Compare commits

...

700 Commits

Author SHA1 Message Date
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
310 changed files with 71227 additions and 48428 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 -y 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 .
+221 -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
@@ -566,3 +566,219 @@ 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.
+118 -6
View File
@@ -1,9 +1,121 @@
<h2>Version 2.0.9</h2>
<h2>Version 2.0.19 / 2016-01-15</h2>
<ul>
<li>Taranis is now the default board in General Settings</li>
<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.8</h2>
<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>
@@ -39,13 +151,13 @@
<ul>
<li>Sound should be ok on all platforms</li>
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
<li>Various bug fixes</li>
<li>Various bug fixes</li>
</ul>
<h2>Version 2.0.3</h2>
<ul>
<li>EEPROM import bug on AdjustGVAR function</li>
<li>Timers correctly displayed in logical switches tab</li>
<li>Timers correctly displayed in logical switches tab</li>
</ul>
<h2>Version 2.0.2</h2>
@@ -219,4 +331,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>
+29 -33
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "9" )
SET( C9X_VERSION_REVISION "19" )
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} )
@@ -89,7 +90,7 @@ add_custom_command(
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
COMMAND make lua_exports.cpp
COMMAND make PCB=TARANIS lua_exports.cpp
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
@@ -106,6 +107,7 @@ include_directories(
add_subdirectory(modeledit)
add_subdirectory(simulation)
add_subdirectory(qcustomplot)
set(common_SRCS
eeprominterface.cpp
@@ -114,7 +116,7 @@ set(common_SRCS
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
@@ -147,7 +149,7 @@ set(companion_SRCS
mdichild.cpp
generaledit.cpp
modelslist.cpp
mountlist.cpp
mountlist.cpp
avroutputdialog.cpp
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
@@ -164,7 +166,6 @@ set(companion_SRCS
mainwindow.cpp
companion.cpp
radionotfound.cpp
qcustomplot.cpp
wizarddata.cpp
wizarddialog.cpp
)
@@ -189,12 +190,11 @@ set(companion_MOC_HDRS
mdichild.h
mainwindow.h
radionotfound.h
qcustomplot.h
qautocombobox.h
helpers.h
wizarddialog.h
)
set(companion_UIS
mdichild.ui
avroutputdialog.ui
@@ -276,14 +276,14 @@ QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
ADD_EXECUTABLE(companion MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
ELSE( )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ADD_EXECUTABLE(companion WIN32 ${companion_SRCS} ${companion_QM})
ENDIF( )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
target_link_libraries(companion modeledit simulation common qcustomplot ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
############# Standalone simu ###############
@@ -344,16 +344,13 @@ else()
add_executable(simulator WIN32 ${simu_SRCS})
endif()
if(SDL_FOUND)
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
else()
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
endif()
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
############# Packaging ####################
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( TARGETS simulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( FILES companion.desktop DESTINATION share/applications )
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
@@ -364,7 +361,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
# Linux specific code
SET(OperatingSystem "Linux")
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -373,20 +370,20 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF( WIN32 )
IF( MSVC )
SET( NSI_IN_FILE companion-vs.nsi.in )
SET( NSI_IN_FILE companion-vs.nsi.in )
ELSE( )
SET( NSI_IN_FILE companion-msys.nsi.in )
ENDIF( )
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
@@ -405,21 +402,20 @@ IF( APPLE )
ELSE( )
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
ENDIF()
ADD_CUSTOM_TARGET( addframeworks ALL
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${PROJECT_NAME} )
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
@@ -428,7 +424,7 @@ IF( APPLE )
ENDIF( )
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
IF(WIN32)
@@ -453,7 +449,7 @@ if(DPKG_PROGRAM)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-nosp@m-gmail.com>")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
@@ -464,6 +460,6 @@ else(DPKG_PROGRAM)
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
endif(DPKG_PROGRAM)
endif(DPKG_PROGRAM)
INCLUDE(CPack)
+69 -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,7 +674,7 @@ AppData::AppData()
settings.remove("patchImage");
settings.remove("rename_firmware_files");
settings.remove("sdPath");
settings.remove("SplashFileName");
settings.remove("SplashFileName");
settings.remove("startup_check_companion9x");
settings.remove("wizardEnable");
@@ -645,7 +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" ,"" );
@@ -675,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);
+34 -3
View File
@@ -48,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());
@@ -66,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
@@ -109,6 +112,7 @@ 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())) {
ui->backLightColor->setEnabled(false);
@@ -164,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());
@@ -224,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()
@@ -263,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
@@ -434,6 +460,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
voice = NULL; // we will search for a voice checkbox
int index = 0;
QWidget * prevFocus = ui->voiceCombo;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
@@ -441,6 +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++);
@@ -452,6 +482,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
if (opt.name == QString("voice")) {
voice = cb;
}
prevFocus = cb;
}
}
}
+2 -1
View File
@@ -47,8 +47,9 @@ class AppPreferencesDialog : public QDialog
void on_snapshotPathButton_clicked();
void on_snapshotClipboardCKB_clicked();
void on_backupPathButton_clicked();
void on_ProfilebackupPathButton_clicked();
void on_ge_pathButton_clicked();
void on_sdPathButton_clicked();
void on_removeProfileButton_clicked();
void on_SplashSelect_clicked();
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -138,7 +138,7 @@ void avrOutputDialog::doCopy()
if (source.open(QIODevice::ReadOnly)) {
QFile dest(destFile);
if (dest.open(QIODevice::WriteOnly)) {
if (dest.open(QIODevice::ReadWrite)) {
addText(tr("Writing file: "));
for (int i=0; i<blocks; i++) {
int read = source.read(buf, BLKSIZE);
+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>
+26 -17
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() );
@@ -423,6 +431,7 @@ void burnDialog::on_BurnFlashButton_clicked()
tempFile = generateProcessUniqueTempFileName("flash.hex");
else
tempFile = generateProcessUniqueTempFileName("flash.bin");
qDebug() << "burnDialog::on_BurnFlashButton_clicked(): patching" << fileName << "with custom splash screen and saving to" << tempFile;
FlashInterface flash(fileName);
flash.setSplash(image);
if (flash.saveFlash(tempFile) > 0) {
@@ -446,7 +455,7 @@ void burnDialog::on_BurnFlashButton_clicked()
}
else {
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
hexfileName->clear();
hexfileName->clear();
}
}
@@ -459,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();
@@ -553,7 +562,7 @@ void burnDialog::on_BurnFlashButton_clicked()
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
}
if (patch) {
QString fileName = generateProcessUniqueTempFileName("temp.bin");
QFile file(fileName);
@@ -582,12 +591,12 @@ void burnDialog::on_BurnFlashButton_clicked()
}
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();
@@ -595,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"/>
+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
)
)
+24 -3
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"
@@ -95,9 +99,22 @@ int main(int argc, char *argv[])
app.installTranslator(&qtTranslator);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
RegisterEepromInterfaces();
registerOpenTxFirmwares();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
#ifdef JOYSTICKS
sdlFlags |= SDL_INIT_JOYSTICK;
#endif
#ifdef SIMU_AUDIO
sdlFlags |= SDL_INIT_AUDIO;
#endif
if (SDL_Init(sdlFlags) < 0) {
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
}
#endif
RegisterEepromInterfaces();
registerOpenTxFirmwares();
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
@@ -133,5 +150,9 @@ int main(int argc, char *argv[])
UnregisterFirmwares();
UnregisterEepromInterfaces();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
#endif
return result;
}
+200 -87
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();
@@ -160,8 +163,8 @@ void CompareDialog::closeEvent(QCloseEvent *event)
CompareDialog::~CompareDialog()
{
qunlink(curvefile5);
qunlink(curvefile9);
qunlink(curvefile1);
qunlink(curvefile1);
delete ui;
}
@@ -250,10 +253,20 @@ void CompareDialog::printSetup()
str.append(fv(tr("Timer1"), getTimerStr(g_model1->timers[0]), color)); //value, mode, count up/down
color=getColor1(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down
color=getColor1(getProtocol(g_model1),getProtocol(g_model2));
str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay,
color=getColor1(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color));
color=getColor1(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&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(getTrimInc(g_model1),getTrimInc(g_model2));
@@ -270,10 +283,20 @@ void CompareDialog::printSetup()
str.append(fv(tr("Timer1"), getTimerStr(g_model2->timers[0]),color)); //value, mode, count up/down
color=getColor2(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down
color=getColor2(getProtocol(g_model1),getProtocol(g_model2));
str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay,
color=getColor2(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color));
color=getColor2(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&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(getTrimInc(g_model1),getTrimInc(g_model2));
@@ -797,7 +820,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
if (md->curve.value) str += " " + md->curve.toString().replace("<", "&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);
@@ -875,7 +898,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
if (md->curve.value) str += " " + md->curve.toString().replace("<", "&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,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()
@@ -1021,11 +1138,7 @@ void CompareDialog::printSwitches()
str.append("<tr>");
color=getColor1(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
if (i<9) {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
} else {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
}
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("L%1").arg(i+1)+QString("</b></td>"));
color=getColor2(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
str.append("</tr>");
@@ -1060,7 +1173,7 @@ void CompareDialog::printFSwitches()
for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
{
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param) || (g_model1->funcSw[i].enabled != g_model2->funcSw[i].enabled) || (g_model1->funcSw[i].repeatParam != g_model2->funcSw[i].repeatParam)) {
color1="green";
color2="red";
} else {
+4 -3
View File
@@ -15,8 +15,9 @@ class CompareDialog : public QDialog
Q_OBJECT
public:
CompareDialog(QWidget *parent);
CompareDialog(QWidget *parent, FirmwareInterface * firmware);
~CompareDialog();
FirmwareInterface * firmware;
protected:
GeneralSettings * settings;
@@ -64,8 +65,8 @@ class CompareDialog : public QDialog
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
QTextEdit * te;
QString curvefile5;
QString curvefile9;
QString curvefile1;
QString curvefile2;
QDir *qd;
private slots:
+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>
+113 -26
View File
@@ -229,7 +229,15 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
case TELEMETRY_SOURCE_DIST_MAX:
result.step = singleprec ? 8 : 1;
result.max = singleprec ? 2040 : 10000;
result.unit = QObject::tr("m");
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step = (result.step * 105) / 32;
result.min = (result.min * 105) / 32;
result.max = (result.max * 105) / 32;
result.unit = QObject::tr("ft");
}
else {
result.unit = QObject::tr("m");
}
break;
case TELEMETRY_SOURCE_CELL:
case TELEMETRY_SOURCE_CELL_MIN:
@@ -301,7 +309,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
break;
default:
result.max = (model.extendedLimits ? 125 : 100);
result.max = model.getChannelsMax(true);
result.min = -result.max;
break;
}
@@ -358,7 +366,7 @@ QString RawSource::toString(const ModelData & model)
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("----");
}
@@ -394,7 +402,7 @@ QString RawSource::toString(const ModelData & model)
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("----");
}
@@ -460,7 +468,7 @@ QString RawSwitch::toString()
};
static const QString timerModes[] = {
QObject::tr("OFF"), QObject::tr("ABS"),
QObject::tr("OFF"), QObject::tr("ON"),
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
};
@@ -723,7 +731,7 @@ void FuncSwData::clear()
QString FuncSwData::funcToString()
{
ModelData model;
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return QObject::tr("Trainer");
@@ -753,8 +761,10 @@ QString FuncSwData::funcToString()
return QObject::tr("Play Both");
else if (func == FuncPlayValue)
return QObject::tr("Play Value");
else if (func == FuncPlayScript)
return QObject::tr("Play Script");
else if (func == FuncLogs)
return QObject::tr("Start Logs");
return QObject::tr("SD Logs");
else if (func == FuncVolume)
return QObject::tr("Volume");
else if (func == FuncBacklight)
@@ -1145,7 +1155,7 @@ 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++) {
flightModeData[i].clear();
@@ -1309,9 +1319,9 @@ ModelData ModelData::removeGlobalVars()
return result;
}
int ModelData::getChannelsMax()
int ModelData::getChannelsMax(bool forceExtendedLimits) const
{
if (extendedLimits)
if (forceExtendedLimits || extendedLimits)
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
else
return 100;
@@ -1326,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());
@@ -1339,7 +1349,7 @@ void UnregisterEepromInterfaces()
foreach(EEPROMInterface * intf, eepromInterfaces) {
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
delete intf;
}
}
OpenTxEepromCleanup();
}
@@ -1347,42 +1357,119 @@ QList<FirmwareInterface *> firmwares;
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)
+53 -18
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
@@ -361,9 +363,9 @@ class RawSource {
}
QString toString(const ModelData & model);
RawSourceRange getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags=0) const;
bool operator == ( const RawSource & other) {
return (this->type == other.type) && (this->index == other.index);
}
@@ -526,6 +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;
@@ -725,8 +729,8 @@ class LogicalSwitchData { // Logical Switches data
};
enum AssignFunc {
FuncSafetyCh1 = 0,
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
FuncOverrideCH1 = 0,
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
FuncTrainer,
FuncTrainerRUD,
FuncTrainerELE,
@@ -742,6 +746,7 @@ enum AssignFunc {
FuncPlayPrompt,
FuncPlayBoth,
FuncPlayValue,
FuncPlayScript,
FuncLogs,
FuncVolume,
FuncBacklight,
@@ -755,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;
@@ -1043,16 +1048,16 @@ class ModelData {
void clearMixes();
void clearInputs();
int getChannelsMax();
int getChannelsMax(bool forceExtendedLimits=false) const;
protected:
void removeGlobalVar(int & var);
};
class RadioData {
public:
public:
GeneralSettings generalSettings;
ModelData models[C9X_MAX_MODELS];
ModelData models[C9X_MAX_MODELS];
};
// TODO rename FlightPhase to FlightMode
@@ -1129,6 +1134,7 @@ enum Capability {
HasSoundMixer,
NumModules,
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HasCurrentCalibration,
HasVolume,
@@ -1155,6 +1161,10 @@ enum Capability {
MultiposPotsPositions,
SimulatorVariant,
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
MixersMonitor,
HasBatMeterRange
};
class SimulatorInterface;
@@ -1171,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;
@@ -1297,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;
+31 -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
@@ -89,14 +89,17 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Er9xGeneral er9xGeneral;
memset(&er9xGeneral,0,sizeof(er9xGeneral));
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -111,29 +114,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 +160,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 +182,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
};
@@ -54,6 +54,10 @@ class Er9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
protected:
Er9xInterface * er9xInterface;
@@ -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,7 +15,6 @@
*/
#include <iostream>
#include <QMessageBox>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "ersky9xsimulator.h"
@@ -120,14 +119,17 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Ersky9xGeneral ersky9xGeneral;
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
else {
radioData.generalSettings=ersky9xGeneral;
@@ -137,40 +139,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 +192,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 +226,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
@@ -54,6 +54,10 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
protected:
Ersky9xInterface * ersky9xInterface;
@@ -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);
@@ -576,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncSafetyCh32) {
if (c9x.func <= FuncOverrideCH32) {
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
}
@@ -49,6 +49,7 @@
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3
@@ -67,6 +68,7 @@ namespace Open9xGruvin9x {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -56,6 +56,11 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -49,6 +49,7 @@
#define DSM2
#define DSM2_PPM
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "9x128"
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
@@ -68,6 +69,7 @@ namespace OpenTxM128 {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -56,6 +56,11 @@ class OpenTxM128Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -52,10 +52,9 @@
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES
#define FLAVOUR "9x"
#define NUM_POTS 3
#undef min
@@ -73,6 +72,7 @@ namespace OpenTxM64 {
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
@@ -55,6 +55,11 @@ class OpenTxM64Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -55,9 +55,9 @@
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3
#define EEPROM_VARIANT 3
#define FLAVOUR "sky9x"
#undef min
#undef max
@@ -76,9 +76,11 @@ namespace Open9xSky9x {
#include "radio/src/eeprom_raw.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/opentx.cpp"
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
@@ -98,6 +100,7 @@ namespace Open9xSky9x {
#include "radio/src/logs.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/sdcard.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
@@ -152,11 +155,9 @@ using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator()
{
QString path=g.profile[g.id()].sdPath()+"/";
int i=0;
for (i=0; i< std::min(path.length(),1022); i++) {
simuSdDirectory[i]=path.at(i).toAscii();
}
simuSdDirectory[i]=0;
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
}
bool Open9xSky9xSimulator::timer10ms()
@@ -165,7 +166,7 @@ bool Open9xSky9xSimulator::timer10ms()
#include "simulatorimport.h"
}
uint8_t * Open9xSky9xSimulator::getLcd()
::uint8_t * Open9xSky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
@@ -182,6 +183,7 @@ void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
g_rotenc[0] = 0;
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartAudioThread(g.profile[g.id()].volumeGain());
StartMainThread(tests);
}
@@ -189,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();
}
@@ -216,27 +220,27 @@ void Open9xSky9xSimulator::setValues(TxInputs &inputs)
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void Open9xSky9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightMode();
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
::uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
void Open9xSky9xSimulator::wheelEvent(::uint8_t steps)
{
g_rotenc[0] += steps*4;
}
@@ -258,3 +262,13 @@ const char * Open9xSky9xSimulator::getError()
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::installTraceHook(void (*callback)(const char *)) {
::traceCallback = callback;
}
@@ -56,6 +56,11 @@ class Open9xSky9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
};
#endif
@@ -55,8 +55,9 @@
#define HAPTIC
#define REVPLUS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
#define FLAVOUR "taranis-plus"
#define MIXERS_MONITOR
#undef min
#undef max
@@ -79,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"
@@ -109,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/sdcard.cpp"
// Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#define SKIP_FATFS_DECLARATION
#include "radio/src/targets/simu/simpgmspace.cpp"
#define SDCARD
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
@@ -149,6 +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"
@@ -156,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"
@@ -193,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()
@@ -206,7 +208,7 @@ bool OpentxTaranisSimulator::timer10ms()
#include "simulatorimport.h"
}
uint8_t * OpentxTaranisSimulator::getLcd()
::uint8_t * OpentxTaranisSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
@@ -222,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();
}
@@ -253,27 +258,27 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpentxTaranisSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightMode();
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
::uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
void OpentxTaranisSimulator::wheelEvent(::uint8_t steps)
{
// g_rotenc[0] += steps*4;
}
@@ -295,3 +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
+79 -20
View File
@@ -202,8 +202,8 @@ class SourcesConversionTable: public ConversionTable {
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++)
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
}
}
@@ -991,7 +991,12 @@ class MixField: public TransformedField {
_destCh = mix.destCh - 1;
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
_curveMode = true;
_curveParam = 6 + mix.curve.value;
if (mix.curve.value > 0) {
_curveParam = 6 + mix.curve.value;
}
else {
_curveParam = mix.curve.value;
}
}
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
_curveMode = true;
@@ -1039,6 +1044,8 @@ class MixField: public TransformedField {
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else if (_curveParam < 0)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
else
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
@@ -1098,7 +1105,7 @@ class InputField: public TransformedField {
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
internalField.Append(new SpareBitsField<8>());
}
@@ -1151,7 +1158,11 @@ class InputField: public TransformedField {
virtual void beforeExport()
{
_weight = smallGvarToEEPROM(expo.weight);
_weight = smallGvarToEEPROM(expo.weight);
if (IS_TARANIS(board) && version >= 216) {
_offset = smallGvarToEEPROM(expo.offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
@@ -1184,6 +1195,10 @@ class InputField: public TransformedField {
expo.weight = smallGvarToC9x(_weight);
if (IS_TARANIS(board) && version >= 216) {
expo.offset = smallGvarToC9x(_offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
@@ -1201,24 +1216,65 @@ class InputField: public TransformedField {
unsigned int version;
bool _curveMode;
int _weight;
int _offset;
int _curveParam;
};
class LimitField: public StructField {
public:
template <int shift>
static int exportLimitValue(int value)
{
const int GV1 = 4096;
if (value > 10000) {
return -GV1 + value - 10001;
}
if (value < -10000) {
return GV1 + value + 10000;
}
return value + shift;
}
template <int shift>
static int importLimitValue(int value)
{
/* GVARS mapping on radio:
GV1 = -4096
GV9 = -4088
-GV1 = 4095
-GV9 = 4087
*/
const int GV1 = 4096;
if (value >= GV1) {
return 10001 + value - GV1;
}
if (value >= GV1-9) {
return -10000 + value - GV1;
}
if (value < -GV1) {
return -10000 + value + GV1 + 1;
}
if (value < -GV1+9) {
return 10000 + value + GV1 + 1;
}
return value - shift;
}
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
StructField("Limit")
{
if (IS_TARANIS(board) && version >= 216) {
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
Append(new SignedField<8>(limit.ppmCenter));
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
}
else {
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
}
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
Append(new BoolField<1>(limit.symetrical));
Append(new BoolField<1>(limit.revert));
if (HAS_LARGE_LCD(board)) {
@@ -1711,7 +1767,10 @@ class CustomFunctionsConversionTable: public ConversionTable {
addConversion(FuncPlayValue, val++);
if (IS_ARM(board)) {
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
if (IS_TARANIS(board))
addConversion(FuncPlayScript, val++);
else
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncBackgroundMusic, val++);
addConversion(FuncBackgroundMusicPause, val++);
@@ -1833,10 +1892,10 @@ class ArmCustomFunctionField: public TransformedField {
else
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216) {
*((uint16_t *)_param) = fn.param;
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
}
else {
*((uint32_t *)_param) = fn.param;
@@ -1852,7 +1911,7 @@ class ArmCustomFunctionField: public TransformedField {
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
}
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(_param, fn.paramarm, sizeof(_param));
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
@@ -1915,7 +1974,7 @@ class ArmCustomFunctionField: public TransformedField {
value = *((uint32_t *)_param);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
}
@@ -1927,7 +1986,7 @@ class ArmCustomFunctionField: public TransformedField {
fn.func = AssignFunc(fn.func + index);
fn.param = value;
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
}
else if (fn.func == FuncVolume) {
@@ -2020,9 +2079,9 @@ class AvrCustomFunctionField: public TransformedField {
_param = fn.param;
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
_union_param = fn.func - FuncSafetyCh1;
_union_param = fn.func - FuncOverrideCH1;
else if (version >= 213)
_active += ((fn.func % 4) << 1);
}
@@ -2080,7 +2139,7 @@ class AvrCustomFunctionField: public TransformedField {
fn.enabled = (_active & 0x01);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
fn.func = AssignFunc(fn.func + _union_param);
else if (version >= 213)
@@ -2790,8 +2849,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new SpareBitsField<16>()); // mAhUsed
internalField.Append(new SpareBitsField<32>()); // globalTimer
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -113,7 +113,7 @@ template <class T>
bool OpenTxEepromInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
{
T _model;
if (!data) {
// load from EEPROM
efile->openRd(FILE_MODEL(index));
@@ -300,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++) {
@@ -319,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)
@@ -399,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;
@@ -546,7 +560,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
case FlightModesName:
return (IS_TARANIS(board) ? 10 : 6);
case GvarsName:
return 6;
return (IS_9X(board) ? 0 : 6);
case HasChNames:
return (IS_TARANIS(board) ? 1 : 0);
case GvarsInCS:
@@ -580,7 +594,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
else
return 16;
case SafetyChannelCustomFunction:
return id.contains("noovveridech") ? 0 : 1;
return id.contains("nooverridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 32;
@@ -663,7 +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:
@@ -730,6 +746,13 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 0;
case MavlinkTelemetry:
return id.contains("mavlink") ? 1 : 0;
case HasInputDiff:
case HasMixerExpo:
return (IS_TARANIS(board) ? true : false);
case MixersMonitor:
return id.contains("mixersmon") ? 1 : 0;
case HasBatMeterRange:
return (IS_TARANIS(board) ? true : false);
default:
return 0;
}
@@ -815,7 +838,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
break;
default:
return 0;
}
}
}
else {
switch (proto) {
@@ -838,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:
@@ -899,12 +922,13 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version)
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)
@@ -929,13 +953,16 @@ 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) {
std::cout << " no\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
BoardEnum backupBoard = (BoardEnum)-1;
@@ -951,12 +978,14 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
break;
default:
std::cout << " unknown board\n";
return false;
errors.set(UNKNOWN_BOARD);
return errors.to_ulong();
}
if (backupBoard != board) {
std::cout << " not right board\n";
return false;
errors.set(WRONG_BOARD);
return errors.to_ulong();
}
uint8_t version = eeprom[4];
@@ -966,29 +995,35 @@ 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()
@@ -1236,7 +1271,7 @@ void registerOpenTxFirmwares()
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR-Pro */
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
@@ -1255,7 +1290,7 @@ void registerOpenTxFirmwares()
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* Taranis board */
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
@@ -1263,15 +1298,19 @@ void registerOpenTxFirmwares()
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
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);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
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);
@@ -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,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);
@@ -111,7 +111,7 @@ class OpenTxFirmware: public FirmwareInterface {
}
virtual FirmwareInterface * getFirmwareVariant(const QString & id);
virtual QString getStampUrl();
virtual QString getReleaseNotesUrl();
@@ -123,7 +123,7 @@ class OpenTxFirmware: public FirmwareInterface {
virtual bool isTelemetrySourceAvailable(int source);
virtual SimulatorInterface * getSimulator();
};
void registerOpenTxFirmwares();
+27 -15
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
@@ -57,31 +57,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 +98,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 +119,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);
+29 -1
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;
@@ -305,6 +310,29 @@ bool FlashInterface::isValid()
return isValidFlag;
}
QString FlashInterface::getFlavour()
{
if (flavour == "opentx-x9dp")
return "opentx-taranis-plus";
else if (flavour == "opentx-x9d")
return "opentx-taranis";
else
return flavour;
}
bool FlashInterface::isHardwareCompatible(FlashInterface &previousFirmware)
{
QString newFlavour = getFlavour();
if (newFlavour.isEmpty())
return true;
QString previousFlavour = previousFirmware.getFlavour();
if (previousFlavour.isEmpty())
return true;
return (newFlavour == previousFlavour);
}
uint FlashInterface::saveFlash(QString fileName)
{
uint8_t binflash[MAX_FSIZE];
+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;
+5 -1
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">
@@ -177,6 +177,10 @@ May be different from firmware language</string>
</layout>
</widget>
<tabstops>
<tabstop>checkFWUpdates</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>voice_dnld</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
File diff suppressed because it is too large Load Diff
+5 -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();
+1516 -1371
View File
File diff suppressed because it is too large Load Diff
+167 -33
View File
@@ -147,18 +147,18 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
}
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
sb(dynamic_cast<QSpinBox *>(weightSB)),
dsb(dynamic_cast<QDoubleSpinBox *>(weightSB)),
weightCB(weightCB),
weight(weight),
flags(flags),
lock(false)
step(step),
lock(true)
{
lock = true;
if (GetCurrentFirmware()->getCapability(Gvars)) {
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(weightCB, weight);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
@@ -170,21 +170,32 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
}
}
weightSB->setMinimum(mini);
weightSB->setMaximum(maxi);
int val;
if (weight>maxi || weight<mini) {
val = deflt;
weightGV->setChecked(true);
weightSB->hide();
weightCB->show();
}
else {
val = weight;
weightGV->setChecked(false);
weightSB->setValue(weight);
weightSB->show();
weightCB->hide();
}
if (sb) {
sb->setMinimum(mini);
sb->setMaximum(maxi);
sb->setValue(val);
}
else {
dsb->setMinimum(mini*step);
dsb->setMaximum(maxi*step);
dsb->setValue(val*step);
}
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
lock = false;
@@ -193,16 +204,23 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
void GVarGroup::gvarCBChanged(int state)
{
weightCB->setVisible(state);
weightSB->setVisible(!state);
if (weightSB)
weightSB->setVisible(!state);
else
weightSB->setVisible(!state);
valuesChanged();
}
void GVarGroup::valuesChanged()
{
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else
weight = weightSB->value();
if (!lock) {
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
}
}
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
@@ -216,10 +234,10 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
lock(false),
lastType(-1)
{
curveTypeCB->addItem(tr("Diff"));
curveTypeCB->addItem(tr("Expo"));
curveTypeCB->addItem(tr("Func"));
curveTypeCB->addItem(tr("Curve"));
if (!(flags & HIDE_DIFF)) curveTypeCB->addItem(tr("Diff"), 0);
if (!(flags & HIDE_EXPO)) curveTypeCB->addItem(tr("Expo"), 1);
curveTypeCB->addItem(tr("Func"), 2);
curveTypeCB->addItem(tr("Curve"), 3);
curveValueCB->setMaxVisibleItems(10);
@@ -235,10 +253,12 @@ void CurveGroup::update()
{
lock = true;
curveTypeCB->setCurrentIndex(curve.type);
int found = curveTypeCB->findData(curve.type);
if (found < 0) found = 0;
curveTypeCB->setCurrentIndex(found);
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
curveGVarCB->show();
curveGVarCB->setVisible(GetCurrentFirmware()->getCapability(Gvars));
if (curve.value > 100 || curve.value < -100) {
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
@@ -278,11 +298,13 @@ void CurveGroup::update()
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=-numcurves; i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
if (i == curve.value) {
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
}
}
}
curveValueCB->setCurrentIndex(curve.value+numcurves);
break;
}
default:
@@ -310,7 +332,8 @@ void CurveGroup::gvarCBChanged(int state)
void CurveGroup::typeChanged(int value)
{
if (!lock) {
switch (value) {
int type = curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
switch (type) {
case 0:
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
break;
@@ -332,7 +355,7 @@ void CurveGroup::typeChanged(int value)
void CurveGroup::valuesChanged()
{
if (!lock) {
switch (curveTypeCB->currentIndex()) {
switch (curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt()) {
case 0:
case 1:
{
@@ -341,14 +364,14 @@ void CurveGroup::valuesChanged()
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
else
value = curveValueSB->value();
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
curve = CurveReference(curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
break;
}
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->itemData(curveValueCB->currentIndex()).toInt());
break;
}
@@ -815,16 +838,40 @@ QString getTimerStr(TimerData & timer)
return result;
}
QString getProtocol(ModelData * g_model)
QString getProtocol(ModuleData & module)
{
QString str = getProtocolStr(g_model->moduleData[0].protocol);
if (g_model->moduleData[0].protocol == PPM)
str.append(QObject::tr(": %1 Channels, %2usec Delay").arg(g_model->moduleData[0].channelsCount).arg(g_model->moduleData[0].ppmDelay));
QString str = getProtocolStr(module.protocol);
if (module.protocol == PPM)
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
else if (!module.protocol == OFF)
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
return str;
}
QString getTrainerMode(const int trainermode, ModuleData & module)
{
QString result;
switch (trainermode) {
case 1:
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
break;
case 2:
result=QObject::tr("Master/SBUS Module");
break;
case 3:
result=QObject::tr("Master/CPPM Module");
break;
case 4:
result=QObject::tr("Master/SBUS in battery compartment");
break;
default:
result=QObject::tr("Master/Jack");
}
return result;
}
QString getPhasesStr(unsigned int phases, ModelData & model)
{
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
@@ -1004,7 +1051,6 @@ QString index2version(int index)
int qunlink(const QString & fileName)
{
qDebug() << "unlinking "<< fileName;
QByteArray ba = fileName.toLatin1();
return unlink(ba.constData());
}
@@ -1015,3 +1061,91 @@ QString generateProcessUniqueTempFileName(const QString & fileName)
sanitizedFileName.remove('/');
return QDir::tempPath() + QString("/%1-").arg(QCoreApplication::applicationPid()) + sanitizedFileName;
}
bool isTempFileName(const QString & fileName)
{
return fileName.startsWith(QDir::tempPath());
}
QString getSoundsPath(const GeneralSettings &generalSettings)
{
QString path = g.profile[g.id()].sdPath() + "/SOUNDS/";
QString lang = generalSettings.ttsLanguage;
if (lang.isEmpty())
lang = "en";
path.append(lang);
return path;
}
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen)
{
QSet<QString> result;
QDir dir(path);
if (dir.exists()) {
foreach (QString filename, dir.entryList(filter, QDir::Files)) {
QFileInfo file(filename);
QString name = file.completeBaseName();
if (name.length() <= maxLen) {
result.insert(name);
}
}
}
return result;
}
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
{
return s1.toLower() < s2.toLower();
}
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;
}
+45 -5
View File
@@ -37,12 +37,12 @@ class CompanionIcon: public QIcon {
CompanionIcon(QString baseimage);
};
class GVarGroup : public QObject {
class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -50,13 +50,19 @@ class GVarGroup : public QObject {
protected:
QCheckBox *weightGV;
QSpinBox *weightSB;
QAbstractSpinBox *weightSB;
QSpinBox *sb;
QDoubleSpinBox *dsb;
QComboBox *weightCB;
int & weight;
const unsigned int flags;
double step;
bool lock;
};
#define HIDE_DIFF 0x01
#define HIDE_EXPO 0x02
#define HIDE_NEGATIVE_CURVES 0x04
class CurveGroup : public QObject {
Q_OBJECT
@@ -119,7 +125,8 @@ int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModelData * g_model);
QString getProtocol(ModuleData & module);
QString getTrainerMode(const int trainermode, ModuleData & module);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */
@@ -148,5 +155,38 @@ class QTimeS : public QTime
int qunlink(const QString & fileName);
QString generateProcessUniqueTempFileName(const QString & fileName);
bool isTempFileName(const QString & fileName);
QString getSoundsPath(const GeneralSettings &generalSettings);
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
bool caseInsensitiveLessThan(const QString &s1, const QString &s2);
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
+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>
+198 -142
View File
@@ -110,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()));
@@ -153,13 +153,13 @@ MainWindow::MainWindow():
child->show();
}
else {
child->show();
child->show();
child->print(model,printfilename);
child->close();
}
}
}
}
}
if (printing) {
QTimer::singleShot(0, this, SLOT(autoClose()));
}
@@ -180,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())
@@ -278,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()) {
@@ -299,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) {
@@ -409,7 +447,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
QAbstractButton *rnButton = NULL;
msgBox.setWindowTitle("Companion");
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?").arg(current_firmware_variant->getId()).arg(versionString));
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(versionString));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
if (!rn.isEmpty()) {
@@ -438,7 +476,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
QAbstractButton *rnButton = NULL;
msgBox.setText("Companion");
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now ?").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
if (!rn.isEmpty()) {
@@ -526,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);
@@ -537,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);
@@ -548,7 +586,7 @@ void MainWindow::setTheme(int index)
}
void MainWindow::setIconThemeSize(int index)
{
{
g.iconSize( index );
QMessageBox msgBox;
@@ -687,7 +725,7 @@ void MainWindow::fwchangelog()
}
void MainWindow::customizeSplash()
{
{
customizeSplashDialog *cd = new customizeSplashDialog(this);
cd->exec();
}
@@ -863,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");
@@ -881,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");
@@ -950,7 +988,7 @@ void MainWindow::readEeprom()
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_ARM(eepromInterface->getBoard()))
if (IS_ARM(eepromInterface->getBoard()))
tempFile = generateProcessUniqueTempFileName("temp.bin");
else
tempFile += generateProcessUniqueTempFileName("temp.hex");
@@ -977,11 +1015,12 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
file.remove();
}
g.flashDir(QFileInfo(filename).dir().absolutePath());
// g.flashDir(QFileInfo(filename).dir().absolutePath());
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = FindMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << path << "into" << filename;
QStringList str;
str << path << filename;
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
@@ -994,6 +1033,7 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
if (result == false) {
QStringList str = GetReceiveFlashCommand(filename);
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << filename << "with avrdude:" << str;
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
ad->setWindowIcon(CompanionIcon("read_flash.png"));
ad->exec();
@@ -1016,6 +1056,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = FindMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << path << "from" << filename;
QStringList str;
str << filename << path;
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
@@ -1028,6 +1069,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
if (result == false) {
QStringList str = GetSendFlashCommand(filename);
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << filename << "with avrdude:" << str;
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message, AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
CompanionIcon iconw("write_flash.png");
ad->setWindowIcon(iconw);
@@ -1149,20 +1191,9 @@ void MainWindow::writeBackup()
if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
bool backupEnable = g.enableBackup();
QString backupPath = g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable = false;
}
}
else {
backupEnable = false;
}
bool backupEnable=true;
QString backupPath=getBackupPath();
if (backupPath.isEmpty()) backupEnable=false;
if (backup) {
if (backupEnable) {
QString backupFile = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
@@ -1171,7 +1202,6 @@ void MainWindow::writeBackup()
}
int oldrev = getEpromVersion(fileName);
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmwareFromRadio(tempFlash))
return;
@@ -1217,7 +1247,7 @@ int MainWindow::getFileType(const QString &fullFileName)
}
bool MainWindow::isValidEEPROM(QString eepromfile)
{
{
int eeprom_size;
QFile file(eepromfile);
int fileType = getFileType(eepromfile);
@@ -1232,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))
@@ -1247,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;
}
@@ -1278,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);
@@ -1295,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 backupFile = generateProcessUniqueTempFileName("backup.bin");
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
qDebug() << "MainWindow::writeFlash(): started with" << fileToFlash;
QString fileName;
bool backup = g.backupOnFlash();
if(!fileToFlash.isEmpty()) {
fileName = fileToFlash;
}
burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);
cd->exec();
qDebug() << "MainWindow::writeFlash(): flashing " << fileName;
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
backup=false;
}
if (!fileName.isEmpty()) {
if (g.checkHardwareCompatibility()) {
QString tempFlash = generateProcessUniqueTempFileName("flash-check.bin");
if (!readFirmwareFromRadio(tempFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
return;
}
FlashInterface previousFlash(tempFlash);
qunlink(tempFlash);
FlashInterface newFlash(fileName);
qDebug() << "MainWindow::writeFlash(): checking firmware compatibility between " << tempFlash << "and" << fileName;
if (!newFlash.isHardwareCompatible(previousFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
if (isTempFileName(fileName)) {
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
qunlink(fileName);
}
return;
}
}
g.backupOnFlash(backup);
if (backup) {
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;
}
}
else {
backupEnable=false;
}
if (backupEnable) {
QDateTime datetime;
backupFile.clear();
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
}
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
sleep(2);
int res = writeFirmwareToRadio(fileName);
if (res) {
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile;
}
sleep(2);
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
}
}
else {
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
}
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
QDateTime datetime;
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
sleep(2);
}
writeFirmwareToRadio(fileName);
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
}
}
else {
bool backupEnable=true;
QString backupPath=getBackupPath();
if (backupPath.isEmpty()) {
backupEnable=false;
}
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
QDateTime datetime;
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
sleep(2);
}
writeFirmwareToRadio(fileName);
}
if (isTempFileName(fileName)) {
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
qunlink(fileName);
}
}
}
void MainWindow::readBackup()
@@ -1409,7 +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();
}
@@ -1433,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"));
@@ -1449,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);
@@ -1463,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()
@@ -1492,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);
@@ -1513,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;
}
@@ -1547,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,7 +1651,7 @@ void MainWindow::createActions()
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);
@@ -1682,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);
}
@@ -1699,7 +1750,7 @@ void MainWindow::createMenus()
helpMenu->addSeparator();
helpMenu->addAction(contributorsAct);
}
QMenu *MainWindow::createRecentFileMenu()
{
QMenu *recentFileMenu = new QMenu(this);
@@ -1740,7 +1791,7 @@ void MainWindow::createToolBars()
break;
default:
size=QSize(24,24);
break;
break;
}
fileToolBar = addToolBar(tr("File"));
fileToolBar->setIconSize(size);
@@ -1785,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);
@@ -1842,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);
@@ -1850,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())
@@ -1877,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);
}
@@ -1919,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);
@@ -1929,8 +1980,8 @@ void MainWindow::updateProfilesActions()
profileActs[i]->setVisible(true);
if (i == g.id())
profileActs[i]->setChecked(true);
}
else
}
else
{
profileActs[i]->setVisible(false);
}
@@ -1944,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"));
@@ -1985,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();
@@ -2011,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;
}
@@ -2029,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();
+39 -35
View File
@@ -81,7 +81,7 @@ MdiChild::MdiChild():
}
}
MdiChild::~MdiChild()
MdiChild::~MdiChild()
{
delete ui;
}
@@ -174,7 +174,7 @@ void MdiChild::modelEdit()
if (row == 0){
generalEdit();
}
}
else {
QApplication::setOverrideCursor(Qt::WaitCursor);
checkAndInitModel( row );
@@ -251,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"),
@@ -260,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
@@ -294,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);
@@ -330,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();
@@ -367,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);
@@ -375,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);
}
@@ -505,7 +515,7 @@ void MdiChild::setCurrentFile(const QString &fileName)
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
g.recentFiles( files );
}
@@ -516,17 +526,9 @@ QString MdiChild::strippedName(const QString &fullFileName)
void MdiChild::writeEeprom() // write to Tx
{
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
}
backupEnable=false;
}
}
else {
bool backupEnable=true;
QString backupPath=((MainWindow *)this->parent())->getBackupPath();
if (backupPath.isEmpty()) {
backupEnable=false;
}
QString stickCal=g.profile[g.id()].stickPotCalib();
@@ -602,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();
@@ -654,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();
+77 -71
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,46 +202,14 @@ void Channels::nameEdited()
}
}
void Channels::offsetEdited()
{
QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(sender());
int index = dsb->property("index").toInt();
model.limitData[index].offset = round(dsb->value() * 10);
emit modified();
}
void Channels::minEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].min = round(sb->value() * 10);
emit modified();
}
void Channels::maxEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].max = round(sb->value() * 10);
emit modified();
}
void Channels::refreshExtendedLimits()
{
int channelMax = model.getChannelsMax();
int channelMaxValue = channelMax * 10;
for (int i=0; i<firmware->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i];
minDSB->setMinimum(-channelMax);
maxDSB->setMaximum(+channelMax);
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
if ( model.limitData[i].min < -channelMaxValue ) model.limitData[i].min = -channelMaxValue;
if ( model.limitData[i].max > +channelMaxValue ) model.limitData[i].max = +channelMaxValue;
foreach(LimitsGroup *group, limitsGroups) {
group->updateMinMax(10*channelMax);
}
emit modified();
}
+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();
+32 -7
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,16 +146,31 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
edit->setPalette(palette);
edit->setText(tr("Curve %1").arg(i+1));
connect(edit, SIGNAL(clicked()), this, SLOT(editCurve()));
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
if (i<limit) {
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
} else {
ui->curvesLayout2->addWidget(edit, i-limit, 1, 1, 1);
}
// The curve plot checkbox
QCheckBox * plot = new QCheckBox(this);
plot->setProperty("index", i);
plot->setPalette(palette);
connect(plot, SIGNAL(toggled(bool)), this, SLOT(plotCurve(bool)));
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
if (i<limit) {
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
} else {
ui->curvesLayout2->addWidget(plot, i-limit, 0, 1, 1);
}
}
QSpacerItem * item = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
ui->curvesLayout->addItem(item,limit+1,1,1,1,0);
if (limit!=numcurves) {
QSpacerItem * item2 = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
ui->curvesLayout2->addItem(item2,limit+1,1,1,1,0);
}
for (int i=0; i<C9X_MAX_POINTS; i++) {
spnx[i] = new QSpinBox(this);
spnx[i]->setProperty("index", i);
+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>
+79 -57
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,6 +258,9 @@ void CustomFunctionsPanel::playMusic()
phononCurrent = -1;
}
else {
if (phononCurrent >= 0) {
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
}
phononCurrent = index;
clickObject->clear();
#ifdef __APPLE__
@@ -281,21 +278,32 @@ void CustomFunctionsPanel::playMusic()
#define CUSTOM_FUNCTION_NUMERIC_PARAM (1<<0)
#define CUSTOM_FUNCTION_SOURCE_PARAM (1<<1)
#define CUSTOM_FUNCTION_FILE_PARAM (1<<2)
#define CUSTOM_FUNCTION_GV_MODE (1<<3)
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<4)
#define CUSTOM_FUNCTION_ENABLE (1<<5)
#define CUSTOM_FUNCTION_REPEAT (1<<6)
#define CUSTOM_FUNCTION_PLAY (1<<7)
#define CUSTOM_FUNCTION_BL_COLOR (1<<8)
#define CUSTOM_FUNCTION_TIME_PARAM (1<<3)
#define CUSTOM_FUNCTION_GV_MODE (1<<4)
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<5)
#define CUSTOM_FUNCTION_ENABLE (1<<6)
#define CUSTOM_FUNCTION_REPEAT (1<<7)
#define CUSTOM_FUNCTION_PLAY (1<<8)
#define CUSTOM_FUNCTION_BL_COLOR (1<<9)
void CustomFunctionsPanel::customFunctionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
}
void CustomFunctionsPanel::functionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
fswtchParamArmT[index]->setCurrentIndex(0);
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
@@ -318,11 +326,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
int index = fswtchFunc[i]->currentIndex();
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
int channelsMax = model.getChannelsMax(true);
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
fswtchParam[i]->setMinimum(-channelsMax);
fswtchParam[i]->setMaximum(channelsMax);
if (modified) {
model.funcSw[i].param = fswtchParam[i]->value();
}
@@ -368,13 +377,11 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
}
else if (index>=FuncSetTimer1 && index<=FuncSetTimer2) {
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(0);
fswtchParam[i]->setMaximum(59*60+59);
fswtchParam[i]->setValue(model.funcSw[i].param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM + CUSTOM_FUNCTION_ENABLE;
if (modified) model.funcSw[i].param = QTimeS(fswtchParamTime[i]->time()).seconds();
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
fswtchParamTime[i]->setTime(QTimeS(model.funcSw[i].param));
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (index==FuncVolume) {
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
@@ -437,11 +444,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
else {
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
}
}
@@ -457,6 +462,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
}
else if (index==FuncPlaySound) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
@@ -469,6 +475,19 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncPlayScript) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml = 8/*TODO*/;
if (fswtchParamArmT[i]->currentText() != "----") {
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, scriptsSet);
}
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
@@ -485,6 +504,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
fswtchParam[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_NUMERIC_PARAM);
fswtchParamTime[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_TIME_PARAM);
fswtchParamGV[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_TOOGLE);
fswtchParamT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_SOURCE_PARAM);
fswtchParamArmT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_FILE_PARAM);
@@ -510,7 +530,6 @@ void CustomFunctionsPanel::update()
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
}
refreshCustomFunction(i);
}
@@ -531,7 +550,6 @@ void CustomFunctionsPanel::fswPaste()
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.funcSw[selectedFunction].paramarm, paramarmList);
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();
@@ -590,8 +608,9 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
b->clear();
for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
if (((i>=FuncSafetyCh1 && i<=FuncSafetyCh32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
((i==FuncPlayScript && !IS_TARANIS(firmware->getBoard()))) ||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
@@ -616,14 +635,17 @@ void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
b->setCurrentIndex(value);
}
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList)
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> &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);
@@ -669,7 +691,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
b->setCurrentIndex(value);
}
else if (function==FuncVolume) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS);
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS|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];
+7 -6
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,7 +32,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
@@ -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);
@@ -153,7 +153,8 @@ void ExpoDialog::valuesChanged()
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>
+3 -1
View File
@@ -209,7 +209,9 @@ void FlightModePanel::update()
if (ui->gvGB->isVisible()) {
for (int i=0; i<gvCount; i++) {
gvNames[i]->setText(model.gvars_names[i]);
if (firmware->getCapability(GvarsName) > 0) {
gvNames[i]->setText(model.gvars_names[i]);
}
gvValues[i]->setDisabled(model.isGVarLinked(phaseIdx, i));
gvValues[i]->setValue(model.getGVarValue(phaseIdx, i));
if (IS_TARANIS(GetEepromInterface()->getBoard()) && phaseIdx == 0) {
+1 -1
View File
@@ -28,7 +28,7 @@ void HeliPanel::update()
lock = true;
ui->swashTypeCB->setCurrentIndex(model.swashRingData.type);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->swashRingValSB->setValue(model.swashRingData.value);
ui->swashInvertELE->setChecked(model.swashRingData.invertELE);
ui->swashInvertAIL->setChecked(model.swashRingData.invertAIL);
+4 -4
View File
@@ -174,7 +174,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
}
}
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->curve.value) str += " " + md->curve.toString();
QString phasesStr = getPhasesStr(md->phases, model);
if (!phasesStr.isEmpty()) str += " " + phasesStr;
@@ -216,18 +216,18 @@ void InputsPanel::gm_openExpo(int index)
if(index<0 || index>=C9X_MAX_EXPOS) return;
ExpoData mixd(model.expoData[index]);
char inputName[4+1];
emit modified();
update();
QString inputName;
if (firmware->getCapability(VirtualInputs))
strcpy(inputName, model.inputNames[mixd.chn]);
inputName = model.inputNames[mixd.chn];
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings, firmware, inputName);
if (g->exec()) {
model.expoData[index] = mixd;
if (firmware->getCapability(VirtualInputs))
strcpy(model.inputNames[mixd.chn], inputName);
strncpy(model.inputNames[mixd.chn], inputName.toAscii().data(), 4);
emit modified();
update();
}
+22 -15
View File
@@ -11,6 +11,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
ModelPanel(parent, model, generalSettings, firmware),
selectedSwitch(0)
{
int channelsMax = model.getChannelsMax(true);
QGridLayout * gridLayout = new QGridLayout(this);
int col = 1;
@@ -48,8 +50,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
cswitchSource1[i]->setVisible(false);
cswitchValue[i] = new QDoubleSpinBox(this);
cswitchValue[i]->setMaximum(125);
cswitchValue[i]->setMinimum(-125);
cswitchValue[i]->setMaximum(channelsMax);
cswitchValue[i]->setMinimum(-channelsMax);
cswitchValue[i]->setAccelerated(true);
cswitchValue[i]->setDecimals(0);
cswitchValue[i]->setProperty("index", i);
@@ -66,8 +68,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchSource2[i]->setVisible(false);
cswitchOffset[i] = new QDoubleSpinBox(this);
cswitchOffset[i]->setProperty("index",i);
cswitchOffset[i]->setMaximum(125);
cswitchOffset[i]->setMinimum(-125);
cswitchOffset[i]->setMaximum(channelsMax);
cswitchOffset[i]->setMinimum(-channelsMax);
cswitchOffset[i]->setAccelerated(true);
cswitchOffset[i]->setDecimals(0);
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -75,8 +77,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
v2Layout->addWidget(cswitchOffset[i]);
cswitchOffset2[i] = new QDoubleSpinBox(this);
cswitchOffset2[i]->setProperty("index",i);
cswitchOffset2[i]->setMaximum(125);
cswitchOffset2[i]->setMinimum(-125);
cswitchOffset2[i]->setMaximum(channelsMax);
cswitchOffset2[i]->setMinimum(-channelsMax);
cswitchOffset2[i]->setAccelerated(true);
cswitchOffset2[i]->setDecimals(0);
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -211,7 +213,6 @@ void LogicalSwitchesPanel::edited()
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
}
model.customSw[i].andsw = 0;
setSwitchWidgetVisibility(i);
}
@@ -239,6 +240,7 @@ void LogicalSwitchesPanel::edited()
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
break;
case LS_FAMILY_STAY:
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (sender() == cswitchOffset[i]) {
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
@@ -246,10 +248,12 @@ void LogicalSwitchesPanel::edited()
else {
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
}
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix("(release)");
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
default:
@@ -257,6 +261,7 @@ void LogicalSwitchesPanel::edited()
}
emit modified();
lock = false;
updateLine(i);
}
}
@@ -274,7 +279,6 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
else
sb->setSingleStep(0.1);
sb->setValue(value);
sb->setSuffix("");
}
#define SOURCE1_VISIBLE 0x1
@@ -320,7 +324,6 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
}
break;
case LS_FAMILY_STICKY:
mask &= ~DELAY_ENABLED;
// no break
case LS_FAMILY_VBOOL:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
@@ -329,12 +332,16 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
break;
case LS_FAMILY_STAY:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
mask &= ~DELAY_ENABLED;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix(tr("(release)"));
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
case LS_FAMILY_VCOMP:
+1 -1
View File
@@ -26,7 +26,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
ui->MixDR_CB->setChecked(md->noExpo==0);
+39 -6
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>434</height>
<width>412</width>
<height>541</height>
</rect>
</property>
<property name="sizePolicy">
@@ -67,7 +67,7 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -96,7 +96,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -125,7 +125,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -148,7 +148,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -611,6 +611,39 @@ If blank then the mix is considered to be &quot;ON&quot; all the time.</string>
</item>
</layout>
</widget>
<tabstops>
<tabstop>mixerName</tabstop>
<tabstop>sourceCB</tabstop>
<tabstop>weightGV</tabstop>
<tabstop>weightCB</tabstop>
<tabstop>weightSB</tabstop>
<tabstop>offsetGV</tabstop>
<tabstop>offsetCB</tabstop>
<tabstop>offsetSB</tabstop>
<tabstop>curveTypeCB</tabstop>
<tabstop>curveGVarCB</tabstop>
<tabstop>curveValueCB</tabstop>
<tabstop>curveValueSB</tabstop>
<tabstop>trimCB</tabstop>
<tabstop>MixDR_CB</tabstop>
<tabstop>cb_FP0</tabstop>
<tabstop>cb_FP1</tabstop>
<tabstop>cb_FP2</tabstop>
<tabstop>cb_FP3</tabstop>
<tabstop>cb_FP4</tabstop>
<tabstop>cb_FP5</tabstop>
<tabstop>cb_FP6</tabstop>
<tabstop>cb_FP7</tabstop>
<tabstop>cb_FP8</tabstop>
<tabstop>switchesCB</tabstop>
<tabstop>warningCB</tabstop>
<tabstop>mltpxCB</tabstop>
<tabstop>delayUpSB</tabstop>
<tabstop>slowUpSB</tabstop>
<tabstop>delayDownSB</tabstop>
<tabstop>slowDownSB</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../companion.qrc"/>
</resources>
+1
View File
@@ -92,6 +92,7 @@ void ModelEdit::addTab(ModelPanel *panel, QString text)
panels << panel;
QWidget * widget = new QWidget(ui->tabWidget);
QVBoxLayout *baseLayout = new QVBoxLayout(widget);
panel->update();
VerticalScrollArea * area = new VerticalScrollArea(widget, panel);
baseLayout->addWidget(area);
ui->tabWidget->addTab(widget, text);
+18
View File
@@ -122,6 +122,15 @@ qreal Node::getX()
return 0;
}
void Node::setX(qreal newX)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setX(rect.left() + (newX+1) * rect.width()/2);
}
}
qreal Node::getY()
{
if(scene())
@@ -132,6 +141,15 @@ qreal Node::getY()
return 0;
}
void Node::setY(qreal newY)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setY(rect.top() + (newY+1) * rect.height()/2);
}
}
QList<Edge *> Node::edges() const
{
return edgeList;
+2
View File
@@ -72,6 +72,8 @@ class Node : public QGraphicsObject
int getBallSize() {return ballSize;}
qreal getX();
qreal getY();
void setX(qreal newX);
void setY(qreal newX);
void setCenteringX(bool val) {centerX = val;}
void setCenteringY(bool val) {centerY = val;}
+54 -22
View File
@@ -5,7 +5,7 @@
#include "helpers.h"
#include "appdata.h"
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware):
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus):
ModelPanel(parent, model, generalSettings, firmware),
timer(timer),
ui(new Ui::Timer)
@@ -35,6 +35,11 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
ui->persistent->addItem(tr("Persistent (manual reset)"), 2);
disableMouseScrolling();
QWidget::setTabOrder(prevFocus, ui->value);
QWidget::setTabOrder(ui->value, ui->mode);
QWidget::setTabOrder(ui->mode, ui->countdownBeep);
QWidget::setTabOrder(ui->countdownBeep, ui->minuteBeep);
QWidget::setTabOrder(ui->minuteBeep, ui->persistent);
lock = false;
}
@@ -67,6 +72,11 @@ void TimerPanel::update()
ui->minuteBeep->setChecked(timer.minuteBeep);
}
QWidget * TimerPanel::getLastFocus()
{
return ui->persistent;
}
void TimerPanel::on_value_editingFinished()
{
timer.val = ui->value->time().minute()*60 + ui->value->time().second();
@@ -179,6 +189,7 @@ void ModulePanel::update()
{
unsigned int mask = 0;
Protocol protocol = (Protocol)module.protocol;
unsigned int max_rx_num = 63;
if (moduleIdx >= 0) {
mask |= MASK_PROTOCOL;
@@ -195,6 +206,7 @@ void ModulePanel::update()
case DSMX:
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
module.channelsCount = 6;
max_rx_num = 20;
break;
case PPM:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
@@ -210,8 +222,9 @@ void ModulePanel::update()
ui->label_protocol->setVisible(mask & MASK_PROTOCOL);
ui->protocol->setVisible(mask & MASK_PROTOCOL);
ui->label_rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->label_rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setMaximum(max_rx_num);
ui->rxNumber->setValue(model.modelId);
ui->label_channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
ui->channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
@@ -247,6 +260,11 @@ void ModulePanel::update()
ui->failsafesLayoutLabel->setVisible(mask & MASK_FAILSAFES);
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
if (mask & MASK_CHANNELS_RANGE) {
ui->channelsStart->setMaximum(32 - ui->channelsCount->value());
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value()));
}
}
void ModulePanel::on_trainerMode_currentIndexChanged(int index)
@@ -342,25 +360,10 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->setupUi(this);
QRegExp rx(CHAR_FOR_NAMES_REGEX);
ui->name->setValidator(new QRegExpValidator(rx, this));
ui->name->setMaxLength(IS_TARANIS(firmware->getBoard()) ? 12 : 10);
for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
for (int i=0; i<firmware->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
}
if (firmware->getCapability(ModelImage)) {
QStringList items;
items.append("");
@@ -407,12 +410,21 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->modelImage_label->hide();
ui->imagePreview->hide();
}
QWidget *prevFocus = ui->image;
for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware, prevFocus);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
prevFocus = timers[i]->getLastFocus();
}
if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide();
}
// Beep Center checkboxes
prevFocus = ui->displayText;
int analogs = 4 + firmware->getCapability(Pots);
for (int i=0; i<analogs+firmware->getCapability(RotaryEncoders); i++) {
QCheckBox * checkbox = new QCheckBox(this);
@@ -421,9 +433,11 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->centerBeepLayout->addWidget(checkbox, 0, i+1);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(onBeepCenterToggled(bool)));
centerBeepCheckboxes << checkbox;
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
checkbox->hide();
if (firmware->getBoard()==BOARD_TARANIS && i==6) {
checkbox->hide();
}
QWidget::setTabOrder(prevFocus, checkbox);
prevFocus = checkbox;
}
// Startup switches warnings
@@ -460,10 +474,14 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
connect(cb, SIGNAL(toggled(bool)), this, SLOT(startupSwitchToggled(bool)));
startupSwitchesSliders << slider;
startupSwitchesCheckboxes << cb;
QWidget::setTabOrder(prevFocus, slider);
QWidget::setTabOrder(slider, cb);
prevFocus = cb;
}
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, firmware->getCapability(Switches));
// Pot warnings
prevFocus = ui->potWarningMode;
if (IS_TARANIS(firmware->getBoard())) {
for (int i=0; i<firmware->getCapability(Pots); i++) {
QCheckBox * cb = new QCheckBox(this);
@@ -475,6 +493,8 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==2) {
cb->hide();
}
QWidget::setTabOrder(prevFocus, cb);
prevFocus = cb;
}
}
else {
@@ -482,6 +502,17 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->potWarningMode->hide();
}
for (int i=0; i<firmware->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
}
disableMouseScrolling();
lock = false;
@@ -579,6 +610,7 @@ void SetupPanel::populateThrottleSourceCB()
lock = true;
ui->throttleSource->clear();
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (i=0; i<6; i++) {
ui->throttleSource->addItem(sourcesTaranis[i], i);
+2 -1
View File
@@ -20,10 +20,11 @@ class TimerPanel : public ModelPanel
Q_OBJECT
public:
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware);
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus);
virtual ~TimerPanel();
virtual void update();
QWidget * getLastFocus();
private slots:
void on_mode_currentIndexChanged(int index);
+13
View File
@@ -532,6 +532,19 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</item>
</layout>
</widget>
<tabstops>
<tabstop>name</tabstop>
<tabstop>image</tabstop>
<tabstop>throttleSource</tabstop>
<tabstop>throttleTrim</tabstop>
<tabstop>throttleWarning</tabstop>
<tabstop>throttleReverse</tabstop>
<tabstop>trimIncrement</tabstop>
<tabstop>extendedLimits</tabstop>
<tabstop>extendedTrims</tabstop>
<tabstop>displayText</tabstop>
<tabstop>potWarningMode</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+15 -4
View File
@@ -344,7 +344,7 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>4</number>
</property>
<property name="maximum">
<number>16</number>
@@ -507,16 +507,16 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>125</number>
<number>63</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
<number>0</number>
</property>
</widget>
</item>
@@ -541,6 +541,17 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>trainerMode</tabstop>
<tabstop>protocol</tabstop>
<tabstop>channelsStart</tabstop>
<tabstop>channelsCount</tabstop>
<tabstop>ppmFrameLength</tabstop>
<tabstop>ppmPolarity</tabstop>
<tabstop>ppmDelay</tabstop>
<tabstop>failsafeMode</tabstop>
<tabstop>rxNumber</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+28 -50
View File
@@ -488,19 +488,6 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
model.frsky.usrProto = 1;
}
if (IS_ARM(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
if (IS_9XRPRO(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
}
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
}
else {
ui->telemetryProtocolLabel->hide();
ui->telemetryProtocol->hide();
}
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
ui->A1Layout->addWidget(analogs[0]);
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
@@ -563,6 +550,19 @@ void TelemetryPanel::setup()
lock = true;
if (IS_ARM(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
if (IS_9XRPRO(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
}
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
}
else {
ui->telemetryProtocolLabel->hide();
ui->telemetryProtocol->hide();
}
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
if (!IS_TARANIS(firmware->getBoard())) {
@@ -593,7 +593,6 @@ void TelemetryPanel::setup()
int varioCap = firmware->getCapability(HasVario);
if (!varioCap) {
ui->varioLimitMax_DSB->hide();
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->varioLimitCenterMax_DSB->hide();
@@ -607,7 +606,6 @@ void TelemetryPanel::setup()
}
else {
if (!firmware->getCapability(HasVarioSink)) {
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->VarioLabel_1->hide();
@@ -616,15 +614,7 @@ void TelemetryPanel::setup()
ui->varioLimitMin_DSB->setValue(model.frsky.varioMin-10);
ui->varioLimitMax_DSB->setValue(model.frsky.varioMax+10);
ui->varioLimitCenterMax_DSB->setValue((model.frsky.varioCenterMax/10.0)+0.5);
if (model.frsky.varioCenterMin==-16) {
ui->varioLimitMinOff_ChkB->setChecked(true);
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
else {
ui->varioLimitMinOff_ChkB->setChecked(false);
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->altimetryGB->setVisible(firmware->getCapability(HasAltitudeSel) || firmware->getCapability(HasVario)),
@@ -719,8 +709,10 @@ void TelemetryPanel::populateCurrentSource()
void TelemetryPanel::on_telemetryProtocol_currentIndexChanged(int index)
{
model.telemetryProtocol = index;
emit modified();
if (!lock) {
model.telemetryProtocol = index;
emit modified();
}
}
void TelemetryPanel::onAnalogModified()
@@ -730,16 +722,20 @@ void TelemetryPanel::onAnalogModified()
void TelemetryPanel::on_bladesCount_editingFinished()
{
model.frsky.blades = ui->bladesCount->value();
emit modified();
if (!lock) {
model.frsky.blades = ui->bladesCount->value();
emit modified();
}
}
void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
{
model.frsky.usrProto = index;
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
telemetryCustomScreens[i]->update();
emit modified();
if (!lock) {
model.frsky.usrProto = index;
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
telemetryCustomScreens[i]->update();
emit modified();
}
}
void TelemetryPanel::on_rssiAlarm1CB_currentIndexChanged(int index)
@@ -801,24 +797,6 @@ void TelemetryPanel::on_varioLimitCenterMin_DSB_editingFinished()
}
}
void TelemetryPanel::on_varioLimitMinOff_ChkB_toggled(bool checked)
{
if (!lock) {
model.frsky.varioCenterMin = -16;
if (!checked) {
lock=true;
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setEnabled(true);
lock=false;
}
else {
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
emit modified();
}
}
void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
{
if (!lock) {
-1
View File
@@ -97,7 +97,6 @@ class TelemetryPanel : public ModelPanel
void on_varioLimitMin_DSB_editingFinished();
void on_varioLimitMax_DSB_editingFinished();
void on_varioLimitCenterMin_DSB_editingFinished();
void on_varioLimitMinOff_ChkB_toggled(bool checked);
void on_varioLimitCenterMax_DSB_editingFinished();
void on_fasOffset_DSB_editingFinished();
void on_mahCount_SB_editingFinished();
+134 -124
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>850</width>
<height>457</height>
<width>749</width>
<height>424</height>
</rect>
</property>
<property name="windowTitle">
@@ -252,7 +252,7 @@
</widget>
</item>
<item row="2" column="1">
<layout class="QGridLayout" name="gridLayout_66" columnstretch="1,0,0,0">
<layout class="QGridLayout" name="gridLayout_66" columnstretch="0,0,0,0">
<item row="0" column="0">
<widget class="QLabel" name="VarioLabel_1">
<property name="sizePolicy">
@@ -277,14 +277,17 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-2.000000000000000</double>
<double>-2.100000000000000</double>
</property>
<property name="maximum">
<double>0.000000000000000</double>
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
@@ -302,6 +305,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
</property>
@@ -327,6 +333,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
@@ -349,6 +358,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
@@ -363,19 +375,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="varioLimitMinOff_ChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Off</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="VarioLabel_2">
<property name="sizePolicy">
@@ -513,21 +512,50 @@
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0" columnstretch="1,0,1,0,1">
<property name="horizontalSpacing">
<number>3</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="3" column="1">
<widget class="QUnsignedAutoComboBox" name="frskyVoltCB">
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="frskyProtoCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>FrSky Sensor Hub</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Various</string>
</property>
</widget>
</item>
<item row="3" column="0">
@@ -543,49 +571,7 @@
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QUnsignedAutoComboBox" name="frskyCurrentCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QLabel" name="current_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Current source</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="bladesCount">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -593,6 +579,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
@@ -607,7 +596,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="blades_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
@@ -635,6 +624,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string> mAh</string>
</property>
@@ -651,6 +643,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string> A</string>
</property>
@@ -688,25 +683,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Various</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="font">
@@ -720,24 +696,43 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="frskyProtoCB">
<item row="4" column="0">
<widget class="QLabel" name="current_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Current source</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QUnsignedAutoComboBox" name="frskyVoltCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QUnsignedAutoComboBox" name="frskyCurrentCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>FrSky Sensor Hub</string>
</property>
</item>
</widget>
</item>
</layout>
@@ -769,19 +764,20 @@
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="rssiLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>RSSI</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="rssiAlarm1Label">
<property name="sizePolicy">
@@ -845,6 +841,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string/>
</property>
@@ -922,6 +921,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string/>
</property>
@@ -939,19 +941,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="rssiLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>RSSI</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
@@ -1018,6 +1007,27 @@
<header>qautocombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>telemetryProtocol</tabstop>
<tabstop>rssiAlarm1CB</tabstop>
<tabstop>rssiAlarm1SB</tabstop>
<tabstop>rssiAlarm2CB</tabstop>
<tabstop>rssiAlarm2SB</tabstop>
<tabstop>varioSourceCB</tabstop>
<tabstop>varioLimitMin_DSB</tabstop>
<tabstop>varioLimitCenterMin_DSB</tabstop>
<tabstop>varioLimitCenterMax_DSB</tabstop>
<tabstop>varioLimitMax_DSB</tabstop>
<tabstop>AltitudeGPS_ChkB</tabstop>
<tabstop>AltitudeToolbar_ChkB</tabstop>
<tabstop>frskyProtoCB</tabstop>
<tabstop>fasOffset_DSB</tabstop>
<tabstop>mahCount_SB</tabstop>
<tabstop>mahCount_ChkB</tabstop>
<tabstop>frskyVoltCB</tabstop>
<tabstop>bladesCount</tabstop>
<tabstop>customScreens</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+335 -247
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>276</width>
<height>118</height>
<height>106</height>
</rect>
</property>
<property name="windowTitle">
@@ -21,252 +21,8 @@
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_11" columnstretch="1,1,1,1" columnminimumwidth="0,0,0,0">
<item row="0" column="0">
<widget class="QLabel" name="label_918">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Unit</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Max">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Max Value</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="alarm1Label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Alarm 1 </string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="alarm1LevelCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>----</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="alarm1GreaterCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>&lt;</string>
</property>
</item>
<item>
<property name="text">
<string>&gt;</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="alarm2Label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Alarm 2</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="alarm2LevelCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>----</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="alarm2GreaterCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>&lt;</string>
</property>
</item>
<item>
<property name="text">
<string>&gt;</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="RatioSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QDoubleSpinBox" name="CalibSB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-12.800000000000001</double>
</property>
<property name="maximum">
<double>12.699999999999999</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="alarm1ValueSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QDoubleSpinBox" name="alarm2ValueSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="CalibLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Offset</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<layout class="QGridLayout" name="gridLayout_11" columnstretch="0,0,0,0,0">
<item row="0" column="1" colspan="4">
<widget class="QComboBox" name="UnitCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -321,10 +77,342 @@
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="alarm2Label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Alarm 2</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,1">
<item>
<widget class="QComboBox" name="alarm1LevelCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>----</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="alarm1GreaterCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>&lt;</string>
</property>
</item>
<item>
<property name="text">
<string>&gt;</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="alarm1ValueSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Max">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Max Value</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
<item>
<widget class="QComboBox" name="alarm2LevelCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>----</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="alarm2GreaterCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>&lt;</string>
</property>
</item>
<item>
<property name="text">
<string>&gt;</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="alarm2ValueSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="alarm1Label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Alarm 1 </string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_918">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Unit</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="RatioSB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QDoubleSpinBox" name="CalibSB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-12.800000000000001</double>
</property>
<property name="maximum">
<double>12.699999999999999</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="CalibLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Offset</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>UnitCB</tabstop>
<tabstop>RatioSB</tabstop>
<tabstop>CalibSB</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+77 -8
View File
@@ -1625,22 +1625,91 @@ May be different from firmware language</string>
</layout>
</widget>
<tabstops>
<tabstop>InvertPixels</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>showSplash</tabstop>
<tabstop>startupCheck_companion9x</tabstop>
<tabstop>startupCheck_fw</tabstop>
<tabstop>historySize</tabstop>
<tabstop>wizardEnable_ChkB</tabstop>
<tabstop>backupPath</tabstop>
<tabstop>backupPathButton</tabstop>
<tabstop>backupEnable</tabstop>
<tabstop>ge_lineedit</tabstop>
<tabstop>ge_pathButton</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>splashLibraryButton</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>splashincludeCB</tabstop>
<tabstop>libraryPath</tabstop>
<tabstop>libraryPathButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>optionCheckBox_1</tabstop>
<tabstop>optionCheckBox_2</tabstop>
<tabstop>checkFWUpdates</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>InvertPixels</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>backLightColor</tabstop>
<tabstop>simuSW</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickCB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>snapshotClipboardCKB</tabstop>
<tabstop>snapshotPath</tabstop>
<tabstop>snapshotPathButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>langCombo</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>sdPath</tabstop>
<tabstop>sdPathButton</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>voice_dnld</tabstop>
<tabstop>optionCheckBox_1</tabstop>
<tabstop>optionCheckBox_2</tabstop>
<tabstop>optionCheckBox_3</tabstop>
<tabstop>optionCheckBox_4</tabstop>
<tabstop>optionCheckBox_5</tabstop>
<tabstop>optionCheckBox_6</tabstop>
<tabstop>optionCheckBox_7</tabstop>
<tabstop>optionCheckBox_8</tabstop>
<tabstop>optionCheckBox_9</tabstop>
<tabstop>optionCheckBox_10</tabstop>
<tabstop>optionCheckBox_11</tabstop>
<tabstop>optionCheckBox_12</tabstop>
<tabstop>optionCheckBox_13</tabstop>
<tabstop>optionCheckBox_14</tabstop>
<tabstop>optionCheckBox_15</tabstop>
<tabstop>optionCheckBox_16</tabstop>
<tabstop>optionCheckBox_17</tabstop>
<tabstop>optionCheckBox_18</tabstop>
<tabstop>optionCheckBox_19</tabstop>
<tabstop>optionCheckBox_20</tabstop>
<tabstop>optionCheckBox_21</tabstop>
<tabstop>optionCheckBox_22</tabstop>
<tabstop>optionCheckBox_23</tabstop>
<tabstop>optionCheckBox_24</tabstop>
<tabstop>optionCheckBox_25</tabstop>
<tabstop>optionCheckBox_26</tabstop>
<tabstop>optionCheckBox_27</tabstop>
<tabstop>optionCheckBox_28</tabstop>
<tabstop>optionCheckBox_29</tabstop>
<tabstop>optionCheckBox_30</tabstop>
<tabstop>optionCheckBox_31</tabstop>
<tabstop>optionCheckBox_32</tabstop>
<tabstop>optionCheckBox_33</tabstop>
<tabstop>optionCheckBox_34</tabstop>
<tabstop>optionCheckBox_35</tabstop>
<tabstop>optionCheckBox_36</tabstop>
<tabstop>optionCheckBox_37</tabstop>
<tabstop>optionCheckBox_38</tabstop>
<tabstop>optionCheckBox_39</tabstop>
<tabstop>optionCheckBox_40</tabstop>
<tabstop>optionCheckBox_41</tabstop>
<tabstop>optionCheckBox_42</tabstop>
<tabstop>checkFWUpdates</tabstop>
<tabstop>renameFirmware</tabstop>
<tabstop>burnFirmware</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>ProfSlot_SB</tabstop>
<tabstop>ProfName_LE</tabstop>
<tabstop>ProfSave_PB</tabstop>
<tabstop>import_PB</tabstop>
<tabstop>export_PB</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+106 -75
View File
@@ -113,8 +113,17 @@ void PrintDialog::printSetup()
str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model))));
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString()));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
}
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[0])));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[1])));
}
if (IS_TARANIS(firmware->getBoard())){
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model->trainerMode, g_model->moduleData[2])));
}
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model)));
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep
@@ -130,7 +139,7 @@ void PrintDialog::printSetup()
QString PrintDialog::printFlightModes()
{
QString str="";
QString str = "";
str.append(QString("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=%1><h2>").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvars+firmware->getCapability(RotaryEncoders)));
str.append(tr("Flight modes"));
str.append("</h2></td></tr><tr><td style=\"border-style:none;\">&nbsp;</td><td colspan=2 align=center><b>");
@@ -147,7 +156,7 @@ QString PrintDialog::printFlightModes()
QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure
for (int i=0; i<4; i++) {
GeneralSettings generalSettings = *g_eeGeneral;
str.append(QString("<td align=\"center\" nowrap><b>%1</b></td>").arg(labels[CONVERT_MODE(i+1)-1]));
str.append(QString("<td align=\"center\" nowrap><b>%1</b></td>").arg((QString)labels[CONVERT_MODE(i+1)-1]));
}
for (unsigned int i=0; i<gvars; i++) {
str.append(QString("<td align=\"center\" nowrap><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model->gvars_names[i]));
@@ -158,38 +167,46 @@ QString PrintDialog::printFlightModes()
str.append("</tr>");
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
FlightModeData *pd=&g_model->flightModeData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td>").arg(i).arg(pd->name));
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale)));
str.append(QString("<td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale)));
str.append("<tr><td valign=\"middle\"><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td>").arg(i).arg(pd->name));
str.append(QString("<td valign=\"middle\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale)));
str.append(QString("<td valign=\"middle\" width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale)));
for (int k=0; k<4; k++) {
//TODO trim values
if (pd->trimRef[k]==-1) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->trim[k]));
//Almost done trim values
if (pd->trimMode[k]==-1) {
str.append(QString("<td valign=\"middle\" align=\"center\"><font size=+1 face='Courier New' color=grey>")+tr("Off")+QString("</font></td>"));
} else {
str.append("<td align=\"right\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(pd->trimRef[k]));
if (pd->trimRef[k]==i) {
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+QString("%1").arg(pd->trim[k])+QString("</font></td>"));
} else {
if (pd->trimMode[k]==0) {
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1").arg(pd->trimRef[k])+QString("</font></td>"));
} else {
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1+").arg(pd->trimRef[k])+QString("<br>%1").arg(pd->trim[k])+QString("</font></td>"));
}
}
}
}
for (unsigned int k=0; k<gvars; k++) {
if (pd->gvars[k]<=1024) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->gvars[k])+"</font></td>");
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>%1").arg(pd->gvars[k])+"</font></td>");
}
else {
int num = pd->gvars[k] - 1025;
if (num>=i) num++;
str.append("<td align=\"right\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(num));
str.append("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(num));
}
}
for (int k=0; k<firmware->getCapability(RotaryEncoders); k++) {
if (pd->rotaryEncoders[k]<=1024) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>");
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>");
}
else {
int num = pd->rotaryEncoders[k] - 1025;
if (num>=i) num++;
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>")+tr("FM")+QString("%1</font></td>").arg(num));
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>")+tr("FM")+QString("%1</font></td>").arg(num));
}
}
str.append(QString("<td align=center><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->swtch.toString()));
str.append(QString("<td align=center valign=\"middle\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->swtch.toString()));
str.append("</tr>");
}
str.append("</table>");
@@ -464,7 +481,7 @@ void PrintDialog::printLimits()
void PrintDialog::printCurves()
{
int i,r,g,b,c,count;
int i,r,g,b,c,count,usedcurves=0;
char buffer[16];
QPen pen(Qt::black, 2, Qt::SolidLine);
@@ -475,27 +492,38 @@ void PrintDialog::printCurves()
if (numcurves==0) {
numcurves=16;
}
{
QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32);
QPainter painter(&qi);
painter.setBrush(QBrush("#FFFFFF"));
painter.setPen(QColor(0,0,0));
painter.drawRect(0,0,ISIZEW,ISIZEW);
str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5));
for(i=0; i<numcurves; i++) {
pen.setColor(colors[i]);
painter.setPen(pen);
colors[i].getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
if(i%2 == 0) str.append("<tr>");
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
if(i%2) str.append("</tr>");
QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32);
QPainter painter(&qi);
painter.setBrush(QBrush("#FFFFFF"));
painter.setPen(QColor(0,0,0));
painter.drawRect(0,0,ISIZEW,ISIZEW);
str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5));
for(i=0; i<numcurves; i++) {
pen.setColor(colors[usedcurves]);
painter.setPen(pen);
colors[usedcurves].getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
int curvepoints=g_model->curves[i].count;
count=0;
for(int j=0; j<curvepoints; j++) {
if (g_model->curves[i].points[j].y!=0)
count++;
}
if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model->curves[i].count !=5)) {
if(usedcurves%2 == 0) str.append("<tr>");
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
if(usedcurves%2) str.append("</tr>");
usedcurves++;
}
}
if (!(usedcurves%2)) str.append("</tr>");
if (usedcurves!=0) {
str.append("</table></td></tr><tr><td colspan=2><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">");
str.append("<tr>");
str.append(doTC("&nbsp;"));
@@ -509,48 +537,50 @@ void PrintDialog::printCurves()
str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("</tr>");
for(i=0; i<numcurves; i++) {
pen.setColor(colors[i]);
painter.setPen(pen);
colors[i].getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
str.append("<tr>");
int curvepoints=g_model->curves[i].count;
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
str.append(QString("<td width=\"70\" rowspan=2 valign=middle><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
else
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
count=0;
for(int j=0; j<curvepoints; j++) {
if (g_model->curves[i].points[j].y!=0)
count++;
}
for(int j=0; j<curvepoints; j++) {
str.append(doTR(QString::number(g_model->curves[i].points[j].y),"green"));
if (j>0 && count!=0) {
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
else
painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
}
}
for(int j=curvepoints; j<numpoint; j++) {
str.append(doTR("","green"));
}
str.append("</tr>");
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) {
str.append("<tr><td width=5>X</td>");
if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
pen.setColor(colors[i]);
painter.setPen(pen);
colors[i].getRgb(&r,&g,&b);
c=r;
c*=256;
c+=g;
c*=256;
c+=b;
sprintf(buffer,"%06x",c);
str.append("<tr>");
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
str.append(QString("<td width=\"70\" rowspan=2 valign=middle><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
else
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
for(int j=0; j<curvepoints; j++) {
str.append(doTR(QString::number(g_model->curves[i].points[j].x),"green"));
str.append(doTR(QString::number(g_model->curves[i].points[j].y),"green"));
if (j>0 && (count!=0 ||(g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM))) {
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
else
painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
}
}
for(int j=curvepoints; j<numpoint; j++) {
str.append(doTR("","green"));
}
str.append("</tr>");
str.append("</tr>");
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) {
str.append("<tr><td width=5>X</td>");
for(int j=0; j<curvepoints; j++) {
str.append(doTR(QString::number(g_model->curves[i].points[j].x),"green"));
}
for(int j=curvepoints; j<numpoint; j++) {
str.append(doTR("","green"));
}
str.append("</tr>");
}
}
}
str.append("</table></td></tr></table></td></tr></table>");
@@ -562,11 +592,9 @@ void PrintDialog::printCurves()
painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20));
painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5);
}
qi.save(curvefile5, "png",100);
te->append(str);
}
te->append(str);
}
void PrintDialog::printSwitches()
@@ -662,6 +690,10 @@ void PrintDialog::printFrSky()
{
int tc=0;
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
int analog=2;
if (IS_ARM(firmware->getBoard())) {
analog=4;
}
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
str.append("<tr><td colspan=3><h2>"+tr("Telemetry Settings")+"</h2></td></tr>");
@@ -670,9 +702,8 @@ void PrintDialog::printFrSky()
str.append(doTC(tr("Range"),"", true));
str.append(doTC(tr("Offset"),"", true));
str.append("</tr>");
FrSkyData *fd=&g_model->frsky;
for (int i=0; i<2; i++) {
for (int i=0; i<analog; i++) {
if (fd->channels[i].ratio!=0) {
tc++;
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
@@ -722,7 +753,7 @@ void PrintDialog::printFrSky()
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td>");
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td></tr>");
FrSkyData *fd=&g_model->frsky;
for (int i=0; i<2; i++) {
for (int i=0; i<analog; i++) {
if (fd->channels[i].ratio!=0) {
tc++;
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
@@ -746,7 +777,7 @@ void PrintDialog::printFrSky()
str.append("<td width=\"40\" align=\"center\"><b>"+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"</b></td><td width=\"40\" align=\"center\"><b>&lt;</b></td><td width=\"40\" align=\"center\"><b>"+QString::number(fd->rssiAlarms[1].value,10)+"</b></td></tr>");
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr>");
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Frsky serial protocol")+"</b></td><td colspan=8 align=\"left\">"+getFrSkyProtocol(fd->usrProto)+"</td></tr>");
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+fd->blades+"</td></tr>");
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+QString("%1").arg(fd->blades)+"</td></tr>");
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr></table>");
}
#if 0
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
set(qcustomplot_SRCS
qcustomplot.cpp
)
set(qcustomplot_HDRS
qcustomplot.h
)
qt4_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
add_library(qcustomplot ${qcustomplot_SRCS})
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+416
View File
@@ -0,0 +1,416 @@
#### Version 1.3.1 released on 25.04.15 ####
Bugfixes:
- Fixed bug that prevented automatic axis rescaling when some graphs/curves had only NaN data points
- Improved QCPItemBracket selection boundaries, especially bsCurly and bsCalligraphic
- Fixed bug of axis rect and colorscale background shifted downward by one logical pixel (visible in scaled png and pdf export)
- Replot upon mouse release is now only performed if a selection change has actually happened (improves responsivity on particularly complex plots)
- Fixed bug that allowed scatter-only graphs to be selected by clicking the non-existent line between scatters
- Fixed crash when trying to select a scatter-only QCPGraph whose only points in the visible key range are at identical key coordinates and vertically off-screen, with adaptive sampling enabled
- Fixed pdf export of QCPColorMap with enabled interpolation (didn't appear interpolated in pdf)
- Reduced QCPColorMap jitter of internal cell boundaries for small sized maps when viewed with high zoom, by applying oversampling factors dependant on map size
- Fixed bug of QCPColorMap::fill() not causing the buffered internal image map to be updated, and thus the change didn't become visible immediately
- Axis labels with size set in pixels (setPixelSize) instead of points now correctly calculate the exponent's font size if beautifully typeset powers are enabled
- Fixed QCPColorMap appearing at the wrong position for logarithmic axes and color map spanning larger ranges
Other:
- Pdf export used to embed entire QCPColorMaps, potentially leading to large files. Now only the visible portion of the map is embedded in the pdf
- Many documentation fixes and extensions, style modernization
- Reduced documentation file size (and thus full package size) by automatically reducing image palettes during package build
- Fixed MSVC warning message (at warning level 4) due to temporary QLists in some foreach statements
#### Version 1.3.0 released on 27.12.14 ####
Added features:
- New plottable class QCPFinancial allows display of candlestick/ohlc data
- New class QCPBarsGroup allows horizontal grouping of multiple QCPBars plottables
- Added QCPBars feature allowing non-zero base values (see property QCPBars::setBaseValue)
- Added QCPBars width type, for more flexible bar widths (see property QCPBars::setWidthType)
- New QCPCurve optimization algorithm, fixes bug which caused line flicker at deep zoom into curve segment
- Item positions can now have different position types and anchors for their x and y coordinates (QCPItemPosition::setTypeX/Y, setParentAnchorX/Y)
- QCPGraph and QCPCurve can now display gaps in their lines, when inserting quiet NaNs as values (std::numeric_limits<double>::quiet_NaN())
- QCPAxis now supports placing the tick labels inside the axis rect, for particularly space saving plots (QCPAxis::setTickLabelSide)
Added features after beta:
- Made code compatible with QT_NO_CAST_FROM_ASCII, QT_NO_CAST_TO_ASCII
- Added compatibility with QT_NO_KEYWORDS after sending code files through a simple reg-ex script
- Added possibility to inject own QCPAxis(-subclasses) via second, optional QCPAxisRect::addAxis parameter
- Added parameter to QCPItemPixmap::setScaled to specify transformation mode
Bugfixes:
- Fixed bug in QCPCurve rendering of very zoomed-in curves (via new optimization algorithm)
- Fixed conflict with MSVC-specific keyword "interface" in text-document-integration example
- Fixed QCPScatterStyle bug ignoring the specified pen in the custom scatter shape constructor
- Fixed bug (possible crash) during QCustomPlot teardown, when a QCPLegend that has no parent layout (i.e. was removed from layout manually) gets deleted
Bugfixes after beta:
- Fixed bug of QCPColorMap/QCPColorGradient colors being off by one color sampling step (only noticeable in special cases)
- Fixed bug of QCPGraph adaptive sampling on vertical key axis, causing staggered look
- Fixed low (float) precision in QCPCurve optimization algorithm, by not using QVector2D anymore
Other:
- Qt 5.3 and Qt 5.4 compatibility
#### Version 1.2.1 released on 07.04.14 ####
Bugfixes:
- Fixed regression which garbled date-time tick labels on axes, if setTickLabelType is ltDateTime and setNumberFormat contains the "b" option
#### Version 1.2.0 released on 14.03.14 ####
Added features:
- Adaptive Sampling for QCPGraph greatly improves performance for high data densities (see QCPGraph::setAdaptiveSampling)
- QCPColorMap plottable with QCPColorScale layout element allows plotting of 2D color maps
- QCustomPlot::savePdf now has additional optional parameters pdfCreator and pdfTitle to set according PDF metadata fields
- QCustomPlot::replot now allows specifying whether the widget update is immediate (repaint) or queued (update)
- QCPRange operators +, -, *, / with double operand for range shifting and scaling, and ==, != for range comparison
- Layers now have a visibility property (QCPLayer::setVisible)
- static functions QCPAxis::opposite and QCPAxis::orientation now offer more convenience when handling axis types
- added notification signals for selectability change (selectableChanged) on all objects that have a selected/selectable property
- added notification signal for QCPAxis scaleType property
- added notification signal QCPLayerable::layerChanged
Bugfixes:
- Fixed assert halt, when QCPAxis auto tick labels not disabled but nevertheless a custom non-number tick label ending in "e" given
- Fixed painting glitches when QCustomPlot resized inside a QMdiArea or under certain conditions inside a QLayout
- If changing QCPAxis::scaleType and thus causing range sanitizing and a range modification, rangeChanged wouldn't be emitted
- Fixed documentation bug that caused indentation to be lost in code examples
Bugfixes after beta:
- Fixed bug that caused crash if clicked-on legend item is removed in mousePressEvent.
- On some systems, font size defaults to -1, which used to cause a debug output in QCPAxisPainterPrivate::TickLabelDataQCP. Now it's checked before setting values based on the default font size.
- When using multiple axes on one side, setting one to invisible didn't properly compress the freed space.
- Fixed bug that allowed selection of plottables when clicking in the bottom or top margin of a QCPAxisRect (outside the inner rect)
Other:
- In method QCPAbstractPlottable::getKeyRange/getValueRange, renamed parameter "validRange" to "foundRange", to better reflect its meaning (and contrast it from QCPRange::validRange)
- QCPAxis low-level axis painting methods exported to QCPAxisPainterPrivate
#### Version 1.1.1 released on 09.12.13 ####
Bugfixes:
- Fixed bug causing legends blocking input events from reaching underlying axis rect even if legend is invisible
- Added missing Q_PROPERTY for QCPAxis::setDateTimeSpec
- Fixed behaviour of QCPAxisRect::setupFullAxesBox (now transfers more properties from bottom/left to top/right axes and sets visibility of bottom/left axes to true)
- Made sure PDF export doesn't default to grayscale output on some systems
Other:
- Plotting hint QCP::phForceRepaint is now enabled on all systems (and not only on windows) by default
- Documentation improvements
#### Version 1.1.0 released on 04.11.13 ####
Added features:
- Added QCPRange::expand and QCPRange::expanded
- Added QCPAxis::rescale to rescale axis to all associated plottables
- Added QCPAxis::setDateTimeSpec/dateTimeSpec to allow axis labels either in UTC or local time
- QCPAxis now additionally emits a rangeChanged signal overload that provides the old range as second parameter
Bugfixes:
- Fixed QCustomPlot::rescaleAxes not rescaling properly if first plottable has an empty range
- QCPGraph::rescaleAxes/rescaleKeyAxis/rescaleValueAxis are no longer virtual (never were in base class, was a mistake)
- Fixed bugs in QCPAxis::items and QCPAxisRect::items not properly returning associated items and potentially stalling
Other:
- Internal change from QWeakPointer to QPointer, thus got rid of deprecated Qt functionality
- Qt5.1 and Qt5.2 (beta1) compatibility
- Release packages now extract to single subdirectory and don't place multiple files in current working directory
#### Version 1.0.1 released on 05.09.13 ####
Bugfixes:
- using define flag QCUSTOMPLOT_CHECK_DATA caused debug output when data was correct, instead of invalid (fixed QCP::isInvalidData)
- documentation images are now properly shown when viewed with Qt Assistant
- fixed various documentation mistakes
Other:
- Adapted documentation style sheet to better match Qt5 documentation
#### Version 1.0.0 released on 01.08.13 ####
Quick Summary:
- Layout system for multiple axis rects in one plot
- Multiple axes per side
- Qt5 compatibility
- More flexible and consistent scatter configuration with QCPScatterStyle
- Various interface cleanups/refactoring
- Pixmap-cached axis labels for improved replot performance
Changes that break backward compatibility:
- QCustomPlot::axisRect() changed meaning due to the extensive changes to how axes and axis rects are handled
it now returns a pointer to a QCPAxisRect and takes an integer index as parameter.
- QCPAxis constructor changed to now take QCPAxisRect* as parent
- setAutoMargin, setMarginLeft/Right/Top/Bottom removed due to the axis rect changes (see QCPAxisRect::setMargins/setAutoMargins)
- setAxisRect removed due to the axis rect changes
- setAxisBackground(-Scaled/-ScaledMode) now moved to QCPAxisRect as setBackground(-Scaled/ScaledMode) (access via QCustomPlot::axisRects())
- QCPLegend now is a QCPLayoutElement
- QCPAbstractPlottable::drawLegendIcon parameter "rect" changed from QRect to QRectF
- QCPAbstractLegendItem::draw second parameter removed (position/size now handled via QCPLayoutElement base class)
- removed QCPLegend::setMargin/setMarginLeft/Right/Top/Bottom (now inherits the capability from QCPLayoutElement::setMargins)
- removed QCPLegend::setMinimumSize (now inherits the capability from QCPLayoutElement::setMinimumSize)
- removed enum QCPLegend::PositionStyle, QCPLegend::positionStyle/setPositionStyle/position/setPosition (replaced by capabilities of QCPLayoutInset)
- QCPLegend transformed to work with new layout system (almost everything changed)
- removed entire title interface: QCustomPlot::setTitle/setTitleFont/setTitleColor/setTitleSelected/setTitleSelectedFont/setTitleSelectedColor and
the QCustomPlot::iSelectTitle interaction flag (all functionality is now given by the layout element "QCPPlotTitle" which can be added to the plot layout)
- selectTest functions now take two additional parameters: bool onlySelectable and QVariant *details=0
- selectTest functions now ignores visibility of objects and (if parameter onlySelectable is true) does not anymore ignore selectability of the object
- moved QCustomPlot::Interaction/Interactions to QCP namespace as QCP::Interaction/Interactions
- moved QCustomPlot::setupFullAxesBox() to QCPAxisRect::setupFullAxesBox. Now also accepts parameter to decide whether to connect opposite axis ranges
- moved range dragging/zooming interface from QCustomPlot to QCPAxisRect (setRangeDrag, setRangeZoom, setRangeDragAxes, setRangeZoomAxes,...)
- rangeDrag/Zoom is now set to Qt::Horizontal|Qt::Vertical instead of 0 by default, on the other hand, iRangeDrag/Zoom is unset in interactions by
default (this makes enabling dragging/zooming easier by just adding the interaction flags)
- QCPScatterStyle takes over everything related to handling scatters in all plottables
- removed setScatterPen/Size on QCPGraph and QCPCurve, removed setOutlierPen/Size on QCPStatisticalBox (now handled via QCPScatterStyle)
- modified setScatterStyle on QCPGraph and QCPCurve, and setOutlierStyle on QCPStatisticalBox, to take QCPScatterStyle
- axis grid and subgrid are now reachable via the QCPGrid *QCPAxis::grid() method. (e.g. instead of xAxis->setGrid(true), write xAxis->grid()->setVisible(true))
Added features:
- Axis tick labels are now pixmap-cached, thus increasing replot performance (in usual setups by about 24%). See plotting hint phCacheLabels which is set by default
- Advanced layout system, including the classes QCPLayoutElement, QCPLayout, QCPLayoutGrid, QCPLayoutInset, QCPAxisRect
- QCustomPlot::axisRects() returns all the axis rects in the QCustomPlot.
- QCustomPlot::plotLayout() returns the top level layout (initially a QCPLayoutGrid with one QCPAxisRect inside)
- QCPAxis now may have an offset to the axis rect (setOffset)
- Multiple axes per QCPAxisRect side are now supported (see QCPAxisRect::addAxis)
- QCustomPlot::toPixmap renders the plot into a pixmap and returns it
- When setting tick label rotation to +90 or -90 degrees on a vertical axis, the labels are now centered vertically on the tick height
(This allows space saving vertical tick labels by having the text direction parallel to the axis)
- Substantially increased replot performance when using very large manual tick vectors (> 10000 ticks) via QCPAxis::setTickVector
- QCPAxis and QCPAxisRect now allow easy access to all plottables(), graphs() and items() that are associated with them
- Added QCustomPlot::hasItem method for consistency with plottable interface, hasPlottable
- Added QCPAxisRect::setMinimumMargins as replacement for hardcoded minimum axis margin (15 px) when auto margin is enabled
- Added Flags type QCPAxis::AxisTypes (from QCPAxis::AxisType), used in QCPAxisRect interface
- Automatic margin calculation can now be enabled/disabled on a per-side basis, see QCPAxisRect::setAutoMargins
- QCPAxisRect margins of multiple axis rects can be coupled via QCPMarginGroup
- Added new default layers "background" and "legend" (QCPAxisRect draws its background on the "background" layer, QCPLegend is on the "legend" layer by default)
- Custom scatter style via QCP::ssCustom and respective setCustomScatter functions that take a QPainterPath
- Filled scatters via QCPScatterStyle::setBrush
Added features after beta:
- Added QCustomPlot::toPainter method, to allow rendering with existing painter
- QCPItemEllipse now provides a center anchor
Bugfixes:
- Fixed compile error on ARM
- Wrong legend icons were displayed if using pixmaps for scatters that are smaller than the legend icon rect
- Fixed clipping inaccuracy for rotated tick labels (were hidden too early, because the non-rotated bounding box was used)
- Fixed bug that caused wrong clipping of axis ticks and subticks when the ticks were given manually by QCPAxis::setTickVector
- Fixed Qt5 crash when dragging graph out of view (iterator out of bounds in QCPGraph::getVisibleDataBounds)
- Fixed QCPItemText not scaling properly when using scaled raster export
Bugfixes after beta:
- Fixed bug that clipped the rightmost pixel column of tick labels when caching activated (only visible on windows for superscript exponents)
- Restored compatibility to Qt4.6
- Restored support for -no-RTTI compilation
- Empty manual tick labels are handled more gracefully (no QPainter qDebug messages anymore)
- Fixed type ambiguity in QCPLineEnding::draw causing compile error on ARM
- Fixed bug of grid layouts not propagating the minimum size from their child elements to the parent layout correctly
- Fixed bug of child elements (e.g. axis rects) of inset layouts not properly receiving mouse events
Other:
- Opened up non-amalgamated project structure to public via git repository
#### Version released on 09.06.12 ####
Quick Summary:
- Items (arrows, text,...)
- Layers (easier control over rendering order)
- New antialiasing system (Each objects controls own antialiasing with setAntialiased)
- Performance Improvements
- improved pixel-precise drawing
- easier shared library creation/usage
Changes that (might) break backward compatibility:
- enum QCPGraph::ScatterSymbol was moved to QCP namespace (now QCP::ScatterSymbol).
This replace should fix your code: "QCPGraph::ss" -> "QCP::ss"
- enum QCustomPlot::AntialiasedElement and flag QCustomPlot::AntialiasedElements was moved to QCP namespace
This replace should fix your code: "QCustomPlot::ae" -> "QCP::ae"
- the meaning of QCustomPlot::setAntialiasedElements has changed slightly: It is now an override to force elements to be antialiased. If you want to force
elements to not be drawn antialiased, use the new setNotAntialiasedElements. If an element is mentioned in neither of those functions, it now controls
its antialiasing itself via its "setAntialiased" function(s). (e.g. QCPAxis::setAntialiased(bool), QCPAbstractPlottable::setAntialiased(bool),
QCPAbstractPlottable::setAntialiasedScatters(bool), etc.)
- QCPAxis::setTickVector and QCPAxis::setTickVectorLabels no longer take a pointer but a const reference of the respective QVector as parameter.
(handing over a pointer didn't give any noticeable performance benefits but was inconsistent with the rest of the interface)
- Equally QCPAxis::tickVector and QCPAxis::tickVectorLabels don't return by pointer but by value now
- QCustomPlot::savePngScaled was removed, its purpose is now included as optional parameter "scale" of savePng.
- If you have derived from QCPAbstractPlottable: all selectTest functions now consistently take the argument "const QPointF &pos" which is the test point in pixel coordinates.
(the argument there was "double key, double value" in plot coordinates, before).
- QCPAbstractPlottable, QCPAxis and QCPLegend now inherit from QCPLayerable
- If you have derived from QCPAbstractPlottable: the draw method signature has changed from "draw (..) const" to "draw (..)", i.e. the method
is not const anymore. This allows the draw function of your plottable to perform buffering/caching operations, if necessary.
Added features:
- Item system: QCPAbstractItem, QCPItemAnchor, QCPItemPosition, QCPLineEnding. Allows placing of lines, arrows, text, pixmaps etc.
- New Items: QCPItemStraightLine, QCPItemLine, QCPItemCurve, QCPItemEllipse, QCPItemRect, QCPItemPixmap, QCPItemText, QCPItemBracket, QCPItemTracer
- QCustomPlot::addItem/itemCount/item/removeItem/selectedItems
- signals QCustomPlot::itemClicked/itemDoubleClicked
- the QCustomPlot interactions property now includes iSelectItems (for selection of QCPAbstractItem)
- QCPLineEnding. Represents the different styles a line/curve can end (e.g. different arrows, circle, square, bar, etc.), see e.g. QCPItemCurve::setHead
- Layer system: QCPLayerable, QCPLayer. Allows more sophisticated control over drawing order and a kind of grouping.
- QCPAbstractPlottable, QCPAbstractItem, QCPAxis, QCPGrid, QCPLegend are layerables and derive from QCPLayerable
- QCustomPlot::addLayer/moveLayer/removeLayer/setCurrentLayer/layer/currentLayer/layerCount
- Initially there are three layers: "grid", "main", and "axes". The "main" layer is initially empty and set as current layer, so new plottables/items are put there.
- QCustomPlot::viewport now makes the previously inaccessible viewport rect read-only-accessible (needed that for item-interface)
- PNG export now allows transparent background by calling QCustomPlot::setColor(Qt::transparent) before savePng
- QCPStatisticalBox outlier symbols may now be all scatter symbols, not only hardcoded circles.
- perfect precision of scatter symbol/error bar drawing and clipping in both antialiased and non-antialiased mode, by introducing QCPPainter
that works around some QPainter bugs/inconveniences. Further, more complex symbols like ssCrossSquare used to look crooked, now they look good.
- new antialiasing control system: Each drawing element now has its own "setAntialiased" function to control whether it is drawn antialiased.
- QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements can be used to override the individual settings.
- Subclasses of QCPAbstractPlottable can now use the convenience functions like applyFillAntialiasingHint or applyScattersAntialiasingHint to
easily make their drawing code comply with the overall antialiasing system.
- QCustomPlot::setNoAntialiasingOnDrag allows greatly improved performance and responsiveness by temporarily disabling all antialiasing while
the user is dragging axis ranges
- QCPGraph can now show scatter symbols at data points and hide its line (see QCPGraph::setScatterStyle, setScatterSize, setScatterPixmap, setLineStyle)
- Grid drawing code was sourced out from QCPAxis to QCPGrid. QCPGrid is mainly an internal class and every QCPAxis owns one. The grid interface still
works through QCPAxis and hasn't changed. The separation allows the grid to be drawn on a different layer as the axes, such that e.g. a graph can
be above the grid but below the axes.
- QCustomPlot::hasPlottable(plottable), returns whether the QCustomPlot contains the plottable
- QCustomPlot::setPlottingHint/setPlottingHints, plotting hints control details about the plotting quality/speed
- export to jpg and bmp added (QCustomPlot::saveJpg/saveBmp), as well as control over compression quality for png and jpg
- multi-select-modifier may now be specified with QCustomPlot::setMultiSelectModifier and is not fixed to Ctrl anymore
Bugfixes:
- fixed QCustomPlot ignores replot after it had size (0,0) even if size becomes valid again
- on Windows, a repaint used to be delayed during dragging/zooming of a complex plot, until the drag operation was done.
This was fixed, i.e. repaints are forced after a replot() call. See QCP::phForceRepaint and setPlottingHints.
- when using the raster paintengine and exporting to scaled PNG, pen widths are now scaled correctly (QPainter bug workaround via QCPPainter)
- PDF export now respects QCustomPlot background color (QCustomPlot::setColor), also Qt::transparent
- fixed a bug on QCPBars and QCPStatisticalBox where auto-rescaling of axis would fail when all data is very small (< 1e-11)
- fixed mouse event propagation bug that prevented range dragging from working on KDE (GNU/Linux)
- fixed a compiler warning on 64-bit systems due to pointer cast to int instead of quintptr in a qDebug output
Other:
- Added support for easier shared library creation (including examples for compiling and using QCustomPlot as shared library)
- QCustomPlot now has the Qt::WA_OpaquePaintEvent widget attribute (gives slightly improved performance).
- QCP::aeGraphs (enum QCP::AntialiasedElement, previously QCustomPlot::aeGraphs) has been marked deprecated since version 02.02.12 and
was now removed. Use QCP::aePlottables instead.
- optional performance-quality-tradeoff for solid graph lines (see QCustomPlot::setPlottingHints).
- marked data classes and QCPRange as Q_MOVABLE_TYPE
- replaced usage of own macro FUNCNAME with Qt macro Q_FUNC_INFO
- QCustomPlot now returns a minimum size hint of 50*50
#### Version released on 31.03.12 ####
Changes that (might) break backward compatibility:
- QCPAbstractLegendItem now inherits from QObject
- mousePress, mouseMove and mouseRelease signals are now emitted before and not after any QCustomPlot processing (range dragging, selecting, etc.)
Added features:
- Interaction system: now allows selecting of objects like plottables, axes, legend and plot title, see QCustomPlot::setInteractions documentation
- Interaction system for plottables:
- setSelectable, setSelected, setSelectedPen, setSelectedBrush, selectTest on QCPAbstractPlottable and all derived plottables
- setSelectionTolerance on QCustomPlot
- selectedPlottables and selectedGraphs on QCustomPlot (returns the list of currently selected plottables/graphs)
- Interaction system for axes:
- setSelectable, setSelected, setSelectedBasePen, setSelectedTickPen, setSelectedSubTickPen, setSelectedLabelFont, setSelectedTickLabelFont,
setSelectedLabelColor, setSelectedTickLabelColor, selectTest on QCPAxis
- selectedAxes on QCustomPlot (returns a list of the axes that currently have selected parts)
- Interaction system for legend:
- setSelectable, setSelected, setSelectedBorderPen, setSelectedIconBorderPen, setSelectedBrush, setSelectedFont, setSelectedTextColor, selectedItems on QCPLegend
- setSelectedFont, setSelectedTextColor, setSelectable, setSelected on QCPAbstractLegendItem
- selectedLegends on QCustomPlot
- Interaction system for title:
- setSelectedTitleFont, setSelectedTitleColor, setTitleSelected on QCustomPlot
- new signals in accordance with the interaction system:
- selectionChangedByUser on QCustomPlot
- selectionChanged on QCPAbstractPlottable
- selectionChanged on QCPAxis
- selectionChanged on QCPLegend and QCPAbstractLegendItem
- plottableClick, legendClick, axisClick, titleClick, plottableDoubleClick, legendDoubleClick, axisDoubleClick, titleDoubleClick on QCustomPlot
- QCustomPlot::deselectAll (deselects everything, i.e. axes and plottables)
- QCPAbstractPlottable::pixelsToCoords (inverse function to the already existing coordsToPixels function)
- QCPRange::contains(double value)
- QCPAxis::setLabelColor and setTickLabelColor
- QCustomPlot::setTitleColor
- QCustomPlot now emits beforeReplot and afterReplot signals. Note that it is safe to make two customPlots mutually call eachothers replot functions
in one of these slots, it will not cause an infinite loop. (usefull for synchronizing axes ranges between two customPlots, because setRange alone doesn't replot)
- If the Qt version is 4.7 or greater, the tick label strings in date-time-mode now support sub-second accuracy (e.g. with format like "hh:mm:ss.zzz").
Bugfixes:
- tick labels/margins should no longer oscillate by one pixel when dragging range or replotting repeatedly while changing e.g. data. This
was caused by a bug in Qt's QFontMetrics::boundingRect function when the font has an integer point size (probably some rounding problem).
The fix hence consists of creating a temporary font (only for bounding-box calculation) which is 0.05pt larger and thus avoiding the
jittering rounding outcome.
- tick label, axis label and plot title colors used to be undefined. This was fixed by providing explicit color properties.
Other:
- fixed some glitches in the documentation
- QCustomPlot::replot and QCustomPlot::rescaleAxes are now slots
#### Version released on 02.02.12 ####
Changes that break backward compatibility:
- renamed all secondary classes from QCustomPlot[...] to QCP[...]:
QCustomPlotAxis -> QCPAxis
QCustomPlotGraph -> QCPGraph
QCustomPlotRange -> QCPRange
QCustomPlotData -> QCPData
QCustomPlotDataMap -> QCPDataMap
QCustomPlotLegend -> QCPLegend
QCustomPlotDataMapIterator -> QCPDataMapIterator
QCustomPlotDataMutableMapIterator -> QCPDataMutableMapIterator
A simple search and replace on all code files should make your code run again, e.g. consider the regex "QCustomPlot(?=[AGRDL])" -> "QCP".
Make sure not to just replace "QCustomPlot" with "QCP" because the main class QCustomPlot hasn't changed to QCP.
This change was necessary because class names became unhandy, pardon my bad naming decision in the beginning.
- QCPAxis::tickLength() and QCPAxis::subTickLength() now each split into two functions for inward and outward ticks (tickLengthIn/tickLengthOut).
- QCPLegend now uses QCPAbstractLegendItem to carry item data (before, the legend was passed QCPGraphs directly)
- QCustomPlot::addGraph() now doesn't return the index of the created graph anymore, but a pointer to the created QCPGraph.
- QCustomPlot::setAutoAddGraphToLegend is replaced by setAutoAddPlottableToLegend
Added features:
- Reversed axis range with QCPAxis::setRangeReversed(bool)
- Tick labels are now only drawn if not clipped by the viewport (widget border) on the sides (e.g. left and right on a horizontal axis).
- Zerolines. Like grid lines only with a separate pen (QCPAxis::setZeroLinePen), at tick position zero.
- Outward ticks. QCPAxis::setTickLength/setSubTickLength now accepts two arguments for inward and outward tick length. This doesn't break
backward compatibility because the second argument (outward) has default value zero and thereby a call with one argument hasn't changed its meaning.
- QCPGraph now inherits from QCPAbstractPlottable
- QCustomPlot::addPlottable/plottable/removePlottable/clearPlottables added to interface with the new QCPAbstractPlottable-based system. The simpler interface
which only acts on QCPGraphs (addGraph, graph, removeGraph, etc.) was adapted internally and is kept for backward compatibility and ease of use.
- QCPLegend items for plottables (e.g. graphs) can automatically wrap their texts to fit the widths, see QCPLegend::setMinimumSize and QCPPlottableLegendItem::setTextWrap.
- QCustomPlot::rescaleAxes. Adapts axis ranges to show all plottables/graphs, by calling QCPAbstractPlottable::rescaleAxes on all plottables in the plot.
- QCPCurve. For plotting of parametric curves.
- QCPBars. For plotting of bar charts.
- QCPStatisticalBox. For statistical box plots.
Bugfixes:
- Fixed QCustomPlot::removeGraph(int) not being able to remove graph index 0
- made QCustomPlot::replot() abort painting when painter initialization fails (e.g. because width/height of QCustomPlot is zero)
- The distance of the axis label from the axis ignored the tick label padding, this could have caused overlapping axis labels and tick labels
- fixed memory leak in QCustomPlot (dtor didn't delete legend)
- fixed bug that prevented QCPAxis::setRangeLower/Upper from setting the value to exactly 0.
Other:
- Changed default error bar handle size (QCustomPlotGraph::setErrorBarSize) from 4 to 6.
- Removed QCustomPlotDataFetcher. Was deprecated and not used class.
- Extended documentation, especially class descriptions.
#### Version released on 15.01.12 ####
Changes that (might) break backward compatibility:
- QCustomPlotGraph now inherits from QObject
Added features:
- Added axis background pixmap (QCustomPlot::setAxisBackground, setAxisBackgroundScaled, setAxisBackgroundScaledMode)
- Added width and height parameter on PDF export function QCustomPlot::savePdf(). This now allows PDF export to
have arbitrary dimensions, independent of the current geometry of the QCustomPlot.
- Added overload of QCustomPlot::removeGraph that takes QCustomPlotGraph* as parameter, instead the index of the graph
- Added all enums to the Qt meta system via Q_ENUMS(). The enums can now be transformed
to QString values easily with the Qt meta system, which makes saving state e.g. as XML
significantly nicer.
- added typedef QMapIterator<double,QCustomPlotData> QCustomPlotDataMapIterator
and typedef QMutableMapIterator<double,QCustomPlotData> QCustomPlotDataMutableMapIterator
for improved information hiding, when using iterators outside QCustomPlot code
Bugfixes:
- Fixed savePngScaled. Axis/label drawing functions used to reset the painter transform
and thereby break savePngScaled. Now they buffer the current transform and restore it afterwards.
- Fixed some glitches in the doxygen comments (affects documentation only)
Other:
- Changed the default tickLabelPadding of top axis from 3 to 6 pixels. Looks better.
- Changed the default QCustomPlot::setAntialiasedElements setting: Graph fills are now antialiased
by default. That's a bit slower, but makes fill borders look better.
#### Version released on 19.11.11 ####
Changes that break backward compatibility:
- QCustomPlotAxis: tickFont and setTickFont renamed to tickLabelFont and setTickLabelFont (for naming consistency)
Other:
- QCustomPlotAxis: Added rotated tick labels, see setTickLabelRotation
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -37,7 +37,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-family:'arial,sans-serif'; font-size:13px; font-style:italic; color:#222222; background-color:#ffffff;&quot;&gt;Note: if you have a Taranis that has not had the firmware upgraded to 2.0 then this version of Companion will not work.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
+9
View File
@@ -1,10 +1,16 @@
set(simulation_SRCS
simulatordialog.cpp
telemetrysimu.cpp
trainersimu.cpp
debugoutput.cpp
)
set(simulation_UIS
simulatordialog-9x.ui
simulatordialog-taranis.ui
telemetrysimu.ui
trainersimu.ui
debugoutput.ui
)
set(simulation_HDRS
@@ -14,6 +20,9 @@ set(simulation_HDRS
xcursorwidget.h
xmenuwidget.h
myslider.h
telemetrysimu.h
trainersimu.h
debugoutput.h
)
if(SDL_FOUND)

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