Compare commits

...

1246 Commits

Author SHA1 Message Date
Damjan Adamic 9547ade3d4 Fixes problem with "'timespec': 'struct' type redefinition" on Windows (#3805) 2016-09-14 22:42:54 +02:00
Bertrand Songis 5f5e16dd6a OpenTX 2.0.20 2016-09-14 21:10:32 +02:00
Damjan Adamic a220853a86 Version moved to 2.0.20 2016-05-26 22:44:27 +02:00
Damjan Adamic fdc86aa93d Release notes updated 2016-05-26 22:42:37 +02:00
Damjan Adamic 6a75e40573 Projectkk2glider/branch 2.0 remove obsolete firmwares (#3537)
* Re #3527: removed th9x simulator

* Re #3527: removed er9x simulator

* Re #3527: removed ersky9x simulator
2016-05-26 21:41:51 +02:00
Damjan Adamic 152ba6018c Travis build fix 2016-05-25 22:54:31 +02:00
Damjan Adamic 9d5a74d250 Fixes #3527: location for 9XR-PRO and SKY9X Mike's bootloader has changed (ported from master) 2016-05-25 22:24:15 +02:00
Damjan Adamic b4bbb95a43 Fixes #3347 (backported from next 946c1777) 2016-03-13 18:42:06 +01:00
Damjan Adamic cf0e7c4a44 Release notes updated 2016-01-15 18:42:32 +01:00
Damjan Adamic fd2e0e4994 Fixes #3230: SD manager bug when scrolling up fixed 2016-01-15 18:16:15 +01:00
Damjan Adamic be457b40fc Fixes #3222 : Throttle Source combobox was populated multiple times (ported from master) 2016-01-10 21:52:33 +01:00
Damjan Adamic 41b91d8f5b Re #2939: additional test for EDGE logical switch (ported from next) 2016-01-10 18:59:27 +01:00
Bertrand Songis 4f9576b09d Merge pull request #3212 from opentx/projectkk2glider/issue_2939_edge_problem
Projectkk2glider/issue 2939 edge problem
2016-01-07 19:29:29 +01:00
Damjan Adamic 04f635404a Re #2939: gtests added 2016-01-07 10:35:09 +01:00
Damjan Adamic 64dd923e86 Re #2939: Version moved to 2.0.19 2016-01-06 21:53:44 +01:00
Damjan Adamic 051503e75c Re #2939: Compilation fix 2016-01-06 21:06:43 +01:00
Damjan Adamic 0520127fe6 Fixes #2939: Logical switch internal state was being reset by the AND switch, that affected its function (it looked like AND was applied before the EDGE processing, not after like it is done for other logical switch types). 2016-01-06 15:17:00 +01:00
Andre Bernet 9d48dca7a8 Release date 2016-01-03 14:54:55 +04:00
martin 426077ed16 CZ translations 2015-11-04 22:03:57 +01:00
Damjan Adamic 81f2b91b91 Version changed to 2.0.18 2015-11-04 19:33:56 +01:00
Damjan Adamic 7ac876af54 Release notes updated, release set to 2015-11-04 2015-11-04 19:08:02 +01:00
Andre Bernet 147d041b20 Had forgotten to add the shift in channel names on failsafe setup page 2015-11-01 14:02:57 +04:00
Andre Bernet 45ea2bf559 Port timer min/max fix from #2702 to 2.0 (issue reported on openrcforums) 2015-11-01 08:47:25 +04:00
Damjan Adamic c9fd91e755 Release notes updated 2015-10-31 20:31:01 +01:00
Andre Bernet f2d316b89b Correct failsafe mapping (fix #2975) 2015-10-30 13:15:08 +04:00
Andre Bernet 0283161f3d Compilation fixes 2015-10-30 13:14:58 +04:00
Damjan Adamic 87b2a4c0f1 Re #2956: removed possibility of INVERS, BOLD and BLINK attributes to Lua lcd.drawChannel() unit (reverted commits 7ad5c1e287 and 82450c6419) 2015-10-18 18:18:41 +02:00
Bertrand Songis 013152cf1f Merge pull request #2977 from opentx/projectkk2glider/issue_2956_unit_attributes
Projectkk2glider/issue 2956 unit attributes
2015-10-17 23:02:36 +02:00
Damjan Adamic 57881edb93 Re #2956: gtest images updated 2015-10-17 21:33:48 +02:00
Damjan Adamic 82450c6419 Re #2956: added SMLSIZE 2015-10-17 20:43:32 +02:00
Damjan Adamic 7ad5c1e287 Fixes #2956: added possibility of INVERS, BOLD and BLINK attributes to Lua lcd.drawChannel() unit 2015-10-17 20:38:59 +02:00
Damjan Adamic 02e9eb3555 Voltage symbol changed to upper case 2015-10-17 20:33:40 +02:00
Bertrand Songis 7284db8514 Fixes #2707 2015-10-13 15:31:19 +02:00
Damjan Adamic f7c1888509 More VC++ errors fixed 2015-10-09 20:15:37 +02:00
Damjan Adamic 3159dd5066 VC++ errors fixed (ported from 2.1 branch commit a142a74c36) 2015-10-09 20:11:35 +02:00
Damjan Adamic 221e3dbdda Fixes #2912: added missing "midtrim" and "endtrim" to FR (ported from 2.1) 2015-09-24 21:48:55 +02:00
Damjan Adamic e5b27d3de4 Helper script added (from 2.1 branch) 2015-09-20 19:09:19 +02:00
Damjan Adamic f9946dff03 Fixes #2728: edge switch could trigger right after the logicalSwitchesReset() was called (ported from 2.1) 2015-09-20 19:06:20 +02:00
Damjan Adamic 2c2b6e7483 Release notes updated 2015-09-20 18:55:49 +02:00
Bertrand Songis 1c16a99d9e Merge pull request #2900 from opentx/bsongis/issue2880_2.0_ppm_center_for_dsm2
Fixes #2880
2015-09-20 11:40:12 +02:00
Bertrand Songis 0771486e4e Travis tests added to 2.0 branch 2015-09-20 11:19:15 +02:00
Bertrand Songis 4040828e7a Fixes #2880 2015-09-19 10:48:44 +02:00
Grieb 66caf7dc79 Missed one place. 2015-09-16 22:35:42 -03:00
Grieb 3decae21b0 Fix logical condition. 2015-09-15 00:44:55 -03:00
Bertrand Songis ff8183fdbb Merge pull request #2770 from opentx/griebd/check_dup_receiver_number_2187
Alert about duplicated receiver id on copy. #2187
2015-09-14 00:20:41 +02:00
Bertrand Songis f0a5b28ef5 Merge pull request #2853 from opentx/griebd/finish_solution_for_2620_2778
should be a final solution for #2620
2015-09-14 00:16:15 +02:00
Damjan Adamic b814373391 Gtests fix 2015-09-12 19:02:01 +02:00
Damjan Adamic c059e9affb Gtests fix 2015-09-12 18:59:39 +02:00
Bertrand Songis 0dee1c207f Jenkins commit tests now stored in the repo 2015-09-12 18:45:30 +02:00
Bertrand Songis cbcf06964e Jenkins commit tests now stored in the repo 2015-09-12 18:45:04 +02:00
Damjan Adamic 9285985ff8 Removed unnecessary #if defined(SIMU) that was introduced in 16bdd1ae93 2015-09-12 18:43:50 +02:00
Damjan Adamic 415ae55a93 Removed unnecessary #if defined(SIMU) that was introduced in 16bdd1ae93 2015-09-12 18:42:20 +02:00
Grieb 526c88dbe8 Fix unrelated unused-but-set-variable. 2015-09-08 17:36:09 -03:00
Grieb 5ccdbeb8f8 Fixes #2620. Finished for backup and xml, needs test. 2015-09-08 17:32:04 -03:00
Grieb f91bfb1310 LoadEeprom error messages interface finished, still missing for LoadBackup and LoadEepromXml. 2015-09-08 14:21:44 -03:00
Grieb 641a382ef3 Cosmetics, trailing spaces. 2015-09-08 14:21:44 -03:00
Grieb 2b6cf2aa9d Changed by sugestions of @bsongis. 😉 2015-09-08 14:21:44 -03:00
Damjan Adamic d476696126 Readme updated 2015-09-03 12:26:10 +02:00
Bertrand Songis 909350dc66 Merge pull request #2789 from opentx/griebd/issue_2620_again
for review: proposed solution for #2620 and #2778
2015-08-28 21:40:42 +02:00
Grieb e62c552217 Possible fix for #2620 and #2778. Not finished, just for review... 2015-08-27 14:54:45 -03:00
Grieb fc935126b2 Cosmetics, trailing spaces and end lines. 2015-08-27 00:31:06 -03:00
Grieb 3018328ae7 Fixes #2187. Warning about used receiver id on copy. 2015-08-25 12:46:20 -03:00
Grieb eb657d5686 Cosmetics. Trailing spaces. 2015-08-25 12:43:42 -03:00
Bertrand Songis fa2bf0afaa Merge pull request #2724 from opentx/projectkk2glider/issue_2623_sd_manager_fixes_for2.0
Fixes #2623: several fixes (ported from 2.1):
2015-08-25 10:01:43 +02:00
Damjan Adamic f481d2f236 Fixes #2734: fixed endless loop in model compare (varable i was used both in outer and inner for loops) (ported from 2.1) 2015-08-19 22:25:20 +02:00
Damjan Adamic bdb22c37c6 Added missing keys initialization for simu (backported from 2.1) 2015-08-18 20:03:25 +02:00
Damjan Adamic 6aa4bd1c68 Re #2623: fixed f_getcwd() on Windows 2015-08-18 17:32:03 +02:00
Damjan Adamic 9f1a6c85c7 Re #2623: fix for non-ARM platforms 2015-08-18 16:52:25 +02:00
Damjan Adamic 23389081a5 Fixes #2623: several fixes (ported from 2.1):
Disable menu for [..],
Refresh file list after delete,
Removed delete menu option for directories,
Several simulator filesystem functions improved
2015-08-17 18:20:00 +02:00
Bertrand Songis 920e856dfd Fixes #2704 2015-08-14 11:50:11 +02:00
Andre Bernet 30336ff481 Frsky-D Telemetry protocol bug (0x5D followed by 0x3D) 2015-08-02 12:14:48 +02:00
bsongis eb03c6a054 Fixes #2271 2015-07-24 16:34:16 +02:00
Bertrand Songis 46218c148e Update README.md 2015-07-16 18:49:10 +02:00
Bertrand Songis 1f557bcda7 Update README.md 2015-07-16 18:48:39 +02:00
Damjan Adamic 19567b099d Fixes #2446: some function static variables were dependent on continuity of g_tmr10ms value between simulator sessions. 2015-07-10 18:31:40 +02:00
bsongis 18e85c4cbb Fixes #2442 2015-07-08 19:47:13 +02:00
Bertrand Songis ad34c2042e Update DONATIONS.txt 2015-07-07 07:25:52 +02:00
Damjan Adamic 8d96cfa420 Fixes #2420: input name buffer overflow in Companion 2015-07-05 18:13:50 +02:00
bsongis 0783f728a9 Fixes #2414 2015-07-04 17:41:39 +02:00
projectkk2glider 9e1f19a8ed Re #1732: stack corruption fixed 2015-07-02 19:21:25 +02:00
Andre Bernet 6914b4347a Add EU-only option to companion on master. Compile script is updated 2015-06-28 17:50:31 +02:00
Bertrand Songis 95ea3514e7 Update DONATIONS.txt 2015-06-28 11:47:00 +02:00
Damjan Adamic 7e385b8754 Release notes updated 2015-06-19 19:12:46 +02:00
bsongis b9a518192b Fixes #2368 2015-06-18 19:43:26 +02:00
Bertrand Songis 70fe6327c9 Update DONATIONS.txt 2015-06-18 19:05:27 +02:00
Bertrand Songis f432a2d4ec Update DONATIONS.txt 2015-06-18 06:52:23 +02:00
Bertrand Songis 7522f97695 Merge pull request #2366 from opentx/projectkk2glider/issue_2326_ge_filtering
Fixes #2326: Google Earth export GPS glitch filtering and lat/lon syn…
2015-06-17 18:07:28 +02:00
Damjan Adamic 674e3a8872 Re #2326: cosmetics 2015-06-17 10:16:24 +02:00
Bertrand Songis f32ff084ad Merge pull request #2365 from opentx/projectkk2glider/issue_2364_s3_ghost_readings
Fixes #2364: use fixed analog value for non-connected pots
2015-06-16 21:34:39 +02:00
Damjan Adamic 31a651ad1a Fixes #2326: Google Earth export GPS glitch filtering and lat/lon synchronization 2015-06-16 15:51:40 +02:00
Damjan Adamic b5cf6a13b0 Fixes #2364: use fixed analog value for non-connected pots 2015-06-16 09:26:06 +02:00
Bertrand Songis 31924c1a23 Update DONATIONS.txt 2015-06-14 21:30:50 +02:00
Bertrand Songis 73cddc76cf Update DONATIONS.txt 2015-06-12 23:52:45 +02:00
Bertrand Songis 64f66133cb Update DONATIONS.txt 2015-06-10 18:09:28 +02:00
Bertrand Songis 9c135095af Update DONATIONS.txt 2015-06-08 18:32:10 +02:00
Bertrand Songis 18f7586890 Update DONATIONS.txt 2015-06-07 09:12:14 +02:00
Bertrand Songis 8818aba486 Update DONATIONS.txt 2015-06-03 06:52:45 +02:00
Bertrand Songis 042b2498b3 Update DONATIONS.txt 2015-05-31 16:54:21 +02:00
Bertrand Songis 03f6d9ca77 Update DONATIONS.txt 2015-05-31 11:10:56 +02:00
Bertrand Songis 82e2ecb362 Update DONATIONS.txt 2015-05-30 17:55:48 +02:00
Bertrand Songis dadac58103 Merge pull request #2344 from opentx/projectkk2glider/issue_2260_simulator_volume_gain
Projectkk2glider/issue 2260 simulator volume gain
2015-05-29 21:18:49 +02:00
Bertrand Songis 297f7fa374 Update DONATIONS.txt 2015-05-28 17:52:08 +02:00
Damjan Adamic b7bdefabb3 Re #2260: All simulator audio globals joined into one structure, code cosmetics 2015-05-27 21:36:23 +02:00
Damjan Adamic 0cb1221312 Re #2260: Release notes updated 2015-05-27 21:09:47 +02:00
Damjan Adamic 00fb68084a Re #2260: ui widget 2015-05-26 19:33:52 +02:00
Damjan Adamic ac0d710efa Re #2260: added volumeGain in simulator 2015-05-26 19:33:52 +02:00
Damjan Adamic a29279e995 Release notes updated 2015-05-26 17:51:31 +02:00
Bertrand Songis 92bc7e9946 Update DONATIONS.txt 2015-05-26 06:33:43 +02:00
Bertrand Songis 3b2878f88a Merge pull request #2341 from opentx/projectkk2glider/issue_2301_findTrueFileName_fix_on_windows
Fixes #2301: findTrueFileName() was not finding any files on Windows
2015-05-25 22:22:33 +02:00
Damjan Adamic d862a13290 Fixes #2301: findTrueFileName() was not finding any files on Windows 2015-05-25 22:10:44 +02:00
Damjan Adamic 9d9e0b83c4 fix (reverted from commit 3fc2a27346) 2015-05-25 21:52:04 +02:00
DA 3fc2a27346 fix 2015-05-25 21:46:14 +02:00
Damjan Adamic e0035aea53 Release notes updated 2015-05-25 20:24:29 +02:00
Bertrand Songis 74cd5e3041 Update DONATIONS.txt 2015-05-25 15:39:31 +02:00
Bertrand Songis 3b9391df96 Update DONATIONS.txt 2015-05-23 19:15:39 +02:00
bsongis 22f0ff4660 [DE firmware] D16 becomes D16-EU (when only this mode is available) 2015-05-22 12:16:48 +02:00
Bertrand Songis 02a84d04cd Merge pull request #2323 from opentx/bsongis/special_eu_taranis_firmware_for_master
Special EU firmware for Taranis - For Master
2015-05-22 11:53:56 +02:00
Bertrand Songis edece6f083 Merge pull request #2295 from opentx/griebd/log_viewer_enhancement_2267
should solve #2267
2015-05-21 23:06:05 +02:00
Andre Bernet d65b04d393 Fix #2327 2015-05-21 22:57:14 +02:00
bsongis 57c4b8a4c6 Special EU firmware for Taranis - For Master
Only D16 mode is EU-compatible. This version will hide both D8 and LR12
modes.
2015-05-20 22:41:33 +02:00
Bertrand Songis 8b74de27d3 Update DONATIONS.txt 2015-05-20 19:10:25 +02:00
Bertrand Songis e726848d83 Update DONATIONS.txt 2015-05-19 20:33:49 +02:00
Bertrand Songis 3d409ba7c0 Merge pull request #2316 from opentx/projectkk2glider/issue_2084_max_expos
Fixes #2084: wrong constant used to limit maximum number of expos
2015-05-17 19:39:46 +02:00
Damjan Adamic 25fdffc417 Fixes #2084: wrong constant used to limit maximum number of expos 2015-05-17 18:50:24 +02:00
Romolo Manfredini f83239945c Missing string in translation 2015-05-16 23:32:37 +02:00
Bertrand Songis ce832b2736 Update DONATIONS.txt 2015-05-16 11:01:09 +02:00
Bertrand Songis 6aa2bd2f83 Update DONATIONS.txt 2015-05-15 13:29:23 +02:00
Bertrand Songis 47f8e6d0b6 Update DONATIONS.txt 2015-05-14 15:06:30 +02:00
Bertrand Songis 0f9ddc736b Update DONATIONS.txt 2015-05-13 08:18:21 +02:00
Grieb a4a6d27f83 logsdialog.cpp: removes unused function. 2015-05-11 13:01:38 -03:00
Grieb 25e60aeb66 Log Viewer: add a second legend and reference to axes in the legends. 2015-05-11 12:38:59 -03:00
Bertrand Songis 5447490fed Update DONATIONS.txt 2015-05-10 08:49:55 +02:00
Grieb 5a4a8ce43e Log Viewer multi-axes. Fixes #2267. 2015-05-09 15:39:07 -03:00
Bertrand Songis b645c9b03a Update DONATIONS.txt 2015-05-08 20:06:26 +02:00
Bertrand Songis 62b21985a8 Update DONATIONS.txt 2015-05-08 08:19:21 +02:00
Grieb fbc31db730 No real changes, just preparing for multi axes in Log Viewer. 2015-05-07 22:54:07 -03:00
Bertrand Songis c86d326869 Update DONATIONS.txt 2015-05-07 18:51:29 +02:00
Bertrand Songis da68fd68c5 Update DONATIONS.txt 2015-05-07 18:51:01 +02:00
Bertrand Songis 89a62f115e Update DONATIONS.txt 2015-05-07 18:45:46 +02:00
Grieb 47fa885cfa Updated QCustomPlot to 1.3.1. 2015-05-06 17:20:17 -03:00
Grieb 6c3591507f Solves item 2 of #2267. And add top/botton margin in graphs. 2015-05-06 16:42:40 -03:00
Bertrand Songis b4ceda1a98 Update DONATIONS.txt 2015-05-06 06:39:17 +02:00
Andre Bernet 27bba73d3c Mixers monitor in simulator (Fix #2258) 2015-05-05 10:25:50 +04:00
Bertrand Songis f4ccc9023b Update DONATIONS.txt 2015-05-04 19:20:29 +02:00
Bertrand Songis ced0546dd9 Update DONATIONS.txt 2015-05-04 07:34:17 +02:00
Bertrand Songis 367bb54119 Version 2.0.17 preparation 2015-05-04 06:59:42 +02:00
Bertrand Songis 88be3ac7a6 Special char introduced by the github editor 2015-05-04 06:54:28 +02:00
Bertrand Songis cb13ad1e8c Fixes #2253 2015-05-03 22:59:03 +02:00
Bertrand Songis 1bada4d7d6 Update mainwindow.cpp 2015-05-03 17:21:32 +02:00
Bertrand Songis 87675d3baf Update license.txt 2015-05-03 17:19:38 +02:00
Bertrand Songis 52226f362a Merge pull request #2252 from opentx/romolo/translations
Italian translations updated and obsolete removed.
2015-05-03 16:29:17 +02:00
Romolo Manfredini 713a99b1a9 Italian translations updated and obsolete removed. 2015-05-03 16:22:05 +02:00
bsongis 2ef2a0cc58 No tests, no code review? Thanks for the spam ... 2015-05-03 15:04:35 +02:00
Bertrand Songis 6c44fff39d Update releasenotes.txt 2015-05-03 13:44:10 +02:00
Bertrand Songis 8848fad8f9 Update releasenotes.txt 2015-05-03 13:43:50 +02:00
Bertrand Songis bc4028bf8c Update releasenotes.txt 2015-05-03 13:43:22 +02:00
Romolo Manfredini 4fdbed2c76 Merge pull request #2243 from opentx/profilebackupfolder
Implement profile specific settings for backup folder.
2015-05-03 13:31:09 +02:00
Romolo Manfredini df0162048f Unneeded this-> 2015-05-03 13:18:37 +02:00
Romolo Manfredini a6410c7a5b Remove duplicated code 2015-05-03 10:04:42 +02:00
Romolo Manfredini 50557c38bc Merge origin/master into profilebackupfolder 2015-05-02 19:19:50 +02:00
Romolo Manfredini f4f99b14ea Remove unneeded code: spared few uS in cpu time.. 2015-05-02 19:19:07 +02:00
Damjan Adamic 7b68109f3d Re #2090: segmentation fault fixed when play button was pressed for the first time 2015-05-02 18:26:06 +02:00
Damjan Adamic b6d85433c6 Release notes updated 2015-05-02 18:00:02 +02:00
Romolo Manfredini 578a305a5f Fix small bug, override of profilebackup folder 2015-05-02 13:51:48 +02:00
Romolo Manfredini 6cb6084afb Merge origin/master into profilebackupfolder 2015-05-02 13:51:34 +02:00
Romolo Manfredini 712a66fe6f As two field were added and binary structur changed we change also the internal version.
The new version will be 201 for opentx2.0
2015-05-02 12:56:22 +02:00
Damjan Adamic db97a2653a Merge pull request #2246 from opentx/romolo/potreset
Reset pots to the middle by right double clicking them
2015-05-02 12:09:06 +02:00
Romolo Manfredini 0d49d27ee2 Allow direct editing of paths 2015-05-02 10:30:54 +02:00
Romolo Manfredini 42d036b510 Reset pots to the middle by right double clicking them 2015-05-02 06:40:15 +02:00
Bertrand Songis 1bbe107c07 Update DONATIONS.txt 2015-05-01 20:22:53 +02:00
Romolo Manfredini 098324f5b9 Implement profile specific settings for backup folder.
Profile backup path if set overrides general one, in any case the backup will be performed if either profile specific setting or general settings ones are enabled.
Disabling backup in profile will not disable backups if generic settings are enabled
2015-05-01 15:56:31 +02:00
Bertrand Songis 8c3bcb28b1 Update DONATIONS.txt 2015-04-29 07:09:53 +02:00
Bertrand Songis 1e504d040b Merge pull request #2237 from opentx/projectkk2glider/issue_2154_64bit_overflow
Fixes #2154: USB mass storage problem with cards bigger than 4GB
2015-04-28 20:44:02 +02:00
Damjan Adamic f01f5cdb89 Release notes updated 2015-04-28 20:25:53 +02:00
Damjan Adamic bd2699f2ca Fixes #2154: USB mass storage problem with cards bigger than 4GB 2015-04-28 20:08:46 +02:00
Damjan Adamic 37170ea8d6 Merge pull request #2236 from opentx/griebd/companion_logsdialog_small_glitch_on_master
[companion][logsdialog]Small glitch when loading a second file.
2015-04-28 18:03:21 +02:00
Grieb 90874090e7 [companion][logsdialog]Small glitch when loading a second file. 2015-04-28 09:53:40 -03:00
Bertrand Songis 36c6311cb2 Merge pull request #2234 from opentx/romolo/modeleditfixes
Modeledit fixes
2015-04-28 07:36:41 +02:00
Romolo Manfredini 30cccb30a4 Layout changes in telemetry tab
update panels in modeledit before adding them to vertical_layouts to avoid fancy resizing of the panels.
2015-04-28 01:26:08 +02:00
Romolo Manfredini 6e0a65c0d6 Another translation missing 2015-04-27 09:44:54 +02:00
Romolo Manfredini 20f933019a Further fixes for it translations 2015-04-26 23:43:33 +02:00
Romolo Manfredini 5b00408d46 Further fix in Italian translation 2015-04-26 21:24:34 +02:00
mhotar 78243be714 CZ translations 2015-04-26 20:49:26 +02:00
Romolo Manfredini 64cf7c16f8 Further fix in Italian translation 2015-04-26 20:32:08 +02:00
Romolo Manfredini 1fb0810778 Further fix in Italian translation and a layout fix for a label too narrow. 2015-04-26 19:30:19 +02:00
Romolo Manfredini 79b94bd361 Improve readability of gvar tab in the simulator (further improvement, numbers are better aligned right) 2015-04-26 18:10:47 +02:00
Romolo Manfredini 6e43250671 Improve readability of gvar tab in the simulator 2015-04-26 18:01:20 +02:00
Romolo Manfredini 5656851168 Simulator layout for GVARS fixed 2015-04-26 17:18:13 +02:00
Damjan Adamic 601c0ca80e Release notes updated and release date set 2015-04-26 16:47:49 +02:00
Andre Bernet 264a007c6e Release notes 2015-04-26 17:26:31 +04:00
Andre Bernet a6509a1380 French translations 2015-04-26 14:56:52 +04:00
Andre Bernet 54b45db3fd Updated all translations for translators without a build environment 2015-04-26 14:23:17 +04:00
Andre Bernet 5027eac7b3 More insisting recommendation about reading firmware release notes 2015-04-26 14:18:05 +04:00
Romolo Manfredini cf9ba4152c Reduce width needed for curve editor 2015-04-26 11:36:56 +02:00
Bertrand Songis be3c5c4796 Update DONATIONS.txt 2015-04-26 11:20:03 +02:00
Romolo Manfredini 980b30f5bf Italian translation update 2015-04-26 10:43:06 +02:00
Romolo Manfredini 7b7e195604 Translation too long for small display. 2015-04-25 21:06:59 +02:00
Damjan Adamic ae34fa0637 Merge pull request #2229 from opentx/griebd/backport_2163_from_next
[companion][logsdialog]Backport fix for #2163 from next to master (log viewer massive speed improvement).
2015-04-25 21:02:29 +02:00
Grieb ff57ed6c4c Fix bug found by @projectkk2glider: X axis was messed up in fly sessions. 2015-04-25 14:07:37 -03:00
Damjan Adamic de00bda9e4 Fixes #2227: removed wrong check for SDL Audio initialization 2015-04-25 17:18:44 +02:00
Grieb 37933643ad [companion][logsdialog]Backport fix for #2163 from next to master. 2015-04-25 11:05:59 -03:00
Bertrand Songis 53bac0e0b7 Update DONATIONS.txt 2015-04-25 11:09:55 +02:00
Romolo Manfredini 65a73161b0 Display A3 and A4 when needed in printouts and print number of blades as number and not as ascii value. 2015-04-25 08:39:57 +02:00
Bertrand Songis b9911c0c71 Merge pull request #2219 from opentx/romolo/toolfixes20
Romolo/toolfixes20
2015-04-25 08:02:34 +02:00
Romolo Manfredini 4355e8e3a4 Compare modules settings 2015-04-24 00:57:42 +02:00
Romolo Manfredini 74e699fd7f FM trims in printout 2015-04-24 00:14:08 +02:00
Romolo Manfredini 23dfbddb1d Fixes in printdialog and comparedialog backported to 2.0 2015-04-24 00:05:08 +02:00
Romolo Manfredini b9c0f8309c New layout for general setup (removes vertical scrolls) 2015-04-23 23:14:32 +02:00
Bertrand Songis b7770cb9d0 Merge pull request #2218 from opentx/romolo/companion_batt_meter_range_2195
Romolo/companion batt meter range 2195
2015-04-23 18:47:57 +02:00
Romolo Manfredini a829f643f6 Move battery range to setup tab 2015-04-23 13:27:42 +02:00
Grieb 642b3b2773 [companion][eepe][general settings]Added battery meter range for Taranis. 2015-04-22 23:51:09 -03:00
Bertrand Songis dc4ccebae8 Update DONATIONS.txt 2015-04-22 18:50:28 +02:00
Bertrand Songis 02c8bcf0fa Update DONATIONS.txt 2015-04-20 18:48:13 +02:00
Romolo Manfredini 509a1f27df The gvar screen was out of the frame 2015-04-19 19:41:02 +02:00
bsongis 5c9467f134 French telemetry labels too long 2015-04-18 11:03:17 +02:00
Damjan Adamic cdb18612e3 Updated gtest images because of changes in commit 3d59de9f95 2015-04-17 20:15:06 +02:00
Damjan Adamic 8d0ab09a02 Merge pull request #2207 from opentx/jtaylor2/Issue_2128
Fix for Issue 2128 Changes to allow foreign characters in sdcard paths for Taranis and sky9...
2015-04-17 20:12:49 +02:00
jtaylor2 becd3fe3a2 Changes to allow foreign characters in sdcard paths for Taranis and sky9x simulators. 2015-04-17 13:16:03 -04:00
Bertrand Songis 61518190e7 Update DONATIONS.txt 2015-04-17 18:43:45 +02:00
Bertrand Songis 7526eb3985 Merge pull request #2205 from opentx/griebd/log_dialog_ordering_2204
[companion][logsDialog]Fixes #2204
2015-04-15 07:09:17 +02:00
bsongis 3d59de9f95 Fixes #2203 2015-04-14 18:58:45 +02:00
Grieb 187c802b5e [companion][logsDialog]Fixes #2204 2015-04-14 12:48:00 -03:00
Bertrand Songis 345d980bb1 Link error on VC++ 2015-04-14 09:07:52 +02:00
Bertrand Songis c4bf58f13d Merge pull request #2201 from opentx/griebd/log_viewer_performance_2199
[companion][log viewer]fix performance decrease if selection (fixes #2199)
2015-04-13 21:07:55 +02:00
Grieb 8c660c356c [companion][logsDialog]Add missing tr(). 2015-04-13 09:53:02 -03:00
Bertrand Songis cbfc78e01c Merge pull request #2200 from opentx/griebd/log_viewer_fly_session_2198
[companion][log viewer]fix fly session selection
2015-04-13 06:36:56 +02:00
Grieb d54c952a10 [companion][log viewer]fix performance decrease if selection (fixes #2199) 2015-04-12 23:46:15 -03:00
Grieb 1796c5be57 [companion][log viewer]fix fly session selection 2015-04-12 23:28:03 -03:00
Bertrand Songis 7a9f8576ed Merge pull request #2182 from opentx/projectkk2glider/sdl_initialization
Proper SDL library initialization for Audio and Joystick subsystems
2015-04-12 22:45:22 +02:00
Bertrand Songis 2aa401fa28 Update DONATIONS.txt 2015-04-12 22:39:38 +02:00
Bertrand Songis 653dc3d0d0 Update DONATIONS.txt 2015-04-11 09:45:07 +02:00
Bertrand Songis d4033efd84 Update DONATIONS.txt 2015-04-08 22:43:20 +02:00
Bertrand Songis e4b5746c47 Update DONATIONS.txt 2015-04-07 23:08:00 +02:00
Bertrand Songis 2ca2b3be1b Update DONATIONS.txt 2015-04-03 23:37:47 +02:00
Damjan Adamic ab93580b54 Release notes updated 2015-04-03 20:08:55 +02:00
Damjan Adamic a60e55d8bc Proper SDL library initialization for Audio and Joystick subsystems 2015-04-03 19:23:13 +02:00
Damjan Adamic ce052fb64c Merge pull request #2177 from opentx/girebd/log_viewer_1863
Fix for #1863
2015-04-03 18:36:03 +02:00
Andre Bernet c6f694f96f Use unit preference for GPS dist (Fix #2180) 2015-04-02 11:03:49 +04:00
Grieb 0a1dfa8064 [Companion][Graph]'srand' is now useless here. 2015-04-01 17:26:39 -03:00
bsongis b857f928ac Fixes #1953 2015-04-01 19:58:14 +02:00
Bertrand Songis 9883aeced7 Update DONATIONS.txt 2015-04-01 19:16:26 +02:00
Andre Bernet d222e0c828 Fix #2062 2015-04-01 09:45:26 +04:00
Bertrand Songis 089e50f176 Version of firmware updated 2015-04-01 06:47:35 +02:00
Grieb cef12652bc [Companion][Graph] Missed sanity check. 2015-03-31 16:26:29 -03:00
Grieb 9c73f0ba41 minor updates 2015-03-30 22:38:56 -03:00
Bertrand Songis 25cdeff642 Update DONATIONS.txt 2015-03-30 23:04:27 +02:00
Bertrand Songis d3bad3d98a Update DONATIONS.txt 2015-03-30 22:03:49 +02:00
Andre Bernet 29fb4a6fda Merge pull request #2178 from opentx/jtaylor2/Issue_2090
Fix for special function play icon Issue #2090
2015-03-30 23:38:37 +04:00
jtaylor2 730bc8c608 Fix for special function play icon Issue 2090 2015-03-30 14:22:23 -04:00
Andre Bernet 8c85b7504b Remove old install folder too 2015-03-30 15:09:24 +04:00
Andre Bernet 787a6ef983 Make version more obvious 2015-03-30 14:18:53 +04:00
Andre Bernet 232b9d6c20 Separate major companion versions - 2.0 part, move of installation folder and settings from OpenTX to OpenTX\Companion 2.0 2015-03-30 14:09:45 +04:00
Andre Bernet f1cc0a3666 Bad copy /paste in uninstaller section 2015-03-30 13:30:24 +04:00
Andre Bernet 1eb52f27fb Leftover files when uninstalling 2015-03-30 11:00:05 +04:00
Bertrand Songis 2c6ed340b4 Update DONATIONS.txt 2015-03-30 06:45:31 +02:00
Bertrand Songis 0c3a4883f5 Update DONATIONS.txt 2015-03-30 06:45:11 +02:00
Grieb bfe760868f Fixes #1863 2015-03-30 00:47:24 -03:00
Grieb d135e22b52 Updates to #1863 and #2163 2015-03-29 16:11:49 -03:00
Grieb d1bf393c3c Changed string 'Time' in logsDialog to 'Time (hh:mm:ss)'. 2015-03-29 16:11:49 -03:00
Grieb 7d0f9efc7b Proposed solution for #1863 2015-03-29 16:11:49 -03:00
Andre Bernet 4f99e86706 Merge pull request #2171 from mpaperno/telemetrysimu_add_fields
Companion/Sim: Add more fields to telemetry simulator UI
2015-03-28 15:18:45 +04:00
maxpaperno 117977654e Fix indents. 2015-03-28 06:12:53 -04:00
bsongis 218073256c Fixes #2050 2015-03-28 10:00:43 +01:00
bsongis a46aa6cd41 Ignore list updated 2015-03-28 09:59:53 +01:00
maxpaperno 30f0cbceb2 Companion/Sim: Add more fields to telemetry simulator UI;
Allow using hex notation for values;
Don't send blank values.
2015-03-28 03:18:18 -04:00
Bertrand Songis ec0e2dd441 Update DONATIONS.txt 2015-03-27 19:59:50 +01:00
Bertrand Songis 8cf1f96796 Update DONATIONS.txt 2015-03-27 06:46:29 +01:00
Bertrand Songis 906a36c1d2 Update DONATIONS.txt 2015-03-25 06:39:04 +01:00
Bertrand Songis b2f7ee1349 Update DONATIONS.txt 2015-03-24 22:36:32 +01:00
Bertrand Songis 7975ccb5bf Update DONATIONS.txt 2015-03-22 18:52:21 +01:00
Andre Bernet cb8c33b60e Merge pull request #2159 from opentx/MicheleVilla/FW_IT_Translation
Update it.h.txt
2015-03-22 13:29:54 +04:00
Michele 35ce95d401 Update it.h.txt 2015-03-22 07:44:18 +01:00
Bertrand Songis 07ddec8a1f Update DONATIONS.txt 2015-03-20 12:11:07 +01:00
Andre Bernet e92ca34661 Fix #2153 2015-03-20 14:45:01 +04:00
Andre Bernet 8d59090460 GVAR names not available for 9x in companion (Fix #2150) 2015-03-18 20:14:27 +04:00
Bertrand Songis 08f70bc61b Merge pull request #2143 from griebd/model_wizard_2091
Fix #2091
2015-03-17 06:38:47 +01:00
Bertrand Songis 0cfd640680 Update DONATIONS.txt 2015-03-17 06:36:57 +01:00
bsongis 25ce79f9e0 Fixes #2144 - Needs tests 2015-03-16 21:10:49 +01:00
Grieb bef750fd30 cosmetics 😉 2015-03-14 17:48:23 -03:00
Grieb 4b5101532e Fix #2091 2015-03-14 16:37:20 -03:00
Bertrand Songis 30cc26d38b Update DONATIONS.txt 2015-03-14 08:18:53 +01:00
Bertrand Songis 08c7f53436 Merge pull request #2136 from griebd/griebd/limit_special_characters_in_model_name_2122
Fix to #2122
2015-03-13 06:39:42 +01:00
Bertrand Songis 377ae33a9e Merge pull request #2139 from griebd/griebd/linux_xsd_compile_error_2138
Fix #2138 - companion compile error on Slackware linux
2015-03-13 06:39:10 +01:00
Grieb 0094efecfb Fix #2138 2015-03-12 20:17:31 -03:00
Bertrand Songis 045c381f3c Update DONATIONS.txt 2015-03-12 23:10:09 +01:00
Bertrand Songis 92f4a9491d Update DONATIONS.txt 2015-03-12 18:17:20 +01:00
Grieb a2c7f2ca73 Fix to #2122 2015-03-12 09:52:56 -03:00
Bertrand Songis 996961cc09 Update DONATIONS.txt 2015-03-09 21:55:19 +01:00
Bertrand Songis fdb270f663 Merge pull request #2132 from opentx/projectkk2glider/enable_link_opening_in_browser
Changelog links now open in external browser
2015-03-09 20:59:29 +01:00
Damjan Adamic 4784ab7828 Changelog links now open in external browser 2015-03-09 20:14:56 +01:00
Damjan Adamic 253e1bab88 Release notes updated 2015-03-09 19:58:27 +01:00
Bertrand Songis 6a15221c2c Merge pull request #2130 from opentx/projectkk2glider/issue_2123_lcd_buffer_overflow
Fixes #2123: lcd_bmp() could write outside the LCD buffer
2015-03-09 19:43:35 +01:00
Damjan Adamic 515cf67b77 Fixes #2123: lcd_bmp() could write outside the LCD buffer 2015-03-09 19:40:39 +01:00
Bertrand Songis b9c6d7d40b Update DONATIONS.txt 2015-03-08 12:49:19 +01:00
Bertrand Songis d690f5dda3 Update DONATIONS.txt 2015-03-07 08:12:03 +01:00
Bertrand Songis 72cdc95761 Update DONATIONS.txt 2015-03-04 18:45:35 +01:00
Bertrand Songis 71863e6e36 Update DONATIONS.txt 2015-03-03 20:06:21 +01:00
Bertrand Songis cee474e736 Update DONATIONS.txt 2015-03-02 06:36:33 +01:00
Bertrand Songis 132c61057a Update DONATIONS.txt 2015-03-01 19:02:49 +01:00
Damjan Adamic 55bf59142a Fixes #2002: Companion audio tracks not alphabetically sorted 2015-02-28 20:47:44 +01:00
Bertrand Songis 2d21fb54e1 Update DONATIONS.txt 2015-02-25 22:45:06 +01:00
Bertrand Songis 894a9a6f04 Update DONATIONS.txt 2015-02-23 21:26:36 +01:00
Bertrand Songis d594b30aa7 Update DONATIONS.txt 2015-02-23 19:22:23 +01:00
Bertrand Songis 55697a1b2c Update DONATIONS.txt 2015-02-23 18:14:19 +01:00
Bertrand Songis 8b0f8a35e0 Update DONATIONS.txt 2015-02-22 22:57:27 +01:00
Damjan Adamic 1cc697d40d Release notes updated 2015-02-22 16:00:20 +01:00
Damjan Adamic 6a29d3e5ae Re #457: audio was not working on radio 2015-02-22 14:49:44 +01:00
Bertrand Songis c5bf0e784a Merge pull request #2026 from opentx/projectkk2glider/simulator_audio
Projectkk2glider/simulator audio
2015-02-22 08:24:01 +01:00
Damjan Adamic 4837bb2f12 Re #457: audio working in Companion, Simulator and simu using SDL library (use SIMU_AUDIO=YES to enable)
Re #457: case insensitive f_stat() and f_open() for SIMU
2015-02-21 21:06:57 +01:00
Damjan Adamic e6620995b9 Re #2026: DISKIO_SIMU renamed to SIMU_DISKIO 2015-02-21 20:24:01 +01:00
bsongis 2991da1d94 Should not raise a "Bad antenna" alert if no module present. Not tested,
needs review.
2015-02-21 12:04:31 +01:00
Bertrand Songis 8c9f821bec Update DONATIONS.txt 2015-02-21 09:19:52 +01:00
Bertrand Songis 76568c5f50 Merge pull request #1977 from davxlw/davxlw_mixers_monitor
Mixers monitor
2015-02-19 23:40:40 +01:00
davxlw 919441f457 Mixers monitor + build option 2015-02-19 20:05:38 +01:00
Damjan Adamic 7aeb2ab303 Release notes updated 2015-02-18 21:33:34 +01:00
Damjan Adamic 7b379f3362 Re #2084: gests for Lua Inputs manipulation 2015-02-18 20:09:58 +01:00
Bertrand Songis 02ce3cc0de Merge pull request #2039 from opentx/projectkk2glider/issue_2007_sdcard_full
Fixes #2007: handle full SD card in openLogs()
2015-02-17 19:39:09 +01:00
Damjan Adamic 57cd700211 Re #2007: removed traces from ff.c 2015-02-17 18:37:52 +01:00
Bertrand Songis b5e36699b3 Merge pull request #2086 from opentx/projectkk2glider/issue_2084_lua_insertInput
Projectkk2glider/issue 2084 lua insert input
2015-02-16 21:13:53 +01:00
Damjan Adamic 8ca138a7ba Re #2084: Lua model.getInput() now also returns switch 2015-02-16 18:49:45 +01:00
Damjan Adamic 23c9efa514 Fixes #2084: index changed to unsigned for Lua mixer funcitons 2015-02-16 18:46:45 +01:00
Damjan Adamic f261118a1c Fixes #2084: Lua model.insertInput() could not add a line to an empty input or at the end of the existing input lines 2015-02-16 18:30:43 +01:00
Bertrand Songis d38a7b05f2 Update DONATIONS.txt 2015-02-15 15:56:54 +01:00
Bertrand Songis cfb54bb70d Update DONATIONS.txt 2015-02-15 12:37:01 +01:00
Bertrand Songis eba227d9da Update DONATIONS.txt 2015-02-14 16:54:29 +01:00
Bertrand Songis 8a5b9f8583 Update DONATIONS.txt 2015-02-09 11:54:18 +01:00
Bertrand Songis 2df15a9f3d Update DONATIONS.txt 2015-02-06 09:30:54 +01:00
Bertrand Songis f70087b5ef Update DONATIONS.txt 2015-01-31 23:58:16 +01:00
Bertrand Songis f0e41eed2e Update DONATIONS.txt 2015-01-31 12:29:49 +01:00
Bertrand Songis 00ab31550c Update DONATIONS.txt 2015-01-31 11:50:25 +01:00
Bertrand Songis 30ef400791 Update DONATIONS.txt 2015-01-31 08:08:20 +01:00
Bertrand Songis 9e50103155 Merge pull request #2021 from opentx/projectkk2glider/issue_2009_timers_refactoring
Fixes #2009: Timer Voice minute call not working for persistent timers
2015-01-28 19:38:42 +01:00
bsongis e3d1afff56 Fixes #2046 2015-01-28 06:55:06 +01:00
bsongis 013de8882d Fixes #2015 2015-01-28 06:49:31 +01:00
bsongis 116fe0dcb6 Fixes #2040 2015-01-27 23:39:24 +01:00
Damjan Adamic cddbcd95fb Re #2007: fixed gruvin and mega2560 simulators 2015-01-25 22:19:42 +01:00
Damjan Adamic a0fbfee721 Re #2007: missing file 2015-01-25 22:07:22 +01:00
Damjan Adamic 6439a977f2 Re #2007: SD card info menu implemented for Taranis, added display of free sectors
disk IO simulation
f_getfree() called in sdInit()
2015-01-25 21:59:39 +01:00
Damjan Adamic 3b0e93a527 Fixes #2007: handle full SD card in openLogs() 2015-01-23 20:12:10 +01:00
Damjan Adamic 6975eef35d Releasenotes updated 2015-01-23 19:09:05 +01:00
Damjan Adamic 8b45512103 Fixes #2027: Deleting file on radio does not actually frees clusters (patch from upstream) 2015-01-23 18:45:42 +01:00
Damjan Adamic 4edb931b7c Fixes #2034: ldc_line() was wrong for slanted lines 2015-01-23 18:09:51 +01:00
Bertrand Songis c0fd5fafb1 Merge pull request #2035 from opentx/projectkk2glider/issue_1937_take_two
Fixes #1937: reverse polarity on external CPPM output (Taranis)
2015-01-22 22:41:22 +01:00
Damjan Adamic 8ecba27adb Re #1937: internal module PPM code now optional (TARANIS_INTERNAL_PPM), but it still can't be selected in menus.
Release notes updated
2015-01-22 12:24:15 +01:00
Damjan Adamic ae029aa3f5 Fixes #1937: reverse polarity on external CPPM output (Taranis)
Removed support for internal module PPM mode (Taranis)
Hw specific code moved to drivers
2015-01-21 20:12:44 +01:00
Bertrand Songis 1fc6ca33d1 Update DONATIONS.txt 2015-01-20 21:49:44 +01:00
Bertrand Songis 2633c4549e Update DONATIONS.txt 2015-01-19 22:55:47 +01:00
Bertrand Songis 80bd182513 Update DONATIONS.txt 2015-01-18 22:31:35 +01:00
Bertrand Songis 40ac4608a7 Merge pull request #2028 from davxlw/davxlw_override
Typo correction
2015-01-18 21:40:51 +01:00
davxlw c8ff7bb9e2 Typo correction 2015-01-18 20:33:18 +01:00
Bertrand Songis cd2f352772 Update DONATIONS.txt 2015-01-17 19:49:38 +01:00
Damjan Adamic 8c73df5e65 Fixes #2009: Timer Voice minute call not working for persistent timers
Timers moved to timer.cpp
Added timer overflow protection
Added timer gtests
THt mode now triggers on THR>10%
2015-01-17 17:14:28 +01:00
Bertrand Songis ec1eb77ab7 Update DONATIONS.txt 2015-01-16 20:23:16 +01:00
Bertrand Songis 73c03318d2 Update DONATIONS.txt 2015-01-16 08:54:40 +01:00
Damjan Adamic d516b15e82 Utility to decode FAT12 clusters 2015-01-15 07:11:04 +01:00
Bertrand Songis 79d446b2af Update DONATIONS.txt 2015-01-14 21:24:18 +01:00
Bertrand Songis cb9fe3c500 Release note updated (scripts use this version tag in the Makefile) 2015-01-13 23:17:41 +01:00
Bertrand Songis e27aeba53f Release notes updated 2015-01-13 22:20:33 +01:00
Bertrand Songis 0bdb08e41c Merge pull request #2000 from davxlw/davxlw_releasenotes
Release notes updated
2015-01-13 22:16:20 +01:00
Bertrand Songis 7e5f5ce4b1 Update DONATIONS.txt 2015-01-13 22:07:34 +01:00
davxlw bfa3592810 Release notes updated 2015-01-13 21:16:52 +01:00
Bertrand Songis 07f02a29e5 Merge pull request #1999 from davxlw/davxlw_SF_SetTimer_Format
Companion: Time format for Special Functions Set Timers
2015-01-13 19:39:20 +01:00
davxlw 338363b05d Companion: Time format for Special Functions Set Timers 2015-01-13 19:04:26 +01:00
Damjan Adamic 047e4f7065 Fixes #1996: Include simulator in linux package 2015-01-13 16:48:10 +01:00
Damjan Adamic 0271823db9 Merge pull request #1998 from opentx/projectkk2glider/issue_1997
Fixes #1997: firmware upload failed when "Check Firmware Compatibility" ...
2015-01-13 16:46:55 +01:00
Damjan Adamic d827395434 Fixes #1997: firmware upload failed when "Check Firmware Compatibility" was selected 2015-01-13 12:13:30 +01:00
Damjan Adamic 94ced113c3 Release notes date set 2015-01-12 21:26:09 +01:00
mhotar 2a0b34146f Czech translations (Companion) 2015-01-11 22:16:13 +01:00
Bertrand Songis b13598d788 Merge pull request #1993 from opentx/MicheleVilla/C9X_IT_Translation
Italian translation in progress
2015-01-11 16:40:46 +01:00
MicheleVilla 4a59b9032b Italian translation in progress 2015-01-11 16:38:16 +01:00
Bertrand Songis 47a7b9f08b Update DONATIONS.txt 2015-01-11 13:00:31 +01:00
MicheleVilla 22a2b6f325 Italian translation in progress 2015-01-11 09:44:10 +01:00
Andre Bernet 84fe66bc82 Companion french translations 2015-01-10 20:00:41 +04:00
bsongis 89db641a9c Fixes #1992 2015-01-10 11:10:01 +01:00
Bertrand Songis 81001f9e24 Update releasenotes.txt
Missing tags
2015-01-10 08:55:10 +01:00
Bertrand Songis a731fb4a29 Update releasenotes.txt 2015-01-09 21:50:09 +01:00
bsongis d0e2caba46 #1942 - Test inverted as requested by the majority ;) 2015-01-09 21:45:32 +01:00
Damjan Adamic 10e71abe4d Release notes updated 2015-01-09 20:54:34 +01:00
Damjan Adamic 10b1836a31 Fixes #1987: gtests for lcd_line() 2015-01-09 19:25:43 +01:00
Bertrand Songis 2860d842dd Merge pull request #1989 from opentx/projectkk2glider/issue_1987
Projectkk2glider/issue 1987
2015-01-09 18:59:28 +01:00
Damjan Adamic a18a79bcba Fixes #1987: missing bitmap for gtests 2015-01-09 18:38:16 +01:00
Damjan Adamic 6d46d52bfd Fixes #1987: bmpLoad() last column not loaded for some bitmap widths, gtests added 2015-01-09 18:33:17 +01:00
bsongis 729f68f33f #1732 - First code review. Nothing obvious found except a buffer
overflow
2015-01-09 17:12:41 +01:00
bsongis 59966a1e40 Fixes #1775 - Review and tests needed 2015-01-09 15:49:59 +01:00
bsongis caf0c42cac Fixes #1942 - Review needed, thanks! If it works it could be used in
some other places.
2015-01-09 15:12:37 +01:00
Damjan Adamic dc295c8cb4 Fixes #1981: Edge function INSTANT bug for V1>2s 2015-01-09 14:26:39 +01:00
Damjan Adamic 641187c3af Re #1987: first pixel not drawn by Lua lcd.drawLine() 2015-01-09 13:56:44 +01:00
bsongis 026b0f141e Fixes #1876 - Popup displayed when flavour from previous firmware exists
and is not compatible with the current flavour. Fortunately FrSky always
inserted a flavour in their radios, so it works. Tested on my Taranis+ I
would appreciate someone else tests on a standard Taranis, thanks!
2015-01-09 12:22:48 +01:00
Bertrand Songis d28c1417c7 Update DONATIONS.txt 2015-01-09 08:50:32 +01:00
Damjan Adamic f37092efd0 Bootloader now uses NANO setting from the main Makefile 2015-01-08 08:26:36 +01:00
Bertrand Songis d95518c91e Merge pull request #1984 from kh90909/pwm-bl-fix
Tested fix for PWM_BACKLIGHT on ATmega2561 MCUs
2015-01-08 07:44:18 +01:00
Ken ed4465d78f Tested fix for PWM_BACKLIGHT on ATmega2561 MCUs
The functionality of timer0 and timer2 are switched between ATmega64/128
and 641/1281/2561. When compiled for ATmega2561, this commit sets up timer0
in the same way as timer2 on ATmega64/128 (phase correct PWM, clk/64 count
rate, inverted if SP22 is defined).

The previous quick fix had a typo in the initialization of TCCR0B (0b111 is
an invalid value for the clock select bits CS2:0). It also did not respect
the SP22 define which indicates the PWM must be inverted. Smartieparts
v2.2 or later programmer boards have an inverted backlight driver. Finally,
it is unnecessary to set DDB7 as it is already set in boardInit() (line
101).
2015-01-08 00:52:21 -05:00
Bertrand Songis b7de352e83 Merge pull request #1978 from davxlw/davxlw_lcd_putsCenter
Little lcd_putsCenter correction
2015-01-07 07:07:07 +01:00
davxlw 42aa3ca4ba Little lcd_putsCenter correction, still doesn't take the different characters
sizes into account...
2015-01-06 17:06:51 +01:00
Bertrand Songis f4afe50c32 Merge pull request #1974 from adriano65/Correction01_#1895
Issue #1935 - added Mavlink 115200 Baud speed - to test
2015-01-06 07:33:33 +01:00
adriano65 8726fe1329 Issue #1935 - added Mavlink 115200 Baud speed - to test 2015-01-06 01:18:35 +01:00
mhotar 2fc2c58338 Merge branch 'master' of https://github.com/opentx/opentx 2015-01-05 23:04:23 +01:00
mhotar f44a744a09 Czech translations 2015-01-05 23:02:51 +01:00
Bertrand Songis b0b29b57fe Update DONATIONS.txt 2015-01-05 22:51:37 +01:00
Bertrand Songis 9f70a5baaf Merge pull request #1971 from adriano65/Correction01_#1895
Correction to "compilation error on 9XR with MAVLINK extension"
2015-01-05 06:42:34 +01:00
adriano65 38c8b95fd7 Correction to "compilation error on 9XR with MAVLINK extension" 2015-01-05 00:17:36 +01:00
bsongis bc0969181e Quick fix for #1970 - I don't have any 2561 for testing, I let you test
and fix if needed!
2015-01-04 23:39:29 +01:00
Damjan Adamic 16bdd1ae93 Re #1489, #1270, Re #1466: Allow only one instance of new dialogs, enable telemetryInterrupt10ms() call 2015-01-04 20:20:30 +01:00
bsongis 15eb56908c Fixes #1961 2015-01-04 17:14:35 +01:00
bsongis e74ab6f15b Fixes #1793 - cp won't work on some Linux distributions 2015-01-04 15:42:23 +01:00
Bertrand Songis 7bf73ac365 Update DONATIONS.txt 2015-01-04 10:00:29 +01:00
Damjan Adamic a5d14f631f Re #457: AUDIO_FILENAME_MAXLEN to small 2015-01-03 12:52:26 +01:00
Damjan Adamic 5947054e3b Release notes updated 2015-01-03 11:09:15 +01:00
Damjan Adamic 8255a84571 Re #1489: windows build didn't like the redefiniton of callback function 2015-01-03 07:04:14 +01:00
Bertrand Songis 91fdbd17c0 Update DONATIONS.txt 2015-01-02 23:07:39 +01:00
Bertrand Songis c3ece1f12f Merge pull request #1967 from opentx/projectkk2glider/companion_simulator_extensions
Projectkk2glider/companion simulator extensions
2015-01-02 20:01:12 +01:00
Damjan Adamic beb93fdf5f Re #1466, #1489, #1270: added missing delete on close 2015-01-02 19:29:00 +01:00
Damjan Adamic 5d60f776ad Re #1270: trainer for Sky9x 2015-01-02 19:29:00 +01:00
Damjan Adamic 07f238b974 Re #1489: TRACE() output intercepted and shown in Companion (shortcut F6) 2015-01-02 19:29:00 +01:00
Damjan Adamic c916bb38d0 Re #1270: simple Trainer Simulator (shortcut F5)
Re #1466: small fixes to Telemetry simulator
2015-01-02 19:28:59 +01:00
Damjan Adamic a1ceb4a4f3 Re #1466: Telemetry simulator opening moved to class SimulatorDialog 2015-01-02 19:09:51 +01:00
Damjan Adamic 263d2cf201 Re #1466: Very simple telemetry (or receiver) simulation for Taranis. Simulates RSSI, SWR, A1 and A2. Uses F4 key as a open shortcut. 2015-01-02 19:09:51 +01:00
bsongis 482d7e0335 Bug introduced in commit c8eba005d3 2015-01-02 12:20:57 +01:00
bsongis 4f323d980f VC++ Compilation error for #1965 2015-01-02 08:13:55 +01:00
Bertrand Songis eb7b662ff2 Update DONATIONS.txt 2015-01-02 08:08:50 +01:00
bsongis 689dacf577 Fixes #1965 2015-01-01 21:24:25 +01:00
bsongis 8762e46dbb Fixes #1960 2015-01-01 20:16:00 +01:00
bsongis c8eba005d3 Fixes #1940 - Also adds a "stops" feature in checkIncDec that could be
useful in a next future
2015-01-01 19:52:41 +01:00
bsongis 34a1b2eeca Warnings removed 2015-01-01 19:47:36 +01:00
bsongis 2ae475a9e8 #1876 - Companion now recognizes the radio type from the binary file 2015-01-01 13:17:22 +01:00
bsongis 5413619846 #1876 - Radio identifier added inside the firmware - it will help
Companion to recognize the radio type and avoid to flash a wrong
firmware.
2015-01-01 11:31:57 +01:00
Damjan Adamic 9bc7ed52d4 Re #1963: fixes the case of power switch fast OFF->ON sequence. 2015-01-01 09:29:15 +01:00
Damjan Adamic 1de327e386 Fixes #1964 and possibly #1963: TIM13 was used by bootloader and delays.c, lcdInitFinish() was missing from lcdSetRefVolt(), simplified LCD init interface for Taranis, delaysInit() was missing from Bootloader (ported 7b19afa96f from next branch) 2014-12-31 19:34:15 +01:00
Bertrand Songis 039d084228 Update DONATIONS.txt 2014-12-31 11:19:44 +01:00
Bertrand Songis b7aab8b64f Merge pull request #1957 from opentx/projectkk2glider/botloader_nano_lib
Projectkk2glider/botloader nano lib
2014-12-29 20:33:19 +01:00
Damjan Adamic cffd5aa2bc Default changed to link with nano lib (NANO=YES), reduces opentx size from 340040 to 323056 bytes 2014-12-27 12:49:20 +01:00
Damjan Adamic 01d9445a49 Using nano lib reduces bootloader size for Taranis from 31880 to 31004 bytes. 2014-12-27 12:38:10 +01:00
Bertrand Songis 9c2f9b8b78 Update DONATIONS.txt 2014-12-23 07:32:59 +01:00
Bertrand Songis 4ab58cb559 Update DONATIONS.txt 2014-12-22 21:08:55 +01:00
Damjan Adamic 1804bcd133 Fixes #1927: THt persistent timer running after model load (with Throttle at -100%) 2014-12-21 20:25:18 +01:00
Bertrand Songis 4b8d9a5549 Merge pull request #1948 from opentx/projectkk2glider/issue1937_ppm_polarity
Re #1937: reverse polarity on external CPPM output (Taranis all)
2014-12-21 00:11:53 +01:00
Bertrand Songis 7426bfafc0 Merge pull request #1947 from opentx/projectkk2glider/issue1800_center_beep_for_noexisting_pot
Fixes #1800: suppress center beep for non-existing pots
2014-12-21 00:11:20 +01:00
Damjan Adamic c9e66c9502 Re #1937: reverse polarity on external CPPM output (Taranis all) 2014-12-20 20:42:33 +01:00
Bertrand Songis bb57632121 Update DONATIONS.txt 2014-12-20 20:18:40 +01:00
Damjan Adamic aa739f394c Fixes #1800: suppress center beep for non-existing pots 2014-12-20 19:41:46 +01:00
Damjan Adamic 2ecbd8e6a9 Turn on back-light in LCD_BL_Config() for REVPLUS (normal Taranis already did this) 2014-12-20 18:58:46 +01:00
Bertrand Songis edabaed304 Update DONATIONS.txt 2014-12-20 09:34:58 +01:00
bsongis 75fd4378fe LCD bugfix on EEPROM alerts. No more Splash if splash disabled 2014-12-18 19:03:52 +01:00
bsongis bf60fd2631 Fixes #1918 2014-12-16 21:55:01 +01:00
Bertrand Songis 8e06e4b8a3 Merge pull request #1936 from opentx/projectkk2glider/issue1919_gvars_invert_take_two
Fixes #1919: Shortcuts keys for inverting values don't work correctly wi...
2014-12-15 23:50:28 +01:00
Bertrand Songis 62f3f71bb3 Update DONATIONS.txt 2014-12-15 23:17:26 +01:00
Damjan Adamic 64227a2cb6 Re #1919: disabled DBLKEYS for !ARM 2014-12-15 21:41:46 +01:00
Bertrand Songis d911220697 Merge pull request #1933 from opentx/projectkk2glider/issue1909_tab_order_2
Projectkk2glider/issue1909 tab order 2
2014-12-15 18:39:05 +01:00
Damjan Adamic 001f53efe3 Fixes #1919: Shortcuts keys for inverting values don't work correctly with GVs 2014-12-15 15:54:46 +01:00
Damjan Adamic 1161647908 Re #1909: tabs fixed for Model Edit -> Setup tab 2014-12-14 16:01:10 +01:00
Damjan Adamic b54afa04e6 Re #1909: tabs fixed for Radio Profile firmware options 2014-12-14 15:30:31 +01:00
Damjan Adamic bfeda24dcd Re #1835: fix for negative trim index 2014-12-14 14:15:56 +01:00
Damjan Adamic ef6b36526d Fixed #1835: Issue with heli swash plate mixing (notrim) 2014-12-14 12:42:05 +01:00
Damjan Adamic 67990ea9a3 Fixes #1869: Google Earth additional fields exported as strings, support for variable number of columns 2014-12-14 10:00:31 +01:00
Bertrand Songis 446da70fb1 Merge pull request #1929 from opentx/projectkk2glider/issue1926_smlsize_fixes
Re #1926: SMLSIZE last line drawn, gtests expanded with LCD character ov...
2014-12-13 22:01:58 +01:00
Damjan Adamic 9e3c90dcd9 Re #1926: SMLSIZE last line drawn, gtests expanded with LCD character overlapped test 2014-12-13 21:24:22 +01:00
Damjan Adamic ef3bf78085 Re #1926: Fixed SMLSIZE gtests 2014-12-13 20:44:47 +01:00
Bertrand Songis 3118970cf4 Merge pull request #1928 from opentx/projectkk2glider/issue1926_display_glitches
Fixes #1926: Little display glitches
2014-12-13 20:21:39 +01:00
Damjan Adamic b9d951919e Fixes #1926: Little display glitches 2014-12-13 20:19:35 +01:00
bsongis 28d95f9844 Target addframeworks fixed as discussed in #1482 - untested 2014-12-12 23:11:06 +01:00
bsongis ed583e704f Fixes #1923 2014-12-12 18:14:32 +01:00
Bertrand Songis aba2e31ce2 Update DONATIONS.txt 2014-12-12 17:53:59 +01:00
Bertrand Songis be27447196 Fixes #1921 2014-12-12 07:19:11 +01:00
Bertrand Songis 2cc47a9146 Merge pull request #1920 from opentx/projectkk2glider/issue1909_tab_order
Fixes #1909: tab order in Companion dialogs
2014-12-11 22:18:53 +01:00
Damjan Adamic a86ec3bcb0 Fixes #1909: tab order in Companion dialogs 2014-12-11 19:31:29 +01:00
bsongis 1c45019403 Fixes #1915 2014-12-11 18:50:38 +01:00
Bertrand Songis 8f10e8e212 Update DONATIONS.txt 2014-12-10 19:03:40 +01:00
bsongis 704f1c95cc Fixes #1908 2014-12-09 21:37:11 +01:00
bsongis f50d94bded 2.0.14 preparation 2014-12-09 20:31:38 +01:00
bsongis 7a7371d651 MAVLINK adaptation for Sky9x and 9XRPRO - Closes #1895 2014-12-09 19:39:00 +01:00
Bertrand Songis be071767c7 Merge pull request #1877 from opentx/projectkk2glider/issue1875_lcd_low_temp
Fixes #1875 and #1849: implemented LCD initialization for low temperatures
2014-12-09 19:02:31 +01:00
bsongis 7f31bde6d0 Fixes #1903 2014-12-08 22:56:52 +01:00
bsongis 108109b579 Fixes #1905 2014-12-08 19:44:58 +01:00
Bertrand Songis ceff3262f9 Update DONATIONS.txt 2014-12-08 19:30:12 +01:00
Damjan Adamic bc31b7d3dd Re #1875 and #1849: the delay for Taranis Plus reduced to 300ms 2014-12-03 20:36:22 +01:00
Bertrand Songis bd8371892d Update DONATIONS.txt 2014-12-02 07:08:23 +01:00
Bertrand Songis 5cfcc27fb4 Update DONATIONS.txt 2014-11-27 18:25:57 +01:00
Damjan Adamic 8f07439943 Fixes #1875 and #1849: implemented LCD initialization for low temperatures. Initialization skipped in case of watchdog reset or boot-loader exit. 2014-11-26 21:04:00 +01:00
Damjan Adamic c052ff26c7 Fixes #1874: Wrong clock configuration for CoOS on Taranis 2014-11-26 17:33:01 +01:00
Bertrand Songis 5dd3af7d3c Update DONATIONS.txt 2014-11-26 07:53:42 +01:00
bsongis 5b9f0dd6a9 Nighly builds were broken (previous syntax was chosen for VC++
compilation!). Anyhow we shouldn't need this trick any more.
2014-11-25 07:11:21 +01:00
Bertrand Songis 7e2b78f2b5 Update DONATIONS.txt 2014-11-24 07:58:01 +01:00
Damjan Adamic b9e2635ec1 Corrected optimization level for sky9x DAC_IRQHandler() (was left in -O2 after that function) 2014-11-23 20:26:44 +01:00
Bertrand Songis caede92d09 Update DONATIONS.txt 2014-11-23 09:41:07 +01:00
bsongis e62651ac14 Fixes #1861 2014-11-22 19:07:39 +01:00
bsongis 643d45e4c0 Fixes #1867 2014-11-22 14:34:32 +01:00
Bertrand Songis a2e930d6a3 Update DONATIONS.txt 2014-11-22 07:14:41 +01:00
Damjan Adamic 9342be9e48 Debian package maintainer changed to Bertrand Songis <bsongis-nosp@m-gmail.com> 2014-11-21 22:06:39 +01:00
Damjan Adamic 125923d7d6 45-taranis.rules renamed to 45-companion-taranis.rules to solve the clash with the same file name from Companion9x debian package 2014-11-21 22:02:33 +01:00
Bertrand Songis fbdb328c6a Update DONATIONS.txt 2014-11-21 20:15:42 +01:00
Bertrand Songis 6c17e1efc8 Update DONATIONS.txt 2014-11-21 18:07:32 +01:00
Bertrand Songis 6273fb7e7c Update DONATIONS.txt 2014-11-21 07:59:12 +01:00
Bertrand Songis f6cc9067d8 Update DONATIONS.txt 2014-11-21 07:09:49 +01:00
Bertrand Songis 8ce5d38093 Update DONATIONS.txt 2014-11-21 00:16:05 +01:00
Bertrand Songis 9397c470da Update DONATIONS.txt 2014-11-20 23:54:16 +01:00
Bertrand Songis c8b3ea7f36 Update DONATIONS.txt 2014-11-20 23:10:48 +01:00
Bertrand Songis 3a55f85ef1 Update DONATIONS.txt 2014-11-20 22:11:00 +01:00
Bertrand Songis f5889dc912 Update DONATIONS.txt 2014-11-20 21:55:55 +01:00
Bertrand Songis f12b8a50ec Update DONATIONS.txt 2014-11-20 21:36:53 +01:00
Bertrand Songis b561967d3e Update DONATIONS.txt 2014-11-20 20:32:07 +01:00
bsongis b359aa12ba Fixes #1834
Fixes #1848
2014-11-19 22:35:35 +01:00
bsongis 5f81444ccb Release notes updated 2014-11-19 21:59:18 +01:00
bsongis e8aba51edb Fixes #1852 2014-11-19 20:27:57 +01:00
bsongis 6393f10ae4 Fixes #1851 2014-11-19 19:47:38 +01:00
bsongis 8a16b63b31 Mutex lock check added as suggested by projectkk2glider 2014-11-19 19:40:45 +01:00
bsongis a5d334b11d No more -O2 on all platforms 2014-11-19 07:12:13 +01:00
bsongis b51060f8f8 unexpectedShutdown sentinel removed 2014-11-18 23:29:27 +01:00
Bertrand Songis 0db8fc5ab2 Update DONATIONS.txt 2014-11-18 23:08:37 +01:00
bsongis 1c696c28fd ioMutex removed 2014-11-18 07:52:15 +01:00
bsongis f29d2074c1 openocd config file added 2014-11-18 00:30:01 +01:00
bsongis c12bc7326c Those ; are a little bit dangerous 2014-11-18 00:30:01 +01:00
Damjan Adamic 6365292bfe Updated release notes 2014-11-17 21:05:43 +01:00
bsongis d74bdef2ea Release notes updated (please update if I missed anything) 2014-11-17 19:06:50 +01:00
Bertrand Songis 884698c7f7 Update DONATIONS.txt 2014-11-17 07:37:25 +01:00
Damjan Adamic 1454764987 Enabled more complier warnings and removed one for Taranis. Other targets still have some warnings. 2014-11-15 11:43:52 +01:00
Bertrand Songis fb35ff098d Merge pull request #1843 from opentx/projectkk2glider/bmpload_fixes
Fixed bmpLoad():
2014-11-15 10:09:58 +01:00
bsongis 681064b11c Cosmetics 2014-11-15 10:09:33 +01:00
bsongis 87ebf0b90a Fixes #1834 - I will confirm with the JTAG that it is a compiler bug
later
2014-11-15 08:36:26 +01:00
Bertrand Songis 1f63108753 Update DONATIONS.txt 2014-11-14 19:57:52 +01:00
Damjan Adamic 649fffa439 Fixed bmpLoad():
* added gtests
 * fixed various memory leaks
 * fixed wrong display of images with width < 8
 * fixed wrong display of images with odd width and/or height
2014-11-12 19:45:00 +01:00
Bertrand Songis e3d08e9bab Update DONATIONS.txt 2014-11-12 07:08:06 +01:00
Bertrand Songis b4cc92b3f0 Update DONATIONS.txt 2014-11-11 20:35:17 +01:00
Bertrand Songis 9691d9f648 Update DONATIONS.txt 2014-11-11 09:04:08 +01:00
Damjan Adamic f02b9699d5 Re #1834 - fixed Companion simulator compilation for lastest FatFS 0.10c 2014-11-10 20:30:55 +01:00
bsongis b78556275b #1834 - Switch to lastest FatFS 0.10c 2014-11-10 18:53:37 +01:00
bsongis 1effa17204 #1834 ... In case we have negative indexes here ... 2014-11-09 22:53:24 +01:00
Damjan Adamic ff69164400 One more try for Windows Companion compile problem (lua_exports) 2014-11-09 21:08:18 +01:00
Damjan Adamic 86e8687d32 Possible solution for Windows Companion compile problem (lua_exports) 2014-11-09 20:44:09 +01:00
Damjan Adamic 85755312e4 Fixes #1839: Companion simulator Lua crash on Mac 2014-11-09 10:32:43 +01:00
Bertrand Songis f826d77f18 Merge pull request #1832 from opentx/projectkk2glider/issue_1783_for_master
Projectkk2glider/issue 1783 for master
2014-11-08 11:23:24 +01:00
bsongis 9dc4756789 In MixerDialog GVar checkbox for Curves was visible even when GVARS
disabled
2014-11-08 11:22:46 +01:00
Bertrand Songis afd04e0c44 Update DONATIONS.txt 2014-11-08 10:53:27 +01:00
Damjan Adamic d718ca03db This enables build of Companion on OS X
Remove the check for arm-gcc version when doing Companion build
2014-11-08 10:15:23 +01:00
Bertrand Songis ca4028cc7e Update DONATIONS.txt 2014-11-07 18:25:59 +01:00
Bertrand Songis 9c0b13eb6b Merge pull request #1827 from opentx/projectkk2glider/issue_1811_for_master
Fixes #1811: Companion 2.0.12 Gvar import error (for limits)
2014-11-03 23:56:42 +01:00
Damjan Adamic 5a10d85ee0 Re #1783: NOT curves removed from inputs (for non ARM platforms) 2014-11-03 22:15:05 +01:00
Damjan Adamic 2d80327ffd Re #1783: NOT curves exported incorrectly (for non ARM platforms) 2014-11-03 22:01:58 +01:00
Damjan Adamic 2a5ff5244f Re #1783: Companion shows too many curve types in input/mixer for 9x 2014-11-03 21:14:52 +01:00
Damjan Adamic 2ce1ec16fb Fixes #1811: Companion 2.0.12 Gvar import error (for limits) 2014-11-03 19:55:07 +01:00
Bertrand Songis 607a93b604 Update DONATIONS.txt 2014-11-03 18:36:57 +01:00
Bertrand Songis 75b7a0517b Merge pull request #1822 from opentx/projectkk2glider/issue_1731_for_master
Fixes #1731: Joystick calibration crash after channel assignment
2014-11-02 19:43:08 +01:00
Damjan Adamic cf54d28f35 Fixes #1731: Joystick calibration crash after channel assignment
also additional fixes to stick postion mapping
2014-11-02 18:58:06 +01:00
Bertrand Songis ffe8ee5a29 Update DONATIONS.txt 2014-11-02 18:06:42 +01:00
Bertrand Songis 552e3d468a Update DONATIONS.txt 2014-11-02 16:28:31 +01:00
Damjan Adamic 949369d6a8 Fixes #1815: Stick icons missing next to trim key states on switch diag page 2014-11-02 13:32:39 +01:00
Damjan Adamic 3b2cf5d738 Fixes #1737: virtual inputs not selectable in SF Volume and heli Collective Source 2014-11-02 12:52:45 +01:00
bsongis 5468bacad7 2.0.13 preparation 2014-11-02 11:07:47 +01:00
Bertrand Songis b8fea4d652 Merge pull request #1820 from opentx/projectkk2glider/issue_1818_for_master
Fixes #1818: added Lua model.resetTimer() function
2014-11-02 10:00:12 +01:00
Damjan Adamic 734480cc56 Fixes #1818: added Lua model.resetTimer() function 2014-11-02 09:26:36 +01:00
Bertrand Songis 30e0d441e4 Update DONATIONS.txt 2014-10-29 19:00:05 +01:00
bsongis 784238252a Simplification with a new #define. Also one test was inverted. 2014-10-28 18:07:46 +01:00
Andre Bernet 403a62478a Disable SWR if XJT version is 0xFF
Typo
2014-10-28 12:38:54 +04:00
bsongis c73ab26bc4 SWR readded to Taranis+ (when the hardware supports it) 2014-10-28 00:23:54 +01:00
bsongis c0783948e6 #1805 fixed 2014-10-26 15:57:00 +01:00
Damjan Adamic dc3ca96a2f Display message in case of Lua telemetry screen script error 2014-10-26 10:40:21 +01:00
Damjan Adamic 5664b4a141 Missing screenshots for previous commit 2014-10-25 20:04:16 +02:00
Damjan Adamic 7e18f53cbe Fixed buffer overflow in lcd_hlineStip() 2014-10-25 20:00:56 +02:00
Damjan Adamic 611e26d0bf Fixed buffer overflow in bmp_load() 2014-10-25 19:30:52 +02:00
bsongis ae7a36deeb A2- set to A2 if A2 > A2+ 2014-10-22 20:27:23 +02:00
bsongis 7c37277364 Little display problem for negative curves on 9X 2014-10-21 07:18:08 +02:00
bsongis 2230fbaa94 SWR added in the firmware as an option (SWR=YES) 2014-10-19 22:54:38 +02:00
bsongis 97bb1a4b4d Cosmetics 2014-10-19 22:54:38 +02:00
bsongis 82d385bcef SWR added for latest Taranis+ production 2014-10-19 22:54:38 +02:00
Bertrand Songis 34f9367e25 Update DONATIONS.txt 2014-10-19 18:46:19 +02:00
Bertrand Songis 205e510468 Update DONATIONS.txt 2014-10-19 09:55:22 +02:00
Andre Bernet 414a482ce4 Fix receiver number range (Fix #1790) 2014-10-17 22:44:57 +04:00
Damjan Adamic b24d071493 Bug in numbering of Lua multiple fields (only in generated documentation file, all numbers were too small by 1) 2014-10-16 18:26:42 +02:00
Bertrand Songis a50e2472e9 Update DONATIONS.txt 2014-10-15 21:33:41 +02:00
bsongis 29c95fd2a3 Cosmetics 2014-10-14 22:23:24 +02:00
Damjan Adamic c9875525a4 Re #1610:
* sport.log only active if SPORT_FILE_LOG=YES
* audio concurrent access fixes
* added IO mutex
* added Event Trace Buffer
* fixed SD card error
2014-10-14 22:14:36 +02:00
bsongis 6df7575ad8 Fixes #1785 2014-10-12 19:42:07 +02:00
bsongis 86c8d4a878 It was possible to have the Limits contextual menu displayed in
READ_ONLY mode
2014-10-11 21:47:12 +02:00
Bertrand Songis 6abc26c36a Update DONATIONS.txt 2014-10-10 19:25:08 +02:00
Bertrand Songis 966398426a Update DONATIONS.txt 2014-10-10 07:04:34 +02:00
mhotar d43a48f088 No special character in CZ names of Inputs.
Conflicts:
	radio/src/translations.cpp
	radio/src/translations.h
	radio/src/translations/cz.h.txt
2014-10-07 07:10:40 +02:00
mhotar 56b4698655 cz tts.py updated 2014-10-07 07:06:28 +02:00
Bertrand Songis 57f0c1b6f6 Update DONATIONS.txt 2014-10-06 21:14:51 +02:00
bsongis b89e16e627 Sky9x Coprocessor bug fix 2014-10-06 00:03:19 +02:00
bsongis 9e4e990d33 Sky9x binary was built with the bootloader present on disk (was not
removed by make clean). So 99% it was a Taranis bootloader.
2014-10-06 00:02:40 +02:00
bsongis a7c893607a Companion bug in model import fixed (after changing radio in the same
session)
2014-10-05 19:32:02 +02:00
Damjan Adamic e477183026 Fixes #1755 (on master branch): LUA get/setTimer(): inconsistent timer struct 2014-10-05 14:52:13 +02:00
bsongis a4698287f8 Note added to Companion: if you have a Taranis that has not had the
firmware upgraded to 2.0 then this version of Companion will not work
2014-10-03 16:36:42 +02:00
Damjan Adamic b035a8df64 Fixes #1657 (ported from next to master):
* corrected varioLimitCenterMin range
* removed varioLimitMinOff checkbox (it is not used anymore in any radio)
2014-10-01 19:38:56 +02:00
Damjan Adamic 223be49c5d Fixes #1696: fixed incorrect display of "<" and ">" characters (ported from next to master branch) 2014-10-01 19:30:13 +02:00
Bertrand Songis ac8312de36 Update DONATIONS.txt 2014-10-01 07:10:41 +02:00
Bertrand Songis 46a9151bcf Update DONATIONS.txt 2014-09-30 07:11:33 +02:00
Bertrand Songis 0e9536fea9 Update DONATIONS.txt 2014-09-28 22:01:22 +02:00
Bertrand Songis 64d86c4c74 Update DONATIONS.txt 2014-09-26 23:40:52 +02:00
Bertrand Songis 151a09149d Update DONATIONS.txt 2014-09-26 07:19:57 +02:00
Bertrand Songis fd53eba65f Update DONATIONS.txt 2014-09-25 10:36:31 +02:00
Bertrand Songis 393f599ecf Update DONATIONS.txt 2014-09-24 19:56:36 +02:00
bsongis 1fbb4effed Tests failure 2014-09-24 15:22:20 +02:00
Bertrand Songis fe95488a83 Update DONATIONS.txt 2014-09-24 14:52:04 +02:00
bsongis c9b9de2c99 Fixes #1630 - Thanks to projectkk2glider for his pull request #1738 - I
only added a google test
2014-09-24 10:04:18 +02:00
bsongis 3adc4c20a6 Automatic google tests fix 2014-09-24 09:24:02 +02:00
Bertrand Songis 227a886122 Update DONATIONS.txt 2014-09-24 07:24:38 +02:00
Bertrand Songis de625fde01 Update DONATIONS.txt 2014-09-23 08:27:32 +02:00
Bertrand Songis daad477250 Update DONATIONS.txt 2014-09-22 17:40:37 +02:00
Bertrand Songis 334a718a8a Update DONATIONS.txt 2014-09-22 10:33:37 +02:00
Bertrand Songis 5baaec1868 Update DONATIONS.txt 2014-09-20 19:01:31 +02:00
Bertrand Songis c2ad82eb35 Update DONATIONS.txt 2014-09-19 15:19:15 +02:00
Bertrand Songis c61c417f13 Update DONATIONS.txt 2014-09-19 12:58:46 +02:00
bsongis 98f156301a Fixes #1727 2014-09-18 08:35:12 +02:00
Bertrand Songis ef6fe0006e Update DONATIONS.txt 2014-09-17 23:35:57 +02:00
Bertrand Songis 23358c254c Update DONATIONS.txt 2014-09-17 15:53:33 +02:00
bsongis 6114245229 Release notes updated 2014-09-16 17:18:31 +02:00
Andre Bernet e76880cf26 French translations 2014-09-16 17:14:56 +02:00
bsongis f30dfa3365 Inversion of S3 on Taranis+ (S3 should be wired as S2) - Issue #1716 2014-09-16 17:14:47 +02:00
Andre Bernet f4aa92ec20 S2 inverted on T+ (Fix #1716) 2014-09-16 17:03:56 +02:00
Bertrand Songis 2640ca9fea Update DONATIONS.txt 2014-09-16 14:30:22 +02:00
bsongis f6a1420ce3 Version and release notes updated 2014-09-15 18:54:32 +02:00
bsongis 6c0f65411a Overflow on OverrideCHxx functions on ARM boards (range is now
-150:+150)
2014-09-15 18:41:25 +02:00
bsongis a7f1ace55b #1647 - bitmap set/get added to the Lua interpreter 2014-09-15 17:37:20 +02:00
bsongis b8dedd7940 #1647 - getCurve exported to the Lua interpreter 2014-09-15 17:32:45 +02:00
bsongis 2703118c56 Makefile typos from #1644 2014-09-15 12:24:09 +02:00
Bertrand Songis 8bfc7a497a Update DONATIONS.txt 2014-09-15 11:58:52 +02:00
bsongis 87870c24a5 Fixes #1709 2014-09-15 11:50:45 +02:00
bsongis 7610fb43d5 Fixes #1669 2014-09-15 11:28:46 +02:00
bsongis 0263784e65 MEGA2560 simu compilation now ok 2014-09-15 09:56:33 +02:00
Bertrand Songis 6f74624371 Update DONATIONS.txt 2014-09-14 22:45:37 +02:00
Bertrand Songis 1c721b3817 Update DONATIONS.txt 2014-09-14 17:51:22 +02:00
bsongis 67d97046bb Fixes #1656 - Throttle Source everywhere (english and french) 2014-09-14 14:56:12 +02:00
bsongis 19d9e6ab19 No THR warning when a new model is created / the wizard is called 2014-09-14 14:46:59 +02:00
bsongis 5d9883d47f Added NANO option in Makefile (default: NANO=NO) 2014-09-14 14:46:59 +02:00
bsongis bb5f1d7d79 Fixes #1715 2014-09-14 14:46:59 +02:00
bsongis 30087b4a3a This luaFree is not needed and could do a mess in RAM 2014-09-14 14:46:59 +02:00
Bertrand Songis 61aa01b9b3 Update DONATIONS.txt 2014-09-14 14:44:29 +02:00
mhotar 16e06cff70 CZ translations - Companion 2014-09-14 02:19:42 +02:00
mhotar 2073a1f033 CZ translations - Radio 2014-09-14 01:17:52 +02:00
bsongis 563b817b46 Fixes #1656 2014-09-13 18:15:28 +02:00
bsongis 8b540a66f6 Companion compilation failure (missing files) 2014-09-13 15:50:24 +02:00
bsongis b0b7657756 Version and release notes updated 2014-09-13 15:45:08 +02:00
bsongis 74d22b623f LTR patch (modified) applied. Saves around 8-10k RAM during the
interpreter initialization
2014-09-13 15:41:52 +02:00
bsongis bee01d9999 Tests added to avoid doing anything in the Lua interpreter after a Lua
Panic
2014-09-13 13:11:05 +02:00
Bertrand Songis d2055edf62 Merge pull request #1712 from opentx/mhotar/CZ_chars_in_Inputs
No special characters in edit fields for CZ language, but enabled in int...
2014-09-13 09:11:13 +02:00
mhotar c926ac557b No special characters in edit fields for CZ language, but enabled in internally defined strings.
It fixes autogenerated Input names.
2014-09-13 01:26:49 +02:00
bsongis 3e2092e32f Revert some last changes so that there is no problem with Lua 2014-09-13 01:03:24 +02:00
bsongis 21054ffc54 Fixes #1675 2014-09-12 12:36:48 +02:00
Bertrand Songis 350ece0b60 Update DONATIONS.txt 2014-09-12 10:24:34 +02:00
bsongis 01a103f2e6 Mega2560 target didn't compile 2014-09-12 07:47:06 +02:00
Bertrand Songis 2e8e439d27 Update DONATIONS.txt 2014-09-11 15:47:25 +02:00
Bertrand Songis 98e6a3dc21 Update DONATIONS.txt 2014-09-11 13:25:47 +02:00
Andre Bernet 3b324d076a Release notes updated 2014-09-10 20:41:00 +02:00
Andre Bernet 91c922d5fb Wording / French translations 2014-09-10 20:27:43 +02:00
Andre Bernet eac918c2da SG switch warning was unreachable on Taranis 2014-09-10 20:13:26 +02:00
Andre Bernet b5f9c0ec84 On Taranis S3 was only hidden when the cursor was in the pot positions line 2014-09-10 20:05:50 +02:00
bsongis d1f54b099b Compilation failure 2014-09-10 20:04:41 +02:00
bsongis 7b98ad55c0 #1692 - We flush the queue instead of stopping the audio (the TADA sound
is cut otherwise)
2014-09-10 19:56:46 +02:00
bsongis d2cb7cb3dd Fixes #1697 2014-09-10 19:28:55 +02:00
bsongis be190b8bb1 Support for Lua dump files removed 2014-09-10 16:19:34 +02:00
bsongis 4b2c02b2c5 The Lua Wizard was broken in 2.0.11 2014-09-10 15:35:06 +02:00
bsongis 142d3fee1a Small alignment problem in protocols on 9X/9XR 2014-09-10 12:12:16 +02:00
bsongis 6a5e938ead Fixes #1692 2014-09-10 12:11:53 +02:00
bsongis 2d9ae108ff Fixes #1566 2014-09-10 12:07:14 +02:00
bsongis bae84e4e8c Navigation bug in protocol selection (9X/9XR only) 2014-09-10 11:51:39 +02:00
bsongis f4944eefdb Fixes the neutral value for PXX as described in #1694 2014-09-10 11:51:00 +02:00
bsongis 5d598cc6a1 Version and release notes updated 2014-09-10 11:32:36 +02:00
bsongis 945808d69b Fixes #1695 2014-09-10 11:32:36 +02:00
Bertrand Songis dbe512e45a Update DONATIONS.txt 2014-09-10 10:58:32 +02:00
bsongis 11efb5121e Fixes #1690 2014-09-10 08:16:57 +02:00
Bertrand Songis f6274f38aa Update DONATIONS.txt 2014-09-09 21:58:17 +02:00
Bertrand Songis cd1f20b8a0 Update DONATIONS.txt 2014-09-09 10:41:57 +02:00
Bertrand Songis e61b931ddb Update DONATIONS.txt 2014-09-09 07:13:13 +02:00
Andre Bernet a7a9b61234 Typo in release notes 2014-09-08 23:01:04 +02:00
bsongis 5ee95673d1 Release notes updated 2014-09-08 22:25:10 +02:00
bsongis 98c5b5e7bd Little display bug in DEBUG page 2014-09-08 22:25:10 +02:00
Bertrand Songis 6d434c0bf9 Update DONATIONS.txt 2014-09-07 21:52:42 +02:00
Bertrand Songis ade7151796 Update DONATIONS.txt 2014-09-07 20:35:50 +02:00
Bertrand Songis a7cd1f9aa0 Update DONATIONS.txt 2014-09-07 11:24:59 +02:00
bsongis cb2c922542 DONATIONS.txt updated 2014-09-05 17:58:40 +02:00
bsongis 8159a559da Release notes updated 2014-09-05 17:20:24 +02:00
bsongis ed826d8c62 [Sky9x] Linker error (no newlib-nano needed, no _sbrk) 2014-09-05 17:17:43 +02:00
bsongis b57f5ab2ce Added DEBUG information (thanks again projectkk2glider!) 2014-09-05 17:03:01 +02:00
bsongis 8fbafa6f05 Fixes #1643 - Thanks to projectkk2glider for his help on this one 2014-09-05 16:23:55 +02:00
Damjan Adamic 9243a59426 Removed lua_fields.txt 2014-09-03 23:33:59 +02:00
Damjan Adamic ccf66831c7 Fixes #1666: fixed bootloader 2014-09-03 23:32:03 +02:00
Damjan Adamic 06792b5696 Fixes #1666: Missing constructor calls for static objects 2014-09-03 23:03:25 +02:00
bsongis 6d4d871849 Various Lua fixes (thanks projectkk2glider!) 2014-09-02 20:53:19 +02:00
bsongis 5a634a7991 Fixes #1656 2014-09-01 09:43:02 +02:00
bsongis 69e504212e Copy/Paste error on second serial port Rx 2014-08-31 22:45:36 +02:00
bsongis 03e049c360 Fixes #1658 2014-08-29 23:05:24 +02:00
bsongis 4ca893da1f Fixes #1655 2014-08-29 15:54:28 +02:00
bsongis 66670cf713 Fixes #1646 2014-08-29 11:53:20 +02:00
bsongis 271bb4a82e Version and release notes updated 2014-08-29 11:46:20 +02:00
bsongis e0eab648ef Fixes #1651 2014-08-28 21:54:33 +02:00
bsongis 3235f43db9 Companion part for #1646
Conflicts:
	companion/src/modeledit/logicalswitches.cpp
2014-08-28 16:42:31 +02:00
bsongis c12b0cfebe Fixes #1650 2014-08-28 15:26:08 +02:00
bsongis 3e590d44f0 Fixes #1646 2014-08-28 15:16:20 +02:00
bsongis 1f6d1799af Fixes #1643 - no more freeze but now I have to understand why we go over
4k there
2014-08-27 23:44:07 +02:00
bsongis 8c813a87c9 Fixes #1635 2014-08-27 23:14:59 +02:00
bsongis 5bdeedbd0e [9X] Display problem of the battery range 2014-08-27 20:44:38 +02:00
bsongis e33f4cf415 Compilation error 2014-08-27 20:44:22 +02:00
bsongis 61d745011a [9XR-PRO] Telemetry fix 2014-08-27 20:44:11 +02:00
bsongis 3e269a04ae lua_fields.txt removed from git as it is automatically generated 2014-08-27 12:25:43 +02:00
bsongis 341feaf78f Fixes #1621 2014-08-27 10:21:55 +02:00
bsongis 19ddf6fc23 [Companion] Servos limits are displayed in us if ppmus option selected 2014-08-26 16:55:58 +02:00
bsongis 9b4b0d3c83 Fixes #1596 2014-08-26 09:01:19 +02:00
bsongis dc1eebf40d RSSI initialization added in google tests 2014-08-25 11:51:15 +02:00
bsongis 752e13b9ab Fixes #1617 2014-08-25 11:39:34 +02:00
bsongis b988bec5bd Fixes #1636 2014-08-25 11:27:46 +02:00
Damjan Adamic 3c72afed20 Fixes #1622: Lua function script not called for SF >= 8 2014-08-25 11:11:06 +02:00
Damjan Adamic e7586f47c3 Re #1547: commit 5949be30fa disabled delay for STICKY (which was wrong) now disabled for EDGE 2014-08-25 10:45:40 +02:00
Bertrand Songis f126b149f0 Merge pull request #1642 from opentx/1641_rx_number_with_DSM
Receiver number wasn't showing up for DSM (Fix #1641)
2014-08-24 23:45:50 +02:00
Andre Bernet 6b15c0c985 Receiver number wasn't showing up for DSM (Fix #1641) 2014-08-24 10:29:36 +02:00
Damjan Adamic db85f39ebc Added generation of Lua fields documentation file: lua_fields.txt 2014-08-21 10:07:39 +02:00
bsongis dee1e4ce8d Fixes #1612 2014-08-16 11:17:45 +02:00
bsongis df96504a85 SWR hidden on Taranis+ 2014-08-15 17:20:35 +02:00
Kjell Kernen 0112a1e3e9 Changed description of the master branch. The text from the next branch had ended up here. 2014-08-14 10:44:04 +02:00
bsongis 36481471a3 Fixes #1595 2014-08-13 11:37:03 +02:00
Bertrand Songis dd08886f2c Update DONATIONS.txt 2014-08-10 19:20:33 +02:00
Bertrand Songis 76ef4b5948 Update DONATIONS.txt 2014-08-10 19:19:41 +02:00
Bertrand Songis eaa247f46d Update DONATIONS.txt 2014-08-08 22:44:53 +02:00
bsongis 3ada9f7cf5 Companion PrintDialog bugfixes 2014-08-08 18:08:42 +02:00
bsongis 10a5e4dc89 Fixes #1527 2014-08-08 17:05:12 +02:00
bsongis 50e4850745 Fixes #1580 2014-08-08 16:29:13 +02:00
bsongis a92de216ac Fixes #1585 2014-08-08 11:48:03 +02:00
bsongis 3f3708f0f1 Fixes #1546
// TODO check if the vario / background music are stopped correctly if
switching to a model which doesn't have these functions enabled
2014-08-08 11:19:04 +02:00
Bertrand Songis 72c433ce9d Update DONATIONS.txt 2014-08-06 20:58:31 +02:00
Damjan Adamic f123b69521 Fixes #1548: bad Swedish Cell translation 2014-08-05 20:35:16 +02:00
Bertrand Songis 80369f0e8f Update DONATIONS.txt 2014-08-05 10:56:27 +02:00
Kjell Kernen 8cd67bf31e Swedish OpenTX translation updated 2014-08-05 10:38:24 +02:00
Kjell Kernen 34ef060e16 Swedish Companion translation updated 2014-08-05 10:24:09 +02:00
Bertrand Songis 1f07f88dce Update DONATIONS.txt 2014-08-04 14:32:05 +02:00
Bertrand Songis 4db5bdd486 Update DONATIONS.txt 2014-08-04 12:03:46 +02:00
bsongis 05ac0682f0 Fixes #1583 2014-08-04 12:02:50 +02:00
bsongis f12c3072b5 Fixes #1579 2014-08-04 11:54:35 +02:00
bsongis 35aea83c89 Fixes #1582 2014-08-04 11:38:39 +02:00
bsongis cf9b5d05a8 Fixes #1568 2014-08-04 11:29:35 +02:00
bsongis d5393be5cb Fixes #1584 2014-08-04 11:20:07 +02:00
Bertrand Songis 10c9936fa0 Merge pull request #1586 from opentx/projectkk2glider/issue_1567
Projectkk2glider/issue 1567
2014-08-04 11:08:00 +02:00
Bertrand Songis 7a74d3ac85 Update DONATIONS.txt 2014-08-04 10:57:23 +02:00
bsongis 39edaff669 Problems with S3 on Taranis (not plus) 2014-08-04 10:19:31 +02:00
bsongis c5aed5f79b Companion MAC compilation fix 2014-08-04 10:01:32 +02:00
bsongis 9b07a77e14 #1566 Companion conversion issue when importing Logical Switches with a
stick as v1 or v2 in previous EEPROM
2014-08-04 10:01:32 +02:00
Bertrand Songis 380fe5e44d Update DONATIONS.txt 2014-08-04 09:58:11 +02:00
Damjan Adamic 8bd2c120d6 Re #1567: cleanup 2014-08-03 19:27:02 +02:00
Damjan Adamic 741ef45f3e Re #1567:
introduced generateProcessUniqueTempFileName() which is used everywhere we need temporary file
renamed unlink() into qunlink()
fixed missing deletion of curve pngs in print dialog
2014-08-03 19:21:46 +02:00
Damjan Adamic 4103adf75d Re #1567: introduced unlink() function that takes QString parameter 2014-08-03 18:03:13 +02:00
Damjan Adamic c0e612531d Re #1567: writeBackup(): added PID to temporary file name 2014-08-03 17:38:24 +02:00
Damjan Adamic 55cb5dce87 Re #1567: readEeprom():
* added PID to temporary file name
 * better error message
 * temporary file deletion
2014-08-03 17:38:24 +02:00
Bertrand Songis 12ba27247e Update DONATIONS.txt 2014-08-02 09:41:10 +02:00
Bertrand Songis 1e33e99655 Update DONATIONS.txt 2014-08-01 07:43:31 +02:00
Damjan Adamic 50acd1fd92 Expanded non regression tests for #1569 2014-07-31 20:23:11 +02:00
bsongis c3626225aa Non regression tests for #1569 2014-07-31 17:24:10 +02:00
Bertrand Songis b71a96ed55 Update DONATIONS.txt 2014-07-31 16:43:23 +02:00
Bertrand Songis d2fcd544d8 Merge pull request #1576 from opentx/projectkk2glider/dirty_hack_issue_1569
Projectkk2glider/dirty hack issue 1569
2014-07-31 16:06:55 +02:00
Damjan Adamic 50997721e2 Using anas instead for getValue 2014-07-31 15:57:50 +02:00
Damjan Adamic 828372ab29 Fix for the case of extended trims
Code cleanup
2014-07-31 15:47:32 +02:00
Damjan Adamic 21ae270c0e Fixes #1569 2014-07-31 15:08:37 +02:00
bsongis 1b2efd1121 Fixes #1572 2014-07-31 11:26:05 +02:00
bsongis 8d6a7c9495 Simu name fixed 2014-07-31 11:22:41 +02:00
bsongis 189becfbb2 Fixes #1569 2014-07-31 11:22:18 +02:00
Bertrand Songis 5a19e147fd Update DONATIONS.txt 2014-07-30 07:45:00 +02:00
Bertrand Songis 062f93ae38 Update DONATIONS.txt 2014-07-28 23:41:37 +02:00
bsongis 9861a08150 Fixes #1562 2014-07-28 21:02:42 +02:00
Bertrand Songis de15d0a5a4 Update DONATIONS.txt 2014-07-28 18:54:56 +02:00
Andre Bernet 1e77bb3c02 French translations 2014-07-27 18:40:16 +02:00
bsongis adadbe06ad Fixes #1559 2014-07-27 17:37:39 +02:00
Andre Bernet 92f2c48de9 French translation fix 2014-07-27 17:31:06 +02:00
Bertrand Songis 1d4fa2a8b0 Update DONATIONS.txt 2014-07-26 22:27:25 +02:00
Bertrand Songis 5493776b9c Update DONATIONS.txt 2014-07-26 19:48:32 +02:00
bsongis b166b77c3e New french TTS prompts 2014-07-26 19:47:40 +02:00
Bertrand Songis 0ecb978364 Update DONATIONS.txt 2014-07-26 19:14:46 +02:00
Bertrand Songis c8d792d3d8 Merge pull request #1556 from opentx/driver33/PL_TR
TR fixes
2014-07-26 12:24:22 +02:00
Jacek Drewniak e9663e40e2 TR fixes 2014-07-26 11:51:23 +02:00
bsongis a7e906dea9 All other Off are uppercase! 2014-07-25 23:30:19 +02:00
Bertrand Songis 685ab3d101 Update DONATIONS.txt 2014-07-25 22:25:49 +02:00
Bertrand Songis 77564d74a4 Merge pull request #1554 from opentx/MicheleVilla/IT_translation_FW
Update it.h.txt
2014-07-25 19:38:14 +02:00
Bertrand Songis a0142d65be Update DONATIONS.txt 2014-07-25 19:29:08 +02:00
bsongis 662bf15562 Fixes #1555 2014-07-25 19:28:08 +02:00
Bertrand Songis 79b928af56 Update DONATIONS.txt 2014-07-25 17:10:32 +02:00
Bertrand Songis 8c28f4bc48 Update DONATIONS.txt 2014-07-25 15:06:16 +02:00
bsongis 7a4d6c89a1 2.0.9 preparation 2014-07-25 12:05:34 +02:00
bsongis 38347becca Cosmetics 2014-07-25 12:05:34 +02:00
Michele 49036dbb40 Update it.h.txt
One change in Italian translation
2014-07-25 11:58:05 +02:00
Bertrand Songis abf36de157 Update DONATIONS.txt 2014-07-25 08:41:56 +02:00
bsongis 32afbf5a5a Fixes #1552 2014-07-25 08:39:41 +02:00
bsongis cba4a02cc1 Fixes #1551 2014-07-25 07:31:58 +02:00
bsongis 4062555605 FAI option tooltip updated (too many users select it without knowing
what it means)
2014-07-24 21:02:15 +02:00
bsongis 9cb38ce839 Companion default firmware is now OpenTX for Taranis 2014-07-24 20:51:31 +02:00
Bertrand Songis 905090ef09 Update DONATIONS.txt 2014-07-24 14:44:59 +02:00
Bertrand Songis 62e5820082 Update DONATIONS.txt 2014-07-24 12:07:18 +02:00
bsongis 2d21e16201 In Companion Wizard, Delta Wing has now 50% weight on elevons (as in
OpenTX Wizard)
2014-07-23 19:19:10 +02:00
bsongis 07303f4301 Taranis calibration better fix 2014-07-23 18:23:24 +02:00
bsongis 91228f803c snprintf undefined on VC++ 2014-07-23 18:02:46 +02:00
bsongis e5d7e1f7c2 Taranis calibration bug 2014-07-23 17:55:02 +02:00
bsongis 81573537eb Fixes #1549 2014-07-23 17:09:55 +02:00
bsongis 7a85328b86 #1549 (Firmware part) 2014-07-23 17:05:14 +02:00
bsongis fd84c62ff4 Dead code removed 2014-07-23 16:31:20 +02:00
bsongis 13e0b21656 The firmware should compile correctly on Windows now 2014-07-23 15:55:27 +02:00
bsongis 5949be30fa Fixes #1547 2014-07-23 15:46:51 +02:00
bsongis 0117c2da68 Fixes #1259 2014-07-23 15:15:26 +02:00
bsongis 943f70c599 OpenTX 2.0.8 preparation 2014-07-22 17:27:33 +02:00
Bertrand Songis 52a48fc4b1 Update DONATIONS.txt 2014-07-22 17:04:17 +02:00
Damjan Adamic 2712ffabb0 Re #1486: gtest improvements in Lua section 2014-07-22 11:39:36 +02:00
Bertrand Songis fa8c8a7094 Update DONATIONS.txt 2014-07-22 07:44:49 +02:00
bsongis 5907193571 Fixes #1543 2014-07-21 23:21:35 +02:00
bsongis 45abfb872f Fixes #1486 2014-07-21 22:25:55 +02:00
bsongis 4d5962b15b Fixes #1533 2014-07-21 20:41:57 +02:00
bsongis eea1c3a84c SAFETY renamed to OVERRIDE 2014-07-21 20:38:44 +02:00
bsongis deed7fc20f Curve index is correctly resetted when its type is changed 2014-07-21 20:23:56 +02:00
bsongis 62fca3f8b6 Fixes #1534 2014-07-21 20:09:39 +02:00
bsongis 9377e58407 Change Lua field name from vario-speed to vertical-speed 2014-07-21 19:22:40 +02:00
bsongis 9b53f69038 Fixes #1535 2014-07-21 19:15:24 +02:00
Bertrand Songis 3680149b52 Merge pull request #1529 from opentx/projectkk2glider/lua_constants_issue_1480
Projectkk2glider/lua constants issue 1480
2014-07-21 19:12:06 +02:00
Bertrand Songis 93faeeafbe Update DONATIONS.txt 2014-07-21 18:34:39 +02:00
Damjan Adamic 2d5d1cb357 Re #1480: couple corrections of field names 2014-07-21 12:04:08 +02:00
Damjan Adamic 2a5364dc8c Re #1480: wrong field.id for multiple fields 2014-07-21 11:51:30 +02:00
bsongis 7f47a4fe10 Fixes #1542 2014-07-20 18:51:24 +02:00
Bertrand Songis a0cc428228 Update DONATIONS.txt 2014-07-19 13:15:16 +02:00
Andre Bernet 61985f7d6a All companion translation files updated 2014-07-19 12:26:49 +02:00
Andre Bernet 3baf64f123 French translations 2014-07-19 12:26:10 +02:00
Andre Bernet 4fd40c154e Rename of "SafetyCH" to "OverrideCH" was not done in companion - UPDATE SERVER SCRIPT! 2014-07-19 12:22:32 +02:00
Andre Bernet 3c360618b9 nosafetych option was duplicated for 9x 2014-07-19 12:19:07 +02:00
Andre Bernet 1d96731ad5 Typo 2014-07-19 12:09:34 +02:00
Andre Bernet 9d1d31d26a lupdate-qt4 is just lupdate on Win 2014-07-19 12:09:04 +02:00
Bertrand Songis 0b52ccfaf1 Update DONATIONS.txt 2014-07-19 07:41:55 +02:00
bsongis 484566083e A little refactoring to avoid all the sprintf and too many string
comparaisons. Completely untested
2014-07-18 22:13:02 +02:00
Bertrand Songis 0f33dc6113 Update DONATIONS.txt 2014-07-18 18:49:59 +02:00
Damjan Adamic 7f3778fc3c Re #1480: units updated 2014-07-18 10:41:16 +02:00
Damjan Adamic 0a9dcc5ce6 Re #1480: added TELEM_MAX_ASPEED conversion in luaGetValueAndPush() 2014-07-18 10:41:16 +02:00
Damjan Adamic 2f01f139cc Re #1480: Cosmetics 2014-07-18 09:07:36 +02:00
Damjan Adamic fb3e615008 Fixes #1480: How to handle the increasing number of Lua constants 2014-07-18 08:59:38 +02:00
Bertrand Songis ce6d0807fa Update DONATIONS.txt 2014-07-17 23:14:29 +02:00
Bertrand Songis cab8f3db71 Update DONATIONS.txt 2014-07-17 08:53:18 +02:00
bsongis 399a8b2e35 Fixes #1517 2014-07-16 20:27:05 +02:00
bsongis 3d4a791940 Timers display bug on main view 2014-07-16 19:27:08 +02:00
bsongis 7373ce2cae Better fix for model backups import 2014-07-16 19:07:09 +02:00
Bertrand Songis 5da1e35efe Update DONATIONS.txt 2014-07-16 14:54:42 +02:00
bsongis fe5b7bee8c Fixes #1516 2014-07-16 14:53:36 +02:00
bsongis 2da1134796 Quick & dirty fix to allow open of backup models from Taranis 2014-07-16 14:52:46 +02:00
Damjan Adamic 83e47d9e35 Typo in german translation for "Änderungen" 2014-07-16 10:37:20 +02:00
Damjan Adamic f0c76efaf7 Re #1506 - FAS offest was limited to +-1.5A in Companion, now +-12A (same as radio) 2014-07-16 09:30:44 +02:00
Bertrand Songis 2fe7d856c3 Update DONATIONS.txt 2014-07-16 08:16:13 +02:00
bsongis a7c1f22b36 Missing reference screenshot for 128x64 Smlsize test 2014-07-15 23:47:20 +02:00
bsongis d92620919b SMLSIZE last row missing 2014-07-15 23:14:02 +02:00
Bertrand Songis 94bb21886b Update DONATIONS.txt 2014-07-15 23:13:17 +02:00
bsongis 5db98a3fef SMLSIZE last row missing 2014-07-15 23:03:48 +02:00
Bertrand Songis 763c7fbb7d Update DONATIONS.txt 2014-07-15 22:11:05 +02:00
bsongis b2d1a4ed22 Fixes #1506 - There was an EEPROM shift in vario settings ... 2014-07-15 16:04:26 +02:00
bsongis e7211065ab Function duplicated 2014-07-15 16:04:26 +02:00
bsongis 68b8b0e38f make clean didn't remove lbm files on Windows (because find doesn't work
correctly)
2014-07-15 16:04:26 +02:00
bsongis 644c833311 Inverted DBLSIZE was one row too big on Taranis 2014-07-15 16:04:26 +02:00
bsongis 30b1f62e99 Fonts improvement on 9XR-PRO / Sky9x 2014-07-15 16:04:26 +02:00
Bertrand Songis 03aa787c8e Update DONATIONS.txt 2014-07-15 14:01:51 +02:00
bsongis 79592d3b00 Fixes #1506 2014-07-15 13:27:05 +02:00
Bertrand Songis 7ed527a328 Update DONATIONS.txt 2014-07-15 13:15:09 +02:00
bsongis 3e0766f2bf Missing sticks reset in google tests (stick position reused in next
tests)
2014-07-15 09:19:22 +02:00
bsongis 71e7926045 Release notes updated #1508 2014-07-15 08:51:18 +02:00
bsongis 8c3d47deac Instant Trim automatic tests - Issue #1508 2014-07-15 08:49:55 +02:00
bsongis 197f31d5a1 Fixes #1508 - Needs another non regression test 2014-07-14 23:41:37 +02:00
Bertrand Songis 1a198c35ad Update DONATIONS.txt 2014-07-14 22:31:15 +02:00
Bertrand Songis 2934fc4d23 Merge pull request #1513 from opentx/projectkk2glider/issue_1510
Re #1510 - This might be a better warning message
2014-07-14 21:26:09 +02:00
Damjan Adamic 4ae9585080 Re #1510 - Added switches warning, better protocol warnings and limited display to max 10 warnings 2014-07-14 20:11:21 +02:00
Damjan Adamic 161016a02a Bad string "Write Backup from file to to Radio" fixed 2014-07-14 19:16:53 +02:00
Damjan Adamic 559bb83864 Re #1510 - This might be a better warning message 2014-07-14 19:13:39 +02:00
bsongis 9a37c3027e Release notes updated 2014-07-14 18:32:17 +02:00
bsongis 6548afcad3 Fixes #1510 - The warning is not very explicit, but at least it is there
...
2014-07-14 18:26:36 +02:00
bsongis ee31c51275 9XR-PRO / Sky9x compilation failure when BOLD=NO 2014-07-14 17:50:01 +02:00
bsongis 63aadad10c Preparation for 2.0.7 2014-07-14 08:11:02 +02:00
bsongis 30958a9a65 I forgot to include this in Companion. Should be ok in the Tx though 2014-07-14 01:42:42 +02:00
bsongis 995183bf22 Compilation error when no gauges 2014-07-14 01:06:54 +02:00
Bertrand Songis 99fedb081e Update DONATIONS.txt 2014-07-13 20:24:07 +02:00
Damjan Adamic cc934c3ac0 Gtest updated according to 28c900e3f7 hack 2014-07-13 15:44:00 +02:00
Damjan Adamic c1d789d004 Fixes #1494 2014-07-13 15:41:18 +02:00
Andre Bernet 4d945b5d95 DSM2=SERIAL was broken if EXT!=FRSKY (fix #1498) 2014-07-13 15:26:14 +02:00
Andre Bernet 28c900e3f7 Dirty hack to filter out bogus cell values from FLVSS... 2014-07-13 14:48:12 +02:00
Damjan Adamic b41ba50b53 Removed raw member that was introduced in commit 3f39352d95. Its role now plays last member of values[] array. Same RAM usage, reduced FLASH usage. 2014-07-13 14:44:42 +02:00
Damjan Adamic 2d22c18758 Added RAW_FRSKY_MINMAX() macro for access to the raw telemetry value and gtests for it 2014-07-13 14:35:15 +02:00
Damjan Adamic 8ce05b3284 Data from tow FLVSS sensors and parsing program for sport.log 2014-07-13 12:18:40 +02:00
bsongis 6d18820b53 Added a new test with real logs from FLVSS. It seems there is a bug on
the FLVSS :(
2014-07-11 23:53:36 +02:00
Bertrand Songis 58ed329ac2 Update DONATIONS.txt 2014-07-11 14:23:12 +02:00
bsongis 2e0858bc0c Whole Cells telemetry info not updated after Telemetry Reset 2014-07-11 12:22:54 +02:00
bsongis 7c9636c58c I try this for #1444, if needed we will revert 2014-07-11 11:40:42 +02:00
Bertrand Songis 9dbd1326da Update DONATIONS.txt 2014-07-11 10:29:24 +02:00
Damjan Adamic 4c82d12c1a Re #1481 - added gtests for SPort FAS sensor 2014-07-10 11:32:04 +02:00
Bertrand Songis 972685bc15 Merge pull request #1477 from opentx/projectkk2glider/cells_gtests
Tests and support for second FLVSS
2014-07-10 09:56:11 +02:00
bsongis 00f8b97ee4 Fixes #1478 2014-07-10 09:32:10 +02:00
bsongis 0b7bbbbdbd Fixes #1475 2014-07-10 09:04:33 +02:00
bsongis 47bc3e896c Fixes #1481 2014-07-10 08:08:33 +02:00
bsongis 904249b2dc Fixes #1478 2014-07-10 08:06:48 +02:00
Damjan Adamic 3700047d2c Re #1409 and #1444:
* added support for two FLVSS
* added gtests for FLVSS
2014-07-09 14:18:39 +02:00
Romolo Manfredini d44e851648 Fix problems with libpng 2014-07-09 13:04:51 +02:00
bsongis 1be75735be Fixes #1476 2014-07-09 09:53:04 +02:00
Bertrand Songis 7da72240a3 Update DONATIONS.txt 2014-07-09 00:17:18 +02:00
bsongis 9357c951f1 Fixes #1474 - I am not happy with this fix, but I don't want to modify
the font right now
2014-07-08 22:05:56 +02:00
Bertrand Songis 1afeb9f977 Merge pull request #1473 from opentx/MicheleVilla/FW_Translation
Update it.h.txt
2014-07-08 19:19:35 +02:00
Michele 000e55725c Update it.h.txt 2014-07-08 18:39:53 +02:00
bsongis 38e342b27b Cosmetics in the voltages screen. Cells, Cells-, Cell, Cell- tested, it
works.
2014-07-08 13:16:37 +02:00
bsongis 3e9064e2e2 2.0.6 preparation 2014-07-08 12:03:48 +02:00
bsongis 2d764e73fd Cosmetics 2014-07-08 11:39:27 +02:00
bsongis f8efcf420a 200 extra bytes used on 9x with FRSKY_HUB option. I return to previous
implementation. Only ARM boards will have the extra features.
2014-07-08 11:38:47 +02:00
bsongis cf546a2341 Refactoring FLVSS - only one sensor for now 2014-07-08 11:02:00 +02:00
Bertrand Songis 87a4f3526b Merge pull request #1465 from opentx/projectkk2glider/reimplementation_of_1443
Projectkk2glider/reimplementation of 1443
2014-07-08 08:26:32 +02:00
bsongis 6b49119af7 getValue(...) Lua identifiers more consistent 2014-07-08 08:04:05 +02:00
bsongis 4c6314331d The compilation server complains with pl language ... 2014-07-07 23:10:26 +02:00
Bertrand Songis 55ab067a0c Merge pull request #1468 from opentx/projectkk2glider/issue_1457
Projectkk2glider/issue 1457
2014-07-07 22:58:42 +02:00
bsongis 3fc18b1cf7 Fixes #1467 - Check your mixes on Sky9x / 9XR-PRO especially if you used
mix warnings!
2014-07-07 22:55:52 +02:00
bsongis f2f8419da1 I forgot to remove the persistent toggled handler 2014-07-07 21:45:51 +02:00
Damjan Adamic 365c2f9e34 Re #1457 - cleanup 2014-07-07 21:38:55 +02:00
bsongis 01fde3db27 Some TODOs removed 2014-07-07 20:56:40 +02:00
Damjan Adamic d743ed9645 Forgoten makefile for split gtests 2014-07-07 19:54:55 +02:00
Damjan Adamic dd67811638 Cosmetics 2014-07-07 19:49:18 +02:00
Damjan Adamic ebe4f6a365 Gtests split into several source files 2014-07-07 19:23:43 +02:00
Damjan Adamic b4e816b784 Re #1443 - Reverting back d675ab1578 with some improvements:
* when telemetry is not streaming all logical switches that involve telemetry value evaluate to FALSE (same as before the change in above commit)
* the duration and delay processing is now enabled for such logical switches (new functionality that was not present before above commit)
2014-07-07 19:18:18 +02:00
bsongis 2798fa7ba9 Fixes #1451 2014-07-07 18:03:48 +02:00
Damjan Adamic ee077a06e6 Re #1464 - added test: "L1 Vfas < 9.6 Delay (0.5s)" 2014-07-07 15:48:46 +02:00
Romolo Manfredini 8f73e9bde0 Fix warnings with libpng 2014-07-07 12:57:33 +02:00
Romolo Manfredini 45d8fca125 Merge origin/next into next 2014-07-07 12:38:13 +02:00
Romolo Manfredini 2bc6c1e754 Fix warnings with libpng 2014-07-07 12:37:10 +02:00
bsongis 39a0feae3b Fixes #1463 2014-07-07 12:19:28 +02:00
bsongis ad7da779c7 Curves in Mixes were not correctly restored on Companion for Sky9x
boards
2014-07-07 07:21:12 +02:00
bsongis 23cafa84f2 Fixes #1392 2014-07-06 23:37:13 +02:00
Damjan Adamic a20e5aee3b Re #1457 - added display of channels 17-32 to Companion simulator 2014-07-06 19:50:42 +02:00
bsongis fa3c50df8e Fixes #1458 2014-07-06 18:58:34 +02:00
bsongis 81eb9326eb Fixes #1461 2014-07-06 18:40:02 +02:00
bsongis 7c71d56383 Fixes #1451 2014-07-06 17:46:16 +02:00
Bertrand Songis 5109a2d7c1 Merge pull request #1460 from opentx/projectkk2glider/issue_1458
Fixes #1458 - Incorrect display of free mem on statistics page
2014-07-06 13:23:08 +02:00
bsongis 82cc799afe Fixes #1458 - 64k was hardcoded 2014-07-06 13:09:33 +02:00
Damjan Adamic 88bb28e3f1 Re #1458 - added gtest for big numbers (>uint16_t) 2014-07-06 09:25:38 +02:00
Damjan Adamic f4fdc233c0 Re #1458 - Forgoten files for new gtest 2014-07-06 09:14:20 +02:00
Damjan Adamic 7130e48089 Re #1458 - the cast is back, but cast to different type depending on platform. Gtest modernized. 2014-07-06 09:11:29 +02:00
Damjan Adamic ed094f89e8 Fixes #1458 - Incorrect display of free mem on statistics page
lcd_outdezNAtt() on ARM was casting values to uint16_t.
2014-07-06 08:49:35 +02:00
bsongis 58f81b193b PPM polarity was inverted in Companion PrintDialog and CompareDialog 2014-07-05 23:17:57 +02:00
Damjan Adamic 50122d4ee1 Bad indentation 2014-07-05 19:43:31 +02:00
bsongis f66388c1d3 LCD asynchronous refresh prepared for Taranis+ 2014-07-05 19:32:00 +02:00
Bertrand Songis 838190ce80 Merge pull request #1455 from opentx/projectkk2glider/issue_1440
Fixes #1440 - Logical switches state not reset after model load
2014-07-05 19:22:42 +02:00
Damjan Adamic 1bc04db9cd gtest only for Taranis (thanks Jenkins) 2014-07-05 19:20:56 +02:00
Damjan Adamic 30a68cf170 Fixes #1440 - Logical switches state not reset after model load:
* logical switches reset not called anymore when user selects "Reset Flight", but only after model load
* logical switches reset now includes a reset of switches state (set to false)
2014-07-05 19:11:16 +02:00
bsongis ec8c207631 Cosmetics 2014-07-05 19:07:32 +02:00
bsongis 9337080307 Hardware SPI used for the Taranis+ LCD. Thanks Mike! 2014-07-05 19:03:11 +02:00
bsongis 8200164797 LCD contrast was set before lcdInit on Taranis 2014-07-05 19:03:11 +02:00
Damjan Adamic 7d85d40f68 Fixes #1452 - Backlight simulation 2014-07-05 17:08:56 +02:00
bsongis 5d23135b0d DBLSIZE restrictions on 9x make the gtests fail 2014-07-05 15:46:26 +02:00
bsongis be6f1587ed Display problems on Sky9x 2014-07-05 15:37:49 +02:00
bsongis c184ddd996 Fixes #1447 - Needs tests 2014-07-05 11:32:22 +02:00
bsongis c903bbcb13 Issue #1428 - SafetyCH changed to OverrideCH on Taranis 2014-07-04 16:53:50 +02:00
Andre Bernet 9b008ded21 Merge pull request #1446 from opentx/bsongis/Taranis+_LCD_refactoring
Bsongis/taranis+ lcd refactoring
2014-07-04 15:33:35 +02:00
bsongis 6f79de6cae Fixes the grayscale inversion on Taranis (not Plus) 2014-07-04 15:20:36 +02:00
bsongis 711b54c98e Fixes #1436 - Be careful, there is a conversion on M128/gruvin9x boards,
L13, L14 and L15 are removed
2014-07-04 12:23:08 +02:00
bsongis 6876718d72 The top bar was a little bit too dark 2014-07-04 11:53:59 +02:00
bsongis 4ffb9f69c6 Taranis LCD functions refactoring 2014-07-04 11:53:29 +02:00
Bertrand Songis b8a6548686 Merge pull request #1442 from opentx/projectkk2glider/total_timer_fixes
Bug fix and refactoring of globalTimer
2014-07-04 11:23:00 +02:00
Damjan Adamic 8c010277c9 Renamed s_timeCumTot to sessionTimer 2014-07-04 11:09:30 +02:00
Bertrand Songis f30e3db1ef Merge pull request #1443 from opentx/projectkk2glider/telemetry_ls_duration_bug
Fixes a bug for case: telemetry values used in logical switches and they...
2014-07-04 10:19:15 +02:00
Damjan Adamic d675ab1578 Fixes a bug for case: telemetry values used in logical switches and they have a duration and/or delay set. 2014-07-03 20:50:31 +02:00
Damjan Adamic b6cbde48be Removed sessionTimer and replaced with existing s_timeCumTot.
Corrected bug when saving g_eeGeneral.globalTimer (missing reset of session timer and eeprom dirty)
2014-07-03 19:14:15 +02:00
Bertrand Songis 1fef79ce80 Update DONATIONS.txt 2014-07-03 14:07:56 +02:00
Bertrand Songis 4f03ae75c5 Merge pull request #1438 from opentx/driver13/PL_TR
translation fixes
2014-07-03 09:47:11 +02:00
Jacek Drewniak 34850fb73d translation fixes 2014-07-03 09:06:41 +02:00
Bertrand Songis ee05f7f80e Update DONATIONS.txt 2014-07-02 23:58:49 +02:00
bsongis 83614359aa Fixes #1434 2014-07-02 23:26:55 +02:00
bsongis 17a2865070 Fixes #1424 2014-07-02 21:50:25 +02:00
bsongis e3866fda45 Fixes #1395 2014-07-02 21:38:05 +02:00
bsongis 81ed325830 Fixes #1422 2014-07-02 17:49:15 +02:00
Bertrand Songis 36e78b9315 Merge pull request #1429 from opentx/projectkk2glider/frsky_refactoring
Projectkk2glider/frsky refactoring
2014-07-02 16:36:54 +02:00
bsongis 6716482ae4 Fixes #1428 2014-07-02 16:34:26 +02:00
Damjan Adamic 7e758ce7ad Wrong type corrected and cosmetic fixes 2014-07-02 16:08:31 +02:00
bsongis 63fe996ebc Fixes #1427 - M badly displayed when SMLSIZE font used 2014-07-02 15:28:34 +02:00
Damjan Adamic 038365e639 Introduced frskyCellVoltage_t type and united code with frskyUpdateCells() 2014-07-02 12:57:36 +02:00
bsongis c3aebfa239 Fixes #1425 2014-07-02 12:25:28 +02:00
Damjan Adamic e6370ebb2a United setting of cell voltage in frskySetCellVoltage() 2014-07-02 12:24:19 +02:00
bsongis 1e25e368d2 #1397 fix continued 2014-07-02 11:17:33 +02:00
Damjan Adamic 645350a1a2 Fixes #1397 - Refactored telemetry view page navigation, long PAGE key press now cycles in oposite direction 2014-07-02 11:17:33 +02:00
Bertrand Songis dd927e6761 Merge pull request #1423 from opentx/projectkk2glider/missing_minCell
Projectkk2glider/missing min cell
2014-07-02 09:50:57 +02:00
Damjan Adamic 713b2e2cf5 Added missing frskyData.hub.minCell update if using SPORT FLVS sensor 2014-07-02 09:41:25 +02:00
Damjan Adamic 7a02e57dcf Cells initialization in simulator 2014-07-02 09:40:30 +02:00
Bertrand Songis 724949b8fc Merge pull request #1417 from opentx/MicheleVilla/IT_TranslationFW
Update it.h.txt
2014-07-02 09:27:03 +02:00
bsongis 1f5295db9c Compilation problem (thanks Jenkins) 2014-07-01 23:08:54 +02:00
bsongis 72ef865c10 Prevents lines from wrapping when writing text 2014-07-01 22:53:28 +02:00
bsongis be0ebe833c Sleep a little bit more between read eeprom / flash / write eeprom on 9x
/ 9xr
2014-07-01 22:53:28 +02:00
bsongis 57b08fb064 Fixes #1362 2014-07-01 22:53:28 +02:00
bsongis 7162ab5399 Warning raised by Valgrind 2014-07-01 22:53:27 +02:00
Michele 4eb44837f3 Update it.h.txt
One change in Italian translation
2014-07-01 22:07:33 +02:00
Damjan Adamic 194a635800 Ups, forgot a bit of debugging code 2014-07-01 21:56:06 +02:00
Damjan Adamic e4314004a8 ACCURAT_THROTTLE_TIMER was lost when splitting code into mixers.cpp in 2fbd4ff13a 2014-07-01 21:53:56 +02:00
bsongis 74534b74c2 Fixes #1415 2014-07-01 19:02:34 +02:00
bsongis 59eb020eb1 getGeneralSettings(), lcd.getLastPos() and lcd.drawGauge() added 2014-07-01 18:06:37 +02:00
bsongis 1d1a815ef7 lcd.drawChannel(...) added. Possibility to write telemetry values using
different sizes
2014-07-01 17:36:39 +02:00
Bertrand Songis 4088abaafb Merge pull request #1413 from opentx/projectkk2glider/telemetry_enhancements
Unfiltered value used for writing into telemetry log
2014-07-01 16:01:03 +02:00
bsongis 9333f3778f The check on the BL size was wrong as it didn't take care of the
_bootStart() function size
2014-07-01 15:59:45 +02:00
Damjan Adamic 070a133cd5 Merge branch 'next-upstream' 2014-07-01 15:45:35 +02:00
Damjan Adamic 74f4f99280 Added regresion test for FrskyValueWithMin averaging algorithm 2014-07-01 15:40:12 +02:00
Damjan Adamic 66848156a8 Removed test code 2014-07-01 15:32:17 +02:00
bsongis 74dfd64e29 The background function is not anymore mandatory in Telemetry scripts 2014-07-01 14:45:39 +02:00
Bertrand Songis ef0b81cd2d Update DONATIONS.txt 2014-07-01 14:40:26 +02:00
bsongis 09842fe531 Telemetry "voltages" and "after flight" screens may be overriden by
telempw.lua and telemaf.lua
2014-07-01 12:10:17 +02:00
bsongis 3c93699f8f Ignore list updated 2014-07-01 11:39:44 +02:00
bsongis a9dd0d0dfb Taranis+ LCD driver a little bit improved 2014-07-01 11:39:01 +02:00
Bertrand Songis 013e6925dc Update DONATIONS.txt 2014-07-01 09:10:04 +02:00
bsongis 591ccfd25f Cosmetics 2014-07-01 08:06:22 +02:00
bsongis b0bdaf6b65 Warning removed 2014-07-01 08:06:22 +02:00
Bertrand Songis f77e6370cf Merge pull request #1412 from opentx/projectkk2glider/issue_1407
Fixes #1407 - Strange input interaction when Throttle trim idle only
2014-06-30 22:44:04 +02:00
Bertrand Songis ce70efa31d Update DONATIONS.txt 2014-06-30 22:31:39 +02:00
bsongis 3a7fe01950 Taranis+ LCD driver is now working! 2014-06-30 22:24:04 +02:00
Damjan Adamic 3f39352d95 Reduced the size of averaging buffer and introduced a raw (unfiltered) value. Averaged value is same as before, but one byte saved per class instance. Unfiltered value is used for writing into telemetry log. 2014-06-30 21:12:01 +02:00
Damjan Adamic d38c02f847 Fixes #1403 - "make clean PCB=TARANIS" deletes necessary source file 2014-06-30 17:58:05 +02:00
Bertrand Songis 2dddd76320 Fixes #1410 2014-06-30 17:57:28 +02:00
bsongis 391e6a867f It's easier to check gtests screenshots with the right filenames 2014-06-30 17:43:33 +02:00
bsongis 1df8b5f5c1 Fixes #1358 2014-06-30 17:43:33 +02:00
bsongis 6913c8e7e5 Cosmetics 2014-06-30 17:43:33 +02:00
bsongis aab03a2b9f BIGBIG font added 2014-06-30 17:43:33 +02:00
Damjan Adamic a83c6c8a0c Fixes #1408 - Move down in Inputs tab not working 2014-06-30 17:24:36 +02:00
Damjan Adamic b5cdd60367 Fixes #1407 - Strange input interaction when Throttle trim idle only 2014-06-30 17:03:59 +02:00
Bertrand Songis 5453ff5678 Update DONATIONS.txt 2014-06-30 17:00:09 +02:00
Bertrand Songis 7b69fb2f79 Update DONATIONS.txt 2014-06-30 16:12:46 +02:00
bsongis 19ac5d3038 New LCD tests added 2014-06-30 16:09:10 +02:00
bsongis 4b64862cf2 New automatic tests added for the LCD 2014-06-30 15:55:19 +02:00
bsongis f643f0be85 Mike's Taranis+ lcd driver 2014-06-30 12:08:01 +02:00
bsongis 0e0b1792e4 switchState function is not needed in the bootloader 2014-06-30 12:07:04 +02:00
bsongis f81c31510b Fixes #1385 2014-06-30 11:27:46 +02:00
bsongis 5c3bd1faf9 Fixes #1389 2014-06-30 11:17:16 +02:00
bsongis 90cf98465b No Telemetry tab in Companion when the firmware doesn't need it 2014-06-30 11:15:26 +02:00
bsongis 1dd47484d4 Stack alignment change doesn't compile on VC++ 2014-06-30 11:15:26 +02:00
Kjell Kernen bd4a85c6a7 Swedish Companion translation 2014-06-30 11:07:04 +02:00
Kjell Kernen b6520e2db6 Finnish Companion translation from Janne Huuskonen 2014-06-30 11:02:12 +02:00
Bertrand Songis 0ea114b219 Merge pull request #1400 from opentx/projectkk2glider/issue_1399
Fixes #1399 - Option to hide inv parameter effect in the channel monitor
2014-06-30 00:39:59 +02:00
Bertrand Songis e36f54eda5 Merge pull request #1401 from opentx/projectkk2glider/lua_stuff
Projectkk2glider/lua stuff
2014-06-30 00:26:41 +02:00
Bertrand Songis d983404656 Update DONATIONS.txt 2014-06-30 00:22:53 +02:00
Bertrand Songis 677b50d39c Update DONATIONS.txt 2014-06-30 00:21:48 +02:00
Damjan Adamic e5ae504bae Fixes #1394 - Taranis GPS Speed still 120km/h limited 2014-06-29 20:31:59 +02:00
Damjan Adamic ce302aae60 Fixes #1338 - Extend limits - Companion (scale bug) 2014-06-29 17:57:56 +02:00
Damjan Adamic b0869fccfc Re #1358 - defined PREC2 in Lua 2014-06-29 14:29:22 +02:00
Damjan Adamic 17ab12f7bf Added missing eeDirty(EE_MODEL) 2014-06-29 14:26:39 +02:00
Damjan Adamic 816f9ce8a0 Fixes #1388 -New Lua functions: model.getInfo() and model.setInfo() 2014-06-29 13:54:50 +02:00
Damjan Adamic 5fb41eb32f Fixes #1396 - Special functions, adjust GV1 Source CHxx not saved in .eepe file (on AVR platforms) 2014-06-29 13:08:28 +02:00
Damjan Adamic c687e20fff Fixes #1390 - hide switches !SHup, !SHdown, !SFup and !SFdown for Taranis 2014-06-29 12:43:34 +02:00
Damjan Adamic c5aa691467 Fixes #1399 - Option to hide inv parameter effect in the channel monitor 2014-06-29 12:00:29 +02:00
Andre Bernet a3d7c694ef Merge pull request #1391 from opentx/driver33/PL_TR
fixes
2014-06-27 23:58:19 +02:00
Jacek Drewniak 2c8b51c9d6 fixes 2014-06-27 23:27:43 +02:00
Andre Bernet a518a34055 String lengths corrected 2014-06-27 16:44:01 +02:00
Andre Bernet 4d3ca7e82e No DBLKEYS on 9XR-PRo 2014-06-27 16:41:30 +02:00
Andre Bernet 98c756a6d2 Remove orphan "tsticks" option 2014-06-27 16:37:11 +02:00
Andre Bernet 84d5c6c4b0 9XR-Pro in standalone simu 2014-06-27 16:28:27 +02:00
Damjan Adamic 935458caa4 No time on full EEPROM backup (reverted from commit e3b8e91a0a) 2014-06-27 08:48:53 +02:00
Bertrand Songis dcec97411e Update DONATIONS.txt 2014-06-27 07:11:16 +02:00
Andre Bernet 91032483c8 More stuff in release notes 2014-06-26 23:04:28 +02:00
Andre Bernet 9e40708f7c 2.0.5 preparation 2014-06-26 22:59:10 +02:00
Andre Bernet 54902a5a00 Lua telemetry screens had been shifted in d2df4af, and start screen still wasn't the intended one.
Now we've got lua first, custom second, then the voltage and end of flight default screens. Makes sense, so that the most potentially powerful type is first.
2014-06-26 18:54:27 +02:00
Andre Bernet 927a9b9f38 Merge pull request #1384 from opentx/MicheleVilla/IT_Translation_FW
Update it.h.txt
2014-06-26 15:58:16 +02:00
Michele bfdb3a9da7 Update it.h.txt
Small changes in Italian translation
2014-06-26 15:54:41 +02:00
Andre Bernet 63269ac35a Backlight Alarm parameter added in companion (fix #1123) 2014-06-26 15:20:29 +02:00
Andre Bernet 113deb6b75 Switch warning for SG wasn't reachable (fix #1371) 2014-06-26 14:41:52 +02:00
mhotar c48f4a51a6 No INVERS in FM string #1357 2014-06-26 13:51:54 +02:00
Andre Bernet 3cd2f709fc wget doesn't like https on win (#1378) 2014-06-26 13:28:20 +02:00
Andre Bernet d2df4af67d Telemetry screens order (Fix #1369) 2014-06-26 13:17:47 +02:00
Andre Bernet 67177aed42 Fix VC compilation for #1364 fix 2014-06-26 13:14:05 +02:00
Kjell Kernen 5879ca2fb6 Moved initialization of eeprom interfaces to before the first lines of active code to avoid future problems. 2014-06-26 12:56:16 +02:00
Kjell Kernen 77a7f13507 German OpenTX firmware translation from Helle 2014-06-26 12:04:56 +02:00
Bertrand Songis 2a794e2ae3 Merge pull request #1379 from opentx/projectkk2glider/issue_1364
Fixes #1364 - Stack alignment to 8 bytes
2014-06-26 11:50:54 +02:00
Bertrand Songis 090f659dca Merge pull request #1381 from opentx/dvogonen/issue_1360_Companion_crash
Fixes #1360
2014-06-26 11:49:41 +02:00
Bertrand Songis ca79fabdc7 Update DONATIONS.txt 2014-06-26 11:46:26 +02:00
Kjell Kernen 693f232f01 Fixes #1360 2014-06-26 11:39:43 +02:00
Damjan Adamic 8c33914cbb Fixes #1364 - Stack alignment to 8 bytes 2014-06-26 10:30:01 +02:00
bsongis a8e594e54c Fixes #1373 - I don't get why this was disable on the MAC, for sure
there was a reason
2014-06-26 07:51:53 +02:00
bsongis 17f7d90dbf Fixes #1374 2014-06-26 07:50:13 +02:00
Bertrand Songis 7ad3d5d317 Update DONATIONS.txt 2014-06-26 07:19:31 +02:00
bsongis 3d37b0d397 Lua bugfixes in getCustomFunction/setCustomFunction and
getLogicalSwitch/setLogicalSwitch
2014-06-26 07:16:43 +02:00
Andre Bernet e8fc7c4c89 Cnsp range was wrong 2014-06-25 21:58:52 +02:00
Damjan Adamic 405fd802d5 Re #1361 - Fixed 10000% bug 2014-06-25 09:02:23 +02:00
mhotar 5d1e9a1701 FM -translatable string 2014-06-25 00:40:20 +02:00
Bertrand Songis d09b85ddc4 Update DONATIONS.txt 2014-06-24 22:54:46 +02:00
mhotar a4aa0eb7c8 FM marks - fix INVERS surrounding 2014-06-24 22:07:43 +02:00
Bertrand Songis d105325dd7 Fixes #1359 2014-06-24 20:56:13 +02:00
bsongis 1fb9e57c62 Fixes #1357 2014-06-24 17:41:13 +02:00
Bertrand Songis 576d9d6d9d Update DONATIONS.txt 2014-06-24 17:20:36 +02:00
Bertrand Songis b7f3d1674d Update DONATIONS.txt 2014-06-24 17:13:07 +02:00
Bertrand Songis f7b009a9be Update DONATIONS.txt 2014-06-24 16:06:40 +02:00
bsongis 2e472700cc 2.0.4 preparation 2014-06-24 11:29:27 +02:00
bsongis edbe6fc72e Fixes #1316 2014-06-24 11:14:40 +02:00
bsongis 1b728948f4 Cosmetics 2014-06-24 11:14:40 +02:00
bsongis 7434c28820 Pulled from ersky9x 2014-06-24 11:14:40 +02:00
Bertrand Songis 751027b4ad Merge pull request #1355 from opentx/projectkk2glider/issue_1283
Fixes #1283 - EEPROM backup/restore - unexpectedShutdown set
2014-06-24 10:51:01 +02:00
Damjan Adamic 317890c9f9 Fixes #1283 - EEPROM backup/restore - unexpectedShutdown set 2014-06-23 19:47:49 +02:00
Damjan Adamic 65f433438a Fixes #1338 - Extend limits - Companion 2014-06-23 19:22:16 +02:00
bsongis 7167f6a9b7 Fixes Companion compilation error 2014-06-23 18:03:49 +02:00
bsongis cb47c0fc92 Fixes #1353 - Tests on radio needed before the release, thanks! 2014-06-23 17:58:52 +02:00
bsongis 37222c32a4 Sky9x compilation error when FRSKY not enabled 2014-06-23 17:40:16 +02:00
bsongis dafb700be2 [Taranis] Telemetry on battery serial port only enabled if UART3 mode is
set to telemetry
2014-06-23 17:38:00 +02:00
bsongis 9d4fbfc3ea Enable telemetry through the nice little cable on 9XR-PRRRO ;) 2014-06-23 17:24:38 +02:00
bsongis e96578c857 [Taranis] Telemetry (only FrSky D) through serial port inside the
battery compartment added
2014-06-23 15:41:50 +02:00
bsongis d2ce28f897 Constant badly used, thanks André for the review 2014-06-23 14:41:40 +02:00
Bertrand Songis 7b3e661110 Update DONATIONS.txt 2014-06-23 14:36:37 +02:00
bsongis 2c6f28e422 Fixes #1352 2014-06-23 12:15:17 +02:00
bsongis 1febac7bf9 Fixes #1347 2014-06-23 10:41:31 +02:00
Bertrand Songis 59b0bca88b Update DONATIONS.txt 2014-06-22 22:06:11 +02:00
bsongis 9f522beac4 300m/s as a max for the vario in Logical Switches 2014-06-22 15:23:56 +02:00
Bertrand Songis 4712383523 Merge pull request #1346 from opentx/projectkk2glider/issue_1345
Projectkk2glider/issue 1345
2014-06-22 15:17:42 +02:00
Damjan Adamic b8487c90de Removed traces 2014-06-22 13:53:46 +02:00
Damjan Adamic f3bc8cb9a4 Fixes #1345 2014-06-22 13:52:59 +02:00
Damjan Adamic c0c6a90f65 Added traces 2014-06-22 13:17:16 +02:00
bsongis ffd4151029 Menu length increased on Taranis to allow backups with date in the
filename
2014-06-22 09:29:12 +02:00
bsongis e3b8e91a0a No time on full EEPROM backup 2014-06-22 09:28:35 +02:00
bsongis 629e09c464 Only appends the date to a model backup (no time). No date/time on
gruvin9x board.
2014-06-22 09:23:59 +02:00
bsongis 8f36f0e405 Cosmetics 2014-06-22 09:14:16 +02:00
bsongis 7467213bad Possible display overflow 2014-06-22 09:00:41 +02:00
bsongis 5b2530ba79 Conditional compilation added around previous pull request (multi-lines
improvement)
2014-06-22 07:25:28 +02:00
Bertrand Songis d0a7d748c9 Merge pull request #1336 from ChrisNisbet01/multiline_string_issue
Fixes issue where strings may be truncated unnecessarily.
2014-06-22 07:17:33 +02:00
bsongis 790073d4db Fixes #1333 2014-06-22 07:14:54 +02:00
Bertrand Songis bb9cd3e8f5 Merge pull request #1344 from opentx/projectkk2glider/companion_lua_1334
Projectkk2glider/companion lua 1334
2014-06-22 00:19:17 +02:00
bsongis 83532f84cd Overflow in copySticksToOffset on 9x 2014-06-22 00:15:23 +02:00
bsongis cfd6d47dfb Fixes #1033 2014-06-22 00:14:49 +02:00
Damjan Adamic 831cbc0122 Script output names same as on the radio (i.e. LUA1b) 2014-06-21 22:20:56 +02:00
Damjan Adamic d0edbacf37 re #1334 - added Lua script outputs to: mixer soruces list, logical switches V1 and V2 list 2014-06-21 22:05:43 +02:00
bsongis 5fcba6e193 Fixes #1339 2014-06-21 21:49:26 +02:00
bsongis e5e378b1b0 Fixes #1343 2014-06-21 21:33:48 +02:00
bsongis 319b3006f3 Compilation problem on gruvin9x boards 2014-06-21 20:15:05 +02:00
bsongis e14c2e0916 Another couple of min/max fixed in Logical Switches 2014-06-21 20:12:28 +02:00
bsongis 026213fcd5 minTelemValue(...) rewritten 2014-06-21 20:03:36 +02:00
bsongis 1116bbb167 Cell max value is now 5.10V in the Firmware (as in Companion) 2014-06-21 19:39:49 +02:00
bsongis 99704109eb getRange(...) won't change the class members any more ... 2014-06-21 19:28:03 +02:00
bsongis f707035af5 A1- to A4- inaccessible 2014-06-21 19:18:23 +02:00
bsongis 8d6ab5c123 A1- A2- A3- A4- min/max wrong in Logical Switches (Companion) 2014-06-21 11:13:38 +02:00
bsongis 40a391d778 dTE min/max wrong in Logical Switches (Companion). GVARS min/max wrong
in Logical Switches (Firmware and Companion)
2014-06-21 11:06:58 +02:00
Chris Nisbet 9fe49846c5 Fixes issue where strings may be truncated unnecessarily.
If the string spans multiple lines (contains character 0x1E), the limit on the line's length should be set back to the original value.
2014-06-21 14:52:40 +12:00
bsongis 88c4c11b56 Fixes #1334 2014-06-21 00:00:29 +02:00
bsongis e4b5f98d58 Fixes #1331 2014-06-20 16:16:16 +02:00
bsongis 405391033d Logical Switches range bugfixes (both Companion and Firmware) 2014-06-20 16:06:55 +02:00
bsongis 13fd1f04c0 French translations 2014-06-20 14:35:15 +02:00
bsongis 8d42380abb Fixes #1329 2014-06-20 14:35:03 +02:00
bsongis 9e1afe8cb0 Bad display after removal of a custom script 2014-06-20 12:09:43 +02:00
bsongis 90381e369d kt to mph conversion taken from last commit (everything else removed, it
breaks 9x support)
2014-06-20 11:41:36 +02:00
bsongis 8fa2c21a47 Merge commit '2a277e930cb8e598c46aa24a5bf29056420cad6a' into next 2014-06-20 11:28:05 +02:00
bsongis c08b57ad9b Merge commit 'c9cc39c1395db32ffd4ef816f3cecbe8e5a2af96' into next 2014-06-20 11:27:41 +02:00
bsongis e31f71f874 Fixes copySticksToOffset bug when HELI enabled (thanks non regression
tests!)
2014-06-20 11:17:24 +02:00
Bertrand Songis 206563f433 Cosmetics 2014-06-20 11:06:11 +02:00
Bertrand Songis a191543ee3 Merge pull request #1298 from ChrisNisbet01/mass_storage_in_firmware
CN - Adds support for a mass storage USB device in the main firmware.
2014-06-20 11:03:59 +02:00
bsongis d74af019f8 #1323 non regression test added 2014-06-20 10:58:36 +02:00
Bertrand Songis 7ea0c7cb5c Merge pull request #1325 from opentx/MicheleVilla/IT_Translation_FW
Update it.h.txt
2014-06-20 09:49:05 +02:00
Michele 38918e157e Update it.h.txt
Small changes in Italian Translation
2014-06-20 08:42:37 +02:00
bsongis 99d33cbc74 Fixes #1324 2014-06-20 07:24:40 +02:00
Bertrand Songis a02b0f5d00 Update DONATIONS.txt 2014-06-20 07:08:33 +02:00
Andy Jenkinson bd42cbed33 Fixes #1302 2014-06-20 01:57:53 +01:00
Andy Jenkinson 546a680bec Support more build environments for Mac. 2014-06-20 00:48:11 +01:00
Bertrand Songis 7cc411d384 Update DONATIONS.txt 2014-06-19 23:59:49 +02:00
bsongis 6908509d79 CopyTrimsToOffset function added - #1323 2014-06-19 23:52:50 +02:00
bsongis b1f44d7101 Fixes #1323 2014-06-19 23:17:50 +02:00
Bertrand Songis e8e2ff4a94 Update DONATIONS.txt 2014-06-19 22:22:29 +02:00
Bertrand Songis 9d7af18f7b Update DONATIONS.txt 2014-06-19 21:17:15 +02:00
Bertrand Songis 937662eac4 Update DONATIONS.txt 2014-06-19 20:19:45 +02:00
Damjan Adamic 2a277e930c Correct minimum value for speed is 0 2014-06-19 16:44:24 +02:00
Damjan Adamic c9cc39c139 Unit for Knots is "kn" 2014-06-19 16:43:53 +02:00
bsongis 3623f66927 Does it fix #1212 on Windows? 2014-06-19 16:29:55 +02:00
bsongis dc58dd4d6f RPM max is 30000 also in Companion 2014-06-19 15:54:02 +02:00
bsongis 0d5196e8c9 Fixes #1291 2014-06-19 15:48:23 +02:00
Damjan Adamic 11b18ca760 Merge pull request #1315 from opentx/projectkk2glider/issue_1310
Fixes #1310 - Vspd V2 value resolution probem in Companion
2014-06-19 15:47:18 +02:00
Damjan Adamic b1fa194a1d Cosmetics 2014-06-19 15:45:47 +02:00
Damjan Adamic 3dfe0afd6f Merge branch 'next-upstream' 2014-06-19 15:40:02 +02:00
Kjell Kernen e82ca116f7 Added spalsh screens for 9xr and 9xrpro 2014-06-19 15:22:42 +02:00
Bertrand Songis 9db563c7c1 Merge pull request #1279 from hrenz/patch-4
Update de.h.txt    there was no RSSI selction at SF and Telemetrie
2014-06-19 15:15:42 +02:00
bsongis a9ad37cab9 Fixes #1304 - A1, A2, A3, A4, RSSI, SWR and Telemetry State alarms are
now Critical alarms and are played in "Alarm" mode.
2014-06-19 15:09:09 +02:00
bsongis 2d5a5eccd6 Fixes #1311 - Speed and AirSpeed maxima are now 2000kts in OpenTX 2014-06-19 15:04:17 +02:00
bsongis a5647ed7bc Fixes #1309 2014-06-19 14:47:26 +02:00
bsongis 7b1edb58a4 Fixes #1306 2014-06-19 12:29:22 +02:00
bsongis ed90015503 Fixes #1272 2014-06-19 11:59:18 +02:00
bsongis 6ef4134b2d Display of an unit in Logical Switches 2014-06-19 10:55:23 +02:00
Chris Nisbet 282a3d00b1 CN - Altered these files so that they have CRLF line endings. 2014-06-19 20:21:20 +12:00
bsongis 36395862d1 Fixes #1311 2014-06-19 10:20:09 +02:00
bsongis 1560fa8bd9 Companion bug in speed values (Logical Switches) 2014-06-19 10:20:09 +02:00
bsongis 79abc49a6c Update of bars source when the telemetry protocol changes 2014-06-19 10:20:09 +02:00
bsongis 6c86cada2c Bad initialization of weight in the MixerDialog (when no GVars) 2014-06-19 10:20:09 +02:00
Chris Nisbet 3e0135071e CN - Attempt to fix line ending issue where remote files have CRLF, but local files have LF only. 2014-06-19 19:50:40 +12:00
Chris Nisbet cdc0147dcb CN - Attempt to fix line ending issue where remote files have CRLF, but local files have LF only. 2014-06-19 19:49:29 +12:00
Damjan Adamic 73cd69c63b Fixes #1310 - Vspd V2 value resolution probem in Companion 2014-06-19 09:10:22 +02:00
Bertrand Songis 7e147c71c1 Merge pull request #1312 from opentx/projectkk2glider/issue_115
Fixes issue #115
2014-06-19 07:31:03 +02:00
Bertrand Songis c4140f305c Update DONATIONS.txt 2014-06-19 07:12:35 +02:00
Chris Nisbet 07b4be8f45 CN - Adds support for a mass storage USB device in the main firmware.
By default, the firmware includes the USB joystick device, but it is possible to replace this code with a mass storage device that allows access to the SD card when running the main firmware.
To include the mass storage device and remove the joystick device, add "USB=MASS" to the command line args when making the firmware.
2014-06-19 16:57:17 +12:00
Damjan Adamic fd9f3ad8be Bad indentaton and reduced buffer size 2014-06-19 06:53:53 +02:00
bsongis b83f95ed1a Events are transmitted to the Lua telemetry screens. Menus are displayed
over those screens (needed at least for Reset Telemetry/Flight)
2014-06-18 22:42:04 +02:00
bsongis b77d470684 background function added to Lua scripts (used only in telemetry
scripts)
2014-06-18 22:42:04 +02:00
bsongis ec81b078fe Now telem0.lua replaces the voltages screen and telem1.lua .. telem7.lua
are allowed. The user could now have 1+7+3+1=12 telemetry screens!
2014-06-18 22:42:04 +02:00
bsongis 2416dde7bb Lua telemetry screens. Still not finished:
- the scripts need to be wakedup even when not displayed
- I only tested telem0.lua, but theorically we could have 7 telemetry
screens
2014-06-18 22:42:04 +02:00
Bertrand Songis 0af5794cfa Update DONATIONS.txt 2014-06-18 22:29:11 +02:00
Damjan Adamic 1e917da05e RTC time initialization in simulator 2014-06-18 22:22:15 +02:00
Damjan Adamic c82068115f Fixes #115 - added date and time to backup filename 2014-06-18 22:19:57 +02:00
Bertrand Songis 41f14b93df Update DONATIONS.txt 2014-06-18 17:45:49 +02:00
Bertrand Songis df7455e24b Update DONATIONS.txt 2014-06-18 15:53:42 +02:00
Bertrand Songis a5316ef6e3 Update DONATIONS.txt 2014-06-18 11:43:56 +02:00
bsongis e6391f04c4 Firmware options refactoring. It allows
FirmwareInterface::getCapability() to know which options are enabled in
the preferences. The Heli tab and the GVars are displayed according to
these options.
2014-06-18 10:43:35 +02:00
bsongis 571b498a82 Warning removed 2014-06-18 07:26:36 +02:00
bsongis efc11be7ee TTS languages were hardcoded in the UI :( 2014-06-17 23:17:49 +02:00
bsongis 19ef43cd7f Compilation error on VC++ 2014-06-17 17:38:29 +02:00
bsongis 1861c5e264 Release notes updated 2014-06-17 17:13:32 +02:00
Kjell Kernen e040ab9897 Fixes #1300 2014-06-17 17:05:47 +02:00
bsongis f2b59df0f6 OpenTX 2.0.3 preparation 2014-06-17 16:54:05 +02:00
bsongis 824059d033 PPM Pulses code modification pulled from ersky9x 2014-06-17 16:51:39 +02:00
bsongis 500ca6554d Sky9x compilation failure 2014-06-17 15:57:25 +02:00
bsongis b3b35eca5b Compilation failure 2014-06-17 15:48:03 +02:00
bsongis 39118453da Code cleanup on Sky9x pulses 2014-06-17 15:41:27 +02:00
bsongis 9e64801384 Compilation failure on Sky9x without FRSKY extension 2014-06-17 15:41:27 +02:00
Damjan Adamic 6497407788 Removed frskyData.hub.gpsDistance simulator initialization because it is a calculated value. 2014-06-17 14:42:29 +02:00
Bertrand Songis 5a3d2244d8 Fixes #1267 2014-06-17 13:17:57 +02:00
Damjan Adamic 8115a78df7 Added couple of simulator telemety initialization values. 2014-06-17 13:04:35 +02:00
Michele f597e6412b Update it.h.txt
Some changes in Italian translations
2014-06-17 12:53:34 +02:00
Bertrand Songis 3df0b12ccb Update DONATIONS.txt 2014-06-17 12:31:25 +02:00
Damjan Adamic f99fc83993 Fixes #1264 - CFN_GVAR_CST_MAX is 500, int16_t is needed 2014-06-17 11:50:08 +02:00
bsongis bf511767ce Fixes #1281 - Needs to be tested on Windows 8 2014-06-17 11:34:02 +02:00
bsongis 9682bf116d Fixes #1271 2014-06-17 11:27:59 +02:00
bsongis 6086112cf9 Fixes #1264 2014-06-17 11:16:42 +02:00
bsongis 6dacd5a914 Google tests didn't compile with my last commit 2014-06-17 11:07:20 +02:00
bsongis 2094e87da5 'phase' renamed to 'flight mode' everywhere in the code 2014-06-17 10:59:00 +02:00
bsongis 20125474c1 Fixes #1267 2014-06-17 10:59:00 +02:00
Damjan Adamic 18f327612f re #1294 - clear input name if removing last input line 2014-06-17 10:01:14 +02:00
Damjan Adamic 6689919a39 Fixes #1294 - Companion, Delete action without a selection 2014-06-17 09:25:57 +02:00
bsongis c7133bb5a0 Backlight driver fixed on Taranis+ 2014-06-17 08:50:02 +02:00
Bertrand Songis a40dc4c4d2 Update DONATIONS.txt 2014-06-17 07:45:33 +02:00
bsongis 9840cc7dfc Fixes #1285 2014-06-16 18:01:42 +02:00
bsongis 8cd55856e9 Fixes #1288 2014-06-16 17:48:23 +02:00
bsongis f4bbaf682c Fixes #1292 2014-06-16 17:39:49 +02:00
Bertrand Songis db7dd83168 Update DONATIONS.txt 2014-06-16 17:34:05 +02:00
bsongis 4d71fb31db Reset All should be named Reset Flight 2014-06-16 14:49:54 +02:00
bsongis 101293124a timer10.wav and timerlt3.wav shouldn't exist any more (beeps) 2014-06-16 14:49:53 +02:00
Damjan Adamic effcb1610b Fixes #1290 - Gvar popup wrong if same as other FM 2014-06-15 18:50:45 +02:00
Bertrand Songis 97b37a5024 Update DONATIONS.txt 2014-06-15 16:40:18 +02:00
Bertrand Songis c79d78664b Update DONATIONS.txt 2014-06-15 15:23:02 +02:00
Bertrand Songis 9c972b0c42 Merge pull request #1286 from opentx/driver33/PL_TR
fixes
2014-06-14 22:54:27 +02:00
Jacek Drewniak 35765394dc fixes 2014-06-14 21:58:57 +02:00
Bertrand Songis 219c4e913c Merge pull request #1284 from opentx/projectkk2glider/issue_1269
Fixes #1269 - RSSI Tx should be hidden in companion if radio is Taranis.
2014-06-14 20:58:44 +02:00
Bertrand Songis d3ca801e53 Update DONATIONS.txt 2014-06-14 20:49:10 +02:00
Damjan Adamic 1c2257190a Fixes #1269 - RSSI Tx should be hidden in companion if radio is Taranis.
I followed isTelemetrySourceAvailable() and hided RssiTx and dTE.
2014-06-14 19:03:03 +02:00
Damjan Adamic f509a7d22b bug: wrong locaion for addText() 2014-06-14 18:30:23 +02:00
Bertrand Songis 44829cd579 Merge pull request #1276 from opentx/projectkk2glider/issue_1266
Fixes #1266 - Companion timer value not in time format
2014-06-14 11:30:34 +02:00
bsongis 94e749d08e Companion: limit for comparaison of timers in Logical Switches is now
300 (1 hour)
2014-06-14 11:22:53 +02:00
bsongis 726a03d433 Fixes #1277 2014-06-14 11:20:40 +02:00
bsongis d6ef1c011b Now the Lua Telemetry scripts 2014-06-14 11:13:02 +02:00
bsongis f295f3b888 Function renamed 2014-06-14 11:09:40 +02:00
Damjan Adamic f55e5f862b Merge pull request #1280 from opentx/ChrisNisbet01/issue_1278
Chris nisbet01/issue 1278
2014-06-14 09:03:16 +02:00
Bertrand Songis 3c5d9c617a Update DONATIONS.txt 2014-06-14 08:57:35 +02:00
Damjan Adamic 10413bbede Removed compiler warning: lua.cpp:63:60: warning: missing braces around initializer for 'ScriptInputsOutputs' [-Wmissing-braces] 2014-06-14 08:24:00 +02:00
Damjan Adamic 91dfb0309e Removed compiler warning: lua.cpp:1382:21: warning: variable 'filename' set but not used [-Wunused-but-set-variable] 2014-06-14 08:18:47 +02:00
Damjan Adamic 6707f68923 One more warning removed: ../targets/taranis/board_taranis.h:256:3: warning: function declaration isn't a prototype [-Wstrict-prototypes] 2014-06-14 08:10:40 +02:00
hrenz 21b80be29a Update de.h.txt
Line 322 Colum 180 and Line 324 Colum 172 
german was different to engish
TR_TELEM_RSSI_RX missing
At opentx  telemetrie no RSSI selection at special funktions
hope thats all
2014-06-14 05:44:21 +02:00
Chris Nisbet c4b19de8eb CN - Couple of bug fixes in USB code. This functions the bugs were in don't appear to be called by any of the OpenTX code. 2014-06-14 13:02:51 +12:00
Damjan Adamic 5351514180 Using enume instead of numeric constants 2014-06-14 00:04:44 +02:00
Damjan Adamic 37ec428efc Fixes #1266 - Companion timer value not in time format 2014-06-13 23:34:01 +02:00
Bertrand Songis 1941d3eb7e Update DONATIONS.txt 2014-06-13 23:23:01 +02:00
bsongis e3df420f8e Lua scripts directories changed. We will now have
/SCRIPTS/WIZARD/
/SCRIPTS/TEMPLATES/
/SCRIPTS/MIXES/
/SCRIPTS/FUNCTIONS/
2014-06-13 14:37:57 +02:00
bsongis 87c8b4b153 #1227 - TRIM_MARGIN is now radio dependant 2014-06-13 11:32:21 +02:00
bsongis 4149361de8 Hungarian voice added 2014-06-13 10:33:10 +02:00
bsongis 2fbd68ecb3 Google analytics removed. Completely wrong, we use the compilation
server numbers instead.
2014-06-13 10:17:36 +02:00
Bertrand Songis cedac96cf4 Update DONATIONS.txt 2014-06-13 07:29:20 +02:00
bsongis 89433127c4 Lua scripts now in custom functions! 2014-06-12 18:18:42 +02:00
Kjell Kernen c23f1e974a Fixes #1262 2014-06-12 16:14:21 +02:00
bsongis 9a83325119 Compilation error when GAUGES=NO 2014-06-12 15:59:54 +02:00
Damjan Adamic a596001338 Companion mixer tab, if CH1 is empty the Move up button will never bring something there, fixes #1261 2014-06-12 15:16:50 +02:00
Bertrand Songis 1127ea412e Update DONATIONS.txt 2014-06-12 12:27:12 +02:00
580 changed files with 92790 additions and 64954 deletions
+14
View File
@@ -0,0 +1,14 @@
language: cpp
before_install:
- sudo apt-get remove cmake cmake-data --yes
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo apt-get update
install:
- sudo apt-get install --yes --force-yes lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
script:
- radio/util/commit-tests.sh
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
+320 -5
View File
@@ -173,12 +173,12 @@ Keith Hertzog
Johan Moelich
Timo Esser
Dean Church (monthly)
Brian Paddock (monthly)
Brian Paddock
Jean Pierre Parisy
Norbert Martsch
Jean-Marie Guitard
Mike Perkins
Tilman Baumann (monthly)
Tilman Baumann
Fred Larssen
Ari Aalto
Robert Sams
@@ -189,7 +189,7 @@ Paul Robinson
Dave Matison
Mike Matheny
Pino Agostino
Graham Boucher (monthly)
Graham Boucher
Nelson Noura
Joel Allamy
Philip David Martin
@@ -200,7 +200,7 @@ Timothy Pelletier
Glen Roe (ShowMaster)
Jan Van Ooteghem
David Ankers - Special thanks here to the OpenPilot project!
Lawrence Christensen (monthly)
Lawrence Christensen
Leo Duflou
Bruce Wood
Arnd Feige
@@ -259,7 +259,7 @@ Peter Mitrik
Thomas Majewski
ANF King
Henrik Hammarström
Kenneth Lilja (monthly)
Kenneth Lilja
R Wells
Uwe Jordt
Harald Wilczak
@@ -467,3 +467,318 @@ 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
Heinrich Illig
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
Thos. O'Meara Photography
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
Sebastien Charpentier
Greg Parker
Norman Maaß
Adriano Del Ben
Justin Poole
Kenneth Harrison
Eugene LaFaille
John O'Shaughnessy
Uwe Jordt
Stuart Olson
Frédéric Devillard
Cheung Leo
Peter Webster
Jean-Claude Bachetta
Delfin Perena
Sae-wook Yoon
Focus on Excellence
Jeffery Golias
Nick Milton
Paul Zasso
Reidar Johannes Lillebotn
Handley William
Luke Williams
Michael Shellim
Brian Spearing
Derek Foster
Pasi Pitkänen
Lexington S Morley
Jeff Roberson
Volkov Victor
Mike Perkins
Bryan Anderson
Daniel Garber
Pavel Stein
Ravi Gupta
Patrick Tuxbury
Mark Deverell
John Capell
Neil McVean
Matthew Elyash
Kerry Cochrell
Willem Aandewiel
Reg Bell
Jean Chenoz
Philippe Grand
Tauno Rautakorpi
Jeff Dillingham
Brad Kelley
Shaun Currier
Danilo Schiara
John Hennig
RK Custom Homes
James Houck
Piet Teekens
Tommy Widenflycht
Johan Petrus Theophilus Maria van Melis
Ralph Gustafson
Paul Luby
Andrew Duncan
Stephen Crowther
Edward Glover
Kelly Byrd
Brad Curtis
Wolfgang Kuhl
LitePilots - litepilots.com
John Beidl
Roy Nixon
Glen Roe
CY Enterprise
Evening Shade Pottery
Gilles Dando
Patrick Richard
Justin Altemeier
Constant Dupuis
Tony Kenward
Pierre Rondel
Ernest Luguera Sanchez
Adam Brackney
Joe Baker
单 雷平
Ben Fay
Chris Monk
Stan von Miller
Christian Krebs
Michel Motte
Graziano Rampinelli
Joe Baker
Jean-Philippe Laurent
Romain Rouzaud
Michel Garbarino
Henri Mirra
Otto Fröhlich
Thomas Cramer
Anthony Trombetta
Fernando Rimoldi
Dietmar Drees
Michal Kowalski
Ivan Correa
Modellbau
Massimo Luigi Stara
Graham Baldwin
Tomasz Rejman
Wolfgang Lang
John Greenwood
Till von Reumont
Paul Pereira Brunner
Donald L Singer
Junsun Lee
Guy Lamaison
Erwin Dulken
Mike H Dailey
Jon Cammarata
Martin Krueger
Adolfo Perogio
Sylvain Techer
Wes Warner
Kevin Caldwell
Ali Ersan Gur
Hans-Rudolf Riniker
Sébastien Boutard
Jean Chessé
Mike H Dailey
Don Polk
Roberto Orsello
Borovikov Dmitriy
John Lipscomb
Peter Glassey
Joseph Kramer
F.Javier Martinez Velasco
Claudio Piccinini
John Jackson
John Beech
Rene Traa
Sebastien Charpentier (monthly)
Nigel Hendriks
Frédéric Devillard
Albert Herzog
Anindya Mukerjee
Kenny Stanberry
Tauno Rautakorpi
Mathias Krapp
Fernando Rimoldi
Wolfgang Rauser
Richard Shagam
Stephen Bailey
DK-System
Casa Kuxtal
Alain Labonne
Christopher Potts
Douglas George
Michael Banks
Jon Wiltshire
David Green
Guy Willems
Xavier Mestelan Pinon
Maik Gottschalk
Scott Sparks
John Dunning
RAD51
Ron Powell
Alain Labonne
Carol Sills
Franck Aßmann
+2 -5
View File
@@ -1,8 +1,5 @@
##OpenTX Next Branch
##OpenTX 2.0 Branch
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
The stable release code is not here, it is in the master branch.
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
The ongoing development is not done in this branch. It is performed in the branches `master` and/or `next`. This branch is used for bug fixes of OpenTX 2.0.x series.
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
+170 -1
View File
@@ -1,3 +1,172 @@
<h2>Version 2.0.20 / 2016-09-14</h2>
<ul>
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
<li>Removed dependencies on th9x, er9x and ersky9x source code (<a href=https://github.com/opentx/opentx/issues/3537>#3537</a>)</li>
</ul>
<h2>Version 2.0.19 / 2016-01-15</h2>
<ul>
<li>Throttle Source combobox was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
</ul>
<h2>Version 2.0.18 / 2016-01-03</h2>
<ul>
<li>Enabled <i>Mixers monitor</i> in Taranis simulator</li>
<li>Better support for multi-axes in Log Viewer (<a href=https://github.com/opentx/opentx/issues/2267>#2267</a>)</li>
<li>File path issue in Taranis simulator function <i>findTrueFileName()</i> on Windows (<a href=https://github.com/opentx/opentx/issues/2301>#2301</a>)</li>
<li>Added simulator volume gain setting (<a href=https://github.com/opentx/opentx/issues/2260>#2260</a>)</li>
<li>Added GPS glitch filtering and Latitude/Longitude position synchronization to Google Earth export (<a href=https://github.com/opentx/opentx/issues/2326>#2326</a>)</li>
<li>Fixed a rare program crash when editing Input for 9X radio (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
<li>Fixed missing RSSI audio warnings if simulator was started multiple times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
<li>EU-only firmware option added</li>
<li>Joystick channel mapping bug fixed (<a href=https://github.com/opentx/opentx/issues/1732>#1732</a>)</li>
<li>Physical switches were missing from Adjust Volume special function sources (<a href=https://github.com/opentx/opentx/issues/2414>#2414</a>)</li>
<li>Fixed a rare program crash: input name buffer overflow (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
<li>Alarms did not work if user started radio simulation several times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
<li>Fixed endless loop in model compare (<a href=https://github.com/opentx/opentx/issues/2734>#2734</a>)</li>
<li>Prevent user from opening 2.1 or higher EEPE (<a href=https://github.com/opentx/opentx/issues/2620>#2620</a>)</li>
<li>Center beep checkbook for P3 was missing for some radios (<a href=https://github.com/opentx/opentx/issues/2707>#2707</a>)</li>
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
</ul>
<h2>Version 2.0.17 / 2015-05-04</h2>
<ul>
<li>Simulator crash (<a href=https://github.com/opentx/opentx/issues/2253>#2253</a>)</li>
</ul>
<h2>Version 2.0.16 / 2015-05-03</h2>
<ul>
<li><i>nooverridech</i> firmware option was not working</li>
<li>Fixed setting Expo from gvars for 9XR-Pro (<a href=https://github.com/opentx/opentx/issues/2040>#2040</a>)</li>
<li>Added Mixers Monitor screen option <i>mixersmon</i> (<a href=https://github.com/opentx/opentx/issues/1945>#1945</a>)</li>
<li>Added audio playing in simulator (<a href=https://github.com/opentx/opentx/issues/457>#457</a>)</li>
<li>Fixed sorting of audio tracks (<a href=https://github.com/opentx/opentx/issues/2002>#2002</a>)</li>
<li>Model wizard fixes (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
<li>GVAR names removed for 9x, radio doesn't support them (<a href=https://github.com/opentx/opentx/issues/2150>#2150</a>)</li>
<li>Some LS sources didn't follow the Imperial units setting (<a href=https://github.com/opentx/opentx/issues/2180>#2180</a>)</li>
<li>Added more fields to the telemetry simulator (<a href=https://github.com/opentx/opentx/issues/2171>#2171</a>)</li>
<li>Log viewer improvements and massive speed increase (<a href=https://github.com/opentx/opentx/issues/1863>#1863</a>, <a href=https://github.com/opentx/opentx/issues/2163>#2163</a>)</li>
<li>Added Battery meter range setting (<a href=https://github.com/opentx/opentx/issues/2195>#2195</a>)</li>
<li>Improvements in Print and Compare dialogs (<a href=https://github.com/opentx/opentx/issues/2219>#2219</a>)</li>
<li>Reset pots to the middle by right double clicking them in Simulator (<a href=https://github.com/opentx/opentx/issues/1939>#1939</a>)</li>
<li>Minor fixes: <a href=https://github.com/opentx/opentx/issues/2153>#2153</a>,
<a href=https://github.com/opentx/opentx/issues/2138>#2138</a>,
<a href=https://github.com/opentx/opentx/issues/2090>#2090</a>,
<a href=https://github.com/opentx/opentx/issues/2122>#2122</a>
</li>
</ul>
<h2>Version 2.0.15 / 2015-01-13</h2>
<ul>
<li>Firmware was not written correctly on radio when compatibility warning check enabled</li>
<li>Time format for Special Functions Set Timers</li>
</ul>
<h2>Version 2.0.14 / 2015-01-12</h2>
<ul>
<li>OpenTX Companion and Companion9x can now be installed side by side on Linux</li>
<li>Improved TAB order in dialogs</li>
<li>Special Function <i>Start Logs</i> renamed to more appropriate <i>SD Logs</i></li>
<li>Improvements for MAC build</li>
<li>Fixes to Google Earth logs export</li>
<li>Firmware compatibility warning check added when flashing new firmware to radio</li>
<li>Fixed issue with Telemetry Type setting on 9XR-PRO</li>
<li>Added Telemetry simulator</li>
<li>Added Trainer simulator</li>
<li>Added Debug Output window</li>
<li>Various texts and translations corrections</li>
<li>Various small bug-fixes</li>
<li>More reliable method of writing EEPROM.BIN and FIRMWARE.BIN to radio</li>
<li>Fixed issue with Edge function INSTANT for V1>2s</li>
<li>Fixed buffer overflow in Joystick code</li>
</ul>
<h2>Version 2.0.13 / 2014-11-20</h2>
<ul>
<li>Too many curves shown on non ARM boards</li>
<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 +338,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>
+47 -75
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "2" )
SET( C9X_VERSION_REVISION "20" )
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
@@ -33,11 +33,12 @@ IF ( SDL_FOUND )
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS( -DJOYSTICKS )
ADD_DEFINITIONS( -DSIMU_AUDIO )
ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled" )
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
ENDIF()
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
@@ -88,9 +89,9 @@ add_custom_command(
)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/stamp-opentx.h
COMMAND make stamp_header
DEPENDS ${RADIO_SRC_DIRECTORY}/Makefile
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
COMMAND make PCB=TARANIS lua_exports.cpp
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
@@ -106,6 +107,7 @@ include_directories(
add_subdirectory(modeledit)
add_subdirectory(simulation)
add_subdirectory(qcustomplot)
set(common_SRCS
eeprominterface.cpp
@@ -114,11 +116,12 @@ 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
${RADIO_SRC_DIRECTORY}/lua_exports.inc
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
@@ -130,15 +133,10 @@ set(common_SRCS
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})
@@ -147,12 +145,11 @@ set(companion_SRCS
flashinterface.cpp
# xmlinterface.cpp
# ${PROJECT_BINARY_DIR}/radio.cxx
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
helpers.cpp
mdichild.cpp
generaledit.cpp
modelslist.cpp
mountlist.cpp
mountlist.cpp
avroutputdialog.cpp
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
@@ -169,7 +166,6 @@ set(companion_SRCS
mainwindow.cpp
companion.cpp
radionotfound.cpp
qcustomplot.cpp
wizarddata.cpp
wizarddialog.cpp
)
@@ -194,12 +190,11 @@ set(companion_MOC_HDRS
mdichild.h
mainwindow.h
radionotfound.h
qcustomplot.h
qautocombobox.h
helpers.h
wizarddialog.h
)
set(companion_UIS
mdichild.ui
avroutputdialog.ui
@@ -255,8 +250,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 )
@@ -283,48 +276,21 @@ QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
ADD_EXECUTABLE(companion MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
ELSE( )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ADD_EXECUTABLE(companion WIN32 ${companion_SRCS} ${companion_QM})
ENDIF( )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
target_link_libraries(companion modeledit simulation common qcustomplot ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
############# Standalone simu ###############
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
${RADIO_SRC_DIRECTORY}/lua_exports.inc
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})
############# 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,20 +340,20 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF( WIN32 )
IF( MSVC )
SET( NSI_IN_FILE companion-vs.nsi.in )
SET( NSI_IN_FILE companion-vs.nsi.in )
ELSE( )
SET( NSI_IN_FILE companion-msys.nsi.in )
ENDIF( )
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
@@ -405,21 +372,20 @@ IF( APPLE )
ELSE( )
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
ENDIF()
ADD_CUSTOM_TARGET( addframeworks ALL
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${PROJECT_NAME} )
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
@@ -428,12 +394,18 @@ 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
IF(WIN32)
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ELSE( )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ENDIF( )
SET(CPACK_PACKAGE_NAME "COMPANION")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
@@ -447,7 +419,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 +430,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)
+72 -23
View File
@@ -1,6 +1,6 @@
/*
* Author - Kjell Kernen
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@@ -20,7 +20,7 @@ AppData g;
// ** CompStoreObj class********************
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (tag2.isEmpty())
{
settings.remove(tag1);
@@ -43,7 +43,7 @@ void CompStoreObj::clear (const QString tag1, const QString tag2, const QString
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -56,7 +56,7 @@ void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QSt
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -69,7 +69,7 @@ void CompStoreObj::store(const QStringList newSList, QStringList &stringList, co
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -82,7 +82,7 @@ void CompStoreObj::store(const QString newString, QString &string, const QString
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -95,7 +95,7 @@ void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, co
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -109,7 +109,7 @@ void CompStoreObj::store(const int newNumber, int &number, const QString tag, co
// Retrieval functions
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -121,7 +121,7 @@ void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -133,7 +133,7 @@ void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const Q
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -145,7 +145,7 @@ void CompStoreObj::retrieve( QString &string, const QString tag, const QString d
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -157,7 +157,7 @@ void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, con
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
@@ -241,7 +241,7 @@ JStickData::JStickData()
void JStickData::remove()
{
// Remove all JStickData values from settings file
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup( "JsCalibration" );
settings.remove( QString( "stick%1_axe").arg(index) );
settings.remove( QString( "stick%1_min").arg(index) );
@@ -256,7 +256,7 @@ void JStickData::remove()
bool JStickData::existsOnDisk()
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("JsCalibration");
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
settings.endGroup();
@@ -295,8 +295,11 @@ QString Profile::fwName() const { return _fwName; }
QString Profile::fwType() const { return _fwType; }
QString Profile::name() const { return _name; }
QString Profile::sdPath() const { return _sdPath; }
int Profile::volumeGain() const { return _volumeGain; }
QString Profile::pBackupDir() const { return _pBackupDir; }
QString Profile::splashFile() const { return _splashFile; }
bool Profile::burnFirmware() const { return _burnFirmware; }
bool Profile::penableBackup() const { return _penableBackup; }
bool Profile::renameFwFiles() const { return _renameFwFiles; }
int Profile::channelOrder() const { return _channelOrder; }
int Profile::defaultMode() const { return _defaultMode; }
@@ -313,6 +316,8 @@ int Profile::currentCalib() const { return _currentCalib; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
int Profile::vBatCalib() const { return _vBatCalib; }
int Profile::vBatMin() const { return _vBatMin; }
int Profile::vBatMax() const { return _vBatMax; }
int Profile::vBatWarn() const { return _vBatWarn; }
// Set declarations
@@ -320,9 +325,12 @@ void Profile::name (const QString x) { store(x, _name, "Name"
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
void Profile::volumeGain (const int x) { store(x, _volumeGain, "volumeGain" ,"Profiles", QString("profile%1").arg(index));}
void Profile::pBackupDir (const QString x) { store(x, _pBackupDir, "pBackupDir" ,"Profiles", QString("profile%1").arg(index));}
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
void Profile::penableBackup (const bool x) { store(x, _penableBackup, "penableBackup" ,"Profiles", QString("profile%1").arg(index));}
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
@@ -338,6 +346,8 @@ void Profile::currentCalib (const int x) { store(x, _currentCalib, "curren
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
// Constructor
@@ -346,16 +356,19 @@ Profile::Profile()
index = -1;
}
// The default copy operator can not be used since the index variable would be destroyed
// The default copy operator can not be used since the index variable would be destroyed
Profile& Profile::operator=(const Profile& rhs)
{
name ( rhs.name() );
fwName ( rhs.fwName() );
fwType ( rhs.fwType() );
sdPath ( rhs.sdPath() );
volumeGain ( rhs.volumeGain() );
pBackupDir ( rhs.pBackupDir() );
splashFile ( rhs.splashFile() );
burnFirmware ( rhs.burnFirmware() );
renameFwFiles( rhs.renameFwFiles() );
penableBackup( rhs.penableBackup() );
channelOrder ( rhs.channelOrder() );
defaultMode ( rhs.defaultMode() );
beeper ( rhs.beeper() );
@@ -369,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
vBatCalib ( rhs.vBatCalib() );
vBatMin ( rhs.vBatMin() );
vBatMax ( rhs.vBatMax() );
vBatWarn ( rhs.vBatWarn() );
return *this;
@@ -377,7 +392,7 @@ Profile& Profile::operator=(const Profile& rhs)
void Profile::remove()
{
// Remove all profile values from settings file
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("Profiles");
settings.remove(QString("profile%1").arg(index));
settings.endGroup();
@@ -388,7 +403,7 @@ void Profile::remove()
bool Profile::existsOnDisk()
{
QSettings settings(PRODUCT, COMPANY);
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("Profiles");
settings.beginGroup(QString("profile%1").arg(index));
QStringList keyList = settings.allKeys();
@@ -413,6 +428,8 @@ void Profile::initFwVariables()
_gsStickMode = 0;
_ppmMultiplier = 0;
_vBatCalib = 0;
_vBatMin = 0;
_vBatMax = 0;
_vBatWarn = 0;
}
@@ -424,9 +441,12 @@ void Profile::init(int newIndex)
_fwType = "";
_name = "";
_sdPath = "";
_volumeGain = 10;
_pBackupDir = "";
_splashFile = "";
_burnFirmware = false;
_renameFwFiles = false;
_penableBackup = false;
_channelOrder = 0;
_defaultMode = 1;
@@ -446,8 +466,11 @@ void Profile::flush()
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _volumeGain, "volumeGain" ,10 ,"Profiles", QString("profile%1").arg(index));
getset( _pBackupDir, "pBackupDir" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _penableBackup, "penableBackup" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
@@ -464,6 +487,8 @@ void Profile::flush()
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
}
@@ -499,6 +524,7 @@ QString AppData::snapshotDir() { return _snapshotDir; }
QString AppData::updatesDir() { return _updatesDir; }
bool AppData::enableBackup() { return _enableBackup; }
bool AppData::checkHardwareCompatibility() { return _checkHardwareCompatibility; }
bool AppData::backupOnFlash() { return _backupOnFlash; }
bool AppData::jsSupport() { return _jsSupport; }
bool AppData::maximized() { return _maximized; }
@@ -550,6 +576,7 @@ void AppData::updatesDir (const QString x) { store(x, _updatesDir,
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
void AppData::checkHardwareCompatibility(const bool x) { store(x, _checkHardwareCompatibility, "checkHardwareCompatibility");}
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
@@ -581,11 +608,29 @@ AppData::AppData()
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
// Import settings from companion9x, but only do it one time.
QSettings c9x_settings("companion9x", "companion9x");
QSettings settings(PRODUCT, COMPANY);
if (profile[0].name().isEmpty() )
// Move existing 2.0 settings if present
QSettings settings(COMPANY, PRODUCT);
if (profile[0].name().isEmpty())
{
QSettings pre2016settings("OpenTX", "OpenTX Companion");
QStringList keys = pre2016settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
settings.setValue(*i, pre2016settings.value(*i));
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
pre2016settings.clear();
}
// Else import settings from companion9x if present
if (profile[0].name().isEmpty())
{
QSettings c9x_settings("companion9x", "companion9x");
// Copy all settings from companion9x to companion
QStringList keys = c9x_settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
@@ -629,10 +674,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 );
}
@@ -642,7 +690,7 @@ AppData::AppData()
// Load and store all variables. Use default values if setting values are missing
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"20" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _tempString, "settings_version" ,"201" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
@@ -672,6 +720,7 @@ AppData::AppData()
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _enableBackup, "backupEnable" ,false );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility", true );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _jsSupport, "js_support" ,false );
getset( _maximized, "maximized" ,false );
+24 -6
View File
@@ -1,6 +1,6 @@
/*
* Author - Kjell Kernen
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@@ -12,7 +12,7 @@
*
*/
// All temporary and permanent global variables are defined here to make
// All temporary and permanent global variables are defined here to make
// initialization and storage safe and visible.
// Do not access variables in QSettings directly, it is not type safe!
@@ -24,8 +24,8 @@
#include <QString>
#include <QSettings>
#define COMPANY "OpenTX Companion"
#define PRODUCT "OpenTX"
#define COMPANY "OpenTX"
#define PRODUCT "Companion 2.0"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
@@ -53,7 +53,7 @@ class CompStoreObj
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
};
};
class FwRevision: protected CompStoreObj
{
@@ -107,8 +107,11 @@ class Profile: protected CompStoreObj
QString _fwType;
QString _name;
QString _sdPath;
int _volumeGain;
QString _pBackupDir;
QString _splashFile;
bool _burnFirmware;
bool _penableBackup;
bool _renameFwFiles;
int _channelOrder;
int _defaultMode;
@@ -126,6 +129,8 @@ class Profile: protected CompStoreObj
int _gsStickMode;
int _ppmMultiplier;
int _vBatCalib;
int _vBatMin;
int _vBatMax;
int _vBatWarn;
public:
@@ -134,9 +139,12 @@ class Profile: protected CompStoreObj
QString fwType() const;
QString name() const;
QString sdPath() const;
int volumeGain() const;
QString pBackupDir() const;
QString splashFile() const;
bool burnFirmware() const;
bool renameFwFiles() const;
bool penableBackup() const;
int channelOrder() const;
int defaultMode() const;
@@ -152,16 +160,21 @@ class Profile: protected CompStoreObj
int gsStickMode() const;
int ppmMultiplier() const;
int vBatCalib() const;
int vBatMin() const;
int vBatMax() const;
int vBatWarn() const;
// All the set definitions
void name (const QString);
void fwName (const QString);
void fwType (const QString);
void volumeGain (const int);
void sdPath (const QString);
void pBackupDir (const QString);
void splashFile (const QString);
void burnFirmware (const bool);
void renameFwFiles (const bool);
void penableBackup (const bool);
void channelOrder (const int);
void defaultMode (const int);
@@ -177,6 +190,8 @@ class Profile: protected CompStoreObj
void gsStickMode (const int);
void ppmMultiplier (const int);
void vBatCalib (const int);
void vBatMin (const int);
void vBatMax (const int);
void vBatWarn (const int);
Profile();
@@ -226,6 +241,7 @@ class AppData: protected CompStoreObj
bool _enableBackup;
bool _backupOnFlash;
bool _checkHardwareCompatibility;
bool _maximized;
bool _jsSupport;
bool _showSplash;
@@ -259,7 +275,7 @@ class AppData: protected CompStoreObj
QString avrdudeLocation();
QString dfuArguments();
QString dfuLocation();
QString lastFw();
QString lastFw();
QString locale();
QString mcu();
QString programmer();
@@ -278,6 +294,7 @@ class AppData: protected CompStoreObj
bool enableBackup();
bool backupOnFlash();
bool checkHardwareCompatibility();
bool jsSupport();
bool maximized();
bool showSplash();
@@ -329,6 +346,7 @@ class AppData: protected CompStoreObj
void enableBackup (const bool);
void backupOnFlash (const bool);
void checkHardwareCompatibility (const bool);
void maximized (const bool);
void jsSupport (const bool);
void showSplash (const bool);
+82 -99
View File
@@ -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());
@@ -189,13 +202,12 @@ void AppPreferencesDialog::initSettings()
foreach(FirmwareInterface * 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()
@@ -267,8 +288,9 @@ void AppPreferencesDialog::on_joystickChkB_clicked() {
}
}
void AppPreferencesDialog::on_joystickcalButton_clicked() {
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
void AppPreferencesDialog::on_joystickcalButton_clicked()
{
JoystickDialog *jd = new JoystickDialog(this, ui->joystickCB->currentIndex());
jd->exec();
}
#endif
@@ -333,7 +355,8 @@ void AppPreferencesDialog::on_SplashSelect_clicked()
}
}
void AppPreferencesDialog::on_clearImageButton_clicked() {
void AppPreferencesDialog::on_clearImageButton_clicked()
{
ui->imageLabel->clear();
ui->SplashFileName->clear();
}
@@ -341,65 +364,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) {
if (firmware->getId() == selected_firmware) {
showVoice(firmware->voice);
populateFirmwareOptions(firmware);
break;
}
}
firmwareChanged();
}
FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
FirmwareInterface * AppPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
bool voice=false;
foreach(FirmwareInterface * 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,6 +413,9 @@ FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
void AppPreferencesDialog::firmwareOptionChanged(bool state)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
if (cb == voice) {
showVoice(voice->isChecked());
}
FirmwareInterface * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
@@ -421,76 +427,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()
{
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 FirmwareInterface * 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 +468,9 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
optionsCheckBoxes.push_back(checkbox);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
if (prevFocus) {
QWidget::setTabOrder(prevFocus, checkbox);
}
}
QCheckBox *cb = optionsCheckBoxes.at(index++);
@@ -505,21 +478,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()));
}
+3 -4
View File
@@ -28,7 +28,7 @@ class AppPreferencesDialog : public QDialog
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const FirmwareInterface *);
FirmwareVariant getFirmwareVariant();
FirmwareInterface * 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
+4 -7
View File
@@ -3,7 +3,6 @@
#include <QtGui>
#include "eeprominterface.h"
#include "flashinterface.h"
#include "googleanalytics.h"
#if defined WIN32 || !defined __GNUC__
#include <Windows.h>
@@ -94,8 +93,6 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
process->start(prog,arg);
}
}
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
}
# if !__GNUC__
@@ -141,9 +138,9 @@ void avrOutputDialog::doCopy()
if (source.open(QIODevice::ReadOnly)) {
QFile dest(destFile);
if (dest.open(QIODevice::WriteOnly)) {
if (dest.open(QIODevice::ReadWrite)) {
addText(tr("Writing file: "));
for (int i=0; i<blocks; i++) {
addText(tr("Writing file: "));
int read = source.read(buf, BLKSIZE);
if (dest.write(buf, read) == read) {
dest.flush();
@@ -159,11 +156,11 @@ void avrOutputDialog::doCopy()
dest.close();
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.fileName() + ", " + tr("reason") + ": " + dest.errorString());
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.fileName() + ", " + tr("reason") + ": " + source.errorString());
}
source.close();
+2 -4
View File
@@ -354,10 +354,8 @@ void burnConfigDialog::restFuses(bool eeProtect)
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
else {
QString tempDir = QDir::tempPath();
QString tempFile;
QString lfuses;
tempFile = tempDir + "/ftemp.bin";
QString tempFile = generateProcessUniqueTempFileName("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);
@@ -376,7 +374,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
lfuses="lfuse:w:0x3F:m";
}
file.close();
unlink(tempFile.toAscii());
qunlink(tempFile);
}
else {
lfuses="lfuse:w:0x3F:m";
+9 -1
View File
@@ -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>
+32 -28
View File
@@ -42,6 +42,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->hide();
}
ui->checkFirmwareCB->setChecked(g.checkHardwareCompatibility());
}
else {
ui->FlashLoadButton->setText(tr("Browse for file"));
@@ -49,6 +50,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
ui->EEpromCB->hide();
ui->checkFirmwareCB->hide();
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
@@ -106,7 +108,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
}
}
ui->FWFileName->hide();
ui->FlashLoadButton->hide();
ui->FlashLoadButton->hide();
hexfileName->clear();
}
else if (Type==FLASH_FILE_TYPE) {
@@ -166,7 +168,7 @@ void burnDialog::on_FlashLoadButton_clicked()
ui->patchcalib_CB->setChecked(false);
ui->patchhw_CB->setChecked(false);
ui->patchhw_CB->hide();
ui->patchcalib_CB->hide();
ui->patchcalib_CB->hide();
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
@@ -203,7 +205,7 @@ void burnDialog::checkFw(QString fileName)
}
else {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
}
}
ui->BurnFlashButton->setEnabled(true);
QTimer::singleShot(0, this, SLOT(shrink()));
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
@@ -236,16 +238,17 @@ bool burnDialog::checkeEprom(QString fileName)
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (!LoadEepromXml(radioData, doc)){
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
if (!errors.test(NO_ERROR)) {
return false;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
QString hline = inputStream.readLine();
@@ -266,7 +269,9 @@ bool burnDialog::checkeEprom(QString fileName)
return true;
}
file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
if (!errors.test(NO_ERROR)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
@@ -290,7 +295,9 @@ bool burnDialog::checkeEprom(QString fileName)
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
if (!errors.test(NO_ERROR)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
@@ -327,7 +334,7 @@ void burnDialog::updateUI()
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
displaySplash();
}
@@ -382,7 +389,7 @@ void burnDialog::on_useAnotherImageCB_clicked()
else{
imageSource = ANOTHER;
imageFile = fileName;
}
}
}
updateUI();
}
@@ -408,6 +415,7 @@ void burnDialog::on_useLibraryImageCB_clicked()
void burnDialog::on_BurnFlashButton_clicked()
{
if (hexType==FLASH_FILE_TYPE) {
g.checkHardwareCompatibility(ui->checkFirmwareCB->isChecked());
QString fileName=ui->FWFileName->text();
if (!fileName.isEmpty()) {
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
@@ -418,12 +426,12 @@ void burnDialog::on_BurnFlashButton_clicked()
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";
tempFile = generateProcessUniqueTempFileName("flash.hex");
else
tempFile = tempDir + "/flash.bin";
tempFile = generateProcessUniqueTempFileName("flash.bin");
qDebug() << "burnDialog::on_BurnFlashButton_clicked(): patching" << fileName << "with custom splash screen and saving to" << tempFile;
FlashInterface flash(fileName);
flash.setSplash(image);
if (flash.saveFlash(tempFile) > 0) {
@@ -447,7 +455,7 @@ void burnDialog::on_BurnFlashButton_clicked()
}
else {
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
hexfileName->clear();
hexfileName->clear();
}
}
@@ -460,7 +468,7 @@ void burnDialog::on_BurnFlashButton_clicked()
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
QString DisplaySet= g.profile[g.id()].display();
QString BeeperSet= g.profile[g.id()].beeper();
QString HapticSet= g.profile[g.id()].haptic();
@@ -554,17 +562,13 @@ void burnDialog::on_BurnFlashButton_clicked()
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";
QString fileName = generateProcessUniqueTempFileName("temp.bin");
QFile file(fileName);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = 0;
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant());
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()));
hexfileName->clear();
@@ -578,21 +582,21 @@ void burnDialog::on_BurnFlashButton_clicked()
QTextStream outputStream(&file);
long result = file.write((char*)eeprom, eeprom_size);
if (result!=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());
hexfileName->append(ui->FWFileName->text());
}
}
else {
hexfileName->clear();
hexfileName->append(ui->FWFileName->text());
hexfileName->append(ui->FWFileName->text());
}
}
this->close();
@@ -600,8 +604,8 @@ void burnDialog::on_BurnFlashButton_clicked()
void burnDialog::on_cancelButton_clicked()
{
hexfileName->clear();
this->close();
hexfileName->clear();
this->close();
}
void burnDialog::on_EEpromCB_toggled(bool checked)
+28 -11
View File
@@ -30,7 +30,7 @@
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="hs2">
@@ -76,6 +76,19 @@
</item>
</layout>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="5" column="0">
@@ -342,26 +355,29 @@
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QCheckBox" name="checkFirmwareCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
</property>
</spacer>
<property name="text">
<string>Check Firmware compatibility</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>BurnFlashButton</tabstop>
<tabstop>FWFileName</tabstop>
<tabstop>FlashLoadButton</tabstop>
<tabstop>versionField</tabstop>
<tabstop>ModField</tabstop>
<tabstop>DateField</tabstop>
<tabstop>useProfileImageCB</tabstop>
<tabstop>useFwImageCB</tabstop>
<tabstop>useLibraryImageCB</tabstop>
@@ -371,6 +387,7 @@
<tabstop>patchhw_CB</tabstop>
<tabstop>EEpromCB</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>BurnFlashButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
+6 -2
View File
@@ -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)
+8 -6
View File
@@ -8,13 +8,14 @@
# XSD_FOUND, If false, don't try to use xsd
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
"C:/Programs/xsd-3.3.0/libxsd"
"C:/Program Files/CodeSynthesis XSD 3.2/include"
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
$ENV{XSDDIR}/include
$ENV{CODESYNTH}/include
/usr/local/include /usr/include
/usr/local/include /usr/include
$ENV{XSDDIR}/libxsd
)
IF( WIN32 )
@@ -27,18 +28,19 @@ ENDIF( )
FIND_PROGRAM( XSDCXX_EXECUTABLE
NAMES
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
PATHS
PATHS
"/opt/local/xsd-3.3.0-i686-macosx/bin"
"C:/Programs/xsd-3.3.0/bin"
"C:/mingw/xsd-3.3.0-i686-windows/bin"
"C:/mingw/xsd-3.3.0-i686-windows/bin"
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
$ENV{XSDDIR}/xsd
)
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
# if the include and the program are found then we have it
IF( XSD_INCLUDE_DIR )
IF( XSDCXX_EXECUTABLE )
@@ -49,4 +51,4 @@ ENDIF( XSD_INCLUDE_DIR )
MARK_AS_ADVANCED(
XSD_INCLUDE_DIR
XSDCXX_EXECUTABLE
)
)
+34 -8
View File
@@ -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,37 @@ int main(int argc, char *argv[])
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant.id);
g.profile[g.id()].fwName("");
#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());
}
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
#endif
RegisterEepromInterfaces();
registerOpenTxFirmwares();
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
g.profile[g.id()].fwName("");
}
QString splashScreen;
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splasht.png";
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splashp.png";
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splashr.png";
else splashScreen = ":/images/splash.png";
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
MainWindow *mainWin = new MainWindow();
if (g.showSplash()) {
@@ -128,5 +150,9 @@ int main(int argc, char *argv[])
UnregisterFirmwares();
UnregisterEepromInterfaces();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
#endif
return result;
}
+2
View File
@@ -40,6 +40,8 @@
<file>images/9xcursphoto.png</file>
<file>images/screenshot.png</file>
<file>images/splash.png</file>
<file>images/splashp.png</file>
<file>images/splashr.png</file>
<file>images/splasht.png</file>
<file>images/companion-title.png</file>
<file>images/maps.png</file>
+245 -160
View File
@@ -24,8 +24,9 @@ public:
uint8_t models[C9X_MAX_MODELS];
};
CompareDialog::CompareDialog(QWidget * parent):
CompareDialog::CompareDialog(QWidget * parent, FirmwareInterface * firmware):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
firmware(firmware),
model1(0),
model2(0),
ui(new Ui::CompareDialog)
@@ -75,6 +76,8 @@ void CompareDialog::dragLeaveEvent(QDragLeaveEvent *event)
void CompareDialog::printDiff()
{
te->clear();
curvefile1=generateProcessUniqueTempFileName("curve1.png");
curvefile2=generateProcessUniqueTempFileName("curve2.png");
printSetup();
if (GetCurrentFirmware()->getCapability(FlightModes)) {
printPhases();
@@ -156,16 +159,12 @@ 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(curvefile1);
delete ui;
}
@@ -254,19 +253,26 @@ 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]));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
}
str.append(fv(tr("Protocol"), getProtocol(g_model1->moduleData[0]),color));
if (firmware->getCapability(NumModules)>1) {
color=getColor1(getProtocol(g_model1->moduleData[1]),getProtocol(g_model2->moduleData[1]));
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model1->moduleData[1]),color));
}
if (IS_TARANIS(firmware->getBoard())){
color=getColor1(getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]));
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),color));
}
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor1(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 +283,26 @@ 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]));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
}
str.append(fv(tr("Protocol"), getProtocol(g_model2->moduleData[0]),color));
if (firmware->getCapability(NumModules)>1) {
color=getColor2(getProtocol(g_model1->moduleData[1]),getProtocol(g_model2->moduleData[1]));
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model2->moduleData[1]),color));
}
if (IS_TARANIS(firmware->getBoard())){
color=getColor2(getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]));
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]),color));
}
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor2(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);
}
@@ -310,8 +323,8 @@ 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));
@@ -333,32 +346,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;\">&nbsp;</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 +367,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>");
@@ -412,8 +412,8 @@ 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=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 +436,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;\">&nbsp;</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 +456,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 +519,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 +546,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 +562,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 +586,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 +668,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 {
@@ -751,7 +746,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 +816,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("<", "&lt;").replace(">", "&gt;");
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 +844,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 +894,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("<", "&lt;").replace(">", "&gt;"));
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 +922,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 +951,176 @@ void CompareDialog::printMixers()
void CompareDialog::printCurves()
{
#if 0
int i,r,g,b,c;
int i,r,g,b,c,count1,count2,usedcurves=0;
QString cm1y,cm1x, cm2y,cm2x;
char buffer [16];
QString color;
QColor * qplot_color[8];
qplot_color[0]=new QColor(0,0,127);
qplot_color[1]=new QColor(0,127,0);
qplot_color[2]=new QColor(127,0,0);
qplot_color[3]=new QColor(127,127,0);
qplot_color[4]=new QColor(0,0,255);
qplot_color[5]=new QColor(0,255,0);
qplot_color[6]=new QColor(255,0,0);
qplot_color[7]=new QColor(255,255,0);
QPen pen(Qt::black, 2, Qt::SolidLine);
int numcurves=firmware->getCapability(NumCurves);
if (numcurves==0) {
numcurves=16;
}
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Curves"));
str.append("</h2></td></tr><tr><td>");
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=11><b>"+tr("5 Point Curves")+"</b></td></tr><tr>");
for(i=0; i<5; i++)
str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("<td></td>");
for(i=0; i<5; i++)
str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("</tr>");
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">");
QImage qi1(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
QPainter painter1(&qi1);
QImage qi2(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
QPainter painter2(&qi2);
painter1.setBrush(QBrush("#FFFFFF"));
painter2.setBrush(QBrush("#FFFFFF"));
painter1.setPen(QColor(0,0,0));
painter2.setPen(QColor(0,0,0));
painter1.drawRect(0,0,ISIZE,ISIZE);
painter2.drawRect(0,0,ISIZE,ISIZE);
for(i=0; i<numcurves; i++) {
count1=0;
for(int j=0; j<g_model1->curves[i].count; j++) {
if (g_model1->curves[i].points[j].y!=0)
count1++;
}
count2=0;
for(int j=0; j<g_model2->curves[i].count; j++) {
if (g_model2->curves[i].points[j].y!=0)
count2++;
}
if ((count1>0) || (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model1->curves[i].count !=5) ||
(count2>0) || (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model2->curves[i].count !=5)) {
pen.setColor(colors[usedcurves]);
painter1.setPen(pen);
painter2.setPen(pen);
for(i=0; i<MAX_CURVE5; i++) {
qplot_color[i]->getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
str.append("<tr>");
for(int j=0; j<5; j++) {
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
}
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
for(int j=0; j<5; j++) {
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
str.append(doTR(QString::number(g_model2->curves5[i][j]),color));
}
str.append("</tr>");
}
str.append("</table></td></tr><tr><td>");
colors[usedcurves].getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
// curves are different in number of points or curve type so makes little sense to compare they are just different
if ((g_model1->curves[i].count!=g_model2->curves[i].count) || (g_model1->curves[i].type!=g_model2->curves[i].type)) {
cm1y="[";
cm1x="[";
for(int j=0; j<g_model1->curves[i].count; j++) {
cm1y.append(QString("%1").arg(g_model1->curves[i].points[j].y));
cm1x.append(QString("%1").arg(g_model1->curves[i].points[j].x));
if (j<(g_model1->curves[i].count-1)) {
cm1y.append(",");
cm1x.append(",");
}
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
else
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
}
cm1y.append("]");
cm1x.append("]");
cm2y="[";
cm2x="[";
for(int j=0; j<g_model2->curves[i].count; j++) {
cm2y.append(QString("%1").arg(g_model2->curves[i].points[j].y));
cm2x.append(QString("%1").arg(g_model2->curves[i].points[j].x));
if (j<(g_model2->curves[i].count-1)) {
cm2y.append(",");
cm2x.append(",");
}
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
else
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
}
cm2y.append("]");
cm2x.append("]");
str.append("<tr><td nowrap width=\"45%\"><font color=green>");
str.append(cm1y);
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
str.append(QString("<br>")+cm1x+QString("</font></td>"));
}
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
str.append("<td nowrap width=\"45%\"><font color=red>");
str.append(cm2y);
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
str.append(QString("<br>")+cm2x+QString("</font></td></tr>"));
}
} else {
// curves have the same number of points and the same type, we can compare them point by point
cm1y="[";
cm1x="[";
cm2y="[";
cm2x="[";
for(int j=0; j<g_model1->curves[i].count; j++) {
if (g_model1->curves[i].points[j].y!=g_model2->curves[i].points[j].y) {
cm1y.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].y));
cm2y.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].y));
} else {
cm1y.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].y));
cm2y.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].y));
}
if (g_model1->curves[i].points[j].x!=g_model2->curves[i].points[j].x) {
cm1x.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].x));
cm2x.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].x));
} else {
cm1x.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].x));
cm2x.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].x));
}
if (j<(g_model1->curves[i].count-1)) {
cm1y.append(",");
cm1x.append(",");
cm2y.append(",");
cm2x.append(",");
}
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
else
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
else
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
}
painter1.setPen(QColor(0,0,0));
painter2.setPen(QColor(0,0,0));
painter1.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
painter2.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
painter1.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
painter2.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
for(int k=0; k<21; k++) {
painter1.drawLine(ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5,(ISIZE*k)/(20));
painter2.drawLine(ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5,(ISIZE*k)/(20));
painter1.drawLine((ISIZE*k)/(20),ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5);
painter2.drawLine((ISIZE*k)/(20),ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5);
}
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=19><b>"+tr("9 Point Curves")+"</b></td></tr><tr>");
for(i=0; i<9; i++)
str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("<td></td>");
for(i=0; i<9; i++)
str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("</tr>");
for(i=0; i<MAX_CURVE9; i++) {
qplot_color[i]->getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
str.append("<tr>");
for(int j=0; j<9; j++) {
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
cm1y.append("]");
cm1x.append("]");
cm2y.append("]");
cm2x.append("]");
str.append("<tr><td nowrap width=\"45%\">");
str.append(cm1y);
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
str.append(QString("<br>")+cm1x+QString("</td>"));
}
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
str.append("<td nowrap width=\"45%\">");
str.append(cm2y);
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
str.append(QString("<br>")+cm2x+QString("</td></tr>"));
}
}
usedcurves++;
}
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1+MAX_CURVE5));
for(int j=0; j<9; j++) {
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
str.append(doTR(QString::number(g_model2->curves9[i][j]),color));
}
str.append("</tr>");
}
str.append("</table></td></tr></table>");
te->append(str);
#endif
if (usedcurves>0) {
str.append(QString("<tr><td width=45 align=center><img src=\"%1\" border=0></td><td>&nbsp;</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 +1131,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->customSw[i].toString(*g_model1, settings);
QString sw2 = g_model2->customSw[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>");
@@ -1088,7 +1173,7 @@ void CompareDialog::printFSwitches()
for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
{
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param) || (g_model1->funcSw[i].enabled != g_model2->funcSw[i].enabled) || (g_model1->funcSw[i].repeatParam != g_model2->funcSw[i].repeatParam)) {
color1="green";
color2="red";
} else {
+5 -3
View File
@@ -15,10 +15,12 @@ class CompareDialog : public QDialog
Q_OBJECT
public:
CompareDialog(QWidget *parent);
CompareDialog(QWidget *parent, FirmwareInterface * firmware);
~CompareDialog();
FirmwareInterface * firmware;
protected:
GeneralSettings * settings;
ModelData * g_model1;
ModelData * g_model2;
ModelData * modeltemp;
@@ -63,8 +65,8 @@ class CompareDialog : public QDialog
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
QTextEdit * te;
QString curvefile5;
QString curvefile9;
QString curvefile1;
QString curvefile2;
QDir *qd;
private slots:
+2
View File
@@ -85,6 +85,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
QFile file(":/releasenotes.txt");
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
ui->textEditor->setHtml(file.readAll());
ui->textEditor->setOpenExternalLinks(true);
}
ui->textEditor->scroll(0,0);
setWindowTitle(tr("Companion Release Notes"));
@@ -124,6 +125,7 @@ contributorsDialog::~contributorsDialog()
void contributorsDialog::replyFinished(QNetworkReply * reply)
{
ui->textEditor->setHtml(reply->readAll());
ui->textEditor->setOpenExternalLinks(true);
}
void contributorsDialog::forceClose()
+1 -1
View File
@@ -15,7 +15,7 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="textEditor">
<widget class="QTextBrowser" name="textEditor">
<property name="readOnly">
<bool>true</bool>
</property>
+18 -5
View File
@@ -505,7 +505,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 +520,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 +547,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 +661,7 @@ class ConversionField: public TransformedField {
if (table->exportValue(_field, _field))
return;
if (!error.isEmpty())
EEPROMWarnings += error + "\n";
EEPROMWarnings.push_back(error);
}
if (shift) {
+335 -181
View File
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <list>
#include <float.h>
#include "eeprominterface.h"
#include "firmwares/er9x/er9xinterface.h"
#include "firmwares/th9x/th9xinterface.h"
@@ -11,7 +12,7 @@
#include "helpers.h"
#include "wizarddata.h"
QString EEPROMWarnings;
std::list<QString> EEPROMWarnings;
const char * switches9X[] = { "3POS", "THR", "RUD", "ELE", "AIL", "GEA", "TRN" };
const char * switchesX9D[] = { "SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH" };
@@ -91,11 +92,13 @@ QString getGVarString(int16_t val, bool sign)
}
}
RawSourceRange RawSource::getRange(bool singleprec)
RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags) const
{
RawSourceRange result;
int board = GetEepromInterface()->getBoard();
FirmwareInterface * firmware = GetCurrentFirmware();
int board = firmware->getBoard();
bool singleprec = (flags & RANGE_SINGLE_PRECISION);
if (!singleprec && !IS_ARM(board)) {
singleprec = true;
@@ -103,11 +106,16 @@ RawSourceRange RawSource::getRange(bool singleprec)
switch (type) {
case SOURCE_TYPE_TELEMETRY:
if (singleprec) {
result.offset = -DBL_MAX;
}
switch (index) {
case TELEMETRY_SOURCE_TX_BATT:
result.step = 0.1;
result.decimals = 1;
result.max = 25.5;
result.unit = QObject::tr("V");
break;
case TELEMETRY_SOURCE_TX_TIME:
result.step = 1;
@@ -116,34 +124,42 @@ RawSourceRange RawSource::getRange(bool singleprec)
case TELEMETRY_SOURCE_TIMER1:
case TELEMETRY_SOURCE_TIMER2:
result.step = singleprec ? 5 : 1;
result.max = singleprec ? 255*5 : 7200;
result.max = singleprec ? 255*5 : 60*60;
result.unit = QObject::tr("s");
break;
case TELEMETRY_SOURCE_RSSI_TX:
case TELEMETRY_SOURCE_RSSI_RX:
result.max = 100;
if (singleprec) result.offset = 128;
break;
case TELEMETRY_SOURCE_A1_MIN:
case TELEMETRY_SOURCE_A2_MIN:
case TELEMETRY_SOURCE_A3_MIN:
case TELEMETRY_SOURCE_A4_MIN:
result = model.frsky.channels[index-TELEMETRY_SOURCE_A1_MIN].getRange();
break;
case TELEMETRY_SOURCE_A1:
case TELEMETRY_SOURCE_A2:
case TELEMETRY_SOURCE_A3:
case TELEMETRY_SOURCE_A4:
if (model) {
const FrSkyChannelData & channel = model->frsky.channels[index-TELEMETRY_SOURCE_A1];
float ratio = channel.getRatio();
if (channel.type==0 || channel.type==1 || channel.type==2)
result.decimals = 2;
else
result.decimals = 0;
result.step = ratio / 255;
result.min = channel.offset * result.step;
result.max = ratio + result.min;
}
result = model.frsky.channels[index-TELEMETRY_SOURCE_A1].getRange();
break;
case TELEMETRY_SOURCE_ALT:
case TELEMETRY_SOURCE_ALT_MIN:
case TELEMETRY_SOURCE_ALT_MAX:
case TELEMETRY_SOURCE_GPS_ALT:
result.step = singleprec ? 8 : 1;
result.min = -500;
result.max = singleprec ? 1540 : 3000;
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step = (result.step * 105) / 32;
result.min = (result.min * 105) / 32;
result.max = (result.max * 105) / 32;
result.unit = QObject::tr("ft");
}
else {
result.unit = QObject::tr("m");
}
break;
case TELEMETRY_SOURCE_T1:
case TELEMETRY_SOURCE_T1_MAX:
@@ -151,89 +167,155 @@ RawSourceRange RawSource::getRange(bool singleprec)
case TELEMETRY_SOURCE_T2_MAX:
result.min = -30;
result.max = 225;
result.unit = QObject::trUtf8("°C");
break;
case TELEMETRY_SOURCE_HDG:
result.step = singleprec ? 2 : 1;
result.max = 360;
if (singleprec) result.offset = 256;
result.unit = QObject::trUtf8("°");
break;
case TELEMETRY_SOURCE_RPM:
case TELEMETRY_SOURCE_RPM_MAX:
result.step = singleprec ? 50 : 1;
result.max = singleprec ? 12750 : 20000;
result.max = singleprec ? 12750 : 30000;
break;
case TELEMETRY_SOURCE_FUEL:
result.max = 100;
result.unit = QObject::tr("%");
break;
case TELEMETRY_SOURCE_ASPEED:
case TELEMETRY_SOURCE_ASPEED_MAX:
result.decimals = 1;
result.step = singleprec ? 2.0 : 0.1;
result.max = singleprec ? (2*255) : 2000;
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step *= 1.150779;
result.max *= 1.150779;
result.unit = QObject::tr("mph");
}
else {
result.step *= 1.852;
result.max *= 1.852;
result.unit = QObject::tr("km/h");
}
break;
case TELEMETRY_SOURCE_SPEED:
case TELEMETRY_SOURCE_SPEED_MAX:
result.step = singleprec ? 4 : 1;
result.max = singleprec ? (4*236) : 2000;
if (model && !model->frsky.imperial) {
result.step = singleprec ? 2 : 1;
result.max = singleprec ? (2*255) : 2000;
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step *= 1.150779;
result.max *= 1.150779;
result.unit = QObject::tr("mph");
}
else {
result.step *= 1.852;
result.max *= 1.852;
result.unit = QObject::tr("km/h");
}
break;
case TELEMETRY_SOURCE_VERTICAL_SPEED:
result.step = 0.1;
result.min = -12.5;
result.max = 13.0;
result.min = singleprec ? -12.5 : -300.0;
result.max = singleprec ? 13.0 : 300.0;
result.decimals = 1;
result.unit = QObject::tr("m/s");
break;
case TELEMETRY_SOURCE_DTE:
result.max = 30000;
break;
case TELEMETRY_SOURCE_DIST:
case TELEMETRY_SOURCE_DIST_MAX:
result.step = singleprec ? 8 : 1;
result.max = singleprec ? 2040 : 10000;
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step = (result.step * 105) / 32;
result.min = (result.min * 105) / 32;
result.max = (result.max * 105) / 32;
result.unit = QObject::tr("ft");
}
else {
result.unit = QObject::tr("m");
}
break;
case TELEMETRY_SOURCE_CELL:
case TELEMETRY_SOURCE_CELL_MIN:
result.step = singleprec ? 0.02 : 0.01;
result.max = 5.1;
result.decimals = 2;
result.unit = QObject::tr("V");
break;
case TELEMETRY_SOURCE_CELLS_SUM:
case TELEMETRY_SOURCE_CELLS_MIN:
case TELEMETRY_SOURCE_VFAS:
case TELEMETRY_SOURCE_VFAS_MIN:
result.step = 0.1;
result.max = 25.5;
result.max = singleprec ? 25.5 : 100.0;
result.decimals = 1;
result.unit = QObject::tr("V");
break;
case TELEMETRY_SOURCE_CURRENT:
case TELEMETRY_SOURCE_CURRENT_MAX:
result.step = singleprec ? 0.5 : 0.1;
result.max = singleprec ? 127.5 : 200.0;
result.decimals = 1;
result.unit = QObject::tr("A");
break;
case TELEMETRY_SOURCE_CONSUMPTION:
result.step = singleprec ? 100 : 1;
result.max = singleprec ? 25500 : 10000;
result.max = singleprec ? 25500 : 30000;
result.unit = QObject::tr("mAh");
break;
case TELEMETRY_SOURCE_POWER:
case TELEMETRY_SOURCE_POWER_MAX:
result.step = singleprec ? 5 : 1;
result.max = singleprec ? 1275 : 2000;
result.unit = QObject::tr("W");
break;
case TELEMETRY_SOURCE_ACCX:
case TELEMETRY_SOURCE_ACCY:
case TELEMETRY_SOURCE_ACCZ:
result.step = 0.01;
result.decimals = 2;
result.max = 2.55;
result.max = singleprec ? 2.55 : 10.00;
result.min = singleprec ? 0 : -10.00;
result.unit = QObject::tr("g");
break;
default:
result.max = 125;
break;
}
if (singleprec && !result.offset) {
if (singleprec && result.offset==-DBL_MAX) {
result.offset = result.max - (127*result.step);
}
if (flags & (RANGE_DELTA_FUNCTION|RANGE_DELTA_ABS_FUNCTION)) {
if (singleprec) {
result.offset = 0;
result.min = result.step * -127;
result.max = result.step * 127;
}
else {
result.min = -result.max;
}
}
break;
default:
result.max = (model && model->extendedLimits ? 125 : 100);
result.min = - result.max;
case SOURCE_TYPE_GVAR:
result.max = 1024;
result.min = -result.max;
break;
default:
result.max = model.getChannelsMax(true);
result.min = -result.max;
break;
}
if (flags & RANGE_DELTA_ABS_FUNCTION) {
result.min = 0;
}
return result;
@@ -257,7 +339,7 @@ QString RotaryEncoderString(int index)
return CHECK_IN_ARRAY(rotary, index);
}
QString RawSource::toString()
QString RawSource::toString(const ModelData & model)
{
static const QString trims[] = {
QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA")
@@ -284,7 +366,7 @@ QString RawSource::toString()
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
QObject::tr("L31"), QObject::tr("L32")
};
if (index<0) {
return QObject::tr("----");
}
@@ -292,11 +374,13 @@ QString RawSource::toString()
case SOURCE_TYPE_VIRTUAL_INPUT:
{
QString result = QObject::tr("[I%1]").arg(index+1);
if (model && strlen(model->inputNames[index]) > 0) {
result += QString(model->inputNames[index]);
if (strlen(model.inputNames[index]) > 0) {
result += QString(model.inputNames[index]);
}
return result;
}
case SOURCE_TYPE_LUA_OUTPUT:
return QObject::tr("LUA%1%2").arg(index/16+1).arg(QChar('a'+index%16));
case SOURCE_TYPE_STICK:
return AnalogString(index);
case SOURCE_TYPE_TRIM:
@@ -318,7 +402,7 @@ QString RawSource::toString()
case SOURCE_TYPE_TELEMETRY:
return CHECK_IN_ARRAY(telemetry, index);
case SOURCE_TYPE_GVAR:
return QObject::tr("GV%1").arg(index+1);
return QObject::tr("GV%1").arg(index+1);
default:
return QObject::tr("----");
}
@@ -384,7 +468,7 @@ QString RawSwitch::toString()
};
static const QString timerModes[] = {
QObject::tr("OFF"), QObject::tr("ABS"),
QObject::tr("OFF"), QObject::tr("ON"),
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
};
@@ -459,6 +543,16 @@ CSFunctionFamily LogicalSwitchData::getFunctionFamily()
return LS_FAMILY_VCOMP;
}
unsigned int LogicalSwitchData::getRangeFlags()
{
if (func == LS_FN_DPOS)
return RANGE_DELTA_FUNCTION;
else if (func == LS_FN_DAPOS)
return RANGE_DELTA_ABS_FUNCTION;
else
return 0;
}
QString LogicalSwitchData::funcToString()
{
switch (func) {
@@ -509,7 +603,7 @@ QString LogicalSwitchData::funcToString()
}
}
QString LogicalSwitchData::toString(const ModelData & model)
QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettings & settings)
{
QString result = "";
@@ -530,11 +624,11 @@ QString LogicalSwitchData::toString(const ModelData & model)
result += QObject::tr("Timer(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2));
break;
case LS_FAMILY_VOFS: {
RawSource source = RawSource(val1, &model);
RawSourceRange range = source.getRange();
RawSource source = RawSource(val1);
RawSourceRange range = source.getRange(model, settings);
QString res;
if (val1)
res += source.toString();
res += source.toString(model);
else
res += "0";
res.remove(" ");
@@ -545,7 +639,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
else if (func == LS_FN_DPOS) result = "d(" + res + ")";
result += res;
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DAPOS || func == LS_FN_DPOS)
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DPOS || func == LS_FN_DAPOS)
result += " &gt; ";
else if (func == LS_FN_ANEG || func == LS_FN_VNEG)
result += " &lt; ";
@@ -577,7 +671,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
case LS_FAMILY_VCOMP:
if (val1)
result += RawSource(val1).toString();
result += RawSource(val1).toString(model);
else
result += "0";
switch (func) {
@@ -605,7 +699,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
break;
}
if (val2)
result += RawSource(val2).toString();
result += RawSource(val2).toString(model);
else
result += "0";
break;
@@ -626,97 +720,19 @@ QString LogicalSwitchData::toString(const ModelData & model)
return result;
}
#if 0
QStringList FuncSwData::toStringList()
void FuncSwData::clear()
{
QStringList result;
QStringList qs;
result << swtch.toString();
result << funcToString();
if (func < FuncInstantTrim) {
result << QString("%1").arg(param);
memset(this, 0, sizeof(FuncSwData));
if (!GetCurrentFirmware()->getCapability(SafetyChannelCustomFunction)) {
func = FuncTrainer;
}
else if (func==FuncPlaySound) {
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func==FuncPlayHaptic) {
qs << "0" << "1" << "2" << "3";
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func==FuncReset) {
qs.append( QObject::tr("Timer1"));
qs.append( QObject::tr("Timer2"));
qs.append( QObject::tr("All"));
qs.append( QObject::tr("Telemetry"));
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
RawSource item(param);
result << item.toString();
}
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
result << QString("%1").arg(param);
} else {
result << paramarm;
}
}
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
switch (adjustMode) {
case 0:
result << QObject::tr("Value ")+QString("%1").arg(param);
break;
case 1:
result << RawSource(param).toString();
break;
case 2:
result << RawSource(param).toString();
break;
case 3:
if (param==0) {
result << QObject::tr("Decr:")+QString(" -1");
}
else {
result << QObject::tr("Incr:")+QString(" +1");
}
break;
default:
break;
}
}
if (func==FuncPlaySound || func==FuncPlayHaptic || func==FuncPlayValue || func==FuncPlayPrompt || func==FuncPlayBoth || func==FuncBackgroundMusic) {
str.append(doTC(QString("%1").arg(g_model->funcSw[i].repeatParam),"green"));
} else {
str.append(doTC( "&nbsp;","green"));
}
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
str.append(doTC((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green"));
} else {
str.append(doTC( "---","green"));
}
return result;
}
#endif
QString FuncSwData::funcToString()
{
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
return QObject::tr("Safety %1").arg(RawSource(SOURCE_TYPE_CH, func).toString());
ModelData model;
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return QObject::tr("Trainer");
else if (func == FuncTrainerRUD)
@@ -745,8 +761,10 @@ QString FuncSwData::funcToString()
return QObject::tr("Play Both");
else if (func == FuncPlayValue)
return QObject::tr("Play Value");
else if (func == FuncPlayScript)
return QObject::tr("Play Script");
else if (func == FuncLogs)
return QObject::tr("Start Logs");
return QObject::tr("SD Logs");
else if (func == FuncVolume)
return QObject::tr("Volume");
else if (func == FuncBacklight)
@@ -795,7 +813,8 @@ QString FuncSwData::paramToString()
}
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
RawSource item(param);
return item.toString();
ModelData model;
return item.toString(model);
}
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
@@ -805,15 +824,16 @@ QString FuncSwData::paramToString()
}
}
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
ModelData model;
switch (adjustMode) {
case 0:
return QObject::tr("Value ")+QString("%1").arg(param);
break;
case 1:
return RawSource(param).toString();
return RawSource(param).toString(model);
break;
case 2:
return RawSource(param).toString();
return RawSource(param).toString(model);
break;
case 3:
if (param==0) {
@@ -841,6 +861,28 @@ QString FuncSwData::repeatToString()
}
}
QString LimitData::minToString()
{
return QString::number((qreal)min/10);
}
QString LimitData::maxToString()
{
return QString::number((qreal)max/10);
}
QString LimitData::offsetToString()
{
return QString::number((qreal)offset/10, 'f', 1);
}
void LimitData::clear()
{
memset(this, 0, sizeof(LimitData));
min = -1000;
max = +1000;
}
GeneralSettings::GeneralSettings()
{
memset(this, 0, sizeof(GeneralSettings));
@@ -993,6 +1035,29 @@ int GeneralSettings::getDefaultChannel(unsigned int stick) const
return -1;
}
float FrSkyChannelData::getRatio() const
{
if (type==0 || type==1 || type==2)
return float(ratio << multiplier) / 10.0;
else
return ratio << multiplier;
}
RawSourceRange FrSkyChannelData::getRange() const
{
RawSourceRange result;
float ratio = getRatio();
if (type==0 || type==1 || type==2)
result.decimals = 2;
else
result.decimals = 0;
result.step = ratio / 255;
result.min = offset * result.step;
result.max = ratio + result.min;
result.unit = QObject::tr("V");
return result;
}
void FrSkyData::clear()
{
memset(this, 0, sizeof(FrSkyData));
@@ -1015,13 +1080,6 @@ ModelData::ModelData(const ModelData & src)
ModelData & ModelData::operator = (const ModelData & src)
{
memcpy(this, &src, sizeof(ModelData));
for (int i=0; i<C9X_MAX_MIXERS; i++)
mixData[i].srcRaw.model = this;
for (int i=0; i<C9X_MAX_EXPOS; i++)
expoData[i].srcRaw.model = this;
swashRingData.collectiveSource.model = this;
return *this;
}
@@ -1045,14 +1103,34 @@ bool ModelData::isInputValid(const unsigned int idx) const
void ModelData::removeInput(const int idx)
{
unsigned int chn = expoData[idx].chn;
memmove(&expoData[idx], &expoData[idx+1], (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData));
expoData[C9X_MAX_EXPOS-1].clear();
//also remove input name if removing last line for this input
bool found = false;
for (int i=0; i<C9X_MAX_EXPOS; i++) {
if (expoData[i].mode==0) continue;
if (expoData[i].chn==chn) {
found = true;
break;
}
}
if (!found) inputNames[chn][0] = 0;
}
void ModelData::clearInputs()
{
for (int i=0; i<C9X_MAX_EXPOS; i++)
expoData[i].clear();
//clear all input names
if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
for (int i=0; i<C9X_MAX_INPUTS; i++) {
inputNames[i][0] = 0;
}
}
}
void ModelData::clearMixes()
@@ -1077,10 +1155,10 @@ void ModelData::clear()
}
else {
moduleData[0].protocol=PPM;
moduleData[1].protocol=OFF;
moduleData[1].protocol=OFF;
}
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
phaseData[i].clear();
flightModeData[i].clear();
}
clearInputs();
clearMixes();
@@ -1090,6 +1168,8 @@ void ModelData::clear()
expoData[i].clear();
for (int i=0; i<C9X_NUM_CSW; i++)
customSw[i].clear();
for (int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
funcSw[i].clear();
for (int i=0; i<C9X_MAX_CURVES; i++)
curves[i].clear(5);
for (int i=0; i<2; i++)
@@ -1112,7 +1192,7 @@ void ModelData::setDefaultInputs(const GeneralSettings & settings)
expo->mode = INPUT_MODE_BOTH;
expo->srcRaw = settings.getDefaultSource(i);
expo->weight = 100;
strncpy(inputNames[i], expo->srcRaw.toString().toLatin1().constData(), sizeof(inputNames[i])-1);
strncpy(inputNames[i], expo->srcRaw.toString(*this).toLatin1().constData(), sizeof(inputNames[i])-1);
}
}
}
@@ -1128,7 +1208,7 @@ void ModelData::setDefaultMixes(const GeneralSettings & settings)
mix->destCh = i+1;
mix->weight = 100;
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, this);
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
}
else {
mix->srcRaw = RawSource(SOURCE_TYPE_STICK, i);
@@ -1149,7 +1229,7 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
{
int result = 0;
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
PhaseData & phase = phaseData[phaseIdx];
FlightModeData & phase = flightModeData[phaseIdx];
if (phase.trimMode[trimIdx] < 0) {
return result;
}
@@ -1171,17 +1251,17 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
{
return phaseData[phaseIdx].gvars[gvarIdx] > 1024;
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
}
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
{
int idx = phaseData[phaseIdx].gvars[gvarIdx];
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
int nextPhase = idx - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
idx = phaseData[phaseIdx].gvars[gvarIdx];
idx = flightModeData[phaseIdx].gvars[gvarIdx];
}
return idx;
}
@@ -1189,7 +1269,7 @@ int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
{
for (uint8_t i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
PhaseData & phase = phaseData[phaseIdx];
FlightModeData & phase = flightModeData[phaseIdx];
int mode = phase.trimMode[trimIdx];
int p = phase.trimRef[trimIdx];
int & trim = phase.trim[trimIdx];
@@ -1216,9 +1296,9 @@ void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
void ModelData::removeGlobalVar(int & var)
{
if (var >= 126 && var <= 130)
var = phaseData[0].gvars[var-126];
var = flightModeData[0].gvars[var-126];
else if (var <= -126 && var >= -130)
var = - phaseData[0].gvars[-126-var];
var = - flightModeData[0].gvars[-126-var];
}
ModelData ModelData::removeGlobalVars()
@@ -1239,9 +1319,9 @@ ModelData ModelData::removeGlobalVars()
return result;
}
int ModelData::getChannelsMax()
int ModelData::getChannelsMax(bool forceExtendedLimits) const
{
if (extendedLimits)
if (forceExtendedLimits || extendedLimits)
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
else
return 100;
@@ -1256,7 +1336,7 @@ void RegisterEepromInterfaces()
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_9XRPRO));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
eepromInterfaces.push_back(new Ersky9xInterface());
@@ -1269,50 +1349,127 @@ void UnregisterEepromInterfaces()
foreach(EEPROMInterface * intf, eepromInterfaces) {
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
delete intf;
}
}
OpenTxEepromCleanup();
}
QList<FirmwareInterface *> firmwares;
FirmwareVariant default_firmware_variant;
FirmwareVariant current_firmware_variant;
FirmwareInterface * default_firmware_variant;
FirmwareInterface * current_firmware_variant;
void UnregisterFirmwares()
void UnregisterFirmwares()
{
foreach (FirmwareInterface * f, firmwares) {
delete f;
}
}
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
{
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->load(radioData, eeprom, size))
return true;
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList errorsList;
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Possible causes for this:");
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a newer version of OpenTX"); }
if (errors.test(NOT_OPENTX)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from OpenTX"); }
if (errors.test(NOT_TH9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Th9X"); }
if (errors.test(NOT_GRUVIN9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Gruvin9X"); }
if (errors.test(NOT_ERSKY9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from ErSky9X"); }
if (errors.test(NOT_ER9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Er9X"); }
if (errors.test(WRONG_SIZE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom size is invalid"); }
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom file system is invalid"); }
if (errors.test(UNKNOWN_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a unknown board"); }
if (errors.test(WRONG_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from the wrong board"); }
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom backup not supported"); }
if (errors.test(UNKNOWN_ERROR)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Something that couldn't be guessed, sorry"); }
if (errors.test(HAS_WARNINGS)) {
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Warning:");
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
}
return false;
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(mainMessage);
msgBox.setInformativeText(errorsList.join("\n"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
{
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(QT_TRANSLATE_NOOP("EepromInterface", "Warnings!"));
msgBox.setInformativeText(warningsList.join("\n"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->loadBackup(radioData, eeprom, size, index))
return true;
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
if (result.test(NO_ERROR)) {
return result.to_ulong();
} else {
errors |= result;
}
}
return false;
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
if (result.test(NO_ERROR)) {
return result.to_ulong();
} else {
errors |= result;
}
}
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc)
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->loadxml(radioData, doc))
return true;
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
if (result.test(NO_ERROR)) {
return result.to_ulong();
} else {
errors |= result;
}
}
return false;
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
QString getBoardName(BoardEnum board)
@@ -1339,15 +1496,11 @@ QString getBoardName(BoardEnum board)
}
}
FirmwareVariant GetFirmwareVariant(QString id)
FirmwareInterface * GetFirmware(QString id)
{
FirmwareVariant result;
foreach(FirmwareInterface * firmware, firmwares) {
if (id.contains(firmware->getId()+"-") || (!id.contains("-") && id.contains(firmware->getId()))) {
result.id = id;
result.firmware = firmware;
result.variant = firmware->getVariant(id);
FirmwareInterface * result = firmware->getFirmwareVariant(id);
if (result) {
return result;
}
}
@@ -1361,20 +1514,21 @@ void FirmwareInterface::addOption(const char *option, QString tooltip, uint32_t
addOptions(options);
}
unsigned int FirmwareInterface::getVariant(const QString & variantId)
unsigned int FirmwareInterface::getVariantNumber()
{
unsigned int variant = variantBase;
QStringList options = variantId.mid(id.length()+1).split("-", QString::SkipEmptyParts);
unsigned int result = 0;
const FirmwareInterface * base = getFirmwareBase();
QStringList options = id.mid(base->getId().length()+1).split("-", QString::SkipEmptyParts);
foreach(QString option, options) {
foreach(QList<Option> group, opts) {
foreach(QList<Option> group, base->opts) {
foreach(Option opt, group) {
if (opt.name == option) {
variant += opt.variant;
result += opt.variant;
}
}
}
}
return variant;
return result;
}
void FirmwareInterface::addLanguage(const char *lang)
+230 -211
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -25,6 +25,8 @@
#include <QtXml>
#include <iostream>
#include <bitset>
#if __GNUC__
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
#else
@@ -252,7 +254,7 @@ enum TelemetrySource {
TELEMETRY_SOURCE_ACCZ,
TELEMETRY_SOURCE_HDG,
TELEMETRY_SOURCE_VERTICAL_SPEED,
TELEMETRY_SOURCE_ASPD,
TELEMETRY_SOURCE_ASPEED,
TELEMETRY_SOURCE_DTE,
TELEMETRY_SOURCE_A1_MIN,
TELEMETRY_SOURCE_A2_MIN,
@@ -286,7 +288,7 @@ enum TelemetrySource {
enum RawSourceType {
SOURCE_TYPE_NONE,
SOURCE_TYPE_VIRTUAL_INPUT,
SOURCE_TYPE_LUA_INPUT,
SOURCE_TYPE_LUA_OUTPUT,
SOURCE_TYPE_STICK, // and POTS
SOURCE_TYPE_ROTARY_ENCODER,
SOURCE_TYPE_TRIM,
@@ -327,29 +329,31 @@ class RawSourceRange
double max;
double step;
double offset;
QString unit;
};
#define RANGE_SINGLE_PRECISION 1
#define RANGE_DELTA_FUNCTION 2
#define RANGE_DELTA_ABS_FUNCTION 4
class GeneralSettings;
class RawSource {
public:
RawSource():
type(SOURCE_TYPE_NONE),
index(0),
model(NULL)
index(0)
{
}
RawSource(int value, const ModelData * model=NULL):
RawSource(int value):
type(RawSourceType(abs(value)/65536)),
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536)),
model(model)
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536))
{
}
RawSource(RawSourceType type, int index=0, const ModelData * model=NULL):
RawSource(RawSourceType type, int index=0):
type(type),
index(index),
model(model)
index(index)
{
}
@@ -358,10 +362,10 @@ class RawSource {
return index >= 0 ? (type * 65536 + index) : -(type * 65536 - index);
}
QString toString();
RawSourceRange getRange(bool singleprec=false);
QString toString(const ModelData & model);
RawSourceRange getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags=0) const;
bool operator == ( const RawSource & other) {
return (this->type == other.type) && (this->index == other.index);
}
@@ -370,9 +374,13 @@ class RawSource {
return (this->type != other.type) || (this->index != other.index);
}
bool isTimeBased() const
{
return (type==SOURCE_TYPE_TELEMETRY && (index==TELEMETRY_SOURCE_TX_TIME || index==TELEMETRY_SOURCE_TIMER1 || index==TELEMETRY_SOURCE_TIMER2));
}
RawSourceType type;
int index;
const ModelData * model;
};
enum RawSwitchType {
@@ -520,6 +528,8 @@ class GeneralSettings {
int temperatureCalib;
int temperatureWarn;
unsigned int mAhWarn;
unsigned int mAhUsed;
unsigned int globalTimer;
unsigned int btBaudrate;
unsigned int sticksGain;
unsigned int rotarySteps;
@@ -625,7 +635,10 @@ class LimitData {
bool symetrical;
char name[6+1];
CurveReference curve;
void clear() { memset(this, 0, sizeof(LimitData)); min = -1000; max = +1000; }
QString minToString();
QString maxToString();
QString offsetToString();
void clear();
};
enum MltpxValue {
@@ -710,13 +723,14 @@ class LogicalSwitchData { // Logical Switches data
int andsw;
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
CSFunctionFamily getFunctionFamily();
unsigned int getRangeFlags();
QString funcToString();
QString toString(const ModelData & model);
QString toString(const ModelData & model, const GeneralSettings & settings);
};
enum AssignFunc {
FuncSafetyCh1 = 0,
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
FuncOverrideCH1 = 0,
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
FuncTrainer,
FuncTrainerRUD,
FuncTrainerELE,
@@ -732,6 +746,7 @@ enum AssignFunc {
FuncPlayPrompt,
FuncPlayBoth,
FuncPlayValue,
FuncPlayScript,
FuncLogs,
FuncVolume,
FuncBacklight,
@@ -745,7 +760,7 @@ enum AssignFunc {
class FuncSwData { // Function Switches data
public:
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch;
AssignFunc func;
int param;
@@ -753,16 +768,16 @@ class FuncSwData { // Function Switches data
unsigned int enabled; // TODO perhaps not any more the right name
unsigned int adjustMode;
int repeatParam;
void clear() { memset(this, 0, sizeof(FuncSwData)); }
void clear();
QString funcToString();
QString paramToString();
QString repeatToString();
QStringList toStringList();
};
class PhaseData {
class FlightModeData {
public:
PhaseData() { clear(); }
FlightModeData() { clear(); }
int trimMode[NUM_STICKS];
int trimRef[NUM_STICKS];
int trim[NUM_STICKS];
@@ -772,7 +787,7 @@ class PhaseData {
unsigned int fadeOut;
int rotaryEncoders[2];
int gvars[C9X_MAX_GVARS];
void clear() { memset(this, 0, sizeof(PhaseData)); }
void clear() { memset(this, 0, sizeof(FlightModeData)); }
};
class SwashRingData { // Swash Ring data
@@ -814,14 +829,8 @@ class FrSkyChannelData {
unsigned int multiplier;
FrSkyAlarmData alarms[2];
float getRatio() const
{
if (type==0 || type==1 || type==2)
return float(ratio << multiplier) / 10.0;
else
return ratio << multiplier;
}
float getRatio() const;
RawSourceRange getRange() const;
void clear() { memset(this, 0, sizeof(FrSkyChannelData)); }
};
@@ -882,7 +891,6 @@ class FrSkyData {
FrSkyData() { clear(); }
FrSkyChannelData channels[4];
unsigned int usrProto;
unsigned int imperial;
int blades;
unsigned int voltsSource;
bool altitudeDisplayed;
@@ -916,9 +924,8 @@ class TimerData {
RawSwitch mode;
bool minuteBeep;
unsigned int countdownBeep;
bool dir; // 0=>Count Down, 1=>Count Up
unsigned int val;
bool persistent;
unsigned int persistent;
int pvalue;
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
};
@@ -954,6 +961,7 @@ class ModuleData {
bool ppmPulsePol; // false = positive
int ppmFrameLength;
void clear() { memset(this, 0, sizeof(ModuleData)); }
QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); }
};
#define C9X_MAX_SCRIPTS 7
@@ -982,7 +990,6 @@ class ModelData {
char name[12+1];
TimerData timers[2];
bool thrTrim; // Enable Throttle Trim
bool thrExpo; // Enable Throttle Expo
int trimInc; // Trim Increments
bool disableThrottleWarning;
@@ -991,7 +998,7 @@ class ModelData {
bool extendedLimits; // TODO xml
bool extendedTrims;
bool throttleReversed;
PhaseData phaseData[C9X_MAX_FLIGHT_MODES];
FlightModeData flightModeData[C9X_MAX_FLIGHT_MODES];
MixData mixData[C9X_MAX_MIXERS];
LimitData limitData[C9X_NUM_CHNOUT];
@@ -1041,113 +1048,123 @@ class ModelData {
void clearMixes();
void clearInputs();
int getChannelsMax();
int getChannelsMax(bool forceExtendedLimits=false) const;
protected:
void removeGlobalVar(int & var);
};
class RadioData {
public:
public:
GeneralSettings generalSettings;
ModelData models[C9X_MAX_MODELS];
ModelData models[C9X_MAX_MODELS];
};
// TODO rename FlightPhase to FlightMode
enum Capability {
FlightModes,
FlightModesName,
FlightModesHaveFades,
Mixes,
Timers,
TimeDivisions,
CustomFunctions,
VoicesAsNumbers,
VoicesMaxLength,
ModelVoice,
MultiLangVoice,
ModelImage,
Pots,
Switches,
SwitchesPositions,
LogicalSwitches,
CustomAndSwitches,
HasNegAndSwitches,
LogicalSwitchesExt,
RotaryEncoders,
Outputs,
ChannelsName,
ExtraInputs,
ExtendedTrims,
NumCurves,
NumCurvePoints,
OffsetWeight,
Simulation,
SoundMod,
SoundPitch,
MaxVolume,
EepromBackup,
Haptic,
HasBeeper,
ModelTrainerEnable,
Timer2ThrTrig,
HasExpoNames,
HasNoExpo,
HasMixerNames,
HasChNames,
HasCvNames,
HasPxxCountry,
HasPPMStart,
HasGeneralUnits,
HasFAIMode,
OptrexDisplay,
PPMExtCtrl,
PPMFrameLength,
DSM2Indexes,
Telemetry,
TelemetryUnits,
TelemetryBars,
Gvars,
GvarsInCS,
GvarsAreNamed,
GvarsFlightModes,
GvarsName,
NoTelemetryProtocol,
TelemetryCustomScreens,
TelemetryCustomScreensFieldsPerLine,
TelemetryTimeshift,
TelemetryMaxMultiplier,
HasAltitudeSel,
HasVario,
HasVarioSink,
HasVariants,
HasFailsafe,
HasSoundMixer,
NumModules,
PPMCenter,
SYMLimits,
HasCurrentCalibration,
HasVolume,
HasBrightness,
PerModelTimers,
SlowScale,
SlowRange,
PermTimers,
HasSDLogs,
CSFunc,
LCDWidth,
GetThrSwitch,
HasDisplayText,
VirtualInputs,
TrainerInputs,
LuaInputs,
LimitsPer1000,
EnhancedCurves,
HasFasOffset,
HasMahPersistent,
MultiposPots,
MultiposPotsPositions,
SimulatorVariant,
FlightModes,
FlightModesName,
FlightModesHaveFades,
Imperial,
Mixes,
Timers,
TimeDivisions,
CustomFunctions,
SafetyChannelCustomFunction,
VoicesAsNumbers,
VoicesMaxLength,
ModelVoice,
MultiLangVoice,
ModelImage,
Pots,
Switches,
SwitchesPositions,
LogicalSwitches,
CustomAndSwitches,
HasNegAndSwitches,
LogicalSwitchesExt,
RotaryEncoders,
Outputs,
ChannelsName,
ExtraInputs,
ExtendedTrims,
NumCurves,
NumCurvePoints,
OffsetWeight,
Simulation,
SoundMod,
SoundPitch,
MaxVolume,
EepromBackup,
Haptic,
HasBeeper,
ModelTrainerEnable,
Timer2ThrTrig,
HasExpoNames,
HasNoExpo,
HasMixerNames,
HasChNames,
HasCvNames,
HasPxxCountry,
HasPPMStart,
HasGeneralUnits,
HasFAIMode,
OptrexDisplay,
PPMExtCtrl,
PPMFrameLength,
DSM2Indexes,
Telemetry,
TelemetryUnits,
TelemetryBars,
Heli,
Gvars,
GvarsInCS,
GvarsAreNamed,
GvarsFlightModes,
GvarsName,
NoTelemetryProtocol,
TelemetryCustomScreens,
TelemetryCustomScreensFieldsPerLine,
TelemetryTimeshift,
TelemetryMaxMultiplier,
HasAltitudeSel,
HasVario,
HasVarioSink,
HasFailsafe,
HasSoundMixer,
NumModules,
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HasCurrentCalibration,
HasVolume,
HasBrightness,
PerModelTimers,
SlowScale,
SlowRange,
PermTimers,
HasSDLogs,
CSFunc,
LCDWidth,
GetThrSwitch,
HasDisplayText,
VirtualInputs,
TrainerInputs,
LuaScripts,
LuaInputsPerScript,
LuaOutputsPerScript,
LimitsPer1000,
EnhancedCurves,
HasFasOffset,
HasMahPersistent,
MultiposPots,
MultiposPotsPositions,
SimulatorVariant,
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
MixersMonitor,
HasBatMeterRange
};
class SimulatorInterface;
@@ -1164,18 +1181,18 @@ class EEPROMInterface
inline BoardEnum getBoard() { return board; }
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
virtual unsigned long load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
virtual unsigned long loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc) = 0;
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
virtual int getSize(ModelData &) = 0;
virtual int getSize(GeneralSettings &) = 0;
virtual int isAvailable(Protocol proto, int port=0) = 0;
virtual const int getEEpromSize() = 0;
@@ -1192,7 +1209,7 @@ class EEPROMInterface
};
extern QString EEPROMWarnings;
extern std::list<QString> EEPROMWarnings;
/* EEPROM string conversion functions */
void setEEPROMString(char *dst, const char *src, int size);
@@ -1231,12 +1248,12 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
for (int p=0; p<C9X_MAX_FLIGHT_MODES; p++) {
for (int i=0; i<NUM_STICKS/2; i++) {
int converted_stick = applyStickMode(i+1, mode) - 1;
int tmp = model.phaseData[p].trim[i];
model.phaseData[p].trim[i] = model.phaseData[p].trim[converted_stick];
model.phaseData[p].trim[converted_stick] = tmp;
tmp = model.phaseData[p].trimRef[i];
model.phaseData[p].trimRef[i] = model.phaseData[p].trimRef[converted_stick];
model.phaseData[p].trimRef[converted_stick] = tmp;
int tmp = model.flightModeData[p].trim[i];
model.flightModeData[p].trim[i] = model.flightModeData[p].trim[converted_stick];
model.flightModeData[p].trim[converted_stick] = tmp;
tmp = model.flightModeData[p].trimRef[i];
model.flightModeData[p].trimRef[i] = model.flightModeData[p].trimRef[converted_stick];
model.flightModeData[p].trimRef[converted_stick] = tmp;
}
}
@@ -1290,9 +1307,34 @@ void RegisterEepromInterfaces();
void UnregisterFirmwares();
void registerOpenTxFirmwares();
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc);
enum EepromLoadErrors {
NO_ERROR,
UNKNOWN_ERROR,
UNSUPPORTED_NEWER_VERSION,
WRONG_SIZE,
WRONG_FILE_SYSTEM,
NOT_OPENTX,
NOT_TH9X,
NOT_GRUVIN9X,
NOT_ERSKY9X,
NOT_ER9X,
UNKNOWN_BOARD,
WRONG_BOARD,
BACKUP_NOT_SUPPORTED,
HAS_WARNINGS,
WARNING_WRONG_FIRMWARE,
NUM_ERRORS
};
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc);
struct Option {
const char * name;
@@ -1303,27 +1345,45 @@ struct Option {
class FirmwareInterface {
public:
FirmwareInterface(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
id(id),
name(name),
board(board),
eepromInterface(eepromInterface),
variantBase(0),
base(NULL)
{
}
FirmwareInterface(FirmwareInterface * base, const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
id(id),
name(name),
board(board),
eepromInterface(eepromInterface),
variantBase(0),
base(base)
{
}
virtual ~FirmwareInterface()
{
delete eepromInterface;
}
FirmwareInterface(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface, bool voice = false):
id(id),
name(name),
board(board),
eepromInterface(eepromInterface),
voice(voice),
variantBase(0)
inline const FirmwareInterface * getFirmwareBase() const
{
return base ? base : this;
}
// TODO needed?
inline void setVariantBase(unsigned int variant)
{
variantBase = variant;
}
unsigned int getVariant(const QString & id);
virtual FirmwareInterface * getFirmwareVariant(const QString & id) { return NULL; }
unsigned int getVariantNumber();
virtual void addLanguage(const char *lang);
@@ -1342,19 +1402,19 @@ class FirmwareInterface {
virtual QString getReleaseNotesUrl() = 0;
virtual QString getFirmwareUrl(QString & id) = 0;
virtual QString getFirmwareUrl() = 0;
inline BoardEnum getBoard()
inline BoardEnum getBoard() const
{
return board;
}
inline QString getName()
inline QString getName() const
{
return name;
}
inline QString getId()
inline QString getId() const
{
return id;
}
@@ -1366,6 +1426,8 @@ class FirmwareInterface {
virtual int getCapability(const Capability) = 0;
virtual bool isTelemetrySourceAvailable(int source) = 0;
virtual SimulatorInterface * getSimulator()
{
return NULL;
@@ -1381,61 +1443,23 @@ class FirmwareInterface {
QString name;
BoardEnum board;
EEPROMInterface * eepromInterface;
public:
bool voice;
protected:
unsigned int variantBase;
FirmwareInterface * base;
private:
FirmwareInterface();
};
class FirmwareVariant
{
public:
FirmwareVariant():
firmware(NULL),
variant(0)
{
}
FirmwareVariant(QString & id, FirmwareInterface * firmware, unsigned int variant):
id(id),
firmware(firmware),
variant(variant)
{
}
QString getFirmwareUrl()
{
if (firmware)
return firmware->getFirmwareUrl(id);
else
return "";
}
QString id;
FirmwareInterface * firmware;
unsigned int variant;
};
extern QList<FirmwareInterface *> firmwares;
extern FirmwareVariant default_firmware_variant;
extern FirmwareVariant current_firmware_variant;
extern FirmwareInterface * default_firmware_variant;
extern FirmwareInterface * current_firmware_variant;
FirmwareVariant GetFirmwareVariant(QString id);
inline FirmwareInterface * GetFirmware(QString id)
{
return GetFirmwareVariant(id).firmware;
}
FirmwareInterface * GetFirmware(QString id);
inline FirmwareInterface * GetCurrentFirmware()
{
return current_firmware_variant.firmware;
return current_firmware_variant;
}
inline EEPROMInterface * GetEepromInterface()
@@ -1443,11 +1467,6 @@ inline EEPROMInterface * GetEepromInterface()
return GetCurrentFirmware()->getEepromInterface();
}
inline unsigned int GetCurrentFirmwareVariant()
{
return current_firmware_variant.variant;
}
void UnregisterEepromInterfaces();
inline int divRoundClosest(const int n, const int d)
+51
View File
@@ -344,6 +344,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);
+2
View File
@@ -146,4 +146,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
+3 -6
View File
@@ -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,7 +376,6 @@ 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;
@@ -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;
@@ -468,7 +466,6 @@ t_Er9xModelData::operator ModelData ()
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.imperial=FrSkyImperial;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
+3 -3
View File
@@ -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
@@ -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)); }
+31 -17
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,6 @@
#include <iostream>
#include "er9xinterface.h"
#include "er9xeeprom.h"
#include "er9xsimulator.h"
#include "file.h"
#include "appdata.h"
@@ -89,14 +88,17 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Er9xGeneral er9xGeneral;
memset(&er9xGeneral,0,sizeof(er9xGeneral));
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -111,29 +113,35 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Er9xGeneral er9xGeneral;
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -151,16 +159,19 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
break;
default:
std::cout << "not er9x\n";
return false;
errors.set(NOT_ER9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = er9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
Er9xModelData er9xModel;
efile->openRd(FILE_MODEL(i));
@@ -170,16 +181,19 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
else {
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = er9xModel;
}
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
+13 -13
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -29,21 +29,21 @@ class Er9xInterface : public EEPROMInterface
virtual ~Er9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
@@ -54,17 +54,17 @@ class Er9xInterface : public EEPROMInterface
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
};
@@ -1,224 +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 "firmwares/er9x/er9xsimulator.h"
#include "firmwares/er9x/er9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define FRSKY
#define PHASES
#undef min
#undef max
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#include <exception>
namespace Er9x {
#include "simpgmspace.h"
#include "er9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "simpgmspace.cpp"
#include "templates.cpp"
#include "frsky.cpp"
#include "audio.cpp"
uint8_t pxxFlag = 0;
int16_t g_anas[7];
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define 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 PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
#define TRIM_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, 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)
}
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin &= ~(mask); else pin |= (mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
switch (swtch) {
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
default:
break;
}
}
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
}
}
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Er9x;
Er9xSimulator::Er9xSimulator(Er9xInterface * er9xInterface):
er9xInterface(er9xInterface)
{
}
bool Er9xSimulator::timer10ms()
{
AUDIO_DRIVER(); // the tone generator
AUDIO_HEARTBEAT(); // the queue processing
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Er9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::start(RadioData &radioData, bool tests)
{
er9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Er9xSimulator::stop()
{
StopMainThread();
}
void Er9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
outputs.beep = audio.busy();
}
void Er9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::setTrim(unsigned int idx, int value)
{
Er9x::setTrim(idx, value);
}
void Er9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Er9x::getTrims(trims.values);
}
const char * Er9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -1,62 +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 er9x_simulator_h
#define er9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Er9xInterface;
class Er9xSimulator : public SimulatorInterface {
public:
Er9xSimulator(Er9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Er9xInterface * er9xInterface;
};
#endif
@@ -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,7 +508,6 @@ 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;
@@ -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;
@@ -596,7 +594,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.imperial=FrSkyImperial;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
@@ -608,7 +605,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,7 +624,6 @@ 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;
@@ -690,7 +685,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;
@@ -715,7 +710,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
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;
@@ -726,7 +720,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
// c9x.customdisplay[i]=customDisplayIndex[i];
// }
for (int i=0; i<5;i++) {
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
c9x.flightModeData[0].gvars[i]=gvars[i].gvar;
// c9x.gvsource[i]=gvars[i].gvsource;
}
return c9x;
@@ -237,14 +237,14 @@ 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
int8_t swtch; //input
@@ -421,7 +421,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
// Add 6 bytes for custom telemetry screen
uint8_t customDisplayIndex[6] ;
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
Ersky9xPhaseData phaseData[6] ;
Ersky9xFlightModeData flightModeData[6] ;
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
operator ModelData();
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -15,10 +15,8 @@
*/
#include <iostream>
#include <QMessageBox>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "ersky9xsimulator.h"
#include "file.h"
#define FILE_TYP_GENERAL 1
@@ -120,14 +118,17 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Ersky9xGeneral ersky9xGeneral;
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
else {
radioData.generalSettings=ersky9xGeneral;
@@ -137,40 +138,48 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
if (ersky9xGeneral.myVers == 10) {
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != EESIZE_SKY9X) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Ersky9xGeneral ersky9xGeneral;
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
@@ -182,21 +191,23 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
break;
default:
std::cout << "not ersky9x\n";
return false;
errors.set(NOT_ERSKY9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = ersky9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
uint8_t buffer[4096];
uint size;
memset(buffer,0,sizeof(buffer));
efile->openRd(FILE_MODEL(i));
// if (!efile->readRlc2((uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData))) {
size=efile->readRlc2(buffer, 4096);
if (!size) {
@@ -214,16 +225,19 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = ersky9xModel;
}
}
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -29,21 +29,21 @@ class Ersky9xInterface : public EEPROMInterface
virtual ~Ersky9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
@@ -54,17 +54,17 @@ class Ersky9xInterface : public EEPROMInterface
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
QDomElement getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); //parse out data to XML format
QDomElement getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
template <class T>
bool loadModelDataXML(QDomDocument * qdoc, ModelData * model, int modelNum, int stickMode); // get data from XML
@@ -1,247 +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 "firmwares/ersky9x/ersky9xsimulator.h"
#include "firmwares/ersky9x/ersky9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSKY9X
#define PCBSKY
#define STAMP
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define TEMPLATES
#define HELI
#define HAPTIC
#define AUDIO
#define REVB
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#undef min
#undef max
#include <exception>
namespace Ersky9x {
#include "../ersky9x/timers.h"
#include "../ersky9x/ersky9x.cpp"
#include "../ersky9x/stamp.cpp"
#include "../ersky9x/menus.cpp"
#include "../ersky9x/pers.cpp"
#include "../ersky9x/file.cpp"
#include "../ersky9x/lcd.cpp"
#include "../ersky9x/drivers.cpp"
#include "../ersky9x/logicio.cpp"
#include "../ersky9x/timers.cpp"
#include "../ersky9x/simpgmspace.cpp"
#include "../ersky9x/templates.cpp"
#include "../ersky9x/frsky.cpp"
#include "../ersky9x/audio.cpp"
#include "../ersky9x/sound.cpp"
#include "../ersky9x/diskio.cpp"
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
//uint8_t pxxFlag = 0;
int16_t g_anas[7];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin |= (mask); else pin &= ~(mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state < 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
switch (swtch) {
SWITCH_CASE(0, PIOC->PIO_PDSR, 1<<20)
SWITCH_CASE(1, PIOA->PIO_PDSR, 1<<15)
SWITCH_CASE(2, PIOC->PIO_PDSR, 1<<31)
SWITCH_3_CASE(3, PIOC->PIO_PDSR, PIOC->PIO_PDSR, 0x00004000, 0x00000800)
SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2)
SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16)
SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8)
default:
break;
}
}
#define 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 KEY_CASE(key, pin, mask) \
case key: \
if (state) pin &= ~mask; else pin |= mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, 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)
}
}
#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 PIN_TRIM_LH_L 0x00800000
#define PIN_TRIM_LV_DN 0x01000000
#define PIN_TRIM_RV_UP 0x00000002
#define PIN_TRIM_RH_L 0x00000001
#define PIN_TRIM_LH_R 0x00000010
#define PIN_TRIM_LV_UP 0x10000000
#define PIN_TRIM_RV_DN 0x00000400
#define PIN_TRIM_RH_R 0x00000200
#define TRIM_CASE KEY_CASE
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, 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)
}
}
}
using namespace Ersky9x;
Ersky9xSimulator::Ersky9xSimulator(Ersky9xInterface * ersky9xInterface):
ersky9xInterface(ersky9xInterface)
{
}
bool Ersky9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Ersky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
{
ersky9xInterface->save(Ersky9x::eeprom, radioData);
StartEepromThread(NULL);
StartMainThread(tests);
}
void Ersky9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Ersky9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setTrim(unsigned int idx, int value)
{
Ersky9x::setTrim(idx, value);
}
void Ersky9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Ersky9x::getTrims(trims.values);
}
const char * Ersky9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -1,62 +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 ersky9x_simulator_h
#define ersky9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Ersky9xInterface;
class Ersky9xSimulator : public SimulatorInterface {
public:
Ersky9xSimulator(Ersky9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Ersky9xInterface * ersky9xInterface;
};
#endif
@@ -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;
@@ -347,9 +347,9 @@ t_Gruvin9xSwashRingData::operator SwashRingData ()
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++)
@@ -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++)
@@ -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];
}
}
}
@@ -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;
}
}
}
@@ -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
@@ -312,7 +312,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
Gruvin9xLogicalSwitchData customSw[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();
@@ -344,7 +344,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
Gruvin9xLogicalSwitchData customSw[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();
@@ -377,7 +377,7 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[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;
@@ -409,7 +409,7 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -93,24 +93,30 @@ bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
return false;
}
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import... ";
std::bitset<NUM_ERRORS> errors;
if (size != this->getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -118,14 +124,16 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
if (version == 0) {
efile->openRd(FILE_GENERAL);
if (efile->readRlc1(&version, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
@@ -145,27 +153,35 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
break;
default:
std::cout << "not gruvin9x\n";
return false;
errors.set(NOT_GRUVIN9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (version == 5) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
return false;
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else if (version < 104) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
return false;
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else if (version <= 106) {
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
return false;
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
for (int i=0; i<getMaxModels(); i++) {
efile->openRd(FILE_MODEL(i));
if (version == 5) {
@@ -185,17 +201,21 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
}
else {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -30,21 +30,21 @@ class Gruvin9xInterface : public EEPROMInterface
virtual ~Gruvin9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
@@ -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);
@@ -461,13 +461,13 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -546,13 +546,13 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -635,13 +635,13 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -725,13 +725,13 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -812,13 +812,13 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -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
@@ -197,7 +197,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xGruvin9xFlightModeData_v207 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v205 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -231,7 +231,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -270,7 +270,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -310,7 +310,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -348,7 +348,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -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);
@@ -577,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncSafetyCh32) {
if (c9x.func <= FuncOverrideCH32) {
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
}
@@ -768,13 +767,13 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_ARM_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;
}
}
}
@@ -857,13 +856,13 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_ARM_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;
}
}
}
@@ -947,13 +946,13 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_ARM_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;
}
}
}
@@ -1031,13 +1030,13 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_ARM_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;
}
}
}
@@ -1118,13 +1117,13 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_ARM_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;
}
}
}
@@ -169,26 +169,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
@@ -346,7 +346,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v208 swashR;
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -385,7 +385,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -425,7 +425,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFrSkyData_v210 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -464,7 +464,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -502,7 +502,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v210 swashR;
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFlightModeData_v212 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -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;
@@ -573,8 +573,8 @@ t_Open9xFuncSwData_v201::operator FuncSwData ()
}
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,
@@ -686,9 +686,9 @@ t_Open9xSwashRingData_v209::operator SwashRingData ()
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;
}
@@ -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++)
@@ -941,7 +937,6 @@ 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;
@@ -949,13 +944,13 @@ t_Open9xModelData_v201::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1023,13 +1018,13 @@ t_Open9xModelData_v202::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1099,13 +1094,13 @@ t_Open9xModelData_v203::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1173,13 +1168,13 @@ t_Open9xModelData_v204::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1252,13 +1247,13 @@ t_Open9xModelData_v205::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1338,13 +1333,13 @@ t_Open9xModelData_v208::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1431,13 +1426,13 @@ t_Open9xModelData_v209::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1525,13 +1520,13 @@ t_Open9xModelData_v210::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -1613,13 +1608,13 @@ t_Open9xModelData_v211::operator ModelData ()
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_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;
}
}
}
@@ -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
@@ -520,7 +520,7 @@ PACK(typedef struct t_Open9xModelData_v201 {
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v201 frsky;
operator ModelData();
@@ -551,7 +551,7 @@ PACK(typedef struct t_Open9xModelData_v202 {
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -584,7 +584,7 @@ PACK(typedef struct t_Open9xModelData_v203 {
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -617,7 +617,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v204 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -650,7 +650,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v205 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -685,7 +685,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -724,7 +724,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -764,7 +764,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -802,7 +802,7 @@ PACK(typedef struct t_Open9xModelData_v211 {
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -48,6 +48,8 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3
@@ -66,6 +68,7 @@ namespace Open9xGruvin9x {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -76,9 +79,10 @@ namespace Open9xGruvin9x {
#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/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -177,13 +181,13 @@ void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
@@ -204,13 +208,13 @@ void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
unsigned int Open9xGruvin9xSimulator::getPhase()
{
return getFlightPhase();
return getFlightMode();
}
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));
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;
}
@@ -56,6 +56,11 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -46,6 +46,10 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define DSM2
#define DSM2_PPM
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "9x128"
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
@@ -65,6 +69,7 @@ namespace OpenTxM128 {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -75,9 +80,10 @@ namespace OpenTxM128 {
#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/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -169,13 +175,13 @@ void OpenTxM128Simulator::setValues(TxInputs &inputs)
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM128Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
@@ -195,13 +201,13 @@ void OpenTxM128Simulator::wheelEvent(uint8_t steps)
unsigned int OpenTxM128Simulator::getPhase()
{
return getFlightPhase();
return getFlightMode();
}
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));
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;
}
@@ -56,6 +56,11 @@ class OpenTxM128Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -50,10 +50,11 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES
#define FLAVOUR "9x"
#define NUM_POTS 3
#undef min
@@ -71,6 +72,7 @@ namespace OpenTxM64 {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -81,9 +83,10 @@ namespace OpenTxM64 {
#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/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/templates.cpp"
@@ -179,13 +182,13 @@ void OpenTxM64Simulator::setValues(TxInputs &inputs)
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM64Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
@@ -201,13 +204,13 @@ void OpenTxM64Simulator::getTrims(Trims & trims)
unsigned int OpenTxM64Simulator::getPhase()
{
return getFlightPhase();
return getFlightMode();
}
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));
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;
}
@@ -55,6 +55,11 @@ class OpenTxM64Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -54,9 +54,10 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3
#define EEPROM_VARIANT 3
#define FLAVOUR "sky9x"
#undef min
#undef max
@@ -75,9 +76,11 @@ namespace Open9xSky9x {
#include "radio/src/eeprom_raw.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/opentx.cpp"
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
@@ -92,11 +95,13 @@ namespace Open9xSky9x {
#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/lcd_common.cpp"
#include "radio/src/lcd_default.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/sdcard.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -109,6 +114,7 @@ namespace Open9xSky9x {
#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/haptic.cpp"
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
@@ -120,6 +126,7 @@ namespace Open9xSky9x {
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_hu.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
@@ -148,11 +155,9 @@ using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator()
{
QString path=g.profile[g.id()].sdPath()+"/";
int i=0;
for (i=0; i< std::min(path.length(),1022); i++) {
simuSdDirectory[i]=path.at(i).toAscii();
}
simuSdDirectory[i]=0;
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
}
bool Open9xSky9xSimulator::timer10ms()
@@ -161,7 +166,7 @@ bool Open9xSky9xSimulator::timer10ms()
#include "simulatorimport.h"
}
uint8_t * Open9xSky9xSimulator::getLcd()
::uint8_t * Open9xSky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
@@ -178,6 +183,7 @@ void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
g_rotenc[0] = 0;
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartAudioThread(g.profile[g.id()].volumeGain());
StartMainThread(tests);
}
@@ -185,12 +191,14 @@ void Open9xSky9xSimulator::start(const char * filename, bool tests)
{
g_rotenc[0] = 0;
StartEepromThread(filename);
StartAudioThread(g.profile[g.id()].volumeGain());
StartMainThread(tests);
}
void Open9xSky9xSimulator::stop()
{
StopMainThread();
StopAudioThread();
StopEepromThread();
}
@@ -212,40 +220,40 @@ void Open9xSky9xSimulator::setValues(TxInputs &inputs)
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void Open9xSky9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
::uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
void Open9xSky9xSimulator::wheelEvent(::uint8_t steps)
{
g_rotenc[0] += steps*4;
}
unsigned int Open9xSky9xSimulator::getPhase()
{
return getFlightPhase();
return getFlightMode();
}
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));
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;
}
@@ -254,3 +262,13 @@ const char * Open9xSky9xSimulator::getError()
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::installTraceHook(void (*callback)(const char *)) {
::traceCallback = callback;
}
@@ -56,6 +56,11 @@ class Open9xSky9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
};
#endif
@@ -54,8 +54,10 @@
#define EEPROM_VARIANT 3
#define HAPTIC
#define REVPLUS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
#define FLAVOUR "taranis-plus"
#define MIXERS_MONITOR
#undef min
#undef max
@@ -78,10 +80,12 @@ inline int geteepromsize() {
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/debug.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/targets/taranis/pulses_driver.cpp"
#include "radio/src/targets/taranis/rtc_driver.cpp"
#include "radio/src/targets/taranis/trainer_driver.cpp"
@@ -99,7 +103,8 @@ inline int geteepromsize() {
#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/lcd_common.cpp"
#include "radio/src/lcd_taranis.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/rtc.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
@@ -107,10 +112,10 @@ inline int geteepromsize() {
#include "radio/src/bmp.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/targets/taranis/haptic_driver.cpp"
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#undef SDCARD
#include "radio/src/simpgmspace.cpp"
#define SDCARD
#include "radio/src/sdcard.cpp"
// Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#define SKIP_FATFS_DECLARATION
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
@@ -129,7 +134,7 @@ inline int geteepromsize() {
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_hu.cpp"
#include "radio/src/lua.cpp"
#include "radio/src/lua/src/lapi.c"
#include "radio/src/lua/src/lcode.c"
@@ -147,6 +152,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/lrotable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
@@ -154,6 +160,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/lbitlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
@@ -191,11 +198,8 @@ OpentxTaranisSimulator::OpentxTaranisSimulator()
{
taranisSimulatorBoard = GetEepromInterface()->getBoard();
QString path=g.profile[g.id()].sdPath()+"/";
int i=0;
for (i=0; i< std::min(path.length(),1022); i++) {
simuSdDirectory[i]=path.at(i).toAscii();
}
simuSdDirectory[i]=0;
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
}
bool OpentxTaranisSimulator::timer10ms()
@@ -204,7 +208,7 @@ bool OpentxTaranisSimulator::timer10ms()
#include "simulatorimport.h"
}
uint8_t * OpentxTaranisSimulator::getLcd()
::uint8_t * OpentxTaranisSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
@@ -220,18 +224,21 @@ void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartAudioThread(g.profile[g.id()].volumeGain());
StartMainThread(tests);
}
void OpentxTaranisSimulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartAudioThread(g.profile[g.id()].volumeGain());
StartMainThread(tests);
}
void OpentxTaranisSimulator::stop()
{
StopMainThread();
StopAudioThread();
StopEepromThread();
}
@@ -251,40 +258,40 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpentxTaranisSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
::uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
void OpentxTaranisSimulator::wheelEvent(::uint8_t steps)
{
// g_rotenc[0] += steps*4;
}
unsigned int OpentxTaranisSimulator::getPhase()
{
return getFlightPhase();
return getFlightMode();
}
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));
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;
}
@@ -293,3 +300,18 @@ const char * OpentxTaranisSimulator::getError()
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
{
frskySportProcessPacket(data);
}
void OpentxTaranisSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::installTraceHook(void (*callback)(const char *)) {
::traceCallback = callback;
}
@@ -56,6 +56,11 @@ class OpentxTaranisSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
};
#endif
+174 -74
View File
@@ -19,7 +19,7 @@
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 15 : 12))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
@@ -40,11 +40,11 @@ inline int switchIndex(int i, BoardEnum board, unsigned int version)
class SwitchesConversionTable: public ConversionTable {
public:
SwitchesConversionTable(BoardEnum board, unsigned int version, unsigned long flags=0)
SwitchesConversionTable(BoardEnum board, unsigned int version, bool timer=false)
{
int val=0;
int offset=0;
if (flags & POPULATE_TIMER_MODES) {
if (timer) {
offset = 4;
for (int i=0; i<5; i++) {
addConversion(RawSwitch(SWITCH_TYPE_TIMER_MODE, i), val++);
@@ -56,8 +56,15 @@ class SwitchesConversionTable: public ConversionTable {
for (int i=1; i<=MAX_SWITCHES_POSITION(board); i++) {
int s = switchIndex(i, board, version);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val);
if (IS_TARANIS(board) && s>=21/*SHup/SHdown*/) {
addImportConversion(RawSwitch(SWITCH_TYPE_SWITCH, 21+22-s), -val+offset);
addExportConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
else {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
val++;
}
if (IS_TARANIS(board) && version >= 216) {
@@ -86,17 +93,15 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
if (!(flags & POPULATE_TIMER_MODES)) {
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
}
}
@@ -124,6 +129,16 @@ class SwitchesConversionTable: public ConversionTable {
ConversionTable::addConversion(sw.toValue(), b);
}
void addImportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addImportConversion(sw.toValue(), b);
}
void addExportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addExportConversion(sw.toValue(), b);
}
class Cache {
public:
Cache(BoardEnum board, unsigned int version, unsigned long flags, SwitchesConversionTable * table):
@@ -189,7 +204,7 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_INPUT, i*16+j), val++);
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
}
}
}
@@ -235,8 +250,9 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
}
}
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
}
}
if (!afterrelease21March2013) {
@@ -260,7 +276,7 @@ class SourcesConversionTable: public ConversionTable {
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
if (version < 216) {
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPD || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPEED || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
continue;
}
if (!IS_ARM(board)) {
@@ -369,7 +385,8 @@ template <int N>
class SwitchField: public ConversionField< SignedField<N> > {
public:
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch"),
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch",
"Switch "+ sw.toString()+" cannot be exported on this board!"),
sw(sw),
_switch(0)
{
@@ -443,7 +460,7 @@ class TelemetrySourcesConversionTable: public ConversionTable {
addConversion(1+TELEMETRY_SOURCE_HDG, val++);
addConversion(1+TELEMETRY_SOURCE_VERTICAL_SPEED, val++);
if (version >= 216) {
addConversion(1+TELEMETRY_SOURCE_ASPD, val++);
addConversion(1+TELEMETRY_SOURCE_ASPEED, val++);
addConversion(1+TELEMETRY_SOURCE_DTE, val++);
}
if (IS_ARM(board) && version >= 216) {
@@ -503,7 +520,8 @@ template <int N>
class SourceField: public ConversionField< UnsignedField<N> > {
public:
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags), "Source"),
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
"Source", "Source "+ source.toString(ModelData())+" cannot be exported on this board!"),
source(source),
_source(0)
{
@@ -701,7 +719,7 @@ class HeliField: public StructField {
class FlightModeField: public TransformedField {
public:
FlightModeField(PhaseData & phase, int index, BoardEnum board, unsigned int version):
FlightModeField(FlightModeData & phase, int index, BoardEnum board, unsigned int version):
TransformedField(internalField),
internalField("Phase"),
phase(phase),
@@ -826,7 +844,7 @@ class FlightModeField: public TransformedField {
protected:
StructField internalField;
PhaseData & phase;
FlightModeData & phase;
int index;
BoardEnum board;
unsigned int version;
@@ -867,8 +885,8 @@ class MixField: public TransformedField {
internalField.Append(new SpareBitsField<8>());
}
else if (IS_ARM(board) && version >= 216) {
internalField.Append(new UnsignedField<4>(_destCh));
internalField.Append(new UnsignedField<4>(mix.mixWarn));
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new UnsignedField<3>(mix.mixWarn));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new BoolField<1>(mix.noExpo));
@@ -973,7 +991,12 @@ class MixField: public TransformedField {
_destCh = mix.destCh - 1;
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
_curveMode = true;
_curveParam = 6 + mix.curve.value;
if (mix.curve.value > 0) {
_curveParam = 6 + mix.curve.value;
}
else {
_curveParam = mix.curve.value;
}
}
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
_curveMode = true;
@@ -1009,18 +1032,20 @@ class MixField: public TransformedField {
if (IS_TARANIS(board) && version < 216) {
if (mix.srcRaw.type == SOURCE_TYPE_STICK && mix.srcRaw.index < NUM_STICKS) {
if (!mix.noExpo) {
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, mix.srcRaw.index, model);
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, mix.srcRaw.index);
}
}
}
if (mix.srcRaw.type != SOURCE_TYPE_NONE) {
mix.destCh = _destCh + 1;
if (!IS_ARM(board) || version < 216) {
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else if (_curveParam < 0)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
else
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
@@ -1080,7 +1105,7 @@ class InputField: public TransformedField {
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
internalField.Append(new SpareBitsField<8>());
}
@@ -1133,7 +1158,11 @@ class InputField: public TransformedField {
virtual void beforeExport()
{
_weight = smallGvarToEEPROM(expo.weight);
_weight = smallGvarToEEPROM(expo.weight);
if (IS_TARANIS(board) && version >= 216) {
_offset = smallGvarToEEPROM(expo.offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
@@ -1166,6 +1195,10 @@ class InputField: public TransformedField {
expo.weight = smallGvarToC9x(_weight);
if (IS_TARANIS(board) && version >= 216) {
expo.offset = smallGvarToC9x(_offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
@@ -1183,24 +1216,65 @@ class InputField: public TransformedField {
unsigned int version;
bool _curveMode;
int _weight;
int _offset;
int _curveParam;
};
class LimitField: public StructField {
public:
template <int shift>
static int exportLimitValue(int value)
{
const int GV1 = 4096;
if (value > 10000) {
return -GV1 + value - 10001;
}
if (value < -10000) {
return GV1 + value + 10000;
}
return value + shift;
}
template <int shift>
static int importLimitValue(int value)
{
/* GVARS mapping on radio:
GV1 = -4096
GV9 = -4088
-GV1 = 4095
-GV9 = 4087
*/
const int GV1 = 4096;
if (value >= GV1) {
return 10001 + value - GV1;
}
if (value >= GV1-9) {
return -10000 + value - GV1;
}
if (value < -GV1) {
return -10000 + value + GV1 + 1;
}
if (value < -GV1+9) {
return 10000 + value + GV1 + 1;
}
return value - shift;
}
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
StructField("Limit")
{
if (IS_TARANIS(board) && version >= 216) {
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
Append(new SignedField<8>(limit.ppmCenter));
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
}
else {
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
}
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
Append(new BoolField<1>(limit.symetrical));
Append(new BoolField<1>(limit.revert));
if (HAS_LARGE_LCD(board)) {
@@ -1255,14 +1329,14 @@ class CurvesField: public TransformedField {
if (IS_TARANIS(board) && version >= 216) {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
if (offset > maxPoints) {
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
EEPROMWarnings.push_back(::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints));
break;
}
}
else {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
if (offset > maxPoints - 5 * maxCurves) {
EEPROMWarnings += ::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
EEPROMWarnings.push_back(::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints));
break;
}
_curves[i] = offset;
@@ -1544,11 +1618,27 @@ class LogicalSwitchField: public TransformedField {
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
RawSource val2(csw.val2);
if (val2.type == SOURCE_TYPE_STICK && val2.index < NUM_STICKS) {
csw.val2 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val2.index).toValue();
}
}
}
else if (csw.func != LS_FN_OFF) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
}
csw.val2 = v2;
RawSource val1(csw.val1, model);
RawSource val1(csw.val1);
if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) {
switch (val1.index) {
case TELEMETRY_SOURCE_TIMER1:
@@ -1677,7 +1767,10 @@ class CustomFunctionsConversionTable: public ConversionTable {
addConversion(FuncPlayValue, val++);
if (IS_ARM(board)) {
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
if (IS_TARANIS(board))
addConversion(FuncPlayScript, val++);
else
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncBackgroundMusic, val++);
addConversion(FuncBackgroundMusicPause, val++);
@@ -1799,10 +1892,10 @@ class ArmCustomFunctionField: public TransformedField {
else
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216) {
*((uint16_t *)_param) = fn.param;
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
}
else {
*((uint32_t *)_param) = fn.param;
@@ -1818,7 +1911,7 @@ class ArmCustomFunctionField: public TransformedField {
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
}
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(_param, fn.paramarm, sizeof(_param));
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
@@ -1881,9 +1974,9 @@ class ArmCustomFunctionField: public TransformedField {
value = *((uint32_t *)_param);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
fn.param = (int16_t)(uint16_t)value;
}
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer2) {
fn.func = AssignFunc(fn.func + index);
@@ -1893,7 +1986,7 @@ class ArmCustomFunctionField: public TransformedField {
fn.func = AssignFunc(fn.func + index);
fn.param = value;
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
}
else if (fn.func == FuncVolume) {
@@ -1908,7 +2001,7 @@ class ArmCustomFunctionField: public TransformedField {
else if (fn.adjustMode == 2)
fn.param = RawSource(SOURCE_TYPE_GVAR, value).toValue();
else
fn.param = value;
fn.param = (int16_t)value;
}
else if (version >= 214) {
fn.adjustMode = _mode;
@@ -1917,7 +2010,7 @@ class ArmCustomFunctionField: public TransformedField {
else if (fn.adjustMode == 2)
fn.param = RawSource(SOURCE_TYPE_GVAR, value).toValue();
else
fn.param = value;
fn.param = (int8_t)value;
}
else {
sourcesConversionTable->importValue(value, (int &)fn.param);
@@ -1986,9 +2079,9 @@ class AvrCustomFunctionField: public TransformedField {
_param = fn.param;
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
_union_param = fn.func - FuncSafetyCh1;
_union_param = fn.func - FuncOverrideCH1;
else if (version >= 213)
_active += ((fn.func % 4) << 1);
}
@@ -2046,7 +2139,7 @@ class AvrCustomFunctionField: public TransformedField {
fn.enabled = (_active & 0x01);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
fn.func = AssignFunc(fn.func + _union_param);
else if (version >= 213)
@@ -2061,6 +2154,10 @@ class AvrCustomFunctionField: public TransformedField {
if (version >= 216) {
fn.func = AssignFunc(fn.func + (_union_param >> 2));
fn.adjustMode = (_union_param & 0x03);
if (fn.adjustMode == 1)
sourcesConversionTable->importValue(_param, (int &)fn.param);
else if (fn.adjustMode == 2)
fn.param = RawSource(SOURCE_TYPE_GVAR, _param).toValue();
}
else if (version >= 213) {
fn.adjustMode = ((_active >> 1) & 0x03);
@@ -2331,10 +2428,9 @@ class FrskyField: public StructField {
Append(new UnsignedField<3>(frsky.varioSource));
Append(new SignedField<5>(frsky.varioCenterMin));
Append(new ConversionField< UnsignedField<3> >(frsky.currentSource, &telemetryCurrentSourceConversionTable, "Current Source"));
Append(new SignedField<8>(frsky.varioCenterMax));
Append(new SignedField<5>(frsky.varioCenterMax));
if (version >= 216) {
// TODO int8_t fasOffset;
Append(new SpareBitsField<8>());
Append(new SignedField<8>(frsky.fasOffset));
}
}
}
@@ -2390,13 +2486,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
for (int i=0; i<O9X_MAX_TIMERS; i++) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, POPULATE_TIMER_MODES));
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<4>());
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<3>());
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
else if (afterrelease21March2013) {
@@ -2404,7 +2500,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
@@ -2415,7 +2511,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
else {
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<15>());
}
}
@@ -2424,7 +2520,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board))
internalField.Append(new UnsignedField<3>(modelData.telemetryProtocol));
else
internalField.Append(new ConversionField< SignedField<3> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this telemetry protocol")));
internalField.Append(new BoolField<1>(modelData.thrTrim));
@@ -2475,7 +2571,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
internalField.Append(new FlightModeField(modelData.phaseData[i], i, board, version));
internalField.Append(new FlightModeField(modelData.flightModeData[i], i, board, version));
if (!IS_ARM(board) || version < 216) {
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
@@ -2499,7 +2595,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if ((board == BOARD_STOCK || (board == BOARD_M128 && version >= 215)) && (variant & GVARS_VARIANT)) {
for (int i=0; i<MAX_GVARS(board, version); i++) {
// on M64 GVARS are common to all phases, and there is no name
internalField.Append(new SignedField<16>(modelData.phaseData[0].gvars[i]));
internalField.Append(new SignedField<16>(modelData.flightModeData[0].gvars[i]));
}
}
@@ -2528,12 +2624,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_TARANIS(board)) {
modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new UnsignedField<8>(modelData.trainerMode));
}
else if (IS_ARM(board) && version >= 216) {
modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
}
if (IS_ARM(board) && version >= 215) {
@@ -2559,7 +2655,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<7; i++) {
ScriptData & script = modelData.scriptData[i];
internalField.Append(new ZCharField<10>(script.filename));
internalField.Append(new CharField<10>(script.filename));
internalField.Append(new ZCharField<10>(script.name));
for (int j=0; j<10; j++) {
internalField.Append(new SignedField<8>(script.inputs[j]));
@@ -2753,8 +2849,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new SpareBitsField<16>()); // mAhUsed
internalField.Append(new SpareBitsField<32>()); // globalTimer
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
@@ -2800,10 +2896,12 @@ void OpenTxGeneralData::beforeExport()
sum += generalData.calibSpanPos[i];
if (++count == 12) break;
}
for (int i=0; i<4; i++) {
potsType[i] = generalData.potsType[i];
if (i<2 && potsType[i] == 1)
potsType[i] = 0;
if (IS_TARANIS(board)) {
for (int i=0; i<4; i++) {
potsType[i] = generalData.potsType[i];
if (i<2 && potsType[i] == 1)
potsType[i] = 0;
}
}
}
else {
@@ -2817,9 +2915,11 @@ void OpenTxGeneralData::beforeExport()
void OpenTxGeneralData::afterImport()
{
for (int i=0; i<4; i++) {
generalData.potsType[i] = potsType[i];
if (i<2 && potsType[i] == 0)
generalData.potsType[i] = 1;
if (IS_TARANIS(board)) {
for (int i=0; i<4; i++) {
generalData.potsType[i] = potsType[i];
if (i<2 && potsType[i] == 0)
generalData.potsType[i] = 1;
}
}
}
+217 -104
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -113,7 +113,7 @@ template <class T>
bool OpenTxEepromInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
{
T _model;
if (!data) {
// load from EEPROM
efile->openRd(FILE_MODEL(index));
@@ -163,8 +163,20 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &mode
}
else {
// load from SD Backup, size is stored in index
QByteArray eepromData((char *)data, index);
open9xModel.Import(eepromData);
QByteArray backupData((char *)data, index);
QByteArray modelData;
if (IS_SKY9X(board))
modelData = backupData;
else
importRlc(modelData, backupData);
if (modelData.size()) {
open9xModel.Import(modelData);
// open9xModel.Dump();
model.used = true;
}
else {
model.clear();
}
}
return true;
@@ -288,16 +300,20 @@ bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, unsi
return (sz == eeprom.size());
}
bool OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import...";
if (size != getEEpromSize()) {
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
if (size==4096) {
int notnull=false;
for (int i=2048; i<4096; i++) {
@@ -307,52 +323,62 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
}
if (notnull) {
std::cout << " wrong size (" << size << ")\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
else {
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
errors.set(HAS_WARNINGS);
errors.set(WARNING_WRONG_FIRMWARE);
size=2048;
}
} else {
std::cout << " wrong size (" << size << ")\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
std::cout << " wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << " no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " version " << (unsigned int)version;
if (!checkVersion(version)) {
EepromLoadErrors version_error = checkVersion(version);
if (version_error != NO_ERROR) {
std::cout << " not open9x\n";
return false;
errors.set(version_error);
return errors.to_ulong();
}
if (!loadGeneral<OpenTxGeneralData>(radioData.generalSettings, version)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " variant " << radioData.generalSettings.variant;
for (int i=0; i<getMaxModels(); i++) {
if (!loadModel(version, radioData.models[i], NULL, i, radioData.generalSettings.variant, radioData.generalSettings.stickMode+1)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << " ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -369,10 +395,10 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
break;
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
version = 216;
version = 217;
break;
case BOARD_M128:
version = 216;
version = 217;
break;
case BOARD_STOCK:
version = 216;
@@ -387,7 +413,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
if (board == BOARD_M128) {
variant |= M128_VARIANT;
}
int result = saveGeneral<OpenTxGeneralData>(radioData.generalSettings, board, version, variant);
if (!result) {
return 0;
@@ -402,10 +428,21 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
}
}
if (!EEPROMWarnings.isEmpty())
if (!EEPROMWarnings.empty()) {
QString msg;
int noErrorsToDisplay = std::min((int)EEPROMWarnings.size(),10);
for (int n = 0; n < noErrorsToDisplay; n++) {
msg += "-" + EEPROMWarnings.front() + "\n";
EEPROMWarnings.pop_front();
}
if (!EEPROMWarnings.empty()) {
msg = QObject::tr("(displaying only first 10 warnings)") + "\n" + msg;
}
EEPROMWarnings.clear();
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("EEPROM saved with these warnings:") + "\n- " + EEPROMWarnings.remove(EEPROMWarnings.length()-1, 1).replace("\n", "\n- "));
QObject::tr("EEPROM saved with these warnings:") + "\n" + msg);
}
return size;
}
@@ -422,7 +459,7 @@ int OpenTxEepromInterface::getSize(ModelData &model)
uint8_t tmp[EESIZE_RLC_MAX];
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmwareVariant());
OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmware()->getVariantNumber());
QByteArray eeprom;
open9xModel.Export(eeprom);
@@ -441,7 +478,7 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
uint8_t tmp[EESIZE_RLC_MAX];
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant());
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmware()->getVariantNumber());
// open9xGeneral.Dump();
QByteArray eeprom;
@@ -453,9 +490,26 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
return efile->size(0);
}
FirmwareInterface * OpenTxFirmware::getFirmwareVariant(const QString & id)
{
if (id.contains(getId()+"-") || (!id.contains("-") && id.contains(getId()))) {
FirmwareInterface * result = new OpenTxFirmware(id, this);
// TODO result.variant = firmware->getVariant(id);
return result;
}
else {
return NULL;
}
}
int OpenTxFirmware::getCapability(const Capability capability)
{
switch (capability) {
case Imperial:
if (IS_ARM(board))
return 0;
else
return id.contains("imperial") ? 1 : 0;
case ModelImage:
if (IS_TARANIS(board))
return 1;
@@ -491,12 +545,22 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 5;
case FlightModesHaveFades:
return 1;
case Heli:
if (IS_TARANIS(board))
return id.contains("noheli") ? 0 : 1;
else
return id.contains("heli") ? 1 : 0;
case Gvars:
return IS_ARM(board) ? 9 : 5;
if (IS_TARANIS(board))
return id.contains("nogvars") ? 0 : 9;
else if (id.contains("gvars"))
return IS_ARM(board) ? 9 : 5;
else
return 0;
case FlightModesName:
return (IS_TARANIS(board) ? 10 : 6);
case GvarsName:
return 6;
return (IS_9X(board) ? 0 : 6);
case HasChNames:
return (IS_TARANIS(board) ? 1 : 0);
case GvarsInCS:
@@ -529,11 +593,11 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 24;
else
return 16;
case SafetyChannelCustomFunction:
return id.contains("nooverridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 32;
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
return 15;
else
return 12;
case CustomAndSwitches:
@@ -563,7 +627,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
case SoundPitch:
return 1;
case Haptic:
return 1;
return (board == BOARD_GRUVIN9X || IS_SKY9X(board) || board == BOARD_TARANIS_PLUS || id.contains("haptic"));
case ModelTrainerEnable:
if (IS_ARM(board))
return 1;
@@ -594,7 +658,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
case HasCvNames:
return (IS_TARANIS(board) ? 1 : 0);
case Telemetry:
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
if (board == BOARD_GRUVIN9X || IS_ARM(board) || id.contains("frsky") || id.contains("telemetrez"))
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
else
return 0;
case TelemetryBars:
return 1;
case TelemetryCustomScreens:
@@ -610,7 +677,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
case TelemetryMaxMultiplier:
return (IS_ARM(board) ? 32 : 8);
case PPMCenter:
return 1;
return (IS_TARANIS(board) || id.contains("ppmca")) ? 1 : 0;
case PPMUnitMicroseconds:
return id.contains("ppmus") ? 1 : 0;
case SYMLimits:
return 1;
case OptrexDisplay:
@@ -619,11 +688,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 1;
case HasVarioSink:
return ((board == BOARD_GRUVIN9X || IS_ARM(board)) ? true : false);
case HasVariants:
if (IS_TARANIS(board))
return 0;
else
return 1;
case HasFailsafe:
return (IS_ARM(board) ? 32 : 0);
case NumModules:
@@ -656,7 +720,12 @@ int OpenTxFirmware::getCapability(const Capability capability)
return IS_TARANIS(board) ? 32 : 0;
case TrainerInputs:
return IS_ARM(board) ? 16 : 8;
case LuaInputs:
case LuaScripts:
return IS_TARANIS(board) ? 7 : 0;
case LuaInputsPerScript:
return IS_TARANIS(board) ? 10 : 0;
case LuaOutputsPerScript:
return IS_TARANIS(board) ? 6 : 0;
case LimitsPer1000:
case EnhancedCurves:
return IS_TARANIS(board);
@@ -675,11 +744,31 @@ int OpenTxFirmware::getCapability(const Capability capability)
return SIMU_M128_VARIANTS;
else
return 0;
case MavlinkTelemetry:
return id.contains("mavlink") ? 1 : 0;
case HasInputDiff:
case HasMixerExpo:
return (IS_TARANIS(board) ? true : false);
case MixersMonitor:
return id.contains("mixersmon") ? 1 : 0;
case HasBatMeterRange:
return (IS_TARANIS(board) ? true : false);
default:
return 0;
}
}
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
{
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
return false;
if (source == TELEMETRY_SOURCE_DTE)
return false;
return true;
}
int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
{
if (IS_TARANIS(board)) {
@@ -749,7 +838,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
break;
default:
return 0;
}
}
}
else {
switch (proto) {
@@ -772,7 +861,7 @@ size_t getSizeA(T (&)[SIZE]) {
return SIZE;
}
bool OpenTxEepromInterface::checkVersion(unsigned int version)
EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
{
switch(version) {
case 201:
@@ -831,11 +920,15 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version)
case 216:
// A lot of things (first github release)
break;
case 217:
// 3 logical switches removed on M128 / gruvin9x boards
return UNSUPPORTED_NEWER_VERSION;
break;
default:
return false;
return NOT_OPENTX;
}
return true;
return NO_ERROR;
}
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
@@ -860,13 +953,39 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
}
}
bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
std::cout << "trying " << getName() << " backup import...";
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0 || eeprom[3] != 0x30+board) {
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
std::cout << " no\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
BoardEnum backupBoard = (BoardEnum)-1;
switch (eeprom[3]) {
case 0x33:
backupBoard = BOARD_TARANIS;
break;
case 0x32:
backupBoard = BOARD_SKY9X;
break;
case 0x31:
backupBoard = BOARD_GRUVIN9X;
break;
default:
std::cout << " unknown board\n";
errors.set(UNKNOWN_BOARD);
return errors.to_ulong();
}
if (backupBoard != board) {
std::cout << " not right board\n";
errors.set(WRONG_BOARD);
return errors.to_ulong();
}
uint8_t version = eeprom[4];
@@ -876,32 +995,38 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
std::cout << " version " << (unsigned int)version << " ";
if (!checkVersion(version)) {
EepromLoadErrors version_error = checkVersion(version);
if (version_error != NO_ERROR) {
std::cout << " not open9x\n";
return false;
errors.set(version_error);
return errors.to_ulong();
}
if (size > esize-8) {
std::cout << " wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (bcktype=='M') {
if (!loadModel(version, radioData.models[index], &eeprom[8], size, variant)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << " backup type not supported\n";
return false;
errors.set(BACKUP_NOT_SUPPORTED);
return errors.to_ulong();
}
std::cout << " ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
QString OpenTxFirmware::getFirmwareUrl(QString & id)
QString OpenTxFirmware::getFirmwareUrl()
{
QString url = OPENTX_FIRMWARE_DOWNLOADS;
switch (board) {
@@ -957,6 +1082,15 @@ SimulatorInterface * OpenTxFirmware::getSimulator()
}
}
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
{
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
firmware->addOption("nooverridech", QObject::tr("No OverrideCH functions available"));
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE (no telemetry) at field") }, { "faimode", QObject::tr("FAI MODE (no telemetry) always enabled") }, { NULL } };
firmware->addOptions(fai_options);
}
void registerOpenTxFirmwares()
{
OpenTxFirmware * openTx;
@@ -964,10 +1098,9 @@ void registerOpenTxFirmwares()
Option ext_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
/* 9x board */
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK, false);
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK);
openTx->addOptions(ext_options);
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -980,7 +1113,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOptions(nav_options);
@@ -991,7 +1123,6 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
@@ -1001,11 +1132,11 @@ void registerOpenTxFirmwares()
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9x board with M128 chip */
openTx = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128, false);
openTx = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128);
openTx->addOptions(ext_options);
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1018,7 +1149,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOptions(nav_options);
@@ -1029,15 +1159,14 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR board */
openTx = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK, false);
openTx = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK);
openTx->addOptions(extr_options);
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1050,7 +1179,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1059,7 +1187,6 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
@@ -1068,11 +1195,11 @@ void registerOpenTxFirmwares()
openTx->addOption("nogps", QObject::tr("No GPS support"));
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR board with M128 chip */
openTx = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128, false);
openTx = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128);
openTx->addOptions(extr_options);
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1085,7 +1212,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1094,16 +1220,14 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* Gruvin9x board */
openTx = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X, false);
openTx->setVariantBase(FRSKY_VARIANT);
openTx = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X);
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
openTx->addOption("nofp", QObject::tr("No flight modes"));
@@ -1114,7 +1238,6 @@ void registerOpenTxFirmwares()
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
openTx->addOptions(dsm2_options);
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1124,22 +1247,18 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
#ifndef __APPLE__
/* SKY9X board */
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X, true);
openTx->setVariantBase(FRSKY_VARIANT);
/* Sky9x board */
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
openTx->addOption("nofp", QObject::tr("No flight modes"));
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1149,59 +1268,53 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR-Pro */
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO, true);
openTx->setVariantBase(FRSKY_VARIANT);
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
openTx->addOption("nofp", QObject::tr("No flight modes"));
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
#endif
/* Taranis board */
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS, true);
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOptions(fai_options);
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* Taranis Plus board */
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS, true);
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOptions(fai_options);
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
default_firmware_variant = GetFirmwareVariant("opentx-9x-heli-templates-en");
default_firmware_variant = GetFirmware("opentx-taranis-en");
current_firmware_variant = default_firmware_variant;
}
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,6 @@
#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"
class RleFile;
@@ -35,25 +34,25 @@ class OpenTxEepromInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
protected:
const char * getName();
bool checkVersion(unsigned int version);
EepromLoadErrors checkVersion(unsigned int version);
bool checkVariant(unsigned int version, unsigned int variant);
@@ -80,8 +79,13 @@ class OpenTxEepromInterface : public EEPROMInterface
class OpenTxFirmware: public FirmwareInterface {
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):
FirmwareInterface(parent, id, parent->getName(), parent->getBoard(), parent->eepromInterface)
{
}
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board):
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board))
{
addLanguage("en");
addLanguage("fr");
@@ -103,19 +107,23 @@ class OpenTxFirmware: public FirmwareInterface {
addTTSLanguage("pl");
addTTSLanguage("pt");
addTTSLanguage("es");
addTTSLanguage("hu");
}
virtual FirmwareInterface * getFirmwareVariant(const QString & id);
virtual QString getStampUrl();
virtual QString getReleaseNotesUrl();
virtual QString getFirmwareUrl(QString & id);
virtual QString getFirmwareUrl();
virtual int getCapability(const Capability);
virtual bool isTelemetrySourceAvailable(int source);
virtual SimulatorInterface * getSimulator();
};
void registerOpenTxFirmwares();
@@ -2,4 +2,3 @@
#define DATE_STR "@DATE@"
#define TIME_STR "@TIME@"
#define VERS_STR "@C9X_VERSION@"
#define MOD_STR "FH"
+4 -5
View File
@@ -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,7 +272,6 @@ 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;
@@ -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++) {
+27 -16
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,6 @@
#include <iostream>
#include "th9xinterface.h"
#include "th9xeeprom.h"
#include "th9xsimulator.h"
#include "file.h"
#include "appdata.h"
@@ -57,31 +56,38 @@ const int Th9xInterface::getMaxModels()
return 16;
}
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying th9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Th9xGeneral th9xGeneral;
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
@@ -91,17 +97,19 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
break;
default:
std::cout << "not th9x\n";
return false;
errors.set(NOT_TH9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if (len != sizeof(Th9xGeneral)) {
std::cout << "not th9x\n";
return false;
errors.set(NOT_TH9X);
return errors.to_ulong();
}
radioData.generalSettings = th9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
Th9xModelData th9xModel;
efile->openRd(FILE_MODEL(i));
@@ -110,16 +118,19 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
}
else {
radioData.models[i] = th9xModel;
}
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
+4 -4
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -34,11 +34,11 @@ class Th9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
@@ -1,233 +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 "firmwares/th9x/th9xsimulator.h"
#include "firmwares/th9x/th9xinterface.h"
#define SIM
#define SIMU
#define SIMU_EXCEPTIONS
#undef min
#undef max
#define NUM_POTS 3
#define NUM_CSW 12
#define SWSRC_SW1 10
#include <exception>
#include <algorithm>
namespace Th9x {
#include "simpgmspace.h"
#include "th9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "foldedlist.cpp"
#include "simpgmspace.cpp"
#include "pulses.cpp"
int16_t g_anas[7];
char g_title[80] = "";
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 750;
else
return 512 + g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trimData[idx].itrim = trimRevertM(value, g_model.trimData[idx].tmode);
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++) {
values[i] = trimVal(i);
}
}
void eeprom_RESV_mismatch(void)
{
assert(!"Should never been called. Only needed by VC++ (debug mode)");
}
#define 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 PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
#define TRIM_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, 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)
}
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin &= ~(mask); else pin |= (mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
switch (swtch) {
SWITCH_CASE(0, pine, 1<<INP_E_ThrCt)
SWITCH_CASE(4, pine, 1<<INP_E_AileDR)
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
default:
break;
}
}
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
}
}
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Th9x;
Th9xSimulator::Th9xSimulator(Th9xInterface * th9xInterface):
th9xInterface(th9xInterface)
{
}
bool Th9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Th9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::start(RadioData &radioData, bool tests)
{
th9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Th9xSimulator::stop()
{
StopMainThread();
}
void Th9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
for (int i=0; i<8; i++)
outputs.chans[i] *= 2;
}
void Th9xSimulator::setValues(TxInputs &_inputs)
{
TxInputs inputs = _inputs;
for (int i=0; i<4; i++)
inputs.sticks[i] /= 2;
for (int i=0; i<3; i++)
inputs.pots[i] /= 2;
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::setTrim(unsigned int idx, int value)
{
Th9x::setTrim(idx, value);
}
void Th9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Th9x::getTrims(trims.values);
}
const char * Th9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -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 th9x_simulator_h
#define th9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Th9xInterface;
class Th9xSimulator : public SimulatorInterface {
public:
Th9xSimulator(Th9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Th9xInterface * th9xInterface;
};
#endif
+45 -23
View File
@@ -67,6 +67,11 @@ FlashInterface::FlashInterface(QString fileName):
if (flash_size > 0) {
version = seekLabel(VERS_MARK);
if (version.startsWith("opentx-")) {
int index = version.lastIndexOf('-');
flavour = version.mid(0, index);
version = version.mid(index+1);
}
date = seekLabel(DATE_MARK);
time = seekLabel(TIME_MARK);
eepromId = seekLabel(EEPR_MARK);
@@ -94,7 +99,7 @@ QString FlashInterface::seekString(const QString & string)
if (start > 0) {
start += string.length();
int end = -1;
for (int i=start; i<start+20; i++) {
for (int i=start; i<start+50; i++) {
char c = flash.at(i);
if (c == '\0' || c == '\036') {
end = i;
@@ -219,21 +224,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 +240,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));
}
}
}
@@ -278,10 +275,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,9 +290,11 @@ 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;
}
@@ -311,6 +310,29 @@ bool FlashInterface::isValid()
return isValidFlag;
}
QString FlashInterface::getFlavour()
{
if (flavour == "opentx-x9dp")
return "opentx-taranis-plus";
else if (flavour == "opentx-x9d")
return "opentx-taranis";
else
return flavour;
}
bool FlashInterface::isHardwareCompatible(FlashInterface &previousFirmware)
{
QString newFlavour = getFlavour();
if (newFlavour.isEmpty())
return true;
QString previousFlavour = previousFirmware.getFlavour();
if (previousFlavour.isEmpty())
return true;
return (newFlavour == previousFlavour);
}
uint FlashInterface::saveFlash(QString fileName)
{
uint8_t binflash[MAX_FSIZE];
+3
View File
@@ -47,6 +47,7 @@ class FlashInterface
inline QString getDate() { return date; }
inline QString getTime() { return time; }
int getSize() { return flash_size; }
QString getFlavour();
inline QString getVersion() { return version; }
unsigned int getVersionId() { return versionId; }
inline int getEEpromVersion() { return eepromVersion; }
@@ -60,6 +61,7 @@ class FlashInterface
QImage::Format getSplashFormat();
uint saveFlash(QString fileName);
bool isValid();
bool isHardwareCompatible(FlashInterface &previousFirmware);
private:
QByteArray flash;
@@ -72,6 +74,7 @@ class FlashInterface
QString filename;
QString date;
QString time;
QString flavour;
QString version;
int versionId;
QString eepromId;
+6
View File
@@ -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()
+5 -51
View File
@@ -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
+6 -3
View File
@@ -32,7 +32,7 @@ class GeneralEdit : public QDialog
protected:
virtual bool eventFilter(QObject *obj, QEvent *event);
signals:
void modelValuesChanged();
@@ -108,11 +108,11 @@ class GeneralEdit : public QDialog
void on_bgVolume_SL_valueChanged();
void on_varioVolume_SL_valueChanged();
void on_wavVolume_SL_valueChanged();
void on_varioP0_SB_editingFinished();
void on_varioPMax_SB_editingFinished();
void on_varioR0_SB_editingFinished();
void on_pot1Type_currentIndexChanged(int index);
void on_pot2Type_currentIndexChanged(int index);
void on_pot3Type_currentIndexChanged(int index);
@@ -128,6 +128,8 @@ class GeneralEdit : public QDialog
void on_mavbaud_CB_currentIndexChanged(int index);
void on_voiceLang_CB_currentIndexChanged(int index);
void on_battCalibDSB_editingFinished();
void on_vBatMinDSB_editingFinished();
void on_vBatMaxDSB_editingFinished();
void on_battwarningDSB_editingFinished();
void on_contrastSB_editingFinished();
void on_calretrieve_PB_clicked();
@@ -137,6 +139,7 @@ class GeneralEdit : public QDialog
void shrink();
void stickReverseEdited();
void on_switchesDelay_valueChanged();
void on_blAlarm_ChkB_stateChanged();
};
#endif // GENERALEDIT_H
+1536 -1359
View File
File diff suppressed because it is too large Load Diff
-73
View File
@@ -1,73 +0,0 @@
#include "googleanalytics.h"
#include <QtGui>
#define TRACKING_ID "UA-40098569-1"
GoogleAnalytics ga;
GoogleAnalytics::GoogleAnalytics():
userId(qrand()),
networkManager(new QNetworkAccessManager(this))
{
}
GoogleAnalytics::~GoogleAnalytics()
{
delete networkManager;
}
void GoogleAnalytics::sendPageView(QString title)
{
// create request and set URL of receiver
QNetworkRequest request;
QUrl host("http://www.google-analytics.com/collect");
request.setUrl(host);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
// setup parameters of request
QString requestParams;
requestParams += "v=1"; // version of protocol
requestParams += "&t=pageview"; // type of request
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
requestParams += "&cid=" + QString::number(userId); // unique user identifier
requestParams += "&dp=companion-" + title.toLower().replace(" ", "-"); // name of page
requestParams += "&dt=" + title; // title of page
requestParams += "&ul=" + QLocale::system().name(); // language
// send request via post method
networkManager->post(request, requestParams.toStdString().c_str());
}
void GoogleAnalytics::sendEvent(QString category, QString action, QString label)
{
// create request and set URL of receiver
QNetworkRequest request;
QUrl host("http://www.google-analytics.com/collect");
request.setUrl(host);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
// setup parameters of request
QString requestParams;
requestParams += "v=1"; // version of protocol
requestParams += "&t=event"; // type of request
requestParams += "&ec=" + category;
requestParams += "&ea=" + action;
requestParams += "&el=" + label;
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
requestParams += "&cid=" + QString::number(userId); // unique user identifier
requestParams += "&dt=Companion"; // name of page (or app name)
requestParams += "&ul=" + QLocale::system().name(); // language
// send request via post method
networkManager->post(request, requestParams.toStdString().c_str());
}
void GoogleAnalytics::slot_receive(QNetworkReply * reply)
{
// output information about reply
qDebug() << "RequestUrl:" << reply->request().url();
qDebug() << "Status:" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
qDebug() << "Error:"<< reply->error();
QByteArray bytes = reply->readAll();
qDebug() << "Contents" << QString::fromUtf8(bytes.data(), bytes.size());
}
-21
View File
@@ -1,21 +0,0 @@
#include <QtNetwork>
class GoogleAnalytics: public QObject
{
Q_OBJECT
public:
GoogleAnalytics();
~GoogleAnalytics();
void sendPageView(QString page);
void sendEvent(QString category, QString action, QString label="");
protected slots:
void slot_receive(QNetworkReply * reply);
protected:
int userId;
QNetworkAccessManager * networkManager;
};
extern GoogleAnalytics ga;
+313 -142
View File
@@ -1,4 +1,11 @@
#include <QtGui>
#if defined WIN32
#include <io.h>
#include <stdio.h>
#endif
#if !defined WIN32 && defined __GNUC__
#include <unistd.h>
#endif
#include "appdata.h"
#include "helpers.h"
#include "simulatordialog.h"
@@ -72,7 +79,7 @@ QString getInputStr(ModelData & model, int index)
}
}
else {
result = RawSource(SOURCE_TYPE_STICK, index).toString();
result = RawSource(SOURCE_TYPE_STICK, index).toString(model);
}
return result;
@@ -140,58 +147,55 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
}
bool gvarsEnabled()
{
int gvars=0;
if (GetCurrentFirmware()->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1;
}
}
else {
gvars=1;
}
return gvars;
}
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
sb(dynamic_cast<QSpinBox *>(weightSB)),
dsb(dynamic_cast<QDoubleSpinBox *>(weightSB)),
weightCB(weightCB),
weight(weight),
flags(flags),
lock(false)
step(step),
lock(true)
{
lock = true;
if (gvarsEnabled()) {
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(weightCB, weight);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
}
else {
weightGV->hide();
if (weight > maxi || weight < -mini) {
if (weight > maxi || weight < mini) {
weight = deflt;
}
}
weightSB->setMinimum(mini);
weightSB->setMaximum(maxi);
int val;
if (weight>maxi || weight<mini) {
val = deflt;
weightGV->setChecked(true);
weightSB->hide();
weightCB->show();
}
else {
val = weight;
weightGV->setChecked(false);
weightSB->setValue(weight);
weightSB->show();
weightCB->hide();
}
if (sb) {
sb->setMinimum(mini);
sb->setMaximum(maxi);
sb->setValue(val);
}
else {
dsb->setMinimum(mini*step);
dsb->setMaximum(maxi*step);
dsb->setValue(val*step);
}
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
lock = false;
@@ -200,16 +204,23 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
void GVarGroup::gvarCBChanged(int state)
{
weightCB->setVisible(state);
weightSB->setVisible(!state);
if (weightSB)
weightSB->setVisible(!state);
else
weightSB->setVisible(!state);
valuesChanged();
}
void GVarGroup::valuesChanged()
{
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else
weight = weightSB->value();
if (!lock) {
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
}
}
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
@@ -223,14 +234,14 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
lock(false),
lastType(-1)
{
curveTypeCB->addItem(tr("Diff"));
curveTypeCB->addItem(tr("Expo"));
curveTypeCB->addItem(tr("Func"));
curveTypeCB->addItem(tr("Curve"));
if (!(flags & HIDE_DIFF)) curveTypeCB->addItem(tr("Diff"), 0);
if (!(flags & HIDE_EXPO)) curveTypeCB->addItem(tr("Expo"), 1);
curveTypeCB->addItem(tr("Func"), 2);
curveTypeCB->addItem(tr("Curve"), 3);
curveValueCB->setMaxVisibleItems(10);
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
@@ -242,10 +253,12 @@ void CurveGroup::update()
{
lock = true;
curveTypeCB->setCurrentIndex(curve.type);
int found = curveTypeCB->findData(curve.type);
if (found < 0) found = 0;
curveTypeCB->setCurrentIndex(found);
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
curveGVarCB->show();
curveGVarCB->setVisible(GetCurrentFirmware()->getCapability(Gvars));
if (curve.value > 100 || curve.value < -100) {
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
@@ -285,11 +298,13 @@ void CurveGroup::update()
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=-numcurves; i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
if (i == curve.value) {
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
}
}
}
curveValueCB->setCurrentIndex(curve.value+numcurves);
break;
}
default:
@@ -304,7 +319,7 @@ void CurveGroup::gvarCBChanged(int state)
{
if (!lock) {
if (state) {
curve.value = 10000; // TODO constant in EEpromInterface ...
curve.value = 10000+1; // TODO constant in EEpromInterface ...
}
else {
curve.value = 0; // TODO could be better
@@ -314,10 +329,33 @@ void CurveGroup::gvarCBChanged(int state)
}
}
void CurveGroup::typeChanged(int value)
{
if (!lock) {
int type = curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
switch (type) {
case 0:
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
break;
case 1:
curve = CurveReference(CurveReference::CURVE_REF_EXPO, 0);
break;
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, 0);
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, 0);
break;
}
update();
}
}
void CurveGroup::valuesChanged()
{
if (!lock) {
switch (curveTypeCB->currentIndex()) {
switch (curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt()) {
case 0:
case 1:
{
@@ -326,14 +364,14 @@ void CurveGroup::valuesChanged()
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
else
value = curveValueSB->value();
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
curve = CurveReference(curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
break;
}
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->itemData(curveValueCB->currentIndex()).toInt());
break;
}
@@ -363,43 +401,13 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
}
}
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
{
GeneralSettings fakeSettings;
if (IS_ARM(GetEepromInterface()->getBoard())) {
populateSwitchCB(b, value, fakeSettings);
}
else {
RawSwitch item;
b->clear();
item = RawSwitch(SWITCH_TYPE_NONE);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
for (int i=1; i<=GetCurrentFirmware()->getCapability(SwitchesPositions); i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=1; i<=6; i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context)
{
RawSwitch item;
b->clear();
if (attr & POPULATE_ONOFF) {
if (context != MixesContext) {
// !FMx
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<0; i++) {
@@ -408,14 +416,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
// !One
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// OFF
item = RawSwitch(SWITCH_TYPE_OFF);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=-GetCurrentFirmware()->getCapability(LogicalSwitches); i<0; i++) {
@@ -448,11 +448,15 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
for (int i=-GetCurrentFirmware()->getCapability(SwitchesPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
//hide up and down for !SH and !SF, because they are redundant (!SFup == SFdown)
if (item.toString().contains("H") || item.toString().contains("F")) continue;
}
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_TIMER_MODES) {
if (context == TimersContext) {
for (int i=0; i<5; i++) {
item = RawSwitch(SWITCH_TYPE_TIMER_MODE, i);
b->addItem(item.toString(), item.toValue());
@@ -499,7 +503,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_ONOFF) {
if (context == CustomFunctionsContext) {
// ON
item = RawSwitch(SWITCH_TYPE_ON);
b->addItem(item.toString(), item.toValue());
@@ -508,7 +512,10 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// FMx
}
// FMx
if (context != MixesContext) {
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=1; i<=GetCurrentFirmware()->getCapability(FlightModes); i++) {
item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i);
@@ -523,8 +530,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
void populateGVCB(QComboBox *b, int value)
{
int selected=0;
int nullitem;
bool selected = false;
b->clear();
@@ -534,29 +540,22 @@ void populateGVCB(QComboBox *b, int value)
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
selected=1;
selected = true;
}
}
b->addItem("---", 0);
nullitem=b->count()-1;
if (value == 0) {
b->setCurrentIndex(b->count()-1);
selected=1;
}
for (int i=1; i<=pgvars; i++) {
int16_t gval = (int16_t)(10000+i);
b->addItem(QObject::tr("GV%1").arg(i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
selected=1;
selected = true;
}
}
if (selected==0)
b->setCurrentIndex(nullitem);
if (!selected) {
b->setCurrentIndex(pgvars);
}
}
void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags)
@@ -567,16 +566,27 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (flags & POPULATE_SOURCES) {
item = RawSource(SOURCE_TYPE_NONE);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
if (flags & POPULATE_SCRIPT_OUTPUTS) {
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
item = RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
}
if (flags & POPULATE_VIRTUAL_INPUTS) {
int virtualInputs = GetCurrentFirmware()->getCapability(VirtualInputs);
for (int i=0; i<virtualInputs; i++) {
if (model.isInputValid(i)) {
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, &model);
b->addItem(item.toString(), item.toValue());
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -585,12 +595,12 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (flags & POPULATE_SOURCES) {
for (int i=0; i<4+GetCurrentFirmware()->getCapability(Pots); i++) {
item = RawSource(SOURCE_TYPE_STICK, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
item = RawSource(SOURCE_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -598,27 +608,27 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (flags & POPULATE_TRIMS) {
for (int i=0; i<4; i++) {
item = RawSource(SOURCE_TYPE_TRIM, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
if (flags & POPULATE_SOURCES) {
item = RawSource(SOURCE_TYPE_MAX);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
if (flags & POPULATE_SWITCHES) {
for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
item = RawSource(SOURCE_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -626,19 +636,19 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (flags & POPULATE_SOURCES) {
for (int i=0; i<NUM_CYC; i++) {
item = RawSource(SOURCE_TYPE_CYC, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<GetCurrentFirmware()->getCapability(TrainerInputs); i++) {
item = RawSource(SOURCE_TYPE_PPM, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
item = RawSource(SOURCE_TYPE_CH, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -648,7 +658,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(GetCurrentFirmware()->getBoard()))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -657,7 +667,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(GetCurrentFirmware()->getBoard()))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -665,7 +675,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (flags & POPULATE_GVARS) {
for (int i=0; i<GetCurrentFirmware()->getCapability(Gvars); i++) {
item = RawSource(SOURCE_TYPE_GVAR, i);
b->addItem(item.toString(), item.toValue());
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
@@ -791,36 +801,77 @@ QString getFrSkyMeasure(int units)
QString getFrSkySrc(int index)
{
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString();
ModelData model;
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString(model);
}
QString getTrimInc(ModelData * g_model)
{
switch (g_model->trimInc) {
case (1): return QObject::tr("Extra Fine");
case (2): return QObject::tr("Fine");
case (3): return QObject::tr("Medium");
case (4): return QObject::tr("Coarse");
default: return QObject::tr("Exponential");
}
switch (g_model->trimInc) {
case -2:
return QObject::tr("Exponential");
case -1:
return QObject::tr("Extra Fine");
case 0:
return QObject::tr("Fine");
case 1:
return QObject::tr("Medium");
case 2:
return QObject::tr("Coarse");
default:
return QObject::tr("Unknown");
}
}
QString getTimerStr(TimerData & timer)
{
QString str = ", " + (timer.dir ? QObject::tr("Count Up") : QObject::tr("Count Down"));
return QObject::tr("%1:%2, ").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0')) + timer.mode.toString() + str;
QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0'));
result += QString(", ") + timer.mode.toString();
if (timer.persistent)
result += QObject::tr(", Persistent");
if (timer.minuteBeep)
result += QObject::tr(", MinuteBeep");
if (timer.countdownBeep == 1)
result += QObject::tr(", CountDown(Beeps)");
else if (timer.countdownBeep == 2)
result += QObject::tr(", CountDown(Voice)");
return result;
}
QString getProtocol(ModelData * g_model)
QString getProtocol(ModuleData & module)
{
QString str = getProtocolStr(g_model->moduleData[0].protocol);
if (g_model->moduleData[0].protocol == PPM)
str.append(QObject::tr(": %1 Channels, %2usec Delay").arg(g_model->moduleData[0].channelsCount).arg(g_model->moduleData[0].ppmDelay));
QString str = getProtocolStr(module.protocol);
if (module.protocol == PPM)
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
else if (!module.protocol == OFF)
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
return str;
}
QString getTrainerMode(const int trainermode, ModuleData & module)
{
QString result;
switch (trainermode) {
case 1:
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
break;
case 2:
result=QObject::tr("Master/SBUS Module");
break;
case 3:
result=QObject::tr("Master/CPPM Module");
break;
case 4:
result=QObject::tr("Master/SBUS in battery compartment");
break;
default:
result=QObject::tr("Master/Jack");
}
return result;
}
QString getPhasesStr(unsigned int phases, ModelData & model)
{
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
@@ -835,7 +886,7 @@ QString getPhasesStr(unsigned int phases, ModelData & model)
for (int i=0; i<numphases;i++) {
if (!(phases & (1<<i))) {
if (count++ > 0) str += QString(", ");
str += getPhaseName(i+1, model.phaseData[i].name);
str += getPhaseName(i+1, model.flightModeData[i].name);
}
}
}
@@ -849,18 +900,37 @@ QString getPhasesStr(unsigned int phases, ModelData & model)
}
}
QString getCenterBeep(ModelData * g_model)
QString getCenterBeepStr(ModelData * g_model)
{
//RETA123
QStringList strl;
if(g_model->beepANACenter & 0x01) strl << QObject::tr("Rudder");
if(g_model->beepANACenter & 0x02) strl << QObject::tr("Elevator");
if(g_model->beepANACenter & 0x04) strl << QObject::tr("Throttle");
if(g_model->beepANACenter & 0x08) strl << QObject::tr("Aileron");
if(g_model->beepANACenter & 0x10) strl << "P1";
if(g_model->beepANACenter & 0x20) strl << "P2";
if(g_model->beepANACenter & 0x40) strl << "P3";
if(g_model->beepANACenter & 0x80) strl << "LS";
if (g_model->beepANACenter & 0x01)
strl << QObject::tr("Rudder");
if (g_model->beepANACenter & 0x02)
strl << QObject::tr("Elevator");
if (g_model->beepANACenter & 0x04)
strl << QObject::tr("Throttle");
if (g_model->beepANACenter & 0x08)
strl << QObject::tr("Aileron");
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
if (g_model->beepANACenter & 0x10)
strl << "S1";
if (g_model->beepANACenter & 0x20)
strl << "S2";
if (g_model->beepANACenter & 0x40)
strl << "S3";
if (g_model->beepANACenter & 0x80)
strl << "LS";
if (g_model->beepANACenter & 0x100)
strl << "RS";
}
else {
if (g_model->beepANACenter & 0x10)
strl << "P1";
if (g_model->beepANACenter & 0x20)
strl << "P2";
if (g_model->beepANACenter & 0x40)
strl << "P3";
}
return strl.join(", ");
}
@@ -978,3 +1048,104 @@ QString index2version(int index)
return QString();
}
}
int qunlink(const QString & fileName)
{
QByteArray ba = fileName.toLatin1();
return unlink(ba.constData());
}
QString generateProcessUniqueTempFileName(const QString & fileName)
{
QString sanitizedFileName = fileName;
sanitizedFileName.remove('/');
return QDir::tempPath() + QString("/%1-").arg(QCoreApplication::applicationPid()) + sanitizedFileName;
}
bool isTempFileName(const QString & fileName)
{
return fileName.startsWith(QDir::tempPath());
}
QString getSoundsPath(const GeneralSettings &generalSettings)
{
QString path = g.profile[g.id()].sdPath() + "/SOUNDS/";
QString lang = generalSettings.ttsLanguage;
if (lang.isEmpty())
lang = "en";
path.append(lang);
return path;
}
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen)
{
QSet<QString> result;
QDir dir(path);
if (dir.exists()) {
foreach (QString filename, dir.entryList(filter, QDir::Files)) {
QFileInfo file(filename);
QString name = file.completeBaseName();
if (name.length() <= maxLen) {
result.insert(name);
}
}
}
return result;
}
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
{
return s1.toLower() < s2.toLower();
}
bool GpsGlitchFilter::isGlitch(double latitude, double longitude)
{
if ((fabs(latitude) < 0.1) && (fabs(longitude) < 0.1)) {
return true;
}
if (lastValid) {
if (fabs(latitude - lastLat) > 0.01) {
// qDebug() << "GpsGlitchFilter(): latitude glitch " << latitude << lastLat;
if ( ++glitchCount < 10) {
return true;
}
}
if (fabs(longitude - lastLon) > 0.01) {
// qDebug() << "GpsGlitchFilter(): longitude glitch " << longitude << lastLon;
if ( ++glitchCount < 10) {
return true;
}
}
}
lastLat = latitude;
lastLon = longitude;
lastValid = true;
glitchCount = 0;
return false;
}
bool GpsLatLonFilter::isValid(const QString & latitude, const QString & longitude)
{
if (lastLat == latitude) {
return false;
}
if (lastLon == longitude) {
return false;
}
lastLat = latitude;
lastLon = longitude;
return true;
}
double toDecimalCoordinate(const QString & value)
{
if (value.isEmpty()) return 0.0;
double temp = int(value.left(value.length()-1).toDouble() / 100);
double result = temp + (value.left(value.length() - 1).toDouble() - temp * 100) / 60.0;
QChar direction = value.at(value.size()-1);
if ((direction == 'S') || (direction == 'W')) {
result = -result;
}
return result;
}
+77 -20
View File
@@ -6,7 +6,7 @@
extern const QColor colors[C9X_MAX_CURVES];
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
#define TMR_NUM_OPTION (TMRMODE_COUNT+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
//convert from mode 1 to mode generalSettings.stickMode
//NOTICE! => 1..4 -> 1..4
@@ -37,14 +37,12 @@ class CompanionIcon: public QIcon {
CompanionIcon(QString baseimage);
};
bool gvarsEnabled();
class GVarGroup : public QObject {
class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -52,13 +50,19 @@ class GVarGroup : public QObject {
protected:
QCheckBox *weightGV;
QSpinBox *weightSB;
QAbstractSpinBox *weightSB;
QSpinBox *sb;
QDoubleSpinBox *dsb;
QComboBox *weightCB;
int & weight;
const unsigned int flags;
double step;
bool lock;
};
#define HIDE_DIFF 0x01
#define HIDE_EXPO 0x02
#define HIDE_NEGATIVE_CURVES 0x04
class CurveGroup : public QObject {
Q_OBJECT
@@ -69,6 +73,7 @@ class CurveGroup : public QObject {
protected slots:
void gvarCBChanged(int);
void typeChanged(int);
void valuesChanged();
protected:
@@ -82,23 +87,29 @@ class CurveGroup : public QObject {
int lastType;
};
#define POPULATE_ONOFF 0x01
#define POPULATE_TIMER_MODES 0x02
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value);
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
enum SwitchContext
{
LogicalSwitchesContext,
CustomFunctionsContext,
TimersContext,
MixesContext
};
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context);
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
QString getProtocolStr(const int proto);
QString getPhasesStr(unsigned int phases, ModelData & model);
#define POPULATE_SOURCES 1
#define POPULATE_TRIMS 2
#define POPULATE_SWITCHES 4
#define POPULATE_GVARS 8
#define POPULATE_TELEMETRY 16
#define POPULATE_TELEMETRYEXT 32
#define POPULATE_VIRTUAL_INPUTS 64
#define POPULATE_SOURCES (1<<0)
#define POPULATE_TRIMS (1<<1)
#define POPULATE_SWITCHES (1<<2)
#define POPULATE_GVARS (1<<3)
#define POPULATE_TELEMETRY (1<<4)
#define POPULATE_TELEMETRYEXT (1<<5)
#define POPULATE_VIRTUAL_INPUTS (1<<6)
#define POPULATE_SCRIPT_OUTPUTS (1<<7)
#define GVARS_VARIANT 0x0001
#define FRSKY_VARIANT 0x0002
@@ -114,8 +125,9 @@ int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModelData * g_model);
QString getCenterBeep(ModelData * g_model);
QString getProtocol(ModuleData & module);
QString getTrainerMode(const int trainermode, ModuleData & module);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */
QString getFrSkyAlarmType(int alarm);
@@ -132,4 +144,49 @@ QPixmap makePixMap( QImage image, QString firmwareType );
int version2index(QString version);
QString index2version(int index);
class QTimeS : public QTime
{
public:
QTimeS(int s) { int h = s/3600; s %= 3600; int m = s/60; s %=60; setHMS(h, m, s); };
QTimeS(const QTime & q) : QTime(q) {};
int seconds() const { return hour()*3600 + minute()*60 + second(); };
};
int qunlink(const QString & fileName);
QString generateProcessUniqueTempFileName(const QString & fileName);
bool isTempFileName(const QString & fileName);
QString getSoundsPath(const GeneralSettings &generalSettings);
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
bool caseInsensitiveLessThan(const QString &s1, const QString &s2);
class GpsGlitchFilter
{
public:
GpsGlitchFilter() : lastValid(false), glitchCount(0) {};
bool isGlitch(double latitude, double longitude);
private:
bool lastValid;
int glitchCount;
double lastLat;
double lastLon;
};
class GpsLatLonFilter
{
public:
GpsLatLonFilter() {};
bool isValid(const QString & latitude, const QString & longitude);
private:
QString lastLat;
QString lastLon;
};
double toDecimalCoordinate(const QString & value);
#endif // HELPERS_H
Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

+20 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>685</width>
<height>418</height>
<height>432</height>
</rect>
</property>
<property name="sizePolicy">
@@ -441,6 +441,25 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>backLightColor</tabstop>
<tabstop>joystickCB</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>simuSW</tabstop>
<tabstop>snapshotPath</tabstop>
<tabstop>snapshotPathButton</tabstop>
<tabstop>snapshotClipboardCKB</tabstop>
<tabstop>libraryPath</tabstop>
<tabstop>libraryPathButton</tabstop>
<tabstop>splashincludeCB</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>splashLibraryButton</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>InvertPixels</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
File diff suppressed because it is too large Load Diff
+50 -14
View File
@@ -3,7 +3,38 @@
#include <QtCore>
#include <QtGui>
#include "qcustomplot.h"
#include "qcustomplot/qcustomplot.h"
#define INVALID_MIN 999999
#define INVALID_MAX -999999
enum yaxes_t {
firstLeft = 0,
firstRight,
secondLeft,
secondRight,
AXES_LIMIT // = 4
};
struct coords {
QVector<double> x, y;
double min_y;
double max_y;
yaxes_t yaxis;
QString name;
};
struct minMax {
double min;
double max;
};
struct plotsCollection {
QVarLengthArray<struct coords> coords;
double min_x;
double max_x;
bool tooManyRanges;
};
namespace Ui {
class logsDialog;
@@ -12,38 +43,43 @@ namespace Ui {
class logsDialog : public QDialog
{
Q_OBJECT
public:
explicit logsDialog(QWidget *parent = 0);
~logsDialog();
private slots:
void titleDoubleClick();
void titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title);
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
void selectionChanged();
void mousePress();
void mouseWheel();
void removeSelectedGraph();
void removeAllGraphs();
void moveLegend();
void plotLogs();
void plotValue(int index, int plot, int numplots);
void plottableItemDoubleClick(QCPAbstractPlottable * plottable, QMouseEvent * event);
// void graphClicked(QCPAbstractPlottable *plottable);
void on_fileOpen_BT_clicked();
void on_sessions_CB_currentIndexChanged(int index);
void on_mapsButton_clicked();
void yAxisChangeRanges(QCPRange range);
private:
QList<QStringList> csvlog;
Ui::logsDialog *ui;
bool cvsFileParse();
double GetScale(QString channel);
QList<QColor> palette;
QCPAxisRect *axisRect;
QCPLegend *rightLegend;
bool plotLock;
QString logFilename;
QVarLengthArray<Qt::GlobalColor> colors;
QPen pen;
double yAxesRatios[AXES_LIMIT];
minMax yAxesRanges[AXES_LIMIT];
bool cvsFileParse();
QList<QStringList> filterGePoints(const QList<QStringList> & input);
void exportToGoogleEarth();
};
#endif // LOGSDIALOG_H
+12 -1
View File
@@ -283,10 +283,21 @@
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header>./qcustomplot.h</header>
<header>qcustomplot/qcustomplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>FileName_LE</tabstop>
<tabstop>fileOpen_BT</tabstop>
<tabstop>FieldsTW</tabstop>
<tabstop>ZoomX_ChkB</tabstop>
<tabstop>ZoomY_ChkB</tabstop>
<tabstop>Reset_PB</tabstop>
<tabstop>sessions_CB</tabstop>
<tabstop>logTable</tabstop>
<tabstop>mapsButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
+225 -172
View File
@@ -64,9 +64,8 @@
#include "helpers.h"
#include "appdata.h"
#include "radionotfound.h"
#include "googleanalytics.h"
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
#ifdef __APPLE__
@@ -111,12 +110,12 @@ MainWindow::MainWindow():
this->setIconSize(QSize(32, 32));
QNetworkProxyFactory::setUseSystemConfiguration(true);
setAcceptDrops(true);
// give time to the splash to disappear and main window to open before starting updates
int updateDelay = 1000;
bool showSplash = g.showSplash();
if (showSplash) {
updateDelay += (SPLASH_TIME*1000);
updateDelay += (SPLASH_TIME*1000);
}
QTimer::singleShot(updateDelay, this, SLOT(doAutoUpdates()));
QTimer::singleShot(updateDelay, this, SLOT(displayWarnings()));
@@ -154,18 +153,16 @@ MainWindow::MainWindow():
child->show();
}
else {
child->show();
child->show();
child->print(model,printfilename);
child->close();
}
}
}
}
}
if (printing) {
QTimer::singleShot(0, this, SLOT(autoClose()));
}
ga.sendPageView("Home");
}
void MainWindow::displayWarnings()
@@ -183,10 +180,48 @@ void MainWindow::displayWarnings()
}
}
else if (warnId==0) {
g.warningId(WARNING_ID);
g.warningId(WARNING_ID);
}
}
QString MainWindow::getBackupPath() {
QString backupPath;
bool backupEnable = g.profile[g.id()].penableBackup();
if (backupEnable) {
backupPath=g.profile[g.id()].pBackupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
backupEnable = false;
}
}
else {
backupEnable = false;
}
}
if (!backupEnable) {
backupEnable=g.enableBackup();
backupPath = g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
backupEnable = false;
}
}
else {
backupEnable = false;
}
}
if ((g.enableBackup() || g.profile[g.id()].penableBackup()) && !(backupEnable) && !IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!QDir(backupPath).exists()) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
}
else {
backupEnable=false;
}
if (!backupEnable) backupPath.clear();
return backupPath;
}
void MainWindow::doAutoUpdates()
{
if (g.autoCheckApp())
@@ -233,7 +268,7 @@ void MainWindow::checkForUpdates()
}
else if (checkForUpdatesState & CHECK_FIRMWARE) {
checkForUpdatesState -= CHECK_FIRMWARE;
QString stamp = GetFirmware(current_firmware_variant.id)->getStampUrl();
QString stamp = GetCurrentFirmware()->getStampUrl();
if (!stamp.isEmpty()) {
networkManager = new QNetworkAccessManager(this);
connect(networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(checkForFirmwareUpdateFinished(QNetworkReply*)));
@@ -281,15 +316,15 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
int c9xver = version2index(c9xversion);
if (c9xver < vnum) {
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
"Would you like to download it?").arg(version) ,
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
#if defined __APPLE__
#if defined __APPLE__
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version));
#else
#else
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version), tr("Executable (*.exe)"));
#endif
if (!fileName.isEmpty()) {
@@ -302,7 +337,7 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
}
#else
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available, please check the OpenTX website!"));
#endif
#endif
}
else {
if (downloadDialog_forWait && checkForUpdatesState==0) {
@@ -365,7 +400,7 @@ void MainWindow::firmwareDownloadAccepted()
return;
}
file.close();
g.fwRev.set(current_firmware_variant.id, version2index(firmwareVersionString));
g.fwRev.set(current_firmware_variant->getId(), version2index(firmwareVersionString));
if (g.profile[g.id()].burnFirmware()) {
int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the radio now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
@@ -400,7 +435,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
download = true;
}
else {
int currentVersion = g.fwRev.get(current_firmware_variant.id);
int currentVersion = g.fwRev.get(current_firmware_variant->getId());
QString currentVersionString = index2version(currentVersion);
QMessageBox msgBox;
@@ -409,10 +444,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
if (currentVersion == 0) {
QString rn = GetFirmware(current_firmware_variant.id)->getReleaseNotesUrl();
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
QAbstractButton *rnButton = NULL;
msgBox.setWindowTitle("Companion");
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?").arg(current_firmware_variant.id).arg(versionString));
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(versionString));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
if (!rn.isEmpty()) {
@@ -438,10 +473,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
}
}
else if (version > currentVersion) {
QString rn = GetFirmware(current_firmware_variant.id)->getReleaseNotesUrl();
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
QAbstractButton *rnButton = NULL;
msgBox.setText("Companion");
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now ?").arg(current_firmware_variant.id).arg(currentVersionString).arg(versionString));
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
if (!rn.isEmpty()) {
@@ -479,7 +514,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
if (ignore) {
int res = QMessageBox::question(this, "Companion", tr("Ignore this release %1?").arg(versionString), QMessageBox::Yes | QMessageBox::No);
if (res==QMessageBox::Yes) {
g.fwRev.set(current_firmware_variant.id, version);
g.fwRev.set(current_firmware_variant->getId(), version);
}
}
else if (download == true) {
@@ -496,10 +531,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
void MainWindow::startFirmwareDownload()
{
QString url = current_firmware_variant.getFirmwareUrl();
QString url = current_firmware_variant->getFirmwareUrl();
qDebug() << url;
QString ext = url.mid(url.lastIndexOf("."));
QString defaultFilename = g.flashDir() + "/" + current_firmware_variant.id;
QString defaultFilename = g.flashDir() + "/" + current_firmware_variant->getId();
if (g.profile[g.id()].renameFwFiles()) {
defaultFilename += "-" + firmwareVersionString;
}
@@ -512,7 +547,6 @@ void MainWindow::startFirmwareDownload()
downloadDialog * dd = new downloadDialog(this, url, filename);
connect(dd, SIGNAL(accepted()), this, SLOT(firmwareDownloadAccepted()));
dd->exec();
ga.sendEvent(getBoardName(GetCurrentFirmware()->getBoard()), "Download", url);
}
}
@@ -530,9 +564,9 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
void MainWindow::setLanguage(QString langString)
{
{
g.locale( langString );
QMessageBox msgBox;
msgBox.setText(tr("The selected language will be used the next time you start Companion."));
msgBox.setIcon(QMessageBox::Information);
@@ -541,9 +575,9 @@ void MainWindow::setLanguage(QString langString)
}
void MainWindow::setTheme(int index)
{
{
g.theme( index );
QMessageBox msgBox;
msgBox.setText(tr("The new theme will be loaded the next time you start Companion."));
msgBox.setIcon(QMessageBox::Information);
@@ -552,7 +586,7 @@ void MainWindow::setTheme(int index)
}
void MainWindow::setIconThemeSize(int index)
{
{
g.iconSize( index );
QMessageBox msgBox;
@@ -636,8 +670,7 @@ void MainWindow::loadProfile() //TODO Load all variables - Also HW!
int profnum=action->data().toInt();
g.id( profnum );
// TODO Get rid of this global variable - The profile.firmware is the real source
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
@@ -692,7 +725,7 @@ void MainWindow::fwchangelog()
}
void MainWindow::customizeSplash()
{
{
customizeSplashDialog *cd = new customizeSplashDialog(this);
cd->exec();
}
@@ -809,9 +842,9 @@ QStringList MainWindow::GetSambaArguments(const QString &tcl)
{
QStringList result;
QString tclFilename = QDir::tempPath() + "/temp.tcl";
QString tclFilename = generateProcessUniqueTempFileName("temp.tcl");
if (QFile::exists(tclFilename)) {
unlink(tclFilename.toAscii());
qunlink(tclFilename);
}
QFile tclFile(tclFilename);
if (!tclFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -868,7 +901,7 @@ QStringList MainWindow::GetSendFlashCommand(const QString &filename)
QStringList ret;
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) {
ret=GetDFUUtilArguments("-D", filename);
ret=GetDFUUtilArguments("-D", filename);
}
else if (eepromInterface->getBoard() == BOARD_SKY9X) {
ret=GetSambaArguments(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
@@ -886,7 +919,7 @@ QStringList MainWindow::GetReceiveFlashCommand(const QString &filename)
{
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) {
return GetDFUUtilArguments("-U", filename);
return GetDFUUtilArguments("-U", filename);
}
else if (eepromInterface->getBoard() == BOARD_SKY9X) {
return GetSambaArguments(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x40000 0\n");
@@ -951,21 +984,23 @@ QString MainWindow::FindMassstoragePath(QString filename)
void MainWindow::readEeprom()
{
QString tempDir = QDir::tempPath();
QString tempFile;
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_ARM(eepromInterface->getBoard()))
tempFile = tempDir + "/temp.bin";
if (IS_ARM(eepromInterface->getBoard()))
tempFile = generateProcessUniqueTempFileName("temp.bin");
else
tempFile = tempDir + "/temp.hex";
tempFile += generateProcessUniqueTempFileName("temp.hex");
qDebug() << "MainWindow::readEeprom(): using temp file: " << tempFile;
if (readEepromFromRadio(tempFile, tr("Read Models and Settings From Radio"))) {
MdiChild *child = createMdiChild();
child->newFile();
child->loadFile(tempFile, false);
child->show();
qunlink(tempFile);
}
}
@@ -980,11 +1015,12 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
file.remove();
}
g.flashDir(QFileInfo(filename).dir().absolutePath());
// g.flashDir(QFileInfo(filename).dir().absolutePath());
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = FindMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << path << "into" << filename;
QStringList str;
str << path << filename;
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
@@ -997,6 +1033,7 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
if (result == false) {
QStringList str = GetReceiveFlashCommand(filename);
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << filename << "with avrdude:" << str;
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
ad->setWindowIcon(CompanionIcon("read_flash.png"));
ad->exec();
@@ -1019,6 +1056,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = FindMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << path << "from" << filename;
QStringList str;
str << filename << path;
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
@@ -1031,6 +1069,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
if (result == false) {
QStringList str = GetSendFlashCommand(filename);
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << filename << "with avrdude:" << str;
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message, AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
CompanionIcon iconw("write_flash.png");
ad->setWindowIcon(iconw);
@@ -1047,7 +1086,10 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
QFile file(filename);
if (file.exists()) {
file.remove();
if (!file.remove()) {
QMessageBox::warning(this, tr("Error"), tr("Could not delete temporary file: %1").arg(filename));
return false;
}
}
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
@@ -1149,20 +1191,9 @@ void MainWindow::writeBackup()
if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
bool backupEnable = g.enableBackup();
QString backupPath = g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable = false;
}
}
else {
backupEnable = false;
}
bool backupEnable=true;
QString backupPath=getBackupPath();
if (backupPath.isEmpty()) backupEnable=false;
if (backup) {
if (backupEnable) {
QString backupFile = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
@@ -1170,13 +1201,11 @@ void MainWindow::writeBackup()
return;
}
int oldrev = getEpromVersion(fileName);
QString tempDir = QDir::tempPath();
QString tempFlash = tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!convertEEPROM(fileName, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?") ,
QMessageBox::Yes | QMessageBox::No);
@@ -1193,9 +1222,7 @@ void MainWindow::writeBackup()
}
fileName = restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
@@ -1220,7 +1247,7 @@ int MainWindow::getFileType(const QString &fullFileName)
}
bool MainWindow::isValidEEPROM(QString eepromfile)
{
{
int eeprom_size;
QFile file(eepromfile);
int fileType = getFileType(eepromfile);
@@ -1235,10 +1262,12 @@ bool MainWindow::isValidEEPROM(QString eepromfile)
return false;
}
file.close();
RadioData * radioData = new RadioData();
bool result = LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size);
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
delete radioData;
return result;
return errors.test(NO_ERROR);
}
else if (fileType==FILE_TYPE_BIN) { //read binary
if (!file.open(QFile::ReadOnly))
@@ -1250,10 +1279,12 @@ bool MainWindow::isValidEEPROM(QString eepromfile)
if (read != eeprom_size) {
return false;
}
RadioData * radioData = new RadioData();
bool result = LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size);
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
delete radioData;
return result;
return errors.test(NO_ERROR);
}
return false;
}
@@ -1281,7 +1312,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
file.close();
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
if (!LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size) || !firmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(NO_ERROR) || !firmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
return false;
QFile file2(restoreFile);
@@ -1298,79 +1330,95 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
void MainWindow::writeFlash(QString fileToFlash)
{
QString fileName;
bool backup = g.backupOnFlash();
if(!fileToFlash.isEmpty())
fileName = fileToFlash;
burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);
cd->exec();
if (IS_TARANIS(GetEepromInterface()->getBoard()))
backup=false;
if (!fileName.isEmpty()) {
g.backupOnFlash(backup);
if (backup) {
QString tempDir = QDir::tempPath();
QString backupFile = tempDir + "/backup.bin";
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
qDebug() << "MainWindow::writeFlash(): started with" << fileToFlash;
QString fileName;
bool backup = g.backupOnFlash();
if(!fileToFlash.isEmpty()) {
fileName = fileToFlash;
}
burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);
cd->exec();
qDebug() << "MainWindow::writeFlash(): flashing " << fileName;
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
backup=false;
}
if (!fileName.isEmpty()) {
if (g.checkHardwareCompatibility()) {
QString tempFlash = generateProcessUniqueTempFileName("flash-check.bin");
if (!readFirmwareFromRadio(tempFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
return;
}
FlashInterface previousFlash(tempFlash);
qunlink(tempFlash);
FlashInterface newFlash(fileName);
qDebug() << "MainWindow::writeFlash(): checking firmware compatibility between " << tempFlash << "and" << fileName;
if (!newFlash.isHardwareCompatible(previousFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
if (isTempFileName(fileName)) {
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
qunlink(fileName);
}
return;
}
}
g.backupOnFlash(backup);
if (backup) {
QString backupFile;
QString backupPath=getBackupPath();
if (backupPath.isEmpty()) {
backupFile = generateProcessUniqueTempFileName("backup.bin");
}
else {
QDateTime datetime;
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
}
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
sleep(2);
int res = writeFirmwareToRadio(fileName);
if (res) {
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile;
}
sleep(2);
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
backupEnable=false;
}
if (backupEnable) {
QDateTime datetime;
backupFile.clear();
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
}
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
sleep(1);
int res = writeFirmwareToRadio(fileName);
if (res) {
QString restoreFile = tempDir + "/restore.bin";
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile;
}
sleep(1);
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
}
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
QDateTime datetime;
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
}
writeFirmwareToRadio(fileName);
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
}
}
else {
bool backupEnable=true;
QString backupPath=getBackupPath();
if (backupPath.isEmpty()) {
backupEnable=false;
}
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
QDateTime datetime;
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
sleep(2);
}
writeFirmwareToRadio(fileName);
}
if (isTempFileName(fileName)) {
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
qunlink(fileName);
}
}
}
void MainWindow::readBackup()
@@ -1412,7 +1460,7 @@ void MainWindow::burnFuses()
void MainWindow::compare()
{
CompareDialog *fd = new CompareDialog(this);
CompareDialog *fd = new CompareDialog(this,GetCurrentFirmware());
fd->setAttribute(Qt::WA_DeleteOnClose, true);
fd->show();
}
@@ -1436,7 +1484,7 @@ void MainWindow::about()
aboutStr.append("<br/><br/>");
aboutStr.append(QString("Version %1, %2").arg(C9X_VERSION).arg(__DATE__));
aboutStr.append("<br/><br/>");
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>&copy; 2011-2014<br/>");
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>&copy; 2011-2015<br/>");
QMessageBox msgBox(this);
msgBox.setWindowIcon(CompanionIcon("information.png"));
msgBox.setWindowTitle(tr("About Companion"));
@@ -1452,7 +1500,7 @@ void MainWindow::updateMenus()
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
writeEepromAct->setEnabled(hasMdiChild);
separatorAct->setVisible(hasMdiChild);
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
cutAct->setEnabled(hasSelection);
copyAct->setEnabled(hasSelection);
@@ -1466,7 +1514,7 @@ void MainWindow::updateMenus()
updateIconSizeActions();
updateIconThemeActions();
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->getName()).arg( g.profile[g.id()].name() ));
setWindowTitle(tr("OpenTX Companion 2.0 - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->getName()).arg( g.profile[g.id()].name() ));
}
MdiChild *MainWindow::createMdiChild()
@@ -1495,7 +1543,7 @@ QAction * MainWindow::addAct(const QString & icon, const QString & sName, const
QAction * newAction = new QAction( this );
if (!icon.isEmpty())
newAction->setIcon(CompanionIcon(icon));
if (!sName.isEmpty())
if (!sName.isEmpty())
newAction->setText(sName);
if (!lName.isEmpty())
newAction->setStatusTip(lName);
@@ -1516,7 +1564,7 @@ QAction * MainWindow::addAct(QActionGroup *aGroup, const QString & sName, const
{
QAction *action = addAct("", sName, lName, QKeySequence::UnknownKey, slot);
action->setCheckable(true);
aGroup->addAction(action);
aGroup->addAction(action);
return action;
}
@@ -1550,7 +1598,7 @@ void MainWindow::createActions()
cutAct = addAct("cut.png", tr("Cut Model"), tr("Cut current model to the clipboard"), QKeySequence::Cut, SLOT(cut()));
copyAct = addAct("copy.png", tr("Copy Model"), tr("Copy current model to the clipboard"), QKeySequence::Copy, SLOT(copy()));
pasteAct = addAct("paste.png", tr("Paste Model"), tr("Paste model from clipboard"), QKeySequence::Paste, SLOT(paste()));
QActionGroup *themeAlignGroup = new QActionGroup(this);
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classic companion9x icon theme"), SLOT(setClassicTheme()));
yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme()));
@@ -1600,10 +1648,10 @@ void MainWindow::createActions()
writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Radio"), tr("Write Models and Settings to Radio"), SLOT(writeEeprom()));
readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Radio"), tr("Read Models and Settings from Radio"), SLOT(readEeprom()));
burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with the Radio"), SLOT(burnConfig()));
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to to Radio"), SLOT(writeBackup()));
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to Radio"), SLOT(writeBackup()));
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
compareAct->setEnabled(false);
simulateAct->setEnabled(false);
printAct->setEnabled(false);
@@ -1685,7 +1733,7 @@ void MainWindow::createMenus()
burnMenu->addSeparator();
burnMenu->addSeparator();
EEPROMInterface *eepromInterface = GetEepromInterface();
if (!IS_ARM(eepromInterface->getBoard())) {
if (!IS_ARM(eepromInterface->getBoard())) {
burnMenu->addAction(burnFusesAct);
burnMenu->addAction(burnListAct);
}
@@ -1702,7 +1750,7 @@ void MainWindow::createMenus()
helpMenu->addSeparator();
helpMenu->addAction(contributorsAct);
}
QMenu *MainWindow::createRecentFileMenu()
{
QMenu *recentFileMenu = new QMenu(this);
@@ -1743,7 +1791,7 @@ void MainWindow::createToolBars()
break;
default:
size=QSize(24,24);
break;
break;
}
fileToolBar = addToolBar(tr("File"));
fileToolBar->setIconSize(size);
@@ -1788,7 +1836,7 @@ void MainWindow::createToolBars()
editToolBar->addAction(cutAct);
editToolBar->addAction(copyAct);
editToolBar->addAction(pasteAct);
burnToolBar = new QToolBar(tr("Write"));
addToolBar( Qt::LeftToolBarArea, burnToolBar );
burnToolBar->setIconSize(size);
@@ -1845,7 +1893,7 @@ void MainWindow::setActiveSubWindow(QWidget *window)
void MainWindow::updateRecentFileActions()
{
int i, numRecentFiles;
// Hide all document slots
for ( i=0 ; i < g.historySize(); i++)
recentFileActs[i]->setVisible(false);
@@ -1853,7 +1901,7 @@ void MainWindow::updateRecentFileActions()
// Fill slots with content and unhide them
QStringList files = g.recentFiles();
numRecentFiles = qMin(files.size(), g.historySize());
for ( i = 0; i < numRecentFiles; i++) {
QString text = strippedName(files[i]);
if (!text.trimmed().isEmpty())
@@ -1880,31 +1928,31 @@ void MainWindow::updateLanguageActions()
{
QString langId = g.locale();
if (langId=="")
if (langId=="")
sysLangAct->setChecked(true);
else if (langId=="cs_CZ")
else if (langId=="cs_CZ")
czechLangAct->setChecked(true);
else if (langId=="de_DE")
else if (langId=="de_DE")
germanLangAct->setChecked(true);
else if (langId=="en")
else if (langId=="en")
englishLangAct->setChecked(true);
else if (langId=="fi_FI")
else if (langId=="fi_FI")
finnishLangAct->setChecked(true);
else if (langId=="fr_FR")
else if (langId=="fr_FR")
frenchLangAct->setChecked(true);
else if (langId=="it_IT")
else if (langId=="it_IT")
italianLangAct->setChecked(true);
else if (langId=="he_IL")
else if (langId=="he_IL")
hebrewLangAct->setChecked(true);
else if (langId=="pl_PL")
else if (langId=="pl_PL")
polishLangAct->setChecked(true);
else if (langId=="pt_PT")
else if (langId=="pt_PT")
portugueseLangAct->setChecked(true);
else if (langId=="ru_RU")
else if (langId=="ru_RU")
russianLangAct->setChecked(true);
else if (langId=="sv_SE")
else if (langId=="sv_SE")
swedishLangAct->setChecked(true);
else if (langId=="nl_NL")
else if (langId=="nl_NL")
dutchLangAct->setChecked(true);
}
@@ -1922,9 +1970,9 @@ void MainWindow::updateIconThemeActions()
void MainWindow::updateProfilesActions()
{
for (int i=0; i<MAX_PROFILES; i++)
for (int i=0; i<MAX_PROFILES; i++)
{
if (g.profile[i].existsOnDisk())
if (g.profile[i].existsOnDisk())
{
QString text = tr("%2").arg(g.profile[i].name());
profileActs[i]->setText(text);
@@ -1932,8 +1980,8 @@ void MainWindow::updateProfilesActions()
profileActs[i]->setVisible(true);
if (i == g.id())
profileActs[i]->setChecked(true);
}
else
}
else
{
profileActs[i]->setVisible(false);
}
@@ -1947,7 +1995,7 @@ void MainWindow::createProfile()
;
if (i==MAX_PROFILES) //Failed to find free slot
return;
// Copy current profile to new and give it a new name
g.profile[i] = g.profile[g.id()];
g.profile[i].name(tr("New Radio"));
@@ -1988,16 +2036,17 @@ int MainWindow::getEpromVersion(QString fileName)
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return -1;
}
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (!LoadEepromXml(testData, doc)){
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(testData, doc));
if (!errors.test(NO_ERROR)) {
return -1;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
QString hline = inputStream.readLine();
@@ -2014,7 +2063,9 @@ int MainWindow::getEpromVersion(QString fileName)
return -1;
}
file.close();
if (!LoadEeprom(testData, eeprom, eeprom_size)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(testData, eeprom, eeprom_size));
if (!errors.test(NO_ERROR)) {
QMessageBox::critical(this, tr("Error"),tr("Invalid Models and Settings File %1").arg(fileName));
return -1;
}
@@ -2032,7 +2083,9 @@ int MainWindow::getEpromVersion(QString fileName)
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
return -1;
}
if (!LoadEeprom(testData, (uint8_t *)eeprom.data(), eeprom_size)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(testData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(NO_ERROR)) {
QMessageBox::critical(this, tr("Error"),tr("Invalid binary Models and Settings File %1").arg(fileName));
return -1;
}
+1
View File
@@ -82,6 +82,7 @@ class MainWindow : public QMainWindow
void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
QString getBackupPath();
private slots:
void openDocURL();
+44 -46
View File
@@ -54,7 +54,6 @@
#include "appdata.h"
#include "wizarddialog.h"
#include <QFileInfo>
#include "googleanalytics.h"
#if defined WIN32 || !defined __GNUC__
#include <windows.h>
@@ -80,11 +79,9 @@ MdiChild::MdiChild():
if (!(this->isMaximized() || this->isMinimized())) {
adjustSize();
}
ga.sendPageView(getBoardName(firmware->getBoard()) + " Models");
}
MdiChild::~MdiChild()
MdiChild::~MdiChild()
{
delete ui;
}
@@ -177,7 +174,7 @@ void MdiChild::modelEdit()
if (row == 0){
generalEdit();
}
}
else {
QApplication::setOverrideCursor(Qt::WaitCursor);
checkAndInitModel( row );
@@ -254,7 +251,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
XmlInterface(inputStream).load(radioData);
}
else
#endif
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),
@@ -263,18 +260,19 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
.arg(file.errorString()));
return false;
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (LoadEepromXml(radioData, doc)){
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
if (errors.test(NO_ERROR)) {
ui->modelsList->refreshList();
if(resetCurrentFile) setCurrentFile(fileName);
return true;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
@@ -297,12 +295,14 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid EEPROM File %1")
.arg(fileName));
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
if (!errors.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName), errors.to_ulong());
return false;
}
if (errors.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errors.to_ulong());
}
ui->modelsList->refreshList();
if(resetCurrentFile) setCurrentFile(fileName);
@@ -333,11 +333,18 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
return false;
}
if (!LoadEeprom(radioData, eeprom, eeprom_size) && !LoadBackup(radioData, eeprom, eeprom_size, 0)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid binary EEPROM File %1")
.arg(fileName));
return false;
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
if (!errorsEeprom.test(NO_ERROR)) {
std::bitset<NUM_ERRORS> errorsBackup((unsigned long long)LoadBackup(radioData, eeprom, eeprom_size, 0));
if (!errorsBackup.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid binary EEPROM File %1").arg(fileName), (errorsEeprom | errorsBackup).to_ulong());
return false;
}
if (errorsBackup.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsBackup.to_ulong());
}
} else if (errorsEeprom.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
}
ui->modelsList->refreshList();
@@ -370,7 +377,7 @@ bool MdiChild::saveAs(bool isNew)
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
#else
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(BIN_FILES_FILTER));
#endif
#endif
}
else {
QFileInfo fi(curFile);
@@ -378,14 +385,14 @@ bool MdiChild::saveAs(bool isNew)
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
#else
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(EEPROM_FILES_FILTER));
#endif
#endif
}
if (fileName.isEmpty())
return false;
g.eepromDir( QFileInfo(fileName).dir().absolutePath() );
if (isNew)
return saveFile(fileName);
else
else
return saveFile(fileName,true);
}
@@ -404,7 +411,7 @@ bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
int eeprom_size = 0;
if (fileType != FILE_TYPE_XML) {
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant(), 0/*last version*/);
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber(), 0/*last version*/);
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
return false;
@@ -508,7 +515,7 @@ void MdiChild::setCurrentFile(const QString &fileName)
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
g.recentFiles( files );
}
@@ -519,23 +526,14 @@ QString MdiChild::strippedName(const QString &fullFileName)
void MdiChild::writeEeprom() // write to Tx
{
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
}
}
else {
bool backupEnable=true;
QString backupPath=((MainWindow *)this->parent())->getBackupPath();
if (backupPath.isEmpty()) {
backupEnable=false;
}
QString stickCal=g.profile[g.id()].stickPotCalib();
burnConfigDialog bcd;
QString tempDir = QDir::tempPath();
QString tempFile = tempDir + "/temp.bin";
QString tempFile = generateProcessUniqueTempFileName("temp.bin");
saveFile(tempFile, false);
if(!QFileInfo(tempFile).exists()) {
QMessageBox::critical(this,tr("Error"), tr("Cannot write temporary file!"));
@@ -553,12 +551,12 @@ void MdiChild::writeEeprom() // write to Tx
return;
}
int oldrev=((MainWindow *)this->parent())->getEpromVersion(tempFile);
QString tempFlash=tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!((MainWindow *)this->parent())->readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, tr("Error"), tr("Cannot check eeprom compatibility! Continue anyway?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No)
@@ -574,9 +572,7 @@ void MdiChild::writeEeprom() // write to Tx
}
tempFile=restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
@@ -608,7 +604,7 @@ void MdiChild::print(int model, QString filename)
else if (ui->modelsList->currentRow() > 0) {
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
}
if (pd) {
pd->setAttribute(Qt::WA_DeleteOnClose, true);
pd->show();
@@ -660,12 +656,14 @@ bool MdiChild::loadBackup()
return false;
}
if (!LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid binary backup File %1")
.arg(fileName));
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
if (!errorsEeprom.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
return false;
}
if (errorsEeprom.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
}
ui->modelsList->refreshList();
+1 -1
View File
@@ -95,7 +95,7 @@ class MdiChild : public QWidget
void modelEdit();
void wizardEdit();
void openEditWindow();
void cut();
void copy();
void paste();
+79 -66
View File
@@ -1,4 +1,5 @@
#include "channels.h"
#include "helpers.h"
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
@@ -6,6 +7,70 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt):
firmware(firmware),
spinbox(new QDoubleSpinBox()),
value(value),
displayStep(0.1)
{
bool allowGVars = false;
int internalStep = 1;
spinbox->setProperty("index", row);
spinbox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spinbox->setAccelerated(true);
if (firmware->getCapability(PPMUnitMicroseconds)) {
displayStep = 0.512;
spinbox->setDecimals(1);
spinbox->setSuffix("us");
}
else {
spinbox->setDecimals(0);
spinbox->setSuffix("%");
}
if (IS_TARANIS(firmware->getBoard()) || deflt == 0 /*it's the offset*/) {
spinbox->setDecimals(1);
allowGVars = true;
}
else {
internalStep *= 10;
}
spinbox->setSingleStep(displayStep*internalStep);
QHBoxLayout * horizontalLayout = new QHBoxLayout();
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
horizontalLayout->addWidget(gv);
QComboBox * cb = new QComboBox();
horizontalLayout->addWidget(cb);
horizontalLayout->addWidget(spinbox);
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
}
LimitsGroup::~LimitsGroup()
{
delete gvarGroup;
}
void LimitsGroup::updateMinMax(int max)
{
if (spinbox->maximum() == 0) {
spinbox->setMinimum(-max*displayStep);
if (value < -max) {
value = -max;
}
}
if (spinbox->minimum() == 0) {
spinbox->setMaximum(max*displayStep);
if (value > max) {
value = max;
}
}
}
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings, firmware)
{
@@ -13,8 +78,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
bool minimize = false;
int col = 1;
if (firmware->getCapability(ChannelsName))
{
if (firmware->getCapability(ChannelsName)) {
minimize=true;
addLabel(gridLayout, tr("Name"), col++);
}
@@ -52,44 +116,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
}
// Channel offset
QDoubleSpinBox * offset = new QDoubleSpinBox(this);
offset->setProperty("index", i);
offset->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
offset->setAccelerated(true);
offset->setDecimals(1);
offset->setMinimum(-100);
offset->setSingleStep(0.1);
offset->setValue(float(model.limitData[i].offset) / 10);
connect(offset, SIGNAL(editingFinished()), this, SLOT(offsetEdited()));
gridLayout->addWidget(offset, i+1, col++, 1, 1);
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
// Channel min
QDoubleSpinBox * minSB = new QDoubleSpinBox(this);
minSB->setProperty("index", i);
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
minSB->setAccelerated(true);
minSB->setDecimals(1);
minSB->setMinimum(-model.getChannelsMax());
minSB->setSingleStep(0.1);
minSB->setMaximum(0);
minSB->setValue(float(model.limitData[i].min) / 10);
connect(minSB, SIGNAL(editingFinished()), this, SLOT(minEdited()));
gridLayout->addWidget(minSB, i+1, col++, 1, 1);
minSpins << minSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
// Channel max
QDoubleSpinBox * maxSB = new QDoubleSpinBox(this);
maxSB->setProperty("index", i);
maxSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
maxSB->setAccelerated(true);
maxSB->setDecimals(1);
maxSB->setMinimum(0);
maxSB->setSingleStep(0.1);
maxSB->setMaximum(model.getChannelsMax());
maxSB->setValue(float(model.limitData[i].max) / 10);
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
maxSpins << maxSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
@@ -117,6 +150,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
QSpinBox * center = new QSpinBox(this);
center->setProperty("index", i);
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
center->setSuffix("us");
center->setMinimum(1375);
center->setMaximum(1625);
center->setValue(1500);
@@ -134,6 +168,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
}
}
// Push the rows up
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
@@ -142,6 +177,9 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
Channels::~Channels()
{
foreach(LimitsGroup *group, limitsGroups) {
delete group;
}
}
void Channels::symlimitsEdited()
@@ -164,39 +202,14 @@ void Channels::nameEdited()
}
}
void Channels::offsetEdited()
{
QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(sender());
int index = dsb->property("index").toInt();
model.limitData[index].offset = round(dsb->value() * 10);
emit modified();
}
void Channels::minEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].min = round(sb->value() * 10);
emit modified();
}
void Channels::maxEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].max = round(sb->value() * 10);
emit modified();
}
void Channels::refreshExtendedLimits()
{
for (int i=0; i<firmware->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i];
minDSB->setMinimum(-model.getChannelsMax());
maxDSB->setMaximum(model.getChannelsMax());
int channelMax = model.getChannelsMax();
foreach(LimitsGroup *group, limitsGroups) {
group->updateMinMax(10*channelMax);
}
emit modified();
}
+19 -5
View File
@@ -4,6 +4,24 @@
#include "modelpanel.h"
#include <QSpinBox>
class GVarGroup;
class LimitsGroup
{
public:
LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt);
~LimitsGroup();
void updateMinMax(int max);
protected:
FirmwareInterface * firmware;
QDoubleSpinBox * spinbox;
GVarGroup * gvarGroup;
int & value;
double displayStep;
};
class Channels : public ModelPanel
{
Q_OBJECT
@@ -13,8 +31,7 @@ class Channels : public ModelPanel
~Channels();
private:
QVector<QDoubleSpinBox *> minSpins;
QVector<QDoubleSpinBox *> maxSpins;
QVector<LimitsGroup *> limitsGroups;
public slots:
void refreshExtendedLimits();
@@ -22,9 +39,6 @@ class Channels : public ModelPanel
private slots:
void symlimitsEdited();
void nameEdited();
void offsetEdited();
void minEdited();
void maxEdited();
void invEdited();
void curveEdited();
void ppmcenterEdited();
+40 -15
View File
@@ -109,19 +109,29 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
ui->curvePreview->setScene(scene);
for (int i=0; i<firmware->getCapability(NumCurves); i++) {
int numcurves=firmware->getCapability(NumCurves);
int limit;
if (numcurves>16) {
limit=numcurves/2;
} else {
limit=numcurves;
}
for (int i=0; i<numcurves; i++) {
visibleCurves[i] = false;
// The reset curve button
QPushButton * reset = new QPushButton(this);
reset->setProperty("index", i);
reset->setMinimumSize(QSize(0, 0));
reset->setMaximumSize(QSize(16, 16));
reset->setIcon(CompanionIcon("clear.png"));
reset->setIconSize(QSize(14, 14));
connect(reset, SIGNAL(clicked()), this, SLOT(resetCurve()));
ui->curvesLayout->addWidget(reset, i, 0, 1, 1);
if (i<limit) {
ui->curvesLayout->addWidget(reset, i, 0, 1, 1);
} else {
ui->curvesLayout2->addWidget(reset, i-limit, 2, 1, 1);
}
// The edit curve button
QPushButton * edit = new QPushButton(this);
edit->setProperty("index", i);
@@ -136,17 +146,39 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
edit->setPalette(palette);
edit->setText(tr("Curve %1").arg(i+1));
connect(edit, SIGNAL(clicked()), this, SLOT(editCurve()));
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
if (i<limit) {
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
} else {
ui->curvesLayout2->addWidget(edit, i-limit, 1, 1, 1);
}
// The curve plot checkbox
QCheckBox * plot = new QCheckBox(this);
plot->setProperty("index", i);
plot->setPalette(palette);
connect(plot, SIGNAL(toggled(bool)), this, SLOT(plotCurve(bool)));
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
if (i<limit) {
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
} else {
ui->curvesLayout2->addWidget(plot, i-limit, 0, 1, 1);
}
}
QSpacerItem * item = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
ui->curvesLayout->addItem(item,limit+1,1,1,1,0);
if (limit!=numcurves) {
QSpacerItem * item2 = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
ui->curvesLayout2->addItem(item2,limit+1,1,1,1,0);
}
for (int i=0; i<C9X_MAX_POINTS; i++) {
spnx[i] = new QSpinBox(this);
spnx[i]->setProperty("index", i);
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spnx[i]->setAccelerated(true);
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spnx[i], i, 0, 1, 1);
spny[i] = new QSpinBox(this);
spny[i]->setProperty("index", i);
spny[i]->setMinimum(-100);
@@ -154,14 +186,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
spny[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spny[i]->setAccelerated(true);
connect(spny[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spny[i], i, 0, 1, 1);
spnx[i] = new QSpinBox(this);
spnx[i]->setProperty("index", i);
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spnx[i]->setAccelerated(true);
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1);
ui->pointsLayout->addWidget(spny[i], i, 1, 1, 1);
bool insert;
if (firmware->getCapability(EnhancedCurves)) {
+112 -96
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>718</width>
<width>605</width>
<height>539</height>
</rect>
</property>
@@ -125,6 +125,9 @@
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="curvesLayout2"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
@@ -172,38 +175,25 @@
<property name="title">
<string>Curve Creator</string>
</property>
<layout class="QGridLayout" name="gridLayout_76" rowstretch="0,0,0,0,0,0,0,0">
<item row="3" column="0">
<widget class="QLabel" name="yMidLabel">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="curveTypeLabel_2">
<property name="text">
<string>Y at X=0</string>
<string>Curve type</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="3">
<widget class="QSpinBox" name="yMax">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="curveType"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="yMaxLabel">
<item row="2" column="0">
<widget class="QLabel" name="curveCoeffLabel">
<property name="text">
<string>Y at X=100</string>
<string>Coefficient</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<item row="2" column="1">
<widget class="QSpinBox" name="curveCoeff">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -219,7 +209,83 @@
</property>
</widget>
</item>
<item row="5" column="1" colspan="3">
<item row="3" column="0">
<widget class="QLabel" name="yMinLabel">
<property name="text">
<string>Y at X=-100</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="yMin">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="yMidLabel">
<property name="text">
<string>Y at X=0</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="yMid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="yMaxLabel">
<property name="text">
<string>Y at X=100</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="yMax">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="curveSideLabel">
<property name="text">
<string>Side</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="curveSide">
<item>
<property name="text">
@@ -238,77 +304,7 @@
</item>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QSpinBox" name="yMin">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="6" column="0" colspan="4">
<widget class="QPushButton" name="curveApply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="curveSideLabel">
<property name="text">
<string>Side</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QSpinBox" name="yMid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QComboBox" name="curveType"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="curveTypeLabel_2">
<property name="text">
<string>Curve type</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="yMinLabel">
<property name="text">
<string>Y at X=-100</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="curveCoeffLabel">
<property name="text">
<string>Coefficient</string>
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -321,6 +317,13 @@
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2">
<widget class="QPushButton" name="curveApply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -339,6 +342,19 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>curvePreview</tabstop>
<tabstop>curvePoints</tabstop>
<tabstop>curveCustom</tabstop>
<tabstop>curveSmooth</tabstop>
<tabstop>curveName</tabstop>
<tabstop>curveCoeff</tabstop>
<tabstop>yMin</tabstop>
<tabstop>yMid</tabstop>
<tabstop>yMax</tabstop>
<tabstop>curveSide</tabstop>
<tabstop>curveApply</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+92 -77
View File
@@ -1,10 +1,4 @@
#include "customfunctions.h"
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
#include <QDoubleSpinBox>
#include "helpers.h"
#include "appdata.h"
@@ -69,36 +63,29 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
int num_fsw = firmware->getCapability(CustomFunctions);
if (!firmware->getCapability(VoicesAsNumbers)) {
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
QString temp = model.funcSw[i].paramarm;
if (!temp.isEmpty()) {
if (!paramarmList.contains(temp)) {
paramarmList.append(temp);
}
tracksSet.insert(temp);
}
}
}
qDebug() << tracksSet;
}
QString path = g.profile[g.id()].sdPath();
path.append("/SOUNDS/");
QString lang = generalSettings.ttsLanguage;
if (lang.isEmpty())
lang="en";
path.append(lang);
QDir qd(path);
int vml= firmware->getCapability(VoicesMaxLength);
if (qd.exists()) {
QStringList filters;
filters << "*.wav" << "*.WAV";
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
QFileInfo fi(file);
QString temp=fi.completeBaseName();
if (!paramarmList.contains(temp) && temp.length()<=vml) {
paramarmList.append(temp);
if (IS_TARANIS(firmware->getBoard())) {
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayScript) {
QString temp = model.funcSw[i].paramarm;
if (!temp.isEmpty()) {
scriptsSet.insert(temp);
}
}
}
qDebug() << scriptsSet;
}
CompanionIcon playIcon("play.png");
@@ -124,7 +111,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
// The function
fswtchFunc[i] = new QComboBox(this);
fswtchFunc[i]->setProperty("index", i);
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
gridLayout->addWidget(fswtchFunc[i], i+1, 2);
QHBoxLayout *paramLayout = new QHBoxLayout();
@@ -149,6 +136,13 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
connect(fswtchParam[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
paramLayout->addWidget(fswtchParam[i]);
fswtchParamTime[i] = new QTimeEdit(this);
fswtchParamTime[i]->setProperty("index", i);
fswtchParamTime[i]->setAccelerated(true);
fswtchParamTime[i]->setDisplayFormat("hh:mm:ss");
connect(fswtchParamTime[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
paramLayout->addWidget(fswtchParamTime[i]);
fswtchParamT[i] = new QComboBox(this);
fswtchParamT[i]->setProperty("index", i);
paramLayout->addWidget(fswtchParamT[i]);
@@ -161,7 +155,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
connect(fswtchParamArmT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
fswtchBLcolor[i] = new QSlider(this);
fswtchBLcolor[i]->setProperty("index", i);
fswtchBLcolor[i]->setMinimum(0);
@@ -188,7 +182,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
fswtchEnable[i] = new QCheckBox(this);
fswtchEnable[i]->setProperty("index", i);
fswtchEnable[i]->setText(tr("ON"));
fswtchEnable[i]->setFixedWidth( 50 );
fswtchEnable[i]->setFixedWidth( 80 );
repeatLayout->addWidget(fswtchEnable[i], i+1);
connect(fswtchEnable[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
}
@@ -197,7 +191,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
addDoubleSpring(gridLayout, 5, num_fsw+1);
disableMouseScrolling();
lock = false;
}
@@ -264,9 +258,16 @@ void CustomFunctionsPanel::playMusic()
phononCurrent = -1;
}
else {
if (phononCurrent >= 0) {
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
}
phononCurrent = index;
clickObject->clear();
#ifdef __APPLE__
clickObject->setCurrentSource(QUrl("file://"+track));
#else
clickObject->setCurrentSource(QUrl(track));
#endif
clickObject->play();
playBT[index]->setIcon(CompanionIcon("stop.png"));
}
@@ -277,21 +278,32 @@ void CustomFunctionsPanel::playMusic()
#define CUSTOM_FUNCTION_NUMERIC_PARAM (1<<0)
#define CUSTOM_FUNCTION_SOURCE_PARAM (1<<1)
#define CUSTOM_FUNCTION_FILE_PARAM (1<<2)
#define CUSTOM_FUNCTION_GV_MODE (1<<3)
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<4)
#define CUSTOM_FUNCTION_ENABLE (1<<5)
#define CUSTOM_FUNCTION_REPEAT (1<<6)
#define CUSTOM_FUNCTION_PLAY (1<<7)
#define CUSTOM_FUNCTION_BL_COLOR (1<<8)
#define CUSTOM_FUNCTION_TIME_PARAM (1<<3)
#define CUSTOM_FUNCTION_GV_MODE (1<<4)
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<5)
#define CUSTOM_FUNCTION_ENABLE (1<<6)
#define CUSTOM_FUNCTION_REPEAT (1<<7)
#define CUSTOM_FUNCTION_PLAY (1<<8)
#define CUSTOM_FUNCTION_BL_COLOR (1<<9)
void CustomFunctionsPanel::customFunctionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
}
void CustomFunctionsPanel::functionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
fswtchParamArmT[index]->setCurrentIndex(0);
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
@@ -314,11 +326,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
int index = fswtchFunc[i]->currentIndex();
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
int channelsMax = model.getChannelsMax(true);
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
fswtchParam[i]->setMinimum(-channelsMax);
fswtchParam[i]->setMaximum(channelsMax);
if (modified) {
model.funcSw[i].param = fswtchParam[i]->value();
}
@@ -364,13 +377,11 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
}
else if (index>=FuncSetTimer1 && index<=FuncSetTimer2) {
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(0);
fswtchParam[i]->setMaximum(59*60+59);
fswtchParam[i]->setValue(model.funcSw[i].param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM + CUSTOM_FUNCTION_ENABLE;
if (modified) model.funcSw[i].param = QTimeS(fswtchParamTime[i]->time()).seconds();
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
fswtchParamTime[i]->setTime(QTimeS(model.funcSw[i].param));
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (index==FuncVolume) {
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
@@ -433,11 +444,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
else {
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
}
}
@@ -453,6 +462,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
}
else if (index==FuncPlaySound) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
@@ -465,6 +475,19 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncPlayScript) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml = 8/*TODO*/;
if (fswtchParamArmT[i]->currentText() != "----") {
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, scriptsSet);
}
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
@@ -481,6 +504,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
fswtchParam[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_NUMERIC_PARAM);
fswtchParamTime[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_TIME_PARAM);
fswtchParamGV[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_TOOGLE);
fswtchParamT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_SOURCE_PARAM);
fswtchParamArmT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_FILE_PARAM);
@@ -502,11 +526,10 @@ void CustomFunctionsPanel::update()
lock = true;
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
}
refreshCustomFunction(i);
}
@@ -523,11 +546,10 @@ void CustomFunctionsPanel::fswPaste()
FuncSwData *fsw = &model.funcSw[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.funcSw[selectedFunction].paramarm, paramarmList);
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();
@@ -539,7 +561,7 @@ void CustomFunctionsPanel::fswDelete()
model.funcSw[selectedFunction].clear();
// TODO update switch and func
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;
@@ -586,24 +608,14 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
b->clear();
for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
if (!firmware->getCapability(HasVolume)) {
if (i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) {
QModelIndex index = b->model()->index(i, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
}
if ((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) {
QModelIndex index = b->model()->index(i, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
if ((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) {
QModelIndex index = b->model()->index(i, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
if ((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) {
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
((i==FuncPlayScript && !IS_TARANIS(firmware->getBoard()))) ||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
((i>=FuncAdjustGV1 && i<=FuncAdjustGVLast) && !firmware->getCapability(Gvars))
) {
QModelIndex index = b->model()->index(i, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
@@ -623,14 +635,17 @@ void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
b->setCurrentIndex(value);
}
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList)
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> &paramsList)
{
b->clear();
b->addItem("----");
bool added = false;
QString currentvalue(value);
foreach ( QString entry, paramsList ) {
// Convert set into list and sort it alphabetically case insensitive
QStringList list = QStringList::fromSet(paramsList);
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
foreach (QString entry, list) {
b->addItem(entry);
if (entry==currentvalue) {
b->setCurrentIndex(b->count()-1);
@@ -676,7 +691,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
b->setCurrentIndex(value);
}
else if (function==FuncVolume) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS);
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS|POPULATE_SWITCHES);
}
else if (function==FuncPlayValue) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT);
+6 -2
View File
@@ -7,6 +7,7 @@
#include <QComboBox>
#include <QDoubleSpinBox>
#include <QPushButton>
#include <QTimeEdit>
#ifdef PHONON
#include <phonon/audiooutput.h>
#include <phonon/mediaobject.h>
@@ -43,6 +44,7 @@ class CustomFunctionsPanel : public ModelPanel
private slots:
void customFunctionEdited();
void functionEdited();
void fsw_customContextMenuRequested(QPoint pos);
void refreshCustomFunction(int index, bool modified=false);
void onChildModified();
@@ -59,15 +61,17 @@ class CustomFunctionsPanel : public ModelPanel
void populateFuncCB(QComboBox *b, unsigned int value);
void populateGVmodeCB(QComboBox *b, unsigned int value);
void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0);
void populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList);
void populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> & paramsList);
bool initialized;
QStringList paramarmList;
QSet<QString> tracksSet;
QSet<QString> scriptsSet;
int phononCurrent;
QComboBox * fswtchSwtch[C9X_MAX_CUSTOM_FUNCTIONS];
QComboBox * fswtchFunc[C9X_MAX_CUSTOM_FUNCTIONS];
QCheckBox * fswtchParamGV[C9X_MAX_CUSTOM_FUNCTIONS];
QDoubleSpinBox * fswtchParam[C9X_MAX_CUSTOM_FUNCTIONS];
QTimeEdit * fswtchParamTime[C9X_MAX_CUSTOM_FUNCTIONS];
QPushButton * playBT[C9X_MAX_CUSTOM_FUNCTIONS];
QComboBox * fswtchParamT[C9X_MAX_CUSTOM_FUNCTIONS];
QComboBox * fswtchParamArmT[C9X_MAX_CUSTOM_FUNCTIONS];
+10 -9
View File
@@ -2,7 +2,8 @@
#include "ui_expodialog.h"
#include "helpers.h"
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName) :
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings,
FirmwareInterface * firmware, QString & inputName) :
QDialog(parent),
ui(new Ui::ExpoDialog),
model(model),
@@ -31,9 +32,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings);
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
ui->sideCB->setCurrentIndex(ed->mode-1);
@@ -62,6 +63,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->inputName->setMaxLength(4);
populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
ui->sourceCB->removeItem(0);
ui->inputName->setValidator(new QRegExpValidator(rx, this));
ui->inputName->setText(inputName);
}
else {
ui->inputNameLabel->hide();
@@ -87,9 +90,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->lineName->setMaxLength(expolength);
}
ui->inputName->setValidator(new QRegExpValidator(rx, this));
ui->inputName->setText(inputName);
ui->lineName->setValidator(new QRegExpValidator(rx, this));
ui->lineName->setText(ed->name);
@@ -122,7 +122,7 @@ ExpoDialog::~ExpoDialog()
void ExpoDialog::updateScale()
{
if (firmware->getCapability(VirtualInputs) && ed->srcRaw.type == SOURCE_TYPE_TELEMETRY) {
RawSourceRange range = ed->srcRaw.getRange();
RawSourceRange range = ed->srcRaw.getRange(model, generalSettings);
ui->scaleLabel->show();
ui->scale->show();
ui->scale->setDecimals(range.decimals);
@@ -146,14 +146,15 @@ void ExpoDialog::valuesChanged()
updateScale();
}
RawSourceRange range = srcRaw.getRange();
RawSourceRange range = srcRaw.getRange(model, generalSettings);
ed->scale = round(float(ui->scale->value()) / range.step);
ed->carryTrim = 1 - ui->trimCB->currentIndex();
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
ed->mode = ui->sideCB->currentIndex() + 1;
strcpy(ed->name, ui->lineName->text().toAscii().data());
strcpy(inputName, ui->inputName->text().toAscii().data());
if (firmware->getCapability(VirtualInputs))
inputName = ui->inputName->text();
ed->phases=0;
for (int i=8; i>=0 ; i--) {
+3 -2
View File
@@ -14,7 +14,8 @@ namespace Ui {
class ExpoDialog : public QDialog {
Q_OBJECT
public:
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName);
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings,
FirmwareInterface * firmware, QString & inputName);
~ExpoDialog();
protected:
@@ -30,7 +31,7 @@ class ExpoDialog : public QDialog {
GeneralSettings & generalSettings;
FirmwareInterface * firmware;
ExpoData * ed;
char * inputName;
QString & inputName;
GVarGroup * gvWeightGroup;
GVarGroup * gvOffsetGroup;
CurveGroup * curveGroup;
+5 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>381</width>
<height>414</height>
<width>389</width>
<height>488</height>
</rect>
</property>
<property name="sizePolicy">
@@ -481,6 +481,9 @@ If blank then the input is considered to be &quot;ON&quot; all the time.</string
<tabstop>weightGV</tabstop>
<tabstop>weightSB</tabstop>
<tabstop>weightCB</tabstop>
<tabstop>offsetGV</tabstop>
<tabstop>offsetSB</tabstop>
<tabstop>offsetCB</tabstop>
<tabstop>curveTypeCB</tabstop>
<tabstop>curveGVarCB</tabstop>
<tabstop>curveValueCB</tabstop>
+18
View File
@@ -457,6 +457,24 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>name</tabstop>
<tabstop>fadeIn</tabstop>
<tabstop>swtch</tabstop>
<tabstop>fadeOut</tabstop>
<tabstop>trim2Use</tabstop>
<tabstop>trim2Value</tabstop>
<tabstop>trim1Use</tabstop>
<tabstop>trim1Value</tabstop>
<tabstop>trim3Use</tabstop>
<tabstop>trim3Value</tabstop>
<tabstop>trim4Use</tabstop>
<tabstop>trim4Value</tabstop>
<tabstop>trim2Slider</tabstop>
<tabstop>trim3Slider</tabstop>
<tabstop>trim1Slider</tabstop>
<tabstop>trim4Slider</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

Some files were not shown because too many files have changed in this diff Show More