Compare commits

..

565 Commits

Author SHA1 Message Date
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
1675 changed files with 161302 additions and 388283 deletions
+1 -5
View File
@@ -1,4 +1,3 @@
/.idea/
/.*project
/.settings
/.autotools
@@ -6,7 +5,4 @@ radio/src/bootloader/.dep/
radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.stamp
radio/src/lua/lua_fields_*.txt
radio/src/lua/lua_exports_*.txt
/doc
-20
View File
@@ -1,20 +0,0 @@
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 add-apt-repository ppa:ubuntu-toolchain-r/test --yes
- sudo add-apt-repository ppa:beineri/opt-qt551 --yes
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-get update -qq
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
install:
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
- export CXX="g++-5" CC="gcc-5"
script:
- ./radio/util/commit-tests.sh .
-40
View File
@@ -1,40 +0,0 @@
project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "2")
set(VERSION_REVISION "0")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
message(STATUS "OpenTX ${VERSION}")
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0023 OLD)
set(CMAKE_CXX_STANDARD 11)
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
add_subdirectory(${RADIO_SRC_DIRECTORY})
if(Qt5Widgets_FOUND)
add_subdirectory(${COMPANION_SRC_DIRECTORY})
endif()
+13 -10
View File
@@ -1,14 +1,11 @@
Bertrand Songis (bsongis)
André Bernet (kilrah)
Bertrand Songis
Romolo Manfredini
André Bernet
Michael Blandford
Damjan Adamic (projectkk2glider)
Franck Aguerre (jivarofad)
Romolo Manfredini (romoloman)
Martin Hotař (mhotar)
Rob Thomson
Bryan J. Rentoul (gruvin)
Cameron Weeks (th9xer)
Bryan J. Rentoul (aka Gruvin)
Cameron Weeks
Martin Hotař
Andreas Weitl
Kjell Kernen
Gabriel Birkus
@@ -16,4 +13,10 @@ Jean-Pierre Parisy
Karl Szmutny
Michal Hlavinka
Pat Mackenzie
Michael Byrne
Michael Byrne (logos and official splashes)
Severino Anedda (splash screens)
Grootwitbaas - 9xforums.com (mac)
Adrian Amberg (splash screens)
Wallaguest1 - 9xforums.com (splash screens)
HC1969 - 9xforums.com (splash screens)
+37 -136
View File
@@ -1,15 +1,3 @@
<a href="http://frsky-rc.com">FrSky (monthly)</a>
<a href="http://alofthobbies.com">Aloft Hobbies</a>
<a href="http://jonathan.it">Jonathan Modellismo</a>
<a href="http://wstech.de">WsTech</a>
<a href="http://aviomotive.com">Aviomotive</a>
<a href="http://boltrc.com">BoltRC</a>
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
<a href="http://litepilots.com">LitePilots</a>
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
<a href="http://3drobotics.com">3D Robotics</a>
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
Mario Sette
Felice Baratto
Alessandro Mari
@@ -26,10 +14,11 @@ Chris Guy
Adrien Gravouille
Thomas Black
Marc Lucht
Michel Baily
Zdenek Trojanek
Martin Hotar
Stefan Grundevik
Fabio Eboli
[Devo] Stefan Grundevik
[Devo] Fabio Eboli
Federico Zotti
Albin Esbjörnsson
Kilian Hüttenhofer
@@ -48,6 +37,7 @@ R. Scott Page
Johan Cronje
Renato Aranghelovici
Jeffrey Irvin
Aloft Hobbies
John Rodgers
Kenneth Crump
Damjan Adamic
@@ -90,6 +80,7 @@ Christian Schulz
Gregory J Shepherd
Michael Shellim
Ming Wang
R. Scott Page
Bernard Lukaschek
Nigel Chippindale
Mike Perkins
@@ -102,6 +93,7 @@ Heinrich Illig
Michael Collins
Michael Manning
Craig Lorentz
Jonathan Modellismo - jonathan.it
André Lasseret
Felipe Alexandre de Oliveira
Brian Harris
@@ -112,6 +104,7 @@ Erhard Werner
Stig Jøran Moen
Keith Hertzog
Christophe Dauvergne
Michel Baily
Tauno Rautakorpi
Sven Assmus
Paul Dittman
@@ -128,6 +121,7 @@ Christophe Rodriguez
Larisa Filocamo
Hartmut Sahm
Åke Brodin
Aloft Hobbies - www.alofthobbies.com
Ted Moss
Filippos Tigarakis
Chewytm
@@ -175,13 +169,16 @@ Willie Swanepoel
Satoru Sasaki
Tyler Darby
Nicholas Crego
Keith Hertzog
Johan Moelich
Timo Esser
Brian Paddock
Dean Church (monthly)
Brian Paddock (monthly)
Jean Pierre Parisy
Norbert Martsch
Jean-Marie Guitard
Tilman Baumann
Mike Perkins
Tilman Baumann (monthly)
Fred Larssen
Ari Aalto
Robert Sams
@@ -192,7 +189,7 @@ Paul Robinson
Dave Matison
Mike Matheny
Pino Agostino
Graham Boucher
Graham Boucher (monthly)
Nelson Noura
Joel Allamy
Philip David Martin
@@ -202,7 +199,8 @@ Blake Spilman
Timothy Pelletier
Glen Roe (ShowMaster)
Jan Van Ooteghem
Lawrence Christensen
David Ankers - Special thanks here to the OpenPilot project!
Lawrence Christensen (monthly)
Leo Duflou
Bruce Wood
Arnd Feige
@@ -255,12 +253,13 @@ Terry McKinley
Марков Алексей
Offer Shmuely
Ian Lobley
Keith Hertzog
Stéphane Fortas
Peter Mitrik
Thomas Majewski
ANF King
Henrik Hammarström
Kenneth Lilja
Kenneth Lilja (monthly)
R Wells
Uwe Jordt
Harald Wilczak
@@ -273,6 +272,7 @@ Miguel Villalpando
Kim Dong Hoon
Terry McKinley
Walter Bell
wsTech - http://wstech.de
Clinton Linck
Josep Clodas Sola
Thierry Martin
@@ -306,6 +306,7 @@ Henry Deucker
Christian Fuchs
Arold Reinders
Robert Miller
Aviomotive - www.aviomotive.com
Mark Gaskievicz
Roland Müller
Frank Gewalt
@@ -319,6 +320,7 @@ Steve Coley
Sean Cull
Roberto Orsello
David Finger
FrSky - www.frsky-rc.com (monthly)
Jean-Marie Oddo
Mike Matheny
Glen Roe (Showmaster)
@@ -345,6 +347,7 @@ Sven Assmus
Markus Eberl
Nicholas Field
Harald Wilczak
Michel Baily
John Grepps
Anthony Burbidge
Sherba Baine
@@ -356,6 +359,7 @@ Aaron Stringer
Alan J Wasserman
Wolfgang Rauser
Samuel Cook
BoltRC - www.boltrc.com
Friedrich Ipolt
Barrington Cole
Charles Lakins
@@ -400,6 +404,7 @@ Colin Rycroft
Emanuel Stassar
Michael Gregory
Robert Russell
Gordon Stahl
Felix Kaiser
Joshua Bardwell
Davd Goodall
@@ -415,16 +420,20 @@ Andrea Montefusco
Paul Luby
Donald L Webster
Kenneth Frehafer
Peter McHenry
Matthias Hase
Markus Wolf
Andrew Fazio
Stefan Künst
Stephen Adams
Arold Reinders
Tauno Rautakorpi
Frank Houvenaghel
Aerial Tech Hobbies - www.aerialtechhobbies.com
George Neusse
Andreja Rusjakovski
Axel Stöckle
Mike Perkins
Erwin Störrle
Rodger Hopper
Fernando Cesar
@@ -480,6 +489,7 @@ Robert Ferguson
CY Enterprise
Michel Stathakis Neto
Beat Zurflueh
Heinrich Illig
Portstate Pty Ltd
Jens Hoffmann
Ricardo Santos
@@ -494,6 +504,7 @@ Cecil Porter
Robert Canavan
Greg Higginbottom
Tim Walker
Thos. O'Meara Photography
Spis Ltd/TurboNote
Patricia Cox
Matthew Lukes
@@ -585,16 +596,18 @@ Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Michel Baily
Donald Burke
Ronald Donker
Fredie Singh
Patrizio Simoncini
Patrizio Simoncini (monthly)
Harald Gabler
Michael Brown
Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Gordon Stahl
Christian Grandjean
Roger Bergevin
NorthSide
@@ -606,6 +619,7 @@ Manuel McLure
Fernando Rimoldi
Hiltenkamp Stephan
Sandeep Kishore Jain
Sebastien Charpentier
Greg Parker
Norman Maaß
Adriano Del Ben
@@ -635,6 +649,7 @@ Pasi Pitkänen
Lexington S Morley
Jeff Roberson
Volkov Victor
Mike Perkins
Bryan Anderson
Daniel Garber
Pavel Stein
@@ -659,8 +674,7 @@ RK Custom Homes
James Houck
Piet Teekens
Tommy Widenflycht
Johan Petrus Theophilus
Maria van Melis
Johan Petrus Theophilus Maria van Melis
Ralph Gustafson
Paul Luby
Andrew Duncan
@@ -669,6 +683,7 @@ Edward Glover
Kelly Byrd
Brad Curtis
Wolfgang Kuhl
LitePilots - litepilots.com
John Beidl
Roy Nixon
Glen Roe
@@ -736,117 +751,3 @@ F.Javier Martinez Velasco
Claudio Piccinini
John Jackson
John Beech
Rene TraaJohn Jackson
Sebastien Charpentier (monthly)
Nigel Hendriks
Frédéric Devillard
Albert Herzog
Anindya Mukerjee
Kenny Stanberry
Tauno Rautakorpi
Mathias Krapp
Fernando Rimoldi
Wolfgang Rauser
Richard Shagam
Stephen Bailey
DK-System
Casa Kuxtal
Christopher Potts
Douglas George
Michael Banks
Jon Wiltshire
David Green
Guy Willems
Xavier Mestelan Pinon
Maik Gottschalk
Scott Sparks
John Dunning
RAD51
Ron Powell
Alain Labonne
Carol Sills
Franck Aßmann
Larry Anderson
Mikael Wallbäck
Wes Warner
Christoffer H Henni
Donna Bayer
Garry Ogilvie
Karlheinz Sirsch
Fred Larssen
Rob Coppock
Franz Josef Hahn
Serge Ribault
Tanguy Le Moign
Barrett Powell
Patrice Lafeuille
Martin Blume
Marek Kopyto
Marco Lange
Gary Nix
Jack Oliphant
John Lever
Adolphe Montefiore
Steven De Weerdt
Håkan Berggen
Ayelet Egosi
Jean-Frederic Gaudreault
Jim Wagner
Lee Scott
Roger Keatley
Sherman Lovell
Hugh Caldwell
JB Fisher Company
Michels Bernhard
Pietro Rossin
Carsten Wache
Brock White
Steven Poretz
David Huelster
Gordon Stahl (monthly)
John Mathison
Richard Duczmal
Gregory Barron
Marcel Fischer
Klas Mälman
Viljo Liukku
Eric Smith
Sven Assmus
Luke Mole
NorthSide
Hannes Mössler
James Kaufman
Ravi Gupta
Lexington S Morley
Ralph Segar
Frédéric Devillard
Cory Theurer
Valentinos Zachariou
Garrett Paquette
Heung Jin Choi
Kerry Cochrell
Doug Miller
Andrzej Weydmann
Chair-man.nl
Eric Beier
Jay Warren
Marian Matej
Alastair Smith
Timothy Senecal
Dietmar Drees
Bruce Jones
Adil Busaidy
Herman Hofman
Jean Paul Michel
Peter McHenry
Julien lecoquierre
Jean-Marie Clay
Robert Nicoll
Dan Nixon
Ewald Moehring
Giovanni Carnesecchi
Paul Dumsday
Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
+3 -5
View File
@@ -1,9 +1,7 @@
##OpenTX 2.2 Branch
##OpenTX Master Branch
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=next)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://gitter.im/opentx/opentx](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Donate using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
You have found your way to the GitHub repository site for the OpenTX Master Branch. This code branch holds the source code for the latest stable release.
The ongoing development on 2.2.x is done in this branch.
The ongoing development is not done in this branch. It is performed in the branch called next.
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.
-22
View File
@@ -1,22 +0,0 @@
macro(add_bitmaps_target targetname filter width format)
file(GLOB bitmaps ${filter})
foreach(bitmap ${bitmaps})
get_filename_component(target ${bitmap} NAME_WE)
set(target ${target}.lbm)
add_custom_command(
OUTPUT ${target}
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
DEPENDS ${bitmap}
)
list(APPEND bitmaps_files ${target})
endforeach()
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
endmacro(add_bitmaps_target)
macro(add_truetype_font_target radio name font size bold)
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
add_custom_target(ttf_${radio}_${name}
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
endmacro(add_truetype_font_target)
-19
View File
@@ -1,19 +0,0 @@
# Locate lupdate binary from QT
# This module defines
# LUPDATE_EXECUTABLE, where is QT lupdate
# LUPDATE_FOUND, if false, don't try to use lupdate
FIND_PROGRAM( LUPDATE_EXECUTABLE
NAMES
lupdate lupdate-qt4
)
MESSAGE( STATUS ${LUPDATE_EXECUTABLE} )
# if the program is found then we have it
IF( LUPDATE_EXECUTABLE )
SET( LUPDATE_FOUND "YES" )
ENDIF( LUPDATE_EXECUTABLE )
MARK_AS_ADVANCED( LUPDATE_EXECUTABLE )
-39
View File
@@ -1,39 +0,0 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "date not implemented")
set(${RESULT} 00.00.0000)
endif(WIN32)
endmacro(today)
macro(now RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "time not implemented")
set(${RESULT} 00:00:00)
endif(WIN32)
endmacro(now)
macro(git_id RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "Git ID implemented")
set(${RESULT} 0)
endif(WIN32)
endmacro(git_id)
+2 -108
View File
@@ -1,109 +1,3 @@
<h2>Version 2.1.6 / 2015-11-11</h2>
[Taranis]
<ul>
<li>Telemetry custom screen changes didn't emit modified signal (<a href=https://github.com/opentx/opentx/issues/3029>#3029</a>)</li>
<li>Hide D8/LR12 when eu firmware option is selected</li>
</ul>
<h2>Version 2.1.5 / 2015-11-05</h2>
Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrSky's release of OpenTX 2.1.4
<ul>
<li>Fixed: changing any setting on the telemetry panel does not set the file as being modified (<a href=https://github.com/opentx/opentx/issues/2875>#2875</a>)</li>
<li>Print model fix for "Play value.... not on startup" (<a href=https://github.com/opentx/opentx/issues/2736>#2736</a>)</li>
<li>Top LCD Timer could not be selected for X9E (<a href=https://github.com/opentx/opentx/issues/2850>#2850</a>)</li>
<li>More informative error/info messages when openin eepe files (<a href=https://github.com/opentx/opentx/issues/2778>#2778</a>)</li>
<li>Print model fix for curves (<a href=https://github.com/opentx/opentx/issues/2896>#2896</a>)</li>
<li>Added missing special functions (bind, range check, set failsafe) (<a href=https://github.com/opentx/opentx/issues/2753>#2753</a>)</li>
<li>Some defaults missing when changing telemetry formula, update propagation issues (<a href=https://github.com/opentx/opentx/issues/2928>#2928</a>)</li>
<li>Fixed wrong import of Logical switches from OpenTX 2.0.x version (<a href=https://github.com/opentx/opentx/issues/2942>#2942</a>)</li>
<li>Fixed a problem with updates path on Windows (<a href=https://github.com/opentx/opentx/issues/2876>#2876</a>)</li>
<li>Edge representation unified (changed from "no release" to "instant") (<a href=https://github.com/opentx/opentx/issues/2837>#2837</a>)</li>
<li>Added channel names on failsafe sliders (<a href=https://github.com/opentx/opentx/issues/3021>#3021</a>)</li>
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
<li>Various texts and translations corrections</li>
<li>Various small bug-fixes: <a href=https://github.com/opentx/opentx/issues/2994>#2994</a>,
<a href=https://github.com/opentx/opentx/issues/3016>#3016</a>,
<a href=https://github.com/opentx/opentx/issues/3012>#3012</a>
</li>
</ul>
<h2>Version 2.1.3 / 2015-09-09</h2>
<ul>
<li>Fix missing translations in inputs/mixes tabs, print and compare dialogs (<a href=https://github.com/opentx/opentx/issues/2847>#2847</a>)</li>
</ul>
<h2>Version 2.1.2 / 2015-09-07</h2>
<ul>
<li>Fixed: Lua model scripts outputs not working in a simulator (<a href=https://github.com/opentx/opentx/issues/2684>#2684</a>)</li>
<li>Fixed a problem of Companion 2.1 trying to install into 2.0 path.
The effect will only be visible for the users that did not install any of the previous 2.1.x versions.
(<a href=https://github.com/opentx/opentx/issues/2645>#2645</a>)</li>
<li>Added missing SDL libraries to MAC package (<a href=https://github.com/opentx/opentx/issues/2678>#2678</a>)</li>
<li>Added used channels check/warning in Wizard (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
<li>Model Print and Model Compare improvements and fixes (<a href=https://github.com/opentx/opentx/issues/2734>#2734</a>, <a href=https://github.com/opentx/opentx/issues/2737>#2737</a>, <a href=https://github.com/opentx/opentx/issues/2576>#2576</a>)</li>
<li>Negative telemetry offset value was reset when writing back to radio (<a href=https://github.com/opentx/opentx/issues/2738>#2738</a>)</li>
<li>Telemetry sensor names were not displayed (<a href=https://github.com/opentx/opentx/issues/2807>#2807</a>)</li>
<li>Mixes multiplex representation now the same as on the radio (<a href=https://github.com/opentx/opentx/issues/2808>#2808</a>)</li>
<li>Fixed language-related startup crash on Mac (<a href=https://github.com/opentx/opentx/issues/2815>#2815</a>)</li>
<li>Fixed issues with conversion from 2.0 (<a href=https://github.com/opentx/opentx/issues/2809>#2809</a>, <a href=https://github.com/opentx/opentx/issues/2800>#2800</a>)</li>
<li>Fixed Throttle source export issue on X9E (<a href=https://github.com/opentx/opentx/issues/2844>#2844</a>)</li>
<li>Added support for the AR9X replacement board (prototype) for the Turnigy 9X radio, info <a href=http://www.rcgroups.com/forums/showthread.php?t=2479552>here</a></li>
</ul>
<h2>Version 2.1.1 / 2015-08-06</h2>
<ul>
<li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li>
<li>DSM receiver numbers for external module were not converted from previous version EEPROM (<a href=https://github.com/opentx/opentx/issues/2474>#2474</a>)</li>
<li>Precision incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2479>#2479</a>)</li>
<li>Unit incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2485>#2485</a>)</li>
<li>Fixed import/export of trim values (<a href=https://github.com/opentx/opentx/issues/2484>#2484</a>)</li>
<li>Removed constant access to floppy disk (<a href=https://github.com/opentx/opentx/issues/2160>#2160</a>)</li>
<li>Telemetry view script combo box list was empty (<a href=https://github.com/opentx/opentx/issues/2465>#2465</a>)</li>
<li>Telemetry view bars ranges not transfered to radio (<a href=https://github.com/opentx/opentx/issues/2491>#2491</a>)</li>
<li>Fixed Standalone simulator radio selection display problem (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
<li>Added missing simulation libraries and enabled side by side installation of Companion 2.0 and 2.1 on Linux (<a href=https://github.com/opentx/opentx/issues/2500>#2500</a>)</li>
<li>Standalone simulator now remembers which radio was simulated in previous session (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
<li>Radio calibration value were not displayed (<a href=https://github.com/opentx/opentx/issues/2502>#2502</a>)</li>
<li>Fixed Vario / Voltage / Current sources export problem</li>
<li>Writing model settings to 9XR-PRO did not work (<a href=https://github.com/opentx/opentx/issues/2402>#2402</a>, <a href=https://github.com/opentx/opentx/issues/2517>#2517</a>)</li>
<li>Model Print and Model Compare improvements</li>
<li>Fixed Companion OSX version (<a href=https://github.com/opentx/opentx/issues/2549>#2549</a>)</li>
<li>Firmware nightly builds are now downloadable from nightly builds of Companion (<a href=https://github.com/opentx/opentx/issues/2526>#2526</a>, <a href=https://github.com/opentx/opentx/issues/2634>#2634</a>)</li>
<li>Fixed telemetry item lists (<a href=https://github.com/opentx/opentx/issues/2541>#2541</a>)</li>
<li>Fixed missing pots P1..P3 for 9X (<a href=https://github.com/opentx/opentx/issues/2543>#2543</a>)</li>
<li>Fixed "Invalid model and settings" error message when writing models and settings to the radio (<a href=https://github.com/opentx/opentx/issues/2544>#2544</a>)</li>
<li>Global Functions fixes (<a href=https://github.com/opentx/opentx/issues/2558>#2558</a>)</li>
<li>Export to Google Earth now working (only) with the new telemetry fields (GPS, GAlt and GSpd) (<a href=https://github.com/opentx/opentx/issues/2546>#2546</a>)</li>
<li>Fixed unsuccessful writing of setting to the radio for 9XR PRO (<a href=https://github.com/opentx/opentx/issues/2605>#2605</a>)</li>
<li>Fixed missing LUA script outputs in special function "Play Value" (<a href=https://github.com/opentx/opentx/issues/2649>#2649</a>)</li>
<li>Various texts and translations corrections</li>
<li>Various small bug-fixes</li>
</ul>
<h2>Version 2.1.0 / 2015-07-16</h2>
<ul>
<li>SD card synchronizaton tool</li>
<li>Added session duraton information in Log Viewer</li>
<li>Enabled <i>Mixers monitor</i> in Taranis simulator</li>
<li>Better support for multi-axes in Log Viewer (<a href=https://github.com/opentx/opentx/issues/2267>#2267</a>)</li>
<li>File path issue in Taranis simulator function <i>findTrueFileName()</i> on Windows (<a href=https://github.com/opentx/opentx/issues/2301>#2301</a>)</li>
<li>Added simulator volume gain setting (<a href=https://github.com/opentx/opentx/issues/2260>#2260</a>)</li>
<li>Added GPS glitch filtering and Latitude/Longitude position synchronization to Google Earth export (<a href=https://github.com/opentx/opentx/issues/2326>#2326</a>)</li>
<li>Fixed a rare program crash when editing Input for 9X radio (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
<li>Fixed missing RSSI audio warnings if simulator was started multiple times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
</ul>
<h2>Version 2.0.17 / 2015-05-04</h2>
<ul>
<li>Simulator crash (<a href=https://github.com/opentx/opentx/issues/2253>#2253</a>)</li>
@@ -228,13 +122,13 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
<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>
+315 -251
View File
@@ -1,81 +1,113 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(COMPANION_NAME "companion")
set(SIMULATOR_NAME "simulator")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
PROJECT( companion )
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
if(ALLOW_NIGHTLY_BUILDS)
add_definitions(-DALLOW_NIGHTLY_BUILDS)
endif(ALLOW_NIGHTLY_BUILDS)
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "17" )
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
option(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
if(DEBUG_IMPORT)
add_definitions(-DDEBUG_MODEL_IMPORT)
message(STATUS "EEPROM import debugging enabled")
endif(DEBUG_IMPORT)
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
option(TABLE_LAYOUT "Use QTableWidget for grid layouts") # Disabled by default
if(TABLE_LAYOUT)
add_definitions(-DTABLE_LAYOUT)
message(STATUS "Using QTableWidget")
endif(TABLE_LAYOUT)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
add_definitions(-DJOYSTICKS)
add_definitions(-DSIMU_AUDIO)
else()
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif()
MESSAGE( STATUS "Looking for XercesC " )
FIND_PACKAGE(XercesC)
IF ( XERCESC_FOUND )
INCLUDE_DIRECTORIES( ${XERCESC_INCLUDE_DIR} )
SET(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
ELSE()
MESSAGE( FATAL_ERROR "XercesC not found! Please set XercesC path ..." )
ENDIF()
message(STATUS "Looking for QT lupdate ")
find_package(Lupdate)
if(LUPDATE_FOUND)
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
else()
message("QT lupdate not found!")
endif()
MESSAGE( STATUS "Looking for Xsd " )
FIND_PACKAGE(Xsd)
IF ( XSD_FOUND )
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
ELSE()
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
ENDIF()
add_definitions(-DQXT_STATIC)
MESSAGE( STATUS "Looking for SDL " )
FIND_PACKAGE(Sdl)
IF ( SDL_FOUND )
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS( -DJOYSTICKS )
ADD_DEFINITIONS( -DSIMU_AUDIO )
ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
ENDIF()
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /LD")
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
link_directories(C:/Programs/pthreads/Pre-built.2/lib/)
set(PTHREAD_LIBRARY pthreadVC2.lib)
else()
set(PTHREAD_LIBRARY pthread)
add_definitions(-Wall)
link_directories(/usr/local/lib)
endif()
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
MESSAGE( STATUS "Looking for PHONON " )
FIND_PACKAGE(Phonon)
IF ( PHONON_FOUND )
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
ADD_DEFINITIONS( -DPHONON )
ELSE()
MESSAGE( "PHONON not found!" )
ENDIF()
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${COMPANION_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/shared
${SIMU_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
ADD_CUSTOM_COMMAND(
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
)
IF( MSVC )
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
LINK_DIRECTORIES( C:/Programs/pthreads/Pre-built.2/lib/ )
SET( PTHREAD_LIBRARY pthreadVC2.lib )
ELSE( )
SET( PTHREAD_LIBRARY pthread )
ADD_DEFINITIONS( -Wall )
LINK_DIRECTORIES( /usr/local/lib )
ENDIF( )
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
COMMAND make lbm
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/sticks_4x1.xbm
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
COMMAND make tra
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
COMMAND make PCB=TARANIS lua_exports.cpp
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/../..
${SIMU_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}/fonts/std
${RADIO_SRC_DIRECTORY}/lua/src
${XSD_INCLUDE_DIR}
)
add_subdirectory(shared)
add_subdirectory(modeledit)
add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(qcustomplot)
add_subdirectory(qxtcommandoptions)
set(common_SRCS
eeprominterface.cpp
@@ -87,62 +119,59 @@ set(common_SRCS
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
firmwares/opentx/open9xSky9xeeprom.cpp
firmwares/opentx/opentxinterface.cpp
firmwares/opentx/opentxTaranisSimulator.cpp
firmwares/opentx/opentxSky9xsimulator.cpp
firmwares/opentx/opentxGruvin9xsimulator.cpp
firmwares/opentx/opentxM128simulator.cpp
firmwares/opentx/opentxM64simulator.cpp
file.cpp
appdata.cpp
)
)
qt5_wrap_cpp(common_SRCS)
qt4_wrap_cpp(common_SRCS)
add_library(common ${common_SRCS})
qt5_use_modules(common Core Xml Widgets)
set(companion_SRCS
hexinterface.cpp
firmwareinterface.cpp
converteeprom.cpp
flashinterface.cpp
# xmlinterface.cpp
# ${PROJECT_BINARY_DIR}/radio.cxx
helpers.cpp
helpers_html.cpp
mdichild.cpp
generaledit.cpp
modelslist.cpp
mountlist.cpp
avroutputdialog.cpp
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
burnconfigdialog.cpp
multimodelprinter.cpp
comparedialog.cpp
contributorsdialog.cpp
releasenotesdialog.cpp
releasenotesfirmwaredialog.cpp
customizesplashdialog.cpp
radiointerface.cpp
progresswidget.cpp
progressdialog.cpp
process_copy.cpp
process_flash.cpp
process_sync.cpp
flashfirmwaredialog.cpp
flasheepromdialog.cpp
burndialog.cpp
printdialog.cpp
modelprinter.cpp
fusesdialog.cpp
logsdialog.cpp
downloaddialog.cpp
splashlibrarydialog.cpp
splashlibrary.cpp
mainwindow.cpp
companion.cpp
radionotfound.cpp
wizarddata.cpp
wizarddialog.cpp
)
)
set(companion_MOC_HDRS
avroutputdialog.h
apppreferencesdialog.h
fwpreferencesdialog.h
burnconfigdialog.h
@@ -151,31 +180,24 @@ set(companion_MOC_HDRS
fusesdialog.h
logsdialog.h
contributorsdialog.h
releasenotesdialog.h
releasenotesfirmwaredialog.h
customizesplashdialog.h
splashlibrarydialog.h
splashlibrary.h
splashlabel.h
progresswidget.h
progressdialog.h
process_copy.h
process_flash.h
process_sync.h
flashfirmwaredialog.h
flasheepromdialog.h
burndialog.h
downloaddialog.h
generaledit.h
modelslist.h
mdichild.h
mainwindow.h
radionotfound.h
qautocombobox.h
helpers.h
wizarddialog.h
modelprinter.h
multimodelprinter.h
)
)
set(companion_UIS
mdichild.ui
avroutputdialog.ui
comparedialog.ui
fusesdialog.ui
logsdialog.ui
@@ -183,219 +205,261 @@ set(companion_UIS
fwpreferencesdialog.ui
burnconfigdialog.ui
downloaddialog.ui
generaledit.ui
printdialog.ui
htmldialog.ui
contributorsdialog.ui
customizesplashdialog.ui
splashlibrarydialog.ui
progresswidget.ui
progressdialog.ui
flashfirmwaredialog.ui
flasheepromdialog.ui
splashlibrary.ui
burndialog.ui
radionotfound.ui
)
)
set(companion_RESOURCES
set(companion_RCS
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
)
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 00.00.0000)
ENDIF (WIN32)
ENDMACRO (TODAY)
if(WIN32)
set(companion_SRCS ${companion_SRCS} icon.rc)
if(NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif()
endif()
MACRO (NOW RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "time not implemented")
SET(${RESULT} 00:00:00)
ENDIF (WIN32)
ENDMACRO (NOW)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})
TODAY(DATE)
NOW(TIME)
set(LANGUAGES he pl pt ru de fr es it sv cs fi nl)
foreach(language ${LANGUAGES})
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
endforeach(language)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
qt5_wrap_ui(companion_SRCS ${companion_UIS})
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
qt5_add_translation(companion_QM ${companion_TS})
qt5_add_resources(companion_RCC ${companion_RESOURCES})
IF( WIN32 )
SET( companion_SRCS ${companion_SRCS} icon.rc )
IF ( NOT MSVC )
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
ENDIF( )
ENDIF( )
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
if(APPLE)
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
else()
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
endif()
SET( LANGUAGES he pl pt ru de fr it sv cs fi nl)
FOREACH( language ${LANGUAGES} )
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
ENDFOREACH( language )
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
set( companion_SRCS ${companion_SRCS} )
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE(companion MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
ELSE( )
ADD_EXECUTABLE(companion WIN32 ${companion_SRCS} ${companion_QM})
ENDIF( )
target_link_libraries(companion modeledit simulation common qcustomplot ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
############# Standalone simu ###############
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
add_custom_command(
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
)
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
add_custom_command(
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
)
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
add_custom_command(
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
set(simu_SRCS
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
)
)
set(simu_MOC_HDRS
modeledit/node.h
)
)
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
set( simu_SRCS ${simu_SRCS} )
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
if(WIN32)
set(simu_SRCS ${simu_SRCS} icon.rc)
endif()
if(APPLE)
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
else()
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
add_executable(simulator WIN32 ${simu_SRCS})
endif()
# TODO not the same link command than companion?
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
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 ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
install(FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
# Linux specific code
set(OperatingSystem "Linux")
else()
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
endif()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( TARGETS simulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( FILES companion.desktop DESTINATION share/applications )
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps )
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps )
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps )
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps )
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
# Linux specific code
SET(OperatingSystem "Linux")
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${QT_BINARY_DIR} )
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(WIN32)
if(MSVC)
set(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
else()
set(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
endif()
IF( WIN32 )
IF( MSVC )
SET( 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/${COMPANION_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/companion.nsi @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/simulator.nsi @ONLY)
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
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/companion.nsi
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/companion.nsi
COMMENT "Companion Windows NSIS Installer")
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
COMMENT "Windows NSIS Installer")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
COMMENT "Simulator Windows NSIS Installer")
ADD_CUSTOM_TARGET( installer
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
)
ENDIF( )
add_custom_target(installer
DEPENDS ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
DEPENDS ${PROJECT_BINARY_DIR}/companion/simulator-windows.exe
SOURCES ${PROJECT_BINARY_DIR}/companion/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
)
endif()
IF( APPLE )
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
IF( CMAKE_GENERATOR STREQUAL Xcode )
SET( WORK_DIR ${CMAKE_BINARY_DIR}/Debug )
ELSE( )
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
ENDIF()
if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(WORK_DIR ${CMAKE_BINARY_DIR}/Debug)
else()
set(WORK_DIR ${PROJECT_BINARY_DIR})
endif()
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync -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(addframeworks
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${COMPANION_NAME})
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks )
add_custom_target(makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks opentx-simulators-bundle)
endif()
ENDIF( )
if(LUPDATE_FOUND)
add_custom_target(translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
add_custom_target(translations
COMMAND echo "Sorry, QT lupdate was not found."
)
endif()
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
IF(WIN32)
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ELSE( )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ENDIF( )
SET(CPACK_PACKAGE_NAME "COMPANION")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
# The file stripping is deliberately disabled, with the stripped file we get
# very poor trace-backs from the users when they report Companion crash
set(CPACK_STRIP_FILES FALSE)
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
set(CPACK_GENERATOR "DEB")
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
set(CPACK_DEBIAN_PACKAGE_VERSION ${VERSION})
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
SET(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
else(DPKG_PROGRAM)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
endif(DPKG_PROGRAM)
include(CPack)
INCLUDE(CPack)
+29 -90
View File
@@ -295,7 +295,6 @@ 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; }
@@ -312,22 +311,19 @@ QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
QString Profile::controlTypes() const { return _controlTypes; }
QString Profile::controlNames() const { return _controlNames; }
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
int Profile::currentCalib() const { return _currentCalib; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
int Profile::vBatWarn() const { return _vBatWarn; }
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
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
void Profile::volumeGain (const int x) { store(x, _volumeGain, "volumeGain" ,"Profiles", QString("profile%1").arg(index));}
void Profile::pBackupDir (const QString x) { store(x, _pBackupDir, "pBackupDir" ,"Profiles", QString("profile%1").arg(index));}
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
@@ -344,15 +340,13 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
void Profile::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
Profile::Profile()
@@ -367,7 +361,6 @@ Profile& Profile::operator=(const Profile& rhs)
fwName ( rhs.fwName() );
fwType ( rhs.fwType() );
sdPath ( rhs.sdPath() );
volumeGain ( rhs.volumeGain() );
pBackupDir ( rhs.pBackupDir() );
splashFile ( rhs.splashFile() );
burnFirmware ( rhs.burnFirmware() );
@@ -382,15 +375,13 @@ Profile& Profile::operator=(const Profile& rhs)
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
controlTypes ( rhs.controlTypes() );
controlNames ( rhs.controlNames() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
currentCalib ( rhs.currentCalib() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
txVoltageCalibration ( rhs.txVoltageCalibration() );
vBatWarn ( rhs.vBatWarn() );
vBatCalib ( rhs.vBatCalib() );
vBatMin ( rhs.vBatMin() );
vBatMax ( rhs.vBatMax() );
vBatWarn ( rhs.vBatWarn() );
return *this;
}
@@ -429,16 +420,14 @@ void Profile::initFwVariables()
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_controlTypes = "";
_controlNames = "";
_txCurrentCalibration = 0;
_currentCalib = 0;
_gsStickMode = 0;
_ppmMultiplier = 0;
_txVoltageCalibration = 0;
_vBatWarn = 0;
_vBatCalib = 0;
_vBatMin = 0;
_vBatMax = 0;
_vBatWarn = 0;
}
void Profile::init(int newIndex)
@@ -449,7 +438,6 @@ void Profile::init(int newIndex)
_fwType = "";
_name = "";
_sdPath = "";
_volumeGain = 10;
_pBackupDir = "";
_splashFile = "";
_burnFirmware = false;
@@ -474,7 +462,6 @@ 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));
@@ -491,15 +478,13 @@ void Profile::flush()
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _txVoltageCalibration, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatWarn, "vBatWarn" ,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));
}
@@ -522,7 +507,6 @@ QString AppData::mcu() { return _mcu; }
QString AppData::programmer() { return _programmer; }
QString AppData::sambaLocation() { return _sambaLocation; }
QString AppData::sambaPort() { return _sambaPort; }
QString AppData::lastSimulator() { return _lastSimulator; }
QString AppData::backupDir() { return _backupDir; }
QString AppData::gePath() { return _gePath; }
@@ -534,6 +518,9 @@ QString AppData::libDir() { return _libDir; }
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; }
bool AppData::showSplash() { return _showSplash; }
@@ -571,7 +558,6 @@ void AppData::mcu (const QString x) { store(x, _mcu,
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
void AppData::lastSimulator (const QString x) { store(x, _lastSimulator, "last_simulator" );}
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
@@ -583,6 +569,9 @@ void AppData::libDir (const QString x) { store(x, _libDir,
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
void AppData::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" );}
@@ -605,10 +594,6 @@ void AppData::warningId (const int x) { store(x, _warningId,
// Constructor
AppData::AppData()
{
}
void AppData::init()
{
//Initialize the profiles
for (int i=0; i<MAX_PROFILES; i++)
@@ -618,47 +603,8 @@ void AppData::init()
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
// Move existing 2.0 settings if present
QSettings settings(COMPANY, PRODUCT);
// Copy existing 2.1 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings21("OpenTX", "Companion 2.1");
QStringList keys = settings21.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings21.value(*i) != QString("") && settings21.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings21.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Copy existing 2.0 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings20("OpenTX", "Companion 2.0");
QStringList keys = settings20.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings20.value(*i) != QString("") && settings20.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings20.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Else copy existing <2.0.16 settings if present
if (profile[0].name().isEmpty())
{
QSettings pre2016settings("OpenTX", "OpenTX Companion");
@@ -666,15 +612,14 @@ void AppData::init()
QStringList keys = pre2016settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (pre2016settings.value(*i) != QString("") && pre2016settings.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, pre2016settings.value(*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
@@ -739,8 +684,8 @@ void AppData::init()
settings.remove("compilation-server");
// Load and store all variables. Use default values if setting values are missing
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"210" ); // This is a version marker. Will be used to upgrade the settings later on.
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"201" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
@@ -758,7 +703,6 @@ void AppData::init()
getset( _programmer, "programmer" ,"usbasp" );
getset( _sambaLocation, "samba_location" ,"" );
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
getset( _lastSimulator, "last_simulator" ,"" );
getset( _backupDir, "backupPath" ,"" );
getset( _gePath, "gePath" ,"" );
@@ -770,14 +714,9 @@ void AppData::init()
getset( _snapshotDir, "snapshotpath" ,"" );
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
getset( _enableBackup, "enableBackup" ,false );
getset( _enableBackup, "backupEnable" ,false );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility", true );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
getset( _useCompanionNightlyBuilds, "useCompanionNightlyBuilds" ,false );
getset( _useFirmwareNightlyBuilds, "useFirmwareNightlyBuilds" ,false );
getset( _jsSupport, "js_support" ,false );
getset( _maximized, "maximized" ,false );
getset( _showSplash, "show_splash" ,true );
+19 -37
View File
@@ -25,7 +25,7 @@
#include <QSettings>
#define COMPANY "OpenTX"
#define PRODUCT "Companion 2.2"
#define PRODUCT "Companion 2.0"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
@@ -107,7 +107,6 @@ class Profile: protected CompStoreObj
QString _fwType;
QString _name;
QString _sdPath;
int _volumeGain;
QString _pBackupDir;
QString _splashFile;
bool _burnFirmware;
@@ -125,15 +124,13 @@ class Profile: protected CompStoreObj
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
QString _controlTypes;
QString _controlNames;
int _txCurrentCalibration;
int _currentCalib;
int _gsStickMode;
int _ppmMultiplier;
int _txVoltageCalibration;
int _vBatWarn;
int _vBatCalib;
int _vBatMin;
int _vBatMax;
int _vBatWarn;
public:
// All the get definitions
@@ -141,7 +138,6 @@ 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;
@@ -158,21 +154,18 @@ class Profile: protected CompStoreObj
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
QString controlTypes() const;
QString controlNames() const;
int txCurrentCalibration() const;
int currentCalib() const;
int gsStickMode() const;
int ppmMultiplier() const;
int txVoltageCalibration() const;
int vBatWarn() 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);
@@ -190,15 +183,13 @@ class Profile: protected CompStoreObj
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void controlTypes (const QString);
void controlNames (const QString);
void txCurrentCalibration (const int);
void currentCalib (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
void txVoltageCalibration (const int);
void vBatWarn (const int);
void vBatCalib (const int);
void vBatMin (const int);
void vBatMax (const int);
void vBatWarn (const int);
Profile();
Profile& operator=(const Profile&);
@@ -209,22 +200,8 @@ class Profile: protected CompStoreObj
void flush();
};
#define BOOL_PROPERTY(name, dflt) \
public: \
inline bool name() { return _ ## name; } \
void name(const bool val) { store(val, _ ## name, # name); } \
private: \
bool _ ## name;
class AppData: protected CompStoreObj
{
BOOL_PROPERTY(enableBackup, false)
BOOL_PROPERTY(outputDisplayDetails, false)
BOOL_PROPERTY(backupOnFlash, true)
BOOL_PROPERTY(checkHardwareCompatibility, true)
BOOL_PROPERTY(useCompanionNightlyBuilds, false)
BOOL_PROPERTY(useFirmwareNightlyBuilds, false)
// All the global variables
public:
Profile profile[MAX_PROFILES];
@@ -248,7 +225,6 @@ class AppData: protected CompStoreObj
QString _programmer;
QString _sambaLocation;
QString _sambaPort;
QString _lastSimulator;
QString _backupDir;
QString _gePath;
@@ -260,6 +236,9 @@ class AppData: protected CompStoreObj
QString _snapshotDir;
QString _updatesDir;
bool _enableBackup;
bool _backupOnFlash;
bool _checkHardwareCompatibility;
bool _maximized;
bool _jsSupport;
bool _showSplash;
@@ -299,7 +278,6 @@ class AppData: protected CompStoreObj
QString programmer();
QString sambaLocation();
QString sambaPort();
QString lastSimulator();
QString backupDir();
QString gePath();
@@ -311,6 +289,9 @@ class AppData: protected CompStoreObj
QString snapshotDir();
QString updatesDir();
bool enableBackup();
bool backupOnFlash();
bool checkHardwareCompatibility();
bool jsSupport();
bool maximized();
bool showSplash();
@@ -349,7 +330,6 @@ class AppData: protected CompStoreObj
void programmer (const QString);
void sambaLocation (const QString);
void sambaPort (const QString);
void lastSimulator (const QString);
void backupDir (const QString);
void gePath (const QString);
@@ -361,6 +341,9 @@ class AppData: protected CompStoreObj
void snapshotDir (const QString);
void updatesDir (const QString);
void enableBackup (const bool);
void backupOnFlash (const bool);
void checkHardwareCompatibility (const bool);
void maximized (const bool);
void jsSupport (const bool);
void showSplash (const bool);
@@ -384,7 +367,6 @@ class AppData: protected CompStoreObj
// Constructor
AppData();
void init();
};
extern AppData g;
+16 -21
View File
@@ -3,7 +3,7 @@
#include "mainwindow.h"
#include "appdata.h"
#include "helpers.h"
#include "firmwareinterface.h"
#include "flashinterface.h"
#ifdef JOYSTICKS
#include "joystick.h"
#include "joystickdialog.h"
@@ -41,16 +41,13 @@ AppPreferencesDialog::~AppPreferencesDialog()
void AppPreferencesDialog::writeValues()
{
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
g.autoCheckApp(ui->autoCheckCompanion->isChecked());
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked());
g.autoCheckFw(ui->autoCheckFirmware->isChecked());
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
g.autoCheckFw(ui->startupCheck_fw->isChecked());
g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked());
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());
@@ -109,14 +106,11 @@ void AppPreferencesDialog::initSettings()
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
ui->startupCheck_fw->setChecked(g.autoCheckFw());
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);
@@ -202,9 +196,9 @@ void AppPreferencesDialog::initSettings()
}
ui->lblGeneralSettings->setText(hwSettings);
Firmware * current_firmware = GetCurrentFirmware();
FirmwareInterface * current_firmware = GetCurrentFirmware();
foreach(Firmware * firmware, firmwares) {
foreach(FirmwareInterface * firmware, firmwares) {
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
if (current_firmware->getFirmwareBase() == firmware) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
@@ -292,8 +286,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
@@ -376,7 +371,7 @@ void AppPreferencesDialog::baseFirmwareChanged()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(Firmware * firmware, firmwares) {
foreach(FirmwareInterface * firmware, firmwares) {
if (firmware->getId() == selected_firmware) {
populateFirmwareOptions(firmware);
break;
@@ -384,11 +379,11 @@ void AppPreferencesDialog::baseFirmwareChanged()
}
}
Firmware * AppPreferencesDialog::getFirmwareVariant()
FirmwareInterface * AppPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(Firmware * firmware, firmwares) {
foreach(FirmwareInterface * firmware, firmwares) {
QString id = firmware->getId();
if (id == selected_firmware) {
foreach(QCheckBox *cb, optionsCheckBoxes) {
@@ -419,7 +414,7 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
if (cb == voice) {
showVoice(voice->isChecked());
}
Firmware * firmware=NULL;
FirmwareInterface * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
@@ -445,9 +440,9 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
}
}
void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
{
const Firmware * parent = firmware->getFirmwareBase();
const FirmwareInterface * parent = firmware->getFirmwareBase();
updateLock = true;
+2 -2
View File
@@ -27,8 +27,8 @@ class AppPreferencesDialog : public QDialog
void showVoice();
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const Firmware *);
Firmware * getFirmwareVariant();
void populateFirmwareOptions(const FirmwareInterface *);
FirmwareInterface * getFirmwareVariant();
QCheckBox * voice;
Ui::AppPreferencesDialog *ui;
+145 -198
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>686</width>
<height>713</height>
<height>550</height>
</rect>
</property>
<property name="sizePolicy">
@@ -233,7 +233,7 @@ May be different from firmware language</string>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
@@ -290,9 +290,6 @@ May be different from firmware language</string>
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
@@ -627,7 +624,7 @@ Mode 4:
<item row="10" column="2" colspan="2">
<widget class="QPushButton" name="sdPathButton">
<property name="text">
<string>Select Folder</string>
<string>Open Folder</string>
</property>
</widget>
</item>
@@ -637,7 +634,7 @@ Mode 4:
<string>The profile specific folder, if set, will override general Backup folder</string>
</property>
<property name="text">
<string>Select Folder</string>
<string>Open Folder</string>
</property>
</widget>
</item>
@@ -648,8 +645,8 @@ Mode 4:
<string>Application Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="10" column="1" colspan="3">
<widget class="QCheckBox" name="autoCheckCompanion">
<item row="7" column="1" colspan="3">
<widget class="QCheckBox" name="startupCheck_companion9x">
<property name="text">
<string>Automatic check for Companion updates</string>
</property>
@@ -668,7 +665,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="13" column="1" colspan="3">
<item row="10" column="1" colspan="3">
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>Enable automatic backup before writing firmware</string>
@@ -682,7 +679,34 @@ Mode 4:
</property>
</widget>
</item>
<item row="18" column="1">
<item row="8" column="1" colspan="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="1" colspan="3">
<widget class="QCheckBox" name="startupCheck_fw">
<property name="text">
<string>Automatic check for OpenTX firmware updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QLineEdit" name="libraryPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="15" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -695,24 +719,7 @@ Mode 4:
</property>
</spacer>
</item>
<item row="11" column="1" colspan="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="1" colspan="3">
<widget class="QCheckBox" name="autoCheckFirmware">
<property name="text">
<string>Automatic check for OpenTX firmware updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="15" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -745,6 +752,19 @@ Mode 4:
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="backupPath">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ge_label">
<property name="text">
@@ -752,7 +772,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="16" column="0">
<item row="13" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -787,14 +807,14 @@ Mode 4:
</property>
</widget>
</item>
<item row="12" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="14" column="1" colspan="3">
<item row="11" column="1" colspan="3">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -808,17 +828,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QLineEdit" name="libraryPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="12" column="1">
<widget class="QComboBox" name="splashincludeCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -838,26 +848,6 @@ Mode 4:
</item>
</widget>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="backupPath">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="12" column="2" colspan="2">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Select Folder</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="ge_lineedit">
<property name="minimumSize">
@@ -874,34 +864,21 @@ Mode 4:
<item row="0" column="2" colspan="2">
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Select Executable</string>
<string>Find Executable</string>
</property>
</widget>
</item>
<item row="16" column="2" colspan="2">
<item row="9" column="2" colspan="2">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="13" column="2" colspan="2">
<widget class="QPushButton" name="libraryPathButton">
<property name="text">
<string>Select Folder</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="useFirmwareNightlyBuilds">
<property name="text">
<string>Use OpenTX firmware nightly builds</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="useCompanionNightlyBuilds">
<property name="text">
<string>Use Companion nightly builds</string>
</property>
<property name="checked">
<bool>false</bool>
<string>Open Folder</string>
</property>
</widget>
</item>
@@ -912,20 +889,49 @@ Mode 4:
<string>Simulator Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Simulator BackLight</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QPushButton" name="joystickcalButton">
<item row="5" column="2">
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Calibrate</string>
<string>Enable</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="snapshotPathButton">
<property name="text">
<string>Open Folder</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
@@ -964,50 +970,6 @@ Mode 4:
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Simulator capture folder</string>
</property>
</widget>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="snapshotClipboardCKB">
<property name="text">
<string>Only capture to clipboard</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="snapshotPathButton">
<property name="text">
<string>Select Folder</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
@@ -1021,36 +983,51 @@ Mode 4:
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Simulator BackLight</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="snapshotPath">
<property name="enabled">
<bool>true</bool>
</property>
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Simulator capture folder</string>
</property>
</widget>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="snapshotPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>350</width>
<height>0</height>
</size>
</property>
@@ -1059,45 +1036,20 @@ Mode 4:
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<item row="1" column="1" colspan="4">
<widget class="QCheckBox" name="snapshotClipboardCKB">
<property name="text">
<string>Only capture to clipboard</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<widget class="QCheckBox" name="simuSW">
<property name="text">
<string>Remember simulator switch values</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_volumeGain">
<property name="text">
<string>Simulator Volume Gain</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="volumeGain">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>3.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@@ -1106,7 +1058,6 @@ Mode 4:
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>profileNameLE</tabstop>
<tabstop>removeProfileButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>langCombo</tabstop>
@@ -1116,9 +1067,6 @@ Mode 4:
<tabstop>clearImageButton</tabstop>
<tabstop>sdPath</tabstop>
<tabstop>sdPathButton</tabstop>
<tabstop>profilebackupPath</tabstop>
<tabstop>ProfilebackupPathButton</tabstop>
<tabstop>pbackupEnable</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>renameFirmware</tabstop>
@@ -1128,8 +1076,8 @@ Mode 4:
<tabstop>historySize</tabstop>
<tabstop>showSplash</tabstop>
<tabstop>modelWizard_CB</tabstop>
<tabstop>autoCheckFirmware</tabstop>
<tabstop>autoCheckCompanion</tabstop>
<tabstop>startupCheck_fw</tabstop>
<tabstop>startupCheck_companion9x</tabstop>
<tabstop>backupPath</tabstop>
<tabstop>backupPathButton</tabstop>
<tabstop>backupEnable</tabstop>
@@ -1144,7 +1092,6 @@ Mode 4:
<tabstop>joystickCB</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>volumeGain</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+504
View File
@@ -0,0 +1,504 @@
#include "avroutputdialog.h"
#include "ui_avroutputdialog.h"
#include <QtGui>
#include "eeprominterface.h"
#include "flashinterface.h"
#if defined WIN32 || !defined __GNUC__
#include <Windows.h>
#include <WinBase.h>
#include <tlhelp32.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#include "mountlist.h"
#endif
avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour, bool displayDetails) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::avrOutputDialog),
kill_timer(NULL),
hasErrors(false)
{
ui->setupUi(this);
#ifdef __APPLE__
QFont newFont("Courier", 13);
ui->plainTextEdit->setFont(newFont);
ui->plainTextEdit->setAttribute(Qt::WA_MacNormalSize);
#endif
#if defined WIN32 || !defined __GNUC__
QFont newFont("Courier", 9);
ui->plainTextEdit->setFont(newFont);
#endif
cmdLine = prog;
closeOpt = closeBehaviour;
if (cmdLine.isEmpty()) {
if (arg.count()<2) {
closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose()));
}
else {
sourceFile=arg.at(0);
destFile=arg.at(1);
if (!displayDetails) {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
} else {
ui->checkBox->setChecked(true);
}
ui->progressBar->setMaximum(127);
QTimer::singleShot(500, this, SLOT(doCopy()));
}
}
else {
if (wTitle.isEmpty())
setWindowTitle(getProgrammer() + " " + tr("result"));
else
setWindowTitle(getProgrammer() + " - " + wTitle);
QFile exec;
winTitle=wTitle;
if (!(exec.exists(prog))) {
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose()));
}
else {
foreach(QString str, arg) cmdLine.append(" " + str);
lfuse = 0;
hfuse = 0;
efuse = 0;
phase=0;
currLine.clear();
if (!displayDetails) {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
else {
ui->checkBox->setChecked(true);
}
process = new QProcess(this);
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
connect(process,SIGNAL(started()),this,SLOT(doProcessStarted()));
connect(process,SIGNAL(readyReadStandardOutput()),this,SLOT(doAddTextStdOut()));
connect(process,SIGNAL(finished(int)),this,SLOT(doFinished(int)));
#if !__GNUC__
kill_timer = new QTimer(this);
connect(kill_timer, SIGNAL(timeout()), this, SLOT(killTimerElapsed()));
kill_timer->start(2000);
#endif
process->start(prog,arg);
}
}
}
# if !__GNUC__
BOOL KillProcessByName(char *szProcessToKill){
HANDLE hProcessSnap;
HANDLE hProcess;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes
if(hProcessSnap == INVALID_HANDLE_VALUE){
return( FALSE );
}
pe32.dwSize = sizeof(PROCESSENTRY32);
if(!Process32First(hProcessSnap, &pe32)){
CloseHandle(hProcessSnap);
return( FALSE );
}
do{
if(!strcmp(pe32.szExeFile,szProcessToKill)){ // checks if process at current position has the name of to be killed app
hProcess = OpenProcess(PROCESS_TERMINATE,0, pe32.th32ProcessID); // gets handle to process
TerminateProcess(hProcess,0); // Terminate process by handle
CloseHandle(hProcess); // close the handle
}
}while(Process32Next(hProcessSnap,&pe32)); // gets next member of snapshot
CloseHandle(hProcessSnap); // closes the snapshot handle
return( TRUE );
}
#endif
void avrOutputDialog::doCopy()
{
char buf[BLKSIZE];
QFile source(sourceFile);
int blocks = (source.size() + BLKSIZE - 1) / BLKSIZE;
ui->progressBar->setMaximum(blocks-1);
if (source.open(QIODevice::ReadOnly)) {
QFile dest(destFile);
if (dest.open(QIODevice::ReadWrite)) {
addText(tr("Writing file: "));
for (int i=0; i<blocks; i++) {
int read = source.read(buf, BLKSIZE);
if (dest.write(buf, read) == read) {
dest.flush();
ui->progressBar->setValue(i);
if ((i%2) != 0)
addText("#");
}
else {
QMessageBox::warning(this, tr("Error"), tr("Write error"));
break;
}
}
dest.close();
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.fileName() + ", " + tr("reason") + ": " + dest.errorString());
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.fileName() + ", " + tr("reason") + ": " + source.errorString());
}
source.close();
doFinished(0);
}
void avrOutputDialog::killTimerElapsed()
{
delete kill_timer;
kill_timer = NULL;
# if !__GNUC__
KillProcessByName("tasklist.exe");
#endif
}
avrOutputDialog::~avrOutputDialog()
{
delete ui;
delete kill_timer;
}
void avrOutputDialog::runAgain(QString prog, QStringList arg, int closeBehaviour)
{
cmdLine = prog;
foreach(QString str, arg) cmdLine.append(" " + str);
closeOpt = closeBehaviour;
currLine.clear();
process->start(prog,arg);
}
void avrOutputDialog::waitForFinish()
{
process->waitForFinished();
}
void avrOutputDialog::addText(const QString &text)
{
QTextCursor cursor(ui->plainTextEdit->textCursor());
// is the scrollbar at the end?
bool atEnd = (ui->plainTextEdit->verticalScrollBar()->value() == ui->plainTextEdit->verticalScrollBar()->maximum());
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
cursor.insertText(text);
if (atEnd) {
ui->plainTextEdit->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
}
}
void avrOutputDialog::doAddTextStdOut()
{
QByteArray data = process->readAllStandardOutput();
QString text = QString(data);
QString temp;
int nlPos, pos, size;
addText(text);
currStdLine.append(text);
if (currStdLine.contains("size = ")) {
pos = currStdLine.lastIndexOf("size = ");
temp = currStdLine.mid(pos+7);
pos = temp.lastIndexOf("\n");
size = temp.left(pos).toInt();
ui->progressBar->setMaximum(size/2048);
}
if (currStdLine.contains("\n")) {
nlPos = currStdLine.lastIndexOf("\n");
currStdLine = currStdLine.mid(nlPos+1);
}
if (!currStdLine.isEmpty()) {
if (currStdLine.at(0) == QChar('.')) {
pos = currStdLine.lastIndexOf(".");
ui->progressBar->setValue(pos);
}
else if (currStdLine.startsWith("Starting upload: [")) {
pos = (currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
ui->progressBar->setValue(pos);
}
}
if (text.contains("Complete ")) {
#if !__GNUC__
delete kill_timer;
kill_timer = NULL;
#endif
int start = text.indexOf("Complete ");
int end = text.indexOf("%");
if (start > 0) {
start += 9;
int value = text.mid(start, end-start).toInt();
ui->progressBar->setValue(value);
}
}
if (text.contains(":010000")) {
//contains fuse info
QStringList stl = text.split(":01000000");
foreach (QString t, stl) {
bool ok = false;
if (!lfuse) lfuse = t.left(2).toInt(&ok,16);
if (!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
if (!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
}
}
if (text.contains("-E-")) {
hasErrors = true;
}
}
QString avrOutputDialog::getProgrammer()
{
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) {
return "DFU Util";
}
else if IS_SKY9X(eepromInterface->getBoard()) {
return "SAM-BA";
}
else {
return "AVRDUDE";
}
}
void avrOutputDialog::errorWizard()
{
QString output=ui->plainTextEdit->toPlainText();
if (output.contains("avrdude: Expected signature for")) { // wrong signature
int pos=output.indexOf("avrdude: Device signature = ");
bool fwexist=false;
QString DeviceStr="Unknown";
QString FwStr="";
if (pos>0) {
QString DeviceId=output.mid(pos+28,8);
if (DeviceId=="0x1e9602") {
DeviceStr="Atmega 64";
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
fwexist=true;
}
else if (DeviceId=="0x1e9702") {
DeviceStr="Atmega 128";
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
fwexist=true;
}
else if (DeviceId=="0x1e9703") {
DeviceStr="Atmega 1280";
}
else if (DeviceId=="0x1e9704") {
DeviceStr="Atmega 1281";
}
else if (DeviceId=="0x1e9801") {
DeviceStr="Atmega 2560";
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board");
fwexist=true;
}
else if (DeviceId=="0x1e9802") {
DeviceStr="Atmega 2561";
}
}
if (fwexist==false) {
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
}
else {
FirmwareInterface *firmware = GetCurrentFirmware();
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName()));
}
}
}
void avrOutputDialog::doAddTextStdErr()
{
int nlPos;
int pbvalue;
QString avrphase;
QByteArray data = process->readAllStandardError();
QString text = QString(data);
currLine.append(text);
if (currLine.contains("#")) {
avrphase = currLine.left(1).toLower();
if (avrphase=="w") {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #ff0000; text-align:center;}:");
phase=1;
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Writing"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Writing"));
pbvalue=currLine.count("#")*2;
ui->progressBar->setValue(pbvalue);
}
else if (avrphase=="r") {
if (phase==0) {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #00ff00; text-align:center;}:");
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Reading"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Reading"));
}
else {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #0000ff; text-align:center;}:");
phase=2;
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Verifying"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Verifying"));
}
pbvalue=currLine.count("#")*2;
ui->progressBar->setValue(pbvalue);
}
}
if (currLine.contains("\n")) {
nlPos = currLine.lastIndexOf("\n");
currLine = currLine.mid(nlPos+1);
}
if (text.contains("-E-") && !text.contains("-E- No receive file name")) {
hasErrors = true;
}
addText(text);
}
#define HLINE_SEPARATOR "================================================================================="
void avrOutputDialog::doFinished(int code=0)
{
addText("\n" HLINE_SEPARATOR);
if (code==1 && getProgrammer()=="SAM-BA")
code=0;
if (code) {
ui->checkBox->setChecked(true);
addText("\n" + getProgrammer() + " " + tr("done - exit code %1").arg(code));
}
else if (hasErrors) {
ui->checkBox->setChecked(true);
addText("\n" + getProgrammer() + " " + tr("done with errors"));
}
else if (!cmdLine.isEmpty()) {
addText("\n" + getProgrammer() + " " + tr("done - SUCCESSFUL"));
}
else {
addText(tr("done - SUCCESSFUL"));
}
addText("\n" HLINE_SEPARATOR "\n");
if(lfuse || hfuse || efuse) {
addReadFuses();
}
switch(closeOpt)
{
case AVR_DIALOG_CLOSE_IF_SUCCESSFUL:
if (!hasErrors && !code) accept();
if (code) {
errorWizard();
}
break;
case AVR_DIALOG_FORCE_CLOSE:
if (hasErrors || code)
reject();
else
accept();
break;
case AVR_DIALOG_SHOW_DONE:
if (hasErrors || code) {
if (!cmdLine.isEmpty()) {
if (getProgrammer()!="AVRDUDE") {
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
}
else {
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
if (res != QMessageBox::No) {
errorWizard();
}
}
}
else {
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
}
// reject();
}
else {
if (!cmdLine.isEmpty()) {
ui->progressBar->setValue(ui->progressBar->maximum());
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
accept();
}
else {
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
accept();
}
}
break;
default: //AVR_DIALOG_KEEP_OPEN
break;
}
}
void avrOutputDialog::doProcessStarted()
{
addText(HLINE_SEPARATOR "\n");
addText(tr("Started") + " " + getProgrammer() + "\n");
addText(cmdLine);
addText("\n" HLINE_SEPARATOR "\n");
}
void avrOutputDialog::addReadFuses()
{
addText(HLINE_SEPARATOR "\n");
addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse,2,16,QChar('0')).arg(hfuse,2,16,QChar('0')).arg(efuse,2,16,QChar('0')));
addText("\n" HLINE_SEPARATOR "\n");
}
void avrOutputDialog::on_checkBox_toggled(bool checked)
{
if (checked) {
ui->plainTextEdit->show();
}
else {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
}
void avrOutputDialog::shrink()
{
resize(0,0);
}
void avrOutputDialog::forceClose()
{
accept();
}
+65
View File
@@ -0,0 +1,65 @@
#ifndef AVROUTPUTDIALOG_H
#define AVROUTPUTDIALOG_H
#include <QDialog>
#include <QtGui>
#define AVR_DIALOG_CLOSE_IF_SUCCESSFUL 0x00
#define AVR_DIALOG_KEEP_OPEN 0x01
#define AVR_DIALOG_FORCE_CLOSE 0x02
#define AVR_DIALOG_SHOW_DONE 0x04
#define READBUF 65536
#define BLKSIZE 512
namespace Ui {
class avrOutputDialog;
}
class avrOutputDialog : public QDialog
{
Q_OBJECT
public:
explicit avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL, bool displayDetails=false);
~avrOutputDialog();
void addText(const QString &text);
void runAgain(QString prog, QStringList arg, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
void waitForFinish();
void addReadFuses();
protected slots:
void doAddTextStdOut();
void doAddTextStdErr();
void doProcessStarted();
void doCopy();
void doFinished(int code);
void on_checkBox_toggled(bool checked);
void shrink();
void forceClose();
void killTimerElapsed();
void errorWizard();
private:
QString getProgrammer();
Ui::avrOutputDialog *ui;
QProcess *process;
QTimer *kill_timer;
QString cmdLine;
int closeOpt;
quint8 lfuse;
quint8 hfuse;
quint8 efuse;
QString currLine;
QString currStdLine;
int phase;
QString winTitle;
bool hasErrors;
QString sourceFile;
QString destFile;
};
#endif // AVROUTPUTDIALOG_H
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProgressWidget</class>
<widget class="QWidget" name="ProgressWidget">
<property name="enabled">
<bool>true</bool>
</property>
<class>avrOutputDialog</class>
<widget class="QDialog" name="avrOutputDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>244</height>
<height>348</height>
</rect>
</property>
<property name="sizePolicy">
@@ -25,42 +22,33 @@
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="info">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QProgressBar" name="progressBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>480</width>
<height>0</height>
</size>
</property>
@@ -78,21 +66,21 @@
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="textEdit">
<item row="1" column="0">
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>100</height>
<width>0</width>
<height>312</height>
</size>
</property>
<property name="font">
@@ -101,20 +89,11 @@
<pointsize>10</pointsize>
</font>
</property>
<property name="lineWidth">
<number>80</number>
</property>
<property name="midLineWidth">
<number>80</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
<enum>QPlainTextEdit::WidgetWidth</enum>
</property>
<property name="readOnly">
<bool>true</bool>
@@ -129,6 +108,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+106 -13
View File
@@ -1,10 +1,10 @@
#include "burnconfigdialog.h"
#include "ui_burnconfigdialog.h"
#include "avroutputdialog.h"
#include "eeprominterface.h"
#include "helpers.h"
#include "appdata.h"
#include "progressdialog.h"
#include "process_flash.h"
#include <QtGui>
#if !defined WIN32 && defined __GNUC__
#include <unistd.h>
@@ -123,7 +123,7 @@ void burnConfigDialog::getSettings()
sambaPort = g.sambaPort();
ui->avrdude_location->setText(getAVRDUDE());
ui->avrArgs->setText(avrArgs.join(" "));
ui->avrArgs->setText(getAVRArgs().join(" "));
ui->samba_location->setText(getSAMBA());
ui->samba_port->setText(getSambaPort());
@@ -285,25 +285,118 @@ void burnConfigDialog::on_dfuArgs_editingFinished()
dfuArgs = ui->dfuArgs->text().split(" ", QString::SkipEmptyParts);
}
void burnConfigDialog::listAvrdudeProgrammers()
void burnConfigDialog::listProgrammers()
{
ProgressDialog progressDialog(this, tr("List available programmers"), CompanionIcon("list.png"), true);
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-c?", progressDialog.progress());
flashProcess.run();
QStringList arguments;
arguments << "-c?";
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
ad->setWindowIcon(CompanionIcon("list.png"));
ad->show();
delete ad;
}
// TODO choose better name when no merge in progress....
void burnConfigDialog::on_pushButton_3_clicked()
{
listAvrdudeProgrammers();
listProgrammers();
}
// TODO choose better name when no merge in progress....
void burnConfigDialog::on_pushButton_4_clicked()
{
ProgressDialog progressDialog(this, tr("Avrdude help"), CompanionIcon("configure.png"), true);
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-?", progressDialog.progress());
flashProcess.run();
QStringList arguments;
arguments << "-?";
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("configure.png"));
ad->show();
delete ad;
}
void burnConfigDialog::readFuses()
{
QStringList args = avrArgs;
if(!avrPort.isEmpty()) args << "-P" << avrPort;
QStringList str;
str << "-U" << "lfuse:r:-:i" << "-U" << "hfuse:r:-:i" << "-U" << "efuse:r:-:i";
QStringList arguments;
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->show();
delete ad;
}
void burnConfigDialog::restFuses(bool eeProtect)
{
//fuses
//avrdude -c usbasp -p m64 -U lfuse:w:<0x0E>:m
//avrdude -c usbasp -p m64 -U hfuse:w:<0x89>:m 0x81 for eeprom protection
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
QMessageBox::StandardButton ret = QMessageBox::No;
ret = QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes)
{
QStringList args = avrArgs;
if(!avrPort.isEmpty()) args << "-P" << avrPort;
QStringList str;
if (avrMCU=="m2560") {
args << "-B8";
QString erStr = eeProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
else {
QString lfuses;
QString tempFile = generateProcessUniqueTempFileName("ftemp.bin");
QStringList argread;
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->exec();
delete ad;
QFile file(tempFile);
if (file.exists() && file.size()==1) {
file.open(QIODevice::ReadOnly);
char bin_flash[1];
file.read(bin_flash, 1);
if (bin_flash[0]==0x0E) {
lfuses="lfuse:w:0x0E:m";
}
else {
lfuses="lfuse:w:0x3F:m";
}
file.close();
qunlink(tempFile);
}
else {
lfuses="lfuse:w:0x3F:m";
}
QString erStr = eeProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
QStringList arguments;
if (avrMCU=="m2560") {
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-u" << str;
}
else {
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
}
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->show();
delete ad;
}
}
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
+9 -6
View File
@@ -1,7 +1,8 @@
#ifndef BURNCONFIGDIALOG_H_
#define BURNCONFIGDIALOG_H_
#ifndef BURNCONFIGDIALOG_H
#define BURNCONFIGDIALOG_H
#include <QtWidgets>
#include <QDialog>
#include <QtGui>
#define MEM_TYPE_EEPROM 1
#define MEM_TYPE_FLASH 2
@@ -22,7 +23,7 @@ public:
QString getAVRDUDE() {return avrLoc;}
QString getSAMBA() {return sambaLoc;}
QString getDFU() {return dfuLoc;}
QStringList getAvrdudeArgs() { QStringList args = avrArgs; if (!avrPort.isEmpty()) args << "-P" << avrPort; return args; }
QStringList getAVRArgs() {return avrArgs;}
QStringList getDFUArgs() {return dfuArgs;}
QString getProgrammer() {return avrProgrammer;}
QString getMCU() {return avrMCU;}
@@ -30,7 +31,9 @@ public:
QString getPort() {return avrPort;}
QString getSambaPort() {return sambaPort;}
void listAvrdudeProgrammers();
void listProgrammers();
void restFuses(bool eeProtect);
void readFuses();
private:
Ui::burnConfigDialog *ui;
@@ -70,4 +73,4 @@ private slots:
void putSettings();
};
#endif // BURNCONFIGDIALOG_H_
#endif // BURNCONFIGDIALOG_H
+619
View File
@@ -0,0 +1,619 @@
#include "burndialog.h"
#include "ui_burndialog.h"
#include <QtGui>
#include "eeprominterface.h"
#include "helpers.h"
#include "splashlibrary.h"
#include "flashinterface.h"
#include "hexinterface.h"
#include "appdata.h"
// Type 1 = Burn EEPROM, Type 2= Burn Flash
burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName):
QDialog(parent),
ui(new Ui::burnDialog),
hexfileName(fileName),
backup(backupEE),
hexType(Type)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("write_flash.png"));
if (!g.profile[g.id()].splashFile().isEmpty()){
imageSource=PROFILE;
imageFile=g.profile[g.id()].splashFile();
}
else {
ui->useProfileImageCB->setDisabled(true);
imageSource=FIRMWARE;
imageFile="";
}
ui->SplashFrame->hide();
ui->FramFWInfo->hide();
ui->EEbackupCB->hide();
ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked);
if (Type == FLASH_FILE_TYPE ) {
ui->EEpromCB->hide();
ui->profile_label->hide();
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
setWindowTitle(tr("Write firmware to Radio"));
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->hide();
}
ui->checkFirmwareCB->setChecked(g.checkHardwareCompatibility());
}
else {
ui->FlashLoadButton->setText(tr("Browse for file"));
ui->profile_label->hide();
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
ui->EEpromCB->hide();
ui->checkFirmwareCB->hide();
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
ui->versionField->clear();
ui->ModField->clear();
ui->FramFWInfo->hide();
ui->SplashFrame->hide();
ui->BurnFlashButton->setDisabled(true);
ui->EEbackupCB->hide();
if (DocName.isEmpty()) {
setWindowTitle(tr("Write Backup to Radio"));
}
else {
setWindowTitle(tr("Write Backup from %1 to Radio").arg(DocName));
}
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
}
if (!hexfileName->isEmpty()) {
ui->FWFileName->setText(*hexfileName);
if (Type==FLASH_FILE_TYPE) {
checkFw(*hexfileName);
}
else {
burnraw=false;
if (checkeEprom(*hexfileName)) {
QString Name = g.profile[g.id()].name();
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
QString DisplaySet = g.profile[g.id()].display();
QString BeeperSet = g.profile[g.id()].beeper();
QString HapticSet = g.profile[g.id()].haptic();
QString SpeakerSet = g.profile[g.id()].speaker();
if (!Name.isEmpty()) {
ui->profile_label->show();
ui->patchcalib_CB->show();
ui->patchhw_CB->show();
// TODO I hardcode the number of pots here, should be dependant on the board?
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
ui->patchcalib_CB->setDisabled(true);
}
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
ui->patchhw_CB->setDisabled(true);
}
}
else {
ui->profile_label->hide();
}
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEpromCB->show();
}
else {
ui->EEpromCB->setChecked(false);
}
ui->BurnFlashButton->setEnabled(true);
}
}
ui->FWFileName->hide();
ui->FlashLoadButton->hide();
hexfileName->clear();
}
else if (Type==FLASH_FILE_TYPE) {
QString FileName = g.profile[g.id()].fwName();
QFile file(FileName);
if (file.exists()) {
checkFw(FileName);
}
}
updateUI();
resize(0, 0);
}
burnDialog::~burnDialog()
{
delete ui;
}
void burnDialog::on_FlashLoadButton_clicked()
{
QString fileName;
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
ui->versionField->clear();
ui->ModField->clear();
ui->FramFWInfo->hide();
ui->SplashFrame->hide();
ui->BurnFlashButton->setDisabled(true);
ui->EEbackupCB->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
if (hexType==FLASH_FILE_TYPE) {
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if(fileName.isEmpty())
return;
checkFw(fileName);
}
else {
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
if (checkeEprom(fileName)) {
if (burnraw==false) {
ui->BurnFlashButton->setEnabled(true);
ui->profile_label->show();
ui->patchcalib_CB->show();
ui->patchhw_CB->show();
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEpromCB->show();
}
else {
ui->EEpromCB->setChecked(false);
}
}
else {
ui->BurnFlashButton->setEnabled(true);
ui->profile_label->hide();
ui->patchcalib_CB->setChecked(false);
ui->patchhw_CB->setChecked(false);
ui->patchhw_CB->hide();
ui->patchcalib_CB->hide();
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
}
updateUI();
}
void burnDialog::checkFw(QString fileName)
{
if (fileName.isEmpty()) {
return;
}
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->show();
}
else {
ui->EEbackupCB->setChecked(false);
*backup=false;
}
ui->FWFileName->setText(fileName);
FlashInterface flash(fileName);
if (flash.isValid()) {
ui->FramFWInfo->show();
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
ui->versionField->setText(flash.getVersion());
ui->ModField->setText(flash.getEEpromId());
ui->SplashFrame->hide();
if (flash.hasSplash()) {
ui->SplashFrame->show();
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
}
}
else {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
}
ui->BurnFlashButton->setEnabled(true);
QTimer::singleShot(0, this, SLOT(shrink()));
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
bool burnDialog::checkeEprom(QString fileName)
{
if (fileName.isEmpty()) {
return false;
}
QFile file(fileName);
if (!file.exists()) {
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
return false;
}
burnraw=false;
int fileType = getFileType(fileName);
#if 0
if (fileType==FILE_TYPE_XML) {
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
QTextStream inputStream(&file);
XmlInterface(inputStream).load(radioData);
}
else
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (!LoadEepromXml(radioData, doc)){
return false;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
QString hline = inputStream.readLine();
if (hline!=EEPE_EEPROM_FILE_HEADER) {
file.close();
return false;
}
}
uint8_t eeprom[EESIZE_RLC_MAX];
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
if (!eeprom_size) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
ui->FWFileName->setText(fileName);
return true;
}
file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
ui->FWFileName->setText(fileName);
return true;
}
}
else if (fileType==FILE_TYPE_BIN) { //read binary
int eeprom_size = file.size();
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
uint8_t *eeprom = (uint8_t *)malloc(eeprom_size);
memset(eeprom, 0, eeprom_size);
long result = file.read((char*)eeprom, eeprom_size);
file.close();
if (result != eeprom_size) {
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
}
}
ui->FWFileName->setText(fileName);
return true;
}
void burnDialog::displaySplash()
{
QImage image;
if (imageSource == FIRMWARE){
FlashInterface flash(ui->FWFileName->text());
image = flash.getSplash();
}
else {
image.load(imageFile);
}
if (image.isNull()) {
return;
}
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
}
void burnDialog::updateUI()
{
if (hexType==EEPROM_FILE_TYPE)
return;
ui->useProfileImageCB->setChecked( imageSource == PROFILE );
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
displaySplash();
}
void burnDialog::on_useFwImageCB_clicked()
{
QString fileName = ui->FWFileName->text();
FlashInterface flash(fileName);
if (!flash.isValid()) {
QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." ));
}
else {
if (!flash.hasSplash()) {
QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
}
else{
imageSource = FIRMWARE;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useProfileImageCB_clicked()
{
QString fileName = g.profile[g.id()].splashFile();
if (!fileName.isEmpty()){
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
}
else {
imageSource = PROFILE;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useAnotherImageCB_clicked()
{
QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
}
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()){
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
}
else{
imageSource = ANOTHER;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useLibraryImageCB_clicked()
{
QString fileName;
splashLibrary *ld = new splashLibrary(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
}
else{
imageSource = LIBRARY;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_BurnFlashButton_clicked()
{
if (hexType==FLASH_FILE_TYPE) {
g.checkHardwareCompatibility(ui->checkFirmwareCB->isChecked());
QString fileName=ui->FWFileName->text();
if (!fileName.isEmpty()) {
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
if (!ui->useFwImageCB->isChecked()) {
const QPixmap * pixmap = ui->imageLabel->pixmap();
QImage image;
if (pixmap) {
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
}
if (!image.isNull()) {
QString tempFile;
if (getFileType(fileName) == FILE_TYPE_HEX)
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) {
hexfileName->clear();
hexfileName->append(tempFile);
}
else {
hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
}
}
else {
hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
}
}
else {
hexfileName->clear();
hexfileName->append(fileName);
}
}
else {
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
hexfileName->clear();
}
}
if (hexType==EEPROM_FILE_TYPE) {
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
QString DisplaySet= g.profile[g.id()].display();
QString BeeperSet= g.profile[g.id()].beeper();
QString HapticSet= g.profile[g.id()].haptic();
QString SpeakerSet= g.profile[g.id()].speaker();
bool patch=false;
if (ui->patchcalib_CB->isChecked()) {
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
QString Byte;
int16_t byte16;
bool ok;
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
Byte=calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibMid[i]=byte16;
Byte=calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibSpanNeg[i]=byte16;
Byte=calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibSpanPos[i]=byte16;
}
for (int i=0; i<4; i++) {
Byte=trainercalib.mid(i*4,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.trainer.calib[i]=byte16;
}
radioData.generalSettings.currentCalib=currentCalib;
radioData.generalSettings.vBatCalib=vBatCalib;
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
patch=true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
}
}
if (ui->patchhw_CB->isChecked()) {
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
radioData.generalSettings.vBatWarn=vBatWarn;
radioData.generalSettings.stickMode=GSStickMode;
uint8_t byte8u;
int8_t byte8;
bool ok;
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.contrast=byte8u;
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.backlightBright=byte8u;
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.beeperMode=(BeeperMode)byte8u;
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.beeperLength=byte8;
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.hapticMode=(BeeperMode)byte8u;
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.hapticStrength=byte8u;
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.hapticLength=byte8;
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerMode=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerPitch=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerVolume=byte8u;
patch=true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
}
if (patch) {
QString fileName = generateProcessUniqueTempFileName("temp.bin");
QFile file(fileName);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber());
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
hexfileName->clear();
}
if (!file.open(QIODevice::WriteOnly)) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
hexfileName->clear();
}
QTextStream outputStream(&file);
long result = file.write((char*)eeprom, eeprom_size);
if (result != eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(fileName).arg(file.errorString()));
}
hexfileName->clear();
hexfileName->append(fileName);
}
else {
hexfileName->clear();
hexfileName->append(ui->FWFileName->text());
}
}
else {
hexfileName->clear();
hexfileName->append(ui->FWFileName->text());
}
}
this->close();
}
void burnDialog::on_cancelButton_clicked()
{
hexfileName->clear();
this->close();
}
void burnDialog::on_EEpromCB_toggled(bool checked)
{
*backup = ui->EEpromCB->isChecked();
}
void burnDialog::shrink()
{
resize(0,0);
}
void burnDialog::on_EEbackupCB_clicked()
{
*backup = ui->EEbackupCB->isChecked();
}
+66
View File
@@ -0,0 +1,66 @@
#ifndef BURNDIALOG_H
#define BURNDIALOG_H
#include <QtGui>
#include <QDialog>
#include "eeprominterface.h"
#include "flashinterface.h"
#include "xmlinterface.h"
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
#define EEPROM_FILE_TYPE 1
#define FLASH_FILE_TYPE 2
namespace Ui
{
class burnDialog;
}
class burnDialog : public QDialog
{
Q_OBJECT
public:
explicit burnDialog(QWidget *parent = 0, int Type = 2, QString * fileName = NULL, bool * backupEE=NULL, QString docname="");
~burnDialog();
private slots:
void on_FlashLoadButton_clicked();
void on_BurnFlashButton_clicked();
void on_cancelButton_clicked();
void on_EEbackupCB_clicked();
void on_EEpromCB_toggled(bool checked);
bool checkeEprom(QString fileName);
void on_useProfileImageCB_clicked();
void on_useFwImageCB_clicked();
void on_useLibraryImageCB_clicked();
void on_useAnotherImageCB_clicked();
void checkFw(QString fileName);
void displaySplash();
void updateUI();
void shrink();
private:
Ui::burnDialog *ui;
QString * hexfileName;
bool * backup;
int hexType;
RadioData radioData;
bool burnraw;
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, ANOTHER};
ImageSource imageSource;
QString imageFile;
};
#endif // BURNDIALOG_H
+396
View File
@@ -0,0 +1,396 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>burnDialog</class>
<widget class="QDialog" name="burnDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>399</width>
<height>564</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Customize Splash</string>
</property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="hs2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="BurnFlashButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Write to TX</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="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">
<widget class="QCheckBox" name="patchcalib_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Modify calibration parameters using settings from current profile&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Patch calibration setting from profile</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="patchhw_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Modify HW parameters using settings from current profile&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Patch HW setting from profile</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="FramFWInfo">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="3" column="0">
<widget class="QLabel" name="dateLabel">
<property name="text">
<string>Date &amp; Time</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="versionField">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="buildLabel">
<property name="text">
<string>Variant</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="ModField">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="versionLabel">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="DateField">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="FWFileName">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="FlashLoadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse for file</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="EEpromCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
</property>
<property name="text">
<string>Check Firmware compatibility</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="EEbackupCB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Backup and restore Models and Settings</string>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="profile_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Current Profile</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="SplashFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="SplashLayout" rowstretch="0,0,0,0,0,0,0">
<item row="0" column="1" rowspan="7">
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
<item row="0" column="0">
<widget class="QLabel" name="imageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>128</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>214</width>
<height>66</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="useFwImageCB">
<property name="text">
<string>Use firmware start screen</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="useAnotherImageCB">
<property name="text">
<string>Use another start screen</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="useProfileImageCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use profile start screen</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="useLibraryImageCB">
<property name="text">
<string>Use library start screen</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkFirmwareCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
</property>
<property name="text">
<string>Check Firmware compatibility</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>FWFileName</tabstop>
<tabstop>FlashLoadButton</tabstop>
<tabstop>versionField</tabstop>
<tabstop>ModField</tabstop>
<tabstop>DateField</tabstop>
<tabstop>useProfileImageCB</tabstop>
<tabstop>useFwImageCB</tabstop>
<tabstop>useLibraryImageCB</tabstop>
<tabstop>useAnotherImageCB</tabstop>
<tabstop>EEbackupCB</tabstop>
<tabstop>patchcalib_CB</tabstop>
<tabstop>patchhw_CB</tabstop>
<tabstop>EEpromCB</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>BurnFlashButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
@@ -4,25 +4,25 @@
# SDL_FOUND, if false, do not try to link to SDL
# SDL_INCLUDE_DIR, where to find SDL.h
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
@@ -46,14 +46,14 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/opt/csw/include
/opt/csw/include
/opt/include/SDL
/opt/include
C:/Programs/SDL/include
)
# I'm not sure if I should do a special casing for Apple. It is
# I'm not sure if I should do a special casing for Apple. It is
# unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?),
# But if they do ([Next|Open|GNU]Step?),
# do they want the -framework option also?
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
@@ -83,7 +83,7 @@ IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
FIND_LIBRARY(SDL_LIBRARY_TEMP
FIND_LIBRARY(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -93,13 +93,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib/x86
C:/Programs/SDL/lib
)
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -109,12 +109,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib
)
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
@@ -135,14 +136,14 @@ IF(SDL_LIBRARY_TEMP)
ENDIF(SDLMAIN_LIBRARY)
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# with the CACHE STRING. Maybe somebody else knows how to fix this.
# The problem is mainly cosmetic, and not a functional issue.
IF(APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if Find the threads package
# and try using this line, so I'm just skipping it entirely for OS X.
@@ -161,4 +162,4 @@ IF(SDL_LIBRARY_TEMP)
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
@@ -1,54 +1,54 @@
# Locate Xsd from code synthesis include paths and binary
# Xsd can be found at http://codesynthesis.com/products/xsd/
# Written by Frederic Heem, frederic.heem _at_ telsey.it
# This module defines
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
# XSD_EXECUTABLE, where is the xsd compiler
# XSD_FOUND, If false, don't try to use xsd
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
"/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
$ENV{XSDDIR}/libxsd
)
IF( WIN32 )
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
ELSE( )
SET( XSDCXX_FILENAME1 xsdcxx )
SET( XSDCXX_FILENAME2 xsd )
ENDIF( )
FIND_PROGRAM( XSDCXX_EXECUTABLE
NAMES
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
PATHS
"/opt/local/xsd-3.3.0-i686-macosx/bin"
"C:/Programs/xsd-3.3.0/bin"
"C:/mingw/xsd-3.3.0-i686-windows/bin"
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
$ENV{XSDDIR}/xsd
)
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
# if the include and the program are found then we have it
IF( XSD_INCLUDE_DIR )
IF( XSDCXX_EXECUTABLE )
SET( XSD_FOUND "YES" )
ENDIF( XSDCXX_EXECUTABLE )
ENDIF( XSD_INCLUDE_DIR )
MARK_AS_ADVANCED(
XSD_INCLUDE_DIR
XSDCXX_EXECUTABLE
)
# Locate Xsd from code synthesis include paths and binary
# Xsd can be found at http://codesynthesis.com/products/xsd/
# Written by Frederic Heem, frederic.heem _at_ telsey.it
# This module defines
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
# XSD_EXECUTABLE, where is the xsd compiler
# XSD_FOUND, If false, don't try to use xsd
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
"C:/Programs/xsd-3.3.0/libxsd"
"C:/Program Files/CodeSynthesis XSD 3.2/include"
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
$ENV{XSDDIR}/include
$ENV{CODESYNTH}/include
/usr/local/include /usr/include
$ENV{XSDDIR}/libxsd
)
IF( WIN32 )
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
ELSE( )
SET( XSDCXX_FILENAME1 xsdcxx )
SET( XSDCXX_FILENAME2 xsd )
ENDIF( )
FIND_PROGRAM( XSDCXX_EXECUTABLE
NAMES
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
PATHS
"/opt/local/xsd-3.3.0-i686-macosx/bin"
"C:/Programs/xsd-3.3.0/bin"
"C:/mingw/xsd-3.3.0-i686-windows/bin"
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
$ENV{XSDDIR}/xsd
)
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
# if the include and the program are found then we have it
IF( XSD_INCLUDE_DIR )
IF( XSDCXX_EXECUTABLE )
SET( XSD_FOUND "YES" )
ENDIF( XSDCXX_EXECUTABLE )
ENDIF( XSD_INCLUDE_DIR )
MARK_AS_ADVANCED(
XSD_INCLUDE_DIR
XSDCXX_EXECUTABLE
)
+8 -21
View File
@@ -53,7 +53,6 @@
#undef main
#endif
#include "mainwindow.h"
#include "version.h"
#include "eeprominterface.h"
#include "appdata.h"
@@ -82,22 +81,12 @@ class MyProxyStyle : public QProxyStyle
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(companion);
QApplication app(argc, argv);
app.setApplicationName("OpenTX Companion");
app.setOrganizationName("OpenTX");
app.setOrganizationDomain("open-tx.org");
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
g.init();
QStringList strl = QApplication::arguments();
if (strl.contains("--version")) {
printf("%s\n", VERSION);
fflush(stdout);
exit(0);
}
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
@@ -109,7 +98,7 @@ int main(int argc, char *argv[])
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
@@ -124,9 +113,8 @@ int main(int argc, char *argv[])
}
#endif
registerEEpromInterfaces();
RegisterEepromInterfaces();
registerOpenTxFirmwares();
registerSimulators();
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
@@ -134,10 +122,10 @@ int main(int argc, char *argv[])
}
QString splashScreen;
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splash-taranis.png";
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splash-9xrpro.png";
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splash-9xr.png";
else splashScreen = ":/images/splash-9x.png";
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splasht.png";
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splashp.png";
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splashr.png";
else splashScreen = ":/images/splash.png";
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
@@ -159,9 +147,8 @@ int main(int argc, char *argv[])
delete splash;
delete mainWin;
unregisterSimulators();
unregisterOpenTxFirmwares();
unregisterEEpromInterfaces();
UnregisterFirmwares();
UnregisterEepromInterfaces();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
@@ -1,11 +1,11 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Companion @VERSION@
Name=Companion
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=@COMPANION_NAME@
Exec='@COMPANION_NAME@'
Icon=companion
Exec='companion'
Terminal=false
StartupNotify=false
Categories=Application
+50 -79
View File
@@ -1,79 +1,64 @@
<!DOCTYPE RCC><RCC version="1.0">
<RCC>
<qresource prefix="/">
<file>images/customize.png</file>
<file>icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../releasenotes.txt</file>
<file>images/simulator/Horus/middle.png</file>
<file>images/simulator/Horus/left.png</file>
<file>images/simulator/Horus/right.png</file>
<file>images/simulator/Horus/top.png</file>
<file>images/simulator/Horus/bottom.png</file>
<file>images/simulator/Horus/led.png</file>
<file>images/simulator/Horus/border-right.png</file>
<file>images/simulator/Horus/left_btn1.png</file>
<file>images/simulator/Horus/left_btn2.png</file>
<file>images/simulator/Horus/left_scrnsht.png</file>
<file>images/simulator/Horus/right_btnU.png</file>
<file>images/simulator/Horus/right_btnL.png</file>
<file>images/simulator/Horus/right_btnD.png</file>
<file>images/simulator/Horus/right_btnR.png</file>
<file>images/simulator/Horus/right_ent.png</file>
<file>images/simulator/9X/9xdb.png</file>
<file>images/simulator/9X/9xdl.png</file>
<file>images/simulator/9X/9xdr.png</file>
<file>images/simulator/9X/9xdt.png</file>
<file>images/simulator/9X/9xdb-bl.png</file>
<file>images/simulator/9X/9xdl-bl.png</file>
<file>images/simulator/9X/9xdr-bl.png</file>
<file>images/simulator/9X/9xdt-bl.png</file>
<file>images/simulator/9X/9xdb-gr.png</file>
<file>images/simulator/9X/9xdl-gr.png</file>
<file>images/simulator/9X/9xdr-gr.png</file>
<file>images/simulator/9X/9xdt-gr.png</file>
<file>images/simulator/9X/9xdb-or.png</file>
<file>images/simulator/9X/9xdl-or.png</file>
<file>images/simulator/9X/9xdr-or.png</file>
<file>images/simulator/9X/9xdt-or.png</file>
<file>images/simulator/9X/9xdb-yl.png</file>
<file>images/simulator/9X/9xdl-yl.png</file>
<file>images/simulator/9X/9xdr-yl.png</file>
<file>images/simulator/9X/9xdt-yl.png</file>
<file>images/simulator/9X/9xdb-rd.png</file>
<file>images/simulator/9X/9xdl-rd.png</file>
<file>images/simulator/9X/9xdr-rd.png</file>
<file>images/simulator/9X/9xdt-rd.png</file>
<file>images/simulator/9X/9xmenu.png</file>
<file>images/simulator/9X/9xmenumenu.png</file>
<file>images/simulator/9X/9xmenuexit.png</file>
<file>images/simulator/9X/9xcurs.png</file>
<file>images/simulator/9X/9xcursup.png</file>
<file>images/simulator/9X/9xcursplus.png</file>
<file>images/simulator/9X/9xcursmin.png</file>
<file>images/simulator/9X/9xcursdown.png</file>
<file>images/simulator/9X/9xcursphoto.png</file>
<file>images/9xdb.png</file>
<file>images/9xdl.png</file>
<file>images/9xdr.png</file>
<file>images/9xdt.png</file>
<file>images/9xdb-bl.png</file>
<file>images/9xdl-bl.png</file>
<file>images/9xdr-bl.png</file>
<file>images/9xdt-bl.png</file>
<file>images/9xdb-gr.png</file>
<file>images/9xdl-gr.png</file>
<file>images/9xdr-gr.png</file>
<file>images/9xdt-gr.png</file>
<file>images/9xdb-or.png</file>
<file>images/9xdl-or.png</file>
<file>images/9xdr-or.png</file>
<file>images/9xdt-or.png</file>
<file>images/9xdb-yl.png</file>
<file>images/9xdl-yl.png</file>
<file>images/9xdr-yl.png</file>
<file>images/9xdt-yl.png</file>
<file>images/9xdb-rd.png</file>
<file>images/9xdl-rd.png</file>
<file>images/9xdr-rd.png</file>
<file>images/9xdt-rd.png</file>
<file>images/9xmenu.png</file>
<file>images/9xmenumenu.png</file>
<file>images/9xmenuexit.png</file>
<file>images/9xcurs.png</file>
<file>images/9xcursup.png</file>
<file>images/9xcursplus.png</file>
<file>images/9xcursmin.png</file>
<file>images/9xcursdown.png</file>
<file>images/9xcursphoto.png</file>
<file>images/screenshot.png</file>
<file>images/splash-9x.png</file>
<file>images/splash-9xrpro.png</file>
<file>images/splash-9xr.png</file>
<file>images/splash-taranis.png</file>
<file>images/splash.png</file>
<file>images/splashp.png</file>
<file>images/splashr.png</file>
<file>images/splasht.png</file>
<file>images/companion-title.png</file>
<file>images/maps.png</file>
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/simulator/Taranis/x9b0.png</file>
<file>images/simulator/Taranis/x9l0.png</file>
<file>images/simulator/Taranis/x9l1.png</file>
<file>images/simulator/Taranis/x9l2.png</file>
<file>images/simulator/Taranis/x9l3.png</file>
<file>images/simulator/Taranis/x9l4.png</file>
<file>images/simulator/Taranis/x9r0.png</file>
<file>images/simulator/Taranis/x9r1.png</file>
<file>images/simulator/Taranis/x9r2.png</file>
<file>images/simulator/Taranis/x9r3.png</file>
<file>images/simulator/Taranis/x9s0.png</file>
<file>images/simulator/Taranis/x9t0.png</file>
<file>images/x9b0.png</file>
<file>images/x9l0.png</file>
<file>images/x9l1.png</file>
<file>images/x9l2.png</file>
<file>images/x9l3.png</file>
<file>images/x9l4.png</file>
<file>images/x9r0.png</file>
<file>images/x9r1.png</file>
<file>images/x9r2.png</file>
<file>images/x9r3.png</file>
<file>images/x9s0.png</file>
<file>images/x9t0.png</file>
<file>images/taranison.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
@@ -115,8 +100,6 @@
<file>images/library/00018.png</file>
<file>images/library/00019.png</file>
<file>images/library/00020.png</file>
<file>images/library/00021.png</file>
<file>images/library/00022.png</file>
<file>images/library/00050.png</file>
<file>images/library/00051.png</file>
<file>images/library/00052.png</file>
@@ -215,7 +198,6 @@
<file>themes/monochrome/16/contributors.png</file>
<file>themes/monochrome/16/stop.png</file>
<file>themes/monochrome/16/write_eeprom.png</file>
<file>themes/monochrome/16/sdsync.png</file>
<file>themes/monochrome/24/paintbrush.png</file>
<file>themes/monochrome/24/open.png</file>
<file>themes/monochrome/24/edit.png</file>
@@ -259,7 +241,6 @@
<file>themes/monochrome/24/contributors.png</file>
<file>themes/monochrome/24/stop.png</file>
<file>themes/monochrome/24/write_eeprom.png</file>
<file>themes/monochrome/24/sdsync.png</file>
<file>themes/monochrome/32/paintbrush.png</file>
<file>themes/monochrome/32/open.png</file>
<file>themes/monochrome/32/edit.png</file>
@@ -303,7 +284,6 @@
<file>themes/monochrome/32/contributors.png</file>
<file>themes/monochrome/32/stop.png</file>
<file>themes/monochrome/32/write_eeprom.png</file>
<file>themes/monochrome/32/sdsync.png</file>
<file>themes/monochrome/48/paintbrush.png</file>
<file>themes/monochrome/48/open.png</file>
<file>themes/monochrome/48/edit.png</file>
@@ -347,7 +327,6 @@
<file>themes/monochrome/48/contributors.png</file>
<file>themes/monochrome/48/stop.png</file>
<file>themes/monochrome/48/write_eeprom.png</file>
<file>themes/monochrome/48/sdsync.png</file>
<file>themes/classic/16/paintbrush.png</file>
<file>themes/classic/16/open.png</file>
<file>themes/classic/16/edit.png</file>
@@ -391,7 +370,6 @@
<file>themes/classic/16/contributors.png</file>
<file>themes/classic/16/stop.png</file>
<file>themes/classic/16/write_eeprom.png</file>
<file>themes/classic/16/sdsync.png</file>
<file>themes/classic/24/paintbrush.png</file>
<file>themes/classic/24/open.png</file>
<file>themes/classic/24/edit.png</file>
@@ -435,7 +413,6 @@
<file>themes/classic/24/contributors.png</file>
<file>themes/classic/24/stop.png</file>
<file>themes/classic/24/write_eeprom.png</file>
<file>themes/classic/24/sdsync.png</file>
<file>themes/classic/32/paintbrush.png</file>
<file>themes/classic/32/open.png</file>
<file>themes/classic/32/edit.png</file>
@@ -479,7 +456,6 @@
<file>themes/classic/32/contributors.png</file>
<file>themes/classic/32/stop.png</file>
<file>themes/classic/32/write_eeprom.png</file>
<file>themes/classic/32/sdsync.png</file>
<file>themes/classic/48/paintbrush.png</file>
<file>themes/classic/48/open.png</file>
<file>themes/classic/48/edit.png</file>
@@ -523,7 +499,6 @@
<file>themes/classic/48/contributors.png</file>
<file>themes/classic/48/stop.png</file>
<file>themes/classic/48/write_eeprom.png</file>
<file>themes/classic/48/sdsync.png</file>
<file>themes/monoblue/16/paintbrush.png</file>
<file>themes/monoblue/16/open.png</file>
<file>themes/monoblue/16/edit.png</file>
@@ -911,7 +886,6 @@
<file>themes/yerico/16/contributors.png</file>
<file>themes/yerico/16/stop.png</file>
<file>themes/yerico/16/write_eeprom.png</file>
<file>themes/yerico/16/sdsync.png</file>
<file>themes/yerico/24/paintbrush.png</file>
<file>themes/yerico/24/open.png</file>
<file>themes/yerico/24/edit.png</file>
@@ -955,7 +929,6 @@
<file>themes/yerico/24/contributors.png</file>
<file>themes/yerico/24/stop.png</file>
<file>themes/yerico/24/write_eeprom.png</file>
<file>themes/yerico/24/sdsync.png</file>
<file>themes/yerico/32/paintbrush.png</file>
<file>themes/yerico/32/open.png</file>
<file>themes/yerico/32/edit.png</file>
@@ -999,7 +972,6 @@
<file>themes/yerico/32/contributors.png</file>
<file>themes/yerico/32/stop.png</file>
<file>themes/yerico/32/write_eeprom.png</file>
<file>themes/yerico/32/sdsync.png</file>
<file>themes/yerico/48/paintbrush.png</file>
<file>themes/yerico/48/open.png</file>
<file>themes/yerico/48/edit.png</file>
@@ -1043,6 +1015,5 @@
<file>themes/yerico/48/contributors.png</file>
<file>themes/yerico/48/stop.png</file>
<file>themes/yerico/48/write_eeprom.png</file>
<file>themes/yerico/48/sdsync.png</file>
</qresource>
</RCC>
File diff suppressed because it is too large Load Diff
+72 -18
View File
@@ -1,8 +1,10 @@
#ifndef _COMPAREDIALOG_H
#define _COMPAREDIALOG_H
#ifndef COMPAREDIALOG_H
#define COMPAREDIALOG_H
#include <QtWidgets>
#include "multimodelprinter.h"
#include <QDialog>
#include <QtGui>
#include <QDir>
#include "eeprominterface.h"
namespace Ui {
class CompareDialog;
@@ -10,32 +12,84 @@ namespace Ui {
class CompareDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
CompareDialog(QWidget *parent, Firmware * firmware);
CompareDialog(QWidget *parent, FirmwareInterface * firmware);
~CompareDialog();
FirmwareInterface * firmware;
protected:
MultiModelPrinter multimodelprinter;
ModelData model1;
ModelData model2;
bool model1Valid;
bool model2Valid;
Ui::CompareDialog * ui;
GeneralSettings * settings;
ModelData * g_model1;
ModelData * g_model2;
ModelData * modeltemp;
int model1;
int model2;
private:
void closeEvent(QCloseEvent *event);
Ui::CompareDialog *ui;
QString doTC(const QString s, const QString color, bool bold);
QString doTR(const QString s, const QString color, bool bold);
QString doTL(const QString s, const QString color, bool bold);
QString fv(const QString name, const QString value,const QString color);
template<class T> QString getColor1(T val1, T val2) {
if (val1!=val2)
return "green";
else
return "grey";
}
template<class T> QString getColor2(T val1, T val2) {
if (val1!=val2)
return "red";
else
return "grey";
}
QString getColor1(char * val1, char * val2) {
if (strcmp(val1,val2)!=0)
return "green";
else
return "grey";
}
QString getColor2(char * val1, char * val2) {
if (strcmp(val1,val2)!=0)
return "red";
else
return "grey";
}
int ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused);
bool ChannelHasExpo(ExpoData * expoArray, uint8_t destCh);
int ModelHasMix(MixData * mixArray, MixData mix, bool * mixused);
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
protected slots:
QTextEdit * te;
QString curvefile1;
QString curvefile2;
QDir *qd;
private slots:
void on_printButton_clicked();
void on_printFileButton_clicked();
protected:
void closeEvent(QCloseEvent * event);
bool handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label);
protected:
void dropEvent(QDropEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void printDiff();
void printSetup();
void printPhases();
void printLimits();
void printExpos();
void printMixers();
void printCurves();
void printGvars();
void printSwitches();
void printSafetySwitches();
void printFSwitches();
void printFrSky();
};
#endif // _COMPAREDIALOG_H
#endif // COMPAREDIALOG_H
-41
View File
@@ -1,41 +0,0 @@
#ifndef _constants_h_
#define _constants_h_
enum BoardEnum {
BOARD_STOCK,
BOARD_M128,
BOARD_MEGA2560,
BOARD_GRUVIN9X,
BOARD_SKY9X,
BOARD_9XRPRO,
BOARD_AR9X,
BOARD_TARANIS,
BOARD_TARANIS_PLUS,
BOARD_TARANIS_X9E,
BOARD_FLAMENCO,
BOARD_HORUS
};
#define C9X_MAX_MODELS 60
#define C9X_MAX_TIMERS 3
#define C9X_MAX_FLIGHT_MODES 9
#define C9X_MAX_MIXERS 64
#define C9X_MAX_INPUTS 32
#define C9X_MAX_EXPOS 64
#define C9X_MAX_CURVES 32
#define C9X_MAX_POINTS 17
#define C9X_MAX_GVARS 9
#define C9X_MAX_ENCODERS 2
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 64 // number of custom switches
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
#define C9X_NUM_MODULES 2
#define NUM_STICKS 4
#define BOARD_9X_NUM_POTS 3
#define C9X_NUM_POTS 8
#define NUM_CAL_PPM 4
#define NUM_CYC 3
#define C9X_NUM_SWITCHES 32
#define C9X_NUM_KEYS 32
#endif
+120 -101
View File
@@ -1,115 +1,134 @@
#include "contributorsdialog.h"
#include "ui_htmldialog.h"
#include "ui_contributorsdialog.h"
#include <QtGui>
#include "helpers.h"
ContributorsDialog::ContributorsDialog(QWidget * parent):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::HtmlDialog)
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::contributorsDialog)
{
ui->setupUi(this);
setWindowTitle(tr("OpenTX Contributors"));
setWindowIcon(CompanionIcon("contributors.png"));
QString str = "<html>" \
"<head>" \
" <style type=\"text/css\">" \
" .normal { font-weight:normal;color:#000000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
" .bold { font-weight:bold;color:#C00000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
" .title { font-weight:bold;color:#000000;font-size:14px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
" </style>" \
"</head>"
"<body class=\"normal\">";
QFile credits(":/CREDITS.txt");
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
if (line.trimmed() == "")
ui->setupUi(this);
switch (contest) {
case 0:
{
this->setWindowIcon(CompanionIcon("contributors.png"));
QFile file(":/DONATIONS.txt");
QString str;
str.append("<html><head>");
str.append("<style type=\"text/css\">\n");
str.append(".mycss\n{\nfont-weight:normal;\ncolor:#000000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append(".mycssb\n{\nfont-weight:bold;\ncolor:#C00000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append(".myhead\n{\nfont-weight:bold;\ncolor:#000000;font-size:14px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append("</style>\n</head><body class=\"mycss\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
str.append("<tr><td class=\"myhead\">"+tr("People who have contributed to this project")+"</td></tr>");
str.append("</table>");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
int columns=6;
float cwidth=100.0/columns;
while (!file.atEnd()) {
str.append("<tr>");
for (int i=0; i<columns; i++) {
str.append(QString("<td width=\"%1%\" ").arg(cwidth));
if (!file.atEnd()) {
QByteArray line = file.readLine();
if (line.contains("monthly") || line.contains("mensual")) {
str.append("class=\"mycssb\">");
} else {
str.append("class=\"mycss\">");
}
str.append(line.trimmed()+"</td>");
} else {
str.append("class=\"mycss\">&nbsp;</td>");
}
}
str.append("</tr>");
}
}
str.append("</table>");
QFile file2(":/CREDITS.txt");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
str.append("<tr><td class=\"mycss\">&nbsp;</td></tr>");
str.append("<tr><td class=\"myhead\">"+tr("Coders")+"</td></tr>");
str.append("</table>");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
while (!file2.atEnd()) {
str.append("<tr>");
for (int i=0; i<3; i++) {
str.append("<td width=\"33.33%\" class=\"mycss\">");
if (!file2.atEnd()) {
QByteArray line = file2.readLine();
str.append(line.trimmed());
} else {
str.append("&nbsp;");
}
str.append("</td>");
}
str.append("</tr>");
}
}
str.append("<tr><td class=\"mycss\">&nbsp;</td></tr>");
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>");
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Thank you all !!!") + "</td></tr>");
str.append("</table>");
str.append("</body></html>");
ui->textEditor->setHtml(str);
ui->textEditor->scroll(0, 0);
setWindowTitle(tr("Contributors"));
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Main Developers"), names, 3));
names.clear();
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
names.append(line.trimmed());
}
str.append(formatTable(tr("Other contributors"), names, 3));
}
QFile donations(":/DONATIONS.txt");
if (donations.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
if (line.trimmed() == "")
}
case 1:
{
this->setWindowIcon(CompanionIcon("changelog.png"));
QFile file(":/releasenotes.txt");
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
ui->textEditor->setHtml(file.readAll());
ui->textEditor->setOpenExternalLinks(true);
}
ui->textEditor->scroll(0,0);
setWindowTitle(tr("Companion Release Notes"));
break;
names.append(line.trimmed());
}
case 2:
{
if (!rnurl.isEmpty()) {
this->setWindowIcon(CompanionIcon("changelog.png"));
this->setWindowTitle(tr("OpenTX Release Notes"));
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
QUrl url(rnurl);
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
manager->get(request);
}
else {
QTimer::singleShot(0, this, SLOT(forceClose()));
}
break;
}
}
str.append(formatTable(tr("Companies and projects who have donated to OpenTX"), names, 3));
names.clear();
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
names.append(line);
}
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
}
str.append("<table><tr><td class=\"normal\">&nbsp;</td></tr>" \
" <tr><td class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
"</table>");
#if 0
QFile blacklist(":/BLACKLIST.txt");
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
}
#endif
str.append("</body></html>");
ui->textEditor->setHtml(str);
ui->textEditor->scroll(0, 0);
ui->textEditor->setOpenExternalLinks(true);
}
ContributorsDialog::~ContributorsDialog()
void contributorsDialog::showEvent ( QShowEvent * )
{
delete ui;
ui->textEditor->scroll(0, 0);
}
QString ContributorsDialog::formatTable(const QString & title, const QStringList & names, int columns)
contributorsDialog::~contributorsDialog()
{
const float cwidth = 100.0 / columns;
QString str = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>" \
" <tr><td class=\"normal\">&nbsp;</td></tr>" \
" <tr><td class=\"title\">" + title + "</td></tr>" \
"</table>";
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
int column = 0;
foreach(QString name, names) {
if (column == 0) {
str.append("<tr>");
}
QString trclass = name.contains("monthly") ? "bold" : "normal";
str.append(QString("<td width=\"%1%\" class=\"%2\">%3</td>").arg(cwidth).arg(trclass).arg(name.trimmed().replace("monthly", tr("monthly"))));
if (++column == columns) {
str.append("</tr>");
column = 0;
}
}
if (column != 0) {
str.append("</tr>");
}
str.append("</table>");
return str;
delete ui;
}
void contributorsDialog::replyFinished(QNetworkReply * reply)
{
ui->textEditor->setHtml(reply->readAll());
ui->textEditor->setOpenExternalLinks(true);
}
void contributorsDialog::forceClose()
{
accept();;
}
+17 -9
View File
@@ -2,22 +2,30 @@
#define CONTRIBUTORSDIALOG_H
#include <QDialog>
#include "eeprominterface.h"
#include "downloaddialog.h"
namespace Ui {
class HtmlDialog;
class contributorsDialog;
}
class ContributorsDialog : public QDialog
class contributorsDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit contributorsDialog(QWidget *parent = 0, int contest = 0, QString rnurl = QString() );
~contributorsDialog();
public:
explicit ContributorsDialog(QWidget * parent = 0);
~ContributorsDialog();
private:
Ui::contributorsDialog *ui;
QNetworkAccessManager *manager;
private:
Ui::HtmlDialog * ui;
QString formatTable(const QString & title, const QStringList & names, int colums);
void showEvent ( QShowEvent * );
private slots:
void forceClose();
void replyFinished(QNetworkReply * reply);
};
#endif // CONTRIBUTORSDIALOG_H
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>HtmlDialog</class>
<widget class="QDialog" name="HtmlDialog">
<class>contributorsDialog</class>
<widget class="QDialog" name="contributorsDialog">
<property name="geometry">
<rect>
<x>0</x>
-45
View File
@@ -1,45 +0,0 @@
#include "converteeprom.h"
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include <QFile>
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmwareFilename)
{
Firmware *currentFirmware = GetCurrentFirmware();
FirmwareInterface firmware(firmwareFilename);
if (!firmware.isValid())
return false;
unsigned int version = firmware.getEEpromVersion();
unsigned int variant = firmware.getEEpromVariant();
QFile sourceFile(sourceEEprom);
int eeprom_size = sourceFile.size();
if (!eeprom_size)
return false;
if (!sourceFile.open(QIODevice::ReadOnly))
return false;
QByteArray eeprom(eeprom_size, 0);
long result = sourceFile.read(eeprom.data(), eeprom_size);
sourceFile.close();
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(ALL_OK)
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
return false;
}
QFile destinationFile(destinationEEprom);
if (!destinationFile.open(QIODevice::WriteOnly))
return false;
result = destinationFile.write(eeprom.constData(), eeprom_size);
destinationFile.close();
if (result != eeprom_size)
return false;
return true;
}
-8
View File
@@ -1,8 +0,0 @@
#ifndef CONVERTHEADER_H_
#define CONVERTHEADER_H_
#include <QString>
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmware);
#endif /* CONVERTHEADER_H_ */
-16
View File
@@ -1,16 +0,0 @@
#ifndef customdebug_h
#define customdebug_h
#include <QDebug>
// Controls the generation of debug output for EEPROM import
#if defined(DEBUG_MODEL_IMPORT)
inline QDebug eepromImportDebug() { return QDebug(QtDebugMsg); }
#else
#undef eepromImportDebug
inline QNoDebug eepromImportDebug() { return QNoDebug(); }
#endif
#endif
+14 -12
View File
@@ -1,10 +1,12 @@
#include "customizesplashdialog.h"
#include "ui_customizesplashdialog.h"
#include "flashfirmwaredialog.h"
#include <QtGui>
#include "appdata.h"
#include "helpers.h"
#include "firmwareinterface.h"
#include "splashlibrarydialog.h"
#include "burndialog.h"
#include "splashlibrary.h"
#include "flashinterface.h"
//*** Side Class ***
@@ -42,12 +44,12 @@ bool Side::displayImage( QString fileName, Source pictSource )
// Determine which picture format to use
if (pictSource == FW ){
FirmwareInterface firmware(fileName);
if (!firmware.hasSplash())
FlashInterface flash(fileName);
if (!flash.hasSplash())
return false;
else
image = firmware.getSplash();
*format = (firmware.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
image = flash.getSplash();
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
}
else {
image.load(fileName);
@@ -103,12 +105,12 @@ bool Side::saveImage()
{
if (*source == FW )
{
FirmwareInterface firmware(*saveToFileName);
if (!firmware.hasSplash()) {
FlashInterface flash(*saveToFileName);
if (!flash.hasSplash()) {
return false;
}
QImage image = imageLabel->pixmap()->toImage().scaled(firmware.getSplashWidth(), firmware.getSplashHeight());
if (firmware.setSplash(image) && (firmware.save(*saveToFileName) > 0)) {
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
}
else {
@@ -233,7 +235,7 @@ void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicke
void customizeSplashDialog::libraryButton_clicked( Side side )
{
QString fileName;
SplashLibraryDialog *ld = new SplashLibraryDialog(this,&fileName);
splashLibrary *ld = new splashLibrary(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, UNDEFINED ))
+3 -2
View File
@@ -1,8 +1,9 @@
#ifndef CUSTOMIZESPLASHDIALOG_H
#define CUSTOMIZESPLASHDIALOG_H
#include <QtWidgets>
#include "firmwareinterface.h"
#include <QtGui>
#include <QDialog>
#include "flashinterface.h"
namespace Ui
{
+2
View File
@@ -1,5 +1,7 @@
#include "downloaddialog.h"
#include "ui_downloaddialog.h"
#include <QMessageBox>
#include <QtGui>
#include <QTime>
#include "helpers.h"
+2 -1
View File
@@ -1,12 +1,13 @@
#ifndef DOWNLOADDIALOG_H
#define DOWNLOADDIALOG_H
#include <QtWidgets>
#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QFile>
namespace Ui {
class downloadDialog;
}
+10 -41
View File
@@ -17,8 +17,6 @@
#ifndef eeprom_importexport_h
#define eeprom_importexport_h
#include "customdebug.h"
#define DIM(arr) (sizeof((arr))/sizeof((arr)[0]))
class DataField {
@@ -106,10 +104,10 @@ class ProxyField: public DataField {
};
template<class container, int N>
class BaseUnsignedField: public DataField {
template<int N>
class UnsignedField: public DataField {
public:
explicit BaseUnsignedField(container & field):
explicit UnsignedField(unsigned int & field):
DataField("Unsigned"),
field(field),
min(0),
@@ -117,7 +115,7 @@ class BaseUnsignedField: public DataField {
{
}
BaseUnsignedField(container & field, const char *name):
UnsignedField(unsigned int & field, const char *name):
DataField(name),
field(field),
min(0),
@@ -125,7 +123,7 @@ class BaseUnsignedField: public DataField {
{
}
BaseUnsignedField(container & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
DataField(name),
field(field),
min(min),
@@ -135,7 +133,7 @@ class BaseUnsignedField: public DataField {
virtual void ExportBits(QBitArray & output)
{
container value = field;
unsigned int value = field;
if (value > max) value = max;
if (value < min) value = min;
@@ -153,7 +151,6 @@ class BaseUnsignedField: public DataField {
if (input[i])
field |= (1<<i);
}
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -162,32 +159,12 @@ class BaseUnsignedField: public DataField {
}
protected:
container & field;
container min;
container max;
unsigned int & field;
unsigned int min;
unsigned int max;
private:
BaseUnsignedField();
};
template <int N>
class UnsignedField : public BaseUnsignedField<unsigned int, N>
{
public:
explicit UnsignedField(unsigned int & field):
BaseUnsignedField<unsigned int, N>(field)
{
}
UnsignedField(unsigned int & field, const char *name):
BaseUnsignedField<unsigned int, N>(field, name)
{
}
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
BaseUnsignedField<unsigned int, N>(field, min, max, name)
{
}
UnsignedField();
};
template<int N>
@@ -210,7 +187,6 @@ class BoolField: public DataField {
virtual void ImportBits(QBitArray & input)
{
field = input[0] ? true : false;
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -280,7 +256,6 @@ class SignedField: public DataField {
}
field = (int)value;
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -341,7 +316,6 @@ class CharField: public DataField {
}
field[i] = idx;
}
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
}
virtual unsigned int size()
@@ -399,7 +373,6 @@ class ZCharField: public DataField {
else
break;
}
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
}
virtual unsigned int size()
@@ -425,7 +398,6 @@ class StructField: public DataField {
}
inline void Append(DataField *field) {
//eepromImportDebug() << QString("StructField(%1) appending field: %2").arg(name).arg(field->getName());
fields.append(field);
}
@@ -443,7 +415,6 @@ class StructField: public DataField {
virtual void ImportBits(QBitArray & input)
{
eepromImportDebug() << QString("\timporting %1[%2]:").arg(name).arg(fields.size());
int offset = 0;
foreach(DataField *field, fields) {
unsigned int size = field->size();
@@ -498,7 +469,6 @@ class TransformedField: public DataField {
virtual void ImportBits(QBitArray & input)
{
eepromImportDebug() << QString("\timporting TransformedField %1:").arg(field.getName());
field.ImportBits(input);
afterImport();
}
@@ -725,7 +695,6 @@ class ConversionField: public TransformedField {
if (scale) {
field *= scale;
}
eepromImportDebug() << QString("\timported ConversionField<%1>:").arg(internalField.getName()) << QString(" before: %1, after: %2").arg(_field).arg(field);
}
protected:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+24 -126
View File
@@ -15,51 +15,30 @@
*/
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include "stdio.h"
#include "inttypes.h"
#include "string.h"
#include "file.h"
#include <assert.h>
#include <algorithm>
#include "eeprominterface.h"
#include "file.h"
RleFile::RleFile():
eeprom(NULL),
eeprom_size(0),
eeFs(NULL),
eeFsArm(NULL),
eepromFatHeader(NULL)
eeFsArm(NULL)
{
}
#define EEPROM_SIZE (4*1024*1024/8)
#define EEPROM_BLOCK_SIZE (4*1024)
#define EEPROM_MARK 0x84697771 /* thanks ;) */
#define EEPROM_ZONE_SIZE (8*1024)
#define EEPROM_FAT_SIZE 128
#define EEPROM_MAX_ZONES (EEPROM_SIZE / EEPROM_ZONE_SIZE)
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
#define FIRST_FILE_AVAILABLE (1+MAX_MODELS)
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version)
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
this->eeprom_size = size;
this->board = board;
this->version = version;
if (IS_SKY9X(board)) {
memset(eeprom, 0xFF, size);
if (version >= 217) {
memset(eeprom, 0, EEPROM_FAT_SIZE);
eepromFatHeader = (EepromHeader *)(eeprom + EEPROM_FAT_SIZE);
eepromFatHeader->mark = EEPROM_MARK;
eepromFatHeader->index = 1;
for (int i=0; i<EEPROM_MAX_FILES; i++) {
eepromFatHeader->files[i].exists = 0;
eepromFatHeader->files[i].zoneIndex = i+1;
}
}
}
else if (IS_TARANIS(board)) {
eeFsArm = (EeFsArm *)eeprom;
@@ -83,7 +62,7 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned in
}
else {
eeFs = (EeFs *)eeprom;
eeFsVersion = (IS_2560(board) || board==BOARD_M128) ? 5 : 4;
eeFsVersion = (board==BOARD_GRUVIN9X || board==BOARD_M128) ? 5 : 4;
eeFsBlockSize = 16;
eeFsLinkSize = 1;
@@ -113,26 +92,6 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned in
}
}
PACK(struct EepromFileHeader
{
uint16_t fileIndex;
uint16_t size;
});
bool RleFile::searchFat()
{
eepromFatHeader = NULL;
uint32_t bestFatIndex = 0;
for (int i=0; i<EEPROM_ZONE_SIZE/EEPROM_FAT_SIZE; i++) {
EepromHeader * header = (EepromHeader *)(eeprom+i*EEPROM_FAT_SIZE);
if (header->mark == EEPROM_MARK && (int)header->index >= bestFatIndex) {
eepromFatHeader = header;
bestFatIndex = header->index;
}
}
return (eepromFatHeader != NULL);
}
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
@@ -140,7 +99,6 @@ bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
this->board = board;
if (IS_SKY9X(board)) {
searchFat();
return 1;
}
else if (IS_TARANIS(board)) {
@@ -236,9 +194,6 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
unsigned int RleFile::EeFsGetFree()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = 0;
unsigned int i;
if (IS_ARM(board))
@@ -258,9 +213,6 @@ unsigned int RleFile::EeFsGetFree()
*/
void RleFile::EeFsFree(unsigned int blk)
{
if (IS_HORUS(board))
return;
unsigned int i = blk;
while (EeFsGetLink(i)) i = EeFsGetLink(i);
if (IS_ARM(board)) {
@@ -278,8 +230,6 @@ void RleFile::EeFsFree(unsigned int blk)
*/
unsigned int RleFile::EeFsAlloc()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
if (IS_ARM(board))
@@ -293,32 +243,14 @@ unsigned int RleFile::EeFsAlloc()
unsigned int RleFile::size(unsigned int id)
{
if (IS_HORUS(board))
return 0;
else
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
}
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_HORUS(board)) {
return 1;
}
else if (IS_SKY9X(board)) {
if (eepromFatHeader) {
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
if (eepromFatHeader->files[i_fileId].exists) {
eeprom_read_block(&m_size, m_fileId*(1<<13)+sizeof(uint16_t), sizeof(uint16_t));
}
else {
m_size = 0;
}
m_pos = sizeof(EepromFileHeader);
}
else {
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
m_pos = sizeof(t_eeprom_header);
}
if (IS_SKY9X(board)) {
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
m_pos = sizeof(t_eeprom_header);
return 1;
}
else {
@@ -338,9 +270,6 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
len -= m_pos;
if (i_len > len) i_len = len;
@@ -361,25 +290,14 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
if (IS_HORUS(board))
return 0;
memset(buf, 0, i_len);
if (IS_SKY9X(board)) {
int len;
if (eepromFatHeader) {
len = std::min((int)i_len, (int)m_size + (int)sizeof(EepromFileHeader) - (int)m_pos);
eeprom_read_block(buf, (m_fileId << 13) + m_pos, len);
int len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
if (len > 0) {
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
m_pos += len;
}
else {
len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
if (len > 0) {
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
m_pos += len;
}
}
return len;
}
else {
@@ -436,11 +354,9 @@ unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersi
dst.resize(0);
for( ; 1; ) {
if (zeroes > 0) {
for (int i = 0; i < zeroes; i++)
dst.append((char) 0);
zeroes = 0;
}
for (int i=0; i<zeroes; i++)
dst.append((char)0);
zeroes = 0;
if (len == 0)
return dst.size();
@@ -547,9 +463,6 @@ void RleFile::closeTrunc()
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
create(i_fileId, typ);
bool state0 = true;
uint8_t cnt = 0;
@@ -596,30 +509,15 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
*/
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
if (IS_SKY9X(board)) {
openRd(i_fileId);
if (eepromFatHeader) {
eepromFatHeader->files[i_fileId].exists = 1;
eeprom_write_block(buf, (m_fileId << 13) + m_pos, i_len);
{
EepromFileHeader header;
header.fileIndex = i_fileId;
header.size = i_len;
eeprom_write_block(&header, (m_fileId << 13), sizeof(header));
}
}
else {
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
t_eeprom_header header;
header.sequence_no = 1;
header.data_size = i_len;
header.flags = 0;
header.hcsum = byte_checksum((uint8_t *) &header, 7);
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
}
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
t_eeprom_header header;
header.sequence_no = 1;
header.data_size = i_len;
header.flags = 0;
header.hcsum = byte_checksum((uint8_t *) &header, 7);
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
return i_len;
}
else {
+1 -18
View File
@@ -61,19 +61,6 @@ struct t_eeprom_header
uint8_t hcsum ;
};
PACK(struct EepromHeaderFile
{
uint8_t zoneIndex:7;
uint8_t exists:1;
});
PACK(struct EepromHeader
{
uint32_t mark;
uint32_t index;
EepromHeaderFile files[63];
});
class RleFile
{
uint8_t m_fileId; //index of file in directory = filename
@@ -86,7 +73,6 @@ class RleFile
uint16_t m_size;
BoardEnum board;
unsigned int version;
uint8_t *eeprom;
unsigned int eeprom_size;
EeFs *eeFs;
@@ -99,8 +85,6 @@ class RleFile
unsigned int eeFsBlocksMax;
unsigned int eeFsLinkSize;
EepromHeader * eepromFatHeader;
void eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size);
void eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size);
@@ -114,13 +98,12 @@ class RleFile
unsigned int EeFsGetFree();
void EeFsFree(unsigned int blk); // free one or more blocks
unsigned int EeFsAlloc(); // alloc one block from freelist
bool searchFat();
public:
RleFile();
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version);
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
bool EeFsOpen(uint8_t *eeprom, int size, BoardEnum board);
+15 -14
View File
@@ -70,7 +70,7 @@ Er9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.vBatCalib = vBatCalib;
result.trainer = trainer;
result.blightinv=blightinv;
result.stickScroll=stickScroll;
@@ -85,13 +85,13 @@ Er9xGeneral::operator GeneralSettings ()
switch (beeperVal) {
case 0:
result.beeperMode = GeneralSettings::BEEPER_QUIET;
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
@@ -361,16 +361,16 @@ t_Er9xModelData::operator ModelData ()
c9x.timers[0].val = tmrVal;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
@@ -378,16 +378,16 @@ t_Er9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = er9xToSource(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
@@ -459,13 +459,14 @@ t_Er9xModelData::operator ModelData ()
}
for (int i=0; i<ER9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
+2 -2
View File
@@ -61,7 +61,7 @@ PACK(typedef struct t_Er9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t vBatCalib;
int8_t lightSw;
Er9xTrainerData trainer;
uint8_t view;
@@ -241,7 +241,7 @@ PACK(typedef struct t_Er9xModelData {
int8_t trim[4];
int8_t curves5[ER9X_MAX_CURVE5][5];
int8_t curves9[ER9X_MAX_CURVE9][9];
Er9xLogicalSwitchData logicalSw[ER9X_NUM_CSW];
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
uint8_t frSkyVoltThreshold ;
int8_t tmrModeB;
uint8_t numVoice;
+27 -42
View File
@@ -17,7 +17,7 @@
#include <iostream>
#include "er9xinterface.h"
#include "er9xeeprom.h"
#include "simulator/er9xsimulator.h"
#include "er9xsimulator.h"
#include "file.h"
#include "appdata.h"
@@ -75,12 +75,12 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
for (int i=0; i<ER9X_MAX_MIXERS; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ER9X_NUM_CSW; i++) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
@@ -89,17 +89,14 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
bool 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)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -114,26 +111,21 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
bool 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";
errors.set(WRONG_SIZE);
return errors.to_ulong();
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
@@ -141,8 +133,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -160,16 +151,13 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
break;
default:
std::cout << "not er9x\n";
errors.set(NOT_ER9X);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
radioData.generalSettings = er9xGeneral;
@@ -186,15 +174,12 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -205,23 +190,23 @@ int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
return 0;
}
int Er9xInterface::getSize(const ModelData &model)
int Er9xInterface::getSize(ModelData &model)
{
return 0;
}
int Er9xInterface::getSize(const GeneralSettings &settings)
int Er9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Er9xInterface::isAvailable(PulsesProtocol prot, int port)
int Er9xInterface::isAvailable(Protocol prot, int port)
{
switch (prot) {
case PULSES_PPM:
case PULSES_DSM2:
case PULSES_PXX_DJT:
case PULSES_PPM16:
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
return 1;
default:
return 0;
@@ -261,7 +246,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
return gd;
}
@@ -271,7 +256,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
return md;
}
@@ -289,7 +274,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tgen, data, sizeof(Er9xGeneral));
break;
@@ -326,7 +311,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tmod, data, sizeof(Er9xModelData));
break;
+16 -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
@@ -29,24 +29,24 @@ class Er9xInterface : public EEPROMInterface
virtual ~Er9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int getSize(const GeneralSettings &settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int isAvailable(Protocol proto, int port=0);
protected:
@@ -54,17 +54,17 @@ class Er9xInterface : public EEPROMInterface
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
};
@@ -47,7 +47,7 @@ namespace Er9x {
uint8_t pxxFlag = 0;
int16_t g_anas[7];
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
uint16_t anaIn(uint8_t chan)
{
@@ -73,14 +73,14 @@ void getTrims(int16_t values[4])
values[i] = g_model.trim[i];
}
#define TRIMS_GPIO_REG_LHL pind
#define TRIMS_GPIO_REG_LVD pind
#define TRIMS_GPIO_REG_RVU pind
#define TRIMS_GPIO_REG_RHL pind
#define TRIMS_GPIO_REG_LHR pind
#define TRIMS_GPIO_REG_LVU pind
#define TRIMS_GPIO_REG_RVD pind
#define TRIMS_GPIO_REG_RHR pind
#define GPIO_TRIM_LH_L pind
#define GPIO_TRIM_LV_DN pind
#define GPIO_TRIM_RV_UP pind
#define GPIO_TRIM_RH_L pind
#define GPIO_TRIM_LH_R pind
#define GPIO_TRIM_LV_UP pind
#define GPIO_TRIM_RV_DN pind
#define GPIO_TRIM_RH_R pind
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
@@ -98,14 +98,14 @@ void getTrims(int16_t values[4])
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
@@ -151,7 +151,7 @@ void simuSetKey(uint8_t key, bool state)
}
}
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
@@ -172,7 +172,8 @@ bool Er9xSimulator::timer10ms()
uint8_t * Er9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
@@ -50,18 +50,14 @@ class Er9xSimulator : public SimulatorInterface {
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Er9xInterface * er9xInterface;
@@ -1,15 +0,0 @@
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
add_custom_command(
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(er9x-simulator er9xsimulator.cpp)
@@ -82,7 +82,7 @@ Ersky9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -105,13 +105,13 @@ Ersky9xGeneral::operator GeneralSettings ()
switch (beeperVal) {
case 0:
result.beeperMode = GeneralSettings::BEEPER_QUIET;
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
@@ -135,7 +135,7 @@ Ersky9xGeneral::operator GeneralSettings ()
result.switchWarningStates = switchWarningStates;
result.speakerVolume = volume;
result.backlightBright = bright ;
result.txCurrentCalibration = current_calib;
result.currentCalib = current_calib;
return result;
}
@@ -493,16 +493,16 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
@@ -510,16 +510,16 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = ersky9xToSource_v10(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
@@ -587,13 +587,14 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
@@ -608,16 +609,16 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
@@ -625,16 +626,16 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
c9x.swashRingData.collectiveWeight = swashInvertCOL ? -100 : 100;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = ersky9xToSource_v11(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
@@ -702,12 +703,25 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
// for (int i=0; i<8; i++) {
// c9x.frskyalarms[i].frskyAlarmLimit=frskyAlarms.alarmData[i].frskyAlarmLimit;
// c9x.frskyalarms[i].frskyAlarmSound=frskyAlarms.alarmData[i].frskyAlarmSound;
// c9x.frskyalarms[i].frskyAlarmType=frskyAlarms.alarmData[i].frskyAlarmType;
// }
// for (int i=0; i<8; i++) {
// c9x.customdisplay[i]=customDisplayIndex[i];
// }
for (int i=0; i<5;i++) {
c9x.flightModeData[0].gvars[i]=gvars[i].gvar;
// c9x.gvsource[i]=gvars[i].gvsource;
}
return c9x;
}
@@ -69,7 +69,7 @@ PACK(typedef struct t_Ersky9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t vBatCalib;
int8_t lightSw;
Ersky9xTrainerData trainer;
uint8_t view;
@@ -246,13 +246,13 @@ PACK(typedef struct t_Ersky9xFlightModeData {
uint16_t spare ; // Future expansion
}) Ersky9xFlightModeData;
PACK(typedef struct t_Ersky9xCustomFunctionData { // Function Switches data
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
int8_t swtch; //input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
}) Ersky9xCustomFunctionData;
}) Ersky9xFuncSwData;
PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -360,7 +360,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
int8_t trim[4];
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
Ersky9xLogicalSwitchData_v10 logicalSw[ERSKY9X_NUM_CSW_V10];
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
uint8_t frSkyVoltThreshold ;
uint8_t res3[2];
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
@@ -409,7 +409,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
int8_t curvexy[18];
Ersky9xLogicalSwitchData_v11 logicalSw[ERSKY9X_NUM_CSW_V11];
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
uint8_t frSkyVoltThreshold ;
uint8_t bt_telemetry;
uint8_t numVoice; // 0-16, rest are Safety switches
@@ -420,7 +420,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
// Add 6 bytes for custom telemetry screen
uint8_t customDisplayIndex[6] ;
Ersky9xCustomFunctionData customFn[ERSKY9X_NUM_FSW];
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
Ersky9xFlightModeData flightModeData[6] ;
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
@@ -15,9 +15,10 @@
*/
#include <iostream>
#include <QMessageBox>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "simulator/ersky9xsimulator.h"
#include "ersky9xsimulator.h"
#include "file.h"
#define FILE_TYP_GENERAL 1
@@ -73,12 +74,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
@@ -105,12 +106,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
@@ -119,17 +120,14 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
bool 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)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
else {
radioData.generalSettings=ersky9xGeneral;
@@ -139,39 +137,32 @@ unsigned long 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";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
bool 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";
errors.set(WRONG_SIZE);
return errors.to_ulong();
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
@@ -179,8 +170,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
@@ -192,14 +182,12 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
break;
default:
std::cout << "not ersky9x\n";
errors.set(NOT_ERSKY9X);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
radioData.generalSettings = ersky9xGeneral;
@@ -230,15 +218,12 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -249,23 +234,23 @@ int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varia
return 0;
}
int Ersky9xInterface::getSize(const ModelData & model)
int Ersky9xInterface::getSize(ModelData &model)
{
return 0;
}
int Ersky9xInterface::getSize(const GeneralSettings & settings)
int Ersky9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Ersky9xInterface::isAvailable(PulsesProtocol prot, int port)
int Ersky9xInterface::isAvailable(Protocol prot, int port)
{
switch (prot) {
case PULSES_PPM:
case PULSES_DSM2:
case PULSES_PXX_DJT:
case PULSES_PPM16:
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
return 1;
default:
return 0;
@@ -305,7 +290,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
return gd;
}
@@ -315,7 +300,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
return md;
}
@@ -333,7 +318,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
break;
@@ -373,7 +358,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
break;
@@ -34,19 +34,19 @@ class Ersky9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(ModelData &);
virtual int getSize(const GeneralSettings & settings);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int isAvailable(Protocol proto, int port=0);
protected:
@@ -58,7 +58,7 @@ namespace Ersky9x {
#include "../ersky9x/sound.cpp"
#include "../ersky9x/diskio.cpp"
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
//uint8_t pxxFlag = 0;
int16_t g_anas[7];
@@ -114,18 +114,18 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
}
}
#define KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
#define KEYS_GPIO_REG_EXIT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_UP PIOC->PIO_PDSR
#define KEYS_GPIO_REG_DOWN PIOC->PIO_PDSR
#define KEYS_GPIO_REG_RIGHT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_LEFT PIOC->PIO_PDSR
#define KEYS_GPIO_PIN_MENU 0x00000020
#define KEYS_GPIO_PIN_EXIT 0x01000000
#define KEYS_GPIO_PIN_UP 0x00000002
#define KEYS_GPIO_PIN_DOWN 0x00000020
#define KEYS_GPIO_PIN_RIGHT 0x00000010
#define KEYS_GPIO_PIN_LEFT 0x00000008
#define GPIO_BUTTON_MENU PIOB->PIO_PDSR
#define GPIO_BUTTON_EXIT PIOC->PIO_PDSR
#define GPIO_BUTTON_UP PIOC->PIO_PDSR
#define GPIO_BUTTON_DOWN PIOC->PIO_PDSR
#define GPIO_BUTTON_RIGHT PIOC->PIO_PDSR
#define GPIO_BUTTON_LEFT PIOC->PIO_PDSR
#define PIN_BUTTON_MENU 0x00000020
#define PIN_BUTTON_EXIT 0x01000000
#define PIN_BUTTON_UP 0x00000002
#define PIN_BUTTON_DOWN 0x00000020
#define PIN_BUTTON_RIGHT 0x00000010
#define PIN_BUTTON_LEFT 0x00000008
#define KEY_CASE(key, pin, mask) \
case key: \
@@ -135,23 +135,23 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
KEY_CASE(KEY_MENU, GPIO_BUTTON_MENU, PIN_BUTTON_MENU)
KEY_CASE(KEY_EXIT, GPIO_BUTTON_EXIT, PIN_BUTTON_EXIT)
KEY_CASE(KEY_RIGHT, GPIO_BUTTON_RIGHT, PIN_BUTTON_RIGHT)
KEY_CASE(KEY_LEFT, GPIO_BUTTON_LEFT, PIN_BUTTON_LEFT)
KEY_CASE(KEY_UP, GPIO_BUTTON_UP, PIN_BUTTON_UP)
KEY_CASE(KEY_DOWN, GPIO_BUTTON_DOWN, PIN_BUTTON_DOWN)
}
}
#define TRIMS_GPIO_REG_LHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LVD PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RVU PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LHR PIOB->PIO_PDSR
#define TRIMS_GPIO_REG_LVU PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RVD PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RHR PIOC->PIO_PDSR
#define GPIO_TRIM_LH_L PIOA->PIO_PDSR
#define GPIO_TRIM_LV_DN PIOA->PIO_PDSR
#define GPIO_TRIM_RV_UP PIOA->PIO_PDSR
#define GPIO_TRIM_RH_L PIOA->PIO_PDSR
#define GPIO_TRIM_LH_R PIOB->PIO_PDSR
#define GPIO_TRIM_LV_UP PIOC->PIO_PDSR
#define GPIO_TRIM_RV_DN PIOC->PIO_PDSR
#define GPIO_TRIM_RH_R PIOC->PIO_PDSR
#define PIN_TRIM_LH_L 0x00800000
#define PIN_TRIM_LV_DN 0x01000000
#define PIN_TRIM_RV_UP 0x00000002
@@ -166,14 +166,14 @@ void simuSetKey(uint8_t key, bool state)
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
@@ -194,7 +194,8 @@ bool Ersky9xSimulator::timer10ms()
uint8_t * Ersky9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
@@ -50,18 +50,14 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Ersky9xInterface * ersky9xInterface;
@@ -1,15 +0,0 @@
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
add_custom_command(
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(ersky9x-simulator ersky9xsimulator.cpp)
@@ -70,7 +70,7 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -88,13 +88,13 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
switch (beeperVal) {
case 0:
result.beeperMode = GeneralSettings::BEEPER_QUIET;
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
@@ -127,7 +127,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -142,7 +142,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = switchWarning;
result.beeperMode = (GeneralSettings::BeeperMode)beeperVal;
result.beeperMode = (BeeperMode)beeperVal;
result.disableMemoryWarning = disableMemoryWarning;
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
@@ -170,12 +170,12 @@ t_Gruvin9xExpoData::operator ExpoData ()
c9x.chn = chn;
c9x.swtch = gruvin9xToSwitch(swtch);
if (negPhase) {
c9x.flightModes= 1 << (phase -1);
c9x.phases= 1 << (phase -1);
} else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
} else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.weight = weight;
if (expo) {
@@ -322,9 +322,9 @@ Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
return c9x;
}
Gruvin9xCustomFunctionData::operator CustomFunctionData ()
Gruvin9xFuncSwData::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
return c9x;
@@ -338,9 +338,9 @@ t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
t_Gruvin9xSwashRingData::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = gruvin9xToSource(collectiveSource);
c9x.value = value;
@@ -423,25 +423,25 @@ t_Gruvin9xModelData_v102::operator ModelData ()
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -476,7 +476,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -493,25 +493,25 @@ t_Gruvin9xModelData_v103::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -546,7 +546,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -563,25 +563,25 @@ t_Gruvin9xModelData_v105::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -633,9 +633,9 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.customFn[i] = customFn[i];
c9x.funcSw[i] = funcSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -653,25 +653,25 @@ t_Gruvin9xModelData_v106::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -716,9 +716,9 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
c9x.customSw[i] = customSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.customFn[i] = customFn[i];
c9x.funcSw[i] = funcSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -69,7 +69,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v103 {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t vBatCalib;
int8_t lightSw;
Gruvin9xTrainerData_v103 trainer;
uint8_t view; //index of subview in main scrren
@@ -106,7 +106,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t vBatCalib;
int8_t lightSw;
Gruvin9xTrainerData_v104 trainer;
uint8_t view; //index of subview in main scrren
@@ -202,13 +202,13 @@ PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xCustomFunctionData { // Function Switches data
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator CustomFunctionData();
t_Gruvin9xCustomFunctionData() { memset(this, 0, sizeof(t_Gruvin9xCustomFunctionData)); }
}) Gruvin9xCustomFunctionData;
operator FuncSwData();
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
}) Gruvin9xFuncSwData;
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
@@ -309,7 +309,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -341,7 +341,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -373,9 +373,9 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
int16_t subtrim[NUM_STICKS];
@@ -405,9 +405,9 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
@@ -93,30 +93,24 @@ bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
return false;
}
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
bool 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";
errors.set(WRONG_SIZE);
return errors.to_ulong();
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
@@ -124,16 +118,14 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << "no\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
if (version == 0) {
efile->openRd(FILE_GENERAL);
if (efile->readRlc1(&version, 1) != 1) {
std::cout << "no\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
}
@@ -153,33 +145,25 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
break;
default:
std::cout << "not gruvin9x\n";
errors.set(NOT_GRUVIN9X);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
if (version == 5) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
return false;
}
else if (version < 104) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
return false;
}
else if (version <= 106) {
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
return false;
}
else {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
for (int i=0; i<getMaxModels(); i++) {
@@ -201,21 +185,17 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
}
else {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -226,25 +206,25 @@ int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t vari
return 0;
}
int Gruvin9xInterface::getSize(const ModelData & model)
int Gruvin9xInterface::getSize(ModelData &model)
{
return 0;
}
int Gruvin9xInterface::getSize(const GeneralSettings & settings)
int Gruvin9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Gruvin9xInterface::isAvailable(PulsesProtocol proto, int port)
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
{
switch (proto) {
case PULSES_PPM:
case PULSES_SILV_A:
case PULSES_SILV_B:
case PULSES_SILV_C:
case PULSES_CTP1009:
case PULSES_DSM2:
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
case DSM2:
return 1;
default:
return 0;
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -30,25 +30,24 @@ class Gruvin9xInterface : public EEPROMInterface
virtual ~Gruvin9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int getSize(const GeneralSettings & settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int isAvailable(Protocol proto, int port=0);
protected:
@@ -87,14 +87,14 @@ t_Open9xGruvin9xMixData_v207::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -155,14 +155,14 @@ t_Open9xGruvin9xMixData_v209::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -222,7 +222,7 @@ t_Open9xGruvin9xMixData_v211::operator MixData ()
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.flightModes = phases;
c9x.phases = phases;
c9x.sOffset = sOffset;
}
return c9x;
@@ -339,9 +339,9 @@ Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
return c9x;
}
t_Open9xGruvin9xCustomFunctionData_v203::operator CustomFunctionData ()
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.func = (AssignFunc)(func);
@@ -378,9 +378,9 @@ t_Open9xGruvin9xCustomFunctionData_v203::operator CustomFunctionData ()
return c9x;
}
t_Open9xGruvin9xCustomFunctionData_v210::operator CustomFunctionData ()
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
@@ -410,9 +410,9 @@ t_Open9xGruvin9xCustomFunctionData_v210::operator CustomFunctionData ()
t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xV4207ToSource(collectiveSource);
c9x.value = value;
@@ -422,9 +422,9 @@ t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
t_Open9xGruvin9xSwashRingData_v209::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xV4209ToSource(collectiveSource);
c9x.value = value;
@@ -436,20 +436,20 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -460,7 +460,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -471,37 +471,44 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
}
}
}
for (int i=0; i<32; i++)
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<16; i++)
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<14; i++)
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<12; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
return c9x;
}
@@ -510,23 +517,23 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -538,7 +545,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -549,30 +556,30 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
}
}
}
for (int i=0; i<32; i++)
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<16; i++)
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<14; i++)
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<12; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -580,10 +587,17 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
return c9x;
}
@@ -592,23 +606,23 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -620,7 +634,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -631,30 +645,30 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
}
}
}
for (int i=0; i<32; i++)
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<16; i++)
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<14; i++)
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<12; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -663,10 +677,17 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
return c9x;
}
@@ -675,23 +696,23 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -703,7 +724,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -714,13 +735,13 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
}
}
}
for (int i=0; i<32; i++)
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<16; i++)
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<14; i++)
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_MAX_CURVES; i++) {
CurveInfo crvinfo = curveinfo(this, i);
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
c9x.curves[i].count = crvinfo.points;
@@ -737,17 +758,17 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<12; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -759,26 +780,26 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
for (int i=0; i<O9X_MAX_TIMERS; i++) {
c9x.timers[i] = timers[i];
c9x.timers[i].persistent = timersXtra[i].remanent;
c9x.timers[i].val = timersXtra[i].value;
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -790,7 +811,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -801,13 +822,13 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
}
}
}
for (int i=0; i<32; i++)
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<16; i++)
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<14; i++)
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_MAX_CURVES; i++) {
CurveInfo crvinfo = curveinfo(this, i);
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
c9x.curves[i].count = crvinfo.points;
@@ -824,15 +845,15 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<12; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
c9x.modelId = modelId;
return c9x;
}
@@ -132,24 +132,24 @@ PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches
RawSource toSource(int8_t value);
}) Open9xGruvin9xLogicalSwitchData_v209;
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v203 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v203)); }
}) Open9xGruvin9xCustomFunctionData_v203;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
}) Open9xGruvin9xFuncSwData_v203;
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v210 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v210)); }
}) Open9xGruvin9xCustomFunctionData_v210;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
}) Open9xGruvin9xFuncSwData_v210;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -177,7 +177,7 @@ PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -189,15 +189,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v207 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v207 flightModeData[5];
Open9xGruvin9xFlightModeData_v207 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v205 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -211,7 +211,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -223,22 +223,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v207 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -250,7 +250,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -262,22 +262,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v209 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -290,7 +290,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -302,21 +302,21 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v209 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t switchWarningStates;
@@ -328,7 +328,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -340,15 +340,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
uint8_t spare1:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v211 mixData[32];
Open9xLimitData_v211 limitData[16];
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xMixData_v211 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -356,7 +356,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
uint8_t switchWarningStates;
Open9xFrSkyData_v210 frsky;
Open9xTimerDataExtra timersXtra[2];
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
operator ModelData();
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
@@ -160,12 +160,12 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
}
c9x.swtch = open9xArmToSwitch(swtch);
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
} else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
} else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.weight = weight;
return c9x;
@@ -190,14 +190,14 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
}
c9x.swtch = open9xArmToSwitch(swtch);
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.weight = weight;
getEEPROMZString(c9x.name, name, sizeof(name));
@@ -213,7 +213,7 @@ t_Open9xArmExpoData_v212::operator ExpoData ()
// TODO c9x.curveMode=curveMode;
// c9x.curveParam=curveParam;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.flightModes= phases;
c9x.phases= phases;
c9x.weight = weight;
getEEPROMZString(c9x.name, name, sizeof(name));
return c9x;
@@ -261,17 +261,17 @@ t_Open9xArmMixData_v208::operator MixData ()
else if (srcRaw == 9) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 9+9+32) {
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-9);
}
else if (srcRaw <= 9+9+32+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-32);
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-O9X_ARM_NUM_CSW);
}
else if (srcRaw <= 9+9+32+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-32-NUM_CYC);
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-32-NUM_CYC-8);
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
}
c9x.weight = weight;
c9x.swtch = open9xArmToSwitch(swtch);
@@ -292,14 +292,14 @@ t_Open9xArmMixData_v208::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -327,17 +327,17 @@ t_Open9xArmMixData_v209::operator MixData ()
else if (srcRaw == 13) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 13+9+32) {
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
}
else if (srcRaw <= 13+9+32+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
}
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
}
c9x.weight = weight;
@@ -358,14 +358,14 @@ t_Open9xArmMixData_v209::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -393,17 +393,17 @@ t_Open9xArmMixData_v210::operator MixData ()
else if (srcRaw == 13) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 13+9+32) {
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
}
else if (srcRaw <= 13+9+32+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
}
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
}
c9x.weight = weight;
@@ -424,14 +424,14 @@ t_Open9xArmMixData_v210::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.flightModes= 1 << (-phase -1);
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.flightModes=0;
c9x.phases=0;
}
else {
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -463,17 +463,17 @@ t_Open9xArmMixData_v212::operator MixData ()
else if (srcRaw == 14) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 14+9+32) {
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-14);
}
else if (srcRaw <= 14+9+32+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-32);
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-O9X_ARM_NUM_CSW);
}
else if (srcRaw <= 14+9+32+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-32-NUM_CYC);
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-32-NUM_CYC-8);
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
}
c9x.weight = weight;
@@ -493,7 +493,7 @@ t_Open9xArmMixData_v212::operator MixData ()
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.flightModes = phases;
c9x.phases = phases;
c9x.sOffset = sOffset;
getEEPROMZString(c9x.name, name, sizeof(name));
}
@@ -571,9 +571,9 @@ t_Open9xArmLogicalSwitchData_v210::operator LogicalSwitchData ()
return c9x;
}
t_Open9xArmCustomFunctionData_v208::operator CustomFunctionData ()
t_Open9xArmFuncSwData_v208::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncOverrideCH32) {
@@ -589,9 +589,9 @@ t_Open9xArmCustomFunctionData_v208::operator CustomFunctionData ()
return c9x;
}
t_Open9xArmCustomFunctionData_v210::operator CustomFunctionData ()
t_Open9xArmFuncSwData_v210::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -613,9 +613,9 @@ t_Open9xArmCustomFunctionData_v210::operator CustomFunctionData ()
return c9x;
}
t_Open9xArmCustomFunctionData_v211::operator CustomFunctionData ()
t_Open9xArmFuncSwData_v211::operator FuncSwData ()
{
CustomFunctionData c9x;
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -640,9 +640,9 @@ t_Open9xArmCustomFunctionData_v211::operator CustomFunctionData ()
t_Open9xArmSwashRingData_v208::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xArm208ToSource(collectiveSource);
c9x.value = value;
@@ -652,9 +652,9 @@ t_Open9xArmSwashRingData_v208::operator SwashRingData ()
t_Open9xArmSwashRingData_v209::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xArm209ToSource(collectiveSource);
c9x.value = value;
@@ -664,9 +664,9 @@ t_Open9xArmSwashRingData_v209::operator SwashRingData ()
t_Open9xArmSwashRingData_v210::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xArm210ToSource(collectiveSource);
c9x.value = value;
@@ -683,8 +683,21 @@ t_Open9xArmFrSkyData_v210::operator FrSkyData ()
c9x.blades = blades+2;
c9x.currentSource=currentSource;
c9x.screens[0].type = 1;
for (int i=0; i<4; i++) {
c9x.screens[0].body.bars[i].source = bars[i].source;
c9x.screens[0].body.bars[i].barMin = bars[i].barMin;
c9x.screens[0].body.bars[i].barMax = bars[i].barMax;
}
c9x.rssiAlarms[0] = rssiAlarms[0].get(0);
c9x.rssiAlarms[1] = rssiAlarms[1].get(1);
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
int i=line*2+col;
c9x.screens[1].body.lines[line].source[col] = lines[i];
}
}
return c9x;
}
@@ -698,8 +711,21 @@ t_Open9xArmFrSkyData_v211::operator FrSkyData ()
c9x.blades = blades+2;
c9x.currentSource=currentSource;
c9x.screens[0].type = 1;
for (int i=0; i<4; i++) {
c9x.screens[0].body.bars[i].source = bars[i].source;
c9x.screens[0].body.bars[i].barMin = bars[i].barMin;
c9x.screens[0].body.bars[i].barMax = bars[i].barMax;
}
c9x.rssiAlarms[0] = rssiAlarms[0].get(0);
c9x.rssiAlarms[1] = rssiAlarms[1].get(1);
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
int i=line*2+col;
c9x.screens[1].body.lines[line].source[col] = lines[i];
}
}
c9x.varioSource = varioSource;
c9x.varioCenterMax = varioSpeedUpMin;
c9x.varioCenterMin = varioSpeedDownMin;
@@ -712,23 +738,23 @@ t_Open9xArmModelData_v208::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -740,7 +766,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -751,30 +777,30 @@ t_Open9xArmModelData_v208::operator ModelData ()
}
}
}
for (int i=0; i<64; i++)
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<32; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -782,8 +808,14 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -795,23 +827,23 @@ t_Open9xArmModelData_v209::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -823,7 +855,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -834,30 +866,30 @@ t_Open9xArmModelData_v209::operator ModelData ()
}
}
}
for (int i=0; i<64; i++)
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<32; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -866,8 +898,14 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -879,23 +917,23 @@ t_Open9xArmModelData_v210::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -907,7 +945,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -918,30 +956,30 @@ t_Open9xArmModelData_v210::operator ModelData ()
}
}
}
for (int i=0; i<64; i++)
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<8; i++) {
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<8; i++) {
c9x.curves[8 + i].count = 9;
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
c9x.curves[8 + i].points[j].y = curves9[i][j];
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<32; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -950,8 +988,8 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -963,23 +1001,23 @@ t_Open9xArmModelData_v211::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++)
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -991,7 +1029,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -1002,13 +1040,13 @@ t_Open9xArmModelData_v211::operator ModelData ()
}
}
}
for (int i=0; i<64; i++)
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<16; i++) {
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
CurveInfo crvinfo = curveinfo(this, i);
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
c9x.curves[i].count = crvinfo.points;
@@ -1025,17 +1063,17 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<32; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.modelId = modelId;
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -1047,26 +1085,26 @@ t_Open9xArmModelData_v212::operator ModelData ()
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
for (int i=0; i<O9X_MAX_TIMERS; i++) {
c9x.timers[i] = timers[i];
c9x.timers[i].persistent = timersXtra[i].remanent;
c9x.timers[i].val = timersXtra[i].value;
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PPM16;
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_PPMSIM;
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_DSM2;
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1078,7 +1116,7 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
@@ -1089,13 +1127,13 @@ t_Open9xArmModelData_v212::operator ModelData ()
}
}
}
for (int i=0; i<64; i++)
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<32; i++)
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<16; i++) {
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
CurveInfo crvinfo = curveinfo(this, i);
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
c9x.curves[i].count = crvinfo.points;
@@ -1112,15 +1150,15 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<32; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.customFn[i] = customFn[i];
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
c9x.modelId = modelId;
return c9x;
}
@@ -19,6 +19,17 @@
#include "open9xStockeeprom.h"
#define O9X_ARM_MAX_FLIGHT_MODES 9
#define O9X_ARM_MAX_MIXERS 64
#define O9X_ARM_MAX_EXPOS 32
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
#define O9X_ARM_NUM_CSW 32 // number of custom switches
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
#define O9X_ARM_MAX_CURVES 16
#define O9X_ARM_NUM_POINTS 512
#define O9X_ARM_MAX_CSFUNCOLD 13
#define O9X_ARM_MAX_CSFUNC 15
PACK(typedef struct t_Open9xArmTimerData_v202 {
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint16_t val;
@@ -208,34 +219,34 @@ PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
}) Open9xArmLogicalSwitchData_v210;
PACK(typedef struct t_Open9xArmCustomFunctionData_v208 { // Function Switches data
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v208)); }
}) Open9xArmCustomFunctionData_v208;
operator FuncSwData();
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
}) Open9xArmFuncSwData_v208;
PACK(typedef struct t_Open9xArmCustomFunctionData_v210 { // Function Switches data
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v210)); }
}) Open9xArmCustomFunctionData_v210;
operator FuncSwData();
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
}) Open9xArmFuncSwData_v210;
PACK(typedef struct t_Open9xArmCustomFunctionData_v211 { // Function Switches data
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v211() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v211)); }
}) Open9xArmCustomFunctionData_v211;
operator FuncSwData();
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
}) Open9xArmFuncSwData_v211;
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -315,7 +326,7 @@ PACK(typedef struct t_Open9xArmFrSkyData_v211 {
PACK(typedef struct t_Open9xArmModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[2];
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -327,22 +338,22 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v208 mixData[64];
Open9xLimitData_v201 limitData[32];
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v208 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmMixData_v208 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v208 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[32];
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -354,7 +365,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
PACK(typedef struct t_Open9xArmModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[2];
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -366,22 +377,22 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v209 mixData[64];
Open9xLimitData_v201 limitData[32];
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v209 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmMixData_v209 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[32];
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -394,7 +405,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
PACK(typedef struct t_Open9xArmModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[2];
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -406,20 +417,20 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v210 mixData[64];
Open9xLimitData_v201 limitData[32];
Open9xArmExpoData_v210 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v210 customFn[32];
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
Open9xArmFrSkyData_v210 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[32];
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -433,7 +444,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
PACK(typedef struct t_Open9xArmModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[2];
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -445,21 +456,21 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v210 mixData[64];
Open9xLimitData_v201 limitData[32];
Open9xArmExpoData_v210 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
int16_t curves[O9X_ARM_MAX_CURVES];
int8_t points[O9X_ARM_NUM_POINTS];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[32];
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
uint8_t switchWarningStates;
@@ -471,7 +482,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
PACK(typedef struct t_Open9xArmModelData_v212 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[2];
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -483,15 +494,15 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
uint8_t spare1:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v212 mixData[64];
Open9xLimitData_v211 limitData[32];
Open9xArmExpoData_v212 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmMixData_v212 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
int16_t curves[O9X_ARM_MAX_CURVES];
int8_t points[O9X_ARM_NUM_POINTS];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v210 swashR;
Open9xArmFlightModeData_v212 flightModeData[9];
Open9xArmFlightModeData_v212 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -499,7 +510,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
uint8_t switchWarningStates;
Open9xArmFrSkyData_v211 frsky;
Open9xTimerDataExtra timersXtra[2];
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
operator ModelData();
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
File diff suppressed because it is too large Load Diff
@@ -247,32 +247,32 @@ PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
}) Open9xSafetySwData;
PACK(typedef struct t_Open9xCustomFunctionData_v201 { // Function Switches data
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v201() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v201)); }
}) Open9xCustomFunctionData_v201;
operator FuncSwData();
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
}) Open9xFuncSwData_v201;
PACK(typedef struct t_Open9xCustomFunctionData_v203 { // Function Switches data
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v203)); }
}) Open9xCustomFunctionData_v203;
operator FuncSwData();
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
}) Open9xFuncSwData_v203;
PACK(typedef struct t_Open9xCustomFunctionData_v210 { // Function Switches data
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v210)); }
}) Open9xCustomFunctionData_v210;
operator FuncSwData();
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
}) Open9xFuncSwData_v210;
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -481,6 +481,20 @@ PACK(typedef struct t_Open9xTimerDataExtra {
t_Open9xTimerDataExtra() { memset(this, 0, sizeof(t_Open9xTimerDataExtra)); }
}) Open9xTimerDataExtra;
#define O9X_MAX_TIMERS 2
#define O9X_MAX_FLIGHT_MODES 5
#define O9X_MAX_MIXERS 32
#define O9X_MAX_EXPOS 14
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
#define O9X_NUM_CSW 12 // number of custom switches
#define O9X_NUM_FSW 16 // number of functions assigned to switches
#define O9X_MAX_CURVES 8
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
#define O9X_MAX_GVARS 5
#define O9X_209_MAX_CURVE5 8
#define O9X_209_MAX_CURVE9 8
PACK(typedef struct t_Open9xModelData_v201 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v201 timer1;
@@ -497,16 +511,16 @@ PACK(typedef struct t_Open9xModelData_v201 {
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v201 timer2;
Open9xMixData_v201 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xCustomFunctionData_v201 customFn[12];
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v201 frsky;
operator ModelData();
@@ -528,16 +542,16 @@ PACK(typedef struct t_Open9xModelData_v202 {
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v201 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xCustomFunctionData_v201 customFn[12];
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -562,15 +576,15 @@ PACK(typedef struct t_Open9xModelData_v203 {
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v203 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -595,15 +609,15 @@ PACK(typedef struct t_Open9xModelData_v204 {
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v203 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v204 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -616,7 +630,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
PACK(typedef struct t_Open9xModelData_v205 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -628,22 +642,22 @@ PACK(typedef struct t_Open9xModelData_v205 {
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v205 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v205 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
operator ModelData();
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
@@ -651,7 +665,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
PACK(typedef struct t_Open9xModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -663,22 +677,22 @@ PACK(typedef struct t_Open9xModelData_v208 {
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v205 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -690,7 +704,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
PACK(typedef struct t_Open9xModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -702,22 +716,22 @@ PACK(typedef struct t_Open9xModelData_v209 {
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v209 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v208 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t frskyLines[4];
uint16_t frskyLinesXtra;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
@@ -730,7 +744,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
PACK(typedef struct t_Open9xModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -742,21 +756,21 @@ PACK(typedef struct t_Open9xModelData_v210 {
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v209 mixData[32];
Open9xLimitData_v201 limitData[16];
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[16];
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t switchWarningStates;
@@ -768,7 +782,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
PACK(typedef struct t_Open9xModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[2];
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
@@ -780,15 +794,15 @@ PACK(typedef struct t_Open9xModelData_v211 {
uint8_t spare1:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v211 mixData[32];
Open9xLimitData_v211 limitData[16];
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xMixData_v211 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
@@ -0,0 +1,225 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxGruvin9xsimulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBGRUVIN9X
#define CPUM2560
#define ROTARY_ENCODERS 2
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define BUZZER
#define AUDIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3
#undef min
#undef max
#include <exception>
namespace Open9xGruvin9x {
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/targets/gruvin9x/somo14d.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 150;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace Open9xGruvin9x;
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
{
}
bool Open9xGruvin9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Open9xGruvin9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
{
g_rotenc[0] = 0;
g_rotenc[1] = 0;
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
{
g_rotenc[0] = 0;
g_rotenc[1] = 0;
StartEepromThread(filename);
StartMainThread(tests);
}
void Open9xGruvin9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Open9xGruvin9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
{
g_rotenc[0] += steps;
}
unsigned int Open9xGruvin9xSimulator::getPhase()
{
return getFlightMode();
}
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * Open9xGruvin9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,66 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9xGruvin9x_simulator_h
#define open9xGruvin9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class Open9xGruvin9xSimulator : public SimulatorInterface {
public:
Open9xGruvin9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
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
@@ -0,0 +1,218 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxM128simulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSTD
#define CPUM128
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define DSM2
#define DSM2_PPM
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "9x128"
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
#undef min
#undef max
#include <exception>
namespace OpenTxM128 {
#include "radio/src/targets/stock/board_stock.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/targets/stock/voice.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 150;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace OpenTxM128;
OpenTxM128Simulator::OpenTxM128Simulator()
{
}
bool OpenTxM128Simulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * OpenTxM128Simulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
{
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void OpenTxM128Simulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartMainThread(tests);
}
void OpenTxM128Simulator::stop()
{
StopMainThread();
StopEepromThread();
}
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
}
void OpenTxM128Simulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM128Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
{
}
unsigned int OpenTxM128Simulator::getPhase()
{
return getFlightMode();
}
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * OpenTxM128Simulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,66 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef OpenTxM128_simulator_h
#define OpenTxM128_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class OpenTxM128Simulator : public SimulatorInterface {
public:
OpenTxM128Simulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
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
@@ -0,0 +1,221 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxM64simulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define HELI
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSTD
#define CPUM64
#define SPLASH
#define FLIGHT_MODES
#define PPM_UNIT_PERCENT_PREC1
#define HELI
#define TEMPLATES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define PXX
#define DSM2
#define DSM2_PPM
#define VARIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define BUZZER
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES
#define FLAVOUR "9x"
#define NUM_POTS 3
#undef min
#undef max
#include <exception>
namespace OpenTxM64 {
#include "radio/src/targets/stock/board_stock.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/timers.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/targets/stock/voice.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace OpenTxM64;
OpenTxM64Simulator::OpenTxM64Simulator()
{
#define INIT_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM64Simulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * OpenTxM64Simulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
{
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
StartEepromThread(NULL);
StartMainThread(tests);
}
void OpenTxM64Simulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartMainThread(tests);
}
void OpenTxM64Simulator::stop()
{
StopMainThread();
StopEepromThread();
}
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void OpenTxM64Simulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM64Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
unsigned int OpenTxM64Simulator::getPhase()
{
return getFlightMode();
}
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * OpenTxM64Simulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,65 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9x_simulator_h
#define open9x_simulator_h
#include "simulatorinterface.h"
class OpenTxEepromInterface;
class OpenTxM64Simulator : public SimulatorInterface {
public:
OpenTxM64Simulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
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
@@ -0,0 +1,274 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxSky9xsimulator.h"
#include "opentxinterface.h"
#include "appdata.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSKY9X
#define CPUARM
#define REVB
#define ROTARY_ENCODERS 1
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define BUZZER
#define AUDIO
#define VOICE
#define HAPTIC
// #define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define SDCARD
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3
#define EEPROM_VARIANT 3
#define FLAVOUR "sky9x"
#undef min
#undef max
#include <exception>
namespace Open9xSky9x {
#include "radio/src/targets/sky9x/board_sky9x.cpp"
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
#include "radio/src/targets/sky9x/pwr_driver.cpp"
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_raw.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/opentx.cpp"
// #include "radio/src/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"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/sdcard.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/targets/sky9x/audio_driver.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
#include "radio/src/targets/sky9x/coproc_driver.cpp"
#include "radio/src/targets/sky9x/haptic_driver.cpp"
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_hu.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator()
{
QString path=g.profile[g.id()].sdPath()+"/";
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
}
bool Open9xSky9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
::uint8_t * Open9xSky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
{
g_rotenc[0] = 0;
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartAudioThread();
StartMainThread(tests);
}
void Open9xSky9xSimulator::start(const char * filename, bool tests)
{
g_rotenc[0] = 0;
StartEepromThread(filename);
StartAudioThread();
StartMainThread(tests);
}
void Open9xSky9xSimulator::stop()
{
StopMainThread();
StopAudioThread();
StopEepromThread();
}
void Open9xSky9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void Open9xSky9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void Open9xSky9xSimulator::getTrims(Trims & trims)
{
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
::uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xSky9xSimulator::wheelEvent(::uint8_t steps)
{
g_rotenc[0] += steps*4;
}
unsigned int Open9xSky9xSimulator::getPhase()
{
return getFlightMode();
}
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * 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;
}
@@ -0,0 +1,66 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9xSky9x_simulator_h
#define open9xSky9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class Open9xSky9xSimulator : public SimulatorInterface {
public:
Open9xSky9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
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
@@ -0,0 +1,316 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxTaranisSimulator.h"
#include "opentxinterface.h"
#include "appdata.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBTARANIS
#define CPUARM
#define HELI
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define FRSKY_SPORT
#define GPS
#define VARIO
#define GAUGES
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define VOICE
#define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define SDCARD
#define RTCLOCK
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define FAI_CHOICE
#define LUA
#define LUA_MODEL_SCRIPTS
#define EEPROM_VARIANT 3
#define HAPTIC
#define REVPLUS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
#define FLAVOUR "taranis-plus"
#undef min
#undef max
#include <exception>
namespace Open9xX9D {
int taranisSimulatorBoard = 0;
inline int geteepromsize() {
return 32*1024;
}
#define EESIZE geteepromsize()
#include "radio/src/targets/taranis/board_taranis.cpp"
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/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"
#include "radio/src/targets/taranis/uart3_driver.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_channels.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_taranis.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/rtc.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/bmp.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/targets/taranis/haptic_driver.cpp"
#include "radio/src/sdcard.cpp"
// Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#define SKIP_FATFS_DECLARATION
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/targets/taranis/audio_driver.cpp"
#include "radio/src/targets/taranis/telemetry_driver.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_hu.cpp"
#include "radio/src/lua.cpp"
#include "radio/src/lua/src/lapi.c"
#include "radio/src/lua/src/lcode.c"
#include "radio/src/lua/src/lctype.c"
#include "radio/src/lua/src/ldebug.c"
#include "radio/src/lua/src/ldo.c"
#include "radio/src/lua/src/ldump.c"
#include "radio/src/lua/src/lfunc.c"
#include "radio/src/lua/src/lgc.c"
#include "radio/src/lua/src/llex.c"
#include "radio/src/lua/src/lmem.c"
#include "radio/src/lua/src/lobject.c"
#include "radio/src/lua/src/lopcodes.c"
#include "radio/src/lua/src/lparser.c"
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/lrotable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
#include "radio/src/lua/src/lzio.c"
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/lbitlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
#include "radio/src/lua/src/lcorolib.c"
int16_t g_anas[NUM_STICKS+5];
uint16_t anaIn(uint8_t chan)
{
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
void resetTrims()
{
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
}
}
using namespace Open9xX9D;
OpentxTaranisSimulator::OpentxTaranisSimulator()
{
taranisSimulatorBoard = GetEepromInterface()->getBoard();
QString path=g.profile[g.id()].sdPath()+"/";
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
}
bool OpentxTaranisSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
::uint8_t * OpentxTaranisSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpentxTaranisSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartAudioThread();
StartMainThread(tests);
}
void OpentxTaranisSimulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartAudioThread();
StartMainThread(tests);
}
void OpentxTaranisSimulator::stop()
{
StopMainThread();
StopAudioThread();
StopEepromThread();
}
void OpentxTaranisSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpentxTaranisSimulator::getTrims(Trims & trims)
{
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
::uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpentxTaranisSimulator::wheelEvent(::uint8_t steps)
{
// g_rotenc[0] += steps*4;
}
unsigned int OpentxTaranisSimulator::getPhase()
{
return getFlightMode();
}
const char * OpentxTaranisSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * 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;
}
@@ -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
@@ -14,29 +14,19 @@
*
*/
#ifndef _OPENTX_SIMULATOR_H_
#define _OPENTX_SIMULATOR_H_
#ifndef opentx_taranis_simulator_h
#define opentx_taranis_simulator_h
#include "simulatorinterface.h"
#if defined __GNUC__
#define DLLEXPORT
#else
#define DLLEXPORT __declspec(dllexport)
#endif
class RadioData;
class OpenTxEepromInterface;
class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
private:
int volumeGain;
class OpentxTaranisSimulator : public SimulatorInterface {
public:
OpenTxSimulator();
virtual void setSdPath(const QString &sdPath);
virtual void setVolumeGain(int value);
OpentxTaranisSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
@@ -62,21 +52,15 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(int steps);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0);
virtual uint16_t getSensorRatio(uint16_t id);
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
virtual void setLuaStateReloadPermanentScripts();
};
#endif // _OPENTX_SIMULATOR_H_
#endif
File diff suppressed because it is too large Load Diff
+49 -26
View File
@@ -22,15 +22,34 @@
#include "eepromimportexport.h"
#include <qbytearray.h>
#define GVARS_VARIANT 0x0001
#define FRSKY_VARIANT 0x0002
#define POS3_VARIANT 0x0004
#define MAVLINK_VARIANT 0x0008
#define M128_VARIANT 0x8000
#define TARANIS_X9E_VARIANT 0x8000
#define GVARS_VARIANT 0x0001
#define FRSKY_VARIANT 0x0002
#define POS3_VARIANT 0x0004
#define MAVLINK_VARIANT 0x0008
#define M128_VARIANT 0x8000
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
#define O9X_MAX_TIMERS 2
#define O9X_MAX_FLIGHT_MODES 5
#define O9X_MAX_MIXERS 32
#define O9X_MAX_EXPOS 14
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
#define O9X_NUM_CSW 12 // number of custom switches
#define O9X_NUM_FSW 16 // number of functions assigned to switches
#define O9X_MAX_CURVES 8
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
#define O9X_ARM_MAX_FLIGHT_MODES 9
#define O9X_ARM_MAX_MIXERS 64
#define O9X_ARM_MAX_EXPOS 32
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
#define O9X_ARM_NUM_CSW 32 // number of custom switches
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
#define O9X_ARM_NUM_POINTS 512
#define O9X_ARM_MAX_CSFUNCOLD 13
#define O9X_ARM_MAX_CSFUNC 15
class OpenTxGeneralData: public TransformedField {
public:
@@ -46,7 +65,7 @@ class OpenTxGeneralData: public TransformedField {
unsigned int version;
int inputsCount;
unsigned int chkSum;
// unsigned int potsType[4];
unsigned int potsType[4];
};
class ProtocolsConversionTable: public ConversionTable
@@ -56,37 +75,40 @@ class ProtocolsConversionTable: public ConversionTable
{
int val = 0;
if (IS_ARM(board)) {
addConversion(PULSES_OFF, val++);
addConversion(OFF, val++);
}
addConversion(PULSES_PPM, val++);
addConversion(PPM, val++);
if (!IS_ARM(board)) {
addConversion(PULSES_PPM16, val++);
addConversion(PULSES_PPMSIM, val++);
addConversion(PPM16, val++);
addConversion(PPMSIM, val++);
}
if (IS_ARM(board)) {
addConversion(PULSES_PXX_XJT_X16, val);
addConversion(PULSES_PXX_XJT_D8, val);
addConversion(PULSES_PXX_XJT_LR12, val++);
addConversion(PXX_XJT_X16, val);
addConversion(PXX_XJT_D8, val);
addConversion(PXX_XJT_LR12, val++);
}
else {
addConversion(PULSES_PXX_DJT, val++);
addConversion(PXX_DJT, val++);
}
if (IS_ARM(board)) {
addConversion(PULSES_LP45, val);
addConversion(PULSES_DSM2, val);
addConversion(PULSES_DSMX, val++);
addConversion(LP45, val);
addConversion(DSM2, val);
addConversion(DSMX, val++);
}
else {
addConversion(PULSES_LP45, val++);
addConversion(PULSES_DSM2, val++);
addConversion(PULSES_DSMX, val++);
}
if (IS_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
addConversion(LP45, val++);
addConversion(DSM2, val++);
addConversion(DSMX, val++);
}
}
};
class ThrottleSourceConversionTable: public ConversionTable {
public:
ThrottleSourceConversionTable(BoardEnum board, unsigned int version);
};
class ChannelsConversionTable: public ConversionTable
{
public:
@@ -118,6 +140,7 @@ class OpenTxModelData: public TransformedField {
char name[256];
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
ProtocolsConversionTable protocolsConversionTable;
ThrottleSourceConversionTable throttleSourceConversionTable;
ChannelsConversionTable channelsConversionTable;
};
File diff suppressed because it is too large Load Diff
@@ -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
@@ -13,12 +13,13 @@
* GNU General Public License for more details.
*
*/
#ifndef opentx_interface_h
#define opentx_interface_h
#ifndef open9x_interface_h
#define open9x_interface_h
#include "eeprominterface.h"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
class RleFile;
class OpenTxEepromInterface : public EEPROMInterface
@@ -33,23 +34,25 @@ class OpenTxEepromInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(const GeneralSettings &);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
protected:
const char * getName();
EepromLoadErrors checkVersion(unsigned int version);
bool checkVersion(unsigned int version);
bool checkVariant(unsigned int version, unsigned int variant);
@@ -74,43 +77,41 @@ class OpenTxEepromInterface : public EEPROMInterface
};
class OpenTxFirmware: public Firmware {
class OpenTxFirmware: public FirmwareInterface {
public:
OpenTxFirmware(const QString & id, OpenTxFirmware * parent):
Firmware(parent, id, parent->getName(), parent->getBoard(), parent->eepromInterface)
FirmwareInterface(parent, id, parent->getName(), parent->getBoard(), parent->eepromInterface)
{
}
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board):
Firmware(id, name, board, new OpenTxEepromInterface(board))
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board))
{
addLanguage("en");
addLanguage("cz");
addLanguage("de");
addLanguage("es");
addLanguage("fr");
addLanguage("it");
addLanguage("nl");
addLanguage("de");
addLanguage("se");
addLanguage("cz");
addLanguage("es");
addLanguage("pl");
addLanguage("pt");
addLanguage("se");
addTTSLanguage("en");
addTTSLanguage("cz");
addTTSLanguage("de");
addTTSLanguage("es");
addTTSLanguage("fr");
addTTSLanguage("hu");
addTTSLanguage("it");
addTTSLanguage("nl");
addTTSLanguage("de");
addTTSLanguage("se");
addTTSLanguage("cz");
addTTSLanguage("sk");
addTTSLanguage("pl");
addTTSLanguage("pt");
addTTSLanguage("se");
addTTSLanguage("sk");
addTTSLanguage("es");
addTTSLanguage("hu");
}
virtual Firmware * getFirmwareVariant(const QString & id);
virtual FirmwareInterface * getFirmwareVariant(const QString & id);
virtual QString getStampUrl();
virtual QString getReleaseNotesUrl();
@@ -121,15 +122,10 @@ class OpenTxFirmware: public Firmware {
virtual bool isTelemetrySourceAvailable(int source);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
QString getFirmwareBaseUrl();
virtual SimulatorInterface * getSimulator();
};
void registerOpenTxFirmwares();
void unregisterOpenTxFirmwares();
#endif
@@ -0,0 +1,4 @@
// Automatically generated file (CMake) - do not edit
#define DATE_STR "@DATE@"
#define TIME_STR "@TIME@"
#define VERS_STR "@C9X_VERSION@"
@@ -1,15 +0,0 @@
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
add_custom_command(
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(th9x-simulator th9xsimulator.cpp)
+7 -7
View File
@@ -62,7 +62,7 @@ Th9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.vBatCalib = vBatCalib;
// result.lightSw = th9xToSwitch(lightSw);
result.trainer = trainer;
result.view = view;
@@ -71,16 +71,16 @@ Th9xGeneral::operator GeneralSettings ()
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
case 0:
result.beeperMode = GeneralSettings::BEEPER_QUIET;
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
result.beeperMode = e_no_keys;
break;
case 2:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperMode = e_all;
break;
case 3:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperMode = e_all;
result.beeperLength = 2;
}
result.stickMode = stickMode;
@@ -274,9 +274,9 @@ t_Th9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncTrims2Offsets;
c9x.funcSw[0].func = FuncTrims2Offsets;
if (trimSw) {
c9x.customFn[0].swtch = trimSw;
c9x.funcSw[0].swtch = trimSw;
}
c9x.beepANACenter = beepANACenter;
c9x.pulsePol = pulsePol;
+1 -1
View File
@@ -64,7 +64,7 @@ PACK(typedef struct t_Th9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t vBatCalib;
int8_t lightSw;
Th9xTrainerData trainer;
uint8_t adcFilt:2;
+20 -32
View File
@@ -17,7 +17,7 @@
#include <iostream>
#include "th9xinterface.h"
#include "th9xeeprom.h"
#include "simulator/th9xsimulator.h"
#include "th9xsimulator.h"
#include "file.h"
#include "appdata.h"
@@ -57,29 +57,23 @@ const int Th9xInterface::getMaxModels()
return 16;
}
unsigned long Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
bool 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";
errors.set(WRONG_SIZE);
return errors.to_ulong();
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
@@ -87,8 +81,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
std::cout << "no\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
@@ -98,16 +91,14 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
break;
default:
std::cout << "not th9x\n";
errors.set(NOT_TH9X);
return errors.to_ulong();
return false;
}
efile->openRd(FILE_GENERAL);
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if (len != sizeof(Th9xGeneral)) {
std::cout << "not th9x\n";
errors.set(NOT_TH9X);
return errors.to_ulong();
return false;
}
radioData.generalSettings = th9xGeneral;
@@ -123,15 +114,12 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
return true;
}
unsigned long Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
return false;
}
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -142,24 +130,24 @@ int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
return 0;
}
int Th9xInterface::getSize(const ModelData & model)
int Th9xInterface::getSize(ModelData &model)
{
return 0;
}
int Th9xInterface::getSize(const GeneralSettings & settings)
int Th9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Th9xInterface::isAvailable(PulsesProtocol proto, int port)
int Th9xInterface::isAvailable(Protocol proto, int port)
{
switch (proto) {
case PULSES_PPM:
case PULSES_SILV_A:
case PULSES_SILV_B:
case PULSES_SILV_C:
case PULSES_CTP1009:
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
return 1;
default:
return 0;
+6 -6
View File
@@ -34,19 +34,19 @@ class Th9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(ModelData &);
virtual int getSize(const GeneralSettings &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int isAvailable(Protocol proto, int port=0);
protected:
@@ -78,14 +78,14 @@ void eeprom_RESV_mismatch(void)
assert(!"Should never been called. Only needed by VC++ (debug mode)");
}
#define TRIMS_GPIO_REG_LHL pind
#define TRIMS_GPIO_REG_LVD pind
#define TRIMS_GPIO_REG_RVU pind
#define TRIMS_GPIO_REG_RHL pind
#define TRIMS_GPIO_REG_LHR pind
#define TRIMS_GPIO_REG_LVU pind
#define TRIMS_GPIO_REG_RVD pind
#define TRIMS_GPIO_REG_RHR pind
#define GPIO_TRIM_LH_L pind
#define GPIO_TRIM_LV_DN pind
#define GPIO_TRIM_RV_UP pind
#define GPIO_TRIM_RH_L pind
#define GPIO_TRIM_LH_R pind
#define GPIO_TRIM_LV_UP pind
#define GPIO_TRIM_RV_DN pind
#define GPIO_TRIM_RH_R pind
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
@@ -103,14 +103,14 @@ void eeprom_RESV_mismatch(void)
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
@@ -156,7 +156,7 @@ void simuSetKey(uint8_t key, bool state)
}
}
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
@@ -175,7 +175,8 @@ bool Th9xSimulator::timer10ms()
uint8_t * Th9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
@@ -48,6 +48,8 @@ class Th9xSimulator : public SimulatorInterface {
virtual unsigned int getPhase() { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
-360
View File
@@ -1,360 +0,0 @@
#include "flasheepromdialog.h"
#include "ui_flasheepromdialog.h"
#include "eeprominterface.h"
#include "helpers.h"
#include "firmwareinterface.h"
#include "hexinterface.h"
#include "appdata.h"
#include "progressdialog.h"
#include "radiointerface.h"
#include "converteeprom.h"
#include "splashlibrarydialog.h"
FlashEEpromDialog::FlashEEpromDialog(QWidget *parent, const QString &filename):
QDialog(parent),
ui(new Ui::FlashEEpromDialog),
eepromFilename(filename),
radioData(new RadioData())
{
ui->setupUi(this);
ui->profileLabel->setText(tr("Current profile: %1").arg(g.profile[g.id()].name()));
if (!filename.isEmpty()) {
ui->eepromFilename->hide();
ui->eepromLoad->hide();
}
QString backupPath = g.profile[g.id()].pBackupDir();
if (backupPath.isEmpty()) {
backupPath=g.backupDir();
ui->backupBeforeWrite->setChecked(g.enableBackup() || g.profile[g.id()].penableBackup());
}
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
ui->backupBeforeWrite->setEnabled(false);
}
updateUI();
}
FlashEEpromDialog::~FlashEEpromDialog()
{
delete ui;
}
void FlashEEpromDialog::updateUI()
{
// ui->burnButton->setEnabled(true);
ui->eepromFilename->setText(eepromFilename);
if (getEEpromVersion(eepromFilename) >= 0) {
ui->profileLabel->show();
ui->patchCalibration->show();
ui->patchHardwareSettings->show();
QString name = g.profile[g.id()].name();
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
QString DisplaySet = g.profile[g.id()].display();
QString BeeperSet = g.profile[g.id()].beeper();
QString HapticSet = g.profile[g.id()].haptic();
QString SpeakerSet = g.profile[g.id()].speaker();
if (!name.isEmpty()) {
ui->profileLabel->show();
ui->patchCalibration->show();
ui->patchHardwareSettings->show();
// TODO I hardcode the number of pots here, should be dependant on the board?
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
ui->patchCalibration->setDisabled(true);
}
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
ui->patchHardwareSettings->setDisabled(true);
}
}
else {
ui->profileLabel->hide();
}
ui->burnButton->setEnabled(true);
}
else {
ui->profileLabel->hide();
ui->patchCalibration->hide();
ui->patchHardwareSettings->hide();
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
void FlashEEpromDialog::on_eepromLoad_clicked()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
if (!filename.isEmpty()) {
eepromFilename = filename;
updateUI();
}
}
int FlashEEpromDialog::getEEpromVersion(const QString &filename)
{
int result = -1;
int eeprom_size = 0;
if (filename.isEmpty()) {
return -1;
}
QFile file(filename);
if (!file.exists()) {
QMessageBox::warning(this, tr("Error"), tr("Unable to find file %1!").arg(filename));
return -1;
}
QByteArray eeprom(EESIZE_MAX, 0);
int fileType = getFileType(filename);
#if 0
if (fileType==FILE_TYPE_XML) {
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
return -1;
}
QTextStream inputStream(&file);
XmlInterface(inputStream).load(testData);
}
else
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) {
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::warning(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
return -1;
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if (xmlOK) {
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
if (!errors.test(ALL_OK)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
}
else {
result = radioData->generalSettings.version;
}
delete radioData;
return result;
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
QString hline = inputStream.readLine();
if (hline!=EEPE_EEPROM_FILE_HEADER) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
return -1;
}
}
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_MAX);
}
else if (fileType==FILE_TYPE_BIN) { //read binary
eeprom_size = file.size();
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
QMessageBox::warning(this, tr("Error"), tr("Error opening file %1:\n%2.").arg(filename).arg(file.errorString()));
return -1;
}
int len = file.read(eeprom.data(), eeprom_size);
if (len != eeprom_size) {
QMessageBox::warning(this, tr("Error"), tr("Error reading file %1:\n%2.").arg(filename).arg(file.errorString()));
return -1;
}
}
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
}
else {
result = radioData->generalSettings.version;
}
delete radioData;
return result;
}
bool FlashEEpromDialog::patchCalibration()
{
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int8_t txVoltageCalibration=(int8_t) g.profile[g.id()].txVoltageCalibration();
int8_t txCurrentCalibration=(int8_t) g.profile[g.id()].txCurrentCalibration();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
QString Byte;
int16_t byte16;
bool ok;
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
Byte=calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData->generalSettings.calibMid[i]=byte16;
Byte=calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData->generalSettings.calibSpanNeg[i]=byte16;
Byte=calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData->generalSettings.calibSpanPos[i]=byte16;
}
for (int i=0; i<4; i++) {
Byte = trainercalib.mid(i*4,4);
byte16 = (int16_t)Byte.toInt(&ok,16);
if (ok) {
radioData->generalSettings.trainer.calib[i] = byte16;
}
}
radioData->generalSettings.txCurrentCalibration = txCurrentCalibration;
radioData->generalSettings.txVoltageCalibration = txVoltageCalibration;
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
return true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
return false;
}
}
bool FlashEEpromDialog::patchHardwareSettings()
{
QString DisplaySet = g.profile[g.id()].display();
QString BeeperSet = g.profile[g.id()].beeper();
QString HapticSet = g.profile[g.id()].haptic();
QString SpeakerSet = g.profile[g.id()].speaker();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
radioData->generalSettings.vBatWarn = vBatWarn;
radioData->generalSettings.stickMode = GSStickMode;
uint8_t byte8u;
int8_t byte8;
bool ok;
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
if (ok) radioData->generalSettings.optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.contrast=byte8u;
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.backlightBright=byte8u;
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.beeperMode=(GeneralSettings::BeeperMode)byte8u;
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
if (ok) radioData->generalSettings.beeperLength=byte8;
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8u;
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.hapticStrength=byte8u;
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
if (ok) radioData->generalSettings.hapticLength=byte8;
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.speakerMode=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.speakerPitch=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok) radioData->generalSettings.speakerVolume=byte8u;
return true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
return false;
}
}
void FlashEEpromDialog::on_burnButton_clicked()
{
// patch the eeprom if needed
bool patch = false;
if (ui->patchCalibration->isChecked()) {
patch |= patchCalibration();
}
if (ui->patchHardwareSettings->isChecked()) {
patch |= patchHardwareSettings();
}
QString filename = eepromFilename;
if (patch) {
QString filename = generateProcessUniqueTempFileName("temp.bin");
QFile file(filename);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = GetEepromInterface()->save(eeprom, *radioData, GetCurrentFirmware()->getVariantNumber());
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"), tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
return;
}
if (!file.open(QIODevice::WriteOnly)) {
QMessageBox::warning(this, tr("Error"), tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
return;
}
QTextStream outputStream(&file);
long result = file.write((char*)eeprom, eeprom_size);
if (result != eeprom_size) {
QMessageBox::warning(this, tr("Error"), tr("Error writing file %1:\n%2.").arg(filename).arg(file.errorString()));
return;
}
}
close();
ProgressDialog progressDialog(this, tr("Write Models and Settings to Radio"), CompanionIcon("write_eeprom.png"));
// backup previous EEPROM if requested
QString backupFilename;
QString backupPath;
if (ui->backupBeforeWrite->isChecked()) {
backupPath = g.profile[g.id()].pBackupDir();
if (backupPath.isEmpty()) {
backupPath=g.backupDir();
}
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
}
else if (ui->checkFirmwareCompatibility->isChecked()) {
backupFilename = generateProcessUniqueTempFileName("eeprom.bin");
}
if (!backupFilename.isEmpty()) {
if (!readEeprom(backupFilename, progressDialog.progress())) {
return;
}
}
// check EEPROM compatibility if requested
if (ui->checkFirmwareCompatibility->isChecked()) {
int eepromVersion = getEEpromVersion(filename);
QString firmwareFilename = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmware(firmwareFilename, progressDialog.progress()))
return;
QString compatEEprom = generateProcessUniqueTempFileName("compat.bin");
if (convertEEprom(filename, compatEEprom, firmwareFilename)) {
int compatVersion = getEEpromVersion(compatEEprom);
if ((compatVersion / 100) != (eepromVersion / 100)) {
QMessageBox::warning(this, tr("Warning"), tr("The radio firmware belongs to another product family, check file and preferences!"));
return;
}
else if (compatVersion < eepromVersion) {
QMessageBox::warning(this, tr("Warning"), tr("The radio firmware is outdated, please upgrade!"));
return;
}
filename = compatEEprom;
}
else if (QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?"), QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) {
return;
}
qunlink(firmwareFilename);
}
// and write...
writeEeprom(filename, progressDialog.progress());
progressDialog.exec();
}
void FlashEEpromDialog::on_cancelButton_clicked()
{
close();
}
void FlashEEpromDialog::shrink()
{
resize(0, 0);
}
-46
View File
@@ -1,46 +0,0 @@
#ifndef FLASHEEPROMDIALOG_H_
#define FLASHEEPROMDIALOG_H_
#include <QtWidgets>
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
namespace Ui
{
class FlashEEpromDialog;
}
class RadioData;
class FlashEEpromDialog : public QDialog
{
Q_OBJECT
public:
explicit FlashEEpromDialog(QWidget *parent, const QString &fileName="");
~FlashEEpromDialog();
private slots:
void on_eepromLoad_clicked();
void on_burnButton_clicked();
void on_cancelButton_clicked();
void shrink();
protected:
void updateUI();
bool isValidEEprom(const QString &filename);
int getEEpromVersion(const QString &filename);
bool patchCalibration();
bool patchHardwareSettings();
private:
Ui::FlashEEpromDialog *ui;
QString eepromFilename;
RadioData *radioData;
};
#endif // FLASHEEPROMDIALOG_H_
-198
View File
@@ -1,198 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FlashEEpromDialog</class>
<widget class="QDialog" name="FlashEEpromDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>399</width>
<height>201</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Write Models and Settings to Radio</string>
</property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/themes/classic/16/write_eeprom.png</normaloff>:/themes/classic/16/write_eeprom.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="filanameLayout">
<item>
<widget class="QLineEdit" name="eepromFilename">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="eepromLoad">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Load...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="profileLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Current Profile</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkFirmwareCompatibility">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
</property>
<property name="text">
<string>Check Firmware compatibility</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="backupBeforeWrite">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Saves a dated copy of your eeprom to the backup folder you specified in the Companion settings before writing the current model to the radio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Backup before Write</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="patchCalibration">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Modify calibration parameters using settings from current profile&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Patch calibration setting from profile</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="patchHardwareSettings">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Modify HW parameters using settings from current profile&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Patch HW settings from profile</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="buttonsLayout">
<item>
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="burnButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Write to TX</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>burnButton</tabstop>
<tabstop>eepromFilename</tabstop>
<tabstop>eepromLoad</tabstop>
<tabstop>cancelButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
-318
View File
@@ -1,318 +0,0 @@
#include "flashfirmwaredialog.h"
#include "ui_flashfirmwaredialog.h"
#include "appdata.h"
#include "converteeprom.h"
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include "process_flash.h"
#include "helpers.h"
#include "hexinterface.h"
#include "progressdialog.h"
#include "radiointerface.h"
#include "progresswidget.h"
#include "splashlibrarydialog.h"
#if defined WIN32 || !defined __GNUC__
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#endif
FlashFirmwareDialog::FlashFirmwareDialog(QWidget *parent):
QDialog(parent),
ui(new Ui::FlashFirmwareDialog),
fwName(g.profile[g.id()].fwName())
{
ui->setupUi(this);
if (!g.profile[g.id()].splashFile().isEmpty()){
imageSource = PROFILE;
imageFile = g.profile[g.id()].splashFile();
ui->useProfileSplash->setChecked(true);
}
else {
imageSource = FIRMWARE;
imageFile = "";
ui->useProfileSplash->setDisabled(true);
}
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
// No backup on Taranis ... could be done if in massstorage
ui->backupEEprom->hide();
ui->backupEEprom->setCheckState(Qt::Unchecked);
}
else {
ui->backupEEprom->setCheckState(g.backupOnFlash() ? Qt::Checked : Qt::Unchecked);
}
QString backupPath = g.profile[g.id()].pBackupDir();
if (backupPath.isEmpty()) {
backupPath=g.backupDir();
}
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
ui->backupEEprom->setEnabled(false);
}
ui->checkHardwareCompatibility->setChecked(g.checkHardwareCompatibility());
updateUI();
resize(0, 0); // TODO needed?
}
FlashFirmwareDialog::~FlashFirmwareDialog()
{
delete ui;
}
void FlashFirmwareDialog::updateUI()
{
ui->firmwareFilename->setText(fwName);
ui->burnButton->setEnabled(QFile(fwName).exists());
FirmwareInterface firmware(fwName);
if (firmware.isValid()) {
ui->firmwareInfoFrame->show();
ui->date->setText(firmware.getDate() + " " + firmware.getTime());
ui->version->setText(firmware.getVersion());
ui->variant->setText(firmware.getEEpromId());
ui->date->setEnabled(true);
ui->version->setEnabled(true);
ui->variant->setEnabled(true);
if (firmware.hasSplash()) {
ui->splashFrame->show();
ui->splash->setFixedSize(firmware.getSplashWidth(), firmware.getSplashHeight());
}
else {
ui->splashFrame->hide();
}
}
else {
imageSource = FIRMWARE;
ui->firmwareInfoFrame->hide();
ui->splashFrame->hide();
}
QImage image;
switch(imageSource) {
case FIRMWARE:
ui->useFirmwareSplash->setChecked(true);
image = firmware.getSplash();
break;
case PROFILE:
ui->useProfileSplash->setChecked(true);
image.load(g.profile[g.id()].splashFile());
break;
case LIBRARY:
ui->useLibrarySplash->setChecked(true);
image.load(imageFile);
break;
case EXTERNAL:
ui->useExternalSplash->setChecked(true);
image.load(imageFile);
break;
}
if (!image.isNull()) {
ui->splash->setPixmap(makePixMap(image, g.profile[g.id()].fwType()));
}
}
void FlashFirmwareDialog::on_firmwareLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) {
fwName = fileName;
if (!fwName.isEmpty() && !FirmwareInterface(fwName).isValid()) {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fwName));
}
updateUI();
}
}
void FlashFirmwareDialog::on_useFirmwareSplash_clicked()
{
FirmwareInterface firmware(fwName);
if (!firmware.isValid()) {
QMessageBox::warning(this, tr("Error"), tr( "The firmware file is not valid." ));
}
else if (!firmware.hasSplash()) {
QMessageBox::warning(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
}
else {
imageSource = FIRMWARE;
}
updateUI();
}
void FlashFirmwareDialog::on_useProfileSplash_clicked()
{
QString fileName = g.profile[g.id()].splashFile();
if (!fileName.isEmpty()) {
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
}
else {
imageSource = PROFILE;
}
}
updateUI();
}
void FlashFirmwareDialog::on_useExternalSplash_clicked()
{
QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
}
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()){
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
}
else{
imageSource = EXTERNAL;
imageFile = fileName;
}
}
updateUI();
}
void FlashFirmwareDialog::on_useLibrarySplash_clicked()
{
QString fileName;
SplashLibraryDialog *ld = new SplashLibraryDialog(this, &fileName);
ld->exec();
if (!fileName.isEmpty()) {
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
}
else {
imageSource = LIBRARY;
imageFile = fileName;
}
}
updateUI();
}
void FlashFirmwareDialog::on_burnButton_clicked()
{
g.flashDir(QFileInfo(fwName).dir().absolutePath());
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
g.backupOnFlash(ui->backupEEprom->isChecked());
qDebug() << "FlashFirmwareDialog: flashing" << fwName;
if (imageSource != FIRMWARE) {
// load the splash image
const QPixmap * pixmap = ui->splash->pixmap();
QImage image;
if (pixmap) {
image = pixmap->toImage().scaled(ui->splash->width(), ui->splash->height());
}
if (image.isNull()) {
QMessageBox::critical(this, tr("Warning"), tr("Splash image not found"));
return;
}
// write the customized firmware
QString tempFile;
if (getFileType(fwName) == FILE_TYPE_HEX)
tempFile = generateProcessUniqueTempFileName("flash.hex");
else
tempFile = generateProcessUniqueTempFileName("flash.bin");
qDebug() << "FlashFirmwareDialog: patching" << fwName << "with custom splash screen and saving to" << tempFile;
FirmwareInterface firmware(fwName);
firmware.setSplash(image);
if (firmware.save(tempFile) <= 0) {
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
return;
}
startFlash(tempFile);
}
else {
startFlash(fwName);
}
}
void FlashFirmwareDialog::on_cancelButton_clicked()
{
close();
}
void FlashFirmwareDialog::shrink()
{
resize(0, 0);
}
void FlashFirmwareDialog::startFlash(const QString &filename)
{
bool backup = g.backupOnFlash();
close();
ProgressDialog progressDialog(this, tr("Write Firmware to Radio"), CompanionIcon("write_flash.png"));
// check hardware compatibility if requested
if (g.checkHardwareCompatibility()) {
QString tempFirmware = generateProcessUniqueTempFileName("flash-check.bin");
if (!readFirmware(tempFirmware, progressDialog.progress())) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
return;
}
FirmwareInterface previousFirmware(tempFirmware);
qunlink(tempFirmware);
FirmwareInterface newFirmware(filename);
qDebug() << "startFlash: checking firmware compatibility between " << tempFirmware << "and" << filename;
if (!newFirmware.isHardwareCompatible(previousFirmware)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
if (isTempFileName(filename)) {
qDebug() << "startFlash: removing temporary file" << filename;
qunlink(filename);
}
return;
}
}
// backup if requested
bool result = true;
QString backupFilename;
QString backupPath;
if (backup) {
backupPath = g.profile[g.id()].pBackupDir();
if (backupPath.isEmpty()) {
backupPath=g.backupDir();
}
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
result = readEeprom(backupFilename, progressDialog.progress());
sleep(2);
}
// flash
result = (result && writeFirmware(filename, progressDialog.progress()));
// restore if backup requested
if (backup && result) {
sleep(2);
QString restoreFilename = generateProcessUniqueTempFileName("restore.bin");
if (!convertEEprom(backupFilename, restoreFilename, filename)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFilename = backupFilename;
}
if (!writeEeprom(restoreFilename, progressDialog.progress())) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFilename));
}
}
progressDialog.progress()->setInfo(tr("Flashing done"));
progressDialog.exec();
if (isTempFileName(filename)) {
qDebug() << "startFlash: removing temporary file" << filename;
qunlink(filename);
}
}
-55
View File
@@ -1,55 +0,0 @@
#ifndef FLASH_FIRMWARE_DIALOG_H
#define FLASH_FIRMWARE_DIALOG_H
#include <QtWidgets>
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include "xmlinterface.h"
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
namespace Ui
{
class FlashFirmwareDialog;
}
class FlashFirmwareDialog : public QDialog
{
Q_OBJECT
public:
FlashFirmwareDialog(QWidget *parent = 0);
~FlashFirmwareDialog();
private slots:
void on_firmwareLoad_clicked();
void on_burnButton_clicked();
void on_cancelButton_clicked();
void on_useProfileSplash_clicked();
void on_useFirmwareSplash_clicked();
void on_useLibrarySplash_clicked();
void on_useExternalSplash_clicked();
void shrink();
protected:
void updateUI();
void startFlash(const QString &filename);
private:
Ui::FlashFirmwareDialog *ui;
QString fwName;
RadioData radioData;
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, EXTERNAL};
ImageSource imageSource;
QString imageFile;
};
#endif // FLASH_FIRMWARE_DIALOG_H

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