Compare commits
1751 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3778e8d5b | |||
| f51a313708 | |||
| 7d9cd8c869 | |||
| 13958c9396 | |||
| 4f9e041a50 | |||
| b609ad750f | |||
| 0d4facd4ae | |||
| 4ab0b31ed8 | |||
| 0355a25b5a | |||
| 1cb78610f7 | |||
| e35720a24a | |||
| 030588b992 | |||
| 5fb12915e5 | |||
| a1f713c721 | |||
| ff9d866550 | |||
| d183bbd05e | |||
| 385536ab73 | |||
| 5c3cfd9cdd | |||
| b4364e13d4 | |||
| 418bd90037 | |||
| 0a3bcd2737 | |||
| 00c62b13d6 | |||
| a61195010a | |||
| 336da8f061 | |||
| 7b35b4bcc8 | |||
| 1f665561eb | |||
| ede587f2e1 | |||
| 8296f508de | |||
| d4544f11f5 | |||
| 5bf370295d | |||
| d4ff8c99c7 | |||
| 5db809841a | |||
| a7462157c5 | |||
| aa0aeece3c | |||
| 51fffc6e1b | |||
| 62e3e98da4 | |||
| 87d90e391a | |||
| 17f465bff5 | |||
| 5fc99e61d5 | |||
| 1f0d0433bb | |||
| e4698d10a3 | |||
| bfb72bb0a9 | |||
| 14e248bec7 | |||
| dd3eaf4ec9 | |||
| 1ebce293c9 | |||
| 1422deb42b | |||
| 449829ea70 | |||
| 9133558bed | |||
| 6ab60d2e84 | |||
| a738f674cc | |||
| ef21053b3d | |||
| 8ed9774b9a | |||
| d0bee7d666 | |||
| 8c2b963395 | |||
| 999aab206a | |||
| 19f5db6fe7 | |||
| df7f715dd3 | |||
| 46d7fb3ff6 | |||
| 6bc7c62adc | |||
| 9b7e913fbf | |||
| be24ff122b | |||
| a3c267b9be | |||
| aac7384414 | |||
| c063dbbbb3 | |||
| 6d5ed8409c | |||
| 423580c260 | |||
| d43764a526 | |||
| a3df4120e1 | |||
| bbc43a908e | |||
| 7c0f568251 | |||
| 1e44380c2d | |||
| 6dda06016b | |||
| 66fe08f72e | |||
| 31b981e63e | |||
| 24630133cb | |||
| a56f75f3d9 | |||
| 7f65075af2 | |||
| 12c87c820f | |||
| 8723c110b4 | |||
| 5b567fc057 | |||
| fc7c7f1a70 | |||
| c389f6621b | |||
| 01b0c015f6 | |||
| e090078401 | |||
| 14ca8f3427 | |||
| fd3f79a8d5 | |||
| c09d4278c3 | |||
| 6bd9717315 | |||
| 79e36b8711 | |||
| 0683e60bec | |||
| 9dc459ec43 | |||
| c05dd4597d | |||
| 017c13dbdc | |||
| 396ded7ee3 | |||
| 40a6db3af4 | |||
| 12171ef266 | |||
| 4c4d3bc24d | |||
| 6ca949d033 | |||
| 18eaca9135 | |||
| 76e312ed5e | |||
| ffaf3401a2 | |||
| ae4fc0888a | |||
| 9cedd8364c | |||
| 332ac86069 | |||
| 22f598cdac | |||
| d6cba75510 | |||
| 8fc7859cf1 | |||
| 1ad54b241d | |||
| d73f3ed19a | |||
| 07ac7db085 | |||
| 9f1c5666aa | |||
| b26cec42bb | |||
| 34240377e0 | |||
| a26b938d72 | |||
| d2d5cebb29 | |||
| 6c167fd6f0 | |||
| 06cd8656f9 | |||
| b58fff1261 | |||
| a956797ae3 | |||
| 9dc1f2d5f8 | |||
| eef6bb0342 | |||
| ce1982dad1 | |||
| 4957cbfef5 | |||
| f9ff77ea7b | |||
| 6abd888bf3 | |||
| 222440a5e3 | |||
| 7800de54b0 | |||
| ff409321ff | |||
| 8b9265a3c7 | |||
| e9f1471eba | |||
| 7d5c392078 | |||
| ec4e843c52 | |||
| 64315baf3a | |||
| a4ff92d299 | |||
| 8eae895c83 | |||
| 00a3e8b404 | |||
| f592a78b4b | |||
| 106e32c5cc | |||
| 5680f00fd3 | |||
| 1086ae85e5 | |||
| af2a79b43e | |||
| 86c2788454 | |||
| 2b397b7433 | |||
| 55356baea8 | |||
| dab2267e10 | |||
| cc9b222175 | |||
| e19d56c66c | |||
| 2009c00dd0 | |||
| e4b14233b5 | |||
| 039b2e943c | |||
| 5baa5f588d | |||
| f8a2ec0aee | |||
| 447ea6fb39 | |||
| bfb10cd539 | |||
| 224a937825 | |||
| 871df6e913 | |||
| 8d5b178fc2 | |||
| 18d8edce36 | |||
| d96f1f3400 | |||
| 641e7335f7 | |||
| 688cd9f724 | |||
| 7312bd2655 | |||
| add90b3a88 | |||
| 27b0052f06 | |||
| bfcb7dfeac | |||
| 8a49645c14 | |||
| 56d12d88c1 | |||
| 4e10c965a9 | |||
| 40adc23d78 | |||
| 516be9d9d3 | |||
| 260da330c4 | |||
| 56c249326f | |||
| a88cace888 | |||
| 2f2b5e2ebe | |||
| a8a3a7e29a | |||
| 5ab974e140 | |||
| 134cf38617 | |||
| 662b0dacf0 | |||
| 3a4ca2be05 | |||
| c0afcb51f7 | |||
| 6a3f277fde | |||
| 5d2a04467c | |||
| f4e0518cd9 | |||
| 98b23b348e | |||
| 81abf548a3 | |||
| 873871d9f4 | |||
| 0b44e10e0f | |||
| 5764cdee57 | |||
| bbdadf57e7 | |||
| f7af41c81c | |||
| 07444b002c | |||
| 0283096ac7 | |||
| 770f7b3174 | |||
| 34d096e115 | |||
| 414070bde1 | |||
| 862dc273f0 | |||
| b119e5552c | |||
| fc492a7709 | |||
| f4d1389c4d | |||
| 2d8b43fa9b | |||
| 3424c1f2d6 | |||
| 460847b425 | |||
| 590aa0620c | |||
| 390781de7c | |||
| 74b43c478b | |||
| e88dd59c93 | |||
| 2953346b6b | |||
| b32bc91385 | |||
| 7e50b2e466 | |||
| 0e5299e32d | |||
| 7dcbd3ae90 | |||
| 103bfe4b79 | |||
| b0a4de5a14 | |||
| ed7cb82d3b | |||
| 5a9882a069 | |||
| f4659a55ba | |||
| 744b3139b8 | |||
| fa0e4b9964 | |||
| 63bed89a52 | |||
| 95de75ba41 | |||
| 08f97e08c6 | |||
| 878f97a52c | |||
| 11e4278add | |||
| 3ce0eecbb3 | |||
| 8365a8dbaf | |||
| bab4168ac4 | |||
| ac638f2020 | |||
| 85329a67e4 | |||
| 1ae43970b4 | |||
| 9b66a9b971 | |||
| bbf88744cb | |||
| 3b6322181c | |||
| c2c7fabfde | |||
| 0f9df195ad | |||
| 85411d28fc | |||
| 49c455aa27 | |||
| f49a23b635 | |||
| 67cd321400 | |||
| 61c7abf214 | |||
| 8564500151 | |||
| 05f7286eb8 | |||
| 23adad950a | |||
| bbb5cd9fdb | |||
| 6682d0c6d3 | |||
| 70ff6b06ed | |||
| d3b55e8ad6 | |||
| 8bf7a78b77 | |||
| bb761f8cf6 | |||
| 5401ead546 | |||
| ca9f250f64 | |||
| 4a13a65024 | |||
| bef5165f68 | |||
| 51ae30cc27 | |||
| f35148ed2d | |||
| 07c10f1256 | |||
| 88f907abc5 | |||
| 2d7330d1bb | |||
| e8e8daff11 | |||
| 00cac49972 | |||
| ca515a9edb | |||
| 0f99e07d9a | |||
| 33de4e903e | |||
| cc1382e5e2 | |||
| 0c01f66272 | |||
| 22f4c11bd9 | |||
| 5e7ef29083 | |||
| 69b6a98777 | |||
| 1dc10122ea | |||
| e9c4274503 | |||
| 4af46ec8dc | |||
| ed93edf8d9 | |||
| ae833f98d0 | |||
| 6f51fc9da6 | |||
| 9c87dcfba3 | |||
| cd38ecd1ca | |||
| 18ab76718e | |||
| e665f4a176 | |||
| 5a94a0db72 | |||
| 0f867f2f3d | |||
| a7a69d5529 | |||
| 66a0f264d3 | |||
| 2e066f08f6 | |||
| 546aa42f56 | |||
| 3609e2df56 | |||
| 46ccd15924 | |||
| 22dab11ccf | |||
| 70c5714775 | |||
| 7f4567c165 | |||
| 3929ea7845 | |||
| 04abe29c7c | |||
| 59235fcfcb | |||
| 483cc6c190 | |||
| fcf417cf5d | |||
| 4d185f78db | |||
| eb70ec38d7 | |||
| de13291db1 | |||
| 28812997ab | |||
| 65017fc243 | |||
| 167734b755 | |||
| 9a42cac661 | |||
| a2c7e788c5 | |||
| 81835d476d | |||
| e9e717a271 | |||
| a838344e5c | |||
| 744c797e30 | |||
| b5a47a9f57 | |||
| 366bb5c962 | |||
| 4a15c49561 | |||
| 74af80e8be | |||
| 72ecd16046 | |||
| 6d12d57abe | |||
| ddf88e2721 | |||
| 520df52951 | |||
| 9de8cefa79 | |||
| a54e1605ba | |||
| 08a198ae66 | |||
| 501b712163 | |||
| bab05340cf | |||
| 3108b450b3 | |||
| 463e23f15b | |||
| 502582a896 | |||
| fc42b19a2f | |||
| f134619f7d | |||
| 0c17833ab7 | |||
| 54a5a34fe8 | |||
| 67da88ceb0 | |||
| 059ea49f2f | |||
| 218e6a77ba | |||
| 3a69982985 | |||
| 68e3e28557 | |||
| 274303a658 | |||
| cde0824f05 | |||
| 28e92d964a | |||
| 6d0537988f | |||
| 86f4957c8c | |||
| ce58a11e73 | |||
| e20e66d9bb | |||
| fdc47640e2 | |||
| dc94820442 | |||
| 28cd92253e | |||
| 73078f1fc0 | |||
| 6c045cf30b | |||
| 6b41b558dd | |||
| 88881843d6 | |||
| 8cb6539264 | |||
| 2c3eb5e313 | |||
| 7755bf0341 | |||
| d63f6bcaf7 | |||
| bda87be10e | |||
| 5f79e7e428 | |||
| 9ed37ab21b | |||
| eb6ba88f5a | |||
| f4c3610a8c | |||
| 10b54312d8 | |||
| 5751a6a06a | |||
| 60b2a378dd | |||
| 1609b1236d | |||
| fc409adeca | |||
| 88f76bf230 | |||
| 133f5fee0f | |||
| 4bab22f797 | |||
| 2d6933d5ec | |||
| bd463e5422 | |||
| 1ec7eaad0a | |||
| 3db6191284 | |||
| 28419db178 | |||
| 04edf114ae | |||
| 78961a1146 | |||
| c2db7f029c | |||
| 3a7e4c5005 | |||
| de6d9f427c | |||
| dc5e36c543 | |||
| 19914fb26b | |||
| f8059b5295 | |||
| d99752b458 | |||
| 3e37b9c256 | |||
| c98cbbcd12 | |||
| da6524c5ee | |||
| d9fb195443 | |||
| 116b147c51 | |||
| deb08e8f68 | |||
| 7ba457be50 | |||
| 1c1f45251b | |||
| 252384e910 | |||
| 4d474288a3 | |||
| 62ecb99e74 | |||
| a7c1a39c4b | |||
| a1e467aaa0 | |||
| b4dcde3aa8 | |||
| 886431f396 | |||
| 8343e57c1c | |||
| 99ee35f88c | |||
| 8e2bc06623 | |||
| 31820a0520 | |||
| 3f193831e7 | |||
| 4358b20faf | |||
| 3147777713 | |||
| 1ecbd4fc33 | |||
| c57dc13d14 | |||
| fde3267b53 | |||
| f6dcb75b8e | |||
| 5421eb59cb | |||
| 0dd3c710c1 | |||
| a85240d665 | |||
| 873cdd70e9 | |||
| 4fc5427d52 | |||
| be4d9ea09d | |||
| e549224c53 | |||
| 6a1f3d5d96 | |||
| c0e9b196f9 | |||
| 2fdde52fcd | |||
| 6e0eec364c | |||
| 27ee3e3ab4 | |||
| b589cd6289 | |||
| a82e07d191 | |||
| 4ff2a62f6c | |||
| 647693909a | |||
| eac8c0a535 | |||
| 2a667d1d53 | |||
| df2318a45d | |||
| b40b1dadff | |||
| 8dfa324fc6 | |||
| bc83156a65 | |||
| ed506d61a8 | |||
| 8e074aaafc | |||
| 485edb579d | |||
| ba05538920 | |||
| 5ed9bfcee9 | |||
| becad53951 | |||
| 27005f57d5 | |||
| 627d3fcfd6 | |||
| 3cdcb0e203 | |||
| ef0e55bc10 | |||
| dbd452aefd | |||
| dc34596f2d | |||
| ce2e8ac1ca | |||
| 62239aac0e | |||
| df37e17b9d | |||
| 1ec20a71c1 | |||
| 41f78440db | |||
| a1d9e31bac | |||
| 48913c4132 | |||
| da62ac501f | |||
| dfcca38596 | |||
| df573ac99e | |||
| 78b1c118c1 | |||
| 38452ca4d0 | |||
| 74b546a9fa | |||
| 8425024eb9 | |||
| 2ed15a8388 | |||
| ee0b07040e | |||
| 5c25d10622 | |||
| 1964ac207c | |||
| 2a8c566e7e | |||
| c6cf0f915e | |||
| b469bc5906 | |||
| a341c7f4f2 | |||
| 905e3c7871 | |||
| bf7c083590 | |||
| 5707e89ddd | |||
| 208f80f07e | |||
| e3bdffd051 | |||
| bc60135f86 | |||
| 2e1a47dc2a | |||
| 8417aa5aae | |||
| ce29561184 | |||
| e150310715 | |||
| 6840b88337 | |||
| 2a8155c61c | |||
| ae26f4c4d5 | |||
| 170c589067 | |||
| 0f15828093 | |||
| 8f75c8a1e0 | |||
| 17b16e4670 | |||
| 4e4be82875 | |||
| 7000d3bf82 | |||
| 96fa393954 | |||
| ad1506a97b | |||
| 8dadb5346b | |||
| 9886dede73 | |||
| 4d2b387098 | |||
| 84fc2007f5 | |||
| ed1db975ea | |||
| 79e727a149 | |||
| 75999c06d7 | |||
| 004fe01242 | |||
| ad9c2e0818 | |||
| 10d70e7d00 | |||
| 82d11abb2e | |||
| 8b29aa1e9b | |||
| 4110de0e64 | |||
| 50fa9a4dfd | |||
| 4a9aa52f28 | |||
| 80c5c2f5f7 | |||
| 70f84b5dad | |||
| fe71712b18 | |||
| 459837d6f3 | |||
| 9a12963da9 | |||
| aa2542f9c0 | |||
| 37ed485282 | |||
| fb7629530f | |||
| f68e297185 | |||
| 4e6bc9db2f | |||
| b3d48bab49 | |||
| 16c04b5ef7 | |||
| 2e65466184 | |||
| f98b032477 | |||
| 8a9686716c | |||
| 531854dd97 | |||
| 3c7d70328a | |||
| 0e6d9d35d9 | |||
| 5dfb3ae75e | |||
| 930fd7443e | |||
| 19ff2d6f39 | |||
| 26fdac072a | |||
| d8fa6beb83 | |||
| 95be0729cf | |||
| 2325b0ea50 | |||
| 41d4bad0cc | |||
| 9593021ee1 | |||
| a9e42b30e9 | |||
| ba64077182 | |||
| fa5b9eec83 | |||
| 7507f1a857 | |||
| 438090536b | |||
| 0bea656cd2 | |||
| c778a4756f | |||
| e6b0a01165 | |||
| 47274050ed | |||
| f7372000c5 | |||
| 2eed25986d | |||
| 56323a330e | |||
| a6e86089ec | |||
| ce38605c11 | |||
| 1236714c04 | |||
| 2b4fb9fbe2 | |||
| fa898e19cd | |||
| 2c204c8231 | |||
| 8cb67d3e2c | |||
| dea8de4ef0 | |||
| 9ccb7e672f | |||
| 0b7a85daa7 | |||
| 360356b7e4 | |||
| a75ff0187f | |||
| 2003d11f1c | |||
| b82e9d5400 | |||
| a966408570 | |||
| 5d6e86e2ad | |||
| ca0c5c02b0 | |||
| 372f6e6d7b | |||
| f59b8f961e | |||
| 863a30a5ed | |||
| fa33924ec7 | |||
| f93dad845d | |||
| 566dfea9bd | |||
| 6f6257dec3 | |||
| 319160c72f | |||
| 9245d7038c | |||
| 11ede465ac | |||
| 916d462b5b | |||
| 25a0463d2d | |||
| d161866544 | |||
| 763f906244 | |||
| 7f6d77e441 | |||
| d9cc451338 | |||
| 91f5205c4f | |||
| f735597210 | |||
| aced02f2bb | |||
| 51500d4455 | |||
| 405567ac11 | |||
| 1b5543698b | |||
| 609f701f90 | |||
| c3cc3bd7d2 | |||
| 7ab483d469 | |||
| 4318d04707 | |||
| edb080903b | |||
| d54a0389ea | |||
| 02cbd9db6a | |||
| 52d1a399be | |||
| 81a14c1732 | |||
| 21f8eb7e9d | |||
| 3afd10011a | |||
| da2d821e22 | |||
| 99e5576af3 | |||
| dc7fcf0b95 | |||
| a458c78dbe | |||
| c756815ad2 | |||
| 5a2d373edd | |||
| b80cc973fe | |||
| bf0a914471 | |||
| 4e1f04fa04 | |||
| 9275158694 | |||
| 5442cc917b | |||
| 827e1e2b43 | |||
| ce2a278862 | |||
| 62ac99b52e | |||
| c44a355573 | |||
| 0886873f54 | |||
| 01e6c60cf5 | |||
| 2a3c5958ad | |||
| d0db790e5e | |||
| 4e55213ae6 | |||
| 7863bb23b9 | |||
| 51ea69edcd | |||
| 3a4c0799e3 | |||
| 85422d11d3 | |||
| 76ff70b59f | |||
| b6b14d69f7 | |||
| 3edacafcf1 | |||
| 07bbcce093 | |||
| d2ae29544e | |||
| 1abc93bc0f | |||
| bdfa29d31c | |||
| c496bb0606 | |||
| dbff381dc5 | |||
| f2b29505ec | |||
| 170acef7c9 | |||
| 99169b6a45 | |||
| 821a198e92 | |||
| 940543cd38 | |||
| 2817866ad2 | |||
| 996433db81 | |||
| d885807c11 | |||
| 318fc79dfe | |||
| fdb48528f9 | |||
| da0b422dce | |||
| 8700b93ccb | |||
| fe3cbab84f | |||
| d9ef482dc0 | |||
| 04bb6b7835 | |||
| 2cb536469f | |||
| 74779cc525 | |||
| 9b6422b534 | |||
| 9b07493152 | |||
| 3c1e59a69d | |||
| 51a8da252d | |||
| 3aa857edd0 | |||
| 98c136eff7 | |||
| 10e693475f | |||
| 9e3ef837bb | |||
| a61a7228da | |||
| 8dfeb9826e | |||
| 3063126d75 | |||
| fb73547b8f | |||
| fd1d640b40 | |||
| 3393d0f409 | |||
| 711e8894f4 | |||
| 5c9809555b | |||
| e7071e26ea | |||
| 8b228e5291 | |||
| 37a6f83f1b | |||
| bda7fef6db | |||
| 24d67c44ea | |||
| 4bd71c8a62 | |||
| 22582cefc7 | |||
| 7451a8f7cb | |||
| 937d426cbd | |||
| 579e38ee0b | |||
| b2e4ede68a | |||
| cb06202c66 | |||
| aaaee8e694 | |||
| 8d82ee2009 | |||
| 76b1111cf7 | |||
| 2e514565cc | |||
| 0eeb0437db | |||
| dd0d34ba14 | |||
| bbd0541f78 | |||
| 9db80e074a | |||
| cebb1d39d6 | |||
| 850caf741a | |||
| 91ee3e8d46 | |||
| fc2dd028b4 | |||
| fff8f5f67e | |||
| 13999cc65e | |||
| b0cc60ccb2 | |||
| 67e6490136 | |||
| bce5d64f05 | |||
| c4ed923ae1 | |||
| 3bd1e52e49 | |||
| 01cd86f6f6 | |||
| 4c0515ab91 | |||
| fffa39a286 | |||
| 38d865694a | |||
| 8604faa23a | |||
| 9cb8bfb43d | |||
| 04acd54a44 | |||
| 471f68beb9 | |||
| 92ceaa948c | |||
| 41cd128ad5 | |||
| 434baf15c4 | |||
| 52a2df4215 | |||
| ab559f334b | |||
| 47025a3ffc | |||
| e23ff880d8 | |||
| 8c7f702310 | |||
| b494f66e89 | |||
| b66e7cc26f | |||
| 7fae34d38e | |||
| 0cfc484c0e | |||
| beaa59888e | |||
| 8e6b898ca1 | |||
| 9d777f799d | |||
| 9e65cd386b | |||
| 3ef447b714 | |||
| 83dd03d654 | |||
| a5e8c85557 | |||
| 5ec4dd499c | |||
| fcafb4d374 | |||
| 8047fcbd92 | |||
| 5617c1eefa | |||
| 9c3e331162 | |||
| 6bf0418520 | |||
| 25e5f2ef81 | |||
| 315934f8d0 | |||
| b456b630b5 | |||
| 785a814e68 | |||
| 673001ec15 | |||
| bc2dd3dc8b | |||
| b0277ed057 | |||
| ab3114d164 | |||
| 2b8374f418 | |||
| 23c4712bbf | |||
| 3c4a23a3c6 | |||
| 20f69fc294 | |||
| c343a80b1b | |||
| 895bc26f77 | |||
| ae16191e76 | |||
| 8c95e02ceb | |||
| 8e37225eb9 | |||
| d4b2bd2142 | |||
| 1e76e24dd7 | |||
| 946a854efc | |||
| a132d4cdea | |||
| 856317ee4f | |||
| 88f85aef06 | |||
| 4a9c87cc9c | |||
| 7e9435c721 | |||
| ce257527f3 | |||
| abe631b1eb | |||
| d7472c0b07 | |||
| 3a13f07e96 | |||
| 33dfcbe2f4 | |||
| be024051e7 | |||
| d8146bb71c | |||
| f67f0ffb1d | |||
| 2a0445e41e | |||
| 3c27d898de | |||
| 4f8df3b973 | |||
| afc41f082e | |||
| 76937ea566 | |||
| a63bb7f9be | |||
| db1de54314 | |||
| 15378b8f19 | |||
| fa3891192c | |||
| c63be24106 | |||
| d77bfae7aa | |||
| 435d7a79b2 | |||
| 23b373f80c | |||
| 215af55a2e | |||
| c159e02706 | |||
| 1cccbac519 | |||
| f131119ca1 | |||
| d6b67899ff | |||
| db722da7c5 | |||
| 90e7264a40 | |||
| 975568b149 | |||
| 30e1d09584 | |||
| c615a35e14 | |||
| bf0f4cae13 | |||
| d129d6eefd | |||
| 1b7b402c0c | |||
| c0c9b5ae83 | |||
| e05b74b05c | |||
| aca3d01adc | |||
| f8aa77a82d | |||
| bbae10fae1 | |||
| 4e9ac498d0 | |||
| a90f9d4937 | |||
| 51cd77b450 | |||
| 79b5d84221 | |||
| 46a52cad89 | |||
| 2d51e2140b | |||
| 64d4219bfb | |||
| 35207ce6f6 | |||
| 2eb3779a18 | |||
| 51ba359330 | |||
| d0ad644045 | |||
| f9e959be33 | |||
| fcbe4572b8 | |||
| 27314d04cf | |||
| 55a7fbaa2e | |||
| 1f6e7e2c2f | |||
| f51d8e1b6c | |||
| bfeab1402c | |||
| 2d19692038 | |||
| a9dfcdfd68 | |||
| b878dc6736 | |||
| 891109a89d | |||
| 217a41e1d9 | |||
| 507947c4f6 | |||
| 62ea9c2648 | |||
| fac4ff10c3 | |||
| a7179f5b77 | |||
| fe500463fd | |||
| 3f371493c2 | |||
| 6c0c52094a | |||
| b95b66e69e | |||
| 286aa677d0 | |||
| dd17eee876 | |||
| 5c26f16dff | |||
| 348f686084 | |||
| 20122512cb | |||
| 7a135a75c4 | |||
| cc1c121c1f | |||
| 6620cfa2c3 | |||
| 5037dff0d4 | |||
| bb921a0a7f | |||
| a2dc0040b0 | |||
| c50677881f | |||
| 9e9b0ff77d | |||
| 006256bce8 | |||
| 9df46efcd8 | |||
| fb0df7d058 | |||
| 1d7740ef4c | |||
| 513dd347c3 | |||
| d9f51d21f4 | |||
| f8c94315bd | |||
| e14797ecf0 | |||
| 80840602c9 | |||
| 2a64ae3720 | |||
| 742b79f977 | |||
| e5d3810b6e | |||
| eef904e9d4 | |||
| 74f8df3a55 | |||
| 40f496e7fb | |||
| c27392b454 | |||
| 6f9d1795db | |||
| ea6dd2c9c4 | |||
| 661657588e | |||
| 56670fc212 | |||
| 7b19afa96f | |||
| 9e434c49d5 | |||
| 93403e6f9b | |||
| eca81904d2 | |||
| d6cc03bef6 | |||
| f69e6c174e | |||
| 05cfad13ea | |||
| f3d6e0825e | |||
| 03067344c9 | |||
| e4e8efec96 | |||
| 579834587b | |||
| dffdd2d6c5 | |||
| 3043163468 | |||
| ebd44a0c22 | |||
| 6304679582 | |||
| 36ec97c5fb | |||
| cf87849c5b | |||
| 1ee17dddbc | |||
| 5046f77cd9 | |||
| 567dcd74f0 | |||
| 5ca286c171 | |||
| 8d812d5314 | |||
| 38a639cef6 | |||
| 62b64862d8 | |||
| e647c8623b | |||
| 319ad3a6aa | |||
| 28db217a50 | |||
| c80f050038 | |||
| 4394d18b13 | |||
| 62ca755d5b | |||
| b781455b61 | |||
| d8d12f0185 | |||
| 0305a948c8 | |||
| 221b28aafa | |||
| 8c68d1e6d1 | |||
| 52b92604e3 | |||
| 32c9dc95d6 | |||
| 849bf8fab3 | |||
| 5e5c207f1e | |||
| 2ac04e60ae | |||
| e9e9ef45a7 | |||
| c6c0f530c8 | |||
| 3428edcc90 | |||
| 594856565a | |||
| 95462b75e6 | |||
| 0e39aaaf72 | |||
| d732bb836c | |||
| 34a2ed0419 | |||
| 2d8eacd629 | |||
| f18a46a2a1 | |||
| cb5e283d74 | |||
| 6a83b846d5 | |||
| b66096107f | |||
| 5ddc741732 | |||
| 5aed69ff85 | |||
| 4a4478cd2e | |||
| f008e6ad88 | |||
| e41139a397 | |||
| 91e52f82c6 | |||
| 602fcfe4a9 | |||
| e3406e12f8 | |||
| 2a73656865 | |||
| 404b55c87f | |||
| 361fbd83dc | |||
| f608985a54 | |||
| 65ff9dcefa | |||
| 7ee2f911a8 | |||
| 4c2c85fe9f | |||
| 2c591e810d | |||
| d43a49d845 | |||
| a9e64c3603 | |||
| 9dd572c191 | |||
| 8c9e5687f1 | |||
| 36a7d4732f | |||
| 55f0781bc9 | |||
| f0cd4fbe8d | |||
| 62f2a321f2 | |||
| d5c6fade8f | |||
| 5ce8b9bc47 | |||
| bf39981b1b | |||
| 6f46ef23da | |||
| f8203b72f7 | |||
| afedd86fae | |||
| e55b7504c3 | |||
| e9f8b14f8b | |||
| 8854ccd231 | |||
| f2ed441916 | |||
| e4de0da0bb | |||
| 8aeb35c912 | |||
| fac8571c29 | |||
| 5c8e8ebbe5 | |||
| 5ad4df344e | |||
| 5566439e76 | |||
| 271dae71f7 | |||
| 0d1362e476 | |||
| e32da2ba4a | |||
| 1b4834b547 | |||
| c10ff3880b | |||
| a539add020 | |||
| e19684063a | |||
| 4a5f5432dd | |||
| c2d772cfd6 | |||
| 9c0dc91667 | |||
| 22c2846992 | |||
| 7302d1b9af | |||
| fa963041ef | |||
| de43ce71df | |||
| 7717348bf5 | |||
| 8177fb7f3b | |||
| 845e9890bb | |||
| 5d926eeffd | |||
| 382e5a0eef | |||
| 9980d11740 | |||
| 8419513318 | |||
| b5d3922f41 | |||
| f62c4ff3e1 | |||
| b64d200c94 | |||
| d64989baac | |||
| 18a1006d4b | |||
| 3eac23dc39 | |||
| e5006769be | |||
| ea0d7577c8 | |||
| dfa32b805b | |||
| 17d61ef300 | |||
| 25bb624e36 | |||
| 978e9a260c | |||
| ed6811ffce | |||
| a2c16302a4 | |||
| 50978c15c5 | |||
| 06437b2954 | |||
| 59d72f93ce | |||
| b492d43f73 | |||
| 1f76ea106a | |||
| f2751979e6 | |||
| b46b049ba3 | |||
| a690352100 | |||
| 47067b9169 | |||
| 317c4657be | |||
| aa037f28d9 | |||
| da8160f1ff | |||
| ad65a95f3e | |||
| 9c37ba7beb | |||
| b099a8bf2b | |||
| e322fba277 | |||
| 72f58e0b0b | |||
| 82e2d5d809 | |||
| 5e530d12b3 | |||
| 8eef4cd0bd | |||
| 35eb25d46e | |||
| ede1f7ff6f | |||
| 3449118e07 | |||
| a3f712b3dc | |||
| b79c4ea79e | |||
| b22e52ae6f | |||
| 89a855380d | |||
| b84799e845 | |||
| 327a5dcffa | |||
| 88d9691d16 | |||
| 7d8ca6931b | |||
| 82c21b8c56 | |||
| 8a80463476 | |||
| 525d956935 | |||
| 1c053a7d0b | |||
| fdeb15253d | |||
| 98895aad30 | |||
| 1c6f938723 | |||
| 227a565a4e | |||
| aa28af6235 | |||
| 13772429f9 | |||
| 1d72831364 | |||
| fb070d8621 | |||
| 24e97a78af | |||
| 5dc38fffe3 | |||
| 5680c8e580 | |||
| b671ba4e40 | |||
| 3fdca6e51d | |||
| 22c7ec6a39 | |||
| 884d762de8 | |||
| c89381bae5 | |||
| 56a4cf5d26 | |||
| e34ce57a3f | |||
| f53df98f70 | |||
| d5eed897fd | |||
| b6d1c13a5d | |||
| cba90cb283 | |||
| 60fc8c11b6 | |||
| f8ace16258 | |||
| aa4bf2f508 | |||
| 2673ab9b8f | |||
| 1066176b0f | |||
| ed16ed9cc4 | |||
| 1dada04b66 | |||
| 2fd5140e46 | |||
| e130c54e47 | |||
| fb6b158999 | |||
| 0de8acd608 | |||
| ce303b2f4a | |||
| 0b8963b15e | |||
| 6839c02aba | |||
| 52040406a4 | |||
| 874156122d | |||
| c4c7fed727 | |||
| 8354f4d842 | |||
| c53e85b702 | |||
| 35ba4b68b1 | |||
| a26c83bd30 | |||
| e35eb2029d | |||
| a062bda7d0 | |||
| f8e6fd7b2d | |||
| e234180f43 | |||
| df44114903 | |||
| f639e4aab4 | |||
| 11e7b86ce7 | |||
| 4e8ef3185c | |||
| e73b0120cc | |||
| 908b54d14b | |||
| d7eb8eb0a9 | |||
| f57444f1cb | |||
| 440cd6a162 | |||
| 3aaa4b014b | |||
| f1429cd8e0 | |||
| f71cf21a02 | |||
| be20e91314 | |||
| 2fb2590579 | |||
| 9327cffbe6 | |||
| 1c24ef3c45 | |||
| b26187f759 | |||
| f39650bf16 | |||
| 37e6819a57 | |||
| 8032d6ee66 | |||
| 80eb34cea2 | |||
| 7497be4d28 | |||
| 5ecb2f2305 | |||
| e4bb750c1f | |||
| ef7bbea285 | |||
| 343e395652 | |||
| 2f8b9347a4 | |||
| 5173907efd | |||
| 555a529a9b | |||
| 79f7c83c24 | |||
| cf2372d139 | |||
| c234b72d05 | |||
| 1424667ff3 | |||
| 99e87050f3 | |||
| 93d2837dee | |||
| 829567a2c1 | |||
| 74252f787b | |||
| 6c5d53194a | |||
| c751e3e4cd | |||
| 141e8322ec | |||
| 6190c399c5 | |||
| 9ec17f6e68 | |||
| 0ac40ab41f | |||
| 4b9287ef8a | |||
| 31a7f877c9 | |||
| b6824e772a | |||
| bdb8e0ef44 | |||
| 22ec446d16 | |||
| 329458e138 | |||
| a7831d68db | |||
| f6a99f23c9 | |||
| 6306c9da27 | |||
| f705adde02 | |||
| ea122610ef | |||
| fff69c74f4 | |||
| e05a16988f | |||
| 871e9f0be3 | |||
| 47499e9e7d | |||
| 4f5a2ab884 | |||
| 2237de99ed | |||
| 36660505d2 | |||
| 125e2539b6 | |||
| 9ee3da4a59 | |||
| 1f77806017 | |||
| 5254c553b2 | |||
| f584766fc7 | |||
| e22c658ee9 | |||
| a5296ca3c6 | |||
| 50e7b9b7af | |||
| 11ae62cff9 | |||
| 651b1247fb | |||
| 40d705af15 | |||
| a60876f259 | |||
| ace4ae07a8 | |||
| 46cd5eeb87 | |||
| 23b2602f41 | |||
| 056d915d37 | |||
| 500602e8cc | |||
| 04f9eb5c0f | |||
| 2cc432344b | |||
| df56b94135 | |||
| 3dcf40b596 | |||
| 78f8b60f85 | |||
| f865af2cbe | |||
| 544449c499 | |||
| e506a001bf | |||
| 13a1c5ca39 | |||
| aa4ba74e1a | |||
| a3d9ec8a65 | |||
| 9f8a908ff5 | |||
| 0a86153843 | |||
| d4e64d9c2b | |||
| 43f8e13c14 | |||
| 8562bee9c1 | |||
| 4eebdfb39d | |||
| 69b5f2fddf | |||
| 419f133fb1 | |||
| 81e8c8a519 | |||
| 5ead4d8582 | |||
| 6195f5ecc1 | |||
| 3e1825aa54 | |||
| 174cc164c5 | |||
| e620230e44 | |||
| c107a1bc8e | |||
| c2166c8a67 | |||
| adacee2060 | |||
| a5836fdc28 | |||
| b0cf67a97e | |||
| 784ec0f05a | |||
| 0bfb1da97f | |||
| f8d043b75f | |||
| 18ec9006af | |||
| 03039a1c5a | |||
| bb7b37de62 | |||
| 92d17c7a86 | |||
| 1f8b3725c4 | |||
| 1721fd635e | |||
| 2f3664145d | |||
| 1e82290d25 | |||
| 46a5ea1377 | |||
| b2ed6e3e0d | |||
| 18ebb79f20 | |||
| 3e31f33b64 | |||
| 9050cd64b1 | |||
| 4971820f40 | |||
| af4c0c7aab | |||
| 3a6a7540f1 | |||
| 98e352b8e3 | |||
| 1e3f3fe029 | |||
| 69aef74036 | |||
| 8d49b1076b | |||
| 07fe45ec5f | |||
| b5c63e339f | |||
| 4d84ba4c19 | |||
| 749afc103e | |||
| d6639aec3d | |||
| 1454eff428 | |||
| 2d43ecdd05 | |||
| c373642686 | |||
| 46d856ab57 | |||
| e01e0efebd | |||
| d77de08a68 | |||
| e89c920c4e | |||
| 18748b4d6a | |||
| 5cbfcc45a4 | |||
| 7714c5779f | |||
| 906a20738b | |||
| 8164fe4f07 | |||
| 77fae410ad | |||
| 6e754e9d30 | |||
| 5bdea6ed26 | |||
| 9ae66c0fb5 | |||
| 4cb598bcaa | |||
| 36481471a3 | |||
| dd08886f2c | |||
| 76ef4b5948 | |||
| 3152ac1121 | |||
| c813cacb1b | |||
| e13f2913df | |||
| 07728782c8 | |||
| fd3790519a | |||
| eaa247f46d | |||
| ee2a23c19d | |||
| 43598fb6df | |||
| 3ada9f7cf5 | |||
| 10a5e4dc89 | |||
| 50e4850745 | |||
| a92de216ac | |||
| 3f3708f0f1 | |||
| 72c433ce9d | |||
| f123b69521 | |||
| 80369f0e8f | |||
| 8cd67bf31e | |||
| 34ef060e16 | |||
| 1f07f88dce | |||
| 4db5bdd486 | |||
| 05ac0682f0 | |||
| f12c3072b5 | |||
| 35aea83c89 | |||
| cf9b5d05a8 | |||
| d5393be5cb | |||
| 10c9936fa0 | |||
| 7a74d3ac85 | |||
| 39edaff669 | |||
| c5aed5f79b | |||
| 9b07a77e14 | |||
| 380fe5e44d | |||
| 8bd2c120d6 | |||
| 741ef45f3e | |||
| 4103adf75d | |||
| c0e612531d | |||
| 55cb5dce87 | |||
| 12ba27247e | |||
| 1e33e99655 | |||
| 50acd1fd92 | |||
| c3626225aa | |||
| b71a96ed55 | |||
| d2fcd544d8 | |||
| 50997721e2 | |||
| 828372ab29 | |||
| 21ae270c0e | |||
| 1b2efd1121 | |||
| 8d6a7c9495 | |||
| 189becfbb2 | |||
| 5a19e147fd | |||
| 062f93ae38 | |||
| 9861a08150 | |||
| de15d0a5a4 | |||
| 1e77bb3c02 | |||
| adadbe06ad | |||
| 92f2c48de9 | |||
| 1d4fa2a8b0 | |||
| 5493776b9c | |||
| b166b77c3e | |||
| 0ecb978364 | |||
| c8d792d3d8 | |||
| e9663e40e2 | |||
| a7e906dea9 | |||
| 685ab3d101 | |||
| 77564d74a4 | |||
| a0142d65be | |||
| 662bf15562 | |||
| 79b928af56 | |||
| 8c28f4bc48 | |||
| 7a4d6c89a1 | |||
| 38347becca | |||
| 49036dbb40 | |||
| abf36de157 | |||
| 32afbf5a5a | |||
| cba4a02cc1 | |||
| 4062555605 | |||
| 9cb38ce839 | |||
| 905090ef09 | |||
| 62e5820082 | |||
| 2d21e16201 | |||
| 07303f4301 | |||
| 91228f803c | |||
| e5d7e1f7c2 | |||
| 81573537eb | |||
| 7a85328b86 | |||
| fd84c62ff4 | |||
| 13e0b21656 | |||
| 5949be30fa | |||
| 0117c2da68 | |||
| 943f70c599 | |||
| 52a48fc4b1 | |||
| 2712ffabb0 | |||
| fa8c8a7094 | |||
| 5907193571 | |||
| 45abfb872f | |||
| 4d5962b15b | |||
| eea1c3a84c | |||
| deed7fc20f | |||
| 62fca3f8b6 | |||
| 9377e58407 | |||
| 9b53f69038 | |||
| 3680149b52 | |||
| 93faeeafbe | |||
| 2d5d1cb357 | |||
| 2a5364dc8c | |||
| 7f47a4fe10 | |||
| a0cc428228 | |||
| 61985f7d6a | |||
| 3baf64f123 | |||
| 4fd40c154e | |||
| 3c360618b9 | |||
| 1d96731ad5 | |||
| 9d1d31d26a | |||
| 0b52ccfaf1 | |||
| 484566083e | |||
| 0f33dc6113 | |||
| afad17be7e | |||
| 7f3778fc3c | |||
| 0a9dcc5ce6 | |||
| 2f01f139cc | |||
| fb3e615008 | |||
| 5ee76f57cc | |||
| d32484406e | |||
| ce6d0807fa | |||
| cab8f3db71 | |||
| 399a8b2e35 | |||
| 3d4a791940 | |||
| 7373ce2cae | |||
| 5da1e35efe | |||
| fe5b7bee8c | |||
| 2da1134796 | |||
| 83e47d9e35 | |||
| f0c76efaf7 | |||
| 2fe7d856c3 | |||
| a7c1f22b36 | |||
| d92620919b | |||
| 94bb21886b | |||
| 5db98a3fef | |||
| 763c7fbb7d | |||
| b2d1a4ed22 | |||
| e7211065ab | |||
| 68b8b0e38f | |||
| 644c833311 | |||
| 30b1f62e99 | |||
| 03aa787c8e | |||
| 79592d3b00 | |||
| 7ed527a328 | |||
| 3e0766f2bf | |||
| 71e7926045 | |||
| 8c3d47deac | |||
| 197f31d5a1 | |||
| 1a198c35ad | |||
| 2934fc4d23 | |||
| 4ae9585080 | |||
| 161016a02a | |||
| 559bb83864 | |||
| 9a37c3027e | |||
| 6548afcad3 | |||
| ee31c51275 | |||
| 63aadad10c | |||
| 30958a9a65 | |||
| 995183bf22 | |||
| 99fedb081e | |||
| cc934c3ac0 | |||
| c1d789d004 | |||
| 4d945b5d95 | |||
| 28c900e3f7 | |||
| b41ba50b53 | |||
| 2d22c18758 | |||
| 8ce05b3284 | |||
| 6d18820b53 | |||
| 58ed329ac2 | |||
| 2e0858bc0c | |||
| 7c9636c58c | |||
| 9dbd1326da | |||
| 4c82d12c1a | |||
| 972685bc15 | |||
| 00f8b97ee4 | |||
| 0b7bbbbdbd | |||
| 47bc3e896c | |||
| 904249b2dc | |||
| 3700047d2c | |||
| d44e851648 | |||
| 1be75735be | |||
| 7da72240a3 | |||
| 9357c951f1 | |||
| 1afeb9f977 | |||
| 000e55725c | |||
| 38e342b27b | |||
| 3e9064e2e2 | |||
| 2d764e73fd | |||
| f8efcf420a | |||
| cf546a2341 | |||
| 87a4f3526b | |||
| 6b49119af7 | |||
| 4c6314331d | |||
| 55ab067a0c | |||
| 3fc18b1cf7 | |||
| f2f8419da1 | |||
| 365c2f9e34 | |||
| 01fde3db27 | |||
| d743ed9645 | |||
| dd67811638 | |||
| ebe4f6a365 | |||
| b4e816b784 | |||
| 2798fa7ba9 | |||
| ee077a06e6 | |||
| 8f73e9bde0 | |||
| 45d8fca125 | |||
| 2bc6c1e754 | |||
| 39a0feae3b | |||
| ad7da779c7 | |||
| 23cafa84f2 | |||
| a20e5aee3b | |||
| fa3c50df8e | |||
| 81eb9326eb | |||
| 7c71d56383 | |||
| 5109a2d7c1 | |||
| 82cc799afe | |||
| 88bb28e3f1 | |||
| f4fdc233c0 | |||
| 7130e48089 | |||
| ed094f89e8 | |||
| 58f81b193b | |||
| 50122d4ee1 | |||
| f66388c1d3 | |||
| 838190ce80 | |||
| 1bc04db9cd | |||
| 30a68cf170 | |||
| ec8c207631 | |||
| 9337080307 | |||
| 8200164797 | |||
| 7d85d40f68 | |||
| 5d23135b0d | |||
| be6f1587ed | |||
| c184ddd996 | |||
| c903bbcb13 | |||
| 9b008ded21 | |||
| 6f79de6cae | |||
| 711b54c98e | |||
| 6876718d72 | |||
| 4ffb9f69c6 | |||
| b8a6548686 | |||
| 8c010277c9 | |||
| f30e3db1ef | |||
| d675ab1578 | |||
| b6cbde48be | |||
| 1fef79ce80 | |||
| 4f03ae75c5 | |||
| 34850fb73d | |||
| ee05f7f80e | |||
| 83614359aa | |||
| 17a2865070 | |||
| e3866fda45 | |||
| 81ed325830 | |||
| 36e78b9315 | |||
| 6716482ae4 | |||
| 7e758ce7ad | |||
| 63fe996ebc | |||
| 038365e639 | |||
| c3aebfa239 | |||
| e6370ebb2a | |||
| 1e25e368d2 | |||
| 645350a1a2 | |||
| dd927e6761 | |||
| 713b2e2cf5 | |||
| 7a02e57dcf | |||
| 724949b8fc | |||
| 1f5295db9c | |||
| 72ef865c10 | |||
| be0ebe833c | |||
| 57b08fb064 | |||
| 7162ab5399 | |||
| 4eb44837f3 | |||
| 194a635800 | |||
| e4314004a8 | |||
| 74534b74c2 | |||
| 59eb020eb1 | |||
| 1d1a815ef7 | |||
| 4088abaafb | |||
| 9333f3778f | |||
| 070a133cd5 | |||
| 74f4f99280 | |||
| 66848156a8 | |||
| 74dfd64e29 | |||
| ef0b81cd2d | |||
| 09842fe531 | |||
| 3c93699f8f | |||
| a9dd0d0dfb | |||
| 013e6925dc | |||
| 591ccfd25f | |||
| b0bdaf6b65 | |||
| f77e6370cf | |||
| ce70efa31d | |||
| 3a7fe01950 | |||
| 3f39352d95 | |||
| d38c02f847 | |||
| 2dddd76320 | |||
| 391e6a867f | |||
| 1df8b5f5c1 | |||
| 6913c8e7e5 | |||
| aab03a2b9f | |||
| a83c6c8a0c | |||
| b5cdd60367 | |||
| 5453ff5678 | |||
| 7b69fb2f79 | |||
| 19ac5d3038 | |||
| 4b64862cf2 | |||
| f643f0be85 | |||
| 0e0b1792e4 | |||
| f81c31510b | |||
| 5c3bd1faf9 | |||
| 90cf98465b | |||
| 1dd47484d4 | |||
| bd4a85c6a7 | |||
| b6520e2db6 | |||
| 0ea114b219 | |||
| e36f54eda5 | |||
| d983404656 | |||
| 677b50d39c | |||
| e5ae504bae | |||
| ce302aae60 | |||
| b0869fccfc | |||
| 17ab12f7bf | |||
| 816f9ce8a0 | |||
| 5fb41eb32f | |||
| c687e20fff | |||
| c5aa691467 | |||
| a3d7c694ef | |||
| 2c8b51c9d6 | |||
| a518a34055 | |||
| 4d3ca7e82e | |||
| 98c756a6d2 | |||
| 84d5c6c4b0 | |||
| 935458caa4 | |||
| dcec97411e | |||
| 91032483c8 | |||
| 9e40708f7c | |||
| 54902a5a00 | |||
| 927a9b9f38 | |||
| bfdb3a9da7 | |||
| 63269ac35a | |||
| 113deb6b75 | |||
| c48f4a51a6 | |||
| 3cd2f709fc | |||
| d2df4af67d | |||
| 67177aed42 | |||
| 5879ca2fb6 | |||
| 77a7f13507 | |||
| 2a794e2ae3 | |||
| 090f659dca | |||
| ca79fabdc7 | |||
| 693f232f01 | |||
| 8c33914cbb | |||
| a8e594e54c | |||
| 17f7d90dbf | |||
| 7ad3d5d317 | |||
| 3d37b0d397 | |||
| e8fc7c4c89 | |||
| 405fd802d5 | |||
| 5d1e9a1701 | |||
| d09b85ddc4 | |||
| a4aa0eb7c8 | |||
| d105325dd7 | |||
| 1fb9e57c62 | |||
| 576d9d6d9d | |||
| b7f3d1674d | |||
| f7b009a9be | |||
| 2e472700cc | |||
| edbe6fc72e | |||
| 1b728948f4 | |||
| 7434c28820 | |||
| 751027b4ad | |||
| 317890c9f9 | |||
| 65f433438a | |||
| 7167f6a9b7 | |||
| cb47c0fc92 | |||
| 37222c32a4 | |||
| dafb700be2 | |||
| 9d4fbfc3ea | |||
| e96578c857 | |||
| d2ce28f897 | |||
| 7b3e661110 | |||
| 2c6f28e422 | |||
| 1febac7bf9 | |||
| 59b0bca88b | |||
| 9f522beac4 | |||
| 4712383523 | |||
| b8487c90de | |||
| f3bc8cb9a4 | |||
| c0c6a90f65 | |||
| ffd4151029 | |||
| e3b8e91a0a | |||
| 629e09c464 | |||
| 8f36f0e405 | |||
| 7467213bad | |||
| 5b2530ba79 | |||
| d0a7d748c9 | |||
| 790073d4db | |||
| bb9cd3e8f5 | |||
| 83532f84cd | |||
| cfd6d47dfb | |||
| 831cbc0122 | |||
| d0edbacf37 | |||
| 5fcba6e193 | |||
| e5e378b1b0 | |||
| 319b3006f3 | |||
| e14c2e0916 | |||
| 026213fcd5 | |||
| 1116bbb167 | |||
| 99704109eb | |||
| f707035af5 | |||
| 8d6ab5c123 | |||
| 40a391d778 | |||
| 9fe49846c5 | |||
| 88c4c11b56 | |||
| e4b5f98d58 | |||
| 405391033d | |||
| 13fd1f04c0 | |||
| 8d42380abb | |||
| 9e1afe8cb0 | |||
| 90381e369d | |||
| 8fa2c21a47 | |||
| c08b57ad9b | |||
| e31f71f874 | |||
| 206563f433 | |||
| a191543ee3 | |||
| d74af019f8 | |||
| 7ea0c7cb5c | |||
| 38918e157e | |||
| 99d33cbc74 | |||
| a02b0f5d00 | |||
| bd42cbed33 | |||
| 546a680bec | |||
| 7cc411d384 | |||
| 6908509d79 | |||
| b1f44d7101 | |||
| e8e2ff4a94 | |||
| 9d7af18f7b | |||
| 937662eac4 | |||
| 2a277e930c | |||
| c9cc39c139 | |||
| 3623f66927 | |||
| dc58dd4d6f | |||
| 0d5196e8c9 | |||
| 11b18ca760 | |||
| b1fa194a1d | |||
| 3dfe0afd6f | |||
| e82ca116f7 | |||
| 9db563c7c1 | |||
| a9ad37cab9 | |||
| 2d5a5eccd6 | |||
| a5647ed7bc | |||
| 7b1edb58a4 | |||
| ed90015503 | |||
| 6ef4134b2d | |||
| 282a3d00b1 | |||
| 36395862d1 | |||
| 1560fa8bd9 | |||
| 79abc49a6c | |||
| 6c86cada2c | |||
| 3e0135071e | |||
| cdc0147dcb | |||
| 73cd69c63b | |||
| 7e147c71c1 | |||
| c4140f305c | |||
| 07b4be8f45 | |||
| fd9f3ad8be | |||
| b83f95ed1a | |||
| b77d470684 | |||
| ec81b078fe | |||
| 2416dde7bb | |||
| 0af5794cfa | |||
| 1e917da05e | |||
| c82068115f | |||
| 41f14b93df | |||
| df7455e24b | |||
| a5316ef6e3 | |||
| e6391f04c4 | |||
| 571b498a82 | |||
| efc11be7ee | |||
| 19ef43cd7f | |||
| 1861c5e264 | |||
| e040ab9897 | |||
| f2b59df0f6 | |||
| 824059d033 | |||
| 500ca6554d | |||
| b3b35eca5b | |||
| 39118453da | |||
| 9e64801384 | |||
| 6497407788 | |||
| 5a3d2244d8 | |||
| 8115a78df7 | |||
| f597e6412b | |||
| 3df0b12ccb | |||
| f99fc83993 | |||
| bf511767ce | |||
| 9682bf116d | |||
| 6086112cf9 | |||
| 6dacd5a914 | |||
| 2094e87da5 | |||
| 20125474c1 | |||
| 18f327612f | |||
| 6689919a39 | |||
| c7133bb5a0 | |||
| a40dc4c4d2 | |||
| 9840cc7dfc | |||
| 8cd55856e9 | |||
| f4bbaf682c | |||
| db7dd83168 | |||
| 4d71fb31db | |||
| 101293124a | |||
| effcb1610b | |||
| 97b37a5024 | |||
| c79d78664b | |||
| 9c972b0c42 | |||
| 35765394dc | |||
| 219c4e913c | |||
| d3ca801e53 | |||
| 1c2257190a | |||
| f509a7d22b | |||
| 44829cd579 | |||
| 94e749d08e | |||
| 726a03d433 | |||
| d6ef1c011b | |||
| f295f3b888 | |||
| f55e5f862b | |||
| 3c5d9c617a | |||
| 10413bbede | |||
| 91dfb0309e | |||
| 6707f68923 | |||
| 21b80be29a | |||
| c4b19de8eb | |||
| 5351514180 | |||
| 37ec428efc | |||
| 1941d3eb7e | |||
| e3df420f8e | |||
| 87c8b4b153 | |||
| 4149361de8 | |||
| 2fbd68ecb3 | |||
| cedac96cf4 | |||
| 89433127c4 | |||
| c23f1e974a | |||
| 9a83325119 | |||
| a596001338 | |||
| 1127ea412e |
+1
-1
@@ -5,4 +5,4 @@ radio/src/bootloader/.dep/
|
||||
radio/src/bootloader/bootloader_ramBoot*
|
||||
*.lbm
|
||||
*.o
|
||||
/doc
|
||||
/doc/
|
||||
|
||||
+10
-13
@@ -1,11 +1,14 @@
|
||||
Bertrand Songis
|
||||
Romolo Manfredini
|
||||
André Bernet
|
||||
Bertrand Songis (bsongis)
|
||||
André Bernet (kilrah)
|
||||
Michael Blandford
|
||||
Damjan Adamic (projectkk2glider)
|
||||
Franck Aguerre (jivarofad)
|
||||
Romolo Manfredini (romoloman)
|
||||
Martin Hotař (mhotar)
|
||||
|
||||
Rob Thomson
|
||||
Bryan J. Rentoul (aka Gruvin)
|
||||
Cameron Weeks
|
||||
Martin Hotař
|
||||
Bryan J. Rentoul (gruvin)
|
||||
Cameron Weeks (th9xer)
|
||||
Andreas Weitl
|
||||
Kjell Kernen
|
||||
Gabriel Birkus
|
||||
@@ -13,10 +16,4 @@ Jean-Pierre Parisy
|
||||
Karl Szmutny
|
||||
Michal Hlavinka
|
||||
Pat Mackenzie
|
||||
Michael Byrne (logos and official splashes)
|
||||
Severino Anedda (splash screens)
|
||||
Grootwitbaas - 9xforums.com (mac)
|
||||
Adrian Amberg (splash screens)
|
||||
Wallaguest1 - 9xforums.com (splash screens)
|
||||
HC1969 - 9xforums.com (splash screens)
|
||||
|
||||
Michael Byrne
|
||||
|
||||
+327
-24
@@ -1,3 +1,13 @@
|
||||
<a href="http://frsky-rc.com">FrSky (monthly)</a>
|
||||
<a href="http://alofthobbies.com">Aloft Hobbies</a>
|
||||
<a href="http://jonathan.it">Jonathan Modellismo</a>
|
||||
<a href="http://wstech.de">WsTech</a>
|
||||
<a href="http://aviomotive.com">Aviomotive</a>
|
||||
<a href="http://boltrc.com">BoltRC</a>
|
||||
<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>
|
||||
|
||||
Mario Sette
|
||||
Felice Baratto
|
||||
Alessandro Mari
|
||||
@@ -17,8 +27,8 @@ Marc Lucht
|
||||
Michel Baily
|
||||
Zdenek Trojanek
|
||||
Martin Hotar
|
||||
[Devo] Stefan Grundevik
|
||||
[Devo] Fabio Eboli
|
||||
Stefan Grundevik
|
||||
Fabio Eboli
|
||||
Federico Zotti
|
||||
Albin Esbjörnsson
|
||||
Kilian Hüttenhofer
|
||||
@@ -37,7 +47,6 @@ R. Scott Page
|
||||
Johan Cronje
|
||||
Renato Aranghelovici
|
||||
Jeffrey Irvin
|
||||
Aloft Hobbies
|
||||
John Rodgers
|
||||
Kenneth Crump
|
||||
Damjan Adamic
|
||||
@@ -80,7 +89,6 @@ Christian Schulz
|
||||
Gregory J Shepherd
|
||||
Michael Shellim
|
||||
Ming Wang
|
||||
R. Scott Page
|
||||
Bernard Lukaschek
|
||||
Nigel Chippindale
|
||||
Mike Perkins
|
||||
@@ -93,7 +101,6 @@ Heinrich Illig
|
||||
Michael Collins
|
||||
Michael Manning
|
||||
Craig Lorentz
|
||||
Jonathan Modellismo - jonathan.it
|
||||
André Lasseret
|
||||
Felipe Alexandre de Oliveira
|
||||
Brian Harris
|
||||
@@ -121,7 +128,6 @@ Christophe Rodriguez
|
||||
Larisa Filocamo
|
||||
Hartmut Sahm
|
||||
Åke Brodin
|
||||
Aloft Hobbies - www.alofthobbies.com
|
||||
Ted Moss
|
||||
Filippos Tigarakis
|
||||
Chewytm
|
||||
@@ -169,16 +175,13 @@ Willie Swanepoel
|
||||
Satoru Sasaki
|
||||
Tyler Darby
|
||||
Nicholas Crego
|
||||
Keith Hertzog
|
||||
Johan Moelich
|
||||
Timo Esser
|
||||
Dean Church (monthly)
|
||||
Brian Paddock (monthly)
|
||||
Brian Paddock
|
||||
Jean Pierre Parisy
|
||||
Norbert Martsch
|
||||
Jean-Marie Guitard
|
||||
Mike Perkins
|
||||
Tilman Baumann (monthly)
|
||||
Tilman Baumann
|
||||
Fred Larssen
|
||||
Ari Aalto
|
||||
Robert Sams
|
||||
@@ -189,7 +192,7 @@ Paul Robinson
|
||||
Dave Matison
|
||||
Mike Matheny
|
||||
Pino Agostino
|
||||
Graham Boucher (monthly)
|
||||
Graham Boucher
|
||||
Nelson Noura
|
||||
Joel Allamy
|
||||
Philip David Martin
|
||||
@@ -199,8 +202,7 @@ Blake Spilman
|
||||
Timothy Pelletier
|
||||
Glen Roe (ShowMaster)
|
||||
Jan Van Ooteghem
|
||||
David Ankers - Special thanks here to the OpenPilot project!
|
||||
Lawrence Christensen (monthly)
|
||||
Lawrence Christensen
|
||||
Leo Duflou
|
||||
Bruce Wood
|
||||
Arnd Feige
|
||||
@@ -253,13 +255,12 @@ Terry McKinley
|
||||
Марков Алексей
|
||||
Offer Shmuely
|
||||
Ian Lobley
|
||||
Keith Hertzog
|
||||
Stéphane Fortas
|
||||
Peter Mitrik
|
||||
Thomas Majewski
|
||||
ANF King
|
||||
Henrik Hammarström
|
||||
Kenneth Lilja (monthly)
|
||||
Kenneth Lilja
|
||||
R Wells
|
||||
Uwe Jordt
|
||||
Harald Wilczak
|
||||
@@ -272,7 +273,6 @@ Miguel Villalpando
|
||||
Kim Dong Hoon
|
||||
Terry McKinley
|
||||
Walter Bell
|
||||
wsTech - http://wstech.de
|
||||
Clinton Linck
|
||||
Josep Clodas Sola
|
||||
Thierry Martin
|
||||
@@ -306,7 +306,6 @@ Henry Deucker
|
||||
Christian Fuchs
|
||||
Arold Reinders
|
||||
Robert Miller
|
||||
Aviomotive - www.aviomotive.com
|
||||
Mark Gaskievicz
|
||||
Roland Müller
|
||||
Frank Gewalt
|
||||
@@ -320,7 +319,6 @@ Steve Coley
|
||||
Sean Cull
|
||||
Roberto Orsello
|
||||
David Finger
|
||||
FrSky - www.frsky-rc.com (monthly)
|
||||
Jean-Marie Oddo
|
||||
Mike Matheny
|
||||
Glen Roe (Showmaster)
|
||||
@@ -347,7 +345,6 @@ Sven Assmus
|
||||
Markus Eberl
|
||||
Nicholas Field
|
||||
Harald Wilczak
|
||||
Michel Baily
|
||||
John Grepps
|
||||
Anthony Burbidge
|
||||
Sherba Baine
|
||||
@@ -359,7 +356,6 @@ Aaron Stringer
|
||||
Alan J Wasserman
|
||||
Wolfgang Rauser
|
||||
Samuel Cook
|
||||
BoltRC - www.boltrc.com
|
||||
Friedrich Ipolt
|
||||
Barrington Cole
|
||||
Charles Lakins
|
||||
@@ -426,14 +422,11 @@ Markus Wolf
|
||||
Andrew Fazio
|
||||
Stefan Künst
|
||||
Stephen Adams
|
||||
Arold Reinders
|
||||
Tauno Rautakorpi
|
||||
Frank Houvenaghel
|
||||
Aerial Tech Hobbies - www.aerialtechhobbies.com
|
||||
George Neusse
|
||||
Andreja Rusjakovski
|
||||
Axel Stöckle
|
||||
Mike Perkins
|
||||
Erwin Störrle
|
||||
Rodger Hopper
|
||||
Fernando Cesar
|
||||
@@ -467,3 +460,313 @@ Martijn Kruissen
|
||||
Jörgen Norman
|
||||
Nathan Kinney
|
||||
John Godden
|
||||
Larry Roper
|
||||
Mike Frizell
|
||||
Daniel Pospolita
|
||||
Peter Herz
|
||||
Don Mondrik
|
||||
Paul Fram
|
||||
Charles Knight
|
||||
Matthew Adams
|
||||
Kenneth Reed
|
||||
Gary Wild
|
||||
Christof Ramm
|
||||
Bruno Bedard
|
||||
Salih Samim Aydin
|
||||
Alexander Pils
|
||||
Andrew Scerbina
|
||||
Donovan Bodishbaugh
|
||||
Ray Dunn
|
||||
Burt Pickard-Richardson
|
||||
Robert Ferguson
|
||||
CY Enterprise
|
||||
Michel Stathakis Neto
|
||||
Beat Zurflueh
|
||||
Portstate Pty Ltd
|
||||
Jens Hoffmann
|
||||
Ricardo Santos
|
||||
Jean-Francois Le Breton
|
||||
Michael Deasy
|
||||
Anindya Mukerjee
|
||||
Emay Toha
|
||||
Kamco Enterprises
|
||||
Peter Mueller
|
||||
Giovanni Trentini
|
||||
Cecil Porter
|
||||
Robert Canavan
|
||||
Greg Higginbottom
|
||||
Tim Walker
|
||||
Spis Ltd/TurboNote
|
||||
Patricia Cox
|
||||
Matthew Lukes
|
||||
Sabine Witte
|
||||
Phillip Perry
|
||||
Beat Zurflueh
|
||||
Russell Stutzman
|
||||
Dietmar Drees
|
||||
Kenneth Ward
|
||||
Jens Lochmüller
|
||||
Anthony Witham
|
||||
Peter Hauke
|
||||
Arizona Action Photos
|
||||
Francis F Dale
|
||||
Willie Swanepoel
|
||||
Edward Hauser
|
||||
Adilson Oliveira
|
||||
Joseph Ordille
|
||||
Michael Shellim
|
||||
Teddie Holmes
|
||||
Alexandre Rault
|
||||
Eric Albin
|
||||
Lukas Kliment
|
||||
Bernard Philippe
|
||||
Bernard Delpy
|
||||
Didier Klein
|
||||
Arnaldo Guedes
|
||||
Cyberauto Systems
|
||||
John Alsbrooks
|
||||
John Kearney
|
||||
Christopher Borden
|
||||
Marc Virgilio Ricci
|
||||
Frederick Davie
|
||||
Jürgen Enders
|
||||
Terrence Pitts
|
||||
Thomas Sandner
|
||||
Marco Coltorti
|
||||
Harald Wilczak
|
||||
Rodney Lorimor
|
||||
Richard Davis
|
||||
Stephen Palmer
|
||||
Michael Napolitan
|
||||
Joshua Bardwell
|
||||
Fred Dawson
|
||||
Jim Wagner
|
||||
Peter Johnson
|
||||
Fredrik Lewerth
|
||||
Arvin Stenersen
|
||||
Daniel Morgan
|
||||
Roy Nixon
|
||||
Joachim Blunck
|
||||
Karl-Heinz Gansel
|
||||
Monrovia Mountain Enterprises
|
||||
Alessandro Villa
|
||||
Jan-Åke Nilsson
|
||||
Matthias Rei
|
||||
DVR Solutions BV
|
||||
Bertrand Condevaux Lanloy
|
||||
Henri Mirra
|
||||
Aurélien Planiol
|
||||
Kevin Caldwell
|
||||
Andrew Garello
|
||||
Tomasz Maziarz
|
||||
Russell Flack
|
||||
Fernando Rimoldi
|
||||
Greg Reid
|
||||
Dietmar Drees
|
||||
Holger Landwehr
|
||||
Arno Loehdorf
|
||||
Boon Sripattha
|
||||
Patrik Åkerfeldt
|
||||
Alonzo Fretwell
|
||||
Renjith Chandrasekharan
|
||||
Ruben Gomez Hernandez
|
||||
Michael Gardner
|
||||
Judith Green
|
||||
Timo Ruppell
|
||||
John Lipscomb
|
||||
Norbert Wenke
|
||||
Erik Frieberg
|
||||
Raimo Ruotsalainen
|
||||
Brian Harris
|
||||
Sebastian Blüml
|
||||
Efisio Maxia
|
||||
Jeff Theobald
|
||||
Anthony Rizzo
|
||||
Rodney Huddleston
|
||||
Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini
|
||||
Harald Gabler
|
||||
Michael Brown
|
||||
Julien Gérard
|
||||
Alexandre d'Alton
|
||||
Peter Mergaerts
|
||||
Jan Houwers
|
||||
Gordon Stahl
|
||||
Christian Grandjean
|
||||
Roger Bergevin
|
||||
NorthSide
|
||||
Sigmund Martinsen
|
||||
Lionel Lafraise
|
||||
Gisli Ofeigsson
|
||||
The Gruvin9x Project
|
||||
Manuel McLure
|
||||
Fernando Rimoldi
|
||||
Hiltenkamp Stephan
|
||||
Sandeep Kishore Jain
|
||||
Greg Parker
|
||||
Norman Maaß
|
||||
Adriano Del Ben
|
||||
Justin Poole
|
||||
Kenneth Harrison
|
||||
Eugene LaFaille
|
||||
John O'Shaughnessy
|
||||
Uwe Jordt
|
||||
Stuart Olson
|
||||
Frédéric Devillard
|
||||
Cheung Leo
|
||||
Peter Webster
|
||||
Jean-Claude Bachetta
|
||||
Delfin Perena
|
||||
Sae-wook Yoon
|
||||
Focus on Excellence
|
||||
Jeffery Golias
|
||||
Nick Milton
|
||||
Paul Zasso
|
||||
Reidar Johannes Lillebotn
|
||||
Handley William
|
||||
Luke Williams
|
||||
Michael Shellim
|
||||
Brian Spearing
|
||||
Derek Foster
|
||||
Pasi Pitkänen
|
||||
Lexington S Morley
|
||||
Jeff Roberson
|
||||
Volkov Victor
|
||||
Bryan Anderson
|
||||
Daniel Garber
|
||||
Pavel Stein
|
||||
Ravi Gupta
|
||||
Patrick Tuxbury
|
||||
Mark Deverell
|
||||
John Capell
|
||||
Neil McVean
|
||||
Matthew Elyash
|
||||
Kerry Cochrell
|
||||
Willem Aandewiel
|
||||
Reg Bell
|
||||
Jean Chenoz
|
||||
Philippe Grand
|
||||
Tauno Rautakorpi
|
||||
Jeff Dillingham
|
||||
Brad Kelley
|
||||
Shaun Currier
|
||||
Danilo Schiara
|
||||
John Hennig
|
||||
RK Custom Homes
|
||||
James Houck
|
||||
Piet Teekens
|
||||
Tommy Widenflycht
|
||||
Johan Petrus Theophilus
|
||||
Maria van Melis
|
||||
Ralph Gustafson
|
||||
Paul Luby
|
||||
Andrew Duncan
|
||||
Stephen Crowther
|
||||
Edward Glover
|
||||
Kelly Byrd
|
||||
Brad Curtis
|
||||
Wolfgang Kuhl
|
||||
John Beidl
|
||||
Roy Nixon
|
||||
Glen Roe
|
||||
CY Enterprise
|
||||
Evening Shade Pottery
|
||||
Gilles Dando
|
||||
Patrick Richard
|
||||
Justin Altemeier
|
||||
Constant Dupuis
|
||||
Tony Kenward
|
||||
Pierre Rondel
|
||||
Ernest Luguera Sanchez
|
||||
Adam Brackney
|
||||
Joe Baker
|
||||
单 雷平
|
||||
Ben Fay
|
||||
Chris Monk
|
||||
Stan von Miller
|
||||
Christian Krebs
|
||||
Michel Motte
|
||||
Graziano Rampinelli
|
||||
Joe Baker
|
||||
Jean-Philippe Laurent
|
||||
Romain Rouzaud
|
||||
Michel Garbarino
|
||||
Henri Mirra
|
||||
Otto Fröhlich
|
||||
Thomas Cramer
|
||||
Anthony Trombetta
|
||||
Fernando Rimoldi
|
||||
Dietmar Drees
|
||||
Michal Kowalski
|
||||
Ivan Correa
|
||||
Modellbau
|
||||
Massimo Luigi Stara
|
||||
Graham Baldwin
|
||||
Tomasz Rejman
|
||||
Wolfgang Lang
|
||||
John Greenwood
|
||||
Till von Reumont
|
||||
Paul Pereira Brunner
|
||||
Donald L Singer
|
||||
Junsun Lee
|
||||
Guy Lamaison
|
||||
Erwin Dulken
|
||||
Mike H Dailey
|
||||
Jon Cammarata
|
||||
Martin Krueger
|
||||
Adolfo Perogio
|
||||
Sylvain Techer
|
||||
Wes Warner
|
||||
Kevin Caldwell
|
||||
Ali Ersan Gur
|
||||
Hans-Rudolf Riniker
|
||||
Sébastien Boutard
|
||||
Jean Chessé
|
||||
Mike H Dailey
|
||||
Don Polk
|
||||
Roberto Orsello
|
||||
Borovikov Dmitriy
|
||||
John Lipscomb
|
||||
Peter Glassey
|
||||
Joseph Kramer
|
||||
F.Javier Martinez Velasco
|
||||
Claudio Piccinini
|
||||
John Jackson
|
||||
John Beech
|
||||
Rene TraaJohn Jackson
|
||||
Sebastien Charpentier (monthly)
|
||||
Nigel Hendriks
|
||||
Frédéric Devillard
|
||||
Albert Herzog
|
||||
Anindya Mukerjee
|
||||
Kenny Stanberry
|
||||
Tauno Rautakorpi
|
||||
Mathias Krapp
|
||||
Fernando Rimoldi
|
||||
Wolfgang Rauser
|
||||
Richard Shagam
|
||||
Stephen Bailey
|
||||
DK-System
|
||||
Casa Kuxtal
|
||||
Christopher Potts
|
||||
Douglas George
|
||||
Michael Banks
|
||||
Jon Wiltshire
|
||||
David Green
|
||||
Guy Willems
|
||||
Xavier Mestelan Pinon
|
||||
Maik Gottschalk
|
||||
Scott Sparks
|
||||
John Dunning
|
||||
RAD51
|
||||
Ron Powell
|
||||
Alain Labonne
|
||||
Carol Sills
|
||||
Franck Aßmann
|
||||
|
||||
+148
-1
@@ -1,3 +1,150 @@
|
||||
<h2>Version 2.1.0 / 2015-07-16</h2>
|
||||
<ul>
|
||||
<li>SD card synchronizaton tool</li>
|
||||
<li>Added session duraton information in Log Viewer</li>
|
||||
<li>Enabled <i>Mixers monitor</i> in Taranis simulator</li>
|
||||
<li>Better support for multi-axes in Log Viewer (<a href=https://github.com/opentx/opentx/issues/2267>#2267</a>)</li>
|
||||
<li>File path issue in Taranis simulator function <i>findTrueFileName()</i> on Windows (<a href=https://github.com/opentx/opentx/issues/2301>#2301</a>)</li>
|
||||
<li>Added simulator volume gain setting (<a href=https://github.com/opentx/opentx/issues/2260>#2260</a>)</li>
|
||||
<li>Added GPS glitch filtering and Latitude/Longitude position synchronization to Google Earth export (<a href=https://github.com/opentx/opentx/issues/2326>#2326</a>)</li>
|
||||
<li>Fixed a rare program crash when editing Input for 9X radio (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
|
||||
<li>Fixed missing RSSI audio warnings if simulator was started multiple times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.0.17 / 2015-05-04</h2>
|
||||
<ul>
|
||||
<li>Simulator crash (<a href=https://github.com/opentx/opentx/issues/2253>#2253</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.0.16 / 2015-05-03</h2>
|
||||
<ul>
|
||||
<li><i>nooverridech</i> firmware option was not working</li>
|
||||
<li>Fixed setting Expo from gvars for 9XR-Pro (<a href=https://github.com/opentx/opentx/issues/2040>#2040</a>)</li>
|
||||
<li>Added Mixers Monitor screen option <i>mixersmon</i> (<a href=https://github.com/opentx/opentx/issues/1945>#1945</a>)</li>
|
||||
<li>Added audio playing in simulator (<a href=https://github.com/opentx/opentx/issues/457>#457</a>)</li>
|
||||
<li>Fixed sorting of audio tracks (<a href=https://github.com/opentx/opentx/issues/2002>#2002</a>)</li>
|
||||
<li>Model wizard fixes (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
|
||||
<li>GVAR names removed for 9x, radio doesn't support them (<a href=https://github.com/opentx/opentx/issues/2150>#2150</a>)</li>
|
||||
<li>Some LS sources didn't follow the Imperial units setting (<a href=https://github.com/opentx/opentx/issues/2180>#2180</a>)</li>
|
||||
<li>Added more fields to the telemetry simulator (<a href=https://github.com/opentx/opentx/issues/2171>#2171</a>)</li>
|
||||
<li>Log viewer improvements and massive speed increase (<a href=https://github.com/opentx/opentx/issues/1863>#1863</a>, <a href=https://github.com/opentx/opentx/issues/2163>#2163</a>)</li>
|
||||
<li>Added Battery meter range setting (<a href=https://github.com/opentx/opentx/issues/2195>#2195</a>)</li>
|
||||
<li>Improvements in Print and Compare dialogs (<a href=https://github.com/opentx/opentx/issues/2219>#2219</a>)</li>
|
||||
<li>Reset pots to the middle by right double clicking them in Simulator (<a href=https://github.com/opentx/opentx/issues/1939>#1939</a>)</li>
|
||||
<li>Minor fixes: <a href=https://github.com/opentx/opentx/issues/2153>#2153</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2138>#2138</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2090>#2090</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2122>#2122</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.0.15 / 2015-01-13</h2>
|
||||
<ul>
|
||||
<li>Firmware was not written correctly on radio when compatibility warning check enabled</li>
|
||||
<li>Time format for Special Functions Set Timers</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.14 / 2015-01-12</h2>
|
||||
<ul>
|
||||
<li>OpenTX Companion and Companion9x can now be installed side by side on Linux</li>
|
||||
<li>Improved TAB order in dialogs</li>
|
||||
<li>Special Function <i>Start Logs</i> renamed to more appropriate <i>SD Logs</i></li>
|
||||
<li>Improvements for MAC build</li>
|
||||
<li>Fixes to Google Earth logs export</li>
|
||||
<li>Firmware compatibility warning check added when flashing new firmware to radio</li>
|
||||
<li>Fixed issue with Telemetry Type setting on 9XR-PRO</li>
|
||||
<li>Added Telemetry simulator</li>
|
||||
<li>Added Trainer simulator</li>
|
||||
<li>Added Debug Output window</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
<li>More reliable method of writing EEPROM.BIN and FIRMWARE.BIN to radio</li>
|
||||
<li>Fixed issue with Edge function INSTANT for V1>2s</li>
|
||||
<li>Fixed buffer overflow in Joystick code</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.13 / 2014-11-20</h2>
|
||||
<ul>
|
||||
<li>Too many curves shown on non ARM boards</li>
|
||||
<li>Fixed vario limits</li>
|
||||
<li>Fixes in compare dialog</li>
|
||||
<li>Fixed receiver number range</li>
|
||||
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
|
||||
<li>Joystick calibration crash after channel assignment</li>
|
||||
<li>Gvar import error for limits</li>
|
||||
<li>Companion shows too many curve types in input/mixer for 9x</li>
|
||||
<li>NOT curves removed from inputs (for non ARM platforms)</li>
|
||||
<li>Companion again builds on OS X (Mac)</li>
|
||||
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
|
||||
<li>Companion didn't take care of PlayScript functions</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.12 / 2014-09-15</h2>
|
||||
<ul>
|
||||
<li>Typos & Translations updated</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
<ul>
|
||||
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
|
||||
<li>Fix issue when a GVAR was used as Offset</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>GVARS allowed in Limits min/max/offset</li>
|
||||
<li>Limits displayed in us when ppmus option selected
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
<ul>
|
||||
<li>Compare dialog bugfixes</li>
|
||||
<li>Curve index correctly resetted when type changed</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.7</h2>
|
||||
<ul>
|
||||
<li>SafetyCH function was missing in simulator</li>
|
||||
<li>EEPROM export warning when exporting logical switches > L12 on 9X128</li>
|
||||
<li>FAS offset was not exported on 9X/9XR boards</li>
|
||||
<li>Trims modes bugfix on non Taranis boards</li>
|
||||
<li>It was impossible to open a backuped model from the Tx</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.6</h2>
|
||||
<ul>
|
||||
<li>Fix Mix curves bug on Sky9x boards</li>
|
||||
<li>Channels 17-32 are displayed in the simulator</li>
|
||||
<li>Backlight simulation bugfix</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.5</h2>
|
||||
<ul>
|
||||
<li>Fix crash on startup</li>
|
||||
<li>Fix version number in simu</li>
|
||||
<li>9XR-Pro now supported on Mac</li>
|
||||
<li>Fix loss of settings in telemetry custom screens</li>
|
||||
<li>Fix 10000% bug when using GVs in mixer weithg or offset</li>
|
||||
<li>Fix Cnsp range in logical switches (up to 30000mAh)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.4</h2>
|
||||
<ul>
|
||||
<li>Sound should be ok on all platforms</li>
|
||||
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.3</h2>
|
||||
<ul>
|
||||
<li>EEPROM import bug on AdjustGVAR function</li>
|
||||
<li>Timers correctly displayed in logical switches tab</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.2</h2>
|
||||
<ul>
|
||||
<li>Mouse scroll wheel behaves differently</li>
|
||||
@@ -169,4 +316,4 @@
|
||||
<li>Try to reduce modeledit window form MAC</li>
|
||||
<li>Wrong init of RF-Module data</li>
|
||||
<li>Read flash from TX didn't worked for Taranis</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
+103
-119
@@ -1,14 +1,22 @@
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "2" )
|
||||
SET( C9X_VERSION_MINOR "1" )
|
||||
SET( C9X_VERSION_REVISION "0" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
|
||||
OPTION(DEBUG_IMPORT "Turns 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)
|
||||
|
||||
MESSAGE( STATUS "Looking for XercesC " )
|
||||
FIND_PACKAGE(XercesC)
|
||||
IF ( XERCESC_FOUND )
|
||||
@@ -33,8 +41,9 @@ IF ( SDL_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
|
||||
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DJOYSTICKS )
|
||||
ADD_DEFINITIONS( -DSIMU_AUDIO )
|
||||
ELSE()
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled" )
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
|
||||
@@ -52,6 +61,14 @@ ELSE()
|
||||
MESSAGE( "PHONON not found!" )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for QT lupdate " )
|
||||
FIND_PACKAGE(Lupdate)
|
||||
if( LUPDATE_FOUND )
|
||||
MESSAGE( "QT lupdate: " ${LUPDATE_EXECUTABLE} )
|
||||
ELSE()
|
||||
MESSAGE( "QT lupdate not found!" )
|
||||
ENDIF()
|
||||
|
||||
ADD_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
|
||||
@@ -73,39 +90,20 @@ set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
COMMAND make lbm
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/sticks_4x1.xbm
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
COMMAND make tra
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
COMMAND make stamp_header
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/Makefile
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/../..
|
||||
${PROJECT_SOURCE_DIR}/shared
|
||||
${SIMU_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${XSD_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(generaledit)
|
||||
add_subdirectory(simulation)
|
||||
add_subdirectory(firmwares/opentx/simulator)
|
||||
add_subdirectory(qcustomplot)
|
||||
|
||||
set(common_SRCS
|
||||
eeprominterface.cpp
|
||||
@@ -114,53 +112,49 @@ set(common_SRCS
|
||||
firmwares/er9x/er9xeeprom.cpp
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/ersky9x/ersky9xeeprom.cpp
|
||||
firmwares/ersky9x/ersky9xinterface.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
firmwares/opentx/opentxeeprom.cpp
|
||||
firmwares/opentx/open9xStockeeprom.cpp
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||
firmwares/opentx/open9xSky9xeeprom.cpp
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
firmwares/opentx/opentxTaranisSimulator.cpp
|
||||
firmwares/opentx/opentxSky9xsimulator.cpp
|
||||
firmwares/opentx/opentxGruvin9xsimulator.cpp
|
||||
firmwares/opentx/opentxM128simulator.cpp
|
||||
firmwares/opentx/opentxM64simulator.cpp
|
||||
file.cpp
|
||||
googleanalytics.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
|
||||
set(common_MOC_HDRS
|
||||
googleanalytics.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp( common_SRCS ${common_MOC_HDRS} )
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
flashinterface.cpp
|
||||
firmwareinterface.cpp
|
||||
converteeprom.cpp
|
||||
# xmlinterface.cpp
|
||||
# ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
helpers.cpp
|
||||
helpers_html.cpp
|
||||
mdichild.cpp
|
||||
generaledit.cpp
|
||||
modelslist.cpp
|
||||
mountlist.cpp
|
||||
avroutputdialog.cpp
|
||||
mountlist.cpp
|
||||
apppreferencesdialog.cpp
|
||||
fwpreferencesdialog.cpp
|
||||
burnconfigdialog.cpp
|
||||
comparedialog.cpp
|
||||
contributorsdialog.cpp
|
||||
releasenotesdialog.cpp
|
||||
releasenotesfirmwaredialog.cpp
|
||||
customizesplashdialog.cpp
|
||||
burndialog.cpp
|
||||
radiointerface.cpp
|
||||
progresswidget.cpp
|
||||
progressdialog.cpp
|
||||
process_copy.cpp
|
||||
process_flash.cpp
|
||||
process_sync.cpp
|
||||
flashfirmwaredialog.cpp
|
||||
flasheepromdialog.cpp
|
||||
printdialog.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
@@ -169,13 +163,11 @@ set(companion_SRCS
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
radionotfound.cpp
|
||||
qcustomplot.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
|
||||
set(companion_MOC_HDRS
|
||||
avroutputdialog.h
|
||||
apppreferencesdialog.h
|
||||
fwpreferencesdialog.h
|
||||
burnconfigdialog.h
|
||||
@@ -184,25 +176,29 @@ set(companion_MOC_HDRS
|
||||
fusesdialog.h
|
||||
logsdialog.h
|
||||
contributorsdialog.h
|
||||
releasenotesdialog.h
|
||||
releasenotesfirmwaredialog.h
|
||||
customizesplashdialog.h
|
||||
splashlibrary.h
|
||||
splashlabel.h
|
||||
burndialog.h
|
||||
progresswidget.h
|
||||
progressdialog.h
|
||||
process_copy.h
|
||||
process_flash.h
|
||||
process_sync.h
|
||||
flashfirmwaredialog.h
|
||||
flasheepromdialog.h
|
||||
downloaddialog.h
|
||||
generaledit.h
|
||||
modelslist.h
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
radionotfound.h
|
||||
qcustomplot.h
|
||||
qautocombobox.h
|
||||
helpers.h
|
||||
wizarddialog.h
|
||||
)
|
||||
|
||||
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
avroutputdialog.ui
|
||||
comparedialog.ui
|
||||
fusesdialog.ui
|
||||
logsdialog.ui
|
||||
@@ -210,12 +206,14 @@ set(companion_UIS
|
||||
fwpreferencesdialog.ui
|
||||
burnconfigdialog.ui
|
||||
downloaddialog.ui
|
||||
generaledit.ui
|
||||
printdialog.ui
|
||||
contributorsdialog.ui
|
||||
htmldialog.ui
|
||||
customizesplashdialog.ui
|
||||
splashlibrary.ui
|
||||
burndialog.ui
|
||||
progresswidget.ui
|
||||
progressdialog.ui
|
||||
flashfirmwaredialog.ui
|
||||
flasheepromdialog.ui
|
||||
radionotfound.ui
|
||||
)
|
||||
|
||||
@@ -255,8 +253,6 @@ NOW(TIME)
|
||||
|
||||
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)
|
||||
|
||||
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR}/../${FIRMWARE} G9X )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
|
||||
IF( WIN32 )
|
||||
@@ -269,7 +265,7 @@ ENDIF( )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
||||
|
||||
SET( LANGUAGES he pl pt ru de fr it sv cs fi nl)
|
||||
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 )
|
||||
@@ -284,47 +280,17 @@ 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( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
target_link_libraries(companion generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(simu_SRCS
|
||||
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
modeledit/node.cpp
|
||||
modeledit/edge.cpp # TODO not needed
|
||||
simulator.cpp
|
||||
@@ -342,18 +308,19 @@ if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
|
||||
if(SDL_FOUND)
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
if(APPLE)
|
||||
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
|
||||
else()
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(simulator simulation common ${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 )
|
||||
@@ -364,7 +331,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
|
||||
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
@@ -373,28 +340,38 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
IF( WIN32 )
|
||||
IF( MSVC )
|
||||
SET( NSI_IN_FILE companion-vs.nsi.in )
|
||||
SET(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
|
||||
SET(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
|
||||
ELSE( )
|
||||
SET( NSI_IN_FILE companion-msys.nsi.in )
|
||||
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/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
|
||||
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)
|
||||
|
||||
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
|
||||
"C:/Program Files/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Programs/NSIS"
|
||||
)
|
||||
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS companion.nsi
|
||||
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
COMMENT "Windows NSIS Installer")
|
||||
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/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_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( )
|
||||
|
||||
@@ -405,13 +382,13 @@ IF( APPLE )
|
||||
ELSE( )
|
||||
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/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
|
||||
@@ -419,7 +396,7 @@ IF( APPLE )
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${PROJECT_NAME} )
|
||||
|
||||
|
||||
|
||||
ADD_CUSTOM_TARGET( makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
@@ -428,12 +405,19 @@ IF( APPLE )
|
||||
ENDIF( )
|
||||
|
||||
ADD_CUSTOM_TARGET( stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
|
||||
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
|
||||
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 echo "Sorry, QT lupdate was not found."
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "COMPANION")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
@@ -447,7 +431,7 @@ if(DPKG_PROGRAM)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-nosp@m-gmail.com>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
|
||||
@@ -458,6 +442,6 @@ else(DPKG_PROGRAM)
|
||||
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif(DPKG_PROGRAM)
|
||||
endif(DPKG_PROGRAM)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
+87
-28
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
@@ -20,7 +20,7 @@ AppData g;
|
||||
// ** CompStoreObj class********************
|
||||
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (tag2.isEmpty())
|
||||
{
|
||||
settings.remove(tag1);
|
||||
@@ -43,7 +43,7 @@ void CompStoreObj::clear (const QString tag1, const QString tag2, const QString
|
||||
|
||||
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -56,7 +56,7 @@ void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QSt
|
||||
|
||||
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -69,7 +69,7 @@ void CompStoreObj::store(const QStringList newSList, QStringList &stringList, co
|
||||
|
||||
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -82,7 +82,7 @@ void CompStoreObj::store(const QString newString, QString &string, const QString
|
||||
|
||||
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -95,7 +95,7 @@ void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, co
|
||||
|
||||
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -109,7 +109,7 @@ void CompStoreObj::store(const int newNumber, int &number, const QString tag, co
|
||||
// Retrieval functions
|
||||
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -121,7 +121,7 @@ void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString
|
||||
|
||||
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -133,7 +133,7 @@ void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const Q
|
||||
|
||||
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -145,7 +145,7 @@ void CompStoreObj::retrieve( QString &string, const QString tag, const QString d
|
||||
|
||||
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -157,7 +157,7 @@ void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, con
|
||||
|
||||
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -241,7 +241,7 @@ JStickData::JStickData()
|
||||
void JStickData::remove()
|
||||
{
|
||||
// Remove all JStickData values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup( "JsCalibration" );
|
||||
settings.remove( QString( "stick%1_axe").arg(index) );
|
||||
settings.remove( QString( "stick%1_min").arg(index) );
|
||||
@@ -256,7 +256,7 @@ void JStickData::remove()
|
||||
|
||||
bool JStickData::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("JsCalibration");
|
||||
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
|
||||
settings.endGroup();
|
||||
@@ -295,8 +295,11 @@ QString Profile::fwName() const { return _fwName; }
|
||||
QString Profile::fwType() const { return _fwType; }
|
||||
QString Profile::name() const { return _name; }
|
||||
QString Profile::sdPath() const { return _sdPath; }
|
||||
int Profile::volumeGain() const { return _volumeGain; }
|
||||
QString Profile::pBackupDir() const { return _pBackupDir; }
|
||||
QString Profile::splashFile() const { return _splashFile; }
|
||||
bool Profile::burnFirmware() const { return _burnFirmware; }
|
||||
bool Profile::penableBackup() const { return _penableBackup; }
|
||||
bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||
int Profile::channelOrder() const { return _channelOrder; }
|
||||
int Profile::defaultMode() const { return _defaultMode; }
|
||||
@@ -314,15 +317,20 @@ int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
int Profile::vBatMin() const { return _vBatMin; }
|
||||
int Profile::vBatMax() const { return _vBatMax; }
|
||||
|
||||
// Set declarations
|
||||
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::volumeGain (const int x) { store(x, _volumeGain, "volumeGain" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::pBackupDir (const QString x) { store(x, _pBackupDir, "pBackupDir" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::penableBackup (const bool x) { store(x, _penableBackup, "penableBackup" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
@@ -339,6 +347,8 @@ void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStic
|
||||
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::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));}
|
||||
|
||||
// Constructor
|
||||
Profile::Profile()
|
||||
@@ -346,16 +356,19 @@ Profile::Profile()
|
||||
index = -1;
|
||||
}
|
||||
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
Profile& Profile::operator=(const Profile& rhs)
|
||||
{
|
||||
name ( rhs.name() );
|
||||
fwName ( rhs.fwName() );
|
||||
fwType ( rhs.fwType() );
|
||||
sdPath ( rhs.sdPath() );
|
||||
volumeGain ( rhs.volumeGain() );
|
||||
pBackupDir ( rhs.pBackupDir() );
|
||||
splashFile ( rhs.splashFile() );
|
||||
burnFirmware ( rhs.burnFirmware() );
|
||||
renameFwFiles( rhs.renameFwFiles() );
|
||||
penableBackup( rhs.penableBackup() );
|
||||
channelOrder ( rhs.channelOrder() );
|
||||
defaultMode ( rhs.defaultMode() );
|
||||
beeper ( rhs.beeper() );
|
||||
@@ -370,6 +383,8 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
vBatMin ( rhs.vBatMin() );
|
||||
vBatMax ( rhs.vBatMax() );
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -377,7 +392,7 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
void Profile::remove()
|
||||
{
|
||||
// Remove all profile values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.remove(QString("profile%1").arg(index));
|
||||
settings.endGroup();
|
||||
@@ -388,7 +403,7 @@ void Profile::remove()
|
||||
|
||||
bool Profile::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.beginGroup(QString("profile%1").arg(index));
|
||||
QStringList keyList = settings.allKeys();
|
||||
@@ -414,6 +429,8 @@ void Profile::initFwVariables()
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_vBatWarn = 0;
|
||||
_vBatMin = 0;
|
||||
_vBatMax = 0;
|
||||
}
|
||||
|
||||
void Profile::init(int newIndex)
|
||||
@@ -424,9 +441,12 @@ void Profile::init(int newIndex)
|
||||
_fwType = "";
|
||||
_name = "";
|
||||
_sdPath = "";
|
||||
_volumeGain = 10;
|
||||
_pBackupDir = "";
|
||||
_splashFile = "";
|
||||
_burnFirmware = false;
|
||||
_renameFwFiles = false;
|
||||
_penableBackup = false;
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
@@ -446,8 +466,11 @@ void Profile::flush()
|
||||
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _volumeGain, "volumeGain" ,10 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _pBackupDir, "pBackupDir" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _penableBackup, "penableBackup" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
|
||||
@@ -465,6 +488,8 @@ void Profile::flush()
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "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));
|
||||
}
|
||||
|
||||
|
||||
@@ -498,8 +523,6 @@ QString AppData::libDir() { return _libDir; }
|
||||
QString AppData::snapshotDir() { return _snapshotDir; }
|
||||
QString AppData::updatesDir() { return _updatesDir; }
|
||||
|
||||
bool AppData::enableBackup() { return _enableBackup; }
|
||||
bool AppData::backupOnFlash() { return _backupOnFlash; }
|
||||
bool AppData::jsSupport() { return _jsSupport; }
|
||||
bool AppData::maximized() { return _maximized; }
|
||||
bool AppData::showSplash() { return _showSplash; }
|
||||
@@ -548,8 +571,6 @@ void AppData::libDir (const QString x) { store(x, _libDir,
|
||||
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
|
||||
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
|
||||
|
||||
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
|
||||
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
|
||||
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
|
||||
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
|
||||
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
|
||||
@@ -581,11 +602,43 @@ AppData::AppData()
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||
joystick[i].init( i );
|
||||
|
||||
// Import settings from companion9x, but only do it one time.
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (profile[0].name().isEmpty() )
|
||||
// Copy existing 2.0.16 settings if present
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings settings20("OpenTX", "Companion 2.0");
|
||||
|
||||
QStringList keys = settings20.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, settings20.value(*i));
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
}
|
||||
|
||||
// Else copy existing <2.0.16 settings if present
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings pre2016settings("OpenTX", "OpenTX Companion");
|
||||
|
||||
QStringList keys = pre2016settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, pre2016settings.value(*i));
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
}
|
||||
|
||||
// Else import settings from companion9x if present
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
// Copy all settings from companion9x to companion
|
||||
QStringList keys = c9x_settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
@@ -629,10 +682,13 @@ AppData::AppData()
|
||||
settings.remove("patchImage");
|
||||
settings.remove("rename_firmware_files");
|
||||
settings.remove("sdPath");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("startup_check_companion9x");
|
||||
settings.remove("wizardEnable");
|
||||
|
||||
// Delete settings that we do not want to carry over from 1.52
|
||||
settings.remove("dfu_location");
|
||||
|
||||
// Select the new default profile as current profile
|
||||
id( 0 );
|
||||
}
|
||||
@@ -641,8 +697,8 @@ AppData::AppData()
|
||||
settings.remove("compilation-server");
|
||||
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
|
||||
getset( _tempString, "settings_version" ,"20" ); // This is a version marker. Will be used to upgrade the settings later on.
|
||||
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
|
||||
getset( _tempString, "settings_version" ,"210" ); // This is a version marker. Will be used to upgrade the settings later on.
|
||||
|
||||
getset( _recentFiles, "recentFileList" ,"" );
|
||||
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
|
||||
@@ -671,8 +727,11 @@ AppData::AppData()
|
||||
getset( _snapshotDir, "snapshotpath" ,"" );
|
||||
getset( _updatesDir, "lastUpdatesDir" ,"" );
|
||||
|
||||
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
|
||||
getset( _enableBackup, "backupEnable" ,false );
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
|
||||
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
getset( _showSplash, "show_splash" ,true );
|
||||
|
||||
+33
-12
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// initialization and storage safe and visible.
|
||||
// Do not access variables in QSettings directly, it is not type safe!
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
|
||||
#define COMPANY "OpenTX Companion"
|
||||
#define PRODUCT "OpenTX"
|
||||
#define COMPANY "OpenTX"
|
||||
#define PRODUCT "Companion 2.1"
|
||||
|
||||
#define MAX_PROFILES 15
|
||||
#define MAX_JOYSTICKS 8
|
||||
@@ -53,7 +53,7 @@ class CompStoreObj
|
||||
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
};
|
||||
};
|
||||
|
||||
class FwRevision: protected CompStoreObj
|
||||
{
|
||||
@@ -107,8 +107,11 @@ class Profile: protected CompStoreObj
|
||||
QString _fwType;
|
||||
QString _name;
|
||||
QString _sdPath;
|
||||
int _volumeGain;
|
||||
QString _pBackupDir;
|
||||
QString _splashFile;
|
||||
bool _burnFirmware;
|
||||
bool _penableBackup;
|
||||
bool _renameFwFiles;
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
@@ -127,6 +130,8 @@ class Profile: protected CompStoreObj
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _vBatWarn;
|
||||
int _vBatMin;
|
||||
int _vBatMax;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
@@ -134,9 +139,12 @@ class Profile: protected CompStoreObj
|
||||
QString fwType() const;
|
||||
QString name() const;
|
||||
QString sdPath() const;
|
||||
int volumeGain() const;
|
||||
QString pBackupDir() const;
|
||||
QString splashFile() const;
|
||||
bool burnFirmware() const;
|
||||
bool renameFwFiles() const;
|
||||
bool penableBackup() const;
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
@@ -153,15 +161,20 @@ class Profile: protected CompStoreObj
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int vBatWarn() const;
|
||||
int vBatMin() const;
|
||||
int vBatMax() const;
|
||||
|
||||
// All the set definitions
|
||||
void name (const QString);
|
||||
void fwName (const QString);
|
||||
void fwType (const QString);
|
||||
void volumeGain (const int);
|
||||
void sdPath (const QString);
|
||||
void pBackupDir (const QString);
|
||||
void splashFile (const QString);
|
||||
void burnFirmware (const bool);
|
||||
void renameFwFiles (const bool);
|
||||
void penableBackup (const bool);
|
||||
void channelOrder (const int);
|
||||
void defaultMode (const int);
|
||||
|
||||
@@ -178,6 +191,8 @@ class Profile: protected CompStoreObj
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void vBatWarn (const int);
|
||||
void vBatMin (const int);
|
||||
void vBatMax (const int);
|
||||
|
||||
Profile();
|
||||
Profile& operator=(const Profile&);
|
||||
@@ -188,8 +203,20 @@ class Profile: protected CompStoreObj
|
||||
void flush();
|
||||
};
|
||||
|
||||
#define BOOL_PROPERTY(name, dflt) \
|
||||
public: \
|
||||
inline bool name() { return _ ## name; } \
|
||||
void name(const bool val) { store(val, _ ## name, # name); } \
|
||||
private: \
|
||||
bool _ ## name;
|
||||
|
||||
class AppData: protected CompStoreObj
|
||||
{
|
||||
BOOL_PROPERTY(enableBackup, false)
|
||||
BOOL_PROPERTY(outputDisplayDetails, false)
|
||||
BOOL_PROPERTY(backupOnFlash, true)
|
||||
BOOL_PROPERTY(checkHardwareCompatibility, true)
|
||||
|
||||
// All the global variables
|
||||
public:
|
||||
Profile profile[MAX_PROFILES];
|
||||
@@ -224,8 +251,6 @@ class AppData: protected CompStoreObj
|
||||
QString _snapshotDir;
|
||||
QString _updatesDir;
|
||||
|
||||
bool _enableBackup;
|
||||
bool _backupOnFlash;
|
||||
bool _maximized;
|
||||
bool _jsSupport;
|
||||
bool _showSplash;
|
||||
@@ -259,7 +284,7 @@ class AppData: protected CompStoreObj
|
||||
QString avrdudeLocation();
|
||||
QString dfuArguments();
|
||||
QString dfuLocation();
|
||||
QString lastFw();
|
||||
QString lastFw();
|
||||
QString locale();
|
||||
QString mcu();
|
||||
QString programmer();
|
||||
@@ -276,8 +301,6 @@ class AppData: protected CompStoreObj
|
||||
QString snapshotDir();
|
||||
QString updatesDir();
|
||||
|
||||
bool enableBackup();
|
||||
bool backupOnFlash();
|
||||
bool jsSupport();
|
||||
bool maximized();
|
||||
bool showSplash();
|
||||
@@ -327,8 +350,6 @@ class AppData: protected CompStoreObj
|
||||
void snapshotDir (const QString);
|
||||
void updatesDir (const QString);
|
||||
|
||||
void enableBackup (const bool);
|
||||
void backupOnFlash (const bool);
|
||||
void maximized (const bool);
|
||||
void jsSupport (const bool);
|
||||
void showSplash (const bool);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "mainwindow.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "flashinterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#ifdef JOYSTICKS
|
||||
#include "joystick.h"
|
||||
#include "joystickdialog.h"
|
||||
@@ -19,10 +19,6 @@ AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
|
||||
updateLock=false;
|
||||
setWindowIcon(CompanionIcon("apppreferences.png"));
|
||||
|
||||
voice=NULL;
|
||||
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
|
||||
initSettings();
|
||||
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||
@@ -52,6 +48,7 @@ void AppPreferencesDialog::writeValues()
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
g.historySize(ui->historySize->value());
|
||||
g.backLight(ui->backLightColor->currentIndex());
|
||||
g.profile[g.id()].volumeGain(round(ui->volumeGain->value() * 10.0));
|
||||
g.libDir(ui->libraryPath->text());
|
||||
g.gePath(ui->ge_lineedit->text());
|
||||
g.embedSplashes(ui->splashincludeCB->currentIndex());
|
||||
@@ -70,6 +67,8 @@ void AppPreferencesDialog::writeValues()
|
||||
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
|
||||
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
|
||||
g.profile[g.id()].sdPath(ui->sdPath->text());
|
||||
g.profile[g.id()].pBackupDir(ui->profilebackupPath->text());
|
||||
g.profile[g.id()].penableBackup(ui->pbackupEnable->isChecked());
|
||||
g.profile[g.id()].splashFile(ui->SplashFileName->text());
|
||||
|
||||
// The profile name may NEVER be empty
|
||||
@@ -80,10 +79,11 @@ void AppPreferencesDialog::writeValues()
|
||||
|
||||
// If a new fw type has been choosen, several things need to reset
|
||||
current_firmware_variant = getFirmwareVariant();
|
||||
if (g.profile[g.id()].fwType() != current_firmware_variant.id) {
|
||||
QString id = current_firmware_variant->getId();
|
||||
if (g.profile[g.id()].fwType() != id) {
|
||||
g.profile[g.id()].fwName("");
|
||||
g.profile[g.id()].initFwVariables();
|
||||
g.profile[g.id()].fwType( current_firmware_variant.id );
|
||||
g.profile[g.id()].fwType(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +103,7 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
|
||||
ui->snapshotPath->setText(g.snapshotDir());
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
if (ui->snapshotClipboardCKB->isChecked())
|
||||
{
|
||||
if (ui->snapshotClipboardCKB->isChecked()) {
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
@@ -113,9 +112,11 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
ui->volumeGain->setValue(g.profile[g.id()].volumeGain() / 10.0);
|
||||
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard()))
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
ui->backLightColor->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->simuSW->setChecked(g.simuSW());
|
||||
ui->modelWizard_CB->setChecked(g.useWizard());
|
||||
@@ -167,6 +168,18 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
|
||||
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
|
||||
ui->sdPath->setText(g.profile[g.id()].sdPath());
|
||||
if (!g.profile[g.id()].pBackupDir().isEmpty()) {
|
||||
if (QDir(g.profile[g.id()].pBackupDir()).exists()) {
|
||||
ui->profilebackupPath->setText(g.profile[g.id()].pBackupDir());
|
||||
ui->pbackupEnable->setEnabled(true);
|
||||
ui->pbackupEnable->setChecked(g.profile[g.id()].penableBackup());
|
||||
} else {
|
||||
ui->pbackupEnable->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->pbackupEnable->setDisabled(true);
|
||||
}
|
||||
|
||||
ui->profileNameLE->setText(g.profile[g.id()].name());
|
||||
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
|
||||
|
||||
@@ -185,17 +198,16 @@ void AppPreferencesDialog::initSettings()
|
||||
}
|
||||
ui->lblGeneralSettings->setText(hwSettings);
|
||||
|
||||
FirmwareInterface * current_firmware = GetCurrentFirmware();
|
||||
Firmware * current_firmware = GetCurrentFirmware();
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
foreach(Firmware * firmware, firmwares) {
|
||||
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
|
||||
if (current_firmware == firmware) {
|
||||
if (current_firmware->getFirmwareBase() == firmware) {
|
||||
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
baseFirmwareChanged();
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_libraryPathButton_clicked()
|
||||
@@ -228,8 +240,17 @@ void AppPreferencesDialog::on_backupPathButton_clicked()
|
||||
if (!fileName.isEmpty()) {
|
||||
g.backupDir(fileName);
|
||||
ui->backupPath->setText(fileName);
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_ProfilebackupPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->profilebackupPath->setText(fileName);
|
||||
ui->pbackupEnable->setEnabled(true);
|
||||
}
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_ge_pathButton_clicked()
|
||||
@@ -333,7 +354,8 @@ void AppPreferencesDialog::on_SplashSelect_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_clearImageButton_clicked() {
|
||||
void AppPreferencesDialog::on_clearImageButton_clicked()
|
||||
{
|
||||
ui->imageLabel->clear();
|
||||
ui->SplashFileName->clear();
|
||||
}
|
||||
@@ -341,65 +363,45 @@ void AppPreferencesDialog::on_clearImageButton_clicked() {
|
||||
|
||||
void AppPreferencesDialog::showVoice(bool show)
|
||||
{
|
||||
if (show)
|
||||
showVoice();
|
||||
else
|
||||
hideVoice();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::showVoice()
|
||||
{
|
||||
ui->voiceLabel->show();
|
||||
ui->voiceCombo->show();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::hideVoice()
|
||||
{
|
||||
ui->voiceLabel->hide();
|
||||
ui->voiceCombo->hide();
|
||||
ui->voiceLabel->setVisible(show);
|
||||
ui->voiceCombo->setVisible(show);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
|
||||
void AppPreferencesDialog::baseFirmwareChanged()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
voice=NULL;
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
|
||||
foreach(Firmware * firmware, firmwares) {
|
||||
if (firmware->getId() == selected_firmware) {
|
||||
showVoice(firmware->voice);
|
||||
populateFirmwareOptions(firmware);
|
||||
break;
|
||||
}
|
||||
}
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
|
||||
Firmware * AppPreferencesDialog::getFirmwareVariant()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
bool voice=false;
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
|
||||
foreach(Firmware * firmware, firmwares) {
|
||||
QString id = firmware->getId();
|
||||
if (id == selected_firmware) {
|
||||
foreach(QCheckBox *cb, optionsCheckBoxes) {
|
||||
if (cb->isChecked()) {
|
||||
if (cb->text()=="voice" && cb->isChecked())
|
||||
voice=true;
|
||||
id += QString("-") + cb->text();
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
if (ui->voiceCombo->count() && (voice || firmware->voice))
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
else {
|
||||
hideVoice();
|
||||
}
|
||||
if (ui->langCombo->count())
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
|
||||
return GetFirmwareVariant(id);
|
||||
if (voice && voice->isChecked()) {
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
|
||||
if (ui->langCombo->count()) {
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
}
|
||||
|
||||
return GetFirmware(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +412,10 @@ FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
|
||||
void AppPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
{
|
||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||
FirmwareInterface * firmware=NULL;
|
||||
if (cb == voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
Firmware * firmware=NULL;
|
||||
if (cb && state) {
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
foreach(firmware, firmwares) {
|
||||
@@ -421,76 +426,40 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
foreach(Option other, opts) {
|
||||
if (other.name != opt.name) {
|
||||
foreach(QCheckBox *ocb, optionsCheckBoxes) {
|
||||
if (ocb->text() == other.name)
|
||||
if (ocb->text() == other.name) {
|
||||
ocb->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
|
||||
return firmwareChanged();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cb && !state) {
|
||||
if (cb->text()=="voice") {
|
||||
hideVoice();
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
else if (firmware) {
|
||||
if (firmware->voice) {
|
||||
showVoice();
|
||||
}
|
||||
}
|
||||
return firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::firmwareLangChanged()
|
||||
void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
|
||||
{
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::firmwareChanged()
|
||||
{
|
||||
if (updateLock)
|
||||
return;
|
||||
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
QString stamp;
|
||||
stamp.append(variant.firmware->getStampUrl());
|
||||
QString url = variant.getFirmwareUrl();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
|
||||
{
|
||||
const FirmwareInterface * parent = /*firmware->parent ? firmware->parent : */ firmware;
|
||||
const Firmware * parent = firmware->getFirmwareBase();
|
||||
|
||||
updateLock = true;
|
||||
|
||||
QString id = current_firmware_variant->getId();
|
||||
ui->langCombo->clear();
|
||||
foreach(const char *lang, parent->languages) {
|
||||
ui->langCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.endsWith(lang))
|
||||
if (id.endsWith(lang)) {
|
||||
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
|
||||
}
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
showVoice(ui->langCombo->count()!=0);
|
||||
voice = NULL; // we will search for a voice checkbox
|
||||
|
||||
int index = 0;
|
||||
QWidget * prevFocus = ui->voiceCombo;
|
||||
foreach(QList<Option> opts, parent->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (index >= optionsCheckBoxes.size()) {
|
||||
@@ -498,6 +467,9 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
|
||||
optionsCheckBoxes.push_back(checkbox);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
|
||||
if (prevFocus) {
|
||||
QWidget::setTabOrder(prevFocus, checkbox);
|
||||
}
|
||||
}
|
||||
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index++);
|
||||
@@ -505,21 +477,31 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
cb->show();
|
||||
cb->setText(opt.name);
|
||||
cb->setToolTip(opt.tooltip);
|
||||
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
if (opt.name==QString("voice")) {
|
||||
voice=cb;
|
||||
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
|
||||
cb->setCheckState(id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
if (opt.name == QString("voice")) {
|
||||
voice = cb;
|
||||
}
|
||||
prevFocus = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (; index<optionsCheckBoxes.size(); index++) {
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index);
|
||||
cb->hide();
|
||||
cb->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (id.contains(QString("-tts%1").arg(lang))) {
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
showVoice(voice && voice->isChecked());
|
||||
|
||||
updateLock = false;
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ class AppPreferencesDialog : public QDialog
|
||||
void showVoice();
|
||||
void hideVoice();
|
||||
void populateLocale();
|
||||
void populateFirmwareOptions(const FirmwareInterface *);
|
||||
FirmwareVariant getFirmwareVariant();
|
||||
void populateFirmwareOptions(const Firmware *);
|
||||
Firmware * getFirmwareVariant();
|
||||
QCheckBox * voice;
|
||||
|
||||
Ui::AppPreferencesDialog *ui;
|
||||
@@ -39,18 +39,17 @@ class AppPreferencesDialog : public QDialog
|
||||
|
||||
protected slots:
|
||||
void shrink();
|
||||
void firmwareLangChanged();
|
||||
void baseFirmwareChanged();
|
||||
void firmwareOptionChanged(bool state);
|
||||
void firmwareChanged();
|
||||
|
||||
void writeValues();
|
||||
void on_libraryPathButton_clicked();
|
||||
void on_snapshotPathButton_clicked();
|
||||
void on_snapshotClipboardCKB_clicked();
|
||||
void on_backupPathButton_clicked();
|
||||
void on_ProfilebackupPathButton_clicked();
|
||||
void on_ge_pathButton_clicked();
|
||||
|
||||
|
||||
void on_sdPathButton_clicked();
|
||||
void on_removeProfileButton_clicked();
|
||||
void on_SplashSelect_clicked();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,507 +0,0 @@
|
||||
#include "avroutputdialog.h"
|
||||
#include "ui_avroutputdialog.h"
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <Windows.h>
|
||||
#include <WinBase.h>
|
||||
#include <tlhelp32.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include "mountlist.h"
|
||||
#endif
|
||||
|
||||
avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour, bool displayDetails) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::avrOutputDialog),
|
||||
kill_timer(NULL),
|
||||
hasErrors(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
#ifdef __APPLE__
|
||||
QFont newFont("Courier", 13);
|
||||
ui->plainTextEdit->setFont(newFont);
|
||||
ui->plainTextEdit->setAttribute(Qt::WA_MacNormalSize);
|
||||
#endif
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
QFont newFont("Courier", 9);
|
||||
ui->plainTextEdit->setFont(newFont);
|
||||
#endif
|
||||
|
||||
cmdLine = prog;
|
||||
closeOpt = closeBehaviour;
|
||||
if (cmdLine.isEmpty()) {
|
||||
if (arg.count()<2) {
|
||||
closeOpt = AVR_DIALOG_FORCE_CLOSE;
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
else {
|
||||
sourceFile=arg.at(0);
|
||||
destFile=arg.at(1);
|
||||
if (!displayDetails) {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
} else {
|
||||
ui->checkBox->setChecked(true);
|
||||
}
|
||||
ui->progressBar->setMaximum(127);
|
||||
QTimer::singleShot(500, this, SLOT(doCopy()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (wTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " " + tr("result"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + wTitle);
|
||||
QFile exec;
|
||||
winTitle=wTitle;
|
||||
if (!(exec.exists(prog))) {
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
|
||||
closeOpt = AVR_DIALOG_FORCE_CLOSE;
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
else {
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
lfuse = 0;
|
||||
hfuse = 0;
|
||||
efuse = 0;
|
||||
phase=0;
|
||||
currLine.clear();
|
||||
if (!displayDetails) {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
else {
|
||||
ui->checkBox->setChecked(true);
|
||||
}
|
||||
process = new QProcess(this);
|
||||
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
|
||||
connect(process,SIGNAL(started()),this,SLOT(doProcessStarted()));
|
||||
connect(process,SIGNAL(readyReadStandardOutput()),this,SLOT(doAddTextStdOut()));
|
||||
connect(process,SIGNAL(finished(int)),this,SLOT(doFinished(int)));
|
||||
|
||||
#if !__GNUC__
|
||||
kill_timer = new QTimer(this);
|
||||
connect(kill_timer, SIGNAL(timeout()), this, SLOT(killTimerElapsed()));
|
||||
kill_timer->start(2000);
|
||||
#endif
|
||||
|
||||
process->start(prog,arg);
|
||||
}
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
|
||||
}
|
||||
|
||||
# if !__GNUC__
|
||||
BOOL KillProcessByName(char *szProcessToKill){
|
||||
HANDLE hProcessSnap;
|
||||
HANDLE hProcess;
|
||||
PROCESSENTRY32 pe32;
|
||||
DWORD dwPriorityClass;
|
||||
|
||||
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes
|
||||
|
||||
if(hProcessSnap == INVALID_HANDLE_VALUE){
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
|
||||
if(!Process32First(hProcessSnap, &pe32)){
|
||||
CloseHandle(hProcessSnap);
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
do{
|
||||
if(!strcmp(pe32.szExeFile,szProcessToKill)){ // checks if process at current position has the name of to be killed app
|
||||
hProcess = OpenProcess(PROCESS_TERMINATE,0, pe32.th32ProcessID); // gets handle to process
|
||||
TerminateProcess(hProcess,0); // Terminate process by handle
|
||||
CloseHandle(hProcess); // close the handle
|
||||
}
|
||||
}while(Process32Next(hProcessSnap,&pe32)); // gets next member of snapshot
|
||||
|
||||
CloseHandle(hProcessSnap); // closes the snapshot handle
|
||||
return( TRUE );
|
||||
}
|
||||
#endif
|
||||
|
||||
void avrOutputDialog::doCopy()
|
||||
{
|
||||
char buf[BLKSIZE];
|
||||
|
||||
QFile source(sourceFile);
|
||||
int blocks = (source.size() + BLKSIZE - 1) / BLKSIZE;
|
||||
ui->progressBar->setMaximum(blocks-1);
|
||||
|
||||
if (source.open(QIODevice::ReadOnly)) {
|
||||
QFile dest(destFile);
|
||||
if (dest.open(QIODevice::WriteOnly)) {
|
||||
for (int i=0; i<blocks; i++) {
|
||||
addText(tr("Writing file: "));
|
||||
int read = source.read(buf, BLKSIZE);
|
||||
if (dest.write(buf, read) == read) {
|
||||
dest.flush();
|
||||
ui->progressBar->setValue(i);
|
||||
if ((i%2) != 0)
|
||||
addText("#");
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Write error"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
dest.close();
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
|
||||
}
|
||||
|
||||
source.close();
|
||||
doFinished(0);
|
||||
}
|
||||
|
||||
void avrOutputDialog::killTimerElapsed()
|
||||
{
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
# if !__GNUC__
|
||||
KillProcessByName("tasklist.exe");
|
||||
#endif
|
||||
}
|
||||
|
||||
avrOutputDialog::~avrOutputDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete kill_timer;
|
||||
}
|
||||
|
||||
void avrOutputDialog::runAgain(QString prog, QStringList arg, int closeBehaviour)
|
||||
{
|
||||
cmdLine = prog;
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
closeOpt = closeBehaviour;
|
||||
currLine.clear();
|
||||
process->start(prog,arg);
|
||||
}
|
||||
|
||||
void avrOutputDialog::waitForFinish()
|
||||
{
|
||||
process->waitForFinished();
|
||||
}
|
||||
|
||||
void avrOutputDialog::addText(const QString &text)
|
||||
{
|
||||
QTextCursor cursor(ui->plainTextEdit->textCursor());
|
||||
|
||||
// is the scrollbar at the end?
|
||||
bool atEnd = (ui->plainTextEdit->verticalScrollBar()->value() == ui->plainTextEdit->verticalScrollBar()->maximum());
|
||||
|
||||
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
||||
cursor.insertText(text);
|
||||
|
||||
if (atEnd) {
|
||||
ui->plainTextEdit->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doAddTextStdOut()
|
||||
{
|
||||
QByteArray data = process->readAllStandardOutput();
|
||||
QString text = QString(data);
|
||||
QString temp;
|
||||
int nlPos, pos, size;
|
||||
|
||||
addText(text);
|
||||
|
||||
currStdLine.append(text);
|
||||
if (currStdLine.contains("size = ")) {
|
||||
pos = currStdLine.lastIndexOf("size = ");
|
||||
temp = currStdLine.mid(pos+7);
|
||||
pos = temp.lastIndexOf("\n");
|
||||
size = temp.left(pos).toInt();
|
||||
ui->progressBar->setMaximum(size/2048);
|
||||
}
|
||||
if (currStdLine.contains("\n")) {
|
||||
nlPos = currStdLine.lastIndexOf("\n");
|
||||
currStdLine = currStdLine.mid(nlPos+1);
|
||||
}
|
||||
if (!currStdLine.isEmpty()) {
|
||||
if (currStdLine.at(0) == QChar('.')) {
|
||||
pos = currStdLine.lastIndexOf(".");
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
else if (currStdLine.startsWith("Starting upload: [")) {
|
||||
pos = (currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("Complete ")) {
|
||||
#if !__GNUC__
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
#endif
|
||||
int start = text.indexOf("Complete ");
|
||||
int end = text.indexOf("%");
|
||||
if (start > 0) {
|
||||
start += 9;
|
||||
int value = text.mid(start, end-start).toInt();
|
||||
ui->progressBar->setValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains(":010000")) {
|
||||
//contains fuse info
|
||||
QStringList stl = text.split(":01000000");
|
||||
foreach (QString t, stl) {
|
||||
bool ok = false;
|
||||
if (!lfuse) lfuse = t.left(2).toInt(&ok,16);
|
||||
if (!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
|
||||
if (!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("-E-")) {
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QString avrOutputDialog::getProgrammer()
|
||||
{
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
return "DFU Util";
|
||||
}
|
||||
else if IS_SKY9X(eepromInterface->getBoard()) {
|
||||
return "SAM-BA";
|
||||
}
|
||||
else {
|
||||
return "AVRDUDE";
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::errorWizard()
|
||||
{
|
||||
QString output=ui->plainTextEdit->toPlainText();
|
||||
if (output.contains("avrdude: Expected signature for")) { // wrong signature
|
||||
int pos=output.indexOf("avrdude: Device signature = ");
|
||||
bool fwexist=false;
|
||||
QString DeviceStr="Unknown";
|
||||
QString FwStr="";
|
||||
|
||||
if (pos>0) {
|
||||
QString DeviceId=output.mid(pos+28,8);
|
||||
if (DeviceId=="0x1e9602") {
|
||||
DeviceStr="Atmega 64";
|
||||
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9702") {
|
||||
DeviceStr="Atmega 128";
|
||||
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9703") {
|
||||
DeviceStr="Atmega 1280";
|
||||
}
|
||||
else if (DeviceId=="0x1e9704") {
|
||||
DeviceStr="Atmega 1281";
|
||||
}
|
||||
else if (DeviceId=="0x1e9801") {
|
||||
DeviceStr="Atmega 2560";
|
||||
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9802") {
|
||||
DeviceStr="Atmega 2561";
|
||||
}
|
||||
}
|
||||
if (fwexist==false) {
|
||||
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
|
||||
}
|
||||
else {
|
||||
FirmwareInterface *firmware = GetCurrentFirmware();
|
||||
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doAddTextStdErr()
|
||||
{
|
||||
int nlPos;
|
||||
int pbvalue;
|
||||
QString avrphase;
|
||||
QByteArray data = process->readAllStandardError();
|
||||
QString text = QString(data);
|
||||
|
||||
currLine.append(text);
|
||||
if (currLine.contains("#")) {
|
||||
avrphase = currLine.left(1).toLower();
|
||||
if (avrphase=="w") {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #ff0000; text-align:center;}:");
|
||||
phase=1;
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Writing"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Writing"));
|
||||
pbvalue=currLine.count("#")*2;
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
else if (avrphase=="r") {
|
||||
if (phase==0) {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #00ff00; text-align:center;}:");
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Reading"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Reading"));
|
||||
}
|
||||
else {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #0000ff; text-align:center;}:");
|
||||
phase=2;
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Verifying"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Verifying"));
|
||||
}
|
||||
pbvalue=currLine.count("#")*2;
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
}
|
||||
|
||||
if (currLine.contains("\n")) {
|
||||
nlPos = currLine.lastIndexOf("\n");
|
||||
currLine = currLine.mid(nlPos+1);
|
||||
}
|
||||
|
||||
if (text.contains("-E-") && !text.contains("-E- No receive file name")) {
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
addText(text);
|
||||
}
|
||||
|
||||
#define HLINE_SEPARATOR "================================================================================="
|
||||
|
||||
void avrOutputDialog::doFinished(int code=0)
|
||||
{
|
||||
addText("\n" HLINE_SEPARATOR);
|
||||
if (code==1 && getProgrammer()=="SAM-BA")
|
||||
code=0;
|
||||
|
||||
if (code) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done - exit code %1").arg(code));
|
||||
}
|
||||
else if (hasErrors) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done with errors"));
|
||||
}
|
||||
else if (!cmdLine.isEmpty()) {
|
||||
addText("\n" + getProgrammer() + " " + tr("done - SUCCESSFUL"));
|
||||
}
|
||||
else {
|
||||
addText(tr("done - SUCCESSFUL"));
|
||||
}
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
|
||||
if(lfuse || hfuse || efuse) {
|
||||
addReadFuses();
|
||||
}
|
||||
|
||||
switch(closeOpt)
|
||||
{
|
||||
case AVR_DIALOG_CLOSE_IF_SUCCESSFUL:
|
||||
if (!hasErrors && !code) accept();
|
||||
if (code) {
|
||||
errorWizard();
|
||||
}
|
||||
break;
|
||||
case AVR_DIALOG_FORCE_CLOSE:
|
||||
if (hasErrors || code)
|
||||
reject();
|
||||
else
|
||||
accept();
|
||||
break;
|
||||
|
||||
case AVR_DIALOG_SHOW_DONE:
|
||||
if (hasErrors || code) {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
if (getProgrammer()!="AVRDUDE") {
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
|
||||
}
|
||||
else {
|
||||
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res != QMessageBox::No) {
|
||||
errorWizard();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
|
||||
}
|
||||
// reject();
|
||||
}
|
||||
else {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
ui->progressBar->setValue(ui->progressBar->maximum());
|
||||
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
|
||||
accept();
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
|
||||
accept();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default: //AVR_DIALOG_KEEP_OPEN
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doProcessStarted()
|
||||
{
|
||||
addText(HLINE_SEPARATOR "\n");
|
||||
addText(tr("Started") + " " + getProgrammer() + "\n");
|
||||
addText(cmdLine);
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
void avrOutputDialog::addReadFuses()
|
||||
{
|
||||
addText(HLINE_SEPARATOR "\n");
|
||||
addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse,2,16,QChar('0')).arg(hfuse,2,16,QChar('0')).arg(efuse,2,16,QChar('0')));
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
void avrOutputDialog::on_checkBox_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->plainTextEdit->show();
|
||||
}
|
||||
else {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void avrOutputDialog::forceClose()
|
||||
{
|
||||
accept();
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
#ifndef AVROUTPUTDIALOG_H
|
||||
#define AVROUTPUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
|
||||
#define AVR_DIALOG_CLOSE_IF_SUCCESSFUL 0x00
|
||||
#define AVR_DIALOG_KEEP_OPEN 0x01
|
||||
#define AVR_DIALOG_FORCE_CLOSE 0x02
|
||||
#define AVR_DIALOG_SHOW_DONE 0x04
|
||||
#define READBUF 65536
|
||||
#define BLKSIZE 512
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class avrOutputDialog;
|
||||
}
|
||||
|
||||
class avrOutputDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL, bool displayDetails=false);
|
||||
~avrOutputDialog();
|
||||
|
||||
void addText(const QString &text);
|
||||
void runAgain(QString prog, QStringList arg, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
|
||||
void waitForFinish();
|
||||
void addReadFuses();
|
||||
|
||||
protected slots:
|
||||
void doAddTextStdOut();
|
||||
void doAddTextStdErr();
|
||||
void doProcessStarted();
|
||||
void doCopy();
|
||||
void doFinished(int code);
|
||||
void on_checkBox_toggled(bool checked);
|
||||
void shrink();
|
||||
void forceClose();
|
||||
void killTimerElapsed();
|
||||
void errorWizard();
|
||||
|
||||
private:
|
||||
QString getProgrammer();
|
||||
Ui::avrOutputDialog *ui;
|
||||
|
||||
QProcess *process;
|
||||
QTimer *kill_timer;
|
||||
QString cmdLine;
|
||||
int closeOpt;
|
||||
quint8 lfuse;
|
||||
quint8 hfuse;
|
||||
quint8 efuse;
|
||||
QString currLine;
|
||||
QString currStdLine;
|
||||
int phase;
|
||||
QString winTitle;
|
||||
bool hasErrors;
|
||||
QString sourceFile;
|
||||
QString destFile;
|
||||
|
||||
};
|
||||
|
||||
#endif // AVROUTPUTDIALOG_H
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "burnconfigdialog.h"
|
||||
#include "ui_burnconfigdialog.h"
|
||||
#include "avroutputdialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
#include "progressdialog.h"
|
||||
#include "process_flash.h"
|
||||
|
||||
#if !defined WIN32 && defined __GNUC__
|
||||
#include <unistd.h>
|
||||
@@ -123,7 +123,7 @@ void burnConfigDialog::getSettings()
|
||||
sambaPort = g.sambaPort();
|
||||
|
||||
ui->avrdude_location->setText(getAVRDUDE());
|
||||
ui->avrArgs->setText(getAVRArgs().join(" "));
|
||||
ui->avrArgs->setText(avrArgs.join(" "));
|
||||
|
||||
ui->samba_location->setText(getSAMBA());
|
||||
ui->samba_port->setText(getSambaPort());
|
||||
@@ -285,120 +285,25 @@ void burnConfigDialog::on_dfuArgs_editingFinished()
|
||||
dfuArgs = ui->dfuArgs->text().split(" ", QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void burnConfigDialog::listProgrammers()
|
||||
void burnConfigDialog::listAvrdudeProgrammers()
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "-c?";
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("list.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
ProgressDialog progressDialog(this, tr("List available programmers"), CompanionIcon("list.png"), true);
|
||||
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-c?", progressDialog.progress());
|
||||
flashProcess.run();
|
||||
}
|
||||
|
||||
// TODO choose better name when no merge in progress....
|
||||
void burnConfigDialog::on_pushButton_3_clicked()
|
||||
{
|
||||
listProgrammers();
|
||||
listAvrdudeProgrammers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO choose better name when no merge in progress....
|
||||
void burnConfigDialog::on_pushButton_4_clicked()
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "-?";
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("configure.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
|
||||
void burnConfigDialog::readFuses()
|
||||
{
|
||||
QStringList args = avrArgs;
|
||||
if(!avrPort.isEmpty()) args << "-P" << avrPort;
|
||||
|
||||
QStringList str;
|
||||
str << "-U" << "lfuse:r:-:i" << "-U" << "hfuse:r:-:i" << "-U" << "efuse:r:-:i";
|
||||
|
||||
QStringList arguments;
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
void burnConfigDialog::restFuses(bool eeProtect)
|
||||
{
|
||||
//fuses
|
||||
//avrdude -c usbasp -p m64 -U lfuse:w:<0x0E>:m
|
||||
//avrdude -c usbasp -p m64 -U hfuse:w:<0x89>:m 0x81 for eeprom protection
|
||||
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
||||
|
||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||
ret = QMessageBox::warning(this, tr("Companion"),
|
||||
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes)
|
||||
{
|
||||
QStringList args = avrArgs;
|
||||
if(!avrPort.isEmpty()) args << "-P" << avrPort;
|
||||
QStringList str;
|
||||
if (avrMCU=="m2560") {
|
||||
args << "-B8";
|
||||
QString erStr = eeProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
|
||||
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
else {
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempFile;
|
||||
QString lfuses;
|
||||
tempFile = tempDir + "/ftemp.bin";
|
||||
QStringList argread;
|
||||
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
QFile file(tempFile);
|
||||
if (file.exists() && file.size()==1) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
char bin_flash[1];
|
||||
file.read(bin_flash, 1);
|
||||
if (bin_flash[0]==0x0E) {
|
||||
lfuses="lfuse:w:0x0E:m";
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
file.close();
|
||||
unlink(tempFile.toAscii());
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
|
||||
QString erStr = eeProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
|
||||
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
QStringList arguments;
|
||||
if (avrMCU=="m2560") {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-u" << str;
|
||||
}
|
||||
else {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
|
||||
}
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
ProgressDialog progressDialog(this, tr("Avrdude help"), CompanionIcon("configure.png"), true);
|
||||
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-?", progressDialog.progress());
|
||||
flashProcess.run();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef BURNCONFIGDIALOG_H
|
||||
#define BURNCONFIGDIALOG_H
|
||||
#ifndef BURNCONFIGDIALOG_H_
|
||||
#define BURNCONFIGDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
QString getAVRDUDE() {return avrLoc;}
|
||||
QString getSAMBA() {return sambaLoc;}
|
||||
QString getDFU() {return dfuLoc;}
|
||||
QStringList getAVRArgs() {return avrArgs;}
|
||||
QStringList getAvrdudeArgs() { QStringList args = avrArgs; if (!avrPort.isEmpty()) args << "-P" << avrPort; return args; }
|
||||
QStringList getDFUArgs() {return dfuArgs;}
|
||||
QString getProgrammer() {return avrProgrammer;}
|
||||
QString getMCU() {return avrMCU;}
|
||||
@@ -31,9 +31,7 @@ public:
|
||||
QString getPort() {return avrPort;}
|
||||
QString getSambaPort() {return sambaPort;}
|
||||
|
||||
void listProgrammers();
|
||||
void restFuses(bool eeProtect);
|
||||
void readFuses();
|
||||
void listAvrdudeProgrammers();
|
||||
|
||||
private:
|
||||
Ui::burnConfigDialog *ui;
|
||||
@@ -73,4 +71,4 @@ private slots:
|
||||
void putSettings();
|
||||
};
|
||||
|
||||
#endif // BURNCONFIGDIALOG_H
|
||||
#endif // BURNCONFIGDIALOG_H_
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>531</width>
|
||||
<height>335</height>
|
||||
<height>422</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -817,6 +817,14 @@ Please only use this if you know what you are doing. There are no error checks
|
||||
<tabstop>avrdude_port</tabstop>
|
||||
<tabstop>avrArgs</tabstop>
|
||||
<tabstop>pushButton_4</tabstop>
|
||||
<tabstop>samba_location</tabstop>
|
||||
<tabstop>sb_browse</tabstop>
|
||||
<tabstop>arm_mcu</tabstop>
|
||||
<tabstop>samba_port</tabstop>
|
||||
<tabstop>dfu_location</tabstop>
|
||||
<tabstop>dfu_browse</tabstop>
|
||||
<tabstop>dfuArgs</tabstop>
|
||||
<tabstop>advCtrChkB</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
@@ -1,620 +0,0 @@
|
||||
#include "burndialog.h"
|
||||
#include "ui_burndialog.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
#include "hexinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
// Type 1 = Burn EEPROM, Type 2= Burn Flash
|
||||
burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName):
|
||||
QDialog(parent),
|
||||
ui(new Ui::burnDialog),
|
||||
hexfileName(fileName),
|
||||
backup(backupEE),
|
||||
hexType(Type)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("write_flash.png"));
|
||||
|
||||
if (!g.profile[g.id()].splashFile().isEmpty()){
|
||||
imageSource=PROFILE;
|
||||
imageFile=g.profile[g.id()].splashFile();
|
||||
}
|
||||
else {
|
||||
ui->useProfileImageCB->setDisabled(true);
|
||||
imageSource=FIRMWARE;
|
||||
imageFile="";
|
||||
}
|
||||
ui->SplashFrame->hide();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->EEbackupCB->hide();
|
||||
ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked);
|
||||
if (Type == FLASH_FILE_TYPE ) {
|
||||
ui->EEpromCB->hide();
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
setWindowTitle(tr("Write firmware to Radio"));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->FlashLoadButton->setText(tr("Browse for file"));
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
ui->EEpromCB->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
if (DocName.isEmpty()) {
|
||||
setWindowTitle(tr("Write Backup to Radio"));
|
||||
}
|
||||
else {
|
||||
setWindowTitle(tr("Write Backup from %1 to Radio").arg(DocName));
|
||||
}
|
||||
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
|
||||
}
|
||||
if (!hexfileName->isEmpty()) {
|
||||
ui->FWFileName->setText(*hexfileName);
|
||||
if (Type==FLASH_FILE_TYPE) {
|
||||
checkFw(*hexfileName);
|
||||
}
|
||||
else {
|
||||
burnraw=false;
|
||||
if (checkeEprom(*hexfileName)) {
|
||||
QString Name = g.profile[g.id()].name();
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
QString HapticSet = g.profile[g.id()].haptic();
|
||||
QString SpeakerSet = g.profile[g.id()].speaker();
|
||||
if (!Name.isEmpty()) {
|
||||
ui->profile_label->show();
|
||||
ui->patchcalib_CB->show();
|
||||
ui->patchhw_CB->show();
|
||||
// TODO I hardcode the number of pots here, should be dependant on the board?
|
||||
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
|
||||
ui->patchcalib_CB->setDisabled(true);
|
||||
}
|
||||
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
|
||||
ui->patchhw_CB->setDisabled(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->profile_label->hide();
|
||||
}
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
ui->FWFileName->hide();
|
||||
ui->FlashLoadButton->hide();
|
||||
hexfileName->clear();
|
||||
}
|
||||
else if (Type==FLASH_FILE_TYPE) {
|
||||
QString FileName = g.profile[g.id()].fwName();
|
||||
QFile file(FileName);
|
||||
if (file.exists()) {
|
||||
checkFw(FileName);
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
burnDialog::~burnDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void burnDialog::on_FlashLoadButton_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if(fileName.isEmpty())
|
||||
return;
|
||||
checkFw(fileName);
|
||||
}
|
||||
else {
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
|
||||
if (checkeEprom(fileName)) {
|
||||
if (burnraw==false) {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->profile_label->show();
|
||||
ui->patchcalib_CB->show();
|
||||
ui->patchhw_CB->show();
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->setChecked(false);
|
||||
ui->patchhw_CB->setChecked(false);
|
||||
ui->patchhw_CB->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::checkFw(QString fileName)
|
||||
{
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEbackupCB->setChecked(false);
|
||||
*backup=false;
|
||||
}
|
||||
ui->FWFileName->setText(fileName);
|
||||
FlashInterface flash(fileName);
|
||||
if (flash.isValid()) {
|
||||
ui->FramFWInfo->show();
|
||||
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
|
||||
ui->versionField->setText(flash.getVersion());
|
||||
ui->ModField->setText(flash.getEEpromId());
|
||||
|
||||
ui->SplashFrame->hide();
|
||||
if (flash.hasSplash()) {
|
||||
ui->SplashFrame->show();
|
||||
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
|
||||
bool burnDialog::checkeEprom(QString fileName)
|
||||
{
|
||||
if (fileName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
QFile file(fileName);
|
||||
if (!file.exists()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
|
||||
return false;
|
||||
}
|
||||
burnraw=false;
|
||||
int fileType = getFileType(fileName);
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
if (!LoadEepromXml(radioData, doc)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
file.reset();
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
QString hline = inputStream.readLine();
|
||||
if (hline!=EEPE_EEPROM_FILE_HEADER) {
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
uint8_t eeprom[EESIZE_RLC_MAX];
|
||||
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
|
||||
if (!eeprom_size) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
file.close();
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
int eeprom_size = file.size();
|
||||
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
uint8_t *eeprom = (uint8_t *)malloc(eeprom_size);
|
||||
memset(eeprom, 0, eeprom_size);
|
||||
long result = file.read((char*)eeprom, eeprom_size);
|
||||
file.close();
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
}
|
||||
}
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
|
||||
void burnDialog::displaySplash()
|
||||
{
|
||||
QImage image;
|
||||
if (imageSource == FIRMWARE){
|
||||
FlashInterface flash(ui->FWFileName->text());
|
||||
image = flash.getSplash();
|
||||
}
|
||||
else {
|
||||
image.load(imageFile);
|
||||
}
|
||||
if (image.isNull()) {
|
||||
return;
|
||||
}
|
||||
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
|
||||
}
|
||||
|
||||
void burnDialog::updateUI()
|
||||
{
|
||||
if (hexType==EEPROM_FILE_TYPE)
|
||||
return;
|
||||
|
||||
ui->useProfileImageCB->setChecked( imageSource == PROFILE );
|
||||
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
|
||||
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
|
||||
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
|
||||
|
||||
displaySplash();
|
||||
}
|
||||
|
||||
void burnDialog::on_useFwImageCB_clicked()
|
||||
{
|
||||
QString fileName = ui->FWFileName->text();
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.isValid()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." ));
|
||||
}
|
||||
else {
|
||||
if (!flash.hasSplash()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
|
||||
}
|
||||
else{
|
||||
imageSource = FIRMWARE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useProfileImageCB_clicked()
|
||||
{
|
||||
QString fileName = g.profile[g.id()].splashFile();
|
||||
if (!fileName.isEmpty()){
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
|
||||
}
|
||||
else {
|
||||
imageSource = PROFILE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useAnotherImageCB_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
|
||||
}
|
||||
else{
|
||||
imageSource = ANOTHER;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useLibraryImageCB_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
|
||||
}
|
||||
else{
|
||||
imageSource = LIBRARY;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_BurnFlashButton_clicked()
|
||||
{
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
QString fileName=ui->FWFileName->text();
|
||||
if (!fileName.isEmpty()) {
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
if (!ui->useFwImageCB->isChecked()) {
|
||||
const QPixmap * pixmap = ui->imageLabel->pixmap();
|
||||
QImage image;
|
||||
if (pixmap) {
|
||||
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
|
||||
}
|
||||
if (!image.isNull()) {
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempFile;
|
||||
if (getFileType(fileName) == FILE_TYPE_HEX)
|
||||
tempFile = tempDir + "/flash.hex";
|
||||
else
|
||||
tempFile = tempDir + "/flash.bin";
|
||||
FlashInterface flash(fileName);
|
||||
flash.setSplash(image);
|
||||
if (flash.saveFlash(tempFile) > 0) {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(tempFile);
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
|
||||
hexfileName->clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (hexType==EEPROM_FILE_TYPE) {
|
||||
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 PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
|
||||
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
|
||||
|
||||
QString DisplaySet= g.profile[g.id()].display();
|
||||
QString BeeperSet= g.profile[g.id()].beeper();
|
||||
QString HapticSet= g.profile[g.id()].haptic();
|
||||
QString SpeakerSet= g.profile[g.id()].speaker();
|
||||
bool patch=false;
|
||||
if (ui->patchcalib_CB->isChecked()) {
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
bool ok;
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibMid[i]=byte16;
|
||||
Byte=calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibSpanNeg[i]=byte16;
|
||||
Byte=calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibSpanPos[i]=byte16;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte=trainercalib.mid(i*4,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
radioData.generalSettings.currentCalib=currentCalib;
|
||||
radioData.generalSettings.vBatCalib=vBatCalib;
|
||||
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
|
||||
patch=true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
|
||||
}
|
||||
}
|
||||
if (ui->patchhw_CB->isChecked()) {
|
||||
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
|
||||
radioData.generalSettings.vBatWarn=vBatWarn;
|
||||
radioData.generalSettings.stickMode=GSStickMode;
|
||||
uint8_t byte8u;
|
||||
int8_t byte8;
|
||||
bool ok;
|
||||
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.contrast=byte8u;
|
||||
|
||||
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.backlightBright=byte8u;
|
||||
|
||||
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.beeperMode=(BeeperMode)byte8u;
|
||||
|
||||
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.beeperLength=byte8;
|
||||
|
||||
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticMode=(BeeperMode)byte8u;
|
||||
|
||||
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticStrength=byte8u;
|
||||
|
||||
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticLength=byte8;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerMode=byte8u;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerPitch=byte8u;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerVolume=byte8u;
|
||||
patch=true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
|
||||
}
|
||||
|
||||
QString fileName;
|
||||
if (patch) {
|
||||
QString tempDir = QDir::tempPath();
|
||||
fileName = tempDir + "/temp.bin";
|
||||
QFile file(fileName);
|
||||
|
||||
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
|
||||
int eeprom_size = 0;
|
||||
|
||||
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant());
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
|
||||
QTextStream outputStream(&file);
|
||||
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if (result!=eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_cancelButton_clicked()
|
||||
{
|
||||
hexfileName->clear();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_EEpromCB_toggled(bool checked)
|
||||
{
|
||||
*backup = ui->EEpromCB->isChecked();
|
||||
}
|
||||
|
||||
void burnDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void burnDialog::on_EEbackupCB_clicked()
|
||||
{
|
||||
*backup = ui->EEbackupCB->isChecked();
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
#ifndef BURNDIALOG_H
|
||||
#define BURNDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
|
||||
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
|
||||
#define EEPROM_FILE_TYPE 1
|
||||
#define FLASH_FILE_TYPE 2
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class burnDialog;
|
||||
}
|
||||
|
||||
class burnDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit burnDialog(QWidget *parent = 0, int Type = 2, QString * fileName = NULL, bool * backupEE=NULL, QString docname="");
|
||||
~burnDialog();
|
||||
|
||||
private slots:
|
||||
void on_FlashLoadButton_clicked();
|
||||
void on_BurnFlashButton_clicked();
|
||||
void on_cancelButton_clicked();
|
||||
void on_EEbackupCB_clicked();
|
||||
void on_EEpromCB_toggled(bool checked);
|
||||
bool checkeEprom(QString fileName);
|
||||
void on_useProfileImageCB_clicked();
|
||||
void on_useFwImageCB_clicked();
|
||||
void on_useLibraryImageCB_clicked();
|
||||
void on_useAnotherImageCB_clicked();
|
||||
|
||||
void checkFw(QString fileName);
|
||||
void displaySplash();
|
||||
void updateUI();
|
||||
void shrink();
|
||||
|
||||
|
||||
private:
|
||||
Ui::burnDialog *ui;
|
||||
QString * hexfileName;
|
||||
bool * backup;
|
||||
int hexType;
|
||||
RadioData radioData;
|
||||
bool burnraw;
|
||||
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, ANOTHER};
|
||||
ImageSource imageSource;
|
||||
QString imageFile;
|
||||
};
|
||||
|
||||
#endif // BURNDIALOG_H
|
||||
@@ -1,379 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>burnDialog</class>
|
||||
<widget class="QDialog" name="burnDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>399</width>
|
||||
<height>564</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Customize Splash</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="hs2">
|
||||
<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>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="BurnFlashButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write to TX</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="patchcalib_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify calibration parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch calibration setting from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="patchhw_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify HW parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch HW setting from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="FramFWInfo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dateLabel">
|
||||
<property name="text">
|
||||
<string>Date & Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="versionField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="buildLabel">
|
||||
<property name="text">
|
||||
<string>Variant</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="ModField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="text">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="DateField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="FWFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="FlashLoadButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse for file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="EEpromCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check Firmware compatibility</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="EEbackupCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup and restore Models and Settings</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="profile_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current Profile</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QFrame" name="SplashFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="SplashLayout" rowstretch="0,0,0,0,0,0,0">
|
||||
<item row="0" column="1" rowspan="7">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>214</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="useFwImageCB">
|
||||
<property name="text">
|
||||
<string>Use firmware start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="useAnotherImageCB">
|
||||
<property name="text">
|
||||
<string>Use another start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="useProfileImageCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use profile start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="useLibraryImageCB">
|
||||
<property name="text">
|
||||
<string>Use library start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
<tabstop>FWFileName</tabstop>
|
||||
<tabstop>FlashLoadButton</tabstop>
|
||||
<tabstop>versionField</tabstop>
|
||||
<tabstop>ModField</tabstop>
|
||||
<tabstop>useProfileImageCB</tabstop>
|
||||
<tabstop>useFwImageCB</tabstop>
|
||||
<tabstop>useLibraryImageCB</tabstop>
|
||||
<tabstop>useAnotherImageCB</tabstop>
|
||||
<tabstop>EEbackupCB</tabstop>
|
||||
<tabstop>patchcalib_CB</tabstop>
|
||||
<tabstop>patchhw_CB</tabstop>
|
||||
<tabstop>EEpromCB</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,19 @@
|
||||
# Locate lupdate binary from QT
|
||||
|
||||
# This module defines
|
||||
# LUPDATE_EXECUTABLE, where is QT lupdate
|
||||
# LUPDATE_FOUND, if false, don't try to use lupdate
|
||||
|
||||
FIND_PROGRAM( LUPDATE_EXECUTABLE
|
||||
NAMES
|
||||
lupdate lupdate-qt4
|
||||
)
|
||||
|
||||
MESSAGE( STATUS ${LUPDATE_EXECUTABLE} )
|
||||
|
||||
# if the program is found then we have it
|
||||
IF( LUPDATE_EXECUTABLE )
|
||||
SET( LUPDATE_FOUND "YES" )
|
||||
ENDIF( LUPDATE_EXECUTABLE )
|
||||
|
||||
MARK_AS_ADVANCED( LUPDATE_EXECUTABLE )
|
||||
@@ -12,7 +12,11 @@
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
macro(_phonon_find_version)
|
||||
file(READ "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h" _phonon_header LIMIT 5000 OFFSET 1000)
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
|
||||
if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
|
||||
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
|
||||
set(PHONON_VERSION "${CMAKE_MATCH_1}")
|
||||
message(STATUS "Phonon Version: ${PHONON_VERSION}")
|
||||
@@ -31,7 +35,7 @@ else(PHONON_FOUND)
|
||||
# then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
|
||||
find_library(PHONON_LIBRARY NAMES phonon)
|
||||
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
|
||||
|
||||
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
|
||||
@@ -1,52 +1,54 @@
|
||||
# Locate Xsd from code synthesis include paths and binary
|
||||
# Xsd can be found at http://codesynthesis.com/products/xsd/
|
||||
# Written by Frederic Heem, frederic.heem _at_ telsey.it
|
||||
|
||||
# This module defines
|
||||
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
|
||||
# XSD_EXECUTABLE, where is the xsd compiler
|
||||
# XSD_FOUND, If false, don't try to use xsd
|
||||
|
||||
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
|
||||
# Locate Xsd from code synthesis include paths and binary
|
||||
# Xsd can be found at http://codesynthesis.com/products/xsd/
|
||||
# Written by Frederic Heem, frederic.heem _at_ telsey.it
|
||||
|
||||
# This module defines
|
||||
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
|
||||
# XSD_EXECUTABLE, where is the xsd compiler
|
||||
# XSD_FOUND, If false, don't try to use xsd
|
||||
|
||||
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
|
||||
"C:/Programs/xsd-3.3.0/libxsd"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/include"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
|
||||
$ENV{XSDDIR}/include
|
||||
$ENV{CODESYNTH}/include
|
||||
/usr/local/include /usr/include
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
|
||||
ELSE( )
|
||||
SET( XSDCXX_FILENAME1 xsdcxx )
|
||||
SET( XSDCXX_FILENAME2 xsd )
|
||||
ENDIF( )
|
||||
|
||||
FIND_PROGRAM( XSDCXX_EXECUTABLE
|
||||
NAMES
|
||||
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
|
||||
"C:/Programs/xsd-3.3.0/libxsd"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/include"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
|
||||
$ENV{XSDDIR}/include
|
||||
$ENV{CODESYNTH}/include
|
||||
/usr/local/include /usr/include
|
||||
$ENV{XSDDIR}/libxsd
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
|
||||
ELSE( )
|
||||
SET( XSDCXX_FILENAME1 xsdcxx )
|
||||
SET( XSDCXX_FILENAME2 xsd )
|
||||
ENDIF( )
|
||||
|
||||
FIND_PROGRAM( XSDCXX_EXECUTABLE
|
||||
NAMES
|
||||
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
|
||||
PATHS
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/bin"
|
||||
"C:/Programs/xsd-3.3.0/bin"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/bin"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
|
||||
$ENV{XSDDIR}/bin
|
||||
/usr/local/bin
|
||||
/usr/bin
|
||||
)
|
||||
|
||||
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
|
||||
|
||||
# if the include and the program are found then we have it
|
||||
IF( XSD_INCLUDE_DIR )
|
||||
IF( XSDCXX_EXECUTABLE )
|
||||
SET( XSD_FOUND "YES" )
|
||||
ENDIF( XSDCXX_EXECUTABLE )
|
||||
ENDIF( XSD_INCLUDE_DIR )
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XSD_INCLUDE_DIR
|
||||
XSDCXX_EXECUTABLE
|
||||
)
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/bin"
|
||||
"C:/Programs/xsd-3.3.0/bin"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/bin"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
|
||||
$ENV{XSDDIR}/bin
|
||||
/usr/local/bin
|
||||
/usr/bin
|
||||
$ENV{XSDDIR}/xsd
|
||||
)
|
||||
|
||||
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
|
||||
|
||||
# if the include and the program are found then we have it
|
||||
IF( XSD_INCLUDE_DIR )
|
||||
IF( XSDCXX_EXECUTABLE )
|
||||
SET( XSD_FOUND "YES" )
|
||||
ENDIF( XSDCXX_EXECUTABLE )
|
||||
ENDIF( XSD_INCLUDE_DIR )
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XSD_INCLUDE_DIR
|
||||
XSDCXX_EXECUTABLE
|
||||
)
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
#include <QSplashScreen>
|
||||
#include <QThread>
|
||||
#include <iostream>
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
#include <SDL.h>
|
||||
#undef main
|
||||
#endif
|
||||
#include "mainwindow.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
@@ -96,19 +100,38 @@ int main(int argc, char *argv[])
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
#ifdef JOYSTICKS
|
||||
sdlFlags |= SDL_INIT_JOYSTICK;
|
||||
#endif
|
||||
#ifdef SIMU_AUDIO
|
||||
sdlFlags |= SDL_INIT_AUDIO;
|
||||
#endif
|
||||
if (SDL_Init(sdlFlags) < 0) {
|
||||
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
}
|
||||
#endif
|
||||
|
||||
registerEEpromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
registerSimulators();
|
||||
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant.id);
|
||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||
g.profile[g.id()].fwName("");
|
||||
}
|
||||
|
||||
|
||||
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
|
||||
QString splashScreen;
|
||||
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splash-taranis.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splash-9xrpro.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splash-9xr.png";
|
||||
else splashScreen = ":/images/splash-9x.png";
|
||||
|
||||
QPixmap pixmap = QPixmap(splashScreen);
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
MainWindow *mainWin = new MainWindow();
|
||||
if (g.showSplash()) {
|
||||
@@ -125,8 +148,12 @@ int main(int argc, char *argv[])
|
||||
delete splash;
|
||||
delete mainWin;
|
||||
|
||||
UnregisterFirmwares();
|
||||
UnregisterEepromInterfaces();
|
||||
unregisterFirmwares();
|
||||
unregisterEEpromInterfaces();
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
SDL_Quit();
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -39,8 +39,10 @@
|
||||
<file>images/9xcursdown.png</file>
|
||||
<file>images/9xcursphoto.png</file>
|
||||
<file>images/screenshot.png</file>
|
||||
<file>images/splash.png</file>
|
||||
<file>images/splasht.png</file>
|
||||
<file>images/splash-9x.png</file>
|
||||
<file>images/splash-9xrpro.png</file>
|
||||
<file>images/splash-9xr.png</file>
|
||||
<file>images/splash-taranis.png</file>
|
||||
<file>images/companion-title.png</file>
|
||||
<file>images/maps.png</file>
|
||||
<file>images/track.png</file>
|
||||
@@ -196,6 +198,7 @@
|
||||
<file>themes/monochrome/16/contributors.png</file>
|
||||
<file>themes/monochrome/16/stop.png</file>
|
||||
<file>themes/monochrome/16/write_eeprom.png</file>
|
||||
<file>themes/monochrome/16/sdsync.png</file>
|
||||
<file>themes/monochrome/24/paintbrush.png</file>
|
||||
<file>themes/monochrome/24/open.png</file>
|
||||
<file>themes/monochrome/24/edit.png</file>
|
||||
@@ -239,6 +242,7 @@
|
||||
<file>themes/monochrome/24/contributors.png</file>
|
||||
<file>themes/monochrome/24/stop.png</file>
|
||||
<file>themes/monochrome/24/write_eeprom.png</file>
|
||||
<file>themes/monochrome/24/sdsync.png</file>
|
||||
<file>themes/monochrome/32/paintbrush.png</file>
|
||||
<file>themes/monochrome/32/open.png</file>
|
||||
<file>themes/monochrome/32/edit.png</file>
|
||||
@@ -282,6 +286,7 @@
|
||||
<file>themes/monochrome/32/contributors.png</file>
|
||||
<file>themes/monochrome/32/stop.png</file>
|
||||
<file>themes/monochrome/32/write_eeprom.png</file>
|
||||
<file>themes/monochrome/32/sdsync.png</file>
|
||||
<file>themes/monochrome/48/paintbrush.png</file>
|
||||
<file>themes/monochrome/48/open.png</file>
|
||||
<file>themes/monochrome/48/edit.png</file>
|
||||
@@ -325,6 +330,7 @@
|
||||
<file>themes/monochrome/48/contributors.png</file>
|
||||
<file>themes/monochrome/48/stop.png</file>
|
||||
<file>themes/monochrome/48/write_eeprom.png</file>
|
||||
<file>themes/monochrome/48/sdsync.png</file>
|
||||
<file>themes/classic/16/paintbrush.png</file>
|
||||
<file>themes/classic/16/open.png</file>
|
||||
<file>themes/classic/16/edit.png</file>
|
||||
@@ -368,6 +374,7 @@
|
||||
<file>themes/classic/16/contributors.png</file>
|
||||
<file>themes/classic/16/stop.png</file>
|
||||
<file>themes/classic/16/write_eeprom.png</file>
|
||||
<file>themes/classic/16/sdsync.png</file>
|
||||
<file>themes/classic/24/paintbrush.png</file>
|
||||
<file>themes/classic/24/open.png</file>
|
||||
<file>themes/classic/24/edit.png</file>
|
||||
@@ -411,6 +418,7 @@
|
||||
<file>themes/classic/24/contributors.png</file>
|
||||
<file>themes/classic/24/stop.png</file>
|
||||
<file>themes/classic/24/write_eeprom.png</file>
|
||||
<file>themes/classic/24/sdsync.png</file>
|
||||
<file>themes/classic/32/paintbrush.png</file>
|
||||
<file>themes/classic/32/open.png</file>
|
||||
<file>themes/classic/32/edit.png</file>
|
||||
@@ -454,6 +462,7 @@
|
||||
<file>themes/classic/32/contributors.png</file>
|
||||
<file>themes/classic/32/stop.png</file>
|
||||
<file>themes/classic/32/write_eeprom.png</file>
|
||||
<file>themes/classic/32/sdsync.png</file>
|
||||
<file>themes/classic/48/paintbrush.png</file>
|
||||
<file>themes/classic/48/open.png</file>
|
||||
<file>themes/classic/48/edit.png</file>
|
||||
@@ -497,6 +506,7 @@
|
||||
<file>themes/classic/48/contributors.png</file>
|
||||
<file>themes/classic/48/stop.png</file>
|
||||
<file>themes/classic/48/write_eeprom.png</file>
|
||||
<file>themes/classic/48/sdsync.png</file>
|
||||
<file>themes/monoblue/16/paintbrush.png</file>
|
||||
<file>themes/monoblue/16/open.png</file>
|
||||
<file>themes/monoblue/16/edit.png</file>
|
||||
@@ -884,6 +894,7 @@
|
||||
<file>themes/yerico/16/contributors.png</file>
|
||||
<file>themes/yerico/16/stop.png</file>
|
||||
<file>themes/yerico/16/write_eeprom.png</file>
|
||||
<file>themes/yerico/16/sdsync.png</file>
|
||||
<file>themes/yerico/24/paintbrush.png</file>
|
||||
<file>themes/yerico/24/open.png</file>
|
||||
<file>themes/yerico/24/edit.png</file>
|
||||
@@ -927,6 +938,7 @@
|
||||
<file>themes/yerico/24/contributors.png</file>
|
||||
<file>themes/yerico/24/stop.png</file>
|
||||
<file>themes/yerico/24/write_eeprom.png</file>
|
||||
<file>themes/yerico/24/sdsync.png</file>
|
||||
<file>themes/yerico/32/paintbrush.png</file>
|
||||
<file>themes/yerico/32/open.png</file>
|
||||
<file>themes/yerico/32/edit.png</file>
|
||||
@@ -970,6 +982,7 @@
|
||||
<file>themes/yerico/32/contributors.png</file>
|
||||
<file>themes/yerico/32/stop.png</file>
|
||||
<file>themes/yerico/32/write_eeprom.png</file>
|
||||
<file>themes/yerico/32/sdsync.png</file>
|
||||
<file>themes/yerico/48/paintbrush.png</file>
|
||||
<file>themes/yerico/48/open.png</file>
|
||||
<file>themes/yerico/48/edit.png</file>
|
||||
@@ -1013,5 +1026,6 @@
|
||||
<file>themes/yerico/48/contributors.png</file>
|
||||
<file>themes/yerico/48/stop.png</file>
|
||||
<file>themes/yerico/48/write_eeprom.png</file>
|
||||
<file>themes/yerico/48/sdsync.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
+240
-209
@@ -1,6 +1,7 @@
|
||||
#include "comparedialog.h"
|
||||
#include "ui_comparedialog.h"
|
||||
#include "helpers.h"
|
||||
#include "helpers_html.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QtGui>
|
||||
#include <QImage>
|
||||
@@ -24,8 +25,9 @@ public:
|
||||
uint8_t models[C9X_MAX_MODELS];
|
||||
};
|
||||
|
||||
CompareDialog::CompareDialog(QWidget * parent):
|
||||
CompareDialog::CompareDialog(QWidget * parent, Firmware * firmware):
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
firmware(firmware),
|
||||
model1(0),
|
||||
model2(0),
|
||||
ui(new Ui::CompareDialog)
|
||||
@@ -79,6 +81,8 @@ void CompareDialog::printDiff()
|
||||
if (GetCurrentFirmware()->getCapability(FlightModes)) {
|
||||
printPhases();
|
||||
}
|
||||
curvefile1=generateProcessUniqueTempFileName("curve1.png");
|
||||
curvefile2=generateProcessUniqueTempFileName("curve2.png");
|
||||
printExpos();
|
||||
printMixers();
|
||||
printLimits();
|
||||
@@ -156,50 +160,15 @@ void CompareDialog::dropEvent(QDropEvent *event)
|
||||
|
||||
void CompareDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QByteArray ba = curvefile5.toLatin1();
|
||||
char *name = ba.data();
|
||||
unlink(name);
|
||||
ba = curvefile9.toLatin1();
|
||||
name = ba.data();
|
||||
unlink(name);
|
||||
}
|
||||
|
||||
CompareDialog::~CompareDialog()
|
||||
{
|
||||
qunlink(curvefile1);
|
||||
qunlink(curvefile2);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString CompareDialog::doTC(const QString s, const QString color="", bool bold=false)
|
||||
{
|
||||
QString str = s;
|
||||
if(bold) str = "<b>" + str + "</b>";
|
||||
if(!color.isEmpty()) str = "<font color=" + color + ">" + str + "</font>";
|
||||
return "<td align=center>" + str + "</td>";
|
||||
}
|
||||
|
||||
QString CompareDialog::doTR(const QString s, const QString color="", bool bold=false)
|
||||
{
|
||||
QString str = s;
|
||||
if(bold) str = "<b>" + str + "</b>";
|
||||
if(!color.isEmpty()) str = "<font color=" + color + ">" + str + "</font>";
|
||||
return "<td align=right>" + str + "</td>";
|
||||
}
|
||||
|
||||
QString CompareDialog::doTL(const QString s, const QString color="", bool bold=false)
|
||||
{
|
||||
QString str = s;
|
||||
if(bold) str = "<b>" + str + "</b>";
|
||||
if(!color.isEmpty()) str = "<font color=" + color + ">" + str + "</font>";
|
||||
return "<td align=left>" + str + "</td>";
|
||||
}
|
||||
|
||||
QString CompareDialog::fv(const QString name, const QString value, const QString color="green")
|
||||
{
|
||||
return "<b>" + name + ": </b><font color=" +color + ">" + value + "</font><br>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
int CompareDialog::ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused)
|
||||
{
|
||||
for (int i=0; i< C9X_MAX_EXPOS; i++) {
|
||||
@@ -254,19 +223,14 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model1->timers[0]), color)); //value, mode, count up/down
|
||||
color=getColor1(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down
|
||||
color=getColor1(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay,
|
||||
color=getColor1(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
|
||||
color=getColor1(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1->moduleData[0]), color)); //proto, numch, delay,
|
||||
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor1(g_model1->thrExpo,g_model2->thrExpo);
|
||||
str.append(fv(tr("Throttle Expo"), g_model1->thrExpo ? tr("Enabled") : tr("Disabled"),color));
|
||||
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
|
||||
color=getColor1(getTrimInc(g_model1),getTrimInc(g_model2));
|
||||
str.append(fv(tr("Trim Increment"), getTrimInc(g_model1),color));
|
||||
color=getColor1(getCenterBeep(g_model1),getCenterBeep(g_model2));
|
||||
str.append(fv(tr("Center Beep"), getCenterBeep(g_model1),color)); // specify which channels beep
|
||||
color = getColor1(getCenterBeepStr(g_model1), getCenterBeepStr(g_model2));
|
||||
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model1), color)); // specify which channels beep
|
||||
str.append("</table></td>");
|
||||
str.append("<td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">");
|
||||
color=getColor2(g_model1->name,g_model2->name);
|
||||
@@ -277,19 +241,14 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model2->timers[0]),color)); //value, mode, count up/down
|
||||
color=getColor2(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down
|
||||
color=getColor2(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay,
|
||||
color=getColor2(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
|
||||
color=getColor2(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2->moduleData[0]), color)); //proto, numch, delay,
|
||||
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor2(g_model1->thrExpo,g_model2->thrExpo);
|
||||
str.append(fv(tr("Throttle Expo"), g_model2->thrExpo ? tr("Enabled") : tr("Disabled"),color));
|
||||
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
|
||||
color=getColor2(getTrimInc(g_model1),getTrimInc(g_model2));
|
||||
str.append(fv(tr("Trim Increment"), getTrimInc(g_model2),color));
|
||||
color=getColor2(getCenterBeep(g_model1),getCenterBeep(g_model2));
|
||||
str.append(fv(tr("Center Beep"), getCenterBeep(g_model2),color)); // specify which channels beep
|
||||
color = getColor2(getCenterBeepStr(g_model1),getCenterBeepStr(g_model2));
|
||||
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model2), color)); // specify which channels beep
|
||||
str.append("</td></tr></table></td></tr></table>");
|
||||
te->append(str);
|
||||
}
|
||||
@@ -306,12 +265,12 @@ void CompareDialog::printPhases()
|
||||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color));
|
||||
@@ -333,32 +292,19 @@ void CompareDialog::printPhases()
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table>");
|
||||
int gvars=0;
|
||||
int gvarnum=0;
|
||||
if (GetCurrentFirmware()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars=1;
|
||||
}
|
||||
if (gvars==1) {
|
||||
gvarnum=GetCurrentFirmware()->getCapability(Gvars);
|
||||
}
|
||||
if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
int gvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
if ((gvars && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
str.append("<tr><td style=\"border-style:none;\"> </td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvars)+tr("Gvars")+"</td>");
|
||||
}
|
||||
if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
|
||||
}
|
||||
str.append("</tr><tr><td align=center><b>"+tr("Flight mode name")+"</b></td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (i=0; i<gvarnum; i++) {
|
||||
for (i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model1->gvars_names[i]));
|
||||
}
|
||||
}
|
||||
@@ -367,13 +313,13 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color));
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (k=0; k<gvarnum; k++) {
|
||||
for (k=0; k<gvars; k++) {
|
||||
color=getColor1(pd1->gvars[k],pd2->gvars[k]);
|
||||
if (pd1->gvars[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\" width=\"40\"><font size=+1 face='Courier New' color=%2>%1").arg(pd1->gvars[k]).arg(color)+"</font></td>");
|
||||
@@ -408,12 +354,12 @@ void CompareDialog::printPhases()
|
||||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor2(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color));
|
||||
@@ -436,18 +382,18 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</table>");
|
||||
|
||||
if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
if ((gvars && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
str.append("<tr><td style=\"border-style:none;\"> </td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvars)+tr("Gvars")+"</td>");
|
||||
}
|
||||
if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
|
||||
}
|
||||
str.append("</tr><tr><td align=center ><b>"+tr("Flight mode name")+"</b></td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (i=0; i<gvarnum; i++) {
|
||||
for (i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model2->gvars_names[i]));
|
||||
}
|
||||
}
|
||||
@@ -456,13 +402,13 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color));
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (k=0; k<gvarnum; k++) {
|
||||
for (k=0; k<gvars; k++) {
|
||||
color=getColor1(pd1->gvars[k],pd2->gvars[k]);
|
||||
if (pd2->gvars[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\" width=\"40\"><font size=+1 face='Courier New' color=%2>%1").arg(pd2->gvars[k]).arg(color)+"</font></td>");
|
||||
@@ -519,11 +465,11 @@ void CompareDialog::printLimits()
|
||||
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
|
||||
}
|
||||
color=getColor1(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
|
||||
str.append(doTR(QString::number((qreal)g_model1->limitData[i].offset/10, 'f', 1),color));
|
||||
str.append(doTR(g_model1->limitData[i].offsetToString(), color));
|
||||
color=getColor1(g_model1->limitData[i].min,g_model2->limitData[i].min);
|
||||
str.append(doTR(QString::number(g_model1->limitData[i].min),color));
|
||||
str.append(doTR(g_model1->limitData[i].minToString(), color));
|
||||
color=getColor1(g_model1->limitData[i].max,g_model2->limitData[i].max);
|
||||
str.append(doTR(QString::number(g_model1->limitData[i].max),color));
|
||||
str.append(doTR(g_model1->limitData[i].maxToString(), color));
|
||||
color=getColor1(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
|
||||
str.append(doTR(QString(g_model1->limitData[i].revert ? tr("INV") : tr("NOR")),color));
|
||||
str.append("</tr>");
|
||||
@@ -546,11 +492,11 @@ void CompareDialog::printLimits()
|
||||
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
|
||||
}
|
||||
color=getColor2(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
|
||||
str.append(doTR(QString::number((qreal)g_model2->limitData[i].offset/10, 'f', 1),color));
|
||||
str.append(doTR(g_model2->limitData[i].offsetToString(), color));
|
||||
color=getColor2(g_model1->limitData[i].min,g_model2->limitData[i].min);
|
||||
str.append(doTR(QString::number(g_model2->limitData[i].min),color));
|
||||
str.append(doTR(g_model2->limitData[i].minToString(), color));
|
||||
color=getColor2(g_model1->limitData[i].max,g_model2->limitData[i].max);
|
||||
str.append(doTR(QString::number(g_model2->limitData[i].max),color));
|
||||
str.append(doTR(g_model2->limitData[i].maxToString(), color));
|
||||
color=getColor2(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
|
||||
str.append(doTR(QString(g_model2->limitData[i].revert ? tr("INV") : tr("NOR")),color));
|
||||
str.append("</tr>");
|
||||
@@ -562,28 +508,23 @@ void CompareDialog::printLimits()
|
||||
void CompareDialog::printGvars()
|
||||
{
|
||||
QString color;
|
||||
int gvars=0;
|
||||
int gvarnum=0;
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetCurrentFirmware()->getCapability(HasVariants) && GetCurrentFirmware()->getCapability(Gvars))) {
|
||||
gvars=1;
|
||||
gvarnum=GetCurrentFirmware()->getCapability(Gvars);
|
||||
}
|
||||
int gvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
|
||||
if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) {
|
||||
if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && gvars) {
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td colspan=2><h2>"+tr("Global Variables")+"</h2></td></tr>");
|
||||
str.append("<tr><td width=50%>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=100>");
|
||||
PhaseData *pd1=&g_model1->phaseData[0];
|
||||
PhaseData *pd2=&g_model2->phaseData[0];
|
||||
int width=100/gvarnum;
|
||||
FlightModeData *pd1=&g_model1->flightModeData[0];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[0];
|
||||
int width = 100 / gvars;
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><b>").arg(width)+tr("GV")+QString("%1</b></td>").arg(i+1));
|
||||
}
|
||||
str.append("</tr>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
color=getColor1(pd1->gvars[i],pd2->gvars[i]);
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><font color=%2>").arg(width).arg(color)+QString("%1</font></td>").arg(pd1->gvars[i]));
|
||||
}
|
||||
@@ -591,12 +532,12 @@ void CompareDialog::printGvars()
|
||||
str.append("</table></td><td width=50%>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=100>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><b>").arg(width)+tr("GV")+QString("%1</b></td>").arg(i+1));
|
||||
}
|
||||
str.append("</tr>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
color=getColor2(pd1->gvars[i],pd2->gvars[i]);
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><font color=%2>").arg(width).arg(color)+QString("%1</font></td>").arg(pd2->gvars[i]));
|
||||
}
|
||||
@@ -673,7 +614,7 @@ void CompareDialog::printExpos()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(ed->phases & mask)) {
|
||||
PhaseData *pd = &g_model1->phaseData[j];
|
||||
FlightModeData *pd = &g_model1->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -696,7 +637,7 @@ void CompareDialog::printExpos()
|
||||
}
|
||||
}
|
||||
str.append("</table></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getInputStr(*g_model2, i)+"</b></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getInputStr(g_model2, i)+"</b></td>");
|
||||
str.append("<td width=\"45%\">");
|
||||
str.append("<table border=0 cellspacing=0 cellpadding=0>");
|
||||
for (int j=0; j<C9X_MAX_EXPOS; j++) {
|
||||
@@ -751,7 +692,7 @@ void CompareDialog::printExpos()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(ed->phases & mask)) {
|
||||
PhaseData *pd = &g_model2->phaseData[j];
|
||||
FlightModeData *pd = &g_model2->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -821,11 +762,11 @@ void CompareDialog::printMixers()
|
||||
break;
|
||||
};
|
||||
str += QString(" %1").arg(getGVarString(md->weight)).rightJustified(6, ' ');
|
||||
str += md->srcRaw.toString();
|
||||
str += md->srcRaw.toString(g_model1);
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
str += md->curve.toString().replace("<", "<").replace(">", ">");
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
|
||||
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
|
||||
@@ -849,7 +790,7 @@ void CompareDialog::printMixers()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(md->phases & mask)) {
|
||||
PhaseData *pd = &g_model1->phaseData[j];
|
||||
FlightModeData *pd = &g_model1->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -899,12 +840,11 @@ void CompareDialog::printMixers()
|
||||
break;
|
||||
};
|
||||
str += QString(" %1").arg(getGVarString(md->weight)).rightJustified(6, ' ');
|
||||
str += md->srcRaw.toString();
|
||||
str += md->srcRaw.toString(g_model2);
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
// TODO if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
|
||||
// TODO if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "<").replace(">", ">"));
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
|
||||
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
|
||||
@@ -928,7 +868,7 @@ void CompareDialog::printMixers()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(md->phases & mask)) {
|
||||
PhaseData *pd = &g_model2->phaseData[j];
|
||||
FlightModeData *pd = &g_model2->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -957,82 +897,176 @@ void CompareDialog::printMixers()
|
||||
|
||||
void CompareDialog::printCurves()
|
||||
{
|
||||
#if 0
|
||||
int i,r,g,b,c;
|
||||
int i,r,g,b,c,count1,count2,usedcurves=0;
|
||||
QString cm1y,cm1x, cm2y,cm2x;
|
||||
char buffer [16];
|
||||
QString color;
|
||||
QColor * qplot_color[8];
|
||||
qplot_color[0]=new QColor(0,0,127);
|
||||
qplot_color[1]=new QColor(0,127,0);
|
||||
qplot_color[2]=new QColor(127,0,0);
|
||||
qplot_color[3]=new QColor(127,127,0);
|
||||
qplot_color[4]=new QColor(0,0,255);
|
||||
qplot_color[5]=new QColor(0,255,0);
|
||||
qplot_color[6]=new QColor(255,0,0);
|
||||
qplot_color[7]=new QColor(255,255,0);
|
||||
QPen pen(Qt::black, 2, Qt::SolidLine);
|
||||
int numcurves=firmware->getCapability(NumCurves);
|
||||
if (numcurves==0) {
|
||||
numcurves=16;
|
||||
}
|
||||
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
|
||||
str.append(tr("Curves"));
|
||||
str.append("</h2></td></tr><tr><td>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=11><b>"+tr("5 Point Curves")+"</b></td></tr><tr>");
|
||||
for(i=0; i<5; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("<td></td>");
|
||||
for(i=0; i<5; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("</tr>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">");
|
||||
QImage qi1(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
|
||||
QPainter painter1(&qi1);
|
||||
QImage qi2(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
|
||||
QPainter painter2(&qi2);
|
||||
painter1.setBrush(QBrush("#FFFFFF"));
|
||||
painter2.setBrush(QBrush("#FFFFFF"));
|
||||
painter1.setPen(QColor(0,0,0));
|
||||
painter2.setPen(QColor(0,0,0));
|
||||
painter1.drawRect(0,0,ISIZE,ISIZE);
|
||||
painter2.drawRect(0,0,ISIZE,ISIZE);
|
||||
|
||||
for(i=0; i<numcurves; i++) {
|
||||
count1=0;
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
if (g_model1->curves[i].points[j].y!=0)
|
||||
count1++;
|
||||
}
|
||||
count2=0;
|
||||
for(int j=0; j<g_model2->curves[i].count; j++) {
|
||||
if (g_model2->curves[i].points[j].y!=0)
|
||||
count2++;
|
||||
}
|
||||
if ((count1>0) || (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model1->curves[i].count !=5) ||
|
||||
(count2>0) || (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model2->curves[i].count !=5)) {
|
||||
pen.setColor(colors[usedcurves]);
|
||||
painter1.setPen(pen);
|
||||
painter2.setPen(pen);
|
||||
|
||||
for(i=0; i<MAX_CURVE5; i++) {
|
||||
qplot_color[i]->getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
for(int j=0; j<5; j++) {
|
||||
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
|
||||
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
for(int j=0; j<5; j++) {
|
||||
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
|
||||
str.append(doTR(QString::number(g_model2->curves5[i][j]),color));
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table></td></tr><tr><td>");
|
||||
colors[usedcurves].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
// curves are different in number of points or curve type so makes little sense to compare they are just different
|
||||
if ((g_model1->curves[i].count!=g_model2->curves[i].count) || (g_model1->curves[i].type!=g_model2->curves[i].type)) {
|
||||
cm1y="[";
|
||||
cm1x="[";
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
cm1y.append(QString("%1").arg(g_model1->curves[i].points[j].y));
|
||||
cm1x.append(QString("%1").arg(g_model1->curves[i].points[j].x));
|
||||
if (j<(g_model1->curves[i].count-1)) {
|
||||
cm1y.append(",");
|
||||
cm1x.append(",");
|
||||
}
|
||||
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
|
||||
}
|
||||
cm1y.append("]");
|
||||
cm1x.append("]");
|
||||
cm2y="[";
|
||||
cm2x="[";
|
||||
for(int j=0; j<g_model2->curves[i].count; j++) {
|
||||
cm2y.append(QString("%1").arg(g_model2->curves[i].points[j].y));
|
||||
cm2x.append(QString("%1").arg(g_model2->curves[i].points[j].x));
|
||||
if (j<(g_model2->curves[i].count-1)) {
|
||||
cm2y.append(",");
|
||||
cm2x.append(",");
|
||||
}
|
||||
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
|
||||
}
|
||||
cm2y.append("]");
|
||||
cm2x.append("]");
|
||||
str.append("<tr><td nowrap width=\"45%\"><font color=green>");
|
||||
str.append(cm1y);
|
||||
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm1x+QString("</font></td>"));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
str.append("<td nowrap width=\"45%\"><font color=red>");
|
||||
str.append(cm2y);
|
||||
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm2x+QString("</font></td></tr>"));
|
||||
}
|
||||
} else {
|
||||
// curves have the same number of points and the same type, we can compare them point by point
|
||||
cm1y="[";
|
||||
cm1x="[";
|
||||
cm2y="[";
|
||||
cm2x="[";
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
if (g_model1->curves[i].points[j].y!=g_model2->curves[i].points[j].y) {
|
||||
cm1y.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].y));
|
||||
cm2y.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].y));
|
||||
} else {
|
||||
cm1y.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].y));
|
||||
cm2y.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].y));
|
||||
}
|
||||
if (g_model1->curves[i].points[j].x!=g_model2->curves[i].points[j].x) {
|
||||
cm1x.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].x));
|
||||
cm2x.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].x));
|
||||
} else {
|
||||
cm1x.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].x));
|
||||
cm2x.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].x));
|
||||
}
|
||||
if (j<(g_model1->curves[i].count-1)) {
|
||||
cm1y.append(",");
|
||||
cm1x.append(",");
|
||||
cm2y.append(",");
|
||||
cm2x.append(",");
|
||||
}
|
||||
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
}
|
||||
painter1.setPen(QColor(0,0,0));
|
||||
painter2.setPen(QColor(0,0,0));
|
||||
painter1.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
|
||||
painter2.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
|
||||
painter1.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
|
||||
painter2.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
|
||||
for(i=0; i<21; i++) {
|
||||
painter1.drawLine(ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5,(ISIZE*i)/(20));
|
||||
painter2.drawLine(ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5,(ISIZE*i)/(20));
|
||||
painter1.drawLine((ISIZE*i)/(20),ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5);
|
||||
painter2.drawLine((ISIZE*i)/(20),ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5);
|
||||
}
|
||||
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=19><b>"+tr("9 Point Curves")+"</b></td></tr><tr>");
|
||||
for(i=0; i<9; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("<td></td>");
|
||||
for(i=0; i<9; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("</tr>");
|
||||
for(i=0; i<MAX_CURVE9; i++) {
|
||||
qplot_color[i]->getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
for(int j=0; j<9; j++) {
|
||||
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
|
||||
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
|
||||
cm1y.append("]");
|
||||
cm1x.append("]");
|
||||
cm2y.append("]");
|
||||
cm2x.append("]");
|
||||
str.append("<tr><td nowrap width=\"45%\">");
|
||||
str.append(cm1y);
|
||||
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm1x+QString("</td>"));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
str.append("<td nowrap width=\"45%\">");
|
||||
str.append(cm2y);
|
||||
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm2x+QString("</td></tr>"));
|
||||
}
|
||||
}
|
||||
usedcurves++;
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1+MAX_CURVE5));
|
||||
for(int j=0; j<9; j++) {
|
||||
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
|
||||
str.append(doTR(QString::number(g_model2->curves9[i][j]),color));
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table></td></tr></table>");
|
||||
te->append(str);
|
||||
#endif
|
||||
if (usedcurves>0) {
|
||||
str.append(QString("<tr><td width=45 align=center><img src=\"%1\" border=0></td><td> </td><td width=45 align=center><img src=\"%2\" border=0></td>").arg(curvefile1).arg(curvefile2));
|
||||
str.append("</table></td></tr></table>");
|
||||
qi1.save(curvefile1, "png",100);
|
||||
qi2.save(curvefile2, "png",100);
|
||||
te->append(str);
|
||||
}
|
||||
}
|
||||
|
||||
void CompareDialog::printSwitches()
|
||||
@@ -1043,17 +1077,14 @@ void CompareDialog::printSwitches()
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
|
||||
QString sw1 = g_model1->customSw[i].toString(*g_model1);
|
||||
QString sw2 = g_model2->customSw[i].toString(*g_model2);
|
||||
GeneralSettings settings;
|
||||
QString sw1 = g_model1->logicalSw[i].toString(*g_model1, settings);
|
||||
QString sw2 = g_model2->logicalSw[i].toString(*g_model2, settings);
|
||||
if (!(sw1.isEmpty() && sw2.isEmpty())) {
|
||||
str.append("<tr>");
|
||||
color=getColor1(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
|
||||
if (i<9) {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
|
||||
} else {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
|
||||
}
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("L%1").arg(i+1)+QString("</b></td>"));
|
||||
color=getColor2(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
|
||||
str.append("</tr>");
|
||||
@@ -1087,8 +1118,8 @@ void CompareDialog::printFSwitches()
|
||||
str.append("</tr>");
|
||||
for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
|
||||
{
|
||||
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
|
||||
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
|
||||
if (g_model1->customFn[i].swtch.type || g_model2->customFn[i].swtch.type) {
|
||||
if ((g_model1->customFn[i].swtch != g_model2->customFn[i].swtch) || (g_model1->customFn[i].func!=g_model2->customFn[i].func) || (g_model1->customFn[i].adjustMode!=g_model2->customFn[i].adjustMode) || (g_model1->customFn[i].param!=g_model2->customFn[i].param) || (g_model1->customFn[i].enabled != g_model2->customFn[i].enabled) || (g_model1->customFn[i].repeatParam != g_model2->customFn[i].repeatParam)) {
|
||||
color1="green";
|
||||
color2="red";
|
||||
} else {
|
||||
@@ -1096,18 +1127,18 @@ void CompareDialog::printFSwitches()
|
||||
color2="grey";
|
||||
}
|
||||
str.append("<tr>");
|
||||
if (g_model1->funcSw[i].swtch.type) {
|
||||
str.append(doTC(g_model1->funcSw[i].swtch.toString(),color1));
|
||||
str.append(doTC(g_model1->funcSw[i].funcToString(),color1));
|
||||
str.append(doTC(g_model1->funcSw[i].paramToString(),color1));
|
||||
int index=g_model1->funcSw[i].func;
|
||||
if (g_model1->customFn[i].swtch.type) {
|
||||
str.append(doTC(g_model1->customFn[i].swtch.toString(),color1));
|
||||
str.append(doTC(g_model1->customFn[i].funcToString(),color1));
|
||||
str.append(doTC(g_model1->customFn[i].paramToString(),color1));
|
||||
int index=g_model1->customFn[i].func;
|
||||
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
|
||||
str.append(doTC(QString("%1").arg(g_model1->funcSw[i].repeatParam),color1));
|
||||
str.append(doTC(QString("%1").arg(g_model1->customFn[i].repeatParam),color1));
|
||||
} else {
|
||||
str.append(doTC( "---",color1));
|
||||
}
|
||||
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
|
||||
str.append(doTC((g_model1->funcSw[i].enabled ? "ON" : "OFF"),color1));
|
||||
str.append(doTC((g_model1->customFn[i].enabled ? "ON" : "OFF"),color1));
|
||||
} else {
|
||||
str.append(doTC( "---",color1));
|
||||
}
|
||||
@@ -1115,18 +1146,18 @@ void CompareDialog::printFSwitches()
|
||||
str.append("<td> </td><td> </td><td> </td><td> </td><td> </td>");
|
||||
}
|
||||
str.append(doTC(tr("SF")+QString("%1").arg(i+1),"",true));
|
||||
if (g_model2->funcSw[i].swtch.type) {
|
||||
str.append(doTC(g_model2->funcSw[i].swtch.toString(),color2));
|
||||
str.append(doTC(g_model2->funcSw[i].funcToString(),color2));
|
||||
str.append(doTC(g_model2->funcSw[i].paramToString(),color2));
|
||||
int index=g_model2->funcSw[i].func;
|
||||
if (g_model2->customFn[i].swtch.type) {
|
||||
str.append(doTC(g_model2->customFn[i].swtch.toString(),color2));
|
||||
str.append(doTC(g_model2->customFn[i].funcToString(),color2));
|
||||
str.append(doTC(g_model2->customFn[i].paramToString(),color2));
|
||||
int index=g_model2->customFn[i].func;
|
||||
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
|
||||
str.append(doTC(QString("%1").arg(g_model2->funcSw[i].repeatParam),color2));
|
||||
str.append(doTC(QString("%1").arg(g_model2->customFn[i].repeatParam),color2));
|
||||
} else {
|
||||
str.append(doTC( "---",color2));
|
||||
}
|
||||
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
|
||||
str.append(doTC((g_model2->funcSw[i].enabled ? "ON" : "OFF"),color2));
|
||||
str.append(doTC((g_model2->customFn[i].enabled ? "ON" : "OFF"),color2));
|
||||
} else {
|
||||
str.append(doTC( "---",color2));
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ class CompareDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CompareDialog(QWidget *parent);
|
||||
CompareDialog(QWidget *parent, Firmware * firmware);
|
||||
~CompareDialog();
|
||||
|
||||
Firmware * firmware;
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
ModelData * g_model1;
|
||||
ModelData * g_model2;
|
||||
ModelData * modeltemp;
|
||||
@@ -28,10 +30,6 @@ class CompareDialog : public QDialog
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
Ui::CompareDialog *ui;
|
||||
QString doTC(const QString s, const QString color, bool bold);
|
||||
QString doTR(const QString s, const QString color, bool bold);
|
||||
QString doTL(const QString s, const QString color, bool bold);
|
||||
QString fv(const QString name, const QString value,const QString color);
|
||||
template<class T> QString getColor1(T val1, T val2) {
|
||||
if (val1!=val2)
|
||||
return "green";
|
||||
@@ -63,8 +61,8 @@ class CompareDialog : public QDialog
|
||||
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
|
||||
|
||||
QTextEdit * te;
|
||||
QString curvefile5;
|
||||
QString curvefile9;
|
||||
QString curvefile1;
|
||||
QString curvefile2;
|
||||
QDir *qd;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef _constants_h_
|
||||
#define _constants_h_
|
||||
|
||||
enum BoardEnum {
|
||||
BOARD_STOCK,
|
||||
BOARD_M128,
|
||||
BOARD_MEGA2560,
|
||||
BOARD_GRUVIN9X,
|
||||
BOARD_SKY9X,
|
||||
BOARD_9XRPRO,
|
||||
BOARD_TARANIS,
|
||||
BOARD_TARANIS_PLUS,
|
||||
BOARD_TARANIS_X9E
|
||||
};
|
||||
|
||||
#define C9X_MAX_MODELS 60
|
||||
#define C9X_MAX_TIMERS 3
|
||||
#define C9X_MAX_FLIGHT_MODES 9
|
||||
#define C9X_MAX_MIXERS 64
|
||||
#define C9X_MAX_INPUTS 32
|
||||
#define C9X_MAX_EXPOS 64
|
||||
#define C9X_MAX_CURVES 32
|
||||
#define C9X_MAX_POINTS 17
|
||||
#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_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
|
||||
#define C9X_NUM_MODULES 2
|
||||
#define NUM_STICKS 4
|
||||
#define BOARD_9X_NUM_POTS 3
|
||||
#define C9X_NUM_POTS 8
|
||||
#define NUM_CAL_PPM 4
|
||||
#define NUM_CYC 3
|
||||
#define C9X_NUM_SWITCHES 32
|
||||
#define C9X_NUM_KEYS 32
|
||||
|
||||
#endif
|
||||
@@ -1,132 +1,108 @@
|
||||
#include "contributorsdialog.h"
|
||||
#include "ui_contributorsdialog.h"
|
||||
#include <QtGui>
|
||||
#include "ui_htmldialog.h"
|
||||
#include "helpers.h"
|
||||
|
||||
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::contributorsDialog)
|
||||
ContributorsDialog::ContributorsDialog(QWidget * parent):
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::HtmlDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
switch (contest) {
|
||||
case 0:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("contributors.png"));
|
||||
QFile file(":/DONATIONS.txt");
|
||||
QString str;
|
||||
str.append("<html><head>");
|
||||
str.append("<style type=\"text/css\">\n");
|
||||
str.append(".mycss\n{\nfont-weight:normal;\ncolor:#000000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".mycssb\n{\nfont-weight:bold;\ncolor:#C00000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".myhead\n{\nfont-weight:bold;\ncolor:#000000;font-size:14px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append("</style>\n</head><body class=\"mycss\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("People who have contributed to this project")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
int columns=6;
|
||||
float cwidth=100.0/columns;
|
||||
while (!file.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<columns; i++) {
|
||||
str.append(QString("<td width=\"%1%\" ").arg(cwidth));
|
||||
if (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
if (line.contains("monthly") || line.contains("mensual")) {
|
||||
str.append("class=\"mycssb\">");
|
||||
} else {
|
||||
str.append("class=\"mycss\">");
|
||||
}
|
||||
str.append(line.trimmed()+"</td>");
|
||||
} else {
|
||||
str.append("class=\"mycss\"> </td>");
|
||||
}
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
str.append("</table>");
|
||||
QFile file2(":/CREDITS.txt");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("Coders")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
while (!file2.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<3; i++) {
|
||||
str.append("<td width=\"33.33%\" class=\"mycss\">");
|
||||
if (!file2.atEnd()) {
|
||||
QByteArray line = file2.readLine();
|
||||
str.append(line.trimmed());
|
||||
} else {
|
||||
str.append(" ");
|
||||
}
|
||||
str.append("</td>");
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Thank you all !!!") + "</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
setWindowTitle(tr("Contributors"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
QFile file(":/releasenotes.txt");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textEditor->setHtml(file.readAll());
|
||||
}
|
||||
ui->textEditor->scroll(0,0);
|
||||
setWindowTitle(tr("Companion Release Notes"));
|
||||
break;
|
||||
}
|
||||
ui->setupUi(this);
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (!rnurl.isEmpty()) {
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
this->setWindowTitle(tr("OpenTX Release Notes"));
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
|
||||
QUrl url(rnurl);
|
||||
QNetworkRequest request(url);
|
||||
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
|
||||
manager->get(request);
|
||||
}
|
||||
else {
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
setWindowTitle(tr("OpenTX Contributors"));
|
||||
setWindowIcon(CompanionIcon("contributors.png"));
|
||||
|
||||
QString str = "<html>" \
|
||||
"<head>" \
|
||||
" <style type=\"text/css\">" \
|
||||
" .normal { font-weight:normal;color:#000000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
|
||||
" .bold { font-weight:bold;color:#C00000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
|
||||
" .title { font-weight:bold;color:#000000;font-size:14px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
|
||||
" </style>" \
|
||||
"</head>"
|
||||
"<body class=\"normal\">";
|
||||
|
||||
QFile credits(":/CREDITS.txt");
|
||||
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QStringList names;
|
||||
while (!credits.atEnd()) {
|
||||
QByteArray line = credits.readLine();
|
||||
if (line.trimmed() == "")
|
||||
break;
|
||||
}
|
||||
names.append(line.trimmed());
|
||||
}
|
||||
str.append(formatTable(tr("Main Developers"), names, 3));
|
||||
|
||||
names.clear();
|
||||
while (!credits.atEnd()) {
|
||||
QByteArray line = credits.readLine();
|
||||
names.append(line.trimmed());
|
||||
}
|
||||
str.append(formatTable(tr("Other contributors"), names, 3));
|
||||
}
|
||||
|
||||
QFile donations(":/DONATIONS.txt");
|
||||
if (donations.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QStringList names;
|
||||
while (!donations.atEnd()) {
|
||||
QByteArray line = donations.readLine();
|
||||
if (line.trimmed() == "")
|
||||
break;
|
||||
names.append(line.trimmed());
|
||||
}
|
||||
str.append(formatTable(tr("Companies and projects who have donated to OpenTX"), names, 3));
|
||||
|
||||
names.clear();
|
||||
while (!donations.atEnd()) {
|
||||
QByteArray line = donations.readLine();
|
||||
names.append(line);
|
||||
}
|
||||
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>" \
|
||||
"</table>");
|
||||
|
||||
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
ui->textEditor->setOpenExternalLinks(true);
|
||||
}
|
||||
|
||||
void contributorsDialog::showEvent ( QShowEvent * )
|
||||
ContributorsDialog::~ContributorsDialog()
|
||||
{
|
||||
ui->textEditor->scroll(0, 0);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
contributorsDialog::~contributorsDialog()
|
||||
QString ContributorsDialog::formatTable(const QString & title, const QStringList & names, int columns)
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
const float cwidth = 100.0 / columns;
|
||||
QString str = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>" \
|
||||
" <tr><td class=\"normal\"> </td></tr>" \
|
||||
" <tr><td class=\"title\">" + title + "</td></tr>" \
|
||||
"</table>";
|
||||
|
||||
void contributorsDialog::replyFinished(QNetworkReply * reply)
|
||||
{
|
||||
ui->textEditor->setHtml(reply->readAll());
|
||||
}
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
|
||||
void contributorsDialog::forceClose()
|
||||
{
|
||||
accept();;
|
||||
int column = 0;
|
||||
foreach(QString name, names) {
|
||||
if (column == 0) {
|
||||
str.append("<tr>");
|
||||
}
|
||||
QString trclass = name.contains("monthly") ? "bold" : "normal";
|
||||
str.append(QString("<td width=\"%1%\" class=\"%2\">%3</td>").arg(cwidth).arg(trclass).arg(name.trimmed().replace("monthly", tr("monthly"))));
|
||||
if (++column == columns) {
|
||||
str.append("</tr>");
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (column != 0) {
|
||||
str.append("</tr>");
|
||||
}
|
||||
|
||||
str.append("</table>");
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -2,30 +2,22 @@
|
||||
#define CONTRIBUTORSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "downloaddialog.h"
|
||||
|
||||
namespace Ui {
|
||||
class contributorsDialog;
|
||||
class HtmlDialog;
|
||||
}
|
||||
|
||||
class contributorsDialog : public QDialog
|
||||
class ContributorsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit contributorsDialog(QWidget *parent = 0, int contest = 0, QString rnurl = QString() );
|
||||
~contributorsDialog();
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
Ui::contributorsDialog *ui;
|
||||
QNetworkAccessManager *manager;
|
||||
public:
|
||||
explicit ContributorsDialog(QWidget * parent = 0);
|
||||
~ContributorsDialog();
|
||||
|
||||
void showEvent ( QShowEvent * );
|
||||
|
||||
private slots:
|
||||
void forceClose();
|
||||
void replyFinished(QNetworkReply * reply);
|
||||
|
||||
private:
|
||||
Ui::HtmlDialog * ui;
|
||||
QString formatTable(const QString & title, const QStringList & names, int colums);
|
||||
};
|
||||
|
||||
#endif // CONTRIBUTORSDIALOG_H
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#include "converteeprom.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include <QFile>
|
||||
|
||||
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmwareFilename)
|
||||
{
|
||||
Firmware *currentFirmware = GetCurrentFirmware();
|
||||
FirmwareInterface firmware(firmwareFilename);
|
||||
if (!firmware.isValid())
|
||||
return false;
|
||||
|
||||
unsigned int version = firmware.getEEpromVersion();
|
||||
unsigned int variant = firmware.getEEpromVariant();
|
||||
|
||||
QFile sourceFile(sourceEEprom);
|
||||
int eeprom_size = sourceFile.size();
|
||||
if (!eeprom_size)
|
||||
return false;
|
||||
|
||||
if (!sourceFile.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
QByteArray eeprom(eeprom_size, 0);
|
||||
long result = sourceFile.read(eeprom.data(), eeprom_size);
|
||||
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))
|
||||
return false;
|
||||
|
||||
QFile destinationFile(destinationEEprom);
|
||||
if (!destinationFile.open(QIODevice::WriteOnly))
|
||||
return false;
|
||||
|
||||
result = destinationFile.write(eeprom.constData(), eeprom_size);
|
||||
destinationFile.close();
|
||||
if (result != eeprom_size)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#ifndef CONVERTHEADER_H_
|
||||
#define CONVERTHEADER_H_
|
||||
|
||||
#include <QString>
|
||||
|
||||
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmware);
|
||||
|
||||
#endif /* CONVERTHEADER_H_ */
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef customdebug_h
|
||||
#define customdebug_h
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
// Controls the generation of debug output for EEPROM import
|
||||
#if defined(DEBUG_MODEL_IMPORT)
|
||||
inline QDebug eepromImportDebug() { return QDebug(QtDebugMsg); }
|
||||
#else
|
||||
#undef eepromImportDebug
|
||||
inline QNoDebug eepromImportDebug() { return QNoDebug(); }
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,12 +1,10 @@
|
||||
#include "customizesplashdialog.h"
|
||||
#include "ui_customizesplashdialog.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "flashfirmwaredialog.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "burndialog.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
//*** Side Class ***
|
||||
|
||||
@@ -44,12 +42,12 @@ bool Side::displayImage( QString fileName, Source pictSource )
|
||||
|
||||
// Determine which picture format to use
|
||||
if (pictSource == FW ){
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.hasSplash())
|
||||
FirmwareInterface firmware(fileName);
|
||||
if (!firmware.hasSplash())
|
||||
return false;
|
||||
else
|
||||
image = flash.getSplash();
|
||||
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
|
||||
image = firmware.getSplash();
|
||||
*format = (firmware.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
|
||||
}
|
||||
else {
|
||||
image.load(fileName);
|
||||
@@ -105,12 +103,12 @@ bool Side::saveImage()
|
||||
{
|
||||
if (*source == FW )
|
||||
{
|
||||
FlashInterface flash(*saveToFileName);
|
||||
if (!flash.hasSplash()) {
|
||||
FirmwareInterface firmware(*saveToFileName);
|
||||
if (!firmware.hasSplash()) {
|
||||
return false;
|
||||
}
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(firmware.getSplashWidth(), firmware.getSplashHeight());
|
||||
if (firmware.setSplash(image) && (firmware.save(*saveToFileName) > 0)) {
|
||||
g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include "flashinterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef eeprom_importexport_h
|
||||
#define eeprom_importexport_h
|
||||
|
||||
#include "customdebug.h"
|
||||
|
||||
#define DIM(arr) (sizeof((arr))/sizeof((arr)[0]))
|
||||
|
||||
class DataField {
|
||||
@@ -104,10 +106,10 @@ class ProxyField: public DataField {
|
||||
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class UnsignedField: public DataField {
|
||||
template<class container, int N>
|
||||
class BaseUnsignedField: public DataField {
|
||||
public:
|
||||
explicit UnsignedField(unsigned int & field):
|
||||
explicit BaseUnsignedField(container & field):
|
||||
DataField("Unsigned"),
|
||||
field(field),
|
||||
min(0),
|
||||
@@ -115,7 +117,7 @@ class UnsignedField: public DataField {
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, const char *name):
|
||||
BaseUnsignedField(container & field, const char *name):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(0),
|
||||
@@ -123,7 +125,7 @@ class UnsignedField: public DataField {
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
|
||||
BaseUnsignedField(container & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(min),
|
||||
@@ -133,7 +135,7 @@ class UnsignedField: public DataField {
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
unsigned int value = field;
|
||||
container value = field;
|
||||
if (value > max) value = max;
|
||||
if (value < min) value = min;
|
||||
|
||||
@@ -151,6 +153,7 @@ class UnsignedField: public DataField {
|
||||
if (input[i])
|
||||
field |= (1<<i);
|
||||
}
|
||||
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
@@ -159,12 +162,32 @@ class UnsignedField: public DataField {
|
||||
}
|
||||
|
||||
protected:
|
||||
unsigned int & field;
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
container & field;
|
||||
container min;
|
||||
container max;
|
||||
|
||||
private:
|
||||
UnsignedField();
|
||||
BaseUnsignedField();
|
||||
};
|
||||
|
||||
template <int N>
|
||||
class UnsignedField : public BaseUnsignedField<unsigned int, N>
|
||||
{
|
||||
public:
|
||||
explicit UnsignedField(unsigned int & field):
|
||||
BaseUnsignedField<unsigned int, N>(field)
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, const char *name):
|
||||
BaseUnsignedField<unsigned int, N>(field, name)
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
|
||||
BaseUnsignedField<unsigned int, N>(field, min, max, name)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<int N>
|
||||
@@ -187,6 +210,7 @@ class BoolField: public DataField {
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
field = input[0] ? true : false;
|
||||
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
@@ -256,6 +280,7 @@ class SignedField: public DataField {
|
||||
}
|
||||
|
||||
field = (int)value;
|
||||
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
@@ -316,6 +341,7 @@ class CharField: public DataField {
|
||||
}
|
||||
field[i] = idx;
|
||||
}
|
||||
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
@@ -373,6 +399,7 @@ class ZCharField: public DataField {
|
||||
else
|
||||
break;
|
||||
}
|
||||
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
@@ -398,6 +425,7 @@ class StructField: public DataField {
|
||||
}
|
||||
|
||||
inline void Append(DataField *field) {
|
||||
//eepromImportDebug() << QString("StructField(%1) appending field: %2").arg(name).arg(field->getName());
|
||||
fields.append(field);
|
||||
}
|
||||
|
||||
@@ -415,6 +443,7 @@ class StructField: public DataField {
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
eepromImportDebug() << QString("\timporting %1[%2]:").arg(name).arg(fields.size());
|
||||
int offset = 0;
|
||||
foreach(DataField *field, fields) {
|
||||
unsigned int size = field->size();
|
||||
@@ -469,6 +498,7 @@ class TransformedField: public DataField {
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
eepromImportDebug() << QString("\timporting TransformedField %1:").arg(field.getName());
|
||||
field.ImportBits(input);
|
||||
afterImport();
|
||||
}
|
||||
@@ -505,7 +535,7 @@ class ConversionTable {
|
||||
{
|
||||
after = 0;
|
||||
|
||||
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
|
||||
for (std::list<ConversionTuple>::iterator it=exportTable.begin(); it!=exportTable.end(); it++) {
|
||||
ConversionTuple tuple = *it;
|
||||
if (before == tuple.a) {
|
||||
after = tuple.b;
|
||||
@@ -520,7 +550,7 @@ class ConversionTable {
|
||||
{
|
||||
after = 0;
|
||||
|
||||
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
|
||||
for (std::list<ConversionTuple>::iterator it=importTable.begin(); it!=importTable.end(); it++) {
|
||||
ConversionTuple tuple = *it;
|
||||
if (before == tuple.b) {
|
||||
after = tuple.a;
|
||||
@@ -547,10 +577,23 @@ class ConversionTable {
|
||||
|
||||
void addConversion(const int a, const int b)
|
||||
{
|
||||
internalTable.push_back(ConversionTuple(a, b));
|
||||
ConversionTuple conversion(a, b);
|
||||
importTable.push_back(conversion);
|
||||
exportTable.push_back(conversion);
|
||||
}
|
||||
|
||||
std::list<ConversionTuple> internalTable;
|
||||
void addImportConversion(const int a, const int b)
|
||||
{
|
||||
importTable.push_back(ConversionTuple(a, b));
|
||||
}
|
||||
|
||||
void addExportConversion(const int a, const int b)
|
||||
{
|
||||
exportTable.push_back(ConversionTuple(a, b));
|
||||
}
|
||||
|
||||
std::list<ConversionTuple> importTable;
|
||||
std::list<ConversionTuple> exportTable;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
@@ -648,7 +691,7 @@ class ConversionField: public TransformedField {
|
||||
if (table->exportValue(_field, _field))
|
||||
return;
|
||||
if (!error.isEmpty())
|
||||
EEPROMWarnings += error + "\n";
|
||||
EEPROMWarnings.push_back(error);
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
@@ -682,6 +725,7 @@ class ConversionField: public TransformedField {
|
||||
if (scale) {
|
||||
field *= scale;
|
||||
}
|
||||
eepromImportDebug() << QString("\timported ConversionField<%1>:").arg(internalField.getName()) << QString(" before: %1, after: %2").arg(_field).arg(field);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
+623
-290
File diff suppressed because it is too large
Load Diff
+578
-419
File diff suppressed because it is too large
Load Diff
+148
-19
@@ -15,30 +15,51 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "stdio.h"
|
||||
#include "inttypes.h"
|
||||
#include "string.h"
|
||||
#include "file.h"
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include "eeprominterface.h"
|
||||
#include "file.h"
|
||||
|
||||
RleFile::RleFile():
|
||||
eeprom(NULL),
|
||||
eeprom_size(0),
|
||||
eeFs(NULL),
|
||||
eeFsArm(NULL)
|
||||
eeFsArm(NULL),
|
||||
eepromFatHeader(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
#define EEPROM_SIZE (4*1024*1024/8)
|
||||
#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)
|
||||
#define FIRST_FILE_AVAILABLE (1+MAX_MODELS)
|
||||
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
this->board = board;
|
||||
this->version = version;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
memset(eeprom, 0xFF, size);
|
||||
if (version >= 217) {
|
||||
eepromFatHeader = (EepromHeader *)eeprom;
|
||||
eepromFatHeader->mark = EEPROM_MARK;
|
||||
eepromFatHeader->index = 1;
|
||||
for (int i=0; i<EEPROM_MAX_FILES; i++) {
|
||||
eepromFatHeader->files[i].exists = 0;
|
||||
eepromFatHeader->files[i].zoneIndex = i+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
eeFsArm = (EeFsArm *)eeprom;
|
||||
@@ -62,7 +83,7 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = (board==BOARD_GRUVIN9X || board==BOARD_M128) ? 5 : 4;
|
||||
eeFsVersion = (IS_2560(board) || board==BOARD_M128) ? 5 : 4;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
|
||||
@@ -92,6 +113,30 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
}
|
||||
}
|
||||
|
||||
PACK(struct EepromFileHeader
|
||||
{
|
||||
uint16_t fileIndex;
|
||||
uint16_t size;
|
||||
});
|
||||
|
||||
bool RleFile::searchFat()
|
||||
{
|
||||
int bestFatIndex = -1;
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (bestFatIndex >= 0) {
|
||||
eepromFatHeader = (EepromHeader *)(eeprom+bestFatIndex*EEPROM_FAT_SIZE);;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
@@ -99,6 +144,7 @@ bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
this->board = board;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
searchFat();
|
||||
return 1;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
@@ -249,8 +295,20 @@ unsigned int RleFile::size(unsigned int id)
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
|
||||
m_pos = sizeof(t_eeprom_header);
|
||||
if (eepromFatHeader) {
|
||||
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
|
||||
if (eepromFatHeader->files[i_fileId].exists) {
|
||||
eeprom_read_block(&m_size, m_fileId*(1<<13)+sizeof(uint16_t), sizeof(uint16_t));
|
||||
}
|
||||
else {
|
||||
m_size = 0;
|
||||
}
|
||||
m_pos = sizeof(EepromFileHeader);
|
||||
}
|
||||
else {
|
||||
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
|
||||
m_pos = sizeof(t_eeprom_header);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
@@ -293,11 +351,19 @@ unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
memset(buf, 0, i_len);
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
int len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
|
||||
if (len > 0) {
|
||||
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
|
||||
int len;
|
||||
if (eepromFatHeader) {
|
||||
len = std::min((int)i_len, (int)m_size + (int)sizeof(EepromFileHeader) - (int)m_pos);
|
||||
eeprom_read_block(buf, (m_fileId << 13) + m_pos, len);
|
||||
m_pos += len;
|
||||
}
|
||||
else {
|
||||
len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
|
||||
if (len > 0) {
|
||||
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
|
||||
m_pos += len;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
else {
|
||||
@@ -344,6 +410,57 @@ unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)src.data();
|
||||
unsigned int len = src.size();
|
||||
uint8_t zeroes = 0;
|
||||
uint8_t bRlc = 0;
|
||||
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
|
||||
for (int i=0; i<bRlc; i++) {
|
||||
dst.append(*buf++);
|
||||
if (--len == 0)
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
bRlc = *buf++;
|
||||
--len;
|
||||
|
||||
if (!(bRlc & 0x7f)) {
|
||||
qDebug() << "RLC decoding error!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rlcVersion == 2) {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = (bRlc>>4) & 0x07;
|
||||
bRlc = bRlc & 0x0f;
|
||||
}
|
||||
else if (bRlc&0x40){
|
||||
zeroes = bRlc & 0x3f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = bRlc & 0x7f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
unsigned int RleFile::write1(uint8_t b)
|
||||
{
|
||||
return write(&b, 1);
|
||||
@@ -460,13 +577,25 @@ unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const u
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
openRd(i_fileId);
|
||||
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
|
||||
t_eeprom_header header;
|
||||
header.sequence_no = 1;
|
||||
header.data_size = i_len;
|
||||
header.flags = 0;
|
||||
header.hcsum = byte_checksum((uint8_t *) &header, 7);
|
||||
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
|
||||
if (eepromFatHeader) {
|
||||
eepromFatHeader->files[i_fileId].exists = 1;
|
||||
eeprom_write_block(buf, (m_fileId << 13) + m_pos, i_len);
|
||||
{
|
||||
EepromFileHeader header;
|
||||
header.fileIndex = i_fileId;
|
||||
header.size = i_len;
|
||||
eeprom_write_block(&header, (m_fileId << 13), sizeof(header));
|
||||
}
|
||||
}
|
||||
else {
|
||||
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
|
||||
t_eeprom_header header;
|
||||
header.sequence_no = 1;
|
||||
header.data_size = i_len;
|
||||
header.flags = 0;
|
||||
header.hcsum = byte_checksum((uint8_t *) &header, 7);
|
||||
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
|
||||
}
|
||||
return i_len;
|
||||
}
|
||||
else {
|
||||
|
||||
+20
-1
@@ -61,6 +61,19 @@ struct t_eeprom_header
|
||||
uint8_t hcsum ;
|
||||
};
|
||||
|
||||
PACK(struct EepromHeaderFile
|
||||
{
|
||||
uint8_t zoneIndex:7;
|
||||
uint8_t exists:1;
|
||||
});
|
||||
|
||||
PACK(struct EepromHeader
|
||||
{
|
||||
uint32_t mark;
|
||||
uint32_t index;
|
||||
EepromHeaderFile files[63];
|
||||
});
|
||||
|
||||
class RleFile
|
||||
{
|
||||
uint8_t m_fileId; //index of file in directory = filename
|
||||
@@ -73,6 +86,7 @@ class RleFile
|
||||
uint16_t m_size;
|
||||
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
uint8_t *eeprom;
|
||||
unsigned int eeprom_size;
|
||||
EeFs *eeFs;
|
||||
@@ -85,6 +99,8 @@ class RleFile
|
||||
unsigned int eeFsBlocksMax;
|
||||
unsigned int eeFsLinkSize;
|
||||
|
||||
EepromHeader * eepromFatHeader;
|
||||
|
||||
void eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size);
|
||||
void eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size);
|
||||
|
||||
@@ -98,12 +114,13 @@ class RleFile
|
||||
unsigned int EeFsGetFree();
|
||||
void EeFsFree(unsigned int blk); // free one or more blocks
|
||||
unsigned int EeFsAlloc(); // alloc one block from freelist
|
||||
bool searchFat();
|
||||
|
||||
public:
|
||||
|
||||
RleFile();
|
||||
|
||||
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
|
||||
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version);
|
||||
|
||||
bool EeFsOpen(uint8_t *eeprom, int size, BoardEnum board);
|
||||
|
||||
@@ -146,4 +163,6 @@ public:
|
||||
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
|
||||
};
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion=2);
|
||||
|
||||
#endif
|
||||
|
||||
Regular → Executable
+63
-41
@@ -17,7 +17,7 @@
|
||||
#include <QtGui>
|
||||
#include "hexinterface.h"
|
||||
#include "splash.h"
|
||||
#include "flashinterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "helpers.h"
|
||||
|
||||
#define VERS_MARK "VERS"
|
||||
@@ -42,7 +42,7 @@ int getFileType(const QString &fullFileName)
|
||||
return 0;
|
||||
}
|
||||
|
||||
FlashInterface::FlashInterface(QString fileName):
|
||||
FirmwareInterface::FirmwareInterface(const QString &filename):
|
||||
flash(MAX_FSIZE, 0),
|
||||
flash_size(0),
|
||||
versionId(0),
|
||||
@@ -52,8 +52,8 @@ FlashInterface::FlashInterface(QString fileName):
|
||||
splash_height(0),
|
||||
isValidFlag(false)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
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);
|
||||
@@ -67,6 +67,11 @@ FlashInterface::FlashInterface(QString fileName):
|
||||
|
||||
if (flash_size > 0) {
|
||||
version = seekLabel(VERS_MARK);
|
||||
if (version.startsWith("opentx-")) {
|
||||
int index = version.lastIndexOf('-');
|
||||
flavour = version.mid(0, index);
|
||||
version = version.mid(index+1);
|
||||
}
|
||||
date = seekLabel(DATE_MARK);
|
||||
time = seekLabel(TIME_MARK);
|
||||
eepromId = seekLabel(EEPR_MARK);
|
||||
@@ -82,11 +87,11 @@ FlashInterface::FlashInterface(QString fileName):
|
||||
|
||||
versionId = version2index(version);
|
||||
SeekSplash();
|
||||
isValidFlag = true;
|
||||
isValidFlag = !version.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
QString FlashInterface::seekString(const QString & string)
|
||||
QString FirmwareInterface::seekString(const QString & string)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
@@ -94,7 +99,7 @@ QString FlashInterface::seekString(const QString & string)
|
||||
if (start > 0) {
|
||||
start += string.length();
|
||||
int end = -1;
|
||||
for (int i=start; i<start+20; i++) {
|
||||
for (int i=start; i<start+50; i++) {
|
||||
char c = flash.at(i);
|
||||
if (c == '\0' || c == '\036') {
|
||||
end = i;
|
||||
@@ -109,7 +114,7 @@ QString FlashInterface::seekString(const QString & string)
|
||||
return result;
|
||||
}
|
||||
|
||||
QString FlashInterface::seekLabel(const QString & label)
|
||||
QString FirmwareInterface::seekLabel(const QString & label)
|
||||
{
|
||||
QString result = seekString(label + "\037\033:");
|
||||
if (!result.isEmpty())
|
||||
@@ -118,7 +123,30 @@ QString FlashInterface::seekLabel(const QString & label)
|
||||
return seekString(label + ":");
|
||||
}
|
||||
|
||||
bool FlashInterface::SeekSplash(QByteArray splash)
|
||||
QString FirmwareInterface::getFlavour() const
|
||||
{
|
||||
if (flavour == "opentx-x9dp")
|
||||
return "opentx-taranis-plus";
|
||||
else if (flavour == "opentx-x9d")
|
||||
return "opentx-taranis";
|
||||
else
|
||||
return flavour;
|
||||
}
|
||||
|
||||
bool FirmwareInterface::isHardwareCompatible(const FirmwareInterface &previousFirmware) const
|
||||
{
|
||||
QString newFlavour = getFlavour();
|
||||
if (newFlavour.isEmpty())
|
||||
return true;
|
||||
|
||||
QString previousFlavour = previousFirmware.getFlavour();
|
||||
if (previousFlavour.isEmpty())
|
||||
return true;
|
||||
|
||||
return (newFlavour == previousFlavour);
|
||||
}
|
||||
|
||||
bool FirmwareInterface::SeekSplash(QByteArray splash)
|
||||
{
|
||||
int start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
@@ -131,7 +159,7 @@ bool FlashInterface::SeekSplash(QByteArray splash)
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
bool FirmwareInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
{
|
||||
int start = 0;
|
||||
while (start>=0) {
|
||||
@@ -157,7 +185,7 @@ bool FlashInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
#define OTX_SPE "SPE"
|
||||
#define OTX_SPE_SIZE 4
|
||||
|
||||
void FlashInterface::SeekSplash(void)
|
||||
void FirmwareInterface::SeekSplash(void)
|
||||
{
|
||||
splash_size = 0;
|
||||
splash_offset = 0;
|
||||
@@ -209,7 +237,7 @@ void FlashInterface::SeekSplash(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
return false;
|
||||
@@ -219,21 +247,13 @@ bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
QColor color;
|
||||
QByteArray splash;
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
unsigned int idx = 0;
|
||||
for (unsigned int y=0; y<splash_height; y+=8) {
|
||||
for (unsigned int x=0; x<splash_width; x++) {
|
||||
unsigned int values[] = { 255, 255, 255, 255 };
|
||||
for (unsigned int z=0; z<8; z++) {
|
||||
if (y+z < splash_height) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y+z));
|
||||
for (unsigned int i=0; i<4; i++) {
|
||||
if (gray & (1<<(4+i)))
|
||||
values[i] -= 1 << z;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<4; i++)
|
||||
b[idx++] = values[i];
|
||||
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++) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y));
|
||||
uint8_t z = ((255-gray)*15)/255;
|
||||
if (y & 1) z <<= 4;
|
||||
b[idx] |= z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +263,7 @@ bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
|
||||
b[splash_width*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,22 +273,22 @@ bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
return true;
|
||||
}
|
||||
|
||||
int FlashInterface::getSplashWidth()
|
||||
int FirmwareInterface::getSplashWidth()
|
||||
{
|
||||
return splash_width;
|
||||
}
|
||||
|
||||
uint FlashInterface::getSplashHeight()
|
||||
uint FirmwareInterface::getSplashHeight()
|
||||
{
|
||||
return splash_height;
|
||||
}
|
||||
|
||||
QImage::Format FlashInterface::getSplashFormat()
|
||||
QImage::Format FirmwareInterface::getSplashFormat()
|
||||
{
|
||||
return splash_format;
|
||||
}
|
||||
|
||||
QImage FlashInterface::getSplash()
|
||||
QImage FirmwareInterface::getSplash()
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
return QImage(); // empty image
|
||||
@@ -278,10 +298,10 @@ QImage FlashInterface::getSplash()
|
||||
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/8)*splash_width*4;
|
||||
unsigned int mask = (1 << (y%8));
|
||||
for (unsigned int x=0; x<splash_width; x++, idx+=4) {
|
||||
unsigned int z = ((flash.at(splash_offset+idx) & mask) ? 0x1 : 0) + ((flash.at(splash_offset+idx+1) & mask) ? 0x2 : 0) + ((flash.at(splash_offset+idx+2) & mask) ? 0x4 : 0) + ((flash.at(splash_offset+idx+3) & mask) ? 0x8 : 0);
|
||||
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);
|
||||
unsigned int z = (y & 1) ? (byte >> 4) : (byte & 0x0F);
|
||||
z = 255-(z*255)/15;
|
||||
QRgb rgb = qRgb(z, z, z);
|
||||
image.setPixel(x, y, rgb);
|
||||
@@ -293,25 +313,27 @@ QImage FlashInterface::getSplash()
|
||||
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++)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return image;
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashInterface::hasSplash()
|
||||
bool FirmwareInterface::hasSplash()
|
||||
{
|
||||
return (splash_offset > 0 ? true : false);
|
||||
}
|
||||
|
||||
bool FlashInterface::isValid()
|
||||
bool FirmwareInterface::isValid()
|
||||
{
|
||||
return isValidFlag;
|
||||
}
|
||||
|
||||
uint FlashInterface::saveFlash(QString fileName)
|
||||
unsigned int FirmwareInterface::save(QString fileName)
|
||||
{
|
||||
uint8_t binflash[MAX_FSIZE];
|
||||
memcpy(&binflash, flash.constData(), flash_size);
|
||||
Regular → Executable
+12
-11
@@ -12,13 +12,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FLASHINTERFACE_H
|
||||
#define FLASHINTERFACE_H
|
||||
#ifndef FIRMWAREINTERFACE_H_
|
||||
#define FIRMWAREINTERFACE_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <inttypes.h>
|
||||
#include "file.h"
|
||||
#include <QString>
|
||||
#include <QImage>
|
||||
#include <QByteArray>
|
||||
|
||||
#define MAX_FSIZE (512*1024)
|
||||
#define SPLASH_WIDTH (128)
|
||||
@@ -40,13 +39,15 @@
|
||||
|
||||
int getFileType(const QString &fullFileName);
|
||||
|
||||
class FlashInterface
|
||||
class FirmwareInterface
|
||||
{
|
||||
public:
|
||||
FlashInterface(QString filename);
|
||||
FirmwareInterface(const QString &filename);
|
||||
inline QString getDate() { return date; }
|
||||
inline QString getTime() { return time; }
|
||||
int getSize() { return flash_size; }
|
||||
QString getFlavour() const;
|
||||
bool isHardwareCompatible(const FirmwareInterface &previousFirmware) const;
|
||||
inline QString getVersion() { return version; }
|
||||
unsigned int getVersionId() { return versionId; }
|
||||
inline int getEEpromVersion() { return eepromVersion; }
|
||||
@@ -58,7 +59,7 @@ class FlashInterface
|
||||
int getSplashWidth();
|
||||
uint getSplashHeight();
|
||||
QImage::Format getSplashFormat();
|
||||
uint saveFlash(QString fileName);
|
||||
unsigned int save(QString fileName);
|
||||
bool isValid();
|
||||
|
||||
private:
|
||||
@@ -72,6 +73,7 @@ class FlashInterface
|
||||
QString filename;
|
||||
QString date;
|
||||
QString time;
|
||||
QString flavour;
|
||||
QString version;
|
||||
int versionId;
|
||||
QString eepromId;
|
||||
@@ -86,5 +88,4 @@ class FlashInterface
|
||||
bool isValidFlag;
|
||||
};
|
||||
|
||||
#endif /* FLASHINTERFACE_H */
|
||||
|
||||
#endif /* FIRMWAREINTERFACE_H_ */
|
||||
@@ -85,13 +85,13 @@ Er9xGeneral::operator GeneralSettings ()
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
result.beeperMode = GeneralSettings::BEEPER_QUIET;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperMode = GeneralSettings::BEEPER_ALL;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
@@ -138,8 +138,8 @@ t_Er9xLimitData::t_Er9xLimitData()
|
||||
t_Er9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -358,7 +358,6 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
||||
c9x.timers[0].dir = tmrDir;
|
||||
c9x.timers[0].val = tmrVal;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -377,19 +376,18 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
c9x.customFn[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
|
||||
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
|
||||
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = er9xToSource(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
@@ -443,7 +441,7 @@ t_Er9xModelData::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ER9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -461,15 +459,13 @@ t_Er9xModelData::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
|
||||
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
|
||||
@@ -195,13 +195,13 @@ PACK(typedef struct t_gvar {
|
||||
// int8_t gvswitch ;
|
||||
}) Er9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_PhaseData {
|
||||
PACK(typedef struct t_FlightModeData {
|
||||
// Trim store as -1001 to -1, trim value-501, 0-5 use trim of phase 0-5
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of modes 1|2|3|4 instead
|
||||
int8_t swtch; // Try 0-5 use trim of phase 0-5, 1000-2000, trim + 1500 ???
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
}) Er9xPhaseData;
|
||||
}) Er9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Er9xModelData {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
@@ -241,7 +241,7 @@ PACK(typedef struct t_Er9xModelData {
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ER9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ER9X_MAX_CURVE9][9];
|
||||
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
|
||||
Er9xLogicalSwitchData logicalSw[ER9X_NUM_CSW];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
int8_t tmrModeB;
|
||||
uint8_t numVoice;
|
||||
@@ -251,7 +251,7 @@ PACK(typedef struct t_Er9xModelData {
|
||||
uint8_t unused1[8] ;
|
||||
uint8_t CustomDisplayIndex[6] ;
|
||||
Er9xGvarData gvars[ER9X_MAX_GVARS] ;
|
||||
Er9xPhaseData phaseData[ER9X_MAX_MODES] ;
|
||||
Er9xFlightModeData flightModeData[ER9X_MAX_MODES] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <iostream>
|
||||
#include "er9xinterface.h"
|
||||
#include "er9xeeprom.h"
|
||||
#include "er9xsimulator.h"
|
||||
#include "simulator/er9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
@@ -75,12 +75,12 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
|
||||
for (int i=0; i<ER9X_MAX_MIXERS; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(er9x-simulator er9xsimulator.cpp)
|
||||
+18
-18
@@ -47,7 +47,7 @@ namespace Er9x {
|
||||
uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
@@ -73,14 +73,14 @@ void getTrims(int16_t values[4])
|
||||
values[i] = g_model.trim[i];
|
||||
}
|
||||
|
||||
#define GPIO_TRIM_LH_L pind
|
||||
#define GPIO_TRIM_LV_DN pind
|
||||
#define GPIO_TRIM_RV_UP pind
|
||||
#define GPIO_TRIM_RH_L pind
|
||||
#define GPIO_TRIM_LH_R pind
|
||||
#define GPIO_TRIM_LV_UP pind
|
||||
#define GPIO_TRIM_RV_DN pind
|
||||
#define GPIO_TRIM_RH_R pind
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
|
||||
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
|
||||
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
|
||||
@@ -98,14 +98,14 @@ void getTrims(int16_t values[4])
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -50,10 +50,12 @@ class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
protected:
|
||||
|
||||
Er9xInterface * er9xInterface;
|
||||
@@ -105,13 +105,13 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
result.beeperMode = GeneralSettings::BEEPER_QUIET;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperMode = GeneralSettings::BEEPER_ALL;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
@@ -147,8 +147,8 @@ t_Ersky9xLimitData::t_Ersky9xLimitData()
|
||||
t_Ersky9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -489,7 +489,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
|
||||
c9x.timers[i].dir = timer[i].tmrDir;
|
||||
c9x.timers[i].val = timer[i].tmrVal;
|
||||
}
|
||||
switch(protocol) {
|
||||
@@ -509,19 +508,18 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
c9x.customFn[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
|
||||
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
|
||||
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = ersky9xToSource_v10(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
@@ -571,7 +569,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -589,15 +587,13 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
|
||||
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -608,7 +604,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
|
||||
c9x.timers[i].dir = timer[i].tmrDir;
|
||||
c9x.timers[i].val = timer[i].tmrVal;
|
||||
}
|
||||
switch(protocol) {
|
||||
@@ -628,19 +623,18 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
c9x.customFn[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
|
||||
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
|
||||
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = ersky9xToSource_v11(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
@@ -690,7 +684,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -708,26 +702,12 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
|
||||
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
// for (int i=0; i<8; i++) {
|
||||
// c9x.frskyalarms[i].frskyAlarmLimit=frskyAlarms.alarmData[i].frskyAlarmLimit;
|
||||
// c9x.frskyalarms[i].frskyAlarmSound=frskyAlarms.alarmData[i].frskyAlarmSound;
|
||||
// c9x.frskyalarms[i].frskyAlarmType=frskyAlarms.alarmData[i].frskyAlarmType;
|
||||
// }
|
||||
// for (int i=0; i<8; i++) {
|
||||
// c9x.customdisplay[i]=customDisplayIndex[i];
|
||||
// }
|
||||
for (int i=0; i<5;i++) {
|
||||
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
|
||||
// c9x.gvsource[i]=gvars[i].gvsource;
|
||||
c9x.flightModeData[0].gvars[i]=gvars[i].gvar;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -237,22 +237,22 @@ PACK(typedef struct t_Ersky9xgvar {
|
||||
// int8_t gvswitch ;
|
||||
}) Ersky9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_Ersky9xPhaseData {
|
||||
PACK(typedef struct t_Ersky9xFlightModeData {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
uint16_t spare ; // Future expansion
|
||||
}) Ersky9xPhaseData;
|
||||
}) Ersky9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
|
||||
PACK(typedef struct t_Ersky9xCustomFunctionData { // Function Switches data
|
||||
int8_t swtch; //input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
uint8_t delay;
|
||||
uint8_t spare;
|
||||
}) Ersky9xFuncSwData;
|
||||
}) Ersky9xCustomFunctionData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
@@ -360,7 +360,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
|
||||
Ersky9xLogicalSwitchData_v10 logicalSw[ERSKY9X_NUM_CSW_V10];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t res3[2];
|
||||
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
|
||||
@@ -409,7 +409,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
int8_t curvexy[18];
|
||||
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
Ersky9xLogicalSwitchData_v11 logicalSw[ERSKY9X_NUM_CSW_V11];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t bt_telemetry;
|
||||
uint8_t numVoice; // 0-16, rest are Safety switches
|
||||
@@ -420,8 +420,8 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
|
||||
// Add 6 bytes for custom telemetry screen
|
||||
uint8_t customDisplayIndex[6] ;
|
||||
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
|
||||
Ersky9xPhaseData phaseData[6] ;
|
||||
Ersky9xCustomFunctionData customFn[ERSKY9X_NUM_FSW];
|
||||
Ersky9xFlightModeData flightModeData[6] ;
|
||||
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
|
||||
|
||||
operator ModelData();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <QMessageBox>
|
||||
#include "ersky9xinterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include "ersky9xsimulator.h"
|
||||
#include "simulator/ersky9xsimulator.h"
|
||||
#include "file.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
@@ -74,12 +74,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mod
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -106,12 +106,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(ersky9x-simulator ersky9xsimulator.cpp)
|
||||
+35
-35
@@ -58,7 +58,7 @@ namespace Ersky9x {
|
||||
#include "../ersky9x/sound.cpp"
|
||||
#include "../ersky9x/diskio.cpp"
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
|
||||
//uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
@@ -114,18 +114,18 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
}
|
||||
}
|
||||
|
||||
#define GPIO_BUTTON_MENU PIOB->PIO_PDSR
|
||||
#define GPIO_BUTTON_EXIT PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_UP PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_DOWN PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_RIGHT PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_LEFT PIOC->PIO_PDSR
|
||||
#define PIN_BUTTON_MENU 0x00000020
|
||||
#define PIN_BUTTON_EXIT 0x01000000
|
||||
#define PIN_BUTTON_UP 0x00000002
|
||||
#define PIN_BUTTON_DOWN 0x00000020
|
||||
#define PIN_BUTTON_RIGHT 0x00000010
|
||||
#define PIN_BUTTON_LEFT 0x00000008
|
||||
#define KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_EXIT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_UP PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_DOWN PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_RIGHT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_LEFT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_PIN_MENU 0x00000020
|
||||
#define KEYS_GPIO_PIN_EXIT 0x01000000
|
||||
#define KEYS_GPIO_PIN_UP 0x00000002
|
||||
#define KEYS_GPIO_PIN_DOWN 0x00000020
|
||||
#define KEYS_GPIO_PIN_RIGHT 0x00000010
|
||||
#define KEYS_GPIO_PIN_LEFT 0x00000008
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
@@ -135,23 +135,23 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, GPIO_BUTTON_MENU, PIN_BUTTON_MENU)
|
||||
KEY_CASE(KEY_EXIT, GPIO_BUTTON_EXIT, PIN_BUTTON_EXIT)
|
||||
KEY_CASE(KEY_RIGHT, GPIO_BUTTON_RIGHT, PIN_BUTTON_RIGHT)
|
||||
KEY_CASE(KEY_LEFT, GPIO_BUTTON_LEFT, PIN_BUTTON_LEFT)
|
||||
KEY_CASE(KEY_UP, GPIO_BUTTON_UP, PIN_BUTTON_UP)
|
||||
KEY_CASE(KEY_DOWN, GPIO_BUTTON_DOWN, PIN_BUTTON_DOWN)
|
||||
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
|
||||
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
|
||||
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
|
||||
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
|
||||
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
|
||||
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
|
||||
}
|
||||
}
|
||||
|
||||
#define GPIO_TRIM_LH_L PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_LV_DN PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_RV_UP PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_RH_L PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_LH_R PIOB->PIO_PDSR
|
||||
#define GPIO_TRIM_LV_UP PIOC->PIO_PDSR
|
||||
#define GPIO_TRIM_RV_DN PIOC->PIO_PDSR
|
||||
#define GPIO_TRIM_RH_R PIOC->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LHL PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LVD PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RVU PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RHL PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LHR PIOB->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LVU PIOC->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RVD PIOC->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RHR PIOC->PIO_PDSR
|
||||
#define PIN_TRIM_LH_L 0x00800000
|
||||
#define PIN_TRIM_LV_DN 0x01000000
|
||||
#define PIN_TRIM_RV_UP 0x00000002
|
||||
@@ -166,14 +166,14 @@ void simuSetKey(uint8_t key, bool state)
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -50,10 +50,12 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
protected:
|
||||
|
||||
Ersky9xInterface * ersky9xInterface;
|
||||
@@ -88,13 +88,13 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
result.beeperMode = GeneralSettings::BEEPER_QUIET;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperMode = GeneralSettings::BEEPER_ALL;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||
result.view = view;
|
||||
result.disableThrottleWarning = disableThrottleWarning;
|
||||
result.switchWarning = switchWarning;
|
||||
result.beeperMode = (BeeperMode)beeperVal;
|
||||
result.beeperMode = (GeneralSettings::BeeperMode)beeperVal;
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
result.disableAlarmWarning = disableAlarmWarning;
|
||||
result.stickMode = stickMode;
|
||||
@@ -201,8 +201,8 @@ t_Gruvin9xLimitData::t_Gruvin9xLimitData()
|
||||
t_Gruvin9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -322,9 +322,9 @@ Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Gruvin9xFuncSwData::operator FuncSwData ()
|
||||
Gruvin9xCustomFunctionData::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
|
||||
return c9x;
|
||||
@@ -338,18 +338,18 @@ t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
|
||||
t_Gruvin9xSwashRingData::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = gruvin9xToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xPhaseData_v102::operator PhaseData ()
|
||||
t_Gruvin9xFlightModeData_v102::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
@@ -359,9 +359,9 @@ t_Gruvin9xPhaseData_v102::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xPhaseData_v106::operator PhaseData ()
|
||||
t_Gruvin9xFlightModeData_v106::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
@@ -378,7 +378,6 @@ t_Gruvin9xTimerData::operator TimerData ()
|
||||
TimerData c9x;
|
||||
c9x.mode = getEr9xTimerMode(mode);
|
||||
c9x.val = val;
|
||||
c9x.dir = dir;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -447,14 +446,13 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
@@ -478,7 +476,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
@@ -518,14 +516,13 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
@@ -549,7 +546,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
@@ -589,7 +586,6 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
@@ -597,20 +593,20 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (phaseData[i].trim[j] > 125) {
|
||||
c9x.phaseData[i].trimRef[j] = 0;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (flightModeData[i].trim[j] > 125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 0;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else if (phaseData[i].trim[j] < -125) {
|
||||
c9x.phaseData[i].trimRef[j] = 129 + phaseData[i].trim[j];
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
else if (flightModeData[i].trim[j] < -125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 129 + flightModeData[i].trim[j];
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else {
|
||||
c9x.phaseData[i].trim[j] += subtrim[j];
|
||||
c9x.flightModeData[i].trim[j] += subtrim[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -637,9 +633,9 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.customFn[i] = customFn[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
@@ -680,7 +676,6 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
@@ -688,13 +683,13 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -721,9 +716,9 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.customFn[i] = customFn[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
|
||||
@@ -202,13 +202,13 @@ PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
|
||||
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
|
||||
}) Gruvin9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
|
||||
PACK(typedef struct t_Gruvin9xCustomFunctionData { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
|
||||
}) Gruvin9xFuncSwData;
|
||||
operator CustomFunctionData();
|
||||
t_Gruvin9xCustomFunctionData() { memset(this, 0, sizeof(t_Gruvin9xCustomFunctionData)); }
|
||||
}) Gruvin9xCustomFunctionData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
|
||||
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
|
||||
@@ -244,19 +244,19 @@ PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
|
||||
t_Gruvin9xSwashRingData();
|
||||
}) Gruvin9xSwashRingData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xPhaseData_v102 {
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v102 {
|
||||
int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Gruvin9xPhaseData_v102() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v102)); }
|
||||
}) Gruvin9xPhaseData_v102;
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v102() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v102)); }
|
||||
}) Gruvin9xFlightModeData_v102;
|
||||
|
||||
|
||||
PACK(typedef struct t_Gruvin9xPhaseData_v106 {
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v106 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -264,9 +264,9 @@ PACK(typedef struct t_Gruvin9xPhaseData_v106 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Gruvin9xPhaseData_v106() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v106)); }
|
||||
}) Gruvin9xPhaseData_v106;
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v106() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v106)); }
|
||||
}) Gruvin9xFlightModeData_v106;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTimerData {
|
||||
int8_t mode:7; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
@@ -309,10 +309,10 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -341,10 +341,10 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -373,11 +373,11 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
int16_t subtrim[NUM_STICKS];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
@@ -405,11 +405,11 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
extern void getEEPROMZString(char *dst, const char *src, int size);
|
||||
extern RawSwitch open9xStockToSwitch(int8_t sw);
|
||||
|
||||
t_Open9xGruvin9xPhaseData_v207::operator PhaseData ()
|
||||
t_Open9xGruvin9xFlightModeData_v207::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -22,9 +22,9 @@ t_Open9xGruvin9xPhaseData_v207::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xPhaseData_v208::operator PhaseData ()
|
||||
t_Open9xGruvin9xFlightModeData_v208::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -339,9 +339,9 @@ Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
|
||||
t_Open9xGruvin9xCustomFunctionData_v203::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
if (func < 16) {
|
||||
c9x.func = (AssignFunc)(func);
|
||||
@@ -378,9 +378,9 @@ t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
|
||||
t_Open9xGruvin9xCustomFunctionData_v210::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.param = param;
|
||||
if (func < 22) {
|
||||
@@ -410,9 +410,9 @@ t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
|
||||
t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xV4207ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -422,9 +422,9 @@ t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
|
||||
t_Open9xGruvin9xSwashRingData_v209::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xV4209ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -436,7 +436,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -460,55 +460,48 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -517,7 +510,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -545,41 +538,41 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -587,17 +580,10 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.frsky.varioCenterMin = varioSpeedDownMin;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -606,7 +592,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -634,41 +620,41 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -677,17 +663,10 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -696,7 +675,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -724,24 +703,24 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -758,17 +737,17 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -780,7 +759,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i] = timers[i];
|
||||
c9x.timers[i].persistent = timersXtra[i].remanent;
|
||||
c9x.timers[i].val = timersXtra[i].value;
|
||||
@@ -811,24 +790,24 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -845,15 +824,15 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v207 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -30,20 +30,20 @@ PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator PhaseData();
|
||||
t_Open9xGruvin9xPhaseData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v207)); }
|
||||
}) Open9xGruvin9xPhaseData_v207;
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v207)); }
|
||||
}) Open9xGruvin9xFlightModeData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xPhaseData_v208 {
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator PhaseData();
|
||||
t_Open9xGruvin9xPhaseData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v208)); }
|
||||
}) Open9xGruvin9xPhaseData_v208;
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v208)); }
|
||||
}) Open9xGruvin9xFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
@@ -132,24 +132,24 @@ PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
|
||||
}) Open9xGruvin9xFuncSwData_v203;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xGruvin9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v203)); }
|
||||
}) Open9xGruvin9xCustomFunctionData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func:5;
|
||||
uint8_t delay:3;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
|
||||
}) Open9xGruvin9xFuncSwData_v210;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xGruvin9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v210)); }
|
||||
}) Open9xGruvin9xCustomFunctionData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
@@ -177,7 +177,7 @@ PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -189,15 +189,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v207 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v207 flightModeData[5];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -211,7 +211,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -223,22 +223,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v207 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
|
||||
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -250,7 +250,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -262,22 +262,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -290,7 +290,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -302,21 +302,21 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -328,7 +328,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -340,15 +340,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v211 mixData[32];
|
||||
Open9xLimitData_v211 limitData[16];
|
||||
Open9xExpoData_v211 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -356,7 +356,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
Open9xTimerDataExtra timersXtra[2];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
|
||||
|
||||
@@ -138,7 +138,6 @@ t_Open9xArmTimerData_v202::operator TimerData ()
|
||||
*/
|
||||
c9x.val = val;
|
||||
c9x.persistent = false;
|
||||
c9x.dir = (val == 0);
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -149,7 +148,7 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -179,7 +178,7 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -220,9 +219,9 @@ t_Open9xArmExpoData_v212::operator ExpoData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmPhaseData_v208::operator PhaseData ()
|
||||
t_Open9xArmFlightModeData_v208::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -232,9 +231,9 @@ t_Open9xArmPhaseData_v208::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmPhaseData_v212::operator PhaseData ()
|
||||
t_Open9xArmFlightModeData_v212::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -262,17 +261,17 @@ t_Open9xArmMixData_v208::operator MixData ()
|
||||
else if (srcRaw == 9) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 9+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-9);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 9+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-32);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 9+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -328,17 +327,17 @@ t_Open9xArmMixData_v209::operator MixData ()
|
||||
else if (srcRaw == 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 13+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -394,17 +393,17 @@ t_Open9xArmMixData_v210::operator MixData ()
|
||||
else if (srcRaw == 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 13+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -464,17 +463,17 @@ t_Open9xArmMixData_v212::operator MixData ()
|
||||
else if (srcRaw == 14) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 14+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-14);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 14+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-32);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 14+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -572,12 +571,12 @@ t_Open9xArmLogicalSwitchData_v210::operator LogicalSwitchData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmFuncSwData_v208::operator FuncSwData ()
|
||||
t_Open9xArmCustomFunctionData_v208::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func);
|
||||
if (c9x.func <= FuncSafetyCh32) {
|
||||
if (c9x.func <= FuncOverrideCH32) {
|
||||
c9x.enabled=param & 0x01;
|
||||
c9x.param = (param>>1)<<1;
|
||||
}
|
||||
@@ -590,9 +589,9 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmFuncSwData_v210::operator FuncSwData ()
|
||||
t_Open9xArmCustomFunctionData_v210::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func);
|
||||
uint32_t value = *((uint32_t *)param);
|
||||
@@ -614,9 +613,9 @@ t_Open9xArmFuncSwData_v210::operator FuncSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmFuncSwData_v211::operator FuncSwData ()
|
||||
t_Open9xArmCustomFunctionData_v211::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func);
|
||||
uint32_t value = *((uint32_t *)param);
|
||||
@@ -641,9 +640,9 @@ t_Open9xArmFuncSwData_v211::operator FuncSwData ()
|
||||
t_Open9xArmSwashRingData_v208::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xArm208ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -653,9 +652,9 @@ t_Open9xArmSwashRingData_v208::operator SwashRingData ()
|
||||
t_Open9xArmSwashRingData_v209::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xArm209ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -665,9 +664,9 @@ t_Open9xArmSwashRingData_v209::operator SwashRingData ()
|
||||
t_Open9xArmSwashRingData_v210::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xArm210ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -684,21 +683,8 @@ t_Open9xArmFrSkyData_v210::operator FrSkyData ()
|
||||
c9x.blades = blades+2;
|
||||
c9x.currentSource=currentSource;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++) {
|
||||
c9x.screens[0].body.bars[i].source = bars[i].source;
|
||||
c9x.screens[0].body.bars[i].barMin = bars[i].barMin;
|
||||
c9x.screens[0].body.bars[i].barMax = bars[i].barMax;
|
||||
}
|
||||
c9x.rssiAlarms[0] = rssiAlarms[0].get(0);
|
||||
c9x.rssiAlarms[1] = rssiAlarms[1].get(1);
|
||||
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
int i=line*2+col;
|
||||
c9x.screens[1].body.lines[line].source[col] = lines[i];
|
||||
}
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -712,21 +698,8 @@ t_Open9xArmFrSkyData_v211::operator FrSkyData ()
|
||||
c9x.blades = blades+2;
|
||||
c9x.currentSource=currentSource;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++) {
|
||||
c9x.screens[0].body.bars[i].source = bars[i].source;
|
||||
c9x.screens[0].body.bars[i].barMin = bars[i].barMin;
|
||||
c9x.screens[0].body.bars[i].barMax = bars[i].barMax;
|
||||
}
|
||||
c9x.rssiAlarms[0] = rssiAlarms[0].get(0);
|
||||
c9x.rssiAlarms[1] = rssiAlarms[1].get(1);
|
||||
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
int i=line*2+col;
|
||||
c9x.screens[1].body.lines[line].source[col] = lines[i];
|
||||
}
|
||||
}
|
||||
|
||||
c9x.varioSource = varioSource;
|
||||
c9x.varioCenterMax = varioSpeedUpMin;
|
||||
c9x.varioCenterMin = varioSpeedDownMin;
|
||||
@@ -739,7 +712,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -767,41 +740,41 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -809,14 +782,8 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.frsky.varioCenterMin = varioSpeedDownMin;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -828,7 +795,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -856,41 +823,41 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -899,14 +866,8 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -918,7 +879,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -946,41 +907,41 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -989,8 +950,8 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1002,7 +963,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1030,24 +991,24 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1064,17 +1025,17 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1086,7 +1047,7 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i] = timers[i];
|
||||
c9x.timers[i].persistent = timersXtra[i].remanent;
|
||||
c9x.timers[i].val = timersXtra[i].value;
|
||||
@@ -1117,24 +1078,24 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1151,15 +1112,15 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,6 @@
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
#define O9X_ARM_MAX_FLIGHT_MODES 9
|
||||
#define O9X_ARM_MAX_MIXERS 64
|
||||
#define O9X_ARM_MAX_EXPOS 32
|
||||
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
|
||||
#define O9X_ARM_NUM_CSW 32 // number of custom switches
|
||||
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
|
||||
#define O9X_ARM_MAX_CURVES 16
|
||||
#define O9X_ARM_NUM_POINTS 512
|
||||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
|
||||
PACK(typedef struct t_Open9xArmTimerData_v202 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint16_t val;
|
||||
@@ -169,26 +158,26 @@ PACK(typedef struct t_Open9xArmMixData_v212 {
|
||||
t_Open9xArmMixData_v212() { memset(this, 0, sizeof(t_Open9xArmMixData_v212)); }
|
||||
}) Open9xArmMixData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmPhaseData_v208 {
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
operator PhaseData();
|
||||
t_Open9xArmPhaseData_v208() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v208)); }
|
||||
}) Open9xArmPhaseData_v208;
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v208)); }
|
||||
}) Open9xArmFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmPhaseData_v212 {
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v212 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[1];
|
||||
operator PhaseData();
|
||||
t_Open9xArmPhaseData_v212() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v212)); }
|
||||
}) Open9xArmPhaseData_v212;
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v212() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v212)); }
|
||||
}) Open9xArmFlightModeData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
@@ -219,34 +208,34 @@ PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
|
||||
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
|
||||
}) Open9xArmLogicalSwitchData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xArmCustomFunctionData_v208 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
|
||||
}) Open9xArmFuncSwData_v208;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xArmCustomFunctionData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v208)); }
|
||||
}) Open9xArmCustomFunctionData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xArmCustomFunctionData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
|
||||
}) Open9xArmFuncSwData_v210;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xArmCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v210)); }
|
||||
}) Open9xArmCustomFunctionData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xArmCustomFunctionData_v211 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
uint8_t delay;
|
||||
uint8_t spare;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
|
||||
}) Open9xArmFuncSwData_v211;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xArmCustomFunctionData_v211() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v211)); }
|
||||
}) Open9xArmCustomFunctionData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
@@ -326,7 +315,7 @@ PACK(typedef struct t_Open9xArmFrSkyData_v211 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -338,22 +327,22 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v208 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v208 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v208 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v208 logicalSw[32];
|
||||
Open9xArmCustomFunctionData_v208 customFn[32];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -365,7 +354,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -377,22 +366,22 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v209 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v209 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v208 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v209 logicalSw[32];
|
||||
Open9xArmCustomFunctionData_v208 customFn[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -405,7 +394,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -417,20 +406,20 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v210 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v210 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v210 logicalSw[32];
|
||||
Open9xArmCustomFunctionData_v210 customFn[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xArmFrSkyData_v210 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -444,7 +433,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -456,21 +445,21 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v210 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v210 expoData[32];
|
||||
int16_t curves[16];
|
||||
int8_t points[512];
|
||||
Open9xArmLogicalSwitchData_v210 logicalSw[32];
|
||||
Open9xArmCustomFunctionData_v211 customFn[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -482,7 +471,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -494,15 +483,15 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v212 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v212 mixData[64];
|
||||
Open9xLimitData_v211 limitData[32];
|
||||
Open9xArmExpoData_v212 expoData[32];
|
||||
int16_t curves[16];
|
||||
int8_t points[512];
|
||||
Open9xArmLogicalSwitchData_v210 logicalSw[32];
|
||||
Open9xArmCustomFunctionData_v211 customFn[32];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v212 flightModeData[9];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -510,7 +499,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xArmFrSkyData_v211 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
Open9xTimerDataExtra timersXtra[2];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
|
||||
|
||||
@@ -24,8 +24,8 @@ int8_t char2idx(char c)
|
||||
if (c>='0' && c<='9') return 27+c-'0';
|
||||
for (int8_t i=0;;i++) {
|
||||
char cc = specialCharsTab[i];
|
||||
if(cc==0) return 0;
|
||||
if(cc==c) return 37+i;
|
||||
if (cc==0) return 0;
|
||||
if (cc==c) return 37+i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
|
||||
c9x.mode = mode;
|
||||
c9x.chn = chn;
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -129,8 +129,8 @@ t_Open9xExpoData_v211::operator ExpoData ()
|
||||
t_Open9xLimitData_v201::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -139,8 +139,8 @@ t_Open9xLimitData_v201::operator LimitData ()
|
||||
t_Open9xLimitData_v211::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
c9x.symetrical=symetrical;
|
||||
@@ -564,17 +564,17 @@ Open9xLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xFuncSwData_v201::operator FuncSwData ()
|
||||
t_Open9xCustomFunctionData_v201::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func+O9X_NUM_CHNOUT);
|
||||
c9x.func = (AssignFunc)(func+16);
|
||||
return c9x;
|
||||
}
|
||||
|
||||
enum Functions {
|
||||
FUNC_SAFETY_CH1,
|
||||
FUNC_SAFETY_CH16=FUNC_SAFETY_CH1+15,
|
||||
FUNC_OVERRIDE_CH1,
|
||||
FUNC_OVERRIDE_CH16=FUNC_OVERRIDE_CH1+15,
|
||||
FUNC_TRAINER,
|
||||
FUNC_TRAINER_RUD,
|
||||
FUNC_TRAINER_ELE,
|
||||
@@ -598,9 +598,9 @@ enum Functions {
|
||||
FUNC_MAX
|
||||
};
|
||||
|
||||
t_Open9xFuncSwData_v203::operator FuncSwData ()
|
||||
t_Open9xCustomFunctionData_v203::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
if (func < 16) {
|
||||
c9x.enabled=param & 0x01;
|
||||
@@ -628,9 +628,9 @@ t_Open9xFuncSwData_v203::operator FuncSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xFuncSwData_v210::operator FuncSwData ()
|
||||
t_Open9xCustomFunctionData_v210::operator CustomFunctionData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.param = param;
|
||||
if (func < 22) {
|
||||
@@ -665,9 +665,9 @@ t_Open9xFuncSwData_v210::operator FuncSwData ()
|
||||
t_Open9xSwashRingData_v208::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9x208ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
@@ -677,18 +677,18 @@ t_Open9xSwashRingData_v208::operator SwashRingData ()
|
||||
t_Open9xSwashRingData_v209::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.elevatorWeight = invertELE ? -100 : 100;
|
||||
c9x.aileronWeight = invertAIL ? -100 : 100;
|
||||
c9x.collectiveWeight = invertCOL ? -100 : 100;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xStock209ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xPhaseData_v201::operator PhaseData ()
|
||||
t_Open9xFlightModeData_v201::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -704,7 +704,6 @@ t_Open9xTimerData_v201::operator TimerData ()
|
||||
// c9x.mode = TMRMODE_OFF;
|
||||
c9x.val = val;
|
||||
c9x.persistent = persistent;
|
||||
c9x.dir = dir;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -725,7 +724,6 @@ t_Open9xTimerData_v202::operator TimerData ()
|
||||
*/
|
||||
c9x.val = val;
|
||||
c9x.persistent = false;
|
||||
c9x.dir = (val == 0);
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -830,7 +828,7 @@ t_Open9xFrSkyData_v203::operator FrSkyData ()
|
||||
t_Open9xFrSkyBarData_v204::operator FrSkyBarData ()
|
||||
{
|
||||
FrSkyBarData c9x;
|
||||
c9x.source = source;
|
||||
c9x.source = RawSource(SOURCE_TYPE_TELEMETRY, source);
|
||||
c9x.barMin = barMin;
|
||||
c9x.barMax = barMax;
|
||||
return c9x;
|
||||
@@ -842,7 +840,6 @@ t_Open9xFrSkyData_v204::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.imperial = imperial;
|
||||
c9x.blades = blades+2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
@@ -856,7 +853,6 @@ t_Open9xFrSkyData_v205::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.imperial = imperial;
|
||||
c9x.blades = blades+2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
@@ -903,12 +899,6 @@ t_Open9xFrSkyData_v210::operator FrSkyData ()
|
||||
}
|
||||
|
||||
c9x.screens[lines_screen_index].type = 0;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.screens[lines_screen_index].body.lines[line].source[col] = (col==0 ? (lines[line] & 0x0f) : ((lines[line] & 0xf0) / 16));
|
||||
c9x.screens[lines_screen_index].body.lines[line].source[col] += (((linesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
|
||||
c9x.rssiAlarms[0] = rssiAlarms[0].get(0);
|
||||
c9x.rssiAlarms[1] = rssiAlarms[1].get(1);
|
||||
@@ -941,51 +931,50 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
// for (int i=0; i<16; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1022,50 +1011,50 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
// for (int i=0; i<16; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId=modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1098,48 +1087,48 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1172,50 +1161,50 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.rssiAlarms[0] = frskyRssiAlarms[0].get(0);
|
||||
c9x.frsky.rssiAlarms[1] = frskyRssiAlarms[1].get(1);
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1224,7 +1213,7 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1251,56 +1240,49 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0]. modelId = modelId;
|
||||
c9x.frsky.screens[1].type = 0;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1309,7 +1291,7 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1337,43 +1319,43 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -1382,18 +1364,11 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
c9x.frsky.screens[1].type = 0;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1402,7 +1377,7 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1430,43 +1405,43 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
@@ -1476,18 +1451,11 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
c9x.frsky.screens[1].type = 0;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -1496,7 +1464,7 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1524,25 +1492,25 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1560,19 +1528,19 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter=servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1584,7 +1552,7 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1612,25 +1580,25 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1648,17 +1616,17 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.logicalSw[i] = logicalSw[i];
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.customFn[i] = customFn[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
c9x.moduleData[0].modelId = modelId;
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -247,32 +247,32 @@ PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
|
||||
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
|
||||
}) Open9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xCustomFunctionData_v201 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
|
||||
}) Open9xFuncSwData_v201;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xCustomFunctionData_v201() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v201)); }
|
||||
}) Open9xCustomFunctionData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xCustomFunctionData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
|
||||
}) Open9xFuncSwData_v203;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v203)); }
|
||||
}) Open9xCustomFunctionData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
|
||||
PACK(typedef struct t_Open9xCustomFunctionData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func:5;
|
||||
uint8_t delay:3;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
|
||||
}) Open9xFuncSwData_v210;
|
||||
operator CustomFunctionData();
|
||||
t_Open9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v210)); }
|
||||
}) Open9xCustomFunctionData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
@@ -445,7 +445,7 @@ PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
|
||||
t_Open9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xSwashRingData_v209)); }
|
||||
}) Open9xSwashRingData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xPhaseData_v201 {
|
||||
PACK(typedef struct t_Open9xFlightModeData_v201 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -453,9 +453,9 @@ PACK(typedef struct t_Open9xPhaseData_v201 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Open9xPhaseData_v201() { memset(this, 0, sizeof(t_Open9xPhaseData_v201)); }
|
||||
}) Open9xPhaseData_v201;
|
||||
operator FlightModeData();
|
||||
t_Open9xFlightModeData_v201() { memset(this, 0, sizeof(t_Open9xFlightModeData_v201)); }
|
||||
}) Open9xFlightModeData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xTimerData_v201 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
@@ -481,20 +481,6 @@ PACK(typedef struct t_Open9xTimerDataExtra {
|
||||
t_Open9xTimerDataExtra() { memset(this, 0, sizeof(t_Open9xTimerDataExtra)); }
|
||||
}) Open9xTimerDataExtra;
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_FLIGHT_MODES 5
|
||||
#define O9X_MAX_MIXERS 32
|
||||
#define O9X_MAX_EXPOS 14
|
||||
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define O9X_NUM_CSW 12 // number of custom switches
|
||||
#define O9X_NUM_FSW 16 // number of functions assigned to switches
|
||||
#define O9X_MAX_CURVES 8
|
||||
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
|
||||
#define O9X_MAX_GVARS 5
|
||||
|
||||
#define O9X_209_MAX_CURVE5 8
|
||||
#define O9X_209_MAX_CURVE9 8
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v201 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v201 timer1;
|
||||
@@ -511,16 +497,16 @@ PACK(typedef struct t_Open9xModelData_v201 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v201 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xMixData_v201 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xSafetySwData safetySw[16];
|
||||
Open9xCustomFunctionData_v201 customFn[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v201 frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -542,16 +528,16 @@ PACK(typedef struct t_Open9xModelData_v202 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xMixData_v201 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xSafetySwData safetySw[16];
|
||||
Open9xCustomFunctionData_v201 customFn[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -576,15 +562,15 @@ PACK(typedef struct t_Open9xModelData_v203 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v203 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -609,15 +595,15 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v203 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v204 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -630,7 +616,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v205 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -642,22 +628,22 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v205 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
|
||||
@@ -665,7 +651,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -677,22 +663,22 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v205 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -704,7 +690,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -716,22 +702,22 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xCustomFunctionData_v203 customFn[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -744,7 +730,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -756,21 +742,21 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xCustomFunctionData_v210 customFn[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -782,7 +768,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -794,15 +780,15 @@ PACK(typedef struct t_Open9xModelData_v211 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v211 mixData[32];
|
||||
Open9xLimitData_v211 limitData[16];
|
||||
Open9xExpoData_v211 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xLogicalSwitchData_v209 logicalSw[12];
|
||||
Open9xCustomFunctionData_v210 customFn[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxGruvin9xsimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBGRUVIN9X
|
||||
#define CPUM2560
|
||||
#define ROTARY_ENCODERS 2
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define BUZZER
|
||||
#define AUDIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xGruvin9x {
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 150;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xGruvin9x;
|
||||
|
||||
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
|
||||
{
|
||||
}
|
||||
|
||||
bool Open9xGruvin9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xGruvin9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
g_rotenc[0] += steps;
|
||||
}
|
||||
|
||||
unsigned int Open9xGruvin9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
}
|
||||
|
||||
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xGruvin9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xGruvin9x_simulator_h
|
||||
#define open9xGruvin9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class Open9xGruvin9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xGruvin9xSimulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxM128simulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSTD
|
||||
#define CPUM128
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace OpenTxM128 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 150;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace OpenTxM128;
|
||||
|
||||
OpenTxM128Simulator::OpenTxM128Simulator()
|
||||
{
|
||||
}
|
||||
|
||||
bool OpenTxM128Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpenTxM128Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int OpenTxM128Simulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
}
|
||||
|
||||
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxM128Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OpenTxM128_simulator_h
|
||||
#define OpenTxM128_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class OpenTxM128Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpenTxM128Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxM64simulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define HELI
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSTD
|
||||
#define CPUM64
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define VARIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define BUZZER
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#define NUM_POTS 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace OpenTxM64 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace OpenTxM64;
|
||||
|
||||
OpenTxM64Simulator::OpenTxM64Simulator()
|
||||
{
|
||||
#define INIT_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM64Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpenTxM64Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int OpenTxM64Simulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
}
|
||||
|
||||
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxM64Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9x_simulator_h
|
||||
#define open9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class OpenTxM64Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpenTxM64Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,256 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxSky9xsimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSKY9X
|
||||
#define CPUARM
|
||||
#define REVB
|
||||
#define ROTARY_ENCODERS 1
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define BUZZER
|
||||
#define AUDIO
|
||||
#define VOICE
|
||||
#define HAPTIC
|
||||
// #define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define SDCARD
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xSky9x {
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xSky9x;
|
||||
|
||||
Open9xSky9xSimulator::Open9xSky9xSimulator()
|
||||
{
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
}
|
||||
simuSdDirectory[i]=0;
|
||||
}
|
||||
|
||||
bool Open9xSky9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xSky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
g_rotenc[0] += steps*4;
|
||||
}
|
||||
|
||||
unsigned int Open9xSky9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
}
|
||||
|
||||
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xSky9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xSky9x_simulator_h
|
||||
#define open9xSky9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class Open9xSky9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xSky9xSimulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,295 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxTaranisSimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBTARANIS
|
||||
#define CPUARM
|
||||
#define HELI
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define FRSKY_SPORT
|
||||
#define GPS
|
||||
#define VARIO
|
||||
#define GAUGES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define VOICE
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define SDCARD
|
||||
#define RTCLOCK
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define FAI_CHOICE
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define EEPROM_VARIANT 3
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xX9D {
|
||||
|
||||
int taranisSimulatorBoard = 0;
|
||||
inline int geteepromsize() {
|
||||
return 32*1024;
|
||||
}
|
||||
#define EESIZE geteepromsize()
|
||||
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_channels.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/rtc.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
||||
#undef SDCARD
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#define SDCARD
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
|
||||
#include "radio/src/lua.cpp"
|
||||
#include "radio/src/lua/src/lapi.c"
|
||||
#include "radio/src/lua/src/lcode.c"
|
||||
#include "radio/src/lua/src/lctype.c"
|
||||
#include "radio/src/lua/src/ldebug.c"
|
||||
#include "radio/src/lua/src/ldo.c"
|
||||
#include "radio/src/lua/src/ldump.c"
|
||||
#include "radio/src/lua/src/lfunc.c"
|
||||
#include "radio/src/lua/src/lgc.c"
|
||||
#include "radio/src/lua/src/llex.c"
|
||||
#include "radio/src/lua/src/lmem.c"
|
||||
#include "radio/src/lua/src/lobject.c"
|
||||
#include "radio/src/lua/src/lopcodes.c"
|
||||
#include "radio/src/lua/src/lparser.c"
|
||||
#include "radio/src/lua/src/lstate.c"
|
||||
#include "radio/src/lua/src/lstring.c"
|
||||
#include "radio/src/lua/src/ltable.c"
|
||||
#include "radio/src/lua/src/ltm.c"
|
||||
#include "radio/src/lua/src/lundump.c"
|
||||
#include "radio/src/lua/src/lvm.c"
|
||||
#include "radio/src/lua/src/lzio.c"
|
||||
#include "radio/src/lua/src/lbaselib.c"
|
||||
#include "radio/src/lua/src/linit.c"
|
||||
#include "radio/src/lua/src/lmathlib.c"
|
||||
#include "radio/src/lua/src/loadlib.c"
|
||||
#include "radio/src/lua/src/lauxlib.c"
|
||||
#include "radio/src/lua/src/ltablib.c"
|
||||
#include "radio/src/lua/src/lcorolib.c"
|
||||
|
||||
|
||||
int16_t g_anas[NUM_STICKS+5];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
void resetTrims()
|
||||
{
|
||||
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
|
||||
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xX9D;
|
||||
|
||||
OpentxTaranisSimulator::OpentxTaranisSimulator()
|
||||
{
|
||||
taranisSimulatorBoard = GetEepromInterface()->getBoard();
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
}
|
||||
simuSdDirectory[i]=0;
|
||||
}
|
||||
|
||||
bool OpentxTaranisSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpentxTaranisSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpentxTaranisSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
// g_rotenc[0] += steps*4;
|
||||
}
|
||||
|
||||
unsigned int OpentxTaranisSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
}
|
||||
|
||||
const char * OpentxTaranisSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpentxTaranisSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef opentx_taranis_simulator_h
|
||||
#define opentx_taranis_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class OpentxTaranisSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpentxTaranisSimulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,34 +22,15 @@
|
||||
#include "eepromimportexport.h"
|
||||
#include <qbytearray.h>
|
||||
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
#define POS3_VARIANT 0x0004
|
||||
#define MAVLINK_VARIANT 0x0008
|
||||
#define M128_VARIANT 0x8000
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
#define POS3_VARIANT 0x0004
|
||||
#define MAVLINK_VARIANT 0x0008
|
||||
#define M128_VARIANT 0x8000
|
||||
#define TARANIS_X9E_VARIANT 0x8000
|
||||
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_FLIGHT_MODES 5
|
||||
#define O9X_MAX_MIXERS 32
|
||||
#define O9X_MAX_EXPOS 14
|
||||
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define O9X_NUM_CSW 12 // number of custom switches
|
||||
#define O9X_NUM_FSW 16 // number of functions assigned to switches
|
||||
#define O9X_MAX_CURVES 8
|
||||
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
|
||||
|
||||
#define O9X_ARM_MAX_FLIGHT_MODES 9
|
||||
#define O9X_ARM_MAX_MIXERS 64
|
||||
#define O9X_ARM_MAX_EXPOS 32
|
||||
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
|
||||
#define O9X_ARM_NUM_CSW 32 // number of custom switches
|
||||
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
|
||||
#define O9X_ARM_NUM_POINTS 512
|
||||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
@@ -65,7 +46,7 @@ class OpenTxGeneralData: public TransformedField {
|
||||
unsigned int version;
|
||||
int inputsCount;
|
||||
unsigned int chkSum;
|
||||
unsigned int potsType[4];
|
||||
// unsigned int potsType[4];
|
||||
};
|
||||
|
||||
class ProtocolsConversionTable: public ConversionTable
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,13 +13,13 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
#ifndef open9x_interface_h
|
||||
#define open9x_interface_h
|
||||
|
||||
#ifndef opentx_interface_h
|
||||
#define opentx_interface_h
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
|
||||
|
||||
class RleFile;
|
||||
|
||||
@@ -78,43 +78,51 @@ class OpenTxEepromInterface : public EEPROMInterface
|
||||
|
||||
};
|
||||
|
||||
class OpenTxFirmware: public FirmwareInterface {
|
||||
class OpenTxFirmware: public Firmware {
|
||||
public:
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board, bool voice = false):
|
||||
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board), voice)
|
||||
OpenTxFirmware(const QString & id, OpenTxFirmware * parent):
|
||||
Firmware(parent, id, parent->getName(), parent->getBoard(), parent->eepromInterface)
|
||||
{
|
||||
}
|
||||
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board):
|
||||
Firmware(id, name, board, new OpenTxEepromInterface(board))
|
||||
{
|
||||
addLanguage("en");
|
||||
addLanguage("cz");
|
||||
addLanguage("de");
|
||||
addLanguage("es");
|
||||
addLanguage("fr");
|
||||
addLanguage("it");
|
||||
addLanguage("de");
|
||||
addLanguage("se");
|
||||
addLanguage("cz");
|
||||
addLanguage("es");
|
||||
addLanguage("nl");
|
||||
addLanguage("pl");
|
||||
addLanguage("pt");
|
||||
addLanguage("se");
|
||||
|
||||
addTTSLanguage("en");
|
||||
addTTSLanguage("fr");
|
||||
addTTSLanguage("it");
|
||||
addTTSLanguage("de");
|
||||
addTTSLanguage("se");
|
||||
addTTSLanguage("cz");
|
||||
addTTSLanguage("sk");
|
||||
addTTSLanguage("es");
|
||||
addTTSLanguage("fr");
|
||||
addTTSLanguage("hu");
|
||||
addTTSLanguage("it");
|
||||
addTTSLanguage("nl");
|
||||
addTTSLanguage("pl");
|
||||
addTTSLanguage("pt");
|
||||
addTTSLanguage("es");
|
||||
addTTSLanguage("se");
|
||||
addTTSLanguage("sk");
|
||||
}
|
||||
|
||||
virtual Firmware * getFirmwareVariant(const QString & id);
|
||||
|
||||
virtual QString getStampUrl();
|
||||
|
||||
virtual QString getReleaseNotesUrl();
|
||||
|
||||
virtual QString getFirmwareUrl(QString & id);
|
||||
virtual QString getFirmwareUrl();
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual SimulatorInterface * getSimulator();
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
|
||||
add_custom_target(about_lbm_9x
|
||||
make lbm PCB=9X
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(about_lbm_taranis
|
||||
make lbm PCB=TARANIS
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(trans
|
||||
make tra
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(lua_exports
|
||||
make PCB=TARANIS lua_exports.inc
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
set(OPENTX_SRC_FILES
|
||||
opentxsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/firmwares/opentx
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs/option
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/CoOS
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/Lua/src
|
||||
)
|
||||
|
||||
if(DEFINED TRANSLATIONS)
|
||||
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
|
||||
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
|
||||
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
|
||||
endif()
|
||||
|
||||
set(COMMON_DEFINITIONS
|
||||
${COMMON_DEFINITIONS}
|
||||
SUFFIX="${SUFFIX}"
|
||||
HELI
|
||||
GVARS
|
||||
FLIGHT_MODES
|
||||
PPM_CENTER_ADJUSTABLE
|
||||
PPM_LIMITS_SYMETRICAL
|
||||
OVERRIDE_CHANNEL_FUNCTION
|
||||
FAI_CHOICE
|
||||
)
|
||||
|
||||
set(COMMON_LIBRARIES
|
||||
${QT_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${SDL_LIBRARY}
|
||||
)
|
||||
|
||||
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x 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(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
opentx-9xr${SUFFIX}-simulator
|
||||
opentx-9x128${SUFFIX}-simulator
|
||||
opentx-9xr128${SUFFIX}-simulator
|
||||
opentx-gruvin9x${SUFFIX}-simulator
|
||||
opentx-mega2560${SUFFIX}-simulator
|
||||
opentx-sky9x${SUFFIX}-simulator
|
||||
opentx-9xrpro${SUFFIX}-simulator
|
||||
opentx-taranis${SUFFIX}-simulator
|
||||
opentx-taranisplus${SUFFIX}-simulator
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega64
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9X with ATmega128
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega128
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Gruvin9x
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Mega2560
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Sky9x
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR-PRO
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis standard
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis Plus
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis X9E
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
ADD_CUSTOM_TARGET(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
@@ -0,0 +1,533 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxsimulator.h"
|
||||
#include <QDebug>
|
||||
#include <stdio.h>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#define COMPANION
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define GUI
|
||||
#define SPLASH
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define GPS
|
||||
#define VARIO
|
||||
#define GAUGES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#if defined(PCBTARANIS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#else
|
||||
#define BUZZER
|
||||
#define TEMPLATES
|
||||
#endif
|
||||
#define BOLD_FONT
|
||||
#define HAPTIC
|
||||
#define THRTRACE
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TIMERS 3
|
||||
#else
|
||||
#define TIMERS 2
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
#define ROTARY_ENCODERS 1
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define ROTARY_ENCODERS 2
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define FRSKY_SPORT
|
||||
#endif
|
||||
|
||||
#if defined (PCBTARANIS)
|
||||
#define MIXERS_MONITOR
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
namespace NAMESPACE {
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/main_arm.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/tasks_arm.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/telemetry/telemetry.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/sbus.cpp"
|
||||
#else
|
||||
#include "radio/src/main_avr.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#else
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBSKY9X)
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/debug.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/functions.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/sdcard.cpp"
|
||||
#endif
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/Taranis/fonts.cpp"
|
||||
#include "radio/src/gui/Taranis/widgets.cpp"
|
||||
#include "radio/src/gui/Taranis/navigation.cpp"
|
||||
#include "radio/src/gui/Taranis/popups.cpp"
|
||||
#include "radio/src/gui/Taranis/helpers.cpp"
|
||||
#include "radio/src/gui/Taranis/menus.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_version.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_diaganas.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Taranis/view_main.cpp"
|
||||
#include "radio/src/gui/Taranis/view_statistics.cpp"
|
||||
#include "radio/src/gui/Taranis/view_channels.cpp"
|
||||
#include "radio/src/gui/Taranis/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Taranis/view_text.cpp"
|
||||
#include "radio/src/gui/Taranis/view_about.cpp"
|
||||
#include "radio/src/gui/Taranis/lcd.cpp"
|
||||
#include "radio/src/gui/Taranis/splash.cpp"
|
||||
#else
|
||||
#include "radio/src/gui/9X/fonts.cpp"
|
||||
#include "radio/src/gui/9X/widgets.cpp"
|
||||
#include "radio/src/gui/9X/navigation.cpp"
|
||||
#include "radio/src/gui/9X/popups.cpp"
|
||||
#include "radio/src/gui/9X/helpers.cpp"
|
||||
#include "radio/src/gui/9X/menus.cpp"
|
||||
#include "radio/src/gui/9X/menu_model.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
||||
#include "radio/src/gui/9X/menu_general.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/9X/view_text.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/9X/menu_general_hardware.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/9X/view_main.cpp"
|
||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
||||
#if !defined(CPUM64)
|
||||
#include "radio/src/gui/9X/view_about.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/lcd.cpp"
|
||||
#include "radio/src/gui/9X/splash.cpp"
|
||||
#endif
|
||||
|
||||
#if !defined(VIRTUALINPUTS)
|
||||
#include "radio/src/templates.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/logs.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(RTCLOCK)
|
||||
#include "radio/src/rtc.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(BUZZER)
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
#if defined(REV9E)
|
||||
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
|
||||
#endif
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
||||
#elif defined(PCBSKY9X)
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
#elif defined(PCBMEGA2560)
|
||||
#include "radio/src/targets/mega2560/board_mega2560.cpp"
|
||||
#else
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_nl.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
#include "radio/src/lua_api.cpp"
|
||||
#include "radio/src/thirdparty/Lua/src/lapi.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcode.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lctype.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldebug.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldo.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lfunc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lgc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/llex.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmem.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lobject.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lopcodes.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lparser.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstate.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstring.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lrotable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lundump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lvm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lzio.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbaselib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/linit.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmathlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbitlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/loadlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lauxlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltablib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcorolib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/liolib.c"
|
||||
#endif
|
||||
|
||||
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void resetTrims()
|
||||
{
|
||||
TRIMS_GPIO_REG_RVD |= TRIMS_GPIO_PIN_RVD;
|
||||
TRIMS_GPIO_REG_RVU |= TRIMS_GPIO_PIN_RVU;
|
||||
TRIMS_GPIO_REG_RHL |= TRIMS_GPIO_PIN_RHL;
|
||||
TRIMS_GPIO_REG_RHR |= TRIMS_GPIO_PIN_RHR;
|
||||
TRIMS_GPIO_REG_LVD |= TRIMS_GPIO_PIN_LVD;
|
||||
TRIMS_GPIO_REG_LVU |= TRIMS_GPIO_PIN_LVU;
|
||||
TRIMS_GPIO_REG_LHL |= TRIMS_GPIO_PIN_LHL;
|
||||
TRIMS_GPIO_REG_LHR |= TRIMS_GPIO_PIN_LHR;
|
||||
}
|
||||
#endif
|
||||
|
||||
void delay_01us(::uint16_t nb)
|
||||
{
|
||||
}
|
||||
|
||||
OpenTxSimulator::OpenTxSimulator()
|
||||
{
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setSdPath(const QString &sdPath)
|
||||
{
|
||||
#if defined(SDCARD)
|
||||
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setVolumeGain(int value)
|
||||
{
|
||||
volumeGain = value;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
::uint8_t * OpenTxSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
|
||||
start((const char *)0, tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] = 0;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
#endif
|
||||
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(volumeGain);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
#if defined(CPUARM)
|
||||
StopAudioThread();
|
||||
#endif
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
#if defined(PCBSKY9X)
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
|
||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
::uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (::uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
::uint8_t idx = NAMESPACE::modn12x3[4*getStickMode() + i];
|
||||
::int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxSimulator::wheelEvent(int steps)
|
||||
{
|
||||
#if defined(REV9E)
|
||||
if (steps == 255)
|
||||
x9de_rotenc -= 2;
|
||||
else
|
||||
x9de_rotenc += 2;
|
||||
#elif defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] += steps*4;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] += steps;
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned int OpenTxSimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
processSportPacket(data);
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
|
||||
{
|
||||
traceCallback = callback;
|
||||
}
|
||||
|
||||
class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
{
|
||||
public:
|
||||
OpenTxSimulatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
virtual SimulatorInterface *create()
|
||||
{
|
||||
return new OpenTxSimulator();
|
||||
}
|
||||
|
||||
virtual QString name()
|
||||
{
|
||||
return QString("opentx-" FLAVOUR SUFFIX);
|
||||
}
|
||||
|
||||
virtual BoardEnum type()
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
return BOARD_TARANIS;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
extern "C" DLLEXPORT SimulatorFactory *registerSimu()
|
||||
{
|
||||
return new NAMESPACE::OpenTxSimulatorFactory();
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef opentx_taranis_simulator_h
|
||||
#define opentx_taranis_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#define FLAVOUR "taranisx9e"
|
||||
#define NAMESPACE TaranisX9E
|
||||
#define EEPROM_VARIANT 0x8000
|
||||
#elif defined(PCBTARANIS) && defined(REVPLUS)
|
||||
#define FLAVOUR "taranisplus"
|
||||
#define NAMESPACE TaranisPlus
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBTARANIS)
|
||||
#define FLAVOUR "taranis"
|
||||
#define NAMESPACE Taranis
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBSKY9X) && defined(REVX)
|
||||
#define FLAVOUR "9xrpro"
|
||||
#define NAMESPACE Sky9xPro
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBSKY9X)
|
||||
#define FLAVOUR "sky9x"
|
||||
#define NAMESPACE Sky9X
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define FLAVOUR "gruvin9x"
|
||||
#define NAMESPACE Gruvin9X
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBMEGA2560)
|
||||
#define FLAVOUR "mega2560"
|
||||
#define NAMESPACE Mega2560
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCB9XR) && defined(CPUM128)
|
||||
#define FLAVOUR "9xr128"
|
||||
#define NAMESPACE M128XR
|
||||
#define EEPROM_VARIANT 0x8003
|
||||
#elif defined(PCB9X) && defined(CPUM128)
|
||||
#define FLAVOUR "9x128"
|
||||
#define NAMESPACE M128
|
||||
#define EEPROM_VARIANT 0x8003
|
||||
#elif defined(PCB9XR) && defined(CPUM64)
|
||||
#define FLAVOUR "9xr"
|
||||
#define NAMESPACE M64XR
|
||||
#define EEPROM_VARIANT 0x0003
|
||||
#elif defined(PCB9X) && defined(CPUM64)
|
||||
#define FLAVOUR "9x"
|
||||
#define NAMESPACE M64
|
||||
#define EEPROM_VARIANT 0x0003
|
||||
#else
|
||||
#error "Unknown board"
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__
|
||||
#define DLLEXPORT
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
namespace NAMESPACE {
|
||||
|
||||
class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
|
||||
|
||||
private:
|
||||
int volumeGain;
|
||||
|
||||
public:
|
||||
|
||||
OpenTxSimulator();
|
||||
|
||||
virtual void setSdPath(const QString &sdPath);
|
||||
|
||||
virtual void setVolumeGain(int value);
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(int steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len);
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *));
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,4 +2,3 @@
|
||||
#define DATE_STR "@DATE@"
|
||||
#define TIME_STR "@TIME@"
|
||||
#define VERS_STR "@C9X_VERSION@"
|
||||
#define MOD_STR "FH"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(th9x-simulator th9xsimulator.cpp)
|
||||
+17
-17
@@ -78,14 +78,14 @@ void eeprom_RESV_mismatch(void)
|
||||
assert(!"Should never been called. Only needed by VC++ (debug mode)");
|
||||
}
|
||||
|
||||
#define GPIO_TRIM_LH_L pind
|
||||
#define GPIO_TRIM_LV_DN pind
|
||||
#define GPIO_TRIM_RV_UP pind
|
||||
#define GPIO_TRIM_RH_L pind
|
||||
#define GPIO_TRIM_LH_R pind
|
||||
#define GPIO_TRIM_LV_UP pind
|
||||
#define GPIO_TRIM_RV_DN pind
|
||||
#define GPIO_TRIM_RH_R pind
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
|
||||
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
|
||||
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
|
||||
@@ -103,14 +103,14 @@ void eeprom_RESV_mismatch(void)
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -48,8 +48,6 @@ class Th9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
protected:
|
||||
@@ -71,16 +71,16 @@ Th9xGeneral::operator GeneralSettings ()
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
result.beeperMode = GeneralSettings::BEEPER_QUIET;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
|
||||
break;
|
||||
case 2:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperMode = GeneralSettings::BEEPER_ALL;
|
||||
break;
|
||||
case 3:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperMode = GeneralSettings::BEEPER_ALL;
|
||||
result.beeperLength = 2;
|
||||
}
|
||||
result.stickMode = stickMode;
|
||||
@@ -124,8 +124,8 @@ t_Th9xLimitData::t_Th9xLimitData()
|
||||
t_Th9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = min-100;
|
||||
c9x.max = max+100;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -197,7 +197,7 @@ int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
v1 = 1+source.index;
|
||||
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
|
||||
EEPROMWarnings += ::QObject::tr("th9x on this board doesn't have Rotary Encoders") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("th9x on this board doesn't have Rotary Encoders"));
|
||||
v1 = 5+source.index;
|
||||
}
|
||||
else if (source.type == SOURCE_TYPE_MAX)
|
||||
@@ -272,12 +272,11 @@ t_Th9xModelData::operator ModelData ()
|
||||
/*c9x.protocol = (Protocol)protocol;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncTrims2Offsets;
|
||||
c9x.customFn[0].func = FuncTrims2Offsets;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = trimSw;
|
||||
c9x.customFn[0].swtch = trimSw;
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.pulsePol = pulsePol;
|
||||
@@ -295,7 +294,7 @@ t_Th9xModelData::operator ModelData ()
|
||||
for (int i=0; i<TH9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trimData[i].itrim;
|
||||
c9x.flightModeData[0].trim[i] = trimData[i].itrim;
|
||||
for (int i=0; i<TH9X_MAX_CURVES3; i++) {
|
||||
c9x.curves[i].count = 3;
|
||||
for (int j=0; j<3; j++) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <iostream>
|
||||
#include "th9xinterface.h"
|
||||
#include "th9xeeprom.h"
|
||||
#include "th9xsimulator.h"
|
||||
#include "simulator/th9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
|
||||
Executable
+358
@@ -0,0 +1,358 @@
|
||||
#include "flasheepromdialog.h"
|
||||
#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"
|
||||
|
||||
FlashEEpromDialog::FlashEEpromDialog(QWidget *parent, const QString &filename):
|
||||
QDialog(parent),
|
||||
ui(new Ui::FlashEEpromDialog),
|
||||
eepromFilename(filename),
|
||||
radioData(new RadioData())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->profileLabel->setText(tr("Current profile: %1").arg(g.profile[g.id()].name()));
|
||||
if (!filename.isEmpty()) {
|
||||
ui->eepromFilename->hide();
|
||||
ui->eepromLoad->hide();
|
||||
}
|
||||
QString backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
ui->backupBeforeWrite->setChecked(g.enableBackup() || g.profile[g.id()].penableBackup());
|
||||
}
|
||||
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
|
||||
ui->backupBeforeWrite->setEnabled(false);
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
FlashEEpromDialog::~FlashEEpromDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FlashEEpromDialog::updateUI()
|
||||
{
|
||||
// ui->burnButton->setEnabled(true);
|
||||
ui->eepromFilename->setText(eepromFilename);
|
||||
if (getEEpromVersion(eepromFilename) >= 0) {
|
||||
ui->profileLabel->show();
|
||||
ui->patchCalibration->show();
|
||||
ui->patchHardwareSettings->show();
|
||||
QString name = g.profile[g.id()].name();
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
QString HapticSet = g.profile[g.id()].haptic();
|
||||
QString SpeakerSet = g.profile[g.id()].speaker();
|
||||
if (!name.isEmpty()) {
|
||||
ui->profileLabel->show();
|
||||
ui->patchCalibration->show();
|
||||
ui->patchHardwareSettings->show();
|
||||
// TODO I hardcode the number of pots here, should be dependant on the board?
|
||||
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
|
||||
ui->patchCalibration->setDisabled(true);
|
||||
}
|
||||
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
|
||||
ui->patchHardwareSettings->setDisabled(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->profileLabel->hide();
|
||||
}
|
||||
ui->burnButton->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
ui->profileLabel->hide();
|
||||
ui->patchCalibration->hide();
|
||||
ui->patchHardwareSettings->hide();
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void FlashEEpromDialog::on_eepromLoad_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
|
||||
if (!filename.isEmpty()) {
|
||||
eepromFilename = filename;
|
||||
updateUI();
|
||||
}
|
||||
}
|
||||
|
||||
int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
{
|
||||
int result = -1;
|
||||
int eeprom_size = 0;
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.exists()) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to find file %1!").arg(filename));
|
||||
return -1;
|
||||
}
|
||||
|
||||
QByteArray eeprom(EESIZE_RLC_MAX, 0);
|
||||
int fileType = getFileType(filename);
|
||||
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(testData);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if (xmlOK) {
|
||||
RadioData * radioData = new RadioData();
|
||||
if (!loadEEpromXml(*radioData, doc)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
result = radioData->generalSettings.version;
|
||||
}
|
||||
delete radioData;
|
||||
return result;
|
||||
}
|
||||
file.reset();
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
QString hline = inputStream.readLine();
|
||||
if (hline!=EEPE_EEPROM_FILE_HEADER) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_RLC_MAX);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
eeprom_size = file.size();
|
||||
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
|
||||
QMessageBox::warning(this, tr("Error"), tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
int len = file.read(eeprom.data(), eeprom_size);
|
||||
if (len != eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Error reading file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
if (eeprom_size == 0 || !loadEEprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
result = radioData->generalSettings.version;
|
||||
}
|
||||
delete radioData;
|
||||
return result;
|
||||
}
|
||||
|
||||
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 PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
bool ok;
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData->generalSettings.calibMid[i]=byte16;
|
||||
Byte=calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData->generalSettings.calibSpanNeg[i]=byte16;
|
||||
Byte=calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData->generalSettings.calibSpanPos[i]=byte16;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte = trainercalib.mid(i*4,4);
|
||||
byte16 = (int16_t)Byte.toInt(&ok,16);
|
||||
if (ok) {
|
||||
radioData->generalSettings.trainer.calib[i] = byte16;
|
||||
}
|
||||
}
|
||||
radioData->generalSettings.currentCalib = currentCalib;
|
||||
radioData->generalSettings.vBatCalib = vBatCalib;
|
||||
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashEEpromDialog::patchHardwareSettings()
|
||||
{
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
QString HapticSet = g.profile[g.id()].haptic();
|
||||
QString SpeakerSet = g.profile[g.id()].speaker();
|
||||
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
|
||||
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
|
||||
|
||||
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
|
||||
radioData->generalSettings.vBatWarn = vBatWarn;
|
||||
radioData->generalSettings.stickMode = GSStickMode;
|
||||
uint8_t byte8u;
|
||||
int8_t byte8;
|
||||
bool ok;
|
||||
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.contrast=byte8u;
|
||||
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.backlightBright=byte8u;
|
||||
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.beeperMode=(GeneralSettings::BeeperMode)byte8u;
|
||||
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.beeperLength=byte8;
|
||||
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8u;
|
||||
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.hapticStrength=byte8u;
|
||||
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.hapticLength=byte8;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.speakerMode=byte8u;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.speakerPitch=byte8u;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok) radioData->generalSettings.speakerVolume=byte8u;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void FlashEEpromDialog::on_burnButton_clicked()
|
||||
{
|
||||
// patch the eeprom if needed
|
||||
bool patch = false;
|
||||
if (ui->patchCalibration->isChecked()) {
|
||||
patch |= patchCalibration();
|
||||
}
|
||||
if (ui->patchHardwareSettings->isChecked()) {
|
||||
patch |= patchHardwareSettings();
|
||||
}
|
||||
QString filename = eepromFilename;
|
||||
if (patch) {
|
||||
QString filename = generateProcessUniqueTempFileName("temp.bin");
|
||||
QFile file(filename);
|
||||
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
|
||||
int eeprom_size = GetEepromInterface()->save(eeprom, *radioData, GetCurrentFirmware()->getVariantNumber());
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Error writing file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
close();
|
||||
|
||||
ProgressDialog progressDialog(this, tr("Write Models and Settings to Radio"), CompanionIcon("write_eeprom.png"));
|
||||
|
||||
// backup previous EEPROM if requested
|
||||
QString backupFilename;
|
||||
QString backupPath;
|
||||
if (ui->backupBeforeWrite->isChecked()) {
|
||||
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()) {
|
||||
backupFilename = generateProcessUniqueTempFileName("eeprom.bin");
|
||||
}
|
||||
if (!backupFilename.isEmpty()) {
|
||||
if (!readEeprom(backupFilename, progressDialog.progress())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check EEPROM compatibility if requested
|
||||
if (ui->checkFirmwareCompatibility->isChecked()) {
|
||||
int eepromVersion = getEEpromVersion(filename);
|
||||
QString firmwareFilename = generateProcessUniqueTempFileName("flash.bin");
|
||||
if (!readFirmware(firmwareFilename, progressDialog.progress()))
|
||||
return;
|
||||
QString compatEEprom = generateProcessUniqueTempFileName("compat.bin");
|
||||
if (convertEEprom(filename, compatEEprom, firmwareFilename)) {
|
||||
int compatVersion = getEEpromVersion(compatEEprom);
|
||||
if ((compatVersion / 100) != (eepromVersion / 100)) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("The radio firmware belongs to another product family, check file and preferences!"));
|
||||
return;
|
||||
}
|
||||
else if (compatVersion < eepromVersion) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("The radio firmware is outdated, please upgrade!"));
|
||||
return;
|
||||
}
|
||||
filename = compatEEprom;
|
||||
}
|
||||
else if (QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?"), QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
qunlink(firmwareFilename);
|
||||
}
|
||||
|
||||
// and write...
|
||||
writeEeprom(filename, progressDialog.progress());
|
||||
|
||||
progressDialog.exec();
|
||||
}
|
||||
|
||||
void FlashEEpromDialog::on_cancelButton_clicked()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void FlashEEpromDialog::shrink()
|
||||
{
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#ifndef FLASHEEPROMDIALOG_H_
|
||||
#define FLASHEEPROMDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class FlashEEpromDialog;
|
||||
}
|
||||
|
||||
class RadioData;
|
||||
|
||||
class FlashEEpromDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FlashEEpromDialog(QWidget *parent, const QString &fileName="");
|
||||
~FlashEEpromDialog();
|
||||
|
||||
private slots:
|
||||
void on_eepromLoad_clicked();
|
||||
void on_burnButton_clicked();
|
||||
void on_cancelButton_clicked();
|
||||
void shrink();
|
||||
|
||||
protected:
|
||||
void updateUI();
|
||||
bool isValidEEprom(const QString &filename);
|
||||
int getEEpromVersion(const QString &filename);
|
||||
bool patchCalibration();
|
||||
bool patchHardwareSettings();
|
||||
|
||||
private:
|
||||
Ui::FlashEEpromDialog *ui;
|
||||
QString eepromFilename;
|
||||
RadioData *radioData;
|
||||
};
|
||||
|
||||
#endif // FLASHEEPROMDIALOG_H_
|
||||
Executable
+198
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FlashEEpromDialog</class>
|
||||
<widget class="QDialog" name="FlashEEpromDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>399</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Write Models and Settings to Radio</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/themes/classic/16/write_eeprom.png</normaloff>:/themes/classic/16/write_eeprom.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="filanameLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="eepromFilename">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="eepromLoad">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="profileLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current Profile</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkFirmwareCompatibility">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check Firmware compatibility</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="backupBeforeWrite">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup before Write</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="patchCalibration">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify calibration parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch calibration setting from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="patchHardwareSettings">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify HW parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch HW settings from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonsLayout">
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<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>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="burnButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write to TX</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>burnButton</tabstop>
|
||||
<tabstop>eepromFilename</tabstop>
|
||||
<tabstop>eepromLoad</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Executable
+318
@@ -0,0 +1,318 @@
|
||||
#include "flashfirmwaredialog.h"
|
||||
#include "ui_flashfirmwaredialog.h"
|
||||
#include "appdata.h"
|
||||
#include "converteeprom.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "process_flash.h"
|
||||
#include "helpers.h"
|
||||
#include "hexinterface.h"
|
||||
#include "progressdialog.h"
|
||||
#include "radiointerface.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "progresswidget.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
FlashFirmwareDialog::FlashFirmwareDialog(QWidget *parent):
|
||||
QDialog(parent),
|
||||
ui(new Ui::FlashFirmwareDialog),
|
||||
fwName(g.profile[g.id()].fwName())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (!g.profile[g.id()].splashFile().isEmpty()){
|
||||
imageSource = PROFILE;
|
||||
imageFile = g.profile[g.id()].splashFile();
|
||||
ui->useProfileSplash->setChecked(true);
|
||||
}
|
||||
else {
|
||||
imageSource = FIRMWARE;
|
||||
imageFile = "";
|
||||
ui->useProfileSplash->setDisabled(true);
|
||||
}
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
// No backup on Taranis ... could be done if in massstorage
|
||||
ui->backupEEprom->hide();
|
||||
ui->backupEEprom->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
else {
|
||||
ui->backupEEprom->setCheckState(g.backupOnFlash() ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
QString backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
|
||||
ui->backupEEprom->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->checkHardwareCompatibility->setChecked(g.checkHardwareCompatibility());
|
||||
|
||||
updateUI();
|
||||
|
||||
resize(0, 0); // TODO needed?
|
||||
}
|
||||
|
||||
FlashFirmwareDialog::~FlashFirmwareDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::updateUI()
|
||||
{
|
||||
ui->firmwareFilename->setText(fwName);
|
||||
ui->burnButton->setEnabled(QFile(fwName).exists());
|
||||
|
||||
FirmwareInterface firmware(fwName);
|
||||
if (firmware.isValid()) {
|
||||
ui->firmwareInfoFrame->show();
|
||||
ui->date->setText(firmware.getDate() + " " + firmware.getTime());
|
||||
ui->version->setText(firmware.getVersion());
|
||||
ui->variant->setText(firmware.getEEpromId());
|
||||
ui->date->setEnabled(true);
|
||||
ui->version->setEnabled(true);
|
||||
ui->variant->setEnabled(true);
|
||||
if (firmware.hasSplash()) {
|
||||
ui->splashFrame->show();
|
||||
ui->splash->setFixedSize(firmware.getSplashWidth(), firmware.getSplashHeight());
|
||||
}
|
||||
else {
|
||||
ui->splashFrame->hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
imageSource = FIRMWARE;
|
||||
ui->firmwareInfoFrame->hide();
|
||||
ui->splashFrame->hide();
|
||||
}
|
||||
|
||||
QImage image;
|
||||
switch(imageSource) {
|
||||
case FIRMWARE:
|
||||
ui->useFirmwareSplash->setChecked(true);
|
||||
image = firmware.getSplash();
|
||||
break;
|
||||
case PROFILE:
|
||||
ui->useProfileSplash->setChecked(true);
|
||||
image.load(g.profile[g.id()].splashFile());
|
||||
break;
|
||||
case LIBRARY:
|
||||
ui->useLibrarySplash->setChecked(true);
|
||||
image.load(imageFile);
|
||||
break;
|
||||
case EXTERNAL:
|
||||
ui->useExternalSplash->setChecked(true);
|
||||
image.load(imageFile);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!image.isNull()) {
|
||||
ui->splash->setPixmap(makePixMap(image, g.profile[g.id()].fwType()));
|
||||
}
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_firmwareLoad_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if (!fileName.isEmpty()) {
|
||||
fwName = fileName;
|
||||
if (!fwName.isEmpty() && !FirmwareInterface(fwName).isValid()) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fwName));
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_useFirmwareSplash_clicked()
|
||||
{
|
||||
FirmwareInterface firmware(fwName);
|
||||
if (!firmware.isValid()) {
|
||||
QMessageBox::warning(this, tr("Error"), tr( "The firmware file is not valid." ));
|
||||
}
|
||||
else if (!firmware.hasSplash()) {
|
||||
QMessageBox::warning(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
|
||||
}
|
||||
else {
|
||||
imageSource = FIRMWARE;
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_useProfileSplash_clicked()
|
||||
{
|
||||
QString fileName = g.profile[g.id()].splashFile();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
|
||||
}
|
||||
else {
|
||||
imageSource = PROFILE;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_useExternalSplash_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
|
||||
}
|
||||
else{
|
||||
imageSource = EXTERNAL;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this, &fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
|
||||
}
|
||||
else {
|
||||
imageSource = LIBRARY;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_burnButton_clicked()
|
||||
{
|
||||
g.flashDir(QFileInfo(fwName).dir().absolutePath());
|
||||
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
|
||||
g.backupOnFlash(ui->backupEEprom->isChecked());
|
||||
|
||||
qDebug() << "FlashFirmwareDialog: flashing" << fwName;
|
||||
|
||||
if (imageSource != FIRMWARE) {
|
||||
// load the splash image
|
||||
const QPixmap * pixmap = ui->splash->pixmap();
|
||||
QImage image;
|
||||
if (pixmap) {
|
||||
image = pixmap->toImage().scaled(ui->splash->width(), ui->splash->height());
|
||||
}
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Splash image not found"));
|
||||
return;
|
||||
}
|
||||
// write the customized firmware
|
||||
QString tempFile;
|
||||
if (getFileType(fwName) == FILE_TYPE_HEX)
|
||||
tempFile = generateProcessUniqueTempFileName("flash.hex");
|
||||
else
|
||||
tempFile = generateProcessUniqueTempFileName("flash.bin");
|
||||
qDebug() << "FlashFirmwareDialog: patching" << fwName << "with custom splash screen and saving to" << tempFile;
|
||||
FirmwareInterface firmware(fwName);
|
||||
firmware.setSplash(image);
|
||||
if (firmware.save(tempFile) <= 0) {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
|
||||
return;
|
||||
}
|
||||
startFlash(tempFile);
|
||||
}
|
||||
else {
|
||||
startFlash(fwName);
|
||||
}
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::on_cancelButton_clicked()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::shrink()
|
||||
{
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
void FlashFirmwareDialog::startFlash(const QString &filename)
|
||||
{
|
||||
bool backup = g.backupOnFlash();
|
||||
|
||||
close();
|
||||
|
||||
ProgressDialog progressDialog(this, tr("Write Firmware to Radio"), CompanionIcon("write_flash.png"));
|
||||
|
||||
// check hardware compatibility if requested
|
||||
if (g.checkHardwareCompatibility()) {
|
||||
QString tempFirmware = generateProcessUniqueTempFileName("flash-check.bin");
|
||||
if (!readFirmware(tempFirmware, progressDialog.progress())) {
|
||||
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
|
||||
return;
|
||||
}
|
||||
FirmwareInterface previousFirmware(tempFirmware);
|
||||
qunlink(tempFirmware);
|
||||
FirmwareInterface newFirmware(filename);
|
||||
qDebug() << "startFlash: checking firmware compatibility between " << tempFirmware << "and" << filename;
|
||||
if (!newFirmware.isHardwareCompatible(previousFirmware)) {
|
||||
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
|
||||
if (isTempFileName(filename)) {
|
||||
qDebug() << "startFlash: removing temporary file" << filename;
|
||||
qunlink(filename);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// backup if requested
|
||||
bool result = true;
|
||||
QString backupFilename;
|
||||
QString backupPath;
|
||||
if (backup) {
|
||||
backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
result = readEeprom(backupFilename, progressDialog.progress());
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
// flash
|
||||
result = (result && writeFirmware(filename, progressDialog.progress()));
|
||||
|
||||
// restore if backup requested
|
||||
if (backup && result) {
|
||||
sleep(2);
|
||||
QString restoreFilename = generateProcessUniqueTempFileName("restore.bin");
|
||||
if (!convertEEprom(backupFilename, restoreFilename, filename)) {
|
||||
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
restoreFilename = backupFilename;
|
||||
}
|
||||
if (!writeEeprom(restoreFilename, progressDialog.progress())) {
|
||||
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFilename));
|
||||
}
|
||||
}
|
||||
|
||||
progressDialog.progress()->setInfo(tr("Flashing done"));
|
||||
progressDialog.exec();
|
||||
|
||||
if (isTempFileName(filename)) {
|
||||
qDebug() << "startFlash: removing temporary file" << filename;
|
||||
qunlink(filename);
|
||||
}
|
||||
}
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#ifndef FLASH_FIRMWARE_DIALOG_H
|
||||
#define FLASH_FIRMWARE_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
|
||||
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class FlashFirmwareDialog;
|
||||
}
|
||||
|
||||
class FlashFirmwareDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlashFirmwareDialog(QWidget *parent = 0);
|
||||
~FlashFirmwareDialog();
|
||||
|
||||
private slots:
|
||||
void on_firmwareLoad_clicked();
|
||||
void on_burnButton_clicked();
|
||||
void on_cancelButton_clicked();
|
||||
void on_useProfileSplash_clicked();
|
||||
void on_useFirmwareSplash_clicked();
|
||||
void on_useLibrarySplash_clicked();
|
||||
void on_useExternalSplash_clicked();
|
||||
void shrink();
|
||||
|
||||
protected:
|
||||
void updateUI();
|
||||
void startFlash(const QString &filename);
|
||||
|
||||
private:
|
||||
Ui::FlashFirmwareDialog *ui;
|
||||
QString fwName;
|
||||
RadioData radioData;
|
||||
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, EXTERNAL};
|
||||
ImageSource imageSource;
|
||||
QString imageFile;
|
||||
};
|
||||
|
||||
#endif // FLASH_FIRMWARE_DIALOG_H
|
||||
Executable
+321
@@ -0,0 +1,321 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FlashFirmwareDialog</class>
|
||||
<widget class="QDialog" name="FlashFirmwareDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>421</width>
|
||||
<height>375</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Flash Firmware</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="firmwareFilename">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="firmwareLoad">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="firmwareInfoFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dateLabel">
|
||||
<property name="text">
|
||||
<string>Date & Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="version">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="buildLabel">
|
||||
<property name="text">
|
||||
<string>Variant</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="variant">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="text">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="date">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="splashFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="useProfileSplash">
|
||||
<property name="text">
|
||||
<string>Use profile start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="useFirmwareSplash">
|
||||
<property name="text">
|
||||
<string>Use firmware start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="useLibrarySplash">
|
||||
<property name="text">
|
||||
<string>Use library start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="useExternalSplash">
|
||||
<property name="text">
|
||||
<string>Use another start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="splash">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>214</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkHardwareCompatibility">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check Hardware compatibility</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="backupEEprom">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup and restore Models and Settings</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout1">
|
||||
<item>
|
||||
<spacer name="spacer1">
|
||||
<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>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="burnButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write to TX</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>burnButton</tabstop>
|
||||
<tabstop>firmwareFilename</tabstop>
|
||||
<tabstop>firmwareLoad</tabstop>
|
||||
<tabstop>version</tabstop>
|
||||
<tabstop>variant</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,35 +1,36 @@
|
||||
#include "fusesdialog.h"
|
||||
#include "ui_fusesdialog.h"
|
||||
#include "burnconfigdialog.h"
|
||||
#include "helpers.h"
|
||||
#include "progressdialog.h"
|
||||
#include "radiointerface.h"
|
||||
|
||||
fusesDialog::fusesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::fusesDialog)
|
||||
FusesDialog::FusesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::FusesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("fuses.png"));
|
||||
}
|
||||
|
||||
fusesDialog::~fusesDialog()
|
||||
FusesDialog::~FusesDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void fusesDialog::on_resetFuses_EEprotect_clicked()
|
||||
void FusesDialog::on_resetFuses_EEprotect_clicked()
|
||||
{
|
||||
burnConfigDialog *bcd = new burnConfigDialog(this);
|
||||
bcd->restFuses(true);
|
||||
ProgressDialog progressDialog(this, tr("Reset Radio Fuses"), CompanionIcon("fuses.png"), true);
|
||||
return resetAvrdudeFuses(true, progressDialog.progress());
|
||||
}
|
||||
|
||||
void fusesDialog::on_resetFuses_EEdelete_clicked()
|
||||
void FusesDialog::on_resetFuses_EEdelete_clicked()
|
||||
{
|
||||
burnConfigDialog *bcd = new burnConfigDialog(this);
|
||||
bcd->restFuses(false);
|
||||
ProgressDialog progressDialog(this, tr("Reset Radio Fuses"), CompanionIcon("fuses.png"), true);
|
||||
return resetAvrdudeFuses(false, progressDialog.progress());
|
||||
}
|
||||
|
||||
void fusesDialog::on_readFuses_clicked()
|
||||
void FusesDialog::on_readFuses_clicked()
|
||||
{
|
||||
burnConfigDialog *bcd = new burnConfigDialog(this);
|
||||
bcd->readFuses();
|
||||
ProgressDialog progressDialog(this, tr("Read Fuses from Radio"), CompanionIcon("fuses.png"), true);
|
||||
return readAvrdudeFuses(progressDialog.progress());
|
||||
}
|
||||
|
||||
+15
-14
@@ -1,27 +1,28 @@
|
||||
#ifndef FUSESDIALOG_H
|
||||
#define FUSESDIALOG_H
|
||||
#ifndef FUSESDIALOG_H_
|
||||
#define FUSESDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class fusesDialog;
|
||||
class FusesDialog;
|
||||
}
|
||||
|
||||
class fusesDialog : public QDialog
|
||||
class FusesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit fusesDialog(QWidget *parent = 0);
|
||||
~fusesDialog();
|
||||
|
||||
private:
|
||||
Ui::fusesDialog *ui;
|
||||
explicit FusesDialog(QWidget *parent = 0);
|
||||
~FusesDialog();
|
||||
|
||||
private slots:
|
||||
void on_readFuses_clicked();
|
||||
void on_resetFuses_EEdelete_clicked();
|
||||
void on_resetFuses_EEprotect_clicked();
|
||||
void on_readFuses_clicked();
|
||||
void on_resetFuses_EEdelete_clicked();
|
||||
void on_resetFuses_EEprotect_clicked();
|
||||
|
||||
private:
|
||||
Ui::FusesDialog *ui;
|
||||
|
||||
};
|
||||
|
||||
#endif // FUSESDIALOG_H
|
||||
#endif // FUSESDIALOG_H_
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>fusesDialog</class>
|
||||
<widget class="QDialog" name="fusesDialog">
|
||||
<class>FusesDialog</class>
|
||||
<widget class="QDialog" name="FusesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -14,6 +14,12 @@ FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||
initSettings();
|
||||
|
||||
foreach(const char *lang, GetCurrentFirmware()->getFirmwareBase()->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (current_firmware_variant->getId().contains(QString("-tts%1").arg(lang)))
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
FirmwarePreferencesDialog::~FirmwarePreferencesDialog()
|
||||
@@ -46,7 +52,7 @@ void FirmwarePreferencesDialog::on_fw_dnld_clicked()
|
||||
|
||||
void FirmwarePreferencesDialog::on_voice_dnld_clicked()
|
||||
{
|
||||
QString url = "http://voices-20.open-tx.org/";
|
||||
QString url = "http://voices-21.open-tx.org/";
|
||||
QString fwType = g.profile[g.id()].fwType();
|
||||
QStringList list = fwType.split("-");
|
||||
QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>416</width>
|
||||
<height>153</height>
|
||||
<height>154</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -81,56 +81,6 @@
|
||||
<string>Set voice language.
|
||||
May be different from firmware language</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>en</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>cz</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>de</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>es</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>fi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>fr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>it</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>pl</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>pt</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>se</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
@@ -227,6 +177,10 @@ May be different from firmware language</string>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>checkFWUpdates</tabstop>
|
||||
<tabstop>fw_dnld</tabstop>
|
||||
<tabstop>voiceCombo</tabstop>
|
||||
<tabstop>voice_dnld</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,142 +0,0 @@
|
||||
#ifndef GENERALEDIT_H
|
||||
#define GENERALEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class GeneralEdit;
|
||||
}
|
||||
|
||||
class GeneralEdit : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GeneralEdit(RadioData &radioData, QWidget *parent = 0);
|
||||
~GeneralEdit();
|
||||
void updateSettings();
|
||||
|
||||
private:
|
||||
Ui::GeneralEdit *ui;
|
||||
RadioData &radioData;
|
||||
GeneralSettings g_eeGeneral;
|
||||
|
||||
bool switchDefPosEditLock;
|
||||
bool voiceLangEditLock;
|
||||
bool mavbaudEditLock;
|
||||
void getGeneralSwitchDefPos(int i, bool val);
|
||||
void setSwitchDefPos();
|
||||
void updateVarioPitchRange();
|
||||
void disableMouseScrolling();
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
signals:
|
||||
void modelValuesChanged();
|
||||
|
||||
private slots:
|
||||
void on_faimode_CB_stateChanged(int );
|
||||
void on_speakerPitchSB_editingFinished();
|
||||
void on_timezoneSB_editingFinished();
|
||||
void on_hapticStrength_valueChanged();
|
||||
void on_soundModeCB_currentIndexChanged(int index);
|
||||
void on_beeperlenCB_currentIndexChanged(int index);
|
||||
void on_volume_SB_editingFinished();
|
||||
void on_hapticmodeCB_currentIndexChanged(int index);
|
||||
void on_hapticLengthCB_currentIndexChanged(int index);
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
void on_splashScreenChkB_stateChanged(int);
|
||||
void on_splashScreenDuration_currentIndexChanged(int index);
|
||||
void on_alarmwarnChkB_stateChanged(int );
|
||||
void on_gpsFormatCB_currentIndexChanged(int index);
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
void on_displayTypeCB_currentIndexChanged(int index);
|
||||
void on_BLBright_SB_editingFinished();
|
||||
void on_backlightColor_SL_valueChanged();
|
||||
void on_re_CB_currentIndexChanged(int index);
|
||||
void on_countrycode_CB_currentIndexChanged(int index);
|
||||
void on_units_CB_currentIndexChanged(int index);
|
||||
void on_trnMode_1_currentIndexChanged(int index);
|
||||
void on_trnChn_1_currentIndexChanged(int index);
|
||||
void on_trnWeight_1_editingFinished();
|
||||
void on_trnMode_2_currentIndexChanged(int index);
|
||||
void on_trnChn_2_currentIndexChanged(int index);
|
||||
void on_trnWeight_2_editingFinished();
|
||||
void on_trnMode_3_currentIndexChanged(int index);
|
||||
void on_trnChn_3_currentIndexChanged(int index);
|
||||
void on_trnWeight_3_editingFinished();
|
||||
void on_trnMode_4_currentIndexChanged(int index);
|
||||
void on_trnChn_4_currentIndexChanged(int index);
|
||||
void on_trnWeight_4_editingFinished();
|
||||
|
||||
void on_CurrentCalib_SB_editingFinished();
|
||||
|
||||
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_PPM1_editingFinished();
|
||||
void on_PPM2_editingFinished();
|
||||
void on_PPM3_editingFinished();
|
||||
void on_PPM4_editingFinished();
|
||||
void on_beepVolume_SL_valueChanged();
|
||||
void on_bgVolume_SL_valueChanged();
|
||||
void on_varioVolume_SL_valueChanged();
|
||||
void on_wavVolume_SL_valueChanged();
|
||||
|
||||
void on_varioP0_SB_editingFinished();
|
||||
void on_varioPMax_SB_editingFinished();
|
||||
void on_varioR0_SB_editingFinished();
|
||||
|
||||
void on_pot1Type_currentIndexChanged(int index);
|
||||
void on_pot2Type_currentIndexChanged(int index);
|
||||
void on_pot3Type_currentIndexChanged(int index);
|
||||
void on_serialPortMode_currentIndexChanged(int index);
|
||||
|
||||
void on_stickmodeCB_currentIndexChanged(int index);
|
||||
void on_channelorderCB_currentIndexChanged(int index);
|
||||
void on_beeperCB_currentIndexChanged(int index);
|
||||
void on_memwarnChkB_stateChanged(int );
|
||||
void on_inactimerSB_editingFinished();
|
||||
void on_backlightautoSB_editingFinished();
|
||||
void on_backlightswCB_currentIndexChanged(int index);
|
||||
void on_mavbaud_CB_currentIndexChanged(int index);
|
||||
void on_voiceLang_CB_currentIndexChanged(int index);
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_battwarningDSB_editingFinished();
|
||||
void on_contrastSB_editingFinished();
|
||||
void on_calretrieve_PB_clicked();
|
||||
void on_calstore_PB_clicked();
|
||||
void unlockSwitchEdited();
|
||||
void setValues();
|
||||
void shrink();
|
||||
void stickReverseEdited();
|
||||
void on_switchesDelay_valueChanged();
|
||||
};
|
||||
|
||||
#endif // GENERALEDIT_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(generaledit_NAMES
|
||||
generaledit
|
||||
generalsetup
|
||||
trainer
|
||||
calibration
|
||||
)
|
||||
|
||||
set(generaledit_SRCS
|
||||
)
|
||||
|
||||
set(generaledit_HDRS
|
||||
)
|
||||
|
||||
set(generaledit_UIS
|
||||
)
|
||||
|
||||
foreach(name ${generaledit_NAMES})
|
||||
set(generaledit_SRCS ${generaledit_SRCS} ${name}.cpp)
|
||||
set(generaledit_HDRS ${generaledit_HDRS} ${name}.h)
|
||||
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
@@ -0,0 +1,422 @@
|
||||
#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)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (!firmware->getCapability(MultiposPots)) {
|
||||
ui->potsTypeSeparator->hide();
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/*void CalibrationPanel::update()
|
||||
{
|
||||
}
|
||||
*/
|
||||
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();
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef CALIBRATION_H
|
||||
#define CALIBRATION_H
|
||||
|
||||
#include "generaledit.h"
|
||||
|
||||
namespace Ui {
|
||||
class Calibration;
|
||||
}
|
||||
|
||||
class QLabel;
|
||||
class AutoLineEdit;
|
||||
class AutoComboBox;
|
||||
|
||||
class CalibrationPanel : public GeneralPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CalibrationPanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~CalibrationPanel();
|
||||
// virtual void update();
|
||||
|
||||
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);
|
||||
|
||||
private:
|
||||
Ui::Calibration *ui;
|
||||
|
||||
void setValues();
|
||||
};
|
||||
|
||||
#endif // CALIBRATION_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user