Compare commits

...

2400 Commits

Author SHA1 Message Date
bsongis e85242e08d Release notes forgotten! 2014-06-12 12:14:50 +02:00
Andre Bernet 7ea2eb6259 Smaller analog delay margin 2014-06-12 11:23:02 +02:00
bsongis 2cd66cbc65 Fixes #1223 2014-06-12 10:34:57 +02:00
Bertrand Songis 06064b6da2 Update DONATIONS.txt 2014-06-12 07:12:08 +02:00
Bertrand Songis 809cb69b4f Update DONATIONS.txt 2014-06-11 22:41:25 +02:00
Bertrand Songis 6f8e439154 Merge pull request #1255 from andyjenkinson/next
Mac companion sound fix (partial for #1212)
2014-06-11 22:28:22 +02:00
bsongis 4c81e57134 Remaining trace 2014-06-11 21:40:36 +02:00
bsongis ddd2d19c0c Companion: wrong import of inputs when profile is Taranis and EEPROM is
9X
2014-06-11 21:40:17 +02:00
bsongis eeb9ee8aa2 A3 and A4 V2 value bug in Logical Switches (Companion) 2014-06-11 21:32:48 +02:00
bsongis 30b660da17 Offset in Taranis Inputs was missing 2014-06-11 20:06:47 +02:00
Andy Jenkinson 4cd881d746 Merge remote-tracking branch 'upstream/next' into next 2014-06-11 17:36:03 +01:00
bsongis ea731eae37 Channels limits go up to 150% when extended limits are enabled 2014-06-11 16:59:29 +02:00
Andy Jenkinson 5d77b8bf21 Merge remote-tracking branch 'upstream/next' into next 2014-06-11 15:44:27 +01:00
Bertrand Songis 621639ad0b Merge pull request #1253 from opentx/mhotar/cz_translations
Timer labels extended to 4 characters in CZ to be able to describe T-Tra...
2014-06-11 16:30:27 +02:00
Kjell Kernen fdc95bbf23 Included some nice start Taranis start screens by Scott Page. 2014-06-11 16:28:53 +02:00
mhotar b182d98da0 Timer labels extended to 4 characters in CZ to be able to describe T-Trace driving timers and THR alarm too. 2014-06-11 16:24:18 +02:00
Andre Bernet e49a15bf07 French translations 2014-06-11 16:13:59 +02:00
bsongis 3cdb2b549b French last translation 2014-06-11 16:11:00 +02:00
bsongis 69276bffcc Cleaning work in Companion 2014-06-11 16:11:00 +02:00
Romolo Manfredini b0afbb692f Merge origin/next into next 2014-06-11 15:13:41 +02:00
Romolo Manfredini 0ab85725e0 Italian translation (almost finished) 2014-06-11 15:12:17 +02:00
bsongis e8e025fdb0 Fixes #1252 2014-06-11 15:06:39 +02:00
bsongis 7d29fed9a5 2.0.2 preparation 2014-06-11 14:51:00 +02:00
bsongis 78ef42755b Fixes #1251 2014-06-11 14:46:50 +02:00
Bertrand Songis 2a9429d183 Update DONATIONS.txt 2014-06-11 14:19:50 +02:00
Kjell Kernen 4773ba469f Swedish OpenTX translation for 2.0.2 2014-06-11 14:13:34 +02:00
Kjell Kernen 6d1b379f53 Swedish companion translation (missed in last commit) 2014-06-11 14:03:23 +02:00
Kjell Kernen 54cbc46929 Swedish companion translation + Fixed spelling error. 2014-06-11 14:02:56 +02:00
Bertrand Songis 1fd4dbb1a9 Update DONATIONS.txt 2014-06-11 13:02:24 +02:00
Bertrand Songis ecd871fe34 Update DONATIONS.txt 2014-06-11 12:17:02 +02:00
bsongis 5c4b2ebd90 EEPROM Backup/Restore problem on 9X128 (variant not used correctly) 2014-06-11 11:58:57 +02:00
bsongis 3fe75fac59 Fixes #1151 (applied the same trick to the GeneralEdit window) 2014-06-11 09:30:52 +02:00
bsongis 43a7434ae5 Fixes #1247 2014-06-11 09:23:11 +02:00
Bertrand Songis 134a9c2472 Update DONATIONS.txt 2014-06-11 09:16:10 +02:00
bsongis 0f495a6fd9 Fixes #1248 2014-06-11 08:21:55 +02:00
Bertrand Songis 5d037327d4 Update DONATIONS.txt 2014-06-11 08:03:56 +02:00
bsongis ebbe2635b7 Fixes #1249 2014-06-11 07:43:00 +02:00
Bertrand Songis cab9615fa8 Update DONATIONS.txt 2014-06-11 07:28:51 +02:00
Bertrand Songis 9b6d45bba3 Update DONATIONS.txt 2014-06-11 07:11:05 +02:00
bsongis 7ddb29ca74 RxBatt alarms files/tones removed 2014-06-10 23:42:46 +02:00
Andre Bernet 87e1c4f96d Missing , 2014-06-10 23:12:24 +02:00
Bertrand Songis 22e625baad Update DONATIONS.txt 2014-06-10 22:32:03 +02:00
Bertrand Songis b37f573226 Update DONATIONS.txt 2014-06-10 19:10:22 +02:00
bsongis 296264d8b4 Fixes #1245 2014-06-10 18:12:41 +02:00
bsongis 2ba86d8cb3 Fixes #1222 2014-06-10 18:03:54 +02:00
Andy Jenkinson 8e5a52879a Partial solution to #1212 (needs testing on other platforms) 2014-06-10 16:14:26 +01:00
bsongis e4d03b8c70 Fixes #1205 - Delay only applied to Play family function, with a
configurable delay, between 0 and 300ms (default is 150ms).
2014-06-10 16:19:44 +02:00
bsongis 831cd81320 #1151 - Done the same trick on the sliders 2014-06-10 16:17:55 +02:00
bsongis b2d8c76fc1 Fixes #1243 2014-06-10 15:40:20 +02:00
bsongis 3392879940 Fixes #1243 2014-06-10 15:29:57 +02:00
Damjan Adamic d767b62d01 Added A3 and A4 simulator initialization values. 2014-06-10 15:24:55 +02:00
bsongis 2ea687099a Fixes #1192 - Tests needed! 2014-06-10 15:21:25 +02:00
bsongis 81c4b61322 Fixes #1151 2014-06-10 15:12:30 +02:00
bsongis 0610c2c79a Fixes #1194 2014-06-10 15:01:04 +02:00
bsongis e50d9c0edf Fixes #1241 - Revert "Bootloader now accessible with left OR right trim inwards"
This reverts commit 54447a45a0.
2014-06-10 14:53:24 +02:00
bsongis 72dc022dc9 Fixes #1182 - RxBatt removed 2014-06-10 14:51:16 +02:00
bsongis 123d5c1be8 Fixes #1242 2014-06-10 14:36:35 +02:00
bsongis 9be2755d91 Fixes #1235 2014-06-10 11:36:10 +02:00
bsongis 4305935fd4 Cosmetics 2014-06-10 11:36:10 +02:00
Bertrand Songis 3dff1fdac7 Update DONATIONS.txt 2014-06-10 09:31:13 +02:00
Andre Bernet 0281a5bb22 Had forgotten to bump bootloader version up 2014-06-10 09:19:34 +02:00
bsongis cc0552d1a2 Fixes #1227 - Constant INSTANT_TRIM_MARGIN set to 1%, needs to be
checked and adjusted!
2014-06-10 09:09:27 +02:00
bsongis f4ee34dcc9 Fixes #1232 2014-06-10 08:36:52 +02:00
bsongis 9791509ec1 Fixes #1219 2014-06-10 08:15:31 +02:00
Bertrand Songis bb71cd35f8 Update DONATIONS.txt 2014-06-10 06:55:26 +02:00
bsongis d93b63d85c Fixes #1237 2014-06-09 23:06:59 +02:00
bsongis 2706a3d81c #1237 - Curves tab initialization bug (all boards except Taranis) 2014-06-09 22:52:56 +02:00
Bertrand Songis 73b0090840 Update DONATIONS.txt 2014-06-09 22:52:39 +02:00
Andre Bernet 2b3242f863 Compilation error 2014-06-09 22:41:17 +02:00
Andre Bernet 9f9a561c82 Compilation error 2014-06-09 22:29:39 +02:00
Andre Bernet ba10ec68b6 Fix flickering backlight in Plus bootloader 2014-06-09 22:24:21 +02:00
Bertrand Songis 0b5820bdd6 Merge pull request #1231 from opentx/dvogonen/comapnion_windows_voice_play_problems
Partial fix for 1212 - Only Windows
2014-06-09 21:40:49 +02:00
Bertrand Songis bfbe0046ab Update DONATIONS.txt 2014-06-09 21:34:53 +02:00
Andre Bernet 71ba0328bd LS main view display on stock (Fix #1239) 2014-06-09 20:07:38 +02:00
Andre Bernet df80aa00c2 Fix #1234 2014-06-09 19:13:02 +02:00
Romolo Manfredini 3c181fc474 Other fixes in Italian translations (to be still finished) 2014-06-09 16:57:10 +02:00
Romolo Manfredini e62a8e8ba7 further fix in Italian translations 2014-06-09 15:45:34 +02:00
Romolo Manfredini eb69444cbf further fix in Italian translations 2014-06-09 15:21:41 +02:00
Kjell Kernen f083b6f45a Partial fix for 1212 - Only Windows 2014-06-09 14:30:14 +02:00
Bertrand Songis 13de131fe4 Merge pull request #1220 from opentx/projectkk2glider/menu_order_change
Changed order of context menu for logical switches and custom functions....
2014-06-09 11:42:56 +02:00
bsongis 4c6c9fdb20 Simu Gruvin9x compilation failure 2014-06-09 11:32:34 +02:00
bsongis 9cb4d5da1f Sky9x Error + Warning removed 2014-06-09 11:14:57 +02:00
bsongis ce22ea22b4 Simu compilation errors 2014-06-09 11:05:55 +02:00
Bertrand Songis aa661ced46 Jenkins test 2014-06-09 10:43:16 +02:00
Bertrand Songis 1e56c9ba14 Jenkins test 2014-06-09 10:41:54 +02:00
Bertrand Songis e65b9d825b Jenkins test 2014-06-09 09:56:38 +02:00
Bertrand Songis 2561e53696 Update DONATIONS.txt 2014-06-09 00:00:13 +02:00
Bertrand Songis 2665c2318f Update DONATIONS.txt 2014-06-08 22:53:46 +02:00
Damjan Adamic 5a0f154876 Fixes #1215 2014-06-08 19:31:02 +02:00
Damjan Adamic 15d89d638c Hide gvars for FM>0 if tx does not support per flight mode gvars, issue #1195 2014-06-08 18:58:53 +02:00
Damjan Adamic 087c9f0202 Gvar value restored, issue #1195 2014-06-08 18:26:39 +02:00
Damjan Adamic 0ae00dddf8 Fixes #1204 2014-06-08 18:07:14 +02:00
Damjan Adamic f865bdf785 Changed order of context menu for logical switches and custom functions. Before this change the Delete option was first and it was too easy to inadvertently delete an item. 2014-06-08 17:18:50 +02:00
Damjan Adamic 04897885dd Fixes #1209 2014-06-08 17:11:14 +02:00
Damjan Adamic 2248c84b8f Added error string to output, to help resolving issue #1217 2014-06-08 16:33:34 +02:00
Bertrand Songis 5f0f5de111 Merge pull request #1211 from andyjenkinson/next
Updates for Mac - needs testing on other platforms
2014-06-08 11:05:48 +02:00
Bertrand Songis b93036c81d Update DONATIONS.txt 2014-06-08 10:58:18 +02:00
Andy Jenkinson 6bfc4f7986 Fixes #1216 2014-06-08 09:10:25 +01:00
Andy Jenkinson 34de0aa01a Revert "Radio buttons in the wizard were too close together" and do this another way via Q_FOREACH
This reverts commit 73f2e99d7d.
2014-06-08 09:07:16 +01:00
Bertrand Songis b8ca14c921 Update DONATIONS.txt 2014-06-08 08:04:23 +02:00
Bertrand Songis 5ec77c6dae Update DONATIONS.txt 2014-06-08 08:02:53 +02:00
Andy Jenkinson f482b895fb Enabled Phonon for Mac (sounds) 2014-06-08 01:26:19 +01:00
Andy Jenkinson 73f2e99d7d Radio buttons in the wizard were too close together 2014-06-08 00:22:27 +01:00
Andy Jenkinson 49b821b04d Merge remote-tracking branch 'upstream/next' into next 2014-06-07 20:43:20 +01:00
Bertrand Songis 17bfe1544f Merge pull request #1208 from andyjenkinson/next
Wizard window style was not set for Mac. Fix for issue #1206
2014-06-07 21:42:35 +02:00
Andy Jenkinson 7a7b4c047e Merge remote-tracking branch 'upstream/next' into next
Testing mouse wheel focus
2014-06-07 20:13:32 +01:00
bsongis 7912b79d7e #1151 - Another possibility which has my preference, what do you think? 2014-06-07 21:00:59 +02:00
Andrew Jenkinson 83d8834fe4 Wizard window style was not set for Mac. This fixes opentx issue #1206 2014-06-07 19:58:58 +01:00
bsongis bf9fc6dd98 The delay on switches was * 10 2014-06-07 20:27:00 +02:00
Bertrand Songis 6edc28b4ba Update DONATIONS.txt 2014-06-07 20:18:06 +02:00
Andre Bernet e0deb3b665 Hide S3 center beep checkbox for !Plus 2014-06-07 17:13:27 +02:00
Andre Bernet 8f3060f99c Pot startup check checkboxes were always hidden 2014-06-07 17:08:30 +02:00
Michele 9e7a52b952 Merge pull request #1202 from opentx/MicheleVilla/IT_Translation_Firmware
Update it.h.txt
2014-06-07 12:36:09 +02:00
Michele 3b8e64fe64 Update it.h.txt
Translation of new option
2014-06-07 12:35:01 +02:00
bsongis 479c070896 Fixes #1199 2014-06-07 12:33:58 +02:00
Andre Bernet 9f75be0dc4 IT translation fix (Fixes #1201) 2014-06-07 12:01:42 +02:00
bsongis d090175b2a Compilation failure on sky9x 2014-06-07 11:46:34 +02:00
bsongis 93d6788605 Fixes #1200 - Needs tests! 2014-06-07 11:07:00 +02:00
Bertrand Songis 5de9f6c4a4 Update DONATIONS.txt 2014-06-07 11:03:18 +02:00
Bertrand Songis 9785720bf6 Update DONATIONS.txt 2014-06-07 07:40:27 +02:00
bsongis 626f4c5784 Issue #1151 - I just added a workaround on the CustomFunctions tab only.
If feedback is good, it will be easy to call disableMouseScrolling() on
other tabs.
2014-06-06 23:25:32 +02:00
Bertrand Songis c1e15d0212 Update DONATIONS.txt 2014-06-06 22:40:45 +02:00
bsongis a19fff0998 Buffer overflow in Companion Wizard 2014-06-06 22:36:00 +02:00
bsongis 9a502461df Fixes #1198 - Needs to be tested before 2.0.2 2014-06-06 22:36:00 +02:00
Bertrand Songis bc484879a5 Update DONATIONS.txt 2014-06-06 20:17:53 +02:00
Bertrand Songis b070f56838 Update DONATIONS.txt 2014-06-06 16:54:15 +02:00
Bertrand Songis dd874427b8 Companion on max fix 2014-06-05 21:35:33 +02:00
bsongis 902a69323a Issue #1128 - Automatic non regression test added 2014-06-06 15:22:13 +02:00
bsongis a6c39e83b1 #1188 - HDG not converted when units are imperial (it was done in audio,
not in
lcd)
2014-06-06 15:07:22 +02:00
bsongis 6511ae173d Fixes #1191 2014-06-06 11:54:13 +02:00
Bertrand Songis 3d4d6ba313 Update DONATIONS.txt 2014-06-06 11:32:55 +02:00
Bertrand Songis ce1ff9ea14 Update DONATIONS.txt 2014-06-06 07:56:42 +02:00
Bertrand Songis 38cf9536e1 Update view_telemetry.cpp 2014-06-05 22:18:24 +02:00
bsongis 2683194f64 Compilation error 2014-06-05 22:05:07 +02:00
Bertrand Songis 010d6691b9 Update DONATIONS.txt 2014-06-05 21:57:26 +02:00
Andre Bernet 3c6e21d945 Release notes updated 2014-06-05 21:52:52 +02:00
bsongis dcde1073b0 [Stock 9x] Problem on logical switches used as sources (both display and
evaluation)
2014-06-05 21:41:05 +02:00
bsongis fd55a40d26 Revert "Warning removed"
This reverts commit a2350c6d92.
2014-06-05 19:48:09 +02:00
bsongis a2350c6d92 Warning removed 2014-06-05 19:32:30 +02:00
bsongis 35e5faa8ad Fixes #1186 2014-06-05 19:32:29 +02:00
Bertrand Songis 77e9130c37 Merge pull request #1187 from opentx/MicheleVilla/IT_translation
Further changes in Italian translation
2014-06-05 19:06:38 +02:00
Bertrand 9cc0b8b608 OSX compilation failures 2014-06-05 19:49:33 +02:00
Michele 96953c7987 Further changes in Italian translation 2014-06-05 19:02:55 +02:00
Bertrand Songis 5b277378c6 Merge pull request #1185 from hrenz/patch-2
Update companion_de.ts      only 3 Lines  for better German
2014-06-05 17:11:53 +02:00
hrenz 2714017fe8 Update companion_de.ts
3 lines corrections only
2014-06-05 17:03:42 +02:00
bsongis b747b03ac0 MAVLINK extension broken 2014-06-05 15:12:55 +02:00
bsongis 3ed37c1e79 Library 'common' introduced in Companion to avoid installing last CMake
on MAC. Reduces compilation time on all platforms (many files were
compiled 2 times)
2014-06-05 14:41:37 +02:00
bsongis b9b2cb46eb Release notes updated 2014-06-05 14:41:37 +02:00
Kjell Kernen 832c891e3e Swdish Companion Translation 2014-06-05 12:36:52 +02:00
bsongis 86a8e6a128 Fixes #1157 2014-06-05 12:05:53 +02:00
Bertrand Songis 30c28645da Update DONATIONS.txt 2014-06-05 11:27:49 +02:00
bsongis 01c0607aa8 Fixes #1184 2014-06-05 10:10:26 +02:00
bsongis 7a14c3592a Fixes #1183 2014-06-05 10:02:17 +02:00
bsongis e9b28898d0 OSX compilation errors fixed 2014-06-05 07:45:34 +02:00
bsongis 001585a194 Fixes #1181 2014-06-05 07:31:26 +02:00
Andre Bernet b22dca6be7 French translations 2014-06-05 00:14:27 +02:00
Andre Bernet e46523b08e All translations updated for new companion strings 2014-06-05 00:08:47 +02:00
bsongis a3f8e92c39 Release notes updated 2014-06-04 22:47:44 +02:00
bsongis 4cdd359405 Prevents a crash in Lua when the inputs/outputs count exceeds the
maximum allowed
2014-06-04 22:47:44 +02:00
Bertrand Songis 82aa8cc383 Update DONATIONS.txt 2014-06-04 22:25:49 +02:00
bsongis 85cb8b3dbd Wrong constant used for Lua inputs count 2014-06-04 22:22:22 +02:00
bsongis 0a5c3f42c5 Revert "Removed some unnecessary code"
This reverts commit 6261fbf317.
2014-06-04 21:22:43 +02:00
mhotar 8267ac2fc2 svg source 2014-06-04 20:46:32 +02:00
mhotar 6bbb416f83 elevons.png 2014-06-04 20:46:07 +02:00
Bertrand Songis 1478b8c9da Update DONATIONS.txt 2014-06-04 19:39:22 +02:00
Michele 3dddf353e4 Merge pull request #1180 from opentx/MicheVilla/Fix_It_translation
Update it.h.txt
2014-06-04 18:03:57 +02:00
Michele ecb1955750 Update it.h.txt
fix shift
2014-06-04 18:01:34 +02:00
Bertrand Songis c00c9e7e79 Update DONATIONS.txt 2014-06-04 17:18:58 +02:00
bsongis e9084e4d59 Cosmetics 2014-06-04 16:36:29 +02:00
Romolo Manfredini 016eafefab further fix in Italian translations 2014-06-04 16:30:18 +02:00
bsongis 7cdc42387b Strange strings numbers in Companion About Dialog 2014-06-04 16:27:13 +02:00
bsongis f09e1338f6 Cosmetics 2014-06-04 15:01:19 +02:00
bsongis 458e41744b 2.0.1 preparation 2014-06-04 14:19:48 +02:00
Bertrand Songis f276b8a9eb Merge pull request #1179 from opentx/MicheleVilla/IT_Firmware_Translation
Update it.h.txt
2014-06-04 14:18:18 +02:00
Michele 57d50f05cd Update it.h.txt 2014-06-04 14:05:12 +02:00
Kjell Kernen dd5889c6fc Martins images added to the multicopter wizard. The wizard is now finished and can be made available for upload. 2014-06-04 13:28:32 +02:00
Michele a4c400b62a Merge pull request #1178 from opentx/MicheleVilla/IT_Firmware_Translation
Update it.h.txt
2014-06-04 12:52:03 +02:00
Michele e7e6c9b75e Update it.h.txt
Some change in Italian translation
2014-06-04 12:43:51 +02:00
bsongis b54c5c2d2e Fix for #1176 improved 2014-06-04 12:28:31 +02:00
bsongis b3d61289e8 Fixes #1176 2014-06-04 12:10:51 +02:00
Bertrand Songis e0295d08da Update DONATIONS.txt 2014-06-04 11:54:19 +02:00
bsongis cf7984a3c5 Fixes #1146 2014-06-04 11:53:04 +02:00
Andre Bernet 41390af8a4 Sky9x was duplicated in firmware list! (#1176) 2014-06-04 11:46:49 +02:00
bsongis 5385a01b2e New parameter added in TELEMETRY screen to choose S.PORT or D protocol. 2014-06-04 11:26:39 +02:00
Andre Bernet 54447a45a0 Bootloader now accessible with left OR right trim inwards 2014-06-04 10:47:55 +02:00
Andre Bernet b593d871a6 Fixes #1175 (display part missing) 2014-06-04 10:37:19 +02:00
bsongis d18c6c9985 Fixes #1175 2014-06-04 10:08:40 +02:00
bsongis 64e84f1af9 Fixes #1173 2014-06-04 09:52:13 +02:00
bsongis 61923a9bec Fixes #1172 2014-06-04 09:02:05 +02:00
Bertrand Songis c8e0b85e7e Update DONATIONS.txt 2014-06-03 23:28:53 +02:00
mhotar 2170d2a129 wizard multirotor images 2014-06-03 22:34:18 +02:00
Bertrand Songis 7f4f7cee8b Update DONATIONS.txt 2014-06-03 21:48:11 +02:00
Kjell Kernen f2c9aa9494 Martin Hotar's name was wrong in the English version of the OpenTX About dialog. 2014-06-03 19:07:29 +02:00
Kjell Kernen 79b461eda8 Added multicopter wizard page to OpenTX lua wizard. The images are just place holders. 2014-06-03 18:53:56 +02:00
Romolo Manfredini becbb8cbb9 further fix in Italian translations 2014-06-03 16:44:23 +02:00
Romolo Manfredini ac98f6adaf Some fix in Italian translations 2014-06-03 15:48:26 +02:00
Bertrand Songis fe68ef4cd1 Update DONATIONS.txt 2014-06-03 14:29:39 +02:00
Bertrand Songis 0342ca9172 Update DONATIONS.txt 2014-06-03 13:31:37 +02:00
Andre Bernet d030561bf3 Contributorsdialog was writable 2014-06-03 11:49:00 +02:00
bsongis d21fcbf260 OpenTX Firmware release notes updated 2014-06-03 11:02:35 +02:00
bsongis 19818b6c07 Companion Release notes updated 2014-06-03 11:02:00 +02:00
bsongis 6b7cc60751 French translation fix 2014-06-03 10:38:23 +02:00
bsongis 00d3d3e20b Fixes #1167 2014-06-03 10:38:23 +02:00
bsongis 4a099a7161 Vario code moved to a separate file vario.cpp 2014-06-03 10:38:23 +02:00
Bertrand Songis df30dd9bb9 Update DONATIONS.txt 2014-06-03 08:17:56 +02:00
Bertrand Songis e44e87221f Update DONATIONS.txt 2014-06-03 07:00:06 +02:00
Bertrand Songis d4959dfeb0 Merge pull request #1169 from opentx/MicheleVilla/IT_C9X_Translation
Italian translation in progress
2014-06-02 23:14:07 +02:00
MicheleVilla ffe70d1eaa Italian translation in progress 2014-06-02 22:07:46 +02:00
Andre Bernet f40182d7f9 French translations 2014-06-02 21:32:36 +02:00
Andre Bernet 5d83772e13 More margin for multipos jitter 2014-06-02 21:32:19 +02:00
bsongis c721a16d65 6-pos multiswitches calibration bug fixed! 2014-06-02 20:17:27 +02:00
Bertrand Songis a257f6f784 Update DONATIONS.txt 2014-06-02 18:25:30 +02:00
bsongis 0b6bcb656a Some duplicated donators removed 2014-06-02 16:54:41 +02:00
bsongis abfbc75fed Last minute modification for 6-pos switch steps detection. Needs to be
tested again!
2014-06-02 16:18:58 +02:00
bsongis 8f7f308ead RSSI Tx masked on Companion for Taranis 2014-06-02 15:26:35 +02:00
bsongis fbb90ff5d5 No Center Beeps during calibration 2014-06-02 15:26:35 +02:00
Bertrand Songis 9b31bfd3ec Update DONATIONS.txt 2014-06-02 14:51:03 +02:00
mhotarxxx b98a9e0228 CZ translations 2014-06-02 13:59:48 +02:00
Bertrand Songis 08f72ae0f7 Update DONATIONS.txt 2014-06-02 13:58:20 +02:00
Andre Bernet 40b9b7f48c French translations 2014-06-02 12:32:31 +02:00
bsongis 7b6557852b 2.0.0 preparation! 2014-06-02 12:11:21 +02:00
bsongis 115f7884d3 Companion Copyright updated (OpenTX Team instead of commiter names) 2014-06-02 12:10:23 +02:00
Andre Bernet 9f9186b7a2 French translations 2014-06-02 12:01:48 +02:00
bsongis 0949049ad6 Orange/Red Alarms changed to Low Alarm/Critical Alarm 2014-06-02 12:01:48 +02:00
bsongis 7ff2e78155 S3 Pot Warning hidden on Taranis (not TaranisPlus) 2014-06-02 11:57:09 +02:00
bsongis 7ce3eb4460 Fixes #1168 2014-06-02 11:57:09 +02:00
Bertrand Songis bc6de2c70d Update DONATIONS.txt 2014-06-02 11:33:37 +02:00
Andre Bernet 1fe835e099 French translations 2014-06-02 11:30:17 +02:00
Andre Bernet 8418bfa4af French translations 2014-06-02 11:26:35 +02:00
Andre Bernet 3b441a7765 Sync text with other firmwares 2014-06-02 11:26:17 +02:00
bsongis 0ea3daa4c4 Bug found in Pots Warning (Auto mode) 2014-06-02 11:01:21 +02:00
Kjell Kernen 207fc721fa Swedish OpenTX translation update 2014-06-02 10:46:37 +02:00
bsongis 960527887d S3 masked on Taranis (not TaranisPlus) 2014-06-02 10:45:17 +02:00
bsongis addf396145 Cosmetics (alignment) 2014-06-02 10:45:16 +02:00
Bertrand Songis 7b26f6d7c6 Update DONATIONS.txt 2014-06-02 10:39:20 +02:00
Bertrand Songis dad8f29cac Update fr.h.txt 2014-06-02 10:14:03 +02:00
Kjell Kernen 2ed9570b9d Swedish Companion translation 2014-06-02 10:09:27 +02:00
Bertrand Songis 0b13b15a98 Update fr.h.txt 2014-06-02 10:08:50 +02:00
bsongis 14de1bb3f8 Kjell added to the list of contributors in the About dialog. Thanks
again!
2014-06-02 10:04:48 +02:00
Bertrand Songis b2058761f0 Update DONATIONS.txt 2014-06-02 07:44:01 +02:00
Bertrand Songis 756df02043 Update DONATIONS.txt 2014-06-02 07:10:28 +02:00
Bertrand Songis 44f4ed09fb Update DONATIONS.txt 2014-06-02 07:09:56 +02:00
bsongis 83378dd84b Italian translations fix (in templates names for 9x stock) 2014-06-01 22:56:30 +02:00
Bertrand Songis fdb756735c Merge pull request #1166 from opentx/MicheleVilla|_IT_Translation
Michele villa| it translation
2014-06-01 22:24:38 +02:00
Michele d45daae44f Update it.h.txt
Completed translation
2014-06-01 21:42:47 +02:00
bsongis 634c327ac6 Vario value accessible in Lua scripts using getValue("vario") 2014-06-01 18:17:52 +02:00
Bertrand Songis a5dea34415 Merge pull request #1165 from opentx/projectkk2glider/noexpo_showing_bug
Projectkk2glider/noexpo showing bug
2014-06-01 17:20:53 +02:00
Damjan Adamic 6d384759ae Removed MixesWithoutExpo capability. Added missing files for previous commit. 2014-06-01 16:13:06 +02:00
Damjan Adamic d641147ef0 The "No DR/Expo" was (after conversion from 215) showing in mixes for Taranis. Taranis does not have this setting. 2014-06-01 16:01:35 +02:00
Bertrand Songis 266c3ced04 Update DONATIONS.txt 2014-06-01 15:30:25 +02:00
Michele f54936d5d2 Update it.h.txt
99% completed
2014-06-01 11:16:59 +02:00
Bertrand Songis 03851b8014 Update DONATIONS.txt 2014-06-01 08:07:50 +02:00
bsongis a4577a9c5a 1.99.7 preparation 2014-05-31 22:36:33 +02:00
Bertrand Songis a5a9678fc5 Update DONATIONS.txt 2014-05-31 22:34:15 +02:00
Bertrand Songis f8798ee298 Update tts.py 2014-05-31 22:15:53 +02:00
bsongis 0a0d6a18b6 Fixes #1163 2014-05-31 20:45:17 +02:00
Bertrand Songis 148483819d Merge pull request #1161 from opentx/MicheleVilla/_IT_Translation
Michele villa/ it translation
2014-05-31 17:59:03 +02:00
Michele 0191b37d12 Update it.h.txt 2014-05-31 17:00:48 +02:00
Michele b54bb5a169 Update it.h.txt 2014-05-31 16:51:35 +02:00
bsongis 72dc69086c Companion can now read and write Firmware in massstorage mode. Big code
refactoring (code was duplicated in many locations) around read/write
firmware/eeprom/backups, who could do some more tests before next
release? Thanks in advance!
2014-05-31 16:22:45 +02:00
Bertrand Songis a02cdca62c Merge pull request #1160 from alexion4/next
Correct URL for Voice Download
2014-05-31 15:10:25 +02:00
alexion4 ba5fe50a66 Correct URL for Voice Download 2014-05-31 14:16:32 +02:00
Kjell Kernen 2774c781f1 German OpenTX translation 2014-05-31 11:51:37 +02:00
Kjell Kernen ee021008a5 Finish Companion translation 2014-05-31 11:51:37 +02:00
Kjell Kernen 2b82b2ef78 German Companion translation 2014-05-31 11:51:37 +02:00
Michele 82dbba2b69 Update it.h.txt
In progress.......
2014-05-31 11:31:24 +02:00
Michele 326a694d1d Update it.h.txt
in progress
Line 231 235 must be checked
2014-05-31 10:03:35 +02:00
bsongis 4acef445a3 Companion Vario Sources were not in line with the firmware 2014-05-31 08:16:13 +02:00
bsongis 2c3866b6ef 1.99.6 preparation 2014-05-30 22:39:48 +02:00
bsongis b10709f68b Lua metrics (duration and interval) added to the Debug screen 2014-05-30 22:37:12 +02:00
Michele f0ae596dc4 Update it.h.txt
Please check line 231 and 235
2014-05-30 19:14:09 +02:00
bsongis fc54178c8e Delta and Plane wizards now finished! 2014-05-30 16:20:57 +02:00
bsongis f94b4c743d RAM saving in the Lua interpreter 2014-05-30 16:20:26 +02:00
bsongis 950f651af9 BMP are read on the stack to avoid a malloc. Lua memory displayed when
pressing [Menu Long]
2014-05-30 16:14:54 +02:00
bsongis 687ddd8f4d New voice alarms for A3/A4/RxBatt 2014-05-30 15:09:34 +02:00
bsongis 259eafca69 RxBatt alarms can go up to 13.2V 2014-05-30 15:09:34 +02:00
Kjell Kernen a752135b10 Finish Companion translation. Nearly 100% complete. 2014-05-30 13:51:19 +02:00
bsongis 7414164b05 1.99.5 preparation 2014-05-30 10:49:11 +02:00
Bertrand Songis b05241adf6 Merge pull request #1155 from opentx/MicheleVilla/_IT_Translation
Michele villa/ it translation
2014-05-30 08:39:01 +02:00
Michele 5db234e346 Update it.h.txt 2014-05-30 08:10:06 +02:00
Michele 2680562170 Update it.h.txt 2014-05-30 08:07:39 +02:00
Bertrand Songis 114179f648 Update DONATIONS.txt 2014-05-29 22:08:26 +02:00
Bertrand Songis 4c1346c820 Update DONATIONS.txt 2014-05-29 22:05:48 +02:00
Michele 4bbb715fbe Update it.h.txt 2014-05-29 19:59:23 +02:00
Michele c601b1db37 Update it.h.txt 2014-05-29 18:42:58 +02:00
Bertrand Songis ae04c4f5cc Merge pull request #1150 from subt/next
Telemetry output to Taranis serial port
2014-05-29 15:17:33 +02:00
Sven Büttner 3849d3c00f Merge branch 'serial_output_fix' into next 2014-05-29 13:14:05 +02:00
Sven Büttner 3c92608e7f Re-added telemetry output to uart3 on Taranis 2014-05-29 13:10:15 +02:00
Bertrand Songis f2515b6b9f Merge pull request #1149 from opentx/driver33/PL_TR
translation pl
2014-05-29 09:46:58 +02:00
Jacek Drewniak 7a4af9de15 translation pl 2014-05-29 08:37:19 +02:00
Bertrand Songis 85f5584793 Merge pull request #1148 from opentx/mhotar/cz_translations
Mhotar/cz translations
2014-05-29 07:33:33 +02:00
bsongis 0963458d29 Plane Wizard flaps and brakes settings applied 2014-05-29 00:04:17 +02:00
bsongis e169bc7ed2 French translations 2014-05-28 23:54:57 +02:00
mhotarxxx ec7fc8ebf3 cz translations 2014-05-28 23:27:40 +02:00
bsongis 8c43ec47af Lua mixes setup fixes 2014-05-28 22:44:41 +02:00
bsongis 483e36e646 Version automatically appended to the firmware name. Is now calculated
BEFORE the user chooses a filename!
2014-05-28 15:12:23 +02:00
Kjell Kernen 9919ad026b Swedish OpenTX translation changes 2014-05-28 13:31:50 +02:00
Kjell Kernen 2505eb958d German OpenTX translation changes from HRenz.
I do not test compile these, I only help HRenz out with the commits.
2014-05-28 13:11:36 +02:00
Kjell Kernen 576b5d5cdf German Companion translation from Helle 2014-05-28 13:06:01 +02:00
Kjell Kernen 9947c9090d Swedish Companion translation of the latest changes 2014-05-28 13:02:41 +02:00
bsongis dee4a10436 Merge branch 'aaronchch/Heli_code_tidy_1128' of https://github.com/aaronchch/opentx into next 2014-05-28 12:30:43 +02:00
bsongis 023b3ac17c HELI simple automatic test added for testing Pull request #1129 2014-05-28 12:30:30 +02:00
mhotar 4497e5e68d SD browser layout fix "[" 2014-05-28 12:18:49 +02:00
mhotar c32f162162 font 5x7 bitmap chars "[]" width reduced for avr and sqt5
This change reflects changes already done for ARM fonts by Bertrand.
2014-05-28 12:18:49 +02:00
mhotar 340aaba419 TX translations 2014-05-28 12:18:49 +02:00
bsongis ce0f6c33be TRACE removed 2014-05-28 11:37:20 +02:00
bsongis cdfeebf494 1.99.4 preparation 2014-05-28 11:23:05 +02:00
bsongis 25effb4652 Wizard automatically launched when present on model creation 2014-05-28 11:04:26 +02:00
bsongis e8ce7c9350 Fixes #1147 2014-05-28 10:46:36 +02:00
bsongis 9047238878 Wizard splitted into 3 files 2014-05-28 10:19:30 +02:00
bsongis 8b641c1309 Allows standalone Lua scripts to be splitted (the wizard was over 20k) 2014-05-28 10:03:31 +02:00
bsongis 93c18d1b66 Cosmetics 2014-05-28 10:02:40 +02:00
bsongis e1f2661838 Fixes #1139 2014-05-28 07:44:05 +02:00
bsongis 4070ec52e7 Relative paths for wizard images do work well (at least on simu, but it
should work the same on the Tx or it's a bug!)
2014-05-28 07:40:40 +02:00
Bertrand Songis ad3ca12a66 Update DONATIONS.txt 2014-05-28 07:06:28 +02:00
Kjell Kernen 4679eefc3c Deltawing bitmaps reencoded again to make them lighter.
I used the command convert -alpha deactivate -colors 16  xxx.png xxx.bmp
Using -colorspace gray gives a far to dark conversion from png to bitmap.
2014-05-28 03:17:37 +02:00
Kjell Kernen 441d56346e Fixed problem with hanging navigation when non existing heli or quad pages were selected. 2014-05-28 02:28:49 +02:00
Kjell Kernen 1c99c3d5af Removed unnecessary global lastPage variable. Prepared for having 4 plane types. 2014-05-28 02:23:37 +02:00
Kjell Kernen 5ca79216f1 Fixed navigation problem on elevons page by adding a drop down box with only 1 option. Makes navigation and appearance the same in all dialogs. 2014-05-28 02:06:38 +02:00
Kjell Kernen b0c22d6160 Fixed display of rudder channel on confirmation page. 2014-05-28 01:53:49 +02:00
Kjell Kernen 305676bb52 Fixed the problem with the top level navigation not working in the wizard.
Reset default model type to plane.
2014-05-28 01:46:28 +02:00
Kjell Kernen bb9e05faed Revert "Revert "Bad installer name on windows""
This reverts commit b67005b0a2.
2014-05-28 01:29:43 +02:00
Kjell Kernen 28f88a180e Added deltawing pages 2014-05-28 00:16:31 +02:00
Kjell Kernen b67005b0a2 Revert "Bad installer name on windows"
This reverts commit b547dbb2f8.
2014-05-28 00:16:31 +02:00
bsongis 3cb695ed35 This was so simple :) 2014-05-27 23:02:00 +02:00
bsongis 4797df176c Warnings can now have an extra info displayed, which is useful for Lua
errors
2014-05-27 23:00:18 +02:00
bsongis 7cd7d0917e Only works on the simu :( 2014-05-27 22:06:08 +02:00
bsongis 31230aec00 Prevents the wizard from being run as a model script 2014-05-27 21:57:32 +02:00
bsongis 14dec6f432 Add a function to raise an error from a Lua script 2014-05-27 21:55:47 +02:00
bsongis 415f1d3dca Fixes #1145 2014-05-27 19:19:26 +02:00
bsongis b6cc01153c Warning removed 2014-05-27 17:57:57 +02:00
bsongis 7f7d92b9af Refactoring CMakeLists.txt 2014-05-27 17:11:28 +02:00
bsongis b736517986 More statistics 2014-05-27 16:21:19 +02:00
bsongis fdde364307 Refactoring 2014-05-27 15:17:39 +02:00
Kjell Kernen 5620a76679 Deltawing wizard imaged reencoded after som information from Bertrand. They became somewhat darker, which might not be a bad thing on the lousy Taranis display. 2014-05-27 14:36:28 +02:00
Kjell Kernen d5465dd264 BMP versions of Martins images for deltawing page in Wizard 2014-05-27 12:44:57 +02:00
bsongis 148e3e3180 Google Analytics added for Companion usage and firmware downloads
statistics
2014-05-27 12:13:50 +02:00
Bertrand Songis ffbae2592b Update wizard.lua 2014-05-27 12:01:39 +02:00
bsongis 97d8886dfa NMEA compilation error 2014-05-27 10:39:29 +02:00
bsongis 84305a5a05 Display problem in General Edit Dialog 2014-05-27 10:37:41 +02:00
bsongis 2be373900c Wizard confirmation page 2014-05-27 08:43:36 +02:00
bsongis 614ba85ad9 Wizard: use the "0 ailerons" image in place of "0 flaps" and "0 brakes" 2014-05-27 07:22:30 +02:00
Bertrand Songis 76fb45fc9c Update DONATIONS.txt 2014-05-27 07:08:10 +02:00
mhotar 8bfc902647 wizard images 2014-05-27 00:59:46 +02:00
bsongis b547dbb2f8 Bad installer name on windows 2014-05-26 22:06:50 +02:00
bsongis cf2f3f17f5 1.99.3 preparation 2014-05-26 22:03:54 +02:00
bsongis db311eb78c RxBatt ok in Companion 2014-05-26 22:00:26 +02:00
bsongis 170cbddb13 1.99.3 preparation 2014-05-26 21:40:42 +02:00
bsongis 331fb9d588 RxBatt now ok! 2014-05-26 21:38:19 +02:00
bsongis 5ac583c598 1.99.2 preparation 2014-05-26 16:49:08 +02:00
bsongis fa0dd2ba08 Fixes #1142 2014-05-26 16:45:18 +02:00
bsongis fc876f0506 Confirmation page added - not as nice as others ;) - Engine settings
applied (others remain to do). Flaps instead of Flaperons
2014-05-26 16:35:47 +02:00
bsongis 0c3b28546a Wizard servos settings screen (min/max/center/direction) 2014-05-26 15:01:12 +02:00
bsongis 3f2fb96caa Lua garbage collector was never called. [Exit Long] will now force exit
on all standalone scripts.
2014-05-26 14:58:55 +02:00
bsongis e370b32203 Wizard Tail configuration page added 2014-05-26 11:15:18 +02:00
bsongis d82dc54d05 Wizard Air brakes menu added 2014-05-26 10:42:23 +02:00
bsongis 08ad87b7ed Wizard Flaperons page added 2014-05-26 10:32:50 +02:00
bsongis eb2fd118b7 Lua Wizard simplification. Engine paged added. 2014-05-26 10:20:29 +02:00
bsongis 02396dc03d Remove screenshots of the Wizard pages which are finished 2014-05-26 09:17:29 +02:00
bsongis ea4f41100d Fixes #1131 2014-05-26 09:17:29 +02:00
Bertrand Songis ecb9129f94 Update DONATIONS.txt 2014-05-26 07:38:17 +02:00
bsongis db75471f21 RxBatt now configurable in Companion 2014-05-25 21:20:14 +02:00
bsongis a6c01f990b A1/A2/A3/A4 skipped in the sources list when their range is not defined 2014-05-25 14:30:51 +02:00
bsongis 59d121e5d4 RxBatt alarms added to EEPROM export in companion. Still missing the UI.
Someone will have time for it? Otherwise it will wait next week.
2014-05-25 09:58:11 +02:00
bsongis 2fd1f575ba Telemetry Volts and Current sources (RxBatt, A3, A4) now available in
Companion. QAutoComboBox introduced to simplify code
2014-05-25 09:43:54 +02:00
bsongis 09d49126a4 Compilation error (thanks Jenkins!) 2014-05-24 18:19:43 +02:00
bsongis c7c58b1a1d Volts source can be RxBatt/A3/A4 and Amps source A3/A4 2014-05-24 16:06:31 +02:00
bsongis 8f9391a8df Constants renamed 2014-05-24 16:06:31 +02:00
Bertrand Songis 5463a93f48 Merge pull request #1136 from opentx/driver33/PL_TR
Driver33/pl tr
2014-05-24 13:51:55 +02:00
Jacek Drewniak 3e7773eea2 small translation fixes 2014-05-24 09:19:55 +02:00
Jacek Drewniak 85427915c4 small translation fixes 2014-05-24 09:17:37 +02:00
bsongis 3ba532cb19 Fixes #1135 2014-05-24 09:02:44 +02:00
bsongis f4681eff0c 1.99.2 preparation 2014-05-23 23:19:05 +02:00
bsongis 4c201da3b6 A3 and A4 now configurable in Companion 2014-05-23 23:13:16 +02:00
Bertrand Songis 91aa1d0690 Update DONATIONS.txt 2014-05-23 22:22:36 +02:00
bsongis 98bb7acdc8 Telemetry RxBatt now tested and ok 2014-05-23 20:15:56 +02:00
bsongis 74e6ee6d1f Fixes #1133 2014-05-23 19:47:13 +02:00
bsongis a46b78bd97 RxBatt overflow (it's stored in a 8bits variable) 2014-05-23 17:26:26 +02:00
bsongis 3126586615 Sky9x compilation failure (thanks Jenkins!) 2014-05-23 16:22:34 +02:00
bsongis cd6bad23fd Default RxBatt alarm value (only RED) 2014-05-23 16:19:56 +02:00
bsongis ede7b02706 Telemetry RxBatt alarms 2014-05-23 16:17:49 +02:00
bsongis 136cd666f7 RxBatt should now be displayed and played correctly 2014-05-23 15:38:50 +02:00
bsongis 375147e4eb Telemetry A3/A4 settings and alarms 2014-05-23 15:29:10 +02:00
Kjell Kernen 48a62406f8 se.h.txt: Translated Time to Tid. Translated ft to fot. 2014-05-23 14:45:43 +02:00
Kjell Kernen d7fe3c77ff Spelling error in fi.h.txt 2014-05-23 14:39:21 +02:00
Andre Bernet b0e0403904 lua option in companion 2014-05-23 12:16:41 +02:00
Andre Bernet 8334641a8e 2.0 has no more templates on Taranis 2014-05-23 11:28:55 +02:00
Andre Bernet 781133fc86 Sync translations 2014-05-23 11:09:46 +02:00
bsongis daf80cad83 A3/A4 support 2014-05-23 11:09:22 +02:00
bsongis 4164481d0a Old S.PORT code removed 2014-05-23 11:09:22 +02:00
Andre Bernet 2b367b6814 Translation fixes 2014-05-22 23:40:24 +02:00
bsongis 2a6e69f902 Preparation for A3/A4 2014-05-22 20:51:46 +02:00
bsongis b01a936b4d The .. operator didn't work well with integers on the real radio (while
it was ok on the simu). I will try to fix the issue later, for now I
introduce the lcd.drawSource(...) function. The Wizard pages are now ok
on the radio itself!
2014-05-22 19:36:56 +02:00
bsongis 1c54a30f01 Taranis Wizard: Ailerons configuration page added 2014-05-22 16:48:15 +02:00
bsongis 90d63738e8 New Lua functions added (needed for the wizard) 2014-05-22 16:47:35 +02:00
bsongis e4f550085a lcd_line now accepts DOTTED pattern 2014-05-22 16:46:46 +02:00
aaronchch 6261fbf317 Removed some unnecessary code 2014-05-22 22:29:00 +12:00
bsongis c6aff45638 Taranis Wizard... first page done! All these files must be copied in a
TEMPLATES directory on the SD
2014-05-21 23:23:41 +02:00
bsongis 857aca7e39 Lua changes needed for the wizard 2014-05-21 23:20:34 +02:00
bsongis fbe6021fbd S3 Pot parameters only visible on TaranisPlus 2014-05-21 18:44:00 +02:00
bsongis 5f65fc57a3 Windows Companion build error 2014-05-21 07:25:43 +02:00
bsongis e91390690c Refactoring of automatic updates (companion and firmware) 2014-05-20 23:38:37 +02:00
mhotar dc2ac966a3 tx wizard images 2014-05-20 22:30:41 +02:00
bsongis 847baa09ef Add a revision number to the versioning scheme 2014-05-20 21:17:23 +02:00
Kjell Kernen 2a777003b9 Removed left over settings parameter "compilation-server".
Added settings version number to make it easier to handle settings upgrades in the future.
2014-05-20 15:57:00 +02:00
bsongis 73faca60d7 OpenTX 2.0 downloads from Companion should be working now 2014-05-20 14:53:59 +02:00
bsongis a178d6b326 Fixes #1122 2014-05-20 14:32:27 +02:00
bsongis b3a6556e0b Taranis REV4a support removed as nobody doesn't still use it (developers
have now a Taranis Plus board inside their REV4a case). Compilation
server for 'next' is now next.open-tx.org
2014-05-20 10:44:36 +02:00
bsongis 84eb29cd96 Fixes #1114 2014-05-19 23:25:41 +02:00
Bertrand Songis 43a3b3ee46 Update DONATIONS.txt 2014-05-19 22:59:39 +02:00
Damjan Adamic 7505701e64 Merge pull request #1119 from opentx/bsongis/logical_switches_issue_1039
Bsongis/logical switches issue 1039
2014-05-19 22:04:30 +02:00
bsongis 273098f9e1 Fixes #1120 2014-05-19 21:16:13 +02:00
bsongis a1c90fccf9 Release notes simplified 2014-05-19 17:50:26 +02:00
bsongis f349330f7d OpenTX stamp simplification (only one stamp for all boards) 2014-05-19 17:29:05 +02:00
bsongis 90fbd9cf62 Fixes #1069 2014-05-19 16:28:00 +02:00
bsongis a85ad617fc Fixes #1112 2014-05-19 15:44:50 +02:00
bsongis 89f42eab8b Ignore list updated 2014-05-19 15:29:21 +02:00
bsongis 788193f89c This initialization was lost in the battle 2014-05-19 15:20:48 +02:00
bsongis 49a4d5ecb1 Gtests KO 2014-05-19 15:12:23 +02:00
bsongis 1a7ff9239d A couple of changes on top of projectkkglider branch 2014-05-19 14:52:07 +02:00
Kjell Kernen ca9d1e47ff Fixes #1066.
Set Vtail mix to use 50% elevator and rudder, to avoid clipping and make the mix more beginner-friendly.
Reversed some servo travels. Positive channel values are now supposed to consistently move control surfaces upward, while negative are supposed to move them downward.
2014-05-19 11:15:11 +02:00
bsongis dffb5a7a79 Bad structure alignment (the compiler does the job, but it's better to
write it so we see where are the lost bits)
2014-05-19 11:07:51 +02:00
bsongis b9ee91b08d Indentation 2014-05-19 11:05:59 +02:00
Bertrand Songis aaa313be76 Merge pull request #1116 from opentx/driver33/PL_TR
PL translation fixes
2014-05-19 08:04:12 +02:00
bsongis b2dc625205 Fixes #1106 2014-05-19 08:03:52 +02:00
Jacek Drewniak 23ebe7e2e4 PL translation fixes 2014-05-18 23:15:00 +02:00
bsongis d4ea6e0d8f No Haptic on Tada 2014-05-18 22:18:37 +02:00
bsongis c2db918e91 Missing EXT=FRSKY_SPORT option as default on Taranis 2014-05-18 22:18:04 +02:00
Damjan Adamic df971b0e77 Cosmetics 2014-05-18 18:44:07 +02:00
Damjan Adamic dc2fcb2618 Another gtests failure 2014-05-18 18:30:30 +02:00
Damjan Adamic 0180e3b90d Gtests problems 2014-05-18 18:22:56 +02:00
Damjan Adamic 9dcaccc87f Cosmetics 2014-05-18 18:09:23 +02:00
Damjan Adamic e14734c8af Reduced number of logical switch context to 2. Now we have only active fm context (lswFM[0]) and other context that is used for all other fms (lswFm[1]).
Much smaller RAM usage, but possible (I beleave unimportant) errors when trasitioning between more than two flight modes.
2014-05-18 18:08:41 +02:00
Damjan Adamic fbb1b65fd6 Delay and Duration using 1 x uint8_t instead of 2 x uint32_t.
Timing for delay and duration is not as accurate as before, max error possible is +-100ms.

Worst case example: duration set at 0.1s will produce output pulse of width between 10ms (min mixer loop  time) and 200ms.

But RAM saving is BIG, unfortunately only on ARM.
2014-05-18 16:47:15 +02:00
Damjan Adamic d6a150738c Cosmetics 2014-05-17 19:56:00 +02:00
Damjan Adamic 1491d3b236 Renamed lswReset() to logicalSwitchesReset()
Added PACKED to logical switches data structures
2014-05-17 19:38:23 +02:00
Damjan Adamic 8ec706ad08 Bugfix 2014-05-17 19:35:34 +02:00
Damjan Adamic c0c824c0f4 Cosmetics 2014-05-17 19:34:53 +02:00
Damjan Adamic 8cba5f9c02 gtest correction needed because of changed order of logical swithces calculation 2014-05-17 18:31:15 +02:00
Damjan Adamic d32b869582 CRLF 2014-05-17 18:23:36 +02:00
Damjan Adamic 07a5333a08 Fixes #1039:
* order of logical switches calculaton now predicable: always from L1 to L64
* each flight mode has its own logical switches context (RAM usage multiplied by number of flight modes)
* resolved problem of non-reentrancy of getSwitch() function
2014-05-17 17:51:33 +02:00
Damjan Adamic 6e5f064c31 One more rename 2014-05-17 17:06:29 +02:00
Damjan Adamic c2031934e0 Reenabled missing #if 2014-05-17 16:20:08 +02:00
Damjan Adamic 34e1a0ce86 All references to "custom switches" renamed to "logical switches" 2014-05-17 15:29:31 +02:00
Damjan Adamic 8c21462f74 More switches code moved to switches.cpp 2014-05-17 15:29:31 +02:00
bsongis 4c44000bce Fixes #1110 2014-05-17 13:31:29 +02:00
Bertrand Songis c987f04388 Update DONATIONS.txt 2014-05-17 11:51:00 +02:00
Bertrand Songis f235ce038f Update DONATIONS.txt 2014-05-17 08:12:40 +02:00
bsongis 128956dbab Google tests compilation failure 2014-05-17 08:04:49 +02:00
bsongis 7aec5762a9 EEPROM shift 2014-05-17 07:52:31 +02:00
bsongis 6c17fee19b Fixes #1107 2014-05-17 07:52:31 +02:00
mhotar 0a53e2e6b3 wizard images #992 2014-05-16 23:50:13 +02:00
bsongis ef15ccf321 Companion bugfixes 2014-05-16 23:02:31 +02:00
bsongis 96ddda7bef Bugfixes 2014-05-16 22:33:00 +02:00
bsongis 5bfe5d9cf6 Display problem with [ in SD Manager 2014-05-16 22:32:13 +02:00
bsongis 4f0e4feadd Cosmetics 2014-05-16 21:17:54 +02:00
bsongis 92e7182740 Sky9x modules settings updated in Companion 2014-05-16 18:32:28 +02:00
bsongis 4048d65724 Warning removed 2014-05-16 18:10:39 +02:00
bsongis 5c880e47cd TrainerMode not needed on sky9x boards 2014-05-16 18:08:32 +02:00
bsongis 836cc95570 Thanks Jenkins! 2014-05-16 17:59:01 +02:00
bsongis e4346e70cd Checklist available on all ARM boards 2014-05-16 17:30:54 +02:00
bsongis 487cd04030 Cosmetics (one TODO done) 2014-05-16 17:08:35 +02:00
Bertrand Songis 3b85414f2e Merge pull request #1105 from opentx/andreas/BringBackFlashSavings
Andreas/bring back flash savings
2014-05-16 16:56:45 +02:00
Bertrand Songis 9805a8cf60 Merge pull request #1104 from opentx/bsongis/Telemetry_refactoring
Bsongis/telemetry refactoring
2014-05-16 16:56:31 +02:00
openfsguruh 9bbe3236ab a special volatile saves 40 bytes if FRSKY_STICKS used 2014-05-16 16:48:07 +02:00
bsongis bfbee05b25 Telemetry refactoring continued 2014-05-16 16:46:04 +02:00
Kjell Kernen 74a8e612bc German Companion translation from Hrenz. 2014-05-16 16:33:13 +02:00
openfsguruh 07e6df9ea5 first 68 bytes flash savings. Bring back to pointer and add volatile 2014-05-16 16:14:30 +02:00
bsongis 40783acc36 Small display bug on SMLSIZE numbers with PREC1 (used in Failsafe menu
on Taranis)
2014-05-16 15:48:57 +02:00
bsongis fec39c4222 Numbers like "5.1" were badly displayed in DBLSIZE (the point was near
the 1). Small code saving (10 bytes)
2014-05-16 15:15:57 +02:00
bsongis d6977a130b Chars [ and ] use now one less pixel in weight 2014-05-16 14:43:32 +02:00
Kjell Kernen b4d99acea9 Companion voice downloads switched to http://voice.open-tx.org/.
By using separate download areas for each Companion version it is possible to change the format and content of the voice downloads between versions. For Companion2 some download alternatives have been removed and some have been added.
2014-05-16 10:18:02 +02:00
Bertrand Songis 96f3c909bc Update DONATIONS.txt 2014-05-16 09:24:36 +02:00
mhotar c72d84e27f wizard images #992 2014-05-16 00:35:14 +02:00
bsongis 6b3c4c8cfe Telemetry bugfixes 2014-05-15 21:08:04 +02:00
Bertrand Songis c9500063aa Update DONATIONS.txt 2014-05-15 19:56:16 +02:00
bsongis b376192b61 Telemetry refactoring 2014-05-15 18:07:52 +02:00
Bertrand Songis 7b1f11398d Update DONATIONS.txt 2014-05-15 13:59:38 +02:00
bsongis 2fbd4ff13a Mixer code splitted differently 2014-05-15 12:08:57 +02:00
bsongis 55ed62e6ac Mixer code moved to a separate file 2014-05-15 11:10:05 +02:00
bsongis 6bcf5aa651 Fixes #1103 2014-05-15 10:48:42 +02:00
bsongis 970cebb9bd A couple of TODOs removed (hardcoded values instead of constants) 2014-05-15 10:25:07 +02:00
bsongis 4f5c145ac7 Changes in menu_general.cpp lost (Play in SD Manager, FRSKY_STICKS mod).
Is displaySlider ok now?
2014-05-15 10:11:09 +02:00
bsongis 5503a9cd3c Curves code moved to a separate file 2014-05-15 08:07:37 +02:00
Bertrand Songis d047133e64 Merge pull request #1102 from opentx/bsongis/Switches_refactoring
Switches code moved to a separate file
2014-05-15 07:36:14 +02:00
mhotar a86ff47e24 wizard images #992 2014-05-15 01:13:43 +02:00
Bertrand Songis 38815c5662 Merge pull request #1100 from opentx/driver33/PL_TR
pl translation fixes
2014-05-14 13:01:51 +02:00
Jacek Drewniak d92322bd0c pl translation fixes 2014-05-14 12:49:19 +02:00
bsongis 8f10bed8c1 Haptic strength will be selectable with a slider, with a default
position at center
2014-05-14 11:15:07 +02:00
bsongis cd42a7749e One more constant exported for Lua scripts: FULLSCALE, to avoid 10.24
hardcoded in Lua scripts...
2014-05-14 10:46:37 +02:00
bsongis 7bd45379b9 Fixes #1095 2014-05-14 10:27:26 +02:00
Bertrand Songis 6406c7352b Update tts.py 2014-05-14 08:00:24 +02:00
Bertrand Songis 276e86eac1 Update tts.py 2014-05-13 23:25:59 +02:00
mhotar d7307ae79f tx wizard -layout #992 2014-05-13 23:12:49 +02:00
bsongis 46c0df8447 Thanks Jenkins! 2014-05-13 22:38:57 +02:00
bsongis 30c4833c23 RSSI line not correctly displayed on all 9X/9XR boards (since
introduction of proportional fonts)
2014-05-13 22:31:51 +02:00
bsongis c13d71c620 Code for telemetry splitted 2014-05-13 22:31:51 +02:00
bsongis 216ecc636a Bootloader removed from inside opentx application code. 2014-05-13 22:31:51 +02:00
bsongis 0e84a27521 A1/A2/RSSI/SWR alarms available on all ARM boards 2014-05-13 22:31:51 +02:00
Damjan Adamic 4932ed8099 Re #1086: Corrected displayed flight mode numbering. Added bold to active flight mode gvars values. 2014-05-13 20:28:32 +02:00
Bertrand Songis 5a7a52c76d Update DONATIONS.txt 2014-05-13 20:07:27 +02:00
bsongis f0f37d5c5d Fixes #1091 2014-05-13 14:48:11 +02:00
Bertrand Songis a98dfabc4b Update tts.py 2014-05-13 14:14:00 +02:00
bsongis 55b0a0a5e0 Fixes #1083 2014-05-13 12:24:03 +02:00
bsongis b1dbf06861 Warning removed 2014-05-13 12:07:48 +02:00
bsongis 0d7fa422b0 Fixes #1087 fixed - Trainer weight range is now [-125%:+125%] 2014-05-13 12:06:08 +02:00
bsongis 2c2278a9ed Fixes #1086 2014-05-13 11:57:36 +02:00
bsongis 6225609f0e Fixes #1090 2014-05-13 11:23:25 +02:00
bsongis 623dbf176c Fixes #1082 2014-05-13 10:49:21 +02:00
bsongis 32d57fbc3d GPS Time was badly displayed (too much space before : since proportional
fonts were introduced)
2014-05-13 10:43:43 +02:00
bsongis 10545a1e6a Fixes #1088 2014-05-13 10:39:53 +02:00
bsongis 324fe4e341 REVPRO fixes 2014-05-13 08:46:54 +02:00
mhotar efeb02b6c6 wizard images #992 2014-05-12 22:42:17 +02:00
bsongis ae5468330a Only one module on 9XR-PRO 2014-05-12 22:03:38 +02:00
Bertrand Songis f0c2f1f3df Update DONATIONS.txt 2014-05-12 20:48:52 +02:00
Kjell Kernen 5bd09f9cf2 Some updated German OpenTX strings from Helle 2014-05-12 20:13:38 +02:00
bsongis cc38920432 No rotary encoders on 9XR-PRO 2014-05-12 19:38:45 +02:00
bsongis df73c969c6 Cosmetics 2014-05-12 19:17:28 +02:00
bsongis a877fefade Simu compilation problem 2014-05-12 19:17:28 +02:00
bsongis 9860bb1a46 Mike's Bootloader integrated 2014-05-12 19:17:28 +02:00
Kjell Kernen 1f87ce75bf Added Finish to the list of downloadable voice languages. 2014-05-12 16:33:13 +02:00
Kjell Kernen 9716fb04d2 Added Wizard option for flight timer. 2014-05-12 16:27:52 +02:00
Bertrand Songis 22697f9491 Update DONATIONS.txt 2014-05-12 08:47:19 +02:00
mhotar 1a4114dbfe wizard images 2014-05-11 23:59:13 +02:00
Bertrand Songis e5a46e2fa8 Merge pull request #1081 from opentx/bsongis/9XR-PRO_port
Bsongis/9 xr pro port
2014-05-11 22:53:07 +02:00
bsongis e78beed266 Unix line endings 2014-05-11 22:50:34 +02:00
bsongis 61224e7207 Merge remote-tracking branch 'origin/next' into bsongis/9XR-PRO_port
Conflicts:
	companion/src/eeprominterface.cpp
	companion/src/eeprominterface.h
	companion/src/firmwares/opentx/opentxeeprom.cpp
	companion/src/firmwares/opentx/opentxinterface.cpp
	companion/src/firmwares/opentx/opentxinterface.h
	companion/src/mdichild.cpp
	radio/src/Makefile
2014-05-11 22:48:48 +02:00
Bertrand Songis a7d58e9a86 Merge pull request #1080 from opentx/projectkk2glider/companion_gvars_issue_500
Fixes #500.
2014-05-11 19:37:43 +02:00
Damjan Adamic 0145bcfd6c Fixes #500.
Graphical presentation could be better, I am not very familiar with Qt.
2014-05-11 18:12:03 +02:00
Damjan Adamic 750cde82d1 Companion simulator crash for REVPLUS, TIM4 simulator substitute was not defined 2014-05-11 17:04:16 +02:00
bsongis fb20b21151 Compilation failure on Taranis (not plus) 2014-05-11 16:00:51 +02:00
bsongis cd04dfaa5e Merge branch 'next' of https://github.com/opentx/opentx into next 2014-05-11 15:53:44 +02:00
Bertrand Songis 8033451e0a Merge pull request #1079 from opentx/TaranisPlus
Taranis plus
2014-05-11 15:51:45 +02:00
bsongis 98920569ab Merge remote-tracking branch 'origin/TaranisPlus' into next 2014-05-11 15:50:05 +02:00
bsongis 72a36b065e PWM Haptic 2014-05-11 15:49:18 +02:00
Bertrand Songis 8bd0657b7e Merge pull request #1078 from opentx/projectkk2glider/flightmode_simulator_issue_1042
Fixes #1042
2014-05-11 15:34:45 +02:00
bsongis 0e2647fa13 Warnings removed 2014-05-11 15:33:22 +02:00
Damjan Adamic 533000ddcd Fixes #1042 2014-05-11 15:06:02 +02:00
bsongis 220e9f3e97 Merge remote-tracking branch 'origin/next' into TaranisPlus
Conflicts:
	companion/src/generaledit.cpp
	companion/src/generaledit.ui
	radio/src/gui/menu_general.cpp
2014-05-11 14:41:03 +02:00
Bertrand Songis cfd4aa73a0 Update DONATIONS.txt 2014-05-11 09:21:23 +02:00
Bertrand Songis ba1116b000 Update DONATIONS.txt 2014-05-11 09:10:06 +02:00
bsongis 3a2e9e7c2e Fixes #1074 2014-05-10 23:30:28 +02:00
bsongis 071890d900 PlayFunction Time was playing negative values (int16_t overflow) 2014-05-10 20:19:27 +02:00
Bertrand Songis 7de60763e5 Update DONATIONS.txt 2014-05-10 20:08:03 +02:00
bsongis 8b2769a734 Switches code moved to a separate file 2014-05-09 18:05:29 +02:00
bsongis c3859dc308 Compilation failure on Sky9x 2014-05-09 17:26:16 +02:00
bsongis 9a086312c7 Disable TX_TIME when no RTCLOCK on board 2014-05-09 17:11:31 +02:00
bsongis 41571d4a74 Fixes #1065 - Companion part 2014-05-09 17:11:31 +02:00
bsongis 6b4dba947a Issue #1065 - FW part done 2014-05-09 17:11:30 +02:00
bsongis 3c07e0a227 Issue #1065 - New function putsTime 2014-05-09 17:11:30 +02:00
Bertrand Songis 57193fddfe Update DONATIONS.txt 2014-05-09 08:31:54 +02:00
Bertrand Songis 4e285ed502 Update DONATIONS.txt 2014-05-08 19:57:32 +02:00
Bertrand Songis 0714138fcd Update DONATIONS.txt 2014-05-08 08:28:03 +02:00
Andre Bernet 7e6b2acc57 Naming consistency 2014-05-07 13:12:05 +02:00
Andre Bernet fdb9871a25 Add more targets to simu with default options that allow for checking most menus 2014-05-07 13:01:43 +02:00
Bertrand Songis 48b183e6c2 Update DONATIONS.txt 2014-05-07 07:10:06 +02:00
Bertrand Songis a1fab7de0f Merge pull request #1062 from opentx/projectkk2glider/companion_print
Projectkk2glider/companion print
2014-05-06 09:55:00 +02:00
Bertrand Songis 216184e6f9 Update DONATIONS.txt 2014-05-06 09:51:27 +02:00
Damjan Adamic c5a526f3b3 Merge branch 'next' 2014-05-05 22:49:44 +02:00
Damjan Adamic 77bafb5364 Converted CR back to CRLF. SmartGit did this to me previously when merging. 2014-05-05 22:41:33 +02:00
Damjan Adamic 5316931fa1 Merge branch 'next' 2014-05-05 22:37:04 +02:00
Damjan Adamic 61addd3d4e Merge branch 'next' 2014-05-05 22:13:24 +02:00
Damjan Adamic b9ee1d5dee Sorted fade times for printPhases() 2014-05-05 21:51:56 +02:00
Damjan Adamic 97bbdd3be1 More compaction of printInputs() 2014-05-05 21:04:50 +02:00
Damjan Adamic b9b4e441e7 renamed printExpo() to printInputs() and compacted code, output is the same. 2014-05-05 21:02:26 +02:00
Damjan Adamic 809a3cfd60 Added "Alt+S" shortcut to start model simulation 2014-05-05 20:25:41 +02:00
bsongis 50774a9018 Cosmetics 2014-05-05 16:35:51 +02:00
bsongis f3f9f46742 100mAh will be now the step for telemetry bars (and logical switches on
stock 9x)
2014-05-05 16:35:41 +02:00
bsongis f178748090 Fixes #986
Fixes #1058
2014-05-05 16:07:07 +02:00
Kjell Kernen 7119d069da Fixed Swedish translation issue that resulted in corrupted mix soure strings 2014-05-05 15:45:31 +02:00
Kjell Kernen 15dd4ba2f2 Swedish translation file realigned with English original 2014-05-05 15:35:18 +02:00
bsongis 6ae7da4b1a Missing check in setGlobalVariable(...) 2014-05-05 14:51:22 +02:00
bsongis c53fbd9e94 Fixes #1059 2014-05-05 14:40:48 +02:00
bsongis 934961e999 Fixes #1056 2014-05-05 12:27:29 +02:00
bsongis 2810323cc7 10200mAh as a maximum for Consumption in Telemetry Bars 2014-05-05 10:53:59 +02:00
bsongis be3c674fe5 Fixes #36 2014-05-05 10:38:32 +02:00
bsongis 1466f96e51 Lua setGlobalVariable / getGlobalVariable added in model library 2014-05-05 09:59:34 +02:00
bsongis 6868b69aad Compiler options to reduce flash usage on sky9x and Taranis 2014-05-05 08:24:24 +02:00
Bertrand Songis 740e5fd703 Update DONATIONS.txt 2014-05-05 07:40:13 +02:00
Bertrand Songis 5ec1860921 Update DONATIONS.txt 2014-05-04 23:47:09 +02:00
Bertrand Songis bba3d8f08c Update DONATIONS.txt 2014-05-04 23:45:50 +02:00
Damjan Adamic 1f3e67f912 Telemetry for Taranis print improvement 2014-05-04 19:52:26 +02:00
Damjan Adamic fe719686d9 Special Functions print improvement 2014-05-04 18:37:58 +02:00
Damjan Adamic 7027d809c1 Logical switches print improvement 2014-05-04 18:21:03 +02:00
Damjan Adamic 0fc8a5e2f2 Reenabled Ctrl+P shortcut for "print model" 2014-05-04 18:08:55 +02:00
Damjan Adamic 8787dd05cd Many improvements of print dialog. Some minor changes in mixes and inputs formatting. 2014-05-04 10:37:49 +02:00
Bertrand Songis 667453d48c Merge pull request #1053 from opentx/driver33/PL_TR
translation fixes
2014-05-03 13:02:09 +02:00
Bertrand Songis 1485713f84 Merge pull request #1051 from opentx/mhotar/cz_translations
cz translations
2014-05-03 13:01:59 +02:00
Jacek Drewniak cb0b6f1c18 translation fixes 2014-05-03 12:42:07 +02:00
bsongis 573858552c Fixes #1052 2014-05-03 11:26:44 +02:00
bsongis c1d57f0b0c Issue #1052 - FW part 2014-05-03 11:26:44 +02:00
Damjan Adamic 644f975322 Missed a spot for #1048, Jenkins was not happy 2014-05-03 11:26:19 +02:00
mhotar 8799e370f2 cz translations 2014-05-02 23:00:54 +02:00
Bertrand Songis ee9aa5bed5 Merge pull request #1049 from opentx/mhotar/tab
Tab in notes file
2014-05-02 22:57:03 +02:00
bsongis 1fb115d3b1 Fixes #1048 2014-05-02 22:54:53 +02:00
bsongis 9f487a86da Issue #1048 - First in Inputs menu, it was impossible to copy a line
from Input4 to Input5
2014-05-02 22:54:52 +02:00
mhotar bee347b291 Tab in notes file 2014-05-02 21:32:35 +02:00
Andre Bernet 0440bc6f34 French translations 2014-05-02 20:11:01 +02:00
Andre Bernet 219e0ef5d5 Better location for stick reverse as mapping is shown above 2014-05-02 20:07:11 +02:00
Andre Bernet 1a43b6d353 Merge branch 'bsongis/Issue660' into next
Conflicts:
	companion/src/firmwares/opentx/opentxinterface.cpp
2014-05-02 14:44:24 +02:00
Andre Bernet 3b4053d850 Companion support - DON'T FORGET COMPILE SCRIPT! 2014-05-02 14:40:18 +02:00
bsongis 48328a7f8a Fixes #1013 - ~ and \t added to the mapped chars in notes 2014-05-02 13:11:15 +02:00
bsongis 72d0f2e6f6 Fixes #1043 2014-05-02 11:04:57 +02:00
bsongis 363bc745ce Fixes #1035 2014-05-02 10:38:54 +02:00
bsongis 16c05c21b6 Fixes #1044 2014-05-02 10:11:01 +02:00
bsongis e30cd90140 AudioQueue::stopAll() instead of AudioQueue::reset() 2014-05-02 10:09:52 +02:00
bsongis ad0e497d17 PLAY_NOW cannot be used with wav files! 2014-05-02 09:26:04 +02:00
Andre Bernet 950786c01d Merge pull request #1046 from opentx/mhotar/cz_translations
radio cz translations
2014-05-01 23:03:00 +02:00
mhotar 044ceb37ac radio cz translations 2014-05-01 22:44:22 +02:00
Bertrand Songis 44cd11c606 Merge pull request #1041 from opentx/dvogonen/remove_qsettings_from_simulator
This commit removes the direct use of QSettings from the simulator
2014-05-01 21:17:47 +02:00
Bertrand Songis ab23afa5fd Update DONATIONS.txt 2014-05-01 21:15:35 +02:00
bsongis 0e4ff42d79 Taranis+ bootloader - only one fix ;) 2014-05-01 20:24:54 +02:00
bsongis 1e0c549444 Taranis+ haptic driver fix 2014-05-01 20:13:27 +02:00
bsongis aba29cb355 Taranis+ switches driver fix 2014-05-01 20:13:03 +02:00
bsongis 1c4eac406d Cosmetics 2014-05-01 20:12:25 +02:00
Kjell Kernen a3b47625f5 This commit removes the direct use of QSettings from the simulator and replaces it with references to the protected global variable g 2014-05-01 20:08:29 +02:00
bsongis c70da8878a Cosmetics 2014-05-01 19:05:03 +02:00
bsongis aa733fa060 [Taranis+] LCD driver now ok 2014-05-01 19:00:23 +02:00
Bertrand Songis 624bdf4a93 Update DONATIONS.txt 2014-05-01 15:02:05 +02:00
Bertrand Songis 7b835b37b3 Merge pull request #1038 from opentx/projectkk2glider/mixes_and_inputs_display
Projectkk2glider/mixes and inputs display
2014-05-01 10:33:32 +02:00
Bertrand Songis 38627890fa Merge pull request #1037 from opentx/projectkk2glider/issue_1034
Save/restore of simulator switches, fixes #1034
2014-05-01 10:29:21 +02:00
Damjan Adamic b092607553 Save/restore of simulator switches, fixes #1034 2014-05-01 09:46:38 +02:00
bsongis d2c42c780f Fixes #1026 (VC++ compiler only). Would someone check that this fix
doesn't increase flash usage on 9x stock? Thanks!
2014-05-01 09:19:34 +02:00
Damjan Adamic 88e7ad4b8c Better display of inputs with assigned name 2014-04-30 23:16:49 +02:00
Damjan Adamic 1a6906bbb3 Input name missing from mixer sources 2014-04-30 22:58:54 +02:00
bsongis 168ec19ef4 Fixes #1036 2014-04-30 22:10:01 +02:00
Damjan Adamic 6b1afde47e bugfix: commit 5c8504add6 broke importing of trim values for FM0 - they were all set to zero. 2014-04-30 21:20:07 +02:00
bsongis 3cd070ee38 Cosmetics 2014-04-30 20:10:45 +02:00
bsongis e2cfaf6742 Fixes #1031 2014-04-30 16:12:53 +02:00
bsongis a2dbee7d98 Fixes #1012 2014-04-30 15:55:35 +02:00
Bertrand Songis f783d12cb2 Merge pull request #1027 from opentx/projectkk2glider/companion_gvars_bug
Projectkk2glider/companion gvars bug
2014-04-30 00:21:24 +02:00
Damjan Adamic 926ad88b73 Hided "popup enabled" checkbox for FM>0. They have taken precious space and severely limited width of GVAR names filed. 2014-04-29 20:06:25 +02:00
Damjan Adamic 8baa2b3887 Bug: setting gvar to "same as flight mode X" caused endless loop if X > current flight mode 2014-04-29 19:59:24 +02:00
Andre Bernet 3a7f122323 Backlight driver, totally untested. Backlight SF color not handled yet. 2014-04-29 18:34:11 +02:00
Andre Bernet 7ca42a8472 Forgot to update a couple of macros 2014-04-29 17:54:11 +02:00
Andre Bernet 314a9d468d ) 2014-04-29 17:23:22 +02:00
Andre Bernet c03708a4dc More pin remappings 2014-04-29 17:12:17 +02:00
Andre Bernet bdf4e6d0d1 LCD pins remapped 2014-04-29 16:47:12 +02:00
Bertrand Songis 802c7fdb4c Update DONATIONS.txt 2014-04-29 16:33:05 +02:00
Andre Bernet 7fc1372f8f Some fields were broken for REV4a and REVPLUS 2014-04-29 16:17:16 +02:00
Andre Bernet 09295d377d Simu now simulates REVPLUS 2014-04-29 16:16:30 +02:00
Andre Bernet 91c84dbb65 Color slider for backlight SF in companion 2014-04-29 16:16:07 +02:00
Kjell Kernen 09d9bcf59a Replaced hard coded switches with Bertrands new defines 2014-04-29 15:42:41 +02:00
Andre Bernet 0ffd0c8e0b Merge branch 'next' of https://github.com/opentx/opentx into TaranisPlus
Conflicts:
	companion/src/firmwares/opentx/opentxinterface.cpp
	radio/src/haptic.cpp
	radio/src/targets/gruvin9x/board_gruvin9x.h
	radio/src/targets/mega2560/board_mega2560.h
	radio/src/targets/sky9x/board_sky9x.h
	radio/src/targets/stock/board_stock.h
	radio/src/targets/taranis/board_taranis.h
	radio/src/targets/taranis/haptic_driver.cpp
2014-04-29 15:13:05 +02:00
bsongis 667dd5fe9e Haptic / Taranis fix 2014-04-29 10:08:54 +02:00
bsongis 1378ce75d3 Warning removed 2014-04-29 10:08:26 +02:00
bsongis 08284a69e6 Switches constants properly defined in Companion 2014-04-29 08:55:19 +02:00
bsongis 866e321b1a Haptic, HapticMode and HapticStrength capabilities merged in Companion 2014-04-29 07:30:55 +02:00
bsongis cbc0d9a30a Cosmetics 2014-04-29 07:21:50 +02:00
Bertrand Songis 9bb4ddf975 Merge pull request #1022 from opentx/mhotar/tab
TAB "\t" added to strings
2014-04-29 07:20:56 +02:00
Bertrand Songis 24cbbad82b Merge pull request #1015 from opentx/kilrah/haptic
Haptic for Taranis
2014-04-29 07:16:04 +02:00
Bertrand Songis 43bc81de4d Merge pull request #1021 from opentx/projectkk2glider/lua_development
Projectkk2glider/lua development
2014-04-29 07:14:52 +02:00
Kjell Kernen 93969c2ee1 Swedish OpenTX translation updated 2014-04-29 00:16:31 +02:00
Kjell Kernen d4d19269ee Merge pull request #1024 from opentx/dvogonen/add_companion_selectable_functions_993
Swedish Companion translation update
2014-04-28 23:48:20 +02:00
Kjell Kernen 30bc786e08 Swedish Companion translation update 2014-04-28 23:43:41 +02:00
Andre Bernet 565aa29c48 Throttle cut wizard option was setting 0% 2014-04-28 23:11:05 +02:00
Kjell Kernen cee6523774 Merge pull request #1020 from opentx/dvogonen/add_companion_selectable_functions_993
Dvogonen/add companion selectable functions 993
2014-04-28 23:03:49 +02:00
Andre Bernet 1a39317c2d Fix #1023 2014-04-28 22:50:25 +02:00
Andre Bernet cc49e71f76 Merge pull request #1019 from opentx/bsongis/Issue1007
Fixes #1007
2014-04-28 22:39:38 +02:00
Andre Bernet 937481d761 Haptic in Taranis simu 2014-04-28 22:37:06 +02:00
mhotar 2d62054e9a TAB "\t" added to strings 2014-04-28 20:20:04 +02:00
Damjan Adamic a6548a05d8 Completed list of conversions in luaGetValueAndPush() 2014-04-28 17:39:43 +02:00
Damjan Adamic bff912aef6 Renamed __luaGetValue() to luaGetValueAndPush() 2014-04-28 17:23:58 +02:00
Kjell Kernen 833585002b Forgot these files in last commit 2014-04-28 15:43:10 +02:00
Kjell Kernen d4362e5e62 Wizard option handliong working and ready for merge into next. 2014-04-28 15:42:31 +02:00
bsongis b56bcff576 Fixes #1007 2014-04-28 13:01:28 +02:00
Andre Bernet db1336522e Cosmetics 2014-04-28 12:54:08 +02:00
Damjan Adamic 16c6a94d35 Merge pull request #1018 from projectkk2glider/lua_development
Lua development
2014-04-28 12:49:51 +02:00
Bertrand Songis bb75538070 Update DONATIONS.txt 2014-04-28 11:51:42 +02:00
Andre Bernet d612f5609f Text view uses fixed font 2014-04-27 23:39:55 +02:00
Kjell Kernen 8781b522d8 Added Wizard GUI for two model options ( Throttle Cut and Throttle Timer).
The wizard option data is not yet added to the mixer. That is the next step.
2014-04-27 22:47:18 +02:00
Kjell Kernen 3980f42b3d Merge pull request #1009 from opentx/mhotar/cz_translations
Mhotar/cz translations
2014-04-27 21:57:46 +02:00
Damjan Adamic 01391aa6aa Return 0 for all temeletry values, when telemetry not available. 2014-04-27 18:12:06 +02:00
Damjan Adamic 55d8a0ac8c bug: Default value was not added for input type VALUE 2014-04-27 11:24:08 +02:00
Damjan Adamic fbbe7e9cc6 Merge branch 'next' 2014-04-26 21:12:16 +02:00
Damjan Adamic eac17bda08 Telemetry values are now returned as proper values (i.e. A1 voltage 4.5V is returned as 4.5) for model script inputs and getValue() function. 2014-04-26 21:10:54 +02:00
Damjan Adamic 06beced480 Removed symbol OPENTX_VERSION 2014-04-26 18:50:43 +02:00
Damjan Adamic bd31c541f6 Order of outputs was wrong 2014-04-26 18:48:30 +02:00
Damjan Adamic fc4cf73c89 Registered OpenTX version as symbol OPENTX_VERSION in Lua
Added PlayNumber()
2014-04-26 09:45:07 +02:00
Damjan Adamic 9285a3a9a1 Lua print() function works by using TRACE macro 2014-04-26 09:43:45 +02:00
bsongis 812242f010 Fixes #1011 2014-04-25 22:10:56 +02:00
Bertrand Songis 5bd376d3e1 Update DONATIONS.txt 2014-04-25 21:53:41 +02:00
Andre Bernet 9a1ba771c0 Translation fix 2014-04-24 22:55:14 +02:00
Bertrand Songis 7949ba2a1d Update DONATIONS.txt 2014-04-24 22:22:42 +02:00
Kjell Kernen 6bd816d5a4 Merge pull request #1008 from projectkk2glider/issue_779
Fixes missing icons in menus and buttons on Fedora 20
2014-04-24 11:37:50 +02:00
mhotar 07149f516f cz translations wip 2014-04-24 00:07:27 +02:00
Bertrand Songis ed4a46242b Update DONATIONS.txt 2014-04-23 23:59:50 +02:00
Andre Bernet 225ea5d63d Gruvin is an m2560 2014-04-23 22:00:05 +02:00
Andre Bernet 5c4f704696 Typo 2014-04-23 22:00:00 +02:00
Andre Bernet c22ee587cd Enable haptic fields for Taranis, add option for revisions < REVPLUS 2014-04-23 21:58:19 +02:00
Andre Bernet 5c0b8fcb2d Haptic support 2014-04-23 21:58:05 +02:00
Damjan Adamic 5d2aacb7d1 Fixes missing icons in menus and buttons on Fedora 20 2014-04-23 19:37:36 +02:00
Bertrand Songis 95fa0991e6 Update DONATIONS.txt 2014-04-23 17:36:42 +02:00
Andre Bernet dfead504f7 Backlight color in SFs for REVPLUS
100 steps instead of 255, should be enough...
2014-04-23 17:31:09 +02:00
Andre Bernet 7600924d94 Make displaySlider generally available 2014-04-23 17:28:16 +02:00
Bertrand Songis 3d7ce1f5e7 Update DONATIONS.txt 2014-04-23 17:22:23 +02:00
Andre Bernet 496f3c3793 Missing translation 2014-04-23 16:25:12 +02:00
Andre Bernet f1ce1ed6b8 German translation fixes 2014-04-23 15:40:05 +02:00
Andre Bernet 57d541efc1 Backlight color support in companion 2014-04-23 15:31:12 +02:00
Andre Bernet 147b6af9cf Backlight color UI in firmware, backend TODO 2014-04-23 15:30:30 +02:00
Andre Bernet e3955159a2 Enable haptic fields for Taranis, add option for revisions < REVPLUS 2014-04-23 15:03:17 +02:00
Andre Bernet 5ad4543d91 Taranis Plus support in companion - DON'T FORGET COMPILE SCRIPT 2014-04-23 14:43:57 +02:00
Andre Bernet f29952616f Typo 2014-04-23 13:59:30 +02:00
Andre Bernet 528f1a4267 Gruvin is an m2560 2014-04-23 13:49:10 +02:00
Andre Bernet 31196c626b Long-standing typo 2014-04-23 13:37:56 +02:00
Andre Bernet c1cd268c00 Taranis default options 2014-04-23 13:36:21 +02:00
Andre Bernet 699707fba4 REVPLUS default options 2014-04-23 13:35:46 +02:00
Andre Bernet faa6cd7a3c Haptic support 2014-04-23 13:18:17 +02:00
Andre Bernet 867be03f96 Translations 2014-04-23 11:05:52 +02:00
mhotar 00a5819f3a cz translations wip 2014-04-23 00:01:28 +02:00
Andre Bernet 2ff45dd73c Remove stray voice language dropdown when not applicable 2014-04-22 16:38:43 +02:00
Andre Bernet 7bb54201cb Typos
French translations
2014-04-22 15:06:20 +02:00
Kjell Kernen 542ec36579 German and Finninsh translation files updated with lupdate to produce new files for translation. 2014-04-22 01:06:26 +02:00
Kjell Kernen 03a4221fe6 Swedish translation of Companion updated. 2014-04-22 01:05:27 +02:00
Kjell Kernen 198bcebabf Finnish Companion translation updated by Janne Huuskonen 2014-04-22 00:37:28 +02:00
Kjell Kernen 85a79b6819 German Companion translation updated by Hrenz 2014-04-22 00:36:45 +02:00
Andre Bernet 2e25d2ad23 French translations 2014-04-21 21:07:50 +02:00
Bertrand Songis b7351d2406 Merge pull request #1002 from projectkk2glider/lua_fixes
Lua fixes
2014-04-21 21:01:35 +02:00
Damjan Adamic d9c1bf767f Refactored luaGetValue(), my previous fix was incorrect. 2014-04-21 20:47:38 +02:00
Damjan Adamic cfa25ab030 Bad indentation 2014-04-21 20:26:23 +02:00
Damjan Adamic 3815ab8c45 Return nil if value not found in luaGetValue() 2014-04-21 20:17:30 +02:00
Damjan Adamic 36409c37f4 SOURCE type input for model scripts missing getValue() 2014-04-21 17:21:02 +02:00
Bertrand Songis be5ed503be Merge pull request #999 from projectkk2glider/mixes_tab_dragdrop_bug_issue_997
Improvement of inputs and mixers tabs in companion
2014-04-21 13:01:37 +02:00
Damjan Adamic a6ad130df7 Reverted commit 8c5fc3a01f (which prevented moving second mixer to the first line) 2014-04-21 12:22:25 +02:00
bsongis 5a06c42bca CompareDialog deleted just after creation 2014-04-21 08:27:37 +02:00
Damjan Adamic 3d35273f4f Merge branch 'upstream/next' 2014-04-20 22:17:25 +02:00
Damjan Adamic 27600ba37e Cosmetic changes 2014-04-20 22:12:55 +02:00
Damjan Adamic fc92ad3a86 Prevent drag&drop between inputs and mixers 2014-04-20 21:29:08 +02:00
Damjan Adamic 65521d96d4 Code refactoring
Added documentation
2014-04-20 19:06:55 +02:00
Damjan Adamic b70586bd9f Reverted to original code (both work) 2014-04-20 18:31:54 +02:00
Damjan Adamic a8c828f105 Corrected list items width (long items were wrapping)
Refactored inputs tab, same system as mixes tab (grouping of lines)
Fixed incorrect spacing for first list item
2014-04-20 18:27:28 +02:00
Damjan Adamic 0e7b420b71 Code cleanup 2014-04-20 15:40:40 +02:00
Andre Bernet 7f4d72c072 "Backup EEPROM" translatable 2014-04-20 14:23:16 +02:00
Damjan Adamic 95e7f7915b Better implementation, spacing now correct, drag&drop working.
Inputs tab still needs spaces converted to &nbsp;
2014-04-20 14:22:54 +02:00
Damjan Adamic 3df9fcb67a Working, but drawing is not perfect 2014-04-20 13:21:28 +02:00
bsongis 352066c7d1 Merge bug in AppPreferencesDialog: Cancel button broken! 2014-04-20 09:45:18 +02:00
bsongis c4eb1182df Fixes #998 2014-04-20 09:30:22 +02:00
Andre Bernet 2eed4ea8e2 Main window position restored (fix #996) 2014-04-19 20:49:11 +02:00
Andre Bernet c41c7469b8 Steps of 10 during key repeats for telemetry values - was awfully long now we have more resolution 2014-04-19 20:17:04 +02:00
mhotar 17c0032451 Merge remote-tracking branch 'origin/next' into mhotar/cz_translations 2014-04-19 18:23:23 +02:00
Andre Bernet 1f6e5544b8 Merge pull request #990 from opentx/bsongis/refactoring_firmware_interface
Bsongis/refactoring firmware interface
2014-04-19 17:59:33 +02:00
bsongis 22dde8014c Too early from this one 2014-04-19 08:52:18 +02:00
bsongis d7205c0601 Merge remote-tracking branch 'origin/next' into
bsongis/refactoring_firmware_interface

Conflicts:
	companion/src/fwpreferencesdialog.cpp
	companion/src/fwpreferencesdialog.h
	companion/src/fwpreferencesdialog.ui
2014-04-19 08:21:58 +02:00
Bertrand Songis 72aff8c738 Merge pull request #991 from opentx/dvogonen/move_firmware_selection_settings_988
Dvogonen/move firmware selection settings 988
2014-04-19 08:06:49 +02:00
Bertrand Songis 58b6d19030 Merge pull request #989 from aaronchch/aaronchch/heli_issue_934
Aaronchch/heli issue 934
2014-04-19 08:06:28 +02:00
Kjell Kernen f3678b2002 All firmware selections have been removed from the download dialog.
A consequence is that it is always possible to try to download voice files. Even for those boards that have no voice capability. I do not think that is a big problem. Anyone trying to download voice files for a unmodified 9x should not be surprised to get a "file not found" browser message.
2014-04-19 00:21:29 +02:00
bsongis 9341aff386 Options Checkboxes removed from the UI 2014-04-18 23:59:22 +02:00
bsongis 97796628af Merge remote-tracking branch 'origin/next' into bsongis/refactoring_firmware_interface 2014-04-18 23:02:21 +02:00
bsongis f2ec3f215b Merge remote-tracking branch
'origin/dvogonen/move_firmware_selection_settings_988' into
bsongis/refactoring_firmware_interface

Conflicts:
	companion/src/apppreferencesdialog.cpp
	companion/src/apppreferencesdialog.h
2014-04-18 23:01:32 +02:00
Andre Bernet 22ddb96526 French translations 2014-04-18 22:33:09 +02:00
Kjell Kernen c911098d84 AppPreferencesDialog is done. All firmware settings can now be selected, since the horrible, horrible code from downloadDialog has been integrated.
Next step:
Remove fw selection code from the download dialog and instead display default firmware name.
2014-04-18 22:20:43 +02:00
bsongis 146c421c84 Classes names capitalization 2014-04-18 18:11:22 +02:00
bsongis 5de6f4dc94 Now we are able to have Model windows with different transmitter types! 2014-04-18 17:34:41 +02:00
bsongis a5085cf7e2 Refactoring continued 2014-04-18 17:20:46 +02:00
bsongis 50a73a3af5 Each ModelEdit window now has its own FirmwareInterface (it means that
we could open 2 ModelEdit windows on different firmwares)
2014-04-18 16:55:53 +02:00
bsongis c5ac19a054 Refactoring FirmwareInterface / EepromInterface 2014-04-18 16:27:27 +02:00
bsongis 7dd9e2d1e2 Ignore list updated 2014-04-18 16:25:44 +02:00
aaronchch 9ae7cb771c Fixed tabs 2014-04-18 22:28:25 +12:00
aaronchch 1dd761b390 Fixes 934 2014-04-18 22:09:43 +12:00
Kjell Kernen ae3327f5a1 Scrapped first move attempt. To much work to do it this way. Will try a more direct approach. 2014-04-18 11:44:06 +02:00
Kjell Kernen 0785930011 Copied code and graphics from download dialog to radio settings tab.
Nothing has been removed or touched in the download dialog.
Absolutely nothing is functional yet, but it compiles.
2014-04-18 11:17:27 +02:00
bsongis 3a783658f9 Cosmetics 2014-04-18 11:13:06 +02:00
Kjell Kernen d42ac095aa German Companion translation from Hrenz 2014-04-18 10:53:25 +02:00
bsongis bfadb3664b New nice screen for Logical Switches 2014-04-18 10:47:32 +02:00
Bertrand Songis 4c3dd8a9b2 Update DONATIONS.txt 2014-04-17 18:54:37 +02:00
Bertrand Songis c8712db5ba Update tts.py 2014-04-17 17:33:07 +02:00
Kjell Kernen 7645c644bc Removing pointless compiler warnings 2014-04-17 12:54:21 +02:00
Bertrand Songis 94404b42ce Merge pull request #985 from opentx/kilrah/850_Plus_support
Support for backlight color (a slider from full A to full B?) and A3/A4
2014-04-17 12:04:18 +02:00
Andre Bernet 3d2a030868 Support for backlight color (a slider from full A to full B?) and A3/A4 2014-04-17 11:21:48 +02:00
bsongis 37960e6a9d Wrong unit used with ASpeed+ 2014-04-17 11:15:55 +02:00
mhotar 741b92721e CZ translations wip 2014-04-16 23:57:25 +02:00
mhotar aaa94ca2f8 CZ translations wip 2014-04-16 23:56:38 +02:00
mhotar c02dbae87a DREX checkbox offset can be set in translations file, so the "Dualrate/Expo enambled" can be better translated 2014-04-16 23:56:23 +02:00
Bertrand Songis c2119f0b22 Merge pull request #984 from opentx/driver33/pl_tr
new translation fixes
2014-04-16 23:02:59 +02:00
Jacek Drewniak 061db5e904 new translation fixes 2014-04-16 22:55:28 +02:00
bsongis b805b147f3 Issue #660 - Firmware part done. I need to check the ASM because when
compiled with the FRSKY_STICKS option enabled, the FW is lighter than
without the option!
2014-04-16 20:04:31 +02:00
bsongis 3829604480 Fixes #982 - Tests needed! 2014-04-16 19:49:20 +02:00
Bertrand Songis 97dee28ae1 Update DONATIONS.txt 2014-04-16 16:45:44 +02:00
bsongis c9b4b78abd Remaining qDebug 2014-04-16 14:24:54 +02:00
mhotar 9bb39a71ca Merge remote-tracking branch 'origin/next' into mhotar/cz_translations
Conflicts:
	companion/src/translations/companion_cs.ts
2014-04-16 13:12:30 +02:00
mhotar 1107e778b5 CZ translations wip 2014-04-16 13:05:13 +02:00
bsongis 2a7a0f0a47 One Dump remained active 2014-04-16 11:45:41 +02:00
Andre Bernet e502f6df6b French translations finished and purged of obsolete items 2014-04-16 11:25:26 +02:00
Andre Bernet b9bdb5c8fc All translations updated, go ahead! 2014-04-16 11:18:54 +02:00
Andre Bernet 1e4877eaf8 New warning 2014-04-16 11:18:06 +02:00
Andre Bernet 02e45c5eea Translation/typo cleanup finished 2014-04-16 11:07:07 +02:00
Andre Bernet e312454aca Translation/typo cleanup part 7 2014-04-16 09:43:40 +02:00
Bertrand Songis 05aaec3dc3 Merge pull request #975 from projectkk2glider/companion_memory_leaks
Companion memory leaks fixed
2014-04-16 09:40:11 +02:00
bsongis 4e28a0211b Ail and Ele broken when HELI option enabled 2014-04-16 09:35:01 +02:00
projectkk2glider 4ccbc13f6a Merge branch 'upstream/next' 2014-04-16 09:34:14 +02:00
bsongis f6d1b0c46f Cosmetics 2014-04-16 07:39:34 +02:00
bsongis f47cd81108 ExtraChannels Capacity removed 2014-04-16 07:27:39 +02:00
Bertrand Songis 6823fbdc5a Merge pull request #976 from projectkk2glider/companion_mixes_tab_highlights
Two visual enhancements to mixes tab in companion
2014-04-16 07:23:36 +02:00
Bertrand Songis 44a2e5231e Update DONATIONS.txt 2014-04-16 07:16:43 +02:00
Andre Bernet 02be92c561 Translation/typo cleanup part 6
French translations
2014-04-16 00:46:13 +02:00
Andre Bernet a8da67d0c3 No default trim button 2014-04-15 23:43:17 +02:00
Andre Bernet 55034273f6 Forgot a bit for #978... crash on load 2014-04-15 19:35:24 +02:00
Damjan Adamic 6354b83a0d Fixes suggested by Bertrand. ExtraChannels not yet removed 2014-04-15 19:12:29 +02:00
Andre Bernet e1372cf695 French translations part 2 2014-04-15 19:01:51 +02:00
Damjan Adamic cd9facb147 Some more code style changes, getting used to openTX style. 2014-04-15 18:56:09 +02:00
Damjan Adamic 7f7c722429 More cosmetic changes 2014-04-15 18:53:00 +02:00
Andre Bernet e11821b342 Translation/typo cleanup part 5 2014-04-15 18:50:28 +02:00
Damjan Adamic 4850541002 Fixes suggested by Bertrand 2014-04-15 18:47:47 +02:00
Andre Bernet 5402dd7ad9 Translation/typo cleanup part 4 2014-04-15 18:17:01 +02:00
bsongis 506bc9b6ae AirSpeed now in Knots (and converted to km/h and mph according to Tx
settings). Tests needed (LCD and audio)
2014-04-15 18:11:13 +02:00
bsongis 560cd8f619 Fixes #978 2014-04-15 18:02:47 +02:00
Andre Bernet 9ba8dfae44 Disable excessively incomplete translations (Fix #712) 2014-04-15 16:16:53 +02:00
Andre Bernet b873036c42 French translations part 1 2014-04-15 16:05:12 +02:00
Andre Bernet ec59baaf4a Translation/typo cleanup part 3 2014-04-15 16:04:12 +02:00
Andre Bernet 2daf4323ca Translation/typo cleanup part 2 2014-04-15 15:38:02 +02:00
Andre Bernet 38f8025221 Translation/typo cleanup part 1 2014-04-15 15:19:39 +02:00
bsongis 5c8504add6 Better fix for #977 2014-04-15 12:25:46 +02:00
bsongis 6011b971ad Fixes #977 2014-04-15 11:36:42 +02:00
mhotar 6ee5e4885f CZ translations wip 2014-04-15 00:02:38 +02:00
Andre Bernet 8c5fc3a01f Fix "Move up a mix will not move higher than the current topmost line entry" 2014-04-14 23:15:52 +02:00
Damjan Adamic 52954b1be4 * Added space between channels in mixers tab, amount defined by MIX_ROW_HEIGHT_INCREASE
* Added highlighting of selected channel when used as source in other channels (Ctrl+T or context menu->Toogle highlight)
* Added leading zero to channel name for ch_number < 10 (better alignment for CH1 to CH9)
2014-04-14 22:00:39 +02:00
Bertrand Songis 138b2deedc Update DONATIONS.txt 2014-04-14 21:55:48 +02:00
Damjan Adamic 5a522fac4b * One more leak fixed.
* debug print removed
2014-04-14 20:53:54 +02:00
Damjan Adamic df954ae483 Fixed many memory leaks 2014-04-14 20:25:17 +02:00
Andre Bernet b7cc3a5ef2 GVAR popups only for Taranis... 2014-04-14 19:20:46 +02:00
bsongis e11c14e66b Fixes #974 2014-04-14 19:04:32 +02:00
bsongis 785c17ed2f Fixes #973 2014-04-14 17:04:52 +02:00
bsongis 01ee8c31fc Fixes #934 2014-04-14 16:19:52 +02:00
Kjell Kernen f2dba0a9ba Updated German translation of OpenTX by Hrenz 2014-04-14 13:47:53 +02:00
Kjell Kernen 9b7cca6bcb German Companion translation updated by Hrenz 2014-04-14 13:44:19 +02:00
bsongis b605dd94eb Fixes #968 2014-04-14 13:31:09 +02:00
bsongis 255ce4de98 Fixes #965 2014-04-14 13:22:09 +02:00
bsongis a068323df1 strcasecmp used rather than strcmpi 2014-04-14 12:07:59 +02:00
Bertrand Songis 48d87cd3da Merge pull request #966 from projectkk2glider/sound_filenames_case_insensitive
Make flightmode, switch and system file names case insensitive
2014-04-14 11:59:42 +02:00
bsongis a3804b25e7 Fixes #967 2014-04-14 11:48:56 +02:00
Bertrand Songis 48161129e3 Update DONATIONS.txt 2014-04-14 10:41:09 +02:00
Andre Bernet 7ad04b8f32 Merge pull request #972 from opentx/driver33/PL_TR
small menu fixes
2014-04-13 08:57:57 +02:00
Jacek Drewniak daa34d6d5b small menu fixes 2014-04-13 00:31:47 +02:00
Andre Bernet e8565b49e0 Flash wasn't unlocked for USB access 2014-04-12 23:22:06 +02:00
Andre Bernet db419fd459 Reset button in telemetry log viewer (fix #962) 2014-04-12 15:57:32 +02:00
Andre Bernet 36e573d024 Merge pull request #970 from opentx/driver33/PL_TR
Fixes to PL
2014-04-12 15:37:55 +02:00
Jacek Drewniak cbabb15556 Fixes to PL 2014-04-12 10:18:21 +02:00
Andre Bernet 52c58b917c FM0 was not converted (fix #964) 2014-04-11 21:50:01 +02:00
Damjan Adamic 2cfd95a026 Make flightmode, switch and system file names case insensitive. 2014-04-11 20:16:51 +02:00
Andre Bernet ac1dbf81f4 Flash only unlocked when needed 2014-04-11 11:18:58 +02:00
Andre Bernet d442fa77e0 Better file validity checks 2014-04-11 10:14:34 +02:00
Andre Bernet 10f16583e0 In "Write Firmware", as long as a valid file was selected once, canceling then selecting an invalid file would pass the valididty check.
Fixes it, but not sure why it is required as we're supposed to overwrite the buffer each time we load a file for flashing - there might be a better fix.
2014-04-11 00:49:32 +02:00
Andre Bernet da23a6cf6c GVAR popup enable checkboxes in companion 2014-04-10 23:48:06 +02:00
bsongis 4eb279e157 Cosmetics 2014-04-10 16:22:48 +02:00
bsongis 5db4aa57b1 Control on simu path to avoid double // and search a file over the
network ...
2014-04-10 16:20:58 +02:00
bsongis cb2e3325cd Jenkins not happy 2014-04-10 13:47:57 +02:00
bsongis f6c8053d00 Functions signature changed (const void *) for EEPROM / Firmware checks 2014-04-10 13:36:40 +02:00
bsongis aec13e3e97 Firmware control in Bootloader (when flashed from massstorage) 2014-04-10 13:18:07 +02:00
bsongis 1b34d178b0 ersky9x EEPROM format allowed in Bootloader Restore 2014-04-10 12:50:45 +02:00
bsongis ed3bc66ea1 Many little differences in logical switches (telemetry sources) between
Companion and the FW (especially on 9x stock board)
2014-04-10 12:35:58 +02:00
Andre Bernet c19dea8472 Standalone simu would crash for "normal" Windows users on launch as they don't have write permissions to the Program Files folder. New method should be portable and store eeprom files in the user's standard document location. 2014-04-10 10:24:11 +02:00
bsongis cb7484cffa Jenkins was not happy 2014-04-09 21:47:35 +02:00
Andre Bernet 9135409e67 Companion will still find old TARANIS.BIN files 2014-04-09 21:17:56 +02:00
bsongis 5aaa560cb4 Fixes #456 2014-04-09 20:58:28 +02:00
Andre Bernet f08a3f6613 SH momentary in simu 2014-04-09 20:44:01 +02:00
Andre Bernet af4f8e7f36 Merge pull request #961 from opentx/kilrah/bl_eeprom_save_load
Kilrah/bl eeprom save load
2014-04-09 20:36:03 +02:00
bsongis 80c7dc53fc AirSpeed IDs from FrSky draft 2014-04-09 20:02:32 +02:00
bsongis 6c25307b48 AirSpeed has the same scale than GPS Speed 2014-04-09 20:00:45 +02:00
bsongis 5e875786cd Trainer menu display bug 2014-04-09 19:53:31 +02:00
bsongis 471794a1dc Missing file 2014-04-09 17:49:56 +02:00
bsongis d1f45951fc Whole EEPROM Backup 2014-04-09 17:30:29 +02:00
Andre Bernet 7540768c1f Invalid file now reported correctly 2014-04-09 14:54:02 +02:00
Bertrand Songis 3e6df4b67c Update DONATIONS.txt 2014-04-09 14:39:56 +02:00
Bertrand Songis 19730d4527 Update DONATIONS.txt 2014-04-09 14:23:09 +02:00
Andre Bernet f3f7fc31b4 Reordering to force a display refresh 2014-04-09 14:12:46 +02:00
Andre Bernet bef65d304b Don't always rewrite the same block... 2014-04-09 13:54:20 +02:00
Bertrand Songis ff2eb36887 Update boot.cpp 2014-04-09 13:30:15 +02:00
Bertrand Songis de9e2a50bc Update boot.cpp 2014-04-09 13:27:28 +02:00
Andre Bernet 5c4e921899 Compilation error when PHONON not present 2014-04-09 12:58:48 +02:00
Andre Bernet 498272bfd2 Navigation 2014-04-09 12:14:02 +02:00
Kjell Kernen ea1e7bdc87 Updated Finnish Companion translation. Getting close now 2014-04-09 12:00:04 +02:00
bsongis 6a3a245ed8 Compilation failure (Companion) 2014-04-09 11:58:01 +02:00
bsongis 5dab6ef38f EEPROM Restore added in Bootloader 2014-04-09 11:51:38 +02:00
Kjell Kernen 358992c48f Fixes #959 2014-04-09 11:05:56 +02:00
Andre Bernet 4f7a98be01 French translations 2014-04-09 10:13:20 +02:00
bsongis ab7218e5cf Merge remote-tracking branch 'origin/next' into
kilrah/bl_eeprom_save_load

Conflicts:
	radio/src/bootloader/boot.cpp
2014-04-09 10:05:42 +02:00
bsongis aaec5f8fb0 No more global warning displayed only on Main View. Global warning will
be displayed on all menus. Saves flash on stock 9x!
2014-04-09 09:55:40 +02:00
Bertrand Songis 7ba16bccb4 Merge pull request #958 from opentx/kilrah/158_12_cells_in_telemetry_view
Kilrah/158 12 cells in telemetry view
2014-04-09 09:53:23 +02:00
Bertrand Songis 53719f1807 Update DONATIONS.txt 2014-04-09 08:00:25 +02:00
Andre Bernet 33d0222e10 Merge pull request #957 from opentx/mhotar/inversion_marking
'!' font method used instead of vlineStip #956
2014-04-09 00:10:08 +02:00
mhotar 33a44322dc '!' font method used instead of vlineStip #956 2014-04-08 23:39:05 +02:00
Andre Bernet 58b00334ff Merge pull request #955 from opentx/driver33/PL_TR
PL_translations fix
2014-04-08 23:35:44 +02:00
Andre Bernet 2a337543d6 Cosmetics 2014-04-08 23:32:30 +02:00
Jacek Drewniak f3088920af PL_translations fix 2014-04-08 23:08:03 +02:00
bsongis a84427e260 UnlockFlash called only one time (or it reboots at the 2nd time) 2014-04-08 22:10:12 +02:00
bsongis 31183cb840 Compilation failure fixed. Plus bootloader check. 2014-04-08 21:47:59 +02:00
bsongis ff7a4599e9 Bootloader can now be flashed from the SD Manager 2014-04-08 21:19:35 +02:00
bsongis fd92c3877b AirSpeed was divided by 100 when displayed 2014-04-08 21:19:35 +02:00
bsongis 96aa54ac77 Code moved 2014-04-08 21:19:35 +02:00
bsongis 896ff1e386 Code moved 2014-04-08 21:19:35 +02:00
bsongis 77477c1687 Cosmetics 2014-04-08 21:19:35 +02:00
bsongis 563aa62fcd BOOT was optimized away 2014-04-08 21:19:35 +02:00
bsongis 845e6e06ea Added boot section with "BOOT" to allow the bootloader to be recognized 2014-04-08 21:19:35 +02:00
bsongis a4d6a6f5e3 Port of Mikes's correction on Bootloader (STM bug) 2014-04-08 21:19:35 +02:00
Bertrand Songis 721ffc75dd Update DONATIONS.txt 2014-04-08 19:12:02 +02:00
Bertrand Songis 99fbb69cf5 Update DONATIONS.txt 2014-04-08 17:59:33 +02:00
Andre Bernet 5ee181dc09 Some logic added 2014-04-08 17:09:29 +02:00
Andre Bernet 578a94f744 Merge pull request #954 from opentx/bsongis/Bootloader_FIRMWARE_exported_in_masstorage
Bsongis/bootloader firmware exported in masstorage
2014-04-08 16:50:11 +02:00
Andre Bernet ad465aaf21 UI 2014-04-08 16:41:14 +02:00
Andre Bernet 63c3ae5a7a Update eeprom file name in companion 2014-04-08 16:13:50 +02:00
bsongis 692b13bba5 FIRMWARE.BIN now exported in Taranis massstorage 2014-04-08 15:55:46 +02:00
bsongis 2443b27b72 New script to calculate FAT12 structure 2014-04-08 15:53:50 +02:00
Kjell Kernen c7d14939a9 Finnish translation of Companion. 2014-04-08 13:22:37 +02:00
Kjell Kernen 0ea06cba2a Swedish translation of everything in Companion, except the telemetry labels. I have a hard these and will reconsider the ones I have translated this far to make a consistent translation. 2014-04-08 12:46:17 +02:00
Andre Bernet 1b76c9a754 Merge pull request #952 from opentx/bsongis/Bootloader_port_mac_fixes_from_mike
All good!
2014-04-08 11:21:30 +02:00
bsongis a514b8e027 Compilation failure 2014-04-08 11:10:21 +02:00
Kjell Kernen 53269df1ba German Companion translation file from Helle 2014-04-08 10:43:15 +02:00
bsongis 30111d9299 Bootloader MAC fixes from Mike 2014-04-08 10:26:08 +02:00
Andre Bernet 5f736554bb Logging fixed, didn't notice the new macro 2014-04-08 10:01:21 +02:00
bsongis a72df4ca16 Fixes #951 2014-04-08 10:00:07 +02:00
bsongis 4c2dabb287 Logical Switches badly displayed on Sky9x when configured with a
telemetry source
2014-04-08 08:24:01 +02:00
Bertrand Songis 5c3bb2ab06 Update eeprominterface.cpp 2014-04-07 21:28:23 +02:00
Bertrand Songis d22529f181 Update eeprominterface.cpp 2014-04-07 21:27:41 +02:00
bsongis 6af9abd9b7 Temporary S.PORT IDs for AirSpeed sensor 2014-04-07 20:01:46 +02:00
bsongis a4f378d726 ASpeed+ added to the telemetry sources list 2014-04-07 19:43:29 +02:00
bsongis 68a45467c5 Fixes #934 (tests needed, I am not at all an HELI flyer!) 2014-04-07 18:09:33 +02:00
bsongis 97cf0544a7 Fixes #938 2014-04-07 17:47:10 +02:00
bsongis 7fdc23b5bb Fixes #942 2014-04-07 17:35:06 +02:00
bsongis 9172eaff6d Fixes #939 2014-04-07 17:16:36 +02:00
bsongis e1df9df40f Custom Switches renamed to Logical Switches in comments 2014-04-07 17:02:24 +02:00
bsongis 711112846c Fixes #946 2014-04-07 16:50:42 +02:00
bsongis b36393e155 Fixes #936 2014-04-07 15:53:21 +02:00
bsongis 4a8b8834a2 Fixes #948 2014-04-07 15:37:32 +02:00
Bertrand Songis 4864af2bfa Update DONATIONS.txt 2014-04-07 14:23:26 +02:00
bsongis 03ab5adfc1 Compilation problem on Sky9x without FrSky module / telemetry 2014-04-07 12:00:02 +02:00
bsongis d1d499a299 Conversions now run when restoring old Model backups 2014-04-07 12:00:02 +02:00
Bertrand Songis 451463505d Merge pull request #943 from opentx/kilrah/simu_trim_keys
Kilrah/simu trim keys
2014-04-07 10:41:14 +02:00
Kjell Kernen b7ace8526b Changed direction defaults for ailerons, flaps and airbrakes after input from people on openRCforums. There really is no right or wrong, but the most common view seems to be that it is best to let the default channel weights mirror the logical travel of control surfaces. OK by me.
Also fixed bug in prebooking of channels.
2014-04-07 10:12:48 +02:00
Andre Bernet b894d0f267 Compilation error 2014-04-07 09:35:59 +02:00
Andre Bernet 4dd72782c2 Merge branch 'next' of https://github.com/opentx/opentx into kilrah/158_12_cells_in_telemetry_view
Conflicts:
	radio/src/logs.cpp
	radio/src/telemetry/frsky.h
	radio/src/telemetry/frsky_sport.h
2014-04-07 09:28:26 +02:00
Bertrand Songis fa1218417a Update DONATIONS.txt 2014-04-07 07:37:19 +02:00
Andre Bernet 6ebefe9e69 Autosource in SFs where applicable (fix #944) 2014-04-06 23:54:21 +02:00
Andre Bernet 9f5ce8f0a6 Refresh incomplete after SF paste, fix #941 2014-04-06 23:18:17 +02:00
Andre Bernet 514d3fdad2 Add trim keys to 9x simu too while we're at it 2014-04-06 22:38:58 +02:00
Andre Bernet d33d2b7ae6 Add trim keys to Taranis simu 2014-04-06 22:25:34 +02:00
Andre Bernet b4ae7e232f Fix #940 2014-04-06 13:55:30 +02:00
bsongis e1e15787c5 Missing initialization in simulator. Does if fix #937? 2014-04-06 10:57:15 +02:00
Andre Bernet ae3f207140 Add support for Dutch language 2014-04-06 10:23:09 +02:00
Andre Bernet 6ee3921bce Update all translation files, discarding obsolete strings due to the number of changes. We're likely close enough for translators to have a go now! 2014-04-06 10:22:39 +02:00
bsongis 8f47a2ebb5 Wrong key for RESET in DEBUG menu 2014-04-05 17:10:58 +02:00
Bertrand Songis 5d40e1e5c9 Merge pull request #929 from opentx/andreas/issue_888_throttle_trace_calc_not_very_accurate
Andreas/issue 888 throttle trace calc not very accurate
2014-04-05 09:40:36 +02:00
bsongis 1751a1a06c Duplicated code removed 2014-04-05 08:28:06 +02:00
bsongis f2af6bf854 Warning pop-up disappearing a soon as one exits telemetry view screen 2014-04-05 07:57:06 +02:00
Kjell Kernen 6e2d3c3a63 Merge pull request #923 from opentx/dvogonen/Fix_channel_odering_922
OK, if the code isn't duplicated, it is needed. So in it goes.
2014-04-05 01:01:18 +02:00
Kjell Kernen 319ec11fab Merge pull request #927 from opentx/dvogonen/introduce_backup_radio_concept_924
The term Backup Radio File introduced
2014-04-05 00:59:17 +02:00
Andre Bernet cbd4186f8c Merge remote-tracking branch 'hrenz/patch-1' into next
Conflicts:
	radio/src/translations/de.h.txt
2014-04-04 23:26:32 +02:00
Bertrand Songis 29e47006ae Merge pull request #930 from projectkk2glider/usb_fixes
USB library fixes according to ST's published known bugs list
2014-04-04 22:09:51 +02:00
Damjan Adamic e4416e6134 USB library fixes according to ST's published known bugs list 2014-04-04 22:03:31 +02:00
bsongis 1b2db2e2b5 FlashInterface rework (missing initialisations, a lot of errors in
valgrind, duplicated code, unused functions, etc.)
Does it fix Issue #925?
2014-04-04 21:48:27 +02:00
hrenz e00f008460 04.04. German Update de.h.txt
Range now back to original
2014-04-04 18:34:43 +02:00
hrenz eec02abf23 04.04. German Update de.h.txt
Hy Kilrah,
Range back to Original for AreaWindow
2014-04-04 18:25:21 +02:00
Kjell Kernen ad9b32beba Removed the functional change I made for #874.
Introduced the term Radio Backup File to describe the eprom files that are uploaded from the radio.
The terms Radio, Tx and TX were used intermittently. I changed them all to Radio (naturally not in contexts having anything with the actual radio transmitting circuit).
2014-04-04 17:32:35 +02:00
Andre Bernet e2e537060c Merge #926 - Reverted STR_RESET (used at multiple places) and Range (nothing to do with the multipos pots, will be for user defined ranges of any source, for example "throttle stick between -23 and +12") 2014-04-04 17:22:44 +02:00
hrenz 796b322edf 0404 German Update de.h.txt
Date 04.04. small changes
Update German de.h.txt
Testet with th9x and Taranis
2014-04-04 16:56:20 +02:00
Andre Bernet 79dbd89214 French translations 2014-04-04 15:30:22 +02:00
Kjell Kernen 63bacf04f8 This takes care of connection sources to the right channels. BUt I have a terribel feeling that I must be duplicating code. This code just has to exist somewhere. 2014-04-04 14:41:09 +02:00
Kjell Kernen 4c6cdd4ed5 Moved Andrés new application selection next to the other selection check boxes. This seems like a natural fit to me, but please protest if you are of another opinion. I could also have added a horizontal line (there is a trick to it).
Set the first tab back as start tab in application settings dialog.
Added automatic conversion of the old companion9x setting for using the wizard for creating models.
2014-04-04 10:54:01 +02:00
bsongis 38e6b2f4b6 Logical Switches V2 multiplier was wrong for Altitude on Sky9x 2014-04-04 09:50:04 +02:00
bsongis 4f7b19ac99 Shift in Sky9x EEPROM 2014-04-04 09:11:31 +02:00
bsongis 3f9bbbc393 Double precision V2 in logical switches for Companion/Sky9x board 2014-04-04 08:21:56 +02:00
bsongis d2a99aadd5 Small code refactoring 2014-04-04 08:04:53 +02:00
Andre Bernet 09e1ac33b1 App preference to use wizard on new model creation. I noticed there was a stub for it just when I was about to finish - anyway now it's done.
I tried adding a line in the ui to separate the setting like done for other groups, but failed to get a horizontal line that spans the whole width despite spending half an hour in that ******* QT designer.
2014-04-03 23:55:35 +02:00
bsongis ec260cbfa8 Bugs in Sky9x v215-v216 EEPROM conversion 2014-04-03 22:34:49 +02:00
Andre Bernet 573e8600e3 Merge branch 'kilrah/667_extended_limits' into next
Conflicts:
	companion/src/modeledit/modeledit.cpp
2014-04-03 21:22:15 +02:00
Andre Bernet 144952f46d Include DR/Expo was still showing for Taranis 2014-04-03 21:10:36 +02:00
Andre Bernet a1277a7af0 Match companion tab order to firmware 2014-04-03 21:06:57 +02:00
Andre Bernet c65b26ec69 Firmware/companion string consistency 2014-04-03 21:04:36 +02:00
Andre Bernet 0075f20ae4 Module/protocol combinations were wrong in companion 2014-04-03 20:35:57 +02:00
Andre Bernet 821a4b9289 Module/protocol combinations were wrong in companion 2014-04-03 20:32:14 +02:00
Andre Bernet 8ae44231f0 DBLKEYS broken in limits on Taranis 2014-04-03 16:55:54 +02:00
Kjell Kernen 42db8824ab Changed Wizard defaults for servo direction slightly to reflect that elevons and ailerons move in different directions, while airbrakes and flaps move in the same direction.
Mirrored wing servo installations are assumed.
2014-04-03 14:06:43 +02:00
Kjell Kernen b7a4b75479 All unused comboboxes are dissabled in the Wizard. 2014-04-03 13:43:15 +02:00
Bertrand Songis 95acb16c96 X and Y swapped in Companion simulator right trims 2014-04-03 13:32:43 +02:00
Bertrand Songis 0789bb83b1 Include DR/Expo should be hidden in MixerDialog on Taranis 2014-04-03 12:26:34 +02:00
Bertrand Songis f86cf7f48a My last commit that fixed bad rounding did increase flash usage on 4.7 compiler (which is the official one) 2014-04-03 12:10:56 +02:00
Kjell Kernen 2335c13a90 Fixes #915 2014-04-03 10:12:33 +02:00
Bertrand Songis e2f0fc039f Update DONATIONS.txt 2014-04-03 09:09:48 +02:00
mhotar 47bd738662 wiz images 2014-04-02 23:52:00 +02:00
Andre Bernet d9c60a9586 Alignment in generaledit 2014-04-02 22:01:32 +02:00
openfsguruh 30099dc5cd changed rounding for gModelMax.
This should prevent counting THROTTLE faster than 100%, if
ACCURAT_THROTTLE_STATS is set to NO and ATMEL based Transmitters are used.
2014-04-02 21:29:00 +02:00
Andre Bernet 3fefcfda53 Bootloader progress bar was still wrong 2014-04-02 20:42:41 +02:00
Andre Bernet 51b160a15c Fixes #918 more 2014-04-02 20:13:28 +02:00
bsongis 1d5a33b981 Fixes #918 2014-04-02 18:59:57 +02:00
Andre Bernet fae5686258 Fix #917 2014-04-02 18:27:50 +02:00
bsongis 38bbde82bf Bug when trim mode was -- (trim disabled)
Fixes #912
2014-04-02 18:27:58 +02:00
bsongis 8f5169c9ec Bad rounding with negative values (99% weight on a negative source).
Saves even flash on stock 9x board.
2014-04-02 18:14:35 +02:00
bsongis 3c3a5851f5 Another limit was hardcoded in PPM pulses (ARM). We will live another
night with 150% limits ...
2014-04-02 16:09:19 +02:00
bsongis b8f97212cf Back to 125% with extended limits 2014-04-02 15:24:28 +02:00
Kjell Kernen 3d5a05538a A new solution for avoiding to select the same channel several times in the same dialog. This time a real one, that should work regardless of how many channels are selected in a dialog, etc. 2014-04-02 15:13:35 +02:00
bsongis a3344f399b Fixes #904 2014-04-02 14:21:36 +02:00
openfsguruh 7ec8392c81 This should solve issue #888;
You have to specify the compile option if you are on a Atmel based CPU like Turnigy9x:

ACCURAT_THROTTLE_STATS=YES

The reason why this fix is not always activated:
- It costs about 18bytes additional flash
- There are rare cases you will notice the rounding issue at all.

Don't bother on Taranis, the fix is activated on this automatically.
2014-04-02 13:13:22 +02:00
Kjell Kernen 5a67212b20 Fixes #908 2014-04-02 12:18:28 +02:00
bsongis 6b2ca5d8dd Fixed Splash fixes. While testing Issue #904 existing code ... 2014-04-02 12:17:31 +02:00
bsongis 4e65718126 Issue #909 fixed 2014-04-02 12:00:41 +02:00
bsongis 1bf95c9438 36 switches hidden in Companion when no Multipos switches ... 2014-04-02 10:25:07 +02:00
bsongis a522dc149f Issue #913 fixed 2014-04-02 09:28:58 +02:00
Bertrand Songis d988b7da64 Merge pull request #910 from opentx/mhotar/CZ_translations
Mhotar/cz translations
2014-04-02 07:54:59 +02:00
mhotar 8bffd10084 BDLSIZE special characters were not remapped 2014-04-02 01:11:27 +02:00
mhotar c93ae32139 CZ translations 2014-04-02 01:02:05 +02:00
bsongis 376ab58437 128 blades, is it ok? If no, just one constant to modify. 2014-04-01 22:01:11 +02:00
bsongis 213a7d2526 Cosmetics 2014-04-01 22:00:29 +02:00
bsongis c4e685170d ModelEdit window will open faster (we need only one Phonon object, not
64!)
2014-04-01 21:24:10 +02:00
bsongis 6bf5409707 Ignore list updated 2014-04-01 19:15:36 +02:00
bsongis c3ba95a980 Issue #893 - Extended Limits increased to +/-150%. Perhaps it will be
reverted later, but it will be only one constant to change, the code is
cleaner.
2014-04-01 18:24:48 +02:00
bsongis c57213459f Issue #903 fixed 2014-04-01 18:13:36 +02:00
bsongis 6c5150de8c PPM=US is now fixed on Taranis. Still remaining the problem with GVARS
as described in Issue #893 (a model configured with a GVAR in Limits
won't work the same way on a PPMUS firmware or on a !PPMUS firmware)
2014-04-01 16:51:50 +02:00
Kjell Kernen 9356a3bd41 Swedish translation of almost all new Wizard strings. 2014-04-01 15:20:59 +02:00
Kjell Kernen cad1850116 Flaps and air brakes have been added. The Wizard is now done as far as OpenTX 2.0 is concerned (Helicopter functionality to be added in 2.x) 2014-04-01 12:56:18 +02:00
bsongis 7a29fcf266 Fixes Issue #898 2014-04-01 11:30:31 +02:00
Kjell Kernen 342aa93213 V-tail and Elevon mixing added to wizard. 2014-04-01 01:11:23 +02:00
mhotar a527a869c1 wiz images and source vectors 2014-04-01 00:44:52 +02:00
bsongis ed1457f9f1 Warning fixed on simu 2014-03-31 20:27:46 +02:00
Kjell Kernen efcdaa31d6 Model Wizard turned back on.
Helicopter part diasabled since it is not finished. The rest should work.
2014-03-31 16:12:00 +02:00
Bertrand Songis 684b7529b6 Merge pull request #899 from opentx/dvogonen/wizard
Dvogonen/wizard
2014-03-31 13:38:12 +02:00
Kjell Kernen 31a5fc2e63 Wizard merged with next.
Wizard turned off by hard coding.
Fixes #897
2014-03-31 13:28:19 +02:00
bsongis 7379341559 Issue #896 fixed 2014-03-31 12:54:56 +02:00
bsongis da81bda26d Issue #852 fixed 2014-03-31 12:08:03 +02:00
bsongis 59aabb4ee5 Issue #892 fixed 2014-03-31 11:32:29 +02:00
bsongis 1503b83dec Issue #891 fixed 2014-03-31 10:31:58 +02:00
bsongis 026f756475 Issue #890 fixed 2014-03-31 10:23:06 +02:00
Kjell Kernen 8059daccaf Merge branch 'origin/next'
Conflicts:
	companion/src/CMakeLists.txt
	companion/src/apppreferencesdialog.ui
	companion/src/companion.qrc
	companion/src/mdichild.cpp
2014-03-31 10:22:23 +02:00
bsongis 7d5b876e27 ARM boards now allow 1 blade in Companion. Shift in Stock-9X EEPROM. 2014-03-31 09:58:28 +02:00
bsongis 1875785cf8 Curve Wizard is completely rewritten 2014-03-30 23:13:26 +02:00
Bertrand Songis 91fa910f84 Update DONATIONS.txt 2014-03-30 21:27:58 +02:00
bsongis 21b5b80491 Bitmaps were limited to 8 chars instead of 10 chars 2014-03-30 09:55:49 +02:00
Bertrand Songis c8444b91bb Merge pull request #887 from opentx/driver33/PL_TR
PL transpation fixes
2014-03-30 08:03:34 +02:00
Bertrand Songis 3a26790b7f Update CMakeLists.txt 2014-03-29 20:40:57 +01:00
Jacek Drewniak e9cc42751f PL transpation fixes 2014-03-29 18:21:44 +01:00
Bertrand Songis 42727e6e19 Visual C++ Compilation 2014-03-29 11:47:58 +01:00
Bertrand Songis 71fb790248 Dependencies updated 2014-03-29 10:33:05 +01:00
bsongis bb57755f5e EEPROM conversions on sky9x 2014-03-29 10:07:22 +01:00
Bertrand Songis 6b4c5bb754 Merge pull request #884 from hrenz/patch-3
Patch 3  2903 010 German update compiled tested ok, no errors
2014-03-29 07:49:44 +01:00
Bertrand Songis 967770376f Update DONATIONS.txt 2014-03-29 07:46:21 +01:00
hrenz 2839591917 2903 010 update german de.h.txt
2903 010  compiled and tested ok
think its now the latested German
2014-03-29 07:09:38 +01:00
bsongis 02bb061b1d Display problem on PlayTrack function, when the user wanted to select
below 1x which is !1x - which means don't play this track at startup
2014-03-28 17:52:08 +01:00
bsongis 59aa647c3d ModelData size on Sky9x was too big 2014-03-28 17:35:32 +01:00
hrenz d48ffac93d 2803 008 German small changes
2803 008 weitere kleine Anpassungen
2014-03-28 14:59:28 +01:00
hrenz 28f5d1eec4 2803 007 German update
some more details updates
direct in Edit of github
2014-03-28 14:50:17 +01:00
hrenz f0cb7e2596 2803 007 German update
2803 007 German update 
some same changes 
direkt at edit github
2014-03-28 14:29:44 +01:00
hrenz e19ff2ce6b Delete 2803_006_German_Test 2014-03-28 14:02:04 +01:00
Kjell Kernen 00b0ddef8b Final pixel pinching to get the best possible item alignment on both Windows and Linux. I do not even want to know how things look on a Mac. I am tired of this :) 2014-03-28 13:53:31 +01:00
Kjell Kernen b54f41c47f Tightened up the layout of the Telemetry tab of model edit.
It is the widest one, so it is setting the mninimum width for all tabs. Important to keep it tight.
2014-03-28 13:39:53 +01:00
hrenz ffff419bb1 Create 2803_006_German_Test 2014-03-28 12:40:07 +01:00
Kjell Kernen cbb8486c75 Telemetry tab looked great on Linux. Not so great on Windows. Group boxes display very differently on these platforms. 2014-03-28 10:49:36 +01:00
bsongis 11566674fb The asterisk for GVARS popups was not visible 2014-03-28 09:14:24 +01:00
bsongis 2984a476a4 Issue #880 fixed 2014-03-28 09:04:44 +01:00
Bertrand Songis f2f20520e3 Merge pull request #881 from opentx/dvogonen/modeledit_layout_adjustments
A few minor adjustments to modeledit to give it a more consistent layout for both Taranis and 9x.
2014-03-28 07:40:28 +01:00
Kjell Kernen e61b411d7a A few minor adjustments to modeledit to give it a more consistent layout for both Taranis and 9x. 2014-03-28 01:20:01 +01:00
bsongis 34b2fdcd7e Issue #877 fixed 2014-03-27 19:06:32 +01:00
bsongis 4abfa688f8 Issue #871 fixed 2014-03-27 18:46:44 +01:00
bsongis 82ea14e014 Issue #871 fixed 2014-03-27 18:27:40 +01:00
bsongis 0b881fea00 Normal precision for min/max Limits on sky9x 2014-03-27 17:51:43 +01:00
bsongis a72396620d Corrections for sky9x 2014-03-27 17:51:43 +01:00
Kjell Kernen 838bf165ba Improvement of Bertrands fix for #875 2014-03-27 17:21:35 +01:00
bsongis 6d1ad5d121 Issue #875 fixed 2014-03-27 16:30:04 +01:00
Bertrand Songis e24301cf13 Update DONATIONS.txt 2014-03-27 16:10:14 +01:00
Kjell Kernen 54eb567770 Fix for #874.
Also killed some unused defines that were only confusing.
2014-03-27 13:57:15 +01:00
Kjell Kernen b5840ee906 Dialog adjustments to "Taranis Not Found Dialog" 2014-03-27 12:03:56 +01:00
bsongis a1a82ad137 Cosmetics 2014-03-27 10:05:26 +01:00
bsongis e10305a4e6 Issue #869 - Trim in Mixes back also in Companion 2014-03-27 10:05:26 +01:00
bsongis 719b519650 Issue #869 - Trim ON/OFF is back in mixer. I wonder now if we couldn't
add the possibility to hide the Virtual Inputs menu as many people won't
use it (It's now possible to select a stick in the mixer, and as soon as
the trim checkbox is ON, it will work perfectly!)
2014-03-27 10:05:25 +01:00
mhotar abbb9aac08 wiz images 2014-03-26 23:39:21 +01:00
Kjell Kernen b3864e590b Merge pull request #872 from opentx/dvogonen/more_informative_taranis_not_found_dialog
Added visual information about the need to hold the trims while booting to use USB
2014-03-26 23:27:07 +01:00
Kjell Kernen 8d85ca9bcb Added visual information about the need to hold the trims while booting to use USB.
I have a strong feeling that without this information, this will be the most common question going forward.
2014-03-26 23:22:34 +01:00
Bertrand Songis 6a6489a060 Merge pull request #856 from m3zercat/additional-com-ports-listed
Com ports listed in Configuration window don't reflect those available on the system.
2014-03-26 14:18:21 +01:00
Bertrand Songis 7584888869 Merge pull request #867 from hrenz/patch-2
Update de.h.txt
2014-03-26 14:16:23 +01:00
Bertrand Songis 9a5d757ba3 Merge pull request #868 from opentx/dvogonen/fix_width_issues_in_model
Updated width settings for Channels, Switches and Special Functions tabs
2014-03-26 13:31:23 +01:00
bsongis 51d93b8bde Issue #857 - Better rounding also in Companion. Warning removed in
simulator
2014-03-26 13:00:51 +01:00
Kjell Kernen ffa06b0143 Updated width settings for the Channels, Logical Switches and Special Functions tabs. Used to look good for Taranis and not at all good for 9x. Both OK now. 2014-03-26 12:48:25 +01:00
bsongis 2fb2638321 Issue #857 - better fix with divRoundClosest 2014-03-26 12:41:31 +01:00
hrenz 9d731bafa6 003 update de.h.txt
003 HMS to GMS  Grad Minute Secunde
2014-03-26 12:21:33 +01:00
Kjell Kernen ef95b8e01d Adding wait cursor during opening of edit window, which takes a long time. 2014-03-26 10:31:05 +01:00
bsongis db8071fc36 Issue #667 fixed 2014-03-26 10:28:36 +01:00
bsongis 5e32b1f9ba GVARS at 4096 instead of 512 (Companion conversions) 2014-03-26 10:01:55 +01:00
hrenz 4dc9024e0a Update de.h.txt
kleine Anpassungen Variotöne, Servoweg
2014-03-26 09:56:36 +01:00
bsongis e0b0bbb517 GVARS start now at 4096 instead of 512 (it's needed in limits) 2014-03-26 09:37:07 +01:00
bsongis 22942b3615 8bits overflow in limits 2014-03-26 09:36:04 +01:00
bsongis f9b9df3a83 Negative curves badly displayed 2014-03-26 09:34:23 +01:00
bsongis 09fc2af254 Taranis has 32 curves, only 16 were shown in Companion 2014-03-26 09:29:05 +01:00
hrenz 3286318bda Update de.h.txt
Only small changes for testing the update prozess at github
if running I will make all the changes next days
2014-03-26 09:21:20 +01:00
bsongis ffe1c3f737 Issue #857 - Offset Companion conversion fixed 2014-03-26 08:59:45 +01:00
bsongis 1328893f5d Issue #857 - Offset rounding in conversion fixed 2014-03-26 08:53:54 +01:00
bsongis 95c8f460a3 Issue #855 fixed 2014-03-26 08:49:34 +01:00
bsongis e66c44b3e9 Issue #864 fixed 2014-03-26 07:30:45 +01:00
bsongis 0ab77f7e90 Issue #865 fixed 2014-03-26 07:25:25 +01:00
Bertrand Songis d1b1044cac Update DONATIONS.txt 2014-03-26 06:51:20 +01:00
bsongis 8ae3276747 Issue #863 fixed (Companion part done) 2014-03-25 20:44:12 +01:00
bsongis 78bdff492d Issue #863 fixed (firmware part) 2014-03-25 19:56:10 +01:00
bsongis c5b0e79e99 Issue #860 fixed 2014-03-25 19:18:28 +01:00
bsongis da292d3d4c Issue #858 fixed 2014-03-25 17:53:44 +01:00
bsongis 2df098c7a6 Issue #861 fixed - Companion export problem (delay / duration in logical
switches)
2014-03-25 17:48:31 +01:00
bsongis 1fd305b5b7 Issue #854 fixed 2014-03-25 17:31:18 +01:00
bsongis b05c3e3476 Same names in Companion for PPMxx and LSxx 2014-03-25 17:17:34 +01:00
bsongis 95a39777f8 Compilation fix 2014-03-25 17:12:23 +01:00
bsongis 8c59a196c7 Inputs / Mixers screens rearrangement / bugfixes 2014-03-25 17:03:24 +01:00
Kjell Kernen 47b79b16ba Corrected bug that caused uneven data length for 16-bit wav files (big no, no). Added speed increase for recorded sound. 2014-03-25 15:46:29 +01:00
Bertrand Songis 76368f3e71 Update DONATIONS.txt 2014-03-25 07:25:03 +01:00
Bertrand Songis dffc9a3cfe Update DONATIONS.txt 2014-03-24 20:50:09 +01:00
Matthew Malkin 37314c42b9 added choice of com ports from 5 through 15 2014-03-24 19:36:30 +00:00
Kjell Kernen cdb81d7740 More sound processing 2014-03-24 20:26:46 +01:00
Bertrand Songis 60b3d8f237 Update en.h.txt 2014-03-24 19:23:51 +01:00
Bertrand Songis 5dc592a145 Update DONATIONS.txt 2014-03-24 19:15:57 +01:00
Kjell Kernen 9eaf00b557 Fixed sound buffer size bug for last recording buffer in OpenTX Recorder 2014-03-24 14:24:50 +01:00
Bertrand Songis eedf8b6643 Merge pull request #848 from projectkk2glider/proper_rounding_of_spoken_values
Proper rounding of displayed and spoken values
2014-03-24 10:43:54 +01:00
Bertrand Songis 6a7e903185 Update DONATIONS.txt 2014-03-24 08:42:10 +01:00
Andre Bernet 95f7dbf102 Missing change in old telemetry protocol for #534
FAS offset range increased to +/-12A. Was initially limited to +/-1.5A to use only 5 bits, but later changes gave it a whole 8bit int.
2014-03-24 00:34:12 +01:00
Andre Bernet 30a457234e Increase 3pos switch delay slightly 2014-03-24 00:07:18 +01:00
Andre Bernet a2aeaa3d69 Switch assignments -> Special functions 2014-03-23 22:38:57 +01:00
Andre Bernet 0b20297306 Fix #847 2014-03-23 21:45:21 +01:00
Andre Bernet a37a9f7237 UI consistency 2014-03-23 21:15:12 +01:00
Damjan Adamic e5cbba4ee2 Proper rounding for values that are scaled down. Displayed and spoken values affected.
Example: value 3.47V was spoken as 3.4V, new spoken value is 3.5V
2014-03-23 20:50:02 +01:00
Damjan Adamic 32090b8bbe Compiler warning removed for gcc 4.8.3 2014-03-23 20:38:42 +01:00
Damjan Adamic be5e6f678a Unit bug corrected, other languages are ok 2014-03-23 20:36:53 +01:00
Bertrand Songis 8dd27fc051 Merge pull request #844 from opentx/kilrah/remove_non_opentx_ui
A megaton of non-OpenTX UI elements and relations removed in general set...
2014-03-23 17:48:26 +01:00
Andre Bernet d4b7ef433a Delta char for symlimits on ARM 2014-03-23 16:34:57 +01:00
Andre Bernet 31823c0c95 Fix #667
FW however apparently also has an issue when turning extended limits off
2014-03-23 15:57:33 +01:00
Kjell Kernen e9035d3649 Fixed small problem with old text being left on screen. 2014-03-23 14:15:52 +01:00
Andre Bernet 01912356bf A megaton of non-OpenTX UI elements and relations removed in general settings 2014-03-23 13:07:32 +01:00
Kjell Kernen 42f28a7089 I found a nasty bug I made that also could make the bootloader hang. This fixes it. I should not have redefined the blocksize variable to make the output look good. It screewed up the flash... 2014-03-23 12:48:40 +01:00
Bertrand Songis 90dc5f5dd1 Merge pull request #843 from opentx/kilrah/808_companion_items
Kilrah/808 companion items
2014-03-23 11:45:34 +01:00
Andre Bernet 6a874b9c23 Fix overflow in automatic switch audio file playing, thanks Damjan 2014-03-23 11:37:40 +01:00
Andre Bernet 545b5bc3ce Vario general settings added to companion 2014-03-23 11:29:45 +01:00
Andre Bernet ba6ebc82bc Serial port mode added to companion 2014-03-23 00:32:30 +01:00
Andre Bernet c3d4989afa Trainer calibration cleanup 2014-03-23 00:13:37 +01:00
Andre Bernet f7822cd356 Merge branch 'dvogonen/bootloader_progress_bug_bar_839' into next 2014-03-22 23:06:15 +01:00
Andre Bernet 6ddafb76f1 Interrupt vectors were placed wrong 2014-03-22 23:05:49 +01:00
Kjell Kernen a341f29900 Fixed bootloader progres bar bug.
Iproved indentation slightly.
2014-03-22 20:11:14 +01:00
Kjell Kernen 16155484f9 Revert "Fixed the progress bar bug. Improved indentation."
This reverts commit 91223db338.
2014-03-22 20:09:16 +01:00
Kjell Kernen 91223db338 Fixed the progress bar bug. Improved indentation. 2014-03-22 20:06:49 +01:00
bsongis 6aecf8c7db Cosmetics 2014-03-22 17:11:02 +01:00
bsongis 2d7c275d82 Issue #831 fixed 2014-03-22 17:08:22 +01:00
Andre Bernet 8a31de751f Merge pull request #838 from alexion4/compilation_error_de
Fix compilation error for TRANSLATION=DE
2014-03-22 15:00:19 +01:00
alexion4 4fc12f2f3e Fix compilation error for TRANSLATION=DE 2014-03-22 14:52:42 +01:00
Andre Bernet e58e07502a Last references to obsolete BOOTLOADER definition removed 2014-03-22 14:28:55 +01:00
Andre Bernet b18073fd23 Merge branch 'usb_joystick3' into next 2014-03-22 14:21:47 +01:00
Bertrand Songis 7de67e7d09 Update DONATIONS.txt 2014-03-22 14:20:02 +01:00
Bertrand Songis 8be144adc0 Merge pull request #830 from projectkk2glider/usb_joystick3
Standalone USB Joystick with bootlader
2014-03-22 14:19:22 +01:00
Damjan Adamic fbe298bece changed return value of usbPlugged() back to int 2014-03-22 11:17:13 +01:00
Kjell Kernen cf22b2328b Added audio processing of recorded files. 2014-03-22 00:38:18 +01:00
Andre Bernet d69e8d9993 Bootloader removed from Makefile following the decision not to support building without bootlaoder on Taranis. 2014-03-22 00:09:59 +01:00
Damjan Adamic 86f136c733 * USB Joystick implemented
* USB Mass storage mode removed from openTX (this is now supported by Bootloader)
2014-03-21 20:58:41 +01:00
bsongis bc9650fc0c Issue #828 fixed 2014-03-21 16:09:35 +01:00
bsongis 49e587eb44 Issue #828 - "Edge" instead of "Stay" 2014-03-21 15:27:20 +01:00
bsongis 57e2428c29 Issue #826 fixed 2014-03-21 15:21:18 +01:00
bsongis f7de9e510a Issue #824 fixed 2014-03-21 11:48:10 +01:00
Kjell Kernen 054ff2dccf Fixed massive memory leak caused by recreating data buffers.
Code cleanup.
2014-03-21 11:32:52 +01:00
bsongis ababec79f9 Issue #823 fixed 2014-03-21 10:12:01 +01:00
Andre Bernet 9ba6564c9a Merge pull request #811 from opentx/bsongis/Side_back_in_expos_is_it_useful
Bsongis/side back in expos
2014-03-21 09:18:22 +01:00
Andre Bernet e8084650b1 Conversion issue with expos mode 2014-03-21 08:16:49 +01:00
bsongis 3bf7053a86 Conversion issue with expos mode 2014-03-21 07:15:36 +01:00
Bertrand Songis bbc568690c Merge pull request #825 from opentx/driver33/PL
Fixes in translation
2014-03-21 07:11:23 +01:00
Bertrand Songis dcce1d067c Update DONATIONS.txt 2014-03-21 07:08:47 +01:00
Jacek Drewniak 031dad4687 Fixes in translation 2014-03-21 01:03:14 +01:00
Kjell Kernen c0f1de4685 Some image changes 2014-03-20 23:48:13 +01:00
Andre Bernet 29b272ea47 French translations 2014-03-20 23:37:21 +01:00
Andre Bernet b2991ec73c Missing " 2014-03-20 23:16:09 +01:00
Kjell Kernen eaef0d4886 Swedish translation fixes. Hope they work. Can't confirm sice someone has broken my Windows build again. 2014-03-20 23:10:34 +01:00
Kjell Kernen eceedefa94 Switched recorder library to one custom made by Tomas Andersson.
Lots of small changes to both Speaker and Recorder.
2014-03-20 22:32:37 +01:00
Andre Bernet 5a5da9da32 Release notes synced with SVN 2014-03-20 22:10:53 +01:00
Andre Bernet cd23b9bc00 Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Side_back_in_expos_is_it_useful 2014-03-20 21:37:29 +01:00
Andre Bernet 78cf31c937 N/A translated 2014-03-20 21:15:53 +01:00
Andre Bernet b3e0f46cc2 Lua script labels translatable 2014-03-20 21:06:48 +01:00
Andre Bernet b7ba3021a8 French translations 2014-03-20 20:43:27 +01:00
Andre Bernet 0d329b7118 Merge pull request #822 from opentx/driver33/PL_trans
PL transaltion fixes
2014-03-20 20:10:47 +01:00
Andre Bernet 3fe337e2ba More translation fixes 2014-03-20 20:00:10 +01:00
Jacek Drewniak 14eb727a21 PL transaltion fixes 2014-03-20 19:59:55 +01:00
bsongis 3c5ae3ea91 Issue #821 fixed 2014-03-20 19:39:56 +01:00
Andre Bernet 79565142b8 More translation fixes 2014-03-20 19:32:56 +01:00
Andre Bernet 1b5aa2bbfa Reserves missing in telemetry sources for some languages 2014-03-20 19:26:12 +01:00
Andre Bernet 719c940be3 Reserve still missing in Italian 2014-03-20 19:11:11 +01:00
Andre Bernet b3c7cfd860 Translations line synced again 2014-03-20 19:07:11 +01:00
Andre Bernet 6aed5948d6 Merge conflict in Swedish translations caused duplicate strings 2014-03-20 19:01:34 +01:00
bsongis 553ac3b9f5 BeepAnaCenter was shifted since S3 introduction 2014-03-20 18:13:29 +01:00
Bertrand Songis 77c822b772 Update DONATIONS.txt 2014-03-20 17:53:06 +01:00
bsongis b973c5db1d Issue #782 fixed 2014-03-20 17:11:14 +01:00
mhotar dd7298a35b TR_CFN_RESERVE missing in translations 2014-03-20 16:12:00 +01:00
bsongis 26200e6080 Issue #820 fixed 2014-03-20 15:57:49 +01:00
bsongis dccfbb61d7 S3 Configuration inside Companion 2014-03-20 15:56:12 +01:00
Kjell Kernen cdde00286a Swedish translation almost complete. Fixed spelling in English strings 2014-03-20 14:44:25 +01:00
bsongis 871899e451 No more templates on OpenTX/Taranis. New templates should be Lua based. 2014-03-20 12:59:51 +01:00
bsongis e3fb62b33e Issue #813 - S3 skipped when not available 2014-03-20 12:56:14 +01:00
bsongis 05e2c8bdf3 Issue #813 fixed 2014-03-20 12:48:20 +01:00
bsongis d8c8e21e1f Issue #812 fixed 2014-03-20 12:39:21 +01:00
bsongis 5036c64a7b Issue #813 - Internal conversions part done 2014-03-20 12:28:57 +01:00
bsongis d2185d1e17 Protocols translations 2014-03-20 12:21:49 +01:00
bsongis 1019912432 EEPROM conversions strings translated 2014-03-20 11:53:51 +01:00
bsongis 787ca4200b Vario parameters translations 2014-03-20 11:51:03 +01:00
bsongis 349240e6eb Issue #816 fixed 2014-03-20 11:44:43 +01:00
bsongis c26117971c Issue #817 fixed 2014-03-20 11:42:04 +01:00
bsongis 50d8aeeddd Missing translations 2014-03-20 11:31:07 +01:00
bsongis a5706d600a French translations 2014-03-20 11:25:13 +01:00
bsongis a8c1b72850 Next one...
../util/addtr.py TR_MENUCUSTOMSCRIPTS="CUSTOM SCRIPTS"
TR_MENUCUSTOMSCRIPT="CUSTOM SCRIPT" TR_MENUCUSTOMFUNC
2014-03-20 11:19:26 +01:00
bsongis 54ddf73d44 Next ones...
../util/addtr.py TR_EXECUTE_FILE="Execute" TR_ASSIGN_BITMAP
../util/addtr.py TR_NO_SCRIPTS_ON_SD="No Scripts on SD"
TR_NO_BITMAPS_ON_SD
2014-03-20 11:17:14 +01:00
bsongis 180a8d4a46 Next one
../util/addtr.py TR_PATH_TOO_LONG="Path too long" TR_VIEW_TEXT="View
text" TR_CHANNELS_MONITOR
2014-03-20 11:15:17 +01:00
bsongis 161e0b1ec3 Next one...
../util/addtr.py TR_SCALE="Scale" TR_VIEW_CHANNELS="View Channels"
TR_VIEW_NOTES="View Notes" TR_ALTITUDE
2014-03-20 11:13:46 +01:00
bsongis bbc7302b89 Translations added. For information here is the command which allowes
these automatic changes:
../util/addtr.py TR_ENABLE_POPUP="Enable Popup"
TR_DISABLE_POPUP="Disable Popup" TR_CURVE_PRESET="Preset..."
TR_PRESET="Preset" TR_MIRROR="Mirror" TR_CLEAR="Clear" TR_RESET="Reset"
TR_COPY_TRIMS_TO_OFS="Copy Trims To Offset" TR_CRITICALALARM
2014-03-20 11:11:40 +01:00
bsongis 533f540c04 AddTranslation script improved ;) 2014-03-20 11:10:35 +01:00
Kjell Kernen 78df41fd86 A couple of strings translated to Swedish 2014-03-20 01:31:17 +01:00
mhotar a213a0613a CZ translations 2014-03-19 23:44:50 +01:00
mhotar f85b671c2a trim strings in TR_PHASES_HEADERS 2014-03-19 22:20:26 +01:00
Kjell Kernen 308136aec0 OpenTX Recorder added 2014-03-19 21:09:54 +01:00
Bertrand Songis 5677c5175c Update DONATIONS.txt 2014-03-19 20:06:50 +01:00
bsongis 7b8869f065 Cosmetics for Lua scripts (while writing the wiki page) 2014-03-19 15:35:56 +01:00
bsongis 7f5d6ad7ad Issue #807 fixed 2014-03-19 11:42:27 +01:00
bsongis 1476ef9126 Ignore list updated 2014-03-19 10:34:33 +01:00
bsongis 25a94e637d Side readded in Companion. Templates removed. 2014-03-19 10:30:51 +01:00
bsongis 1d1f4ed4fe In case it is useful, comments appreciated! 2014-03-19 09:24:25 +01:00
bsongis afa8a7991e Cosmetics 2014-03-19 09:23:46 +01:00
mhotar 4df95fb61e CZ translations 2014-03-19 00:19:41 +01:00
Bertrand Songis a111b8a6f0 Merge pull request #805 from opentx/kilrah/standalone_simu_dialog
Kilrah/standalone simu dialog
2014-03-18 16:41:41 +01:00
Bertrand Songis 1d3d2dd4e3 Update DONATIONS.txt 2014-03-18 16:30:20 +01:00
Kjell Kernen bc93768359 Merge pull request #806 from opentx/dvogonen/show_general_settings_in_profile_803
Display of calibration data and time stamp added to profile tab
2014-03-18 14:37:33 +01:00
Kjell Kernen b3cb503a0d The profile tab now shows if there is radio settings like calibration data in the profile or not. It also displays a starage date for the data.
The radio settings are time stamped when they are saved to profile. I would prefer to stamp them when they are retrieved from the sender, but this is not possible in any good way with the current file format. I intended to use file storage times, but this turned out to be a bad idea since the date can get screwed up in a lot of different ways.
2014-03-18 14:35:06 +01:00
bsongis c55ee5f404 LS=>S3 shift in sources import 2014-03-18 10:50:30 +01:00
Bertrand Songis 5051d3324b Update DONATIONS.txt 2014-03-18 06:39:59 +01:00
Kjell Kernen 69f5119dbc Translations and fixes to Swedish translation file 2014-03-18 01:00:42 +01:00
mhotar c94fcb88ed wiz images 2014-03-18 00:02:23 +01:00
Andre Bernet 25ee57caf0 Cosmetics 2014-03-17 23:56:37 +01:00
Andre Bernet 469ae3d90d Merge branch 'next' of https://github.com/opentx/opentx into kilrah/standalone_simu_dialog 2014-03-17 22:16:34 +01:00
Andre Bernet d5cfa845c2 Merge pull request #804 from opentx/kilrah/Bootloader
Kilrah/bootloader
2014-03-17 21:08:03 +01:00
Andre Bernet 071f71f84e Ignore list updated 2014-03-17 21:05:08 +01:00
Andre Bernet de073a25ea Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Bootloader 2014-03-17 20:32:11 +01:00
bsongis f907abb730 Checks bootloader size not greater than 32k. Bug fixes. 2014-03-17 17:32:14 +01:00
Kjell Kernen bb4bca8125 Two more missing dialog icons (these are the last I can find) 2014-03-17 17:25:58 +01:00
Kjell Kernen bd419d14e3 Adding edit window icon to the modeledit window 2014-03-17 17:07:17 +01:00
Kjell Kernen 28b763b44f Fixed bug that stoped the paintbrush icon from being displayed. 2014-03-17 16:54:42 +01:00
bsongis ded73341e8 Issue #773 fixed (+ non regression tests added) 2014-03-17 16:34:48 +01:00
bsongis 0a70142067 Issue #797 fixed. Global variables need again to be tested :( 2014-03-17 14:35:23 +01:00
bsongis 0c9b45e738 Play Custom functions with no file selected slowed down the radio 2014-03-17 12:27:38 +01:00
bsongis c3e0d1967b Issue #801 fixed 2014-03-17 12:00:36 +01:00
bsongis 9af0639b76 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-03-17 11:51:06 +01:00
bsongis 4202492b1a lock missing in telemetry bars screen 2014-03-17 11:50:39 +01:00
bsongis a082a9a53e A couple of bugs in telemetry bars fixed 2014-03-17 11:33:22 +01:00
Kjell Kernen 9bd8e1a53d More GPL3 stuff 2014-03-17 10:52:20 +01:00
bsongis e2c26ac295 Scale problem with Cur+ and Pwr+ in telemetry bars 2014-03-17 10:37:47 +01:00
Bertrand Songis f1aeecaf9a Update CMakeLists.txt 2014-03-17 07:27:06 +01:00
Bertrand Songis edd54cafea Update DONATIONS.txt 2014-03-17 07:25:25 +01:00
Kjell Kernen 78ed248fda Added GPL information 2014-03-17 01:34:35 +01:00
Kjell Kernen 1b32ff2850 Added Speaker Logo 2014-03-16 23:08:45 +01:00
Kjell Kernen 9c8c01af8d Image change 2014-03-16 22:56:48 +01:00
Kjell Kernen f21ffb2796 A few changes to the French strings from Christophe Bernardi 2014-03-16 22:09:01 +01:00
bsongis d4acb9a8d0 Issue #698 fixed - Quick & dirty for now. I will switch everything to
CMake later
2014-03-16 21:57:11 +01:00
bsongis c59b0afa39 Qt4.8.5 required 2014-03-16 21:57:11 +01:00
Kjell Kernen 3bc5d8f6ff Merge pull request #800 from opentx/dvogonen/opentx_voice_generator
Dvogonen/opentx voice generator
2014-03-16 21:49:16 +01:00
Kjell Kernen 7429fc6215 Logos 2014-03-16 21:37:24 +01:00
Andre Bernet 8105adb174 Replicate same fix to REs 2014-03-16 20:19:57 +01:00
Andre Bernet c20b5d3413 GVARs referencing other GVARs were broken (Fixes #787) 2014-03-16 20:09:43 +01:00
mhotar 73b59267fa sk sentences 2014-03-16 19:03:11 +01:00
Andre Bernet 34b7826638 Merge pull request #768 from opentx/mhotar/modelsetup_items
Mhotar/modelsetup items
2014-03-16 17:42:10 +01:00
Andre Bernet 93333b1735 French translations 2014-03-16 17:36:05 +01:00
Andre Bernet 50a38a97be Wording 2014-03-16 17:04:17 +01:00
Andre Bernet dedfac4041 Merge branch 'next' of https://github.com/opentx/opentx into mhotar/modelsetup_items
Conflicts:
	radio/src/translations/fi.h.txt
	radio/src/translations/se.h.txt
2014-03-16 16:54:51 +01:00
Andre Bernet 19d9c585f8 Input name saved only when clicking OK (Fixes #750) 2014-03-16 11:32:14 +01:00
Andre Bernet f30f1cef7f Revert "Inputs tab hidden when not applicable (Fixes #795)"
This reverts commit 69ba969bd1.
2014-03-16 11:14:29 +01:00
Andre Bernet 69ba969bd1 Inputs tab hidden when not applicable (Fixes #795) 2014-03-16 10:32:54 +01:00
Andre Bernet a38d92f64b Adapt telemetry alarm settings for Taranis (Fixes #517) 2014-03-16 10:27:32 +01:00
Andre Bernet abda129041 Companion now appears in Add/Remove Programs on Windows (Forgot msys script) 2014-03-16 10:04:09 +01:00
Andre Bernet c6ec0838c0 Companion now appears in Add/Remove Programs on Windows (Fixes #521) 2014-03-16 09:59:40 +01:00
Kjell Kernen 75c42afbbc Splash screen added to OpenTX Speaker 2014-03-15 22:26:39 +01:00
Andre Bernet db7034b150 Dialog for choosing radio type, separate eeprom file for each type 2014-03-15 21:21:48 +01:00
Kjell Kernen 0071a04efa New French strings from Christophe Bernardi 2014-03-15 20:33:27 +01:00
Andre Bernet 78f36a02b4 Fixes #793 2014-03-15 16:30:33 +01:00
bsongis 8bc28248e0 cosmetics 2014-03-15 15:44:09 +01:00
bsongis 1c3ced7222 Cosmetics on the bootloader 2014-03-15 15:36:02 +01:00
Andre Bernet d7afdfc77c Fixes #794 2014-03-15 15:07:11 +01:00
Kjell Kernen 347988c135 v 1.0
All radio voice languages supported.
2014-03-15 13:49:04 +01:00
Kjell Kernen 538db5e4af Added eSpeak link and information to OpenTX Speaker 2014-03-15 12:08:48 +01:00
Kjell Kernen 7289fbdd2a Added Spanish to OpenTX Speak 2014-03-15 10:02:49 +01:00
Kjell Kernen d9f14997b8 Portuguese support 2014-03-15 00:49:42 +01:00
Kjell Kernen 39b7060393 French, German and Czech added 2014-03-14 21:26:53 +01:00
Kjell Kernen 2915f294aa Ignore build files 2014-03-14 16:02:34 +01:00
Kjell Kernen 0ae5d05519 v 0.4 2014-03-14 15:58:32 +01:00
bsongis c10dd3640a Refactoring/Bugfix 2014-03-14 14:54:45 +01:00
bsongis eb0cb8312a The wizard should use the channel order defined in preferences 2014-03-14 14:54:45 +01:00
bsongis 8a38c6a13b Little improvement, it remains some like this one ;) 2014-03-14 14:54:45 +01:00
bsongis 383475a6ed Now the wizard is able to configure a simple 4CH plane 2014-03-14 14:54:45 +01:00
bsongis e0582cd398 Some refactoring in the new Wizard 2014-03-14 14:54:45 +01:00
mhotar 13e998ec2d wiz images 2014-03-12 22:39:49 +01:00
Bertrand Songis c913aa3374 Update DONATIONS.txt 2014-03-12 18:22:02 +01:00
bsongis ef05cdd782 Cosmetics 2014-03-12 18:13:28 +01:00
bsongis 7738aa27bd Reindentation of loadboot.cpp 2014-03-12 16:19:34 +01:00
bsongis 278218e7a0 Reindentation of boot.cpp 2014-03-12 16:18:30 +01:00
bsongis 68c270760c Now bootloader OK on Taranis 2014-03-12 16:06:13 +01:00
mhotar ae6d9f146b wiz images 2014-03-12 13:09:42 +01:00
Romolo Manfredini ce8880e162 Fix segfault in c9x 2014-03-12 02:53:51 +01:00
mhotar cd97abca08 wiz images 2014-03-11 22:50:58 +01:00
Kjell Kernen fcdc6f68bd Fixing image size bugs caused by the use of a frame 2014-03-09 23:19:20 +01:00
Kjell Kernen 4f6b60bdd5 Fixing width bug due to fixed dialog width 2014-03-09 22:49:45 +01:00
Kjell Kernen e000eb586a Fixed width size bug in burndialog
Translated versions of the dialog would get the texts cut by the splash images.
2014-03-09 21:31:45 +01:00
Kjell Kernen b389495e7b Translated latest strings.
Fixed bug someone had introduced with missing selection string.
Changed back to using caps in menus.
2014-03-09 17:12:16 +01:00
Kjell Kernen cec0a9cd3b Translated latest Swedish strings 2014-03-09 16:42:22 +01:00
Kjell Kernen e2dd42658d First Finnish translation of OpenTX (Just a few strings to start with) 2014-03-09 16:34:06 +01:00
Kjell Kernen d5da0ad828 Start of the Finnish translation of Companion made by Janne Huskonen 2014-03-09 16:06:19 +01:00
Kjell Kernen 9943bf9845 Merge pull request #786 from opentx/dvogonen/sound_play_crashes_companion_784
Fixes #784
2014-03-08 23:35:04 +01:00
Kjell Kernen 02268c54ff Fixes #784 2014-03-08 23:34:15 +01:00
Kjell Kernen 9f085e2c87 Merge pull request #780 from opentx/dvogonen/darker_colors_in_print_dialog_479
Turned down the light green color hue od curve 11, 12, 13 to be more rea...
2014-03-08 15:26:23 +01:00
Kjell Kernen cea4c89fe2 Turned down the light green color hue od curve 11, 12, 13 to be more readable.
Fixes #479
2014-03-08 15:25:22 +01:00
Bertrand Songis 5603287204 Update DONATIONS.txt 2014-03-06 22:11:33 +01:00
Bertrand Songis eeb5532ffa Update DONATIONS.txt 2014-03-06 22:11:18 +01:00
bsongis 47b6c2b771 Last minute changes before alpha release 2014-03-06 12:10:26 +01:00
bsongis b6982a310f Version changed to 1.99 for nightly builds 2014-03-06 09:40:41 +01:00
bsongis 4e6def3ba3 Compilation errors on Companion 2014-03-05 17:32:17 +01:00
bsongis 5e6cd0ee76 Compilation error fixed 2014-03-05 15:42:51 +01:00
bsongis 197708c967 Last files removed, only the minimum left and moved to another directory 2014-03-05 15:16:13 +01:00
bsongis 0dbf9d8b81 5 more files removed 2014-03-05 14:46:55 +01:00
bsongis 7f6a137ce8 2 more files removed 2014-03-05 14:24:51 +01:00
bsongis 3b1ac9f5d8 4 more files removed 2014-03-05 11:58:40 +01:00
bsongis a2235f1bda 2 more files removed 2014-03-05 11:54:03 +01:00
bsongis 43733d4e66 4 more files removed 2014-03-05 11:53:21 +01:00
bsongis 404c58d447 3 more files removed 2014-03-05 11:48:28 +01:00
bsongis 072f305cfe 3 more files removed 2014-03-05 11:47:30 +01:00
bsongis 1d181ae300 one more file removed 2014-03-05 11:46:50 +01:00
bsongis 55349d46da 5 more files removed 2014-03-05 11:45:57 +01:00
bsongis 5b0835cecb translations.h/.cpp files splitted into translations.h/.ccp and
fonts.h/.cpp
2014-03-05 10:59:52 +01:00
mhotar 708411c272 EN,FR translations 2014-03-04 23:08:18 +01:00
mhotar 3f231585a9 Neverending conflicts 2014-03-04 22:52:37 +01:00
mhotar 4cc6b6f8aa Merge branch 'next' into mhotar/modelsetup_items
Conflicts:
	radio/src/translations/en.h.txt
	radio/src/translations/fr.h.txt
2014-03-04 22:46:22 +01:00
mhotar 21f2130d13 TR_POTTYPES "None" in cz.h.txt 2014-03-04 22:31:41 +01:00
mhotar b919773b56 TR_POTTYPES "None" was missing in some translations 2014-03-04 22:26:15 +01:00
mhotar b506259d76 Conflicts fix 2014-03-04 21:52:54 +01:00
bsongis 3788f5f562 5 more files removed 2014-03-04 18:31:12 +01:00
Kjell Kernen e45410c257 Check for updates dialog now always on top.
The check for downloads dialogs were started asynchonously. This was the reason for the dialog ending up under other windows and behaving strangely since other windows will steal focus as soon as the dialog lets go of it.
2014-03-04 18:05:51 +01:00
bsongis 9cdd175250 4 more files removed 2014-03-04 17:58:57 +01:00
bsongis dc3ea6b555 one more file removed 2014-03-04 17:56:52 +01:00
bsongis 51fe47ed8a 3 files removed 2014-03-04 17:14:35 +01:00
Kjell Kernen bb767ca863 Slowing down the close of the download dialog with 2 seconds to avoid unpeasant flashing dialogs. 2014-03-04 17:03:54 +01:00
Bertrand Songis 0b83d9e0d7 Update DONATIONS.txt 2014-03-04 16:42:26 +01:00
bsongis 74872b1322 18 more files removed 2014-03-04 15:58:01 +01:00
bsongis b7e079a0d9 2 files removed 2014-03-04 15:33:26 +01:00
Kjell Kernen b133a990f1 New plce holder function in eeprominterface for importing wizard data. Need help from Bertrand since the format of the real mixes is mysterious. 2014-03-04 13:36:01 +01:00
Kjell Kernen 11565e05e9 Merge branch 'origin/next' 2014-03-04 13:33:31 +01:00
bsongis ae54f4908a More Sky9x bootloader files removed 2014-03-04 12:07:43 +01:00
bsongis 7853aebf3d 1 more file removed 2014-03-04 12:03:34 +01:00
Bertrand Songis cd6acebaaa Update DONATIONS.txt 2014-03-04 11:58:13 +01:00
bsongis 1c0278130c Merge branch 'kilrah/Bootloader' of https://github.com/opentx/opentx into kilrah/Bootloader 2014-03-04 11:30:14 +01:00
bsongis e7c08e56b2 Sky9x files removed for now 2014-03-04 11:29:41 +01:00
bsongis 8c06e0d8ac Sky9x files removed for now 2014-03-04 11:23:33 +01:00
bsongis c482eef8d2 2 other files removed 2014-03-04 10:50:15 +01:00
bsongis d5b83e1b4e 7 files removed 2014-03-04 10:41:04 +01:00
Kjell Kernen eb52b7288c Merge branch 'origin/next' 2014-03-04 10:05:55 +01:00
bsongis 92436f47f7 PCBX9D replaced everywhere by PCBTARANIS 2014-03-04 09:26:52 +01:00
bsongis e0b8e55e73 French translations aligned 2014-03-04 07:28:12 +01:00
mhotar df462447e0 Merge branch 'next' into mhotar/modelsetup_items
Conflicts:
	radio/src/translations.cpp
	radio/src/translations.h
	radio/src/translations/de.h.txt
	radio/src/translations/en.h.txt
	radio/src/translations/fr.h.txt
2014-03-04 02:13:15 +01:00
Kjell Kernen e648cb7542 Wizard model name saved to current model. Diacritics filtered out. 2014-03-04 00:56:31 +01:00
mhotar 13a2fdfc00 indentations and ifdef corrected 2014-03-03 23:48:49 +01:00
Kjell Kernen 898496a85d Added status information for wixard mix data. 2014-03-03 23:13:26 +01:00
bsongis 9bb64c07ae Align french translations 2014-03-03 22:57:46 +01:00
bsongis 7435416422 More cleaning in bootloader 2014-03-03 21:31:34 +01:00
bsongis b90cff13b4 Some duplicated files removed 2014-03-03 17:57:36 +01:00
Kjell Kernen 0a867bcc22 Merge branch 'origin/next'
Conflicts:
	companion/src/mdichild.cpp
2014-03-03 17:54:43 +01:00
bsongis b6b2569190 Merge remote-tracking branch 'origin/next' into kilrah/Bootloader
Conflicts:
	radio/src/Makefile
2014-03-03 17:14:12 +01:00
Kjell Kernen 5b5aac9d16 Added GPLv2 licence texts to new files 2014-03-03 16:54:45 +01:00
bsongis 8662a4ec68 Merge issues 2014-03-03 16:50:32 +01:00
bsongis a18953f6a2 Merge remote-tracking branch 'origin/next' into bsongis/9XR-PRO_port
Conflicts:
	companion/src/avroutputdialog.cpp
	companion/src/burnconfigdialog.cpp
	companion/src/eeprominterface.cpp
	companion/src/eeprominterface.h
	companion/src/firmwares/opentx/opentxinterface.cpp
	companion/src/helpers.cpp
	radio/src/gui/menu_general.cpp
	radio/src/opentx.cpp
2014-03-03 16:41:41 +01:00
Kjell Kernen 9dfffbf641 Changed logics for opening model edit windows. Double clicking an empty slot always opens wizard. Clicking en existing always opens model edit. By using right click menu either can be specified. 2014-03-03 16:30:01 +01:00
bsongis 145c741307 Warnings fixed 2014-03-03 15:56:59 +01:00
Bertrand Songis 8a0dc22578 Merge pull request #770 from opentx/bsongis/Issue767_extra_pot
Bsongis/issue767 extra pot
2014-03-03 15:44:59 +01:00
Bertrand Songis 55cea50824 Merge pull request #755 from opentx/bsongis/Issue524_SPORT_GPS
Bsongis/issue524 sport gps
2014-03-03 15:44:45 +01:00
bsongis 88b7374c6c Compilation error 2014-03-03 15:42:13 +01:00
bsongis cdce9b0da7 Merge remote-tracking branch 'origin/next' into
bsongis/Issue524_SPORT_GPS

Conflicts:
	radio/src/telemetry/frsky_sport.cpp
	radio/src/translations/de.h.txt
2014-03-03 15:36:34 +01:00
bsongis c8f1758bc1 Conversion of °C->°F on HDG
Altitude stored as feet in logs when imperial mode chosen
2014-03-03 15:33:26 +01:00
Kjell Kernen b347b6f9c5 Wizard data broken out into separate files. 2014-03-03 14:40:02 +01:00
bsongis adf08a59fb Issue #731 fixed - Default mixes/expos created on an empty model 2014-03-03 13:01:17 +01:00
bsongis bf7919bd8d Issue #731 - Conversion issues (Inputs) fixed 2014-03-03 12:24:42 +01:00
Kjell Kernen 858c9193cb Data handling added. I have used the simplest possible channel class. An array with these channels are filled throughout the wizard, forming a simplistic mix table that can be passed on and inserted in the real mixer.
The simple mixer is fully functional for planes and multicopters.
I have to read up on how helicopters are controlled. Currently that part is done wrong since I have no idea about how to set up helicopter mixes.
2014-03-02 23:56:49 +01:00
Bertrand Songis 5fb301b9e2 Update DONATIONS.txt 2014-03-02 21:43:29 +01:00
bsongis e59ebed474 Issue #534 missing control 2014-03-02 15:44:34 +01:00
bsongis aed219cbd1 EEPROM conversions problems 2014-03-02 14:35:42 +01:00
Kjell Kernen 672e5f8088 Wizard fully functional on GUI level. Right click on model slot to test.
No functionality whatsoever on the logical level! Completely harmless to run.
2014-03-02 13:30:08 +01:00
mhotar 61bb02ceea Thr grouping for Taranis only 2014-03-01 23:32:05 +01:00
bsongis e5cfef711f Vario didn't stop beeping when in sink mode 2014-03-01 22:25:06 +01:00
bsongis cac6314ce1 Issue #767 - Companion part 2014-03-01 22:18:43 +01:00
Bertrand Songis 06e945be67 Update DONATIONS.txt 2014-03-01 21:36:00 +01:00
bsongis 3215346a1b Issue #767 - Extra Pot (S3) support 2014-03-01 18:54:08 +01:00
bsongis f9e6819b37 Ignore list updated 2014-03-01 08:48:42 +01:00
bsongis 35b2346ba8 DE translations 2014-03-01 08:45:06 +01:00
mhotar 83651486f4 Translations updated 2014-03-01 02:08:45 +01:00
mhotar 55ff2e6b5e Throttle label and missing string defs 2014-03-01 01:20:47 +01:00
mhotar 4506328144 Preflight check label and items 2014-03-01 00:25:18 +01:00
bsongis dcb52913a5 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-28 23:19:01 +01:00
bsongis 09e427d73e Indentation issues 2014-02-28 23:18:21 +01:00
Kjell Kernen 64fa9ed334 Images added to project 2014-02-28 23:09:11 +01:00
Kjell Kernen 058a65cac6 Images moved to better location 2014-02-28 23:08:52 +01:00
Kjell Kernen b734077605 Removed all the old wizard images 2014-02-28 23:07:34 +01:00
Kjell Kernen 6eb57c2f63 temporary wizard images 2014-02-28 22:13:48 +01:00
Andre Bernet 4d66fd8061 PPMx were missing in Inputs source list 2014-02-28 15:07:34 +01:00
Andre Bernet 3ab86c90a6 Sky9x support for 16CH input on trainer port (untested) 2014-02-28 13:51:18 +01:00
Andre Bernet c2912eb5e1 French translation fix 2014-02-28 13:18:03 +01:00
Andre Bernet 56cb40dd38 Taranis trainer driver support for 16CH input 2014-02-28 13:07:45 +01:00
Andre Bernet 89970776a6 Merge pull request #737 from opentx/bsongis/spare_values_in_telemetry_and_functions
Bsongis/spare values in telemetry and functions
2014-02-28 12:45:07 +01:00
bsongis da41f43ff4 Merge remote-tracking branch 'origin/next' into
bsongis/spare_values_in_telemetry_and_functions

Conflicts:
	radio/src/translations/fr.h.txt
2014-02-28 12:22:59 +01:00
bsongis f250d381e5 Issue #764 fixed 2014-02-28 12:16:43 +01:00
bsongis c4bff418e3 Issue #762 fixed 2014-02-28 11:58:37 +01:00
bsongis 3692ad0eb0 Merge branch 'bsongis/spare_values_in_telemetry_and_functions' of https://github.com/opentx/opentx into bsongis/spare_values_in_telemetry_and_functions 2014-02-28 11:45:07 +01:00
bsongis 38fd271246 Shift in Telemetry when importing EEPROM < 216 2014-02-28 11:44:02 +01:00
Andre Bernet 2d678b781e Units in all languages 2014-02-28 11:18:38 +01:00
Andre Bernet c6b64a9305 Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Issue524_SPORT_GPS 2014-02-28 11:06:52 +01:00
Andre Bernet 88cba206ff Hide dTE 2014-02-28 10:37:35 +01:00
bsongis d6fefe71c0 Rename continued 2014-02-28 10:12:07 +01:00
bsongis 8d9039532a Search & Replace CUSTOMSW by LOGICALSW 2014-02-28 10:12:07 +01:00
bsongis 1c482e7f6e Issue #757 fixed 2014-02-28 10:12:06 +01:00
Andre Bernet 0a30595bb1 Merge pull request #759 from opentx/mhotar/LS_delta_character
Mhotar/LS delta character
2014-02-28 09:40:44 +01:00
Kjell Kernen 8ce52f9d5e A few new splash screens for Taranis 2014-02-28 00:09:50 +01:00
Kjell Kernen 756c6b37cc Merge pull request #761 from opentx/dvogonen/fix_756
Fixes #756
2014-02-28 00:03:47 +01:00
Kjell Kernen 8277e8bef1 Fixes #756 2014-02-28 00:02:30 +01:00
mhotar a12e615a30 CMakeLists for en.h 2014-02-27 23:13:39 +01:00
Andre Bernet bec9f650ee Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Issue524_SPORT_GPS
Conflicts:
	radio/src/translations.h
2014-02-27 22:45:12 +01:00
Andre Bernet 423d1a4437 French translations 2014-02-27 22:22:34 +01:00
Andre Bernet 3c8fd3a51d Delta character now requires en.h to go through translate.py 2014-02-27 21:19:33 +01:00
Andre Bernet 572a9ed3ba Merge branch 'next' of https://github.com/opentx/opentx into bsongis/spare_values_in_telemetry_and_functions 2014-02-27 20:09:31 +01:00
Bertrand Songis 93b895a4f5 Issue #628 fixed 2014-02-27 17:45:37 +01:00
Bertrand Songis 961fbf291b Problem when changing v1 value in Timer Logical Switches 2014-02-27 17:07:23 +01:00
mhotar 4f225ae707 PL translations- string lengths corrected 2014-02-27 15:18:00 +01:00
mhotar c0b3c1c6e9 translation files updated
-delta added to VCSWFUNC
-"Set" added to VFSWFUNC
2014-02-27 14:51:41 +01:00
Kjell Kernen baffeeb5b0 Taranis splash image changes 2014-02-27 13:41:48 +01:00
mhotar 832ac1927b delta character bitmaps 2014-02-27 12:01:38 +01:00
bsongis fdd2e3f4d4 Mixer slow bug (source=MAX, switch, slow up, no slow down) 2014-02-26 21:19:47 +01:00
bsongis 86c0678273 cppcheck experiment. A couple of memory leaks fixed 2014-02-26 16:10:12 +01:00
Kjell Kernen 33091c295f Reformatted radio.xsd with VS2010 that has superior functions for auto formatting code. It used to be more or less built out of tab characters, which I am alergic to. 2014-02-26 15:35:13 +01:00
bsongis e0548cdfe8 cpplint doesn't complain about mainwindow.cpp 2014-02-26 15:28:03 +01:00
Kjell Kernen d57697460b Cleaned tabs from code. The ones in mainwindow.cpp are mine. The rest come from other contributors. 2014-02-26 15:23:42 +01:00
bsongis d465ee80a2 Indentation fixed so that cpplint is ok 2014-02-26 15:22:27 +01:00
bsongis 933f866e93 Cosmetics 2014-02-26 15:22:27 +01:00
Kjell Kernen 356980fac3 Two new splash screens. 2014-02-26 14:41:06 +01:00
bsongis 3f03abc0d1 EEPROM conversion bug with telemetry values in logical switches 2014-02-26 12:02:24 +01:00
Andre Bernet 32aa5e9bc4 Merge pull request #745 from opentx/bsongis/Issue650_precise_logical_switches_delays_durations
Issue #650 fixed - 0.1s precision in durations/delays for logical
2014-02-26 11:26:52 +01:00
Kjell Kernen f2e252c986 Moved library images around to make room for a full page of Taranis screens.
This makes the library look a lot better.
2014-02-26 11:23:43 +01:00
bsongis d14fc31f88 Import bug, scale result was always 0 2014-02-26 11:21:09 +01:00
Andre Bernet 32bcb8b5d6 Merge pull request #738 from opentx/bsongis/vario_improvements
Bsongis/vario improvements
2014-02-26 10:18:41 +01:00
bsongis 66610f8562 Merge branch 'bsongis/Issue650_precise_logical_switches_delays_durations' of https://github.com/opentx/opentx into bsongis/Issue650_precise_logical_switches_delays_durations 2014-02-26 09:59:17 +01:00
bsongis f5b9ebfcc3 Core in import of EEPROMS < 216 2014-02-26 09:54:25 +01:00
bsongis cf9eaf11fb Speed unit in logs depending on imperial parameter 2014-02-26 08:57:45 +01:00
Bertrand Songis a5330a7bfc Update DONATIONS.txt 2014-02-26 06:44:00 +01:00
Kjell Kernen f7e741b4e2 Pict upddates 2014-02-26 03:11:33 +01:00
Kjell Kernen 5ece7d9934 Moved selection of radio type from download dialog to profile tab. This was a bit tricky. 2014-02-26 01:38:13 +01:00
bsongis 31526f7fe2 Compilation error 2014-02-25 23:13:34 +01:00
Andre Bernet c5edba2188 Merge pull request #744 from opentx/bsongis/Issue741_a_equals_x_in_logical_switches
Issue #741 fixed - a==x added in logical switches functions
2014-02-25 21:07:07 +01:00
Andre Bernet 7c3c7a1572 Merge pull request #742 from opentx/bsongis/indication_of_active_fm_in_gv_menu
Bsongis/indication of active fm in gv menu
2014-02-25 20:43:13 +01:00
Andre Bernet c1f44e1748 Merge branch 'next' of https://github.com/opentx/opentx into bsongis/indication_of_active_fm_in_gv_menu 2014-02-25 20:34:53 +01:00
Kjell Kernen b5c46626f9 Another Taranis splash screen. Idea stolen from Martin. 2014-02-25 20:19:51 +01:00
Andre Bernet 4d2f8d2918 Duration/delay display wasn't adapted on Taranis 2014-02-25 19:49:21 +01:00
Andre Bernet d7483c9dc3 Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Issue650_precise_logical_switches_delays_durations 2014-02-25 19:29:21 +01:00
Kjell Kernen bfb5f5b993 Martin Hotar splash screen in 212x64 format added 2014-02-25 19:09:46 +01:00
Andre Bernet 94afb88f8b Merge branch 'next' of https://github.com/opentx/opentx into bsongis/vario_improvements
Conflicts:
	radio/src/audio_arm.cpp
2014-02-25 19:02:36 +01:00
Andre Bernet 95d7951b17 Merge pull request #725 from opentx/bsongis/Issue713_more_custom_functions
Bsongis/issue713 more custom functions
2014-02-25 19:00:01 +01:00
Andre Bernet 82146f7b7d Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Issue713_more_custom_functions 2014-02-25 18:17:15 +01:00
bsongis 2e58969aa1 Fix problem with GPS speed unit used with voice 2014-02-25 18:05:54 +01:00
bsongis 590a58a6e9 Port of GPS modifications from SVN 2014-02-25 16:57:01 +01:00
Bertrand Songis d8c6e69b09 Merge pull request #749 from opentx/driver33/PL_TR
PL translation fixes
2014-02-25 07:16:59 +01:00
Kjell Kernen 2e14e5d9c8 Swedish Companion translation 2014-02-24 22:50:03 +01:00
Jacek Drewniak 06115fdaed PL translation fixes 2014-02-24 21:44:11 +01:00
Bertrand Songis 9992c1f79c Update DONATIONS.txt 2014-02-24 20:58:59 +01:00
Bertrand Songis 0029f57413 Conversions from older EEPROM for duration/delay fields (x5) 2014-02-24 19:52:35 +01:00
Bertrand Songis c823ca69ce More spares to allow A3/A4/RSSI_Tx/Rx_Batt in Telemetry (ARM boards) 2014-02-24 18:22:39 +01:00
Bertrand Songis 0f3e6581bd Update DONATIONS.txt 2014-02-24 18:20:29 +01:00
Kjell Kernen ca4c7b4dc1 Corrected index error in general edit 2014-02-24 16:36:45 +01:00
Kjell Kernen ca3127fdc1 Merge pull request #746 from opentx/dvogonen/clean_up_splash_library
Splash library updated
2014-02-24 15:40:46 +01:00
Kjell Kernen 91f8157f03 Renaming files to change order 2014-02-24 14:41:05 +01:00
Kjell Kernen 575ea504aa Updated QT resource file with new image names 2014-02-24 14:28:19 +01:00
Kjell Kernen dc37677cc6 Removing ER9x and Open9x specific imagery 2014-02-24 12:22:46 +01:00
Bertrand Songis 56d167e45f Issue #650 fixed - 0.1s precision in durations/delays for logical
switches
2014-02-24 07:45:37 +01:00
Bertrand Songis 2a8abd08da Issue #741 fixed - a==x added in logical switches functions 2014-02-24 07:30:59 +01:00
Bertrand Songis 3ac1a03d96 This sine wave is reported as better than the previous one 2014-02-24 07:06:26 +01:00
Bertrand Songis c98e718e16 Merge pull request #743 from opentx/dvogonen/simplify_burn_dialog
Dvogonen/simplify burn dialog
2014-02-24 00:07:47 +01:00
Kjell Kernen c289689105 All splash imgage display dialogs now use common code.
The splash image library displayed all images in 128x64 mono format.
Changed this to display either in 128x64 mono or 212x64 gray scale depending on profile information.
2014-02-23 22:24:43 +01:00
openfsguruh d4db0f1f95 typo in comment, no real change 2014-02-23 20:34:16 +01:00
Bertrand Songis 5d46f46a87 Script to automatically add a translation into all files. Syntax:
addtr.py TR_GLOBAL_V "GLOBAL V." TR_GLOBAL_VARS
2014-02-23 19:58:52 +01:00
Bertrand Songis 0bbb3c6b4f Translation for the string added 2014-02-23 19:57:51 +01:00
Bertrand Songis 525fee5acd .hex files ignored 2014-02-23 19:14:30 +01:00
Bertrand Songis ed6fc15a13 Screen index hidden on GVARS screen (after 2 seconds) 2014-02-23 19:09:17 +01:00
Kjell Kernen 08812f2546 Merge branch 'origin/next' 2014-02-23 18:55:20 +01:00
Kjell Kernen 6607dbd1b4 Both the latest downloaded firmware variant and file name are now consistently stored in the profile. This means that switching profile switches both at the same time. Previously the file name was global and the firmware variant was stored per profile. This made use of profiles confusing. 2014-02-23 18:40:56 +01:00
Kjell Kernen d8f7bde324 Fixed assert error 2014-02-23 16:10:19 +01:00
Jacek Drewniak f3680fdc6a Merge pull request #740 from opentx/driver33/PL_TR
Pl Transaltion fix
2014-02-23 15:51:41 +01:00
Jacek Drewniak 6f4cda74bc Pl Transaltion fix 2014-02-23 15:50:24 +01:00
Kjell Kernen eafc5b8359 Fixed two assertion bugs I caused yesterday 2014-02-23 11:44:27 +01:00
Bertrand Songis 7195ad3806 The headers in the top bar - still the page number to remove! 2014-02-23 09:54:12 +01:00
Bertrand Songis 62f921404e Indication of current flight mode in global vars - 1st part: the 2
seconds
2014-02-23 09:22:51 +01:00
Kjell Kernen 6ea9b2c26a The two image labels and complicatd logics replaced by a simpler 4-way image selection and a single image label that simply shows whatever image that will be used as radio splash screen. 2014-02-23 01:28:49 +01:00
Bertrand Songis eaefefa4f0 Merge pull request #739 from opentx/mhotar/bold_font_bitmap_fix
Bold MNY characters reworked
2014-02-22 22:00:20 +01:00
mhotar 5b3449c55a Bold MNY characters reworked 2014-02-22 20:20:27 +01:00
Bertrand Songis d7a67fc7a1 Update myeeprom.h 2014-02-22 20:12:59 +01:00
Bertrand Songis c7eccdec0f Merge pull request #735 from opentx/andreas/WeightAndGVARS_BugFix
Bugfix for GVARS in weight for stock and ranges for ARM based transmitter
2014-02-22 20:12:13 +01:00
Bertrand Songis c63a29ef97 Debug mods removed for pull request 2014-02-22 19:57:25 +01:00
Bertrand Songis 10a1250496 I like these harmonics (63000, 0, 20000, 0, 20000) 2014-02-22 19:55:18 +01:00
Bertrand Songis 8b90b62333 Missing Power+ in all sources from Companion 2014-02-22 19:40:30 +01:00
Bertrand Songis 7e43a88d3f Some reserve in telemetry sources added 2014-02-22 19:24:01 +01:00
Kjell Kernen 059234a6e0 Fixed image load bug in burn dialog.
Needs to be tested on Linux and Mac.
2014-02-22 18:25:10 +01:00
Kjell Kernen bebb067ee3 Merge pull request #736 from opentx/dvogonen/fix_companion_gui_bugs
Fixed a few minor issues. It seems larger since I had to reformat an entire source file. One of my editors had mangled it and inserted tabs everywhere. Hate that.
2014-02-22 15:30:03 +01:00
Kjell Kernen a4a6d3b0ce Merge branch 'origin/next' 2014-02-22 14:59:27 +01:00
openfsguruh da277536b7 For All:
- GV1_XXX constants are now in myeeprom.h to be close to the mixer defines
  (they need to match to the defined types, e.g. needs to have enough bits)

For Stock:
- bugfix gvars not working for weight for stock transmitter

For ARM based Transmitter:
- limits offset now to 490 (instead of 4085)
- limits for weight and offset can be easily changed in myeeprom.h, with defines
  #define GV_RANGE_WEIGHT 500
  #define GV_RANGE_OFFSET 490
  (be sure they are not bigger than something about 4000)

No code cost
2014-02-22 14:47:36 +01:00
Bertrand Songis a47ac42996 I Add some reserve in custom functions to avoid to change EEPROM 15days
after the release ...
2014-02-22 14:00:01 +01:00
Bertrand Songis 7cf94ec204 Should fix Issue #732. Not reproduced, not tested 2014-02-22 13:15:10 +01:00
Bertrand Songis f3b9135a09 Core in Custom Functions Panel 2014-02-22 12:32:28 +01:00
Bertrand Songis 5337158911 Core in Custom Functions Panel 2014-02-22 12:32:21 +01:00
Bertrand Songis 82e74a72e6 Shift in sources when 7 Lua scripts allowed 2014-02-22 11:13:42 +01:00
Jacek Drewniak aab70cde9d Merge pull request #734 from opentx/driver33/PL_trans
comapnion translation fixes
2014-02-22 11:08:40 +01:00
Jacek Drewniak fdb0e00685 comapnion translation fixes 2014-02-22 11:06:47 +01:00
Jacek Drewniak 2f1056b05a Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-22 10:47:17 +01:00
Bertrand Songis 3333d68fd8 Inputs alignement fixed in Companion 2014-02-22 10:37:08 +01:00
Bertrand Songis 7ebd371ab6 Issue #731 fixed (companion Inputs import bug) 2014-02-22 10:37:07 +01:00
Jacek Drewniak 0f373353c7 Companion PL translation fixes 2014-02-22 10:20:01 +01:00
Andre Bernet 903cb8bd83 Throttle warning fixed
Top bar time colon now blinks "correctly", some people seemed to be confused by it...
2014-02-22 08:47:22 +01:00
Kjell Kernen ccfa25d58e Souce buttons checked in edit splash dialog.
Corrected faulty theme icon.
2014-02-22 00:41:27 +01:00
Andre Bernet 47259fb40a Fix throttle warning
No need to write a space for blinking colon as all positions are hardcoded
2014-02-21 23:35:55 +01:00
Andre Bernet 92a5429ce0 Longer inhibition time for automatic switch prompts at power up 2014-02-21 23:22:06 +01:00
Bertrand Songis 1a61ff64bd Issue #731 - Flight modes switches conversion 2014-02-21 22:59:53 +01:00
Andre Bernet 3f14d6a066 Top bar time colon now blinks "correctly", some people seemed to be confused by it... 2014-02-21 22:55:04 +01:00
Bertrand Songis 0602a550d7 Issue #731 - Calibration conversion 2014-02-21 22:22:05 +01:00
Kjell Kernen e9ce69c6a4 Fixed setting conversion and initialization problems 2014-02-21 20:49:00 +01:00
Bertrand Songis 9c38236a30 Another bug in system prompts referencing 2014-02-21 17:50:34 +01:00
Kjell Kernen ea57e3e40a Corrected a number of smaller issuses in the GUI.
A new profile now keeps the values from the current profile.
Removed the special handling of the Name field in profiles.
2014-02-21 17:29:02 +01:00
Bertrand Songis 9b5b22658a Cosmetics 2014-02-21 17:09:03 +01:00
Bertrand Songis a7bba2a578 Logical switches automatic prompts bugfix 2014-02-21 16:55:43 +01:00
Bertrand Songis d02912577b Merge problem :( 2014-02-21 16:51:51 +01:00
Bertrand Songis af4e1ce85a Merge branch 'bsongis/Issue713_more_custom_functions' of
https://github.com/opentx/opentx into
bsongis/Issue713_more_custom_functions

Conflicts:
	radio/src/audio_arm.cpp
2014-02-21 16:45:58 +01:00
Bertrand Songis 0345173039 No more parsing of all system sounds. Automatic prompts silent after
alerts
2014-02-21 16:40:52 +01:00
Bertrand Songis 5f560e8d1b No more parsing of all system sounds. Automatic prompts silent after
alerts
2014-02-21 15:57:00 +01:00
Bertrand Songis a2ebf07cad Compilation was broken 2014-02-21 15:54:53 +01:00
Bertrand Songis 095bb38c03 Now logical switches automatic prompts 2014-02-21 15:18:05 +01:00
Bertrand Songis 5dbf2063f8 6-pos and 3-pos switches shouldn't be played at startup now 2014-02-21 14:47:38 +01:00
Bertrand Songis 9ade773618 Merge remote-tracking branch 'origin/next' into
bsongis/Issue713_more_custom_functions

Conflicts:
	radio/src/.gitignore
	radio/src/opentx.cpp
2014-02-21 14:26:11 +01:00
Bertrand Songis 9639d60acf Merge pull request #687 from opentx/andreas/Issue020_ThrWarnPotsAndTransmitterFix_Merged
merged changes from Issue020_ThrottleWarning
2014-02-21 14:15:37 +01:00
Bertrand Songis bb774648ff P25 and P26 automatic prompts were not played 2014-02-21 12:16:05 +01:00
Bertrand Songis 23b3ea1856 Background Music should now stop correctly when switch is OFF 2014-02-21 11:58:19 +01:00
Bertrand Songis 6955a492d7 A new set of amplitudes for the sine wave ... 2014-02-21 11:52:02 +01:00
Bertrand Songis 40579a0d75 Makefile cosmetics 2014-02-21 11:15:19 +01:00
Bertrand Songis 6312222eec Flash saving, I hope I am not wrong I removed the STARTUP_WARNING_INIT
state
2014-02-21 11:08:17 +01:00
Bertrand Songis f857d5454e Cosmetics 2014-02-21 10:15:12 +01:00
Kjell Kernen 0e09e1e270 Merge pull request #728 from opentx/dvogonen/making_settings_type_safe
Merging this one myself since both Bertrand and I have been throug it over and over. Better merge it fast before something else changes and forces new changes.
2014-02-21 10:14:09 +01:00
Bertrand Songis 1ca2e091a7 Update menus.cpp 2014-02-21 08:18:29 +01:00
Bertrand Songis cb88a28557 Merge remote-tracking branch 'origin/next' into next 2014-02-21 07:48:44 +01:00
Bertrand Songis 576682f6a8 Merge remote-tracking branch 'origin/next' into dvogonen/making_settings_type_safe 2014-02-21 07:38:30 +01:00
Bertrand Songis 08245aade9 Simulator updated with last Kjell improvements 2014-02-21 07:40:50 +01:00
Bertrand Songis b30cf3ee0e Update .gitignore 2014-02-21 07:19:57 +01:00
Bertrand Songis 04f5afbb9b Merge remote-tracking branch 'origin/next' into bsongis/vario_improvements 2014-02-21 07:19:02 +01:00
Bertrand Songis 9fa5ffc69c Update .gitignore 2014-02-21 07:17:35 +01:00
Bertrand Songis 2aa8c68cf6 Merge remote-tracking branch 'origin/next' into bsongis/vario_improvements 2014-02-21 07:17:00 +01:00
Bertrand Songis 903dc152a5 Merge remote-tracking branch 'origin/next' into
bsongis/vario_improvements

Conflicts:
	radio/src/maths.cpp
2014-02-21 07:13:33 +01:00
Bertrand Songis 99e42ceeb2 Different harmonics. Seem to be better. I would say that:
- all beeps from the radio need to be lowered.
- perhaps the low frequencies don't need to be amplified any more?
2014-02-20 23:26:34 +01:00
Bertrand Songis 67afb99c77 Update DONATIONS.txt 2014-02-20 23:23:15 +01:00
Bertrand Songis 901c5339ff 1000bytes RAM saved 2014-02-20 22:47:14 +01:00
Kjell Kernen 5842bc8473 First merge problem fixed (there are more) 2014-02-20 22:33:41 +01:00
Kjell Kernen 58d8a99511 Merge branch 'origin/next'
Conflicts:
	companion/src/eeprominterface.cpp
	companion/src/firmwares/opentx/opentxinterface.cpp
	companion/src/mainwindow.cpp
	companion/src/simulatordialog.cpp
	companion/src/xsimulatordialog.cpp
2014-02-20 21:37:51 +01:00
Kjell Kernen de3e0e802f Merge pull request #703 from opentx/bsongis/standalone_simu
Bsongis/standalone simu
2014-02-20 21:18:14 +01:00
Bertrand Songis a05a88cc89 Link error when no SDL on VC++ 2014-02-20 21:07:31 +01:00
Kjell Kernen 681a4f436c Forgot the updated CMakeLists.txt file 2014-02-20 20:36:02 +01:00
Kjell Kernen 4805e3eb4b Fixed name space collisions introduced by included QT header. Now compiles on Windows. Finally!
Broke up definitions and declarations in separate files.
Declared base storage class as protected member.
2014-02-20 20:08:49 +01:00
Bertrand Songis f2f9579b77 Automatic sounds for multipos switches 2014-02-20 19:51:32 +01:00
Bertrand Songis e5f336fba1 Indentation 2014-02-20 19:33:09 +01:00
Bertrand Songis 65e6814b28 Switches positions not played at startup 2014-02-20 19:25:08 +01:00
Bertrand Songis 91bec1e4d9 Now it works. No hashed sounds at startup. 2014-02-20 19:07:39 +01:00
Bertrand Songis a91bfbba9e Bug in SD audio parse 2014-02-20 18:15:24 +01:00
Bertrand Songis 7f12f50036 Again the TADA on all alerts 2014-02-20 18:00:14 +01:00
Bertrand Songis fe99e0d917 Merge branch 'bsongis/Issue713_more_custom_functions' of https://github.com/opentx/opentx into bsongis/Issue713_more_custom_functions 2014-02-20 17:13:49 +01:00
Bertrand Songis 204b4b2369 Merge branch 'bsongis/Issue713_more_custom_functions' of
https://github.com/opentx/opentx/ into
bsongis/Issue713_more_custom_functions
2014-02-20 17:17:23 +01:00
Bertrand Songis f8d7007ef8 Merge branch 'bsongis/Issue713_more_custom_functions' of https://github.com/opentx/opentx/ into bsongis/Issue713_more_custom_functions 2014-02-20 17:15:12 +01:00
Bertrand Songis 444fc85710 All alerts are TADA :) 2014-02-20 17:12:53 +01:00
Bertrand Songis 1f318844f0 Compilation error (thanks Jenkins) 2014-02-20 17:01:34 +01:00
Bertrand Songis d5348de16e All alerts are TADA :) 2014-02-20 16:57:36 +01:00
Bertrand Songis be20388278 Now the Ele stick can be used for tests when vario source is dTE 2014-02-20 16:51:25 +01:00
Bertrand Songis 7e0a30c08f Reduces the duration of SD search for automatic model files 2014-02-20 16:21:04 +01:00
Kjell Kernen e87bec64e3 Merge pull request #727 from opentx/dvogonen/use_correct_icons
Now it is possible to see Martins beautiful new icons in a number of the dialogs.
2014-02-20 15:35:59 +01:00
Kjell Kernen 2ac79a7791 Most icons set correctly. Icons only seen in Windows (perhaps Mac).
I have not figured out how to set icons of daughter-windows, only dialogs.
2014-02-20 15:34:13 +01:00
Bertrand Songis 067c4ee0db Another TODO removed 2014-02-20 13:18:18 +01:00
Bertrand Songis a14848fc7f One TODO less ... 2014-02-20 13:01:22 +01:00
Andre Bernet 9fa0919a36 Merge pull request #721 from opentx/bsongis/Issue718_cells_voltage_precision
Issue #718 fixed (Cells voltage accuracy)
2014-02-20 12:48:01 +01:00
Andre Bernet 5659dcb78f Fix cell logs 2014-02-20 12:46:29 +01:00
Andre Bernet 44ea1ae8eb Cells decoding wasn't updated for SPORT 2014-02-20 12:35:34 +01:00
Bertrand Songis e0a03f6728 Simu renamed to simulator, in the same directory as companion 2014-02-20 12:11:10 +01:00
Bertrand Songis 0db90e34c3 Windows inserted \r\n in the EEPROM! 2014-02-20 12:10:26 +01:00
Bertrand Songis 4a9e8d6a4b VC++ Warning removed 2014-02-20 12:08:09 +01:00
Kjell Kernen 4385be717f Defined missed global variable (lastUpdatesDir).
Renamed lastDir to eepromDir, which is a better name.
2014-02-20 09:23:47 +01:00
Kjell Kernen 0cfbc7669d Merge branch 'origin/next' 2014-02-20 08:38:38 +01:00
Bertrand Songis fd855d8a8c VC++ Warning removed 2014-02-20 07:56:13 +01:00
Bertrand Songis 342d2cdb83 VC++ Warnings removed 2014-02-20 07:51:51 +01:00
Bertrand Songis a93ea1faa1 Compilation problem on VC++ 2014-02-20 07:22:36 +01:00
Bertrand Songis 82348f7e05 Import/Export broken in Companion (7scripts instead of 3) 2014-02-19 21:39:39 +01:00
Bertrand Songis 4d1df6a166 4 stages mixer. Now vario can be used with a background music! 2014-02-19 20:31:50 +01:00
Kjell Kernen 73621e1f75 Merge pull request #726 from opentx/mhotar/companion_new_theme
Mhotar/companion new theme
2014-02-19 18:58:25 +01:00
Bertrand Songis 481e312ae3 Vario part in Global Settings page reworked 2014-02-19 17:47:21 +01:00
mhotar 7eee552f2c icons32 -manual handling 2014-02-19 17:14:50 +01:00
Bertrand Songis b3e2e8e321 Compilation failure. Thanks Jenkins! 2014-02-19 16:57:02 +01:00
Bertrand Songis 7c4214d5b9 More custom scripts (7 instead of 3) 2014-02-19 16:41:18 +01:00
Bertrand Songis 5a7fda2f81 Merge branch 'next' into bsongis/Issue713_more_custom_functions 2014-02-19 15:24:51 +01:00
Bertrand Songis 3340a18461 Fix for simu running on VirtualBox mounted directories 2014-02-19 15:23:13 +01:00
Bertrand Songis 59af2e2719 Valgrind detected a value tested, not initialized 2014-02-19 15:22:36 +01:00
Bertrand Songis 271fe6804d Merge remote-tracking branch 'origin/next' into bsongis/Issue713_more_custom_functions 2014-02-19 15:16:30 +01:00
Kjell Kernen 80ef2b8d38 All function names changed to a consistent standard.
Cleaned up indentation of appdata.h
2014-02-19 14:01:34 +01:00
Bertrand Songis ad134173be Issue #713 - Now automatic Switch files are played 2014-02-19 11:30:54 +01:00
Bertrand Songis e38a4d320f Issue #713 - Automatic Switch Audio Files (part 1) 2014-02-19 10:41:03 +01:00
Kjell Kernen 82910acffe Merge branch 'origin/next' 2014-02-19 00:41:45 +01:00
mhotar bd8c1b6f32 source vectors 2014-02-18 23:51:33 +01:00
mhotar da0c47f536 theme icons -all but not optimised 2014-02-18 23:49:46 +01:00
Kjell Kernen da68c593cf Changed every single QSetting in Companion.
Next step: Function renaming
2014-02-18 23:48:57 +01:00
mhotar 141b999b92 theme rename -missing part 2014-02-18 23:48:24 +01:00
Bertrand Songis fbd0744431 Issue #713 - 64 custom functions instead of 32. 8chars only filenames in
PlayTrack function
2014-02-18 22:46:30 +01:00
Bertrand Songis 197c008937 Update DONATIONS.txt 2014-02-18 20:46:04 +01:00
Bertrand Songis f9590d4141 Vario bugfixes 2014-02-18 20:44:10 +01:00
Bertrand Songis 8023606223 A little bit expo (x^2) in repeat frequency 2014-02-18 16:28:25 +01:00
Bertrand Songis 0157eebf7c Vario: allows a refresh of tones frequency / duration every 10ms 2014-02-18 16:08:42 +01:00
Bertrand Songis ec6d1c1212 Companion import/export for new vario parameters 2014-02-18 15:04:20 +01:00
Bertrand Songis 8c5798443a Vario experiments around tone/silence ratio. Now (100% / 75%-50% linear
/ 25%)
2014-02-18 15:01:54 +01:00
Bertrand Songis d389d31694 Issue #718 fixed (Cells voltage accuracy) 2014-02-18 14:54:23 +01:00
Bertrand Songis ef51b2e6e8 dTE added as a Vario source. Still not added the algorithms to take it
into account, we don't have any dTE capable sensor yet
2014-02-18 11:55:04 +01:00
Bertrand Songis 45330e6468 Update DONATIONS.txt 2014-02-18 11:49:24 +01:00
mhotar 9f658cd760 new theme folder renamed 2014-02-18 11:37:58 +01:00
Bertrand Songis 1767de646d Vario repeat parameter added 2014-02-18 11:33:02 +01:00
mhotar 259f8efdf9 new theme renamed 2014-02-18 11:29:34 +01:00
Bertrand Songis 298fb332f9 Update DONATIONS.txt 2014-02-18 07:51:30 +01:00
Kjell Kernen f617ae1362 Modeledit added 2014-02-18 00:25:04 +01:00
Kjell Kernen 2616961b95 Merge branch 'origin/next' 2014-02-17 23:49:08 +01:00
Kjell Kernen c23a096a73 Almost all global settings wrapped in protective object to guarantee type safety and protect against tag spelling errors (I have found and corrected a lot of those!).
Joystick settings and burner configuration is not yet within the global object.
2014-02-17 23:47:40 +01:00
Bertrand Songis 967af60cbe Vario improvements 2014-02-17 23:26:12 +01:00
openfsguruh b82ffe308d Merge branch 'next' 2014-02-17 21:08:39 +01:00
openfsguruh 76bda4f89a Revert "Revert "Merge branch 'next'""
This reverts commit a9f4d2185c.
2014-02-17 21:06:46 +01:00
openfsguruh a9f4d2185c Revert "Merge branch 'next'"
This reverts commit a2ecdaa484, reversing
changes made to c909590091.
2014-02-17 20:59:11 +01:00
openfsguruh a2ecdaa484 Merge branch 'next'
Conflicts:
	companion/src/customizesplashdialog.cpp
	companion/src/mainwindow.cpp
	companion/src/translations/companion_pl.ts
2014-02-17 20:56:50 +01:00
Bertrand Songis ade4c07083 Update DONATIONS.txt 2014-02-17 20:22:34 +01:00
Kjell Kernen 2633b61433 Profiles working.
Next all duplicated variables will be removed from global and only exists in profile.
2014-02-17 15:28:50 +01:00
Bertrand Songis 7164375b75 2 harmonics added to the sine wave 2014-02-17 15:27:15 +01:00
Bertrand Songis 502ea0e921 Lower sounds must have a greater amplitude in order to have the same
energy
2014-02-17 15:19:05 +01:00
Bertrand Songis 408d0ef26d Allow 110Hz tones 2014-02-17 14:41:33 +01:00
Bertrand Songis 8ec13c59e9 Update DONATIONS.txt 2014-02-17 07:05:41 +01:00
Kjell Kernen fdc9873ab8 Profile date is now type safe. Semi working, not complete yet. 2014-02-17 01:16:24 +01:00
mhotar d2189f5d10 new theme icons 2014-02-17 00:49:37 +01:00
Bertrand Songis cc5061970e Update DONATIONS.txt 2014-02-16 20:15:42 +01:00
Kjell Kernen acbe17e4bc Main and the preferences dialog are done.
At least as far as the simple values. I have not made support for complex values like profiles yet.
2014-02-16 18:17:10 +01:00
Kjell Kernen ea3f47c7f2 I will wrap the unsafe global settings operations in a application data object.
I have found several bugs in the current model, where settings labels have been spelled badly or been of the wrong type.
2014-02-16 16:48:55 +01:00
Bertrand Songis 7ef2f866af Update maths.cpp 2014-02-16 15:58:55 +01:00
Bertrand Songis d02d78101c Issue #182 fixed 2014-02-16 10:21:28 +01:00
Bertrand Songis 79e86c249a Issue #708 fixed (Bugs in Telemetry and Logical Switches) 2014-02-15 20:38:01 +01:00
Bertrand Songis 52dff725c1 Issue #707 fixed (EEPROM conversions) 2014-02-15 19:00:14 +01:00
Kjell Kernen d2674a5ba1 Merge pull request #709 from opentx/dvogonen/add_finnish_to_companion_menu_languages
Dvogonen/add finnish to companion menu languages
2014-02-15 12:17:44 +01:00
Kjell Kernen c4c67658b4 Last pieces in place to support Finnish 2014-02-15 12:15:33 +01:00
Kjell Kernen 745161ee6e Merge branch 'origin/next' 2014-02-15 12:01:03 +01:00
Kjell Kernen 81fd67585e Merge pull request #706 from opentx/driver33/PL_Translation
changes in translation of Companion and adding Finish transaltion RAW fi...
2014-02-15 12:00:06 +01:00
Kjell Kernen 26c1bc0725 Added Finnish to menu languges 2014-02-15 11:47:15 +01:00
Kjell Kernen 24f30bf5e1 Added fi.h to ignored temp files 2014-02-15 10:14:05 +01:00
Jacek Drewniak e607dea888 changes in translation of Companion and adding Finish transaltion RAW file 2014-02-15 10:06:29 +01:00
Jacek Drewniak 3bdce075a1 Merge pull request #704 from opentx/driver33/PL_translation_WIKI
small changes
2014-02-15 09:42:28 +01:00
Kjell Kernen e19df39c0e Changing function names to make the code easier to read and understand.
I am looking at simplifying the code for reading and writing firmware. There seems to be a few bugs...
2014-02-15 02:42:48 +01:00
mhotar 78fb60de27 new theme icons #684 2014-02-15 01:18:53 +01:00
Jacek Drewniak a12367c0fa small changes 2014-02-14 23:45:26 +01:00
Bertrand Songis 249152394b Merge remote-tracking branch 'origin/next' into bsongis/standalone_simu 2014-02-14 18:36:54 +01:00
Bertrand Songis 0d76f2461a Issue #515 fixed. Standalone Qt based simu added. xsimulatordialog and
simulatordialog merged
2014-02-14 18:34:01 +01:00
Kjell Kernen 6bbf56bdd8 I checked in the Finnish header file by mistake.
File deleted.
2014-02-14 17:35:20 +01:00
Bertrand Songis a87e5af764 Merge pull request #702 from opentx/dvogonen/finnish_language_suport_673
Full support for Finnish language in OpenTX
2014-02-14 17:25:42 +01:00
Kjell Kernen 3d542a0ded Full support for Finnish language in OpenTX 2014-02-14 17:18:23 +01:00
mhotar 646485599a new theme icons32 2014-02-14 17:04:04 +01:00
Kjell Kernen ba5a9c723e Updated swedish translation with all the latest strings 2014-02-14 16:24:04 +01:00
Bertrand Songis 0b9602a8da Merge pull request #700 from opentx/driver33/PL_Translation
critical fixes - Opentx FW compilation error PL translation
2014-02-14 07:05:54 +01:00
Jacek Drewniak 3d5a9904d0 critical fixes - Opentx FW compilation error PL translation 2014-02-13 23:31:07 +01:00
Kjell Kernen b5af24e8c9 Merge pull request #699 from opentx/dvogonen/cleaning_up_code
Cleaned up the action definitions in Companion.
2014-02-13 22:15:56 +01:00
Kjell Kernen 3084ad12c5 Cleaned up the action definitions. 2014-02-13 22:13:49 +01:00
Bertrand Songis aa19969759 Warning removed 2014-02-13 18:11:40 +01:00
Bertrand Songis a918f293cf Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-13 17:37:04 +01:00
Bertrand Songis 7d3642e16f Issue #89 fixed - ASpd, dTE, Cel-, Vfas- added to Telemetry. All
telemetry values available in logical switches
2014-02-13 17:33:51 +01:00
Andre Bernet d2dd9fa6f8 Ignore list 2014-02-13 16:05:23 +01:00
Andre Bernet e505efc9f5 Merge pull request #681 from opentx/bsongis/Lua_interpreter_171
Bsongis/lua interpreter #171
2014-02-13 15:57:57 +01:00
Kjell Kernen 2c605e8280 Merge pull request #693 from opentx/dvogonen/menu_selections_are_invisible
Companion menu selections are now marked the proper way for each OS.
2014-02-13 00:07:56 +01:00
Kjell Kernen 6f807b007b Companion menu selections are now marked the propper way for each operating system. Previously they were marked in nonstandard ways or not at all. 2014-02-13 00:05:22 +01:00
openfsguruh c909590091 updated from branch "next"
Merge branch 'next'
2014-02-12 21:13:59 +01:00
Kjell Kernen 26d9455b8a A bunch of new icons for the New Theme 2014-02-12 16:11:43 +01:00
Bertrand Songis 491f4e12c2 Logical Switches import issue (Telemetry) 2014-02-12 15:57:53 +01:00
Kjell Kernen a0dbfddad0 Merge pull request #692 from opentx/dvogonen/add_new_icon_theme
New icon theme added
2014-02-12 13:23:41 +01:00
Kjell Kernen 4ca9aba433 New icon theme added 2014-02-12 13:22:46 +01:00
Kjell Kernen fab041ce16 Reverted all classical icon theme icons 2014-02-12 10:52:58 +01:00
Kjell Kernen 53b8825d03 Originals for classic icon theme reverted. 2014-02-12 10:49:14 +01:00
Kjell Kernen 675a425eed Moving icons around to make room for New theme 2014-02-12 09:59:25 +01:00
Kjell Kernen 9a47c9d067 Merge pull request #690 from opentx/dvogonen/splasheditor_width_bug
Merging this so I can close my two conflicting branches.
2014-02-12 01:28:44 +01:00
Kjell Kernen 64573dd571 Merge branch 'origin/next' 2014-02-12 01:21:59 +01:00
Kjell Kernen 94720b0c4e Fixes width bug for 212 wide images. 2014-02-12 01:11:30 +01:00
Bertrand Songis c034abdb4e Merge pull request #689 from opentx/driver33/PL_Translation
Fixes
2014-02-11 21:37:06 +01:00
Jacek Drewniak 60b4fb1126 Fixes 2014-02-11 21:04:39 +01:00
Andre Bernet a76484a7eb Merge branch 'next' into bsongis/Lua_interpreter_171 2014-02-11 18:21:18 +01:00
Andre Bernet 973475d01e Telemetry comparison value conversions weren't being run 2014-02-11 18:17:31 +01:00
Kjell Kernen 48af7aefd0 Made the Splash editor respect the 9x/Taranis LCD widths in a consistent way. Previously everything was displayed as a Taranis bitmap.
Pictures larger than 9x width will get scaled to Taranis width (212 pix).
2014-02-11 18:08:54 +01:00
openfsguruh a4f4999546 bugfix: Throttle warning shown wrong in companion
Actually Throttle warning was not ticked by default in companion, and if
ticked, it was disabled, and when not ticked it was enabled.
Now it fits to the real firmware settings.
2014-02-11 17:40:05 +01:00
Andre Bernet 9caa0f1e3b AND switch wasn't converted 2014-02-11 17:24:03 +01:00
openfsguruh 45ba06c7b9 Merge remote-tracking branch 'origin/next' into andreas/Issue020_ThrWarnPotsAndTransmitterFix_Merged 2014-02-11 17:10:18 +01:00
Bertrand Songis 83727726aa Merge pull request #686 from opentx/dvogonen/companion_interface_bugfixes
A few bug fixes and an updated Swedish translation.
2014-02-11 14:07:38 +01:00
Kjell Kernen 18a2af7291 A few bug fixes and an updated Swedish translation. 2014-02-11 14:03:03 +01:00
Bertrand Songis 448a3c1b6b Code cleaning around vario 2014-02-11 12:32:16 +01:00
Bertrand Songis 7a9105dccb Switches for 9X didn't longer works for Mixers as input 2014-02-11 11:47:03 +01:00
Bertrand Songis 2c60b84258 Conversions errors (negative switches) 2014-02-11 11:29:10 +01:00
Bertrand Songis f5797b2b3a Merge pull request #684 from opentx/dvogonen/tabbed_preferences
Dvogonen/tabbed preferences
2014-02-11 08:47:19 +01:00
Kjell Kernen eedc5ea68f Profiles can now be added and removed in a proper way. 2014-02-11 08:37:07 +01:00
Kjell Kernen 58e213f578 Merge branch 'origin/next' 2014-02-11 04:38:03 +01:00
Bertrand Songis 2794bb8070 Wrap around in Logical Switches sources 2014-02-10 22:06:19 +01:00
Bertrand Songis 72898b0d3a Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-10 21:43:36 +01:00
Bertrand Songis dcaed635f0 Code factorisation in EEPROM conversions 2014-02-10 21:45:13 +01:00
openfsguruh da23a624dc merged changes from Issue020_ThrottleWarning
based on current next branch, includes all changes from old
ThrottleWarning branch.

Solves issue 020: Throttle warning if P1-P3 is selected as Thr source.
Adds Turnigy TransmitterFix option
code savings:
120 bytes without Transmitter fix
4 bytes but 1 more data if Transmitter Fix is activated.

Added make option TURNIGY_TRANSMITTER_FIX for this purpose
TURNIGY_TRANSMITTER_FIX = NO   is default
set to YES for new Turnigy9x transmitter which transmits even no pulses
are generated.
2014-02-10 20:51:25 +01:00
Kjell Kernen 70ddd2911a Merge pull request #676 from opentx/driver33/PL_Translation
Fixes (reverted from commit 1a6832c83a)
2014-02-10 20:41:29 +01:00
Andre Bernet bb4fc32b00 Fix conversion of timer source and CFs 2014-02-10 20:16:18 +01:00
Bertrand Songis 1a6832c83a Merge pull request #676 from opentx/driver33/PL_Translation
Fixes
2014-02-10 18:01:47 +01:00
Kjell Kernen b74d7f0f32 Added code for creating new profiles. 2014-02-10 18:01:43 +01:00
Bertrand Songis 7eddd64e3a Merge remote-tracking branch 'origin/next' into
bsongis/Lua_interpreter_171

Conflicts:
	companion/src/firmwares/opentx/opentxeeprom.cpp
2014-02-10 17:57:40 +01:00
Bertrand Songis 9337fa861f EEPROM v216 conversions fixes 2014-02-10 17:52:53 +01:00
Kjell Kernen d5e22111e1 App Preferences dialog tabs fully functional, except for adding profiles.
Splash Editor fully functional. Improved handling of image formats remain.
Merged branch 'origin/next'
2014-02-10 16:59:49 +01:00
Bertrand Songis 51a6c3c0ab Merge pull request #679 from opentx/kilrah/Switch_and_pot_warnings
Kilrah/switch and pot warnings
2014-02-10 16:21:25 +01:00
Bertrand Songis c205336fa6 mAh was store two times on Tx shutdown 2014-02-10 16:17:47 +01:00
Bertrand Songis cde4fea817 getVersion added to Lua functions 2014-02-10 16:05:32 +01:00
Andre Bernet 9ac30369e0 Solve merge conflict 2014-02-10 15:27:53 +01:00
Andre Bernet f635a1e762 Solve merge conflict 2014-02-10 15:25:18 +01:00
Andre Bernet a43caca219 Translations 2014-02-10 15:17:24 +01:00
Andre Bernet 041bf5aa04 Try to get rid of character mess 2014-02-10 15:14:35 +01:00
Bertrand Songis ce6e9fa4a9 Lua EEPROM support in Companion added 2014-02-10 14:47:33 +01:00
Andre Bernet 2a83cffc53 Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Switch_and_pot_warnings
Conflicts:
	companion/src/eeprominterface.h
	companion/src/firmwares/opentx/opentxeeprom.cpp
	radio/src/opentx.cpp
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h.txt
2014-02-10 14:47:32 +01:00
Andre Bernet b39dd034c6 Switch warnings before 21 March 2013 imported OK 2014-02-10 13:08:56 +01:00
Andre Bernet 160cf07110 Switch states now imported correctly after 21 March 2013, need to check the case of before that 2014-02-10 12:34:52 +01:00
Bertrand Songis d374453c8f Lua now uses our fake FatFS when running in simu 2014-02-10 12:15:24 +01:00
Andre Bernet da5359af87 Missing rename 2014-02-10 11:58:24 +01:00
Andre Bernet 2f6c8cb200 Rename AFTER release xxx 2014-02-10 11:45:08 +01:00
Bertrand Songis e15eb9ff79 Lua branch updated to 'next' 2014-02-10 11:26:50 +01:00
Bertrand Songis 7e65fe82c3 Companion compilation error on VC++ 2014-02-10 10:31:15 +01:00
Bertrand Songis 330234df01 Lua interpreter now running inside companion! 2014-02-10 10:31:14 +01:00
Bertrand Songis 8f08a61d12 Lua interpreter introduced 2014-02-10 10:29:31 +01:00
Bertrand Songis 12997bd169 Bug on ID2 fixed 2014-02-10 10:22:12 +01:00
Kjell Kernen c48e1781fd The profile tab is now functional 2014-02-10 07:54:42 +01:00
Andre Bernet dc660d4ade Switch/pot warnings were duplicated in companion structure for Taranis
nPotsToWarn relocated out of MODELDATA_EXTRA
Only bug left is ID2 on stock appearing as RUD in the states
2014-02-09 23:45:31 +01:00
Andre Bernet 30d13baeab Don't update pot warnings when not applicable 2014-02-09 20:19:15 +01:00
Jacek Drewniak af755fa549 R E T A no-translate fix 2014-02-09 17:21:53 +01:00
Jacek Drewniak ac57faa85e Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-09 15:28:38 +01:00
Jacek Drewniak ee2e46f3cb Fixes 2014-02-09 15:27:30 +01:00
Bertrand Songis c64ef77f08 Update DONATIONS.txt 2014-02-09 15:22:33 +01:00
Kjell Kernen 07a6fd8ee7 Alternative testable tab based setting version. 2014-02-09 14:30:50 +01:00
Jacek Drewniak 0188d076e3 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-09 11:43:17 +01:00
Andre Bernet 0f340e1aaf Merge pull request #669 from opentx/bsongis/Issue594_settimer_function
Bsongis/issue594 settimer function
2014-02-09 11:35:51 +01:00
Jacek Drewniak 2e270950fe Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-09 11:17:44 +01:00
Bertrand Songis 24ae9854c0 Merge pull request #671 from opentx/dvogonen/remove_profile_import_export
Import and Export of profiles removed.
2014-02-09 08:51:40 +01:00
Bertrand Songis 4b280fb3fa Merge pull request #672 from opentx/dvogonen/add_menu_help_link
Fixes #495
2014-02-09 08:50:34 +01:00
Bertrand Songis d932bfc79a Update DONATIONS.txt 2014-02-09 08:49:54 +01:00
Kjell Kernen 7ef7436118 Fixes #495
Added link to OpenTX documentation page in the help menu
2014-02-09 01:12:01 +01:00
Kjell Kernen b99cb4c431 Import and Export of profiles removed. 2014-02-09 00:35:46 +01:00
Jacek Drewniak 0b13c57b96 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-08 23:54:30 +01:00
Bertrand Songis 6560c99445 Avoids the crash in Companion 2014-02-08 18:22:06 +01:00
Bertrand Songis e27a8bece4 Avoids the "No matching signal" warnings (on_XXX slots seem parsed by
moc)
2014-02-08 18:06:55 +01:00
Bertrand Songis 1ef2e89972 Merge pull request #668 from opentx/dvogonen/simplify_companion_preferences_dialog_632
Dvogonen/simplify companion preferences dialog 632
2014-02-08 17:17:14 +01:00
Bertrand Songis d146966a18 Issue #594 (SetTimer) - Companion part done 2014-02-08 17:12:26 +01:00
Kjell Kernen 417ab94993 Merge branch 'origin/next' 2014-02-08 17:03:48 +01:00
Bertrand Songis 9052f8824e Issue #594 - Two timers can be set ... 2014-02-08 16:58:12 +01:00
Bertrand Songis 2aca8a1338 Merge pull request #666 from opentx/kilrah/665_Failsafes
Fix Issue #665
2014-02-08 16:43:30 +01:00
Kjell Kernen 5c70c2f415 Moved fields around in the fwPref dialog to make it clear what affects the current settings (profile) and what configures the download. 2014-02-08 16:41:06 +01:00
Bertrand Songis a9ed6485fd Issue #594 (Set Timer Function) - Still missing UI in Companion 2014-02-08 13:44:42 +01:00
Andre Bernet f79ae6c39b Falisafe settings fixed, now include decimal (slider removed) and scaled properly taking 1000/1024 ratio to match display on the radio 2014-02-08 13:14:20 +01:00
Bertrand Songis 63d48e810d Update DONATIONS.txt 2014-02-08 09:30:50 +01:00
Bertrand Songis 08a37b77e7 Renaming started ... who wants to continue? 2014-02-08 08:38:06 +01:00
Bertrand Songis afc3b61232 Merge pull request #661 from opentx/dvogonen/simplify_companion_preferences_dialog_632
Dvogonen/simplify companion preferences dialog 632
2014-02-08 07:48:37 +01:00
Andre Bernet 2f437ccad5 French translations 2014-02-08 01:06:07 +01:00
Andre Bernet 5f75e5851e Rename "Stay" to "Edge" 2014-02-08 01:05:54 +01:00
Andre Bernet 1ce67a62c2 Sync translations 2014-02-08 00:50:03 +01:00
Andre Bernet ca9d53dbdd CS->LS 2014-02-08 00:30:35 +01:00
Andre Bernet 17823786e4 Merge branch 'bsongis/Issue592_sticky_switches' into next
Conflicts:
	radio/src/gui/menu_model.cpp
2014-02-07 23:39:28 +01:00
Bertrand Songis 4c5ac47507 Problem with AdjustGVAR modes on ARM boards (mode has > 2bits, allowing
more modes if needed later)
2014-02-07 22:58:12 +01:00
Bertrand Songis f686934430 Delay not applicable on Stay logical switches 2014-02-07 22:17:32 +01:00
Bertrand Songis 2e35e095c6 AUTOSWITCH enabled with Stay function 2014-02-07 22:10:06 +01:00
Bertrand Songis 8f0a318cc3 Issue #662 fixed - Companion copy/paste bug 2014-02-07 21:52:30 +01:00
Bertrand Songis 55f600a63c Stay function added in Companion 2014-02-07 18:24:25 +01:00
Bertrand Songis 9894fda194 Issue #592 - Stay logical switches function added. Range also prepared
to avoid another EEPROM change in a future release.
2014-02-07 17:50:29 +01:00
Kjell Kernen db1a459a47 Updated translation 2014-02-07 17:19:29 +01:00
Kjell Kernen 23a61cc60e Merge branch 'origin/next'
Conflicts:
	companion/src/translations/companion_pl.ts
2014-02-07 17:10:40 +01:00
Kjell Kernen 98779da0cf Editor getting some functionality 2014-02-07 17:06:11 +01:00
Andre Bernet b12f76bc39 Merge pull request #621 from opentx/bsongis/Issue554_trims_relative_default
All good!
2014-02-07 11:35:58 +01:00
Andre Bernet 2364752a98 Trims included in simulator stick labels 2014-02-07 11:21:40 +01:00
Bertrand Songis f7f1de4e94 Merge branch 'bsongis/Issue592_sticky_switches' of https://github.com/opentx/opentx into bsongis/Issue592_sticky_switches 2014-02-07 07:36:25 +01:00
Bertrand Songis 86bd251f74 Simulator always asked for calibration 2014-02-07 07:34:40 +01:00
Bertrand Songis e4ee5a0cd9 Merge pull request #655 from opentx/driver33/PL_Translation
adding new things from changes
2014-02-07 07:07:57 +01:00
Jacek Drewniak 5c0c57a2c5 Merge branch 'driver33/PL_Translation' into next 2014-02-07 01:18:34 +01:00
mhotar 1006496795 CFN-param alignments 2014-02-06 23:58:01 +01:00
Bertrand Songis eb80d75ee1 Timer modes support in Companion 2014-02-06 22:44:11 +01:00
Kjell Kernen c7b7cd2ba9 Splash Editor modified 2014-02-06 20:52:17 +01:00
Kjell Kernen 9badcb3513 Merge branch 'origin/next'
Conflicts:
	companion/src/apppreferencesdialog.cpp
	companion/src/apppreferencesdialog.h
	companion/src/apppreferencesdialog.ui
	companion/src/fwpreferencesdialog.ui
	companion/src/imgpreferences.ui
	companion/src/mainwindow.cpp
2014-02-06 18:15:12 +01:00
Kjell Kernen 7b8a7ffd58 Split of preferences completed.
Old preferences still left for testing (last checking with that).
Work started on updating the splash editor.
2014-02-06 17:59:58 +01:00
Bertrand Songis 01242e2b78 Issue #592 - AND switch bug on 9x stock 2014-02-06 16:23:48 +01:00
Bertrand Songis 38129abd43 Issue #592 - 422bytes saved on 9x stock!!! 2014-02-06 15:57:59 +01:00
Bertrand Songis cae4d1ecf6 Issue #592 - All boards will have this feature available, it costs only
50bytes on stock board (I saved more in this same branch)
2014-02-06 14:43:43 +01:00
Bertrand Songis 4a20329b2b Issue #192 - Trims and Rotary encoders buttons added to the switches
list
2014-02-06 12:45:53 +01:00
Bertrand Songis dac51367f4 Update DONATIONS.txt 2014-02-06 07:05:22 +01:00
Kjell Kernen 2d241ea9d9 Preference dialog split into two dialogs.
Both the two new dialogs and the old one are active and working at the same time. The old one will be removed when everything is in place.
New preference icons are added for classical theme.
Placeholder icons added for all monochrome themes.
The only thing not moved is the splash screen functionality. It does not really fit in either dialog and there are allready another special dialog for customizing splash screens. Perhaps make a combined dialog for all splash screen work? Will think about it tomorrow.
2014-02-06 00:00:22 +01:00
Bertrand Songis 46fe25fd24 Companion typos 2014-02-05 22:32:54 +01:00
Bertrand Songis c473b8e105 Issue #592 - Support for Sticky Switches in Companion 2014-02-05 22:31:43 +01:00
Jacek Drewniak 71b28cff87 adding new things from changes 2014-02-05 22:08:55 +01:00
Kjell Kernen 1f7be79a92 Revert "Two new dialogs defined."
This reverts commit d9f97016e2.
2014-02-05 17:48:01 +01:00
Kjell Kernen 06bb5ab175 Merge branch 'origin/next' 2014-02-05 17:46:12 +01:00
Kjell Kernen d9f97016e2 Two new dialogs defined. 2014-02-05 17:44:49 +01:00
Bertrand Songis 873d2c4377 Merge remote-tracking branch 'origin/next' into
bsongis/Issue592_sticky_switches

Conflicts:
	radio/src/gui/menu_model.cpp
2014-02-05 08:01:40 +01:00
Bertrand Songis 8ff61ef915 Update DONATIONS.txt 2014-02-05 07:22:12 +01:00
Bertrand Songis cefd125117 Merge pull request #654 from opentx/dvogonen/simplify_companion_preferences_dialog_632
First preference simplification step
2014-02-04 13:55:54 -08:00
Kjell Kernen bb3335b555 Updated translation files 2014-02-04 22:47:14 +01:00
Kjell Kernen 191c11056a Merge branch 'next' 2014-02-04 22:40:59 +01:00
Kjell Kernen cf6a56b64a Merge branch 'origin/next' 2014-02-04 22:38:03 +01:00
Kjell Kernen 0ecadadeb4 Settings menu created which will hold all configurations and settings.
Language, theme and icon size broken out of the preferences and put into the menu, where they belong.
2014-02-04 22:37:13 +01:00
Bertrand Songis cfa5382969 Update DONATIONS.txt 2014-02-04 22:26:08 +01:00
Bertrand Songis 77ff73a89b Merge pull request #653 from opentx/mhotar/layout_alignments_Issue#584
Mhotar/layout alignments issue#584
2014-02-04 11:51:48 -08:00
mhotar 9744eb966c pointer and ":" fix 2014-02-04 20:25:35 +01:00
mhotar 0a45a71ea0 merge ate PL,FR,ES translations files 2014-02-04 14:43:16 +01:00
mhotar 40edf9f88a Merge remote-tracking branch 'origin/next' into mhotar/layout_alignments_Issue #584
Conflicts:
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h.txt
	radio/src/translations/pl.h.txt
Manually resolved.
2014-02-04 13:41:39 +01:00
mhotar 49bcb3b0fc Centered strings #584 2014-02-04 13:01:59 +01:00
Bertrand Songis 08cc65b517 Merge pull request #648 from opentx/driver33/PL_Translation
fix according to (#646)
2014-02-04 02:00:01 -08:00
Bertrand Songis b18a642de6 Test Companion automatic compilation 2014-02-04 10:48:48 +01:00
Bertrand Songis 9c82e62cc7 [all] Issue #592 - Corrections (GVARS) 2014-02-04 10:30:26 +01:00
Bertrand Songis 98eb42a77c Issue #592 - Corrections for ARM boards 2014-02-04 07:35:46 +01:00
Bertrand Songis 21398347f1 Update DONATIONS.txt 2014-02-04 07:16:33 +01:00
Bertrand Songis a48d76504a [all] Issue #592 - Sticky switches: more code rewritten, more flash
saved on 9x stock. Logical Switches Delay and Duration modified on
Taranis and Sky9x
2014-02-03 23:20:49 +01:00
Kjell Kernen 71ef6d5457 Changed names for Master/Slave in Swedsih translation 2014-02-03 23:17:55 +01:00
Andre Bernet 10dc3503c2 Pot warning UI in companion 2014-02-03 21:32:19 +01:00
Jacek Drewniak c4251c4ee2 fix according to (#646) 2014-02-03 19:09:51 +01:00
Andre Bernet 62ad79538f Fix constant string, remove warning 2014-02-03 17:42:38 +01:00
Andre Bernet 28e9d0ee94 Fix UTF8 mess 2014-02-03 17:18:22 +01:00
Andre Bernet 59ad4f79fc Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Switch_and_pot_warnings
Conflicts:
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h.txt
	radio/src/translations/pl.h.txt
	radio/src/translations/se.h.txt
2014-02-03 17:15:08 +01:00
Andre Bernet efacc05868 Switch warnings for ID0 on 9x now display the position it should have, like on Taranis. Makes more sense than having the current position. 2014-02-03 17:07:45 +01:00
Bertrand Songis c2b18553ab Merge branch 'bsongis/Issue592_sticky_switches' of
https://github.com/opentx/opentx into bsongis/Issue592_sticky_switches

Conflicts:
	radio/src/opentx.cpp
2014-02-03 15:10:27 +01:00
Bertrand Songis 075a21b53a Merge branch 'bsongis/Issue592_sticky_switches' of
https://github.com/opentx/opentx into bsongis/Issue592_sticky_switches

Conflicts:
	radio/src/opentx.cpp
2014-02-03 15:07:37 +01:00
Bertrand Songis c8ae023a15 Merge branch 'bsongis/Issue592_sticky_switches' of
https://github.com/opentx/opentx into bsongis/Issue592_sticky_switches

Conflicts:
	radio/src/opentx.cpp
2014-02-03 15:05:10 +01:00
Bertrand Songis e48c27d30a [all] Issue #592 - Sticky switches on all boards. Saves 62bytes on
stock!
2014-02-03 14:33:55 +01:00
Bertrand Songis b404673f58 [all] Issue #592 - Sticky switches on all boards. Saves 62bytes on
stock!
2014-02-03 14:07:42 +01:00
Dvogonen b8f3e1771d Corrected an image problem with a section being slightly "blacker" than the black surrounding it. Pushing directly to next. 2014-02-03 13:58:19 +01:00
Kjell Kernen e0fe763832 Merge pull request #647 from opentx/dvogonen/renaming_even_more_CS_to_LS
Changed CS labels in xsimulator to LS labels
2014-02-03 04:52:12 -08:00
Dvogonen 5960f25878 Changed CS labels in xsimulator to LS labels 2014-02-03 13:50:19 +01:00
Kjell Kernen 719aa2ee49 Merge pull request #646 from opentx/dvogonen/rename_another_screenful_of_CS_to_LS
Renamed the CS labels in the simulator dialog to LS
2014-02-03 03:09:13 -08:00
Dvogonen 1b071cbf47 Renamed the CS labels in the simulator dialog to LS 2014-02-03 12:07:52 +01:00
Kjell Kernen 210c03e0a1 Merge pull request #645 from opentx/dvogonen/swedish_translation_branch
Translated latest strings to Swedish and made minor improvements
2014-02-03 02:55:22 -08:00
Dvogonen 2b878af183 TRanslated latest strings and made minor improvements 2014-02-03 11:53:40 +01:00
Bertrand Songis 9730f8d190 [Taranis] Issue #592 - Sticky switches 2014-02-03 11:22:06 +01:00
Andre Bernet 7c81920431 Debug wasn't padded 2014-02-03 10:21:42 +01:00
Andre Bernet d44f3d9f3e Merge pull request #643 from opentx/driver33/PL_translation
Driver33/pl translation
2014-02-03 01:18:11 -08:00
Andre Bernet 6509a5a66e Conflict resolved the wrong way 2014-02-03 10:17:09 +01:00
Jacek Drewniak 6a9b21b6e6 fixes in both companion and opentx new string in companion helpers that need to be transfered into other translation files 2014-02-03 00:59:29 +01:00
Andre Bernet 9a81cc37b3 Remove Virtual SP2UART choice for serial port for now, sync translations (Debug) 2014-02-03 00:05:44 +01:00
Andre Bernet 352a2e023a Merge pull request #641 from opentx/driver33/sport
Driver33/sport
2014-02-02 14:57:42 -08:00
Jacek Drewniak 5916959038 Chenged SPORT to S-Port in all translation files. 2014-02-02 23:48:23 +01:00
Bertrand Songis 413c146fe0 [Taranis] 6pos multiswitch fix 2014-02-02 22:50:36 +01:00
Bertrand Songis 64a8349120 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-02 21:52:44 +01:00
Bertrand Songis f4784e61b1 Companion didn't compile properly! 2014-02-02 21:57:12 +01:00
Bertrand Songis cb7cb4aaf8 [Taranis] 6pos multiswitch adjustments 2014-02-02 21:51:42 +01:00
Bertrand Songis e6c92d1ed9 Update DONATIONS.txt 2014-02-02 19:02:23 +01:00
Bertrand Songis 698885f645 [Taranis, Sky9x] Wav files played even in silent mode. 2014-02-02 13:51:33 +01:00
Andre Bernet e1aba1bc1c Fixes fixed 2014-02-02 12:14:30 +01:00
Bertrand Songis 3adac4c795 Update DONATIONS.txt 2014-02-02 12:02:29 +01:00
Andre Bernet 54076ebb8f Merge pull request #634 from opentx/bsongis/Taranis_UART3_modes
UART3 Debug/SPORT modes

Looks all good!
2014-02-02 02:17:27 -08:00
Bertrand Songis 0f1c14549e [all] Issue #627 fixed 2014-02-02 09:40:04 +01:00
Bertrand Songis 72022a0e32 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-02-02 09:13:48 +01:00
Bertrand Songis c91759166a [all] Issue #626 fixed 2014-02-02 09:14:10 +01:00
Jacek Drewniak 2a9d5d4778 Fixes 2014-02-02 00:32:39 +01:00
Bertrand Songis c045a6214b [Taranis] Issue #626 fixed 2014-02-01 21:59:46 +01:00
Bertrand Songis 3e2e665955 [Taranis] Pull request #610 - Speaker volume hysteresis 2014-02-01 21:44:02 +01:00
Bertrand Songis 281dee18eb Merge pull request #631 from opentx/driver33/PL_translation
Driver33/pl translation
2014-02-01 11:01:57 -08:00
Bertrand Songis 53c670deee Merge remote-tracking branch 'origin/next' into
bsongis/Issue554_trims_relative_default

Conflicts:
	radio/src/gui/menu_model.cpp
2014-02-01 19:56:31 +01:00
Bertrand Songis c3417a0d88 UART3 Debug/SPORT modes 2014-02-01 19:50:49 +01:00
Andre Bernet 0b77d9921d VC doesn't like binary constants 2014-02-01 19:42:57 +01:00
Jacek Drewniak b9448c6baf Add 2 lines of translation + some orto fixes 2014-02-01 19:24:10 +01:00
Jacek Drewniak c9367ba10f Merge branch 'next' into driver33/PL_translation 2014-02-01 19:09:50 +01:00
Kjell Kernen 2c9f601404 Merge pull request #633 from opentx/dvogonen/OpenTX_-build_broken_in_next_632
Dvogonen/open tx  build broken in next 632
2014-02-01 09:51:54 -08:00
Dvogonen d9373b997b Polish Translation problem fixed. 2014-02-01 18:49:50 +01:00
Dvogonen 6f8ab60e11 Czech Translation problem fixed 2014-02-01 18:31:44 +01:00
Dvogonen 3db2b2912f I think that these files have been saved as UTF8. They now builds just fine. 2014-02-01 17:37:22 +01:00
Bertrand Songis 670bb0a0c5 Avoid recursive calls to getTrimValue 2014-02-01 16:23:57 +01:00
Andre Bernet cae8cb9c1f TRN switch not in warnings... 2014-02-01 15:36:28 +01:00
Andre Bernet 3f2166330d Confirmation beep had been removed on stock 2014-02-01 14:57:35 +01:00
Andre Bernet 3a5b41ae54 Switch warnings on stock again 2014-02-01 14:55:10 +01:00
Andre Bernet fcce76cfa4 Correct for new constant name 2014-02-01 13:24:53 +01:00
Andre Bernet 856ffd4ed7 Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Switch_and_pot_warnings
Conflicts:
	companion/src/firmwares/opentx/opentxeeprom.cpp
	radio/src/gui/menu_model.cpp
	radio/src/opentx.cpp
	radio/src/telemetry/frsky.cpp
	radio/src/translations.cpp
	radio/src/translations.h
	radio/src/translations/cz.h.txt
	radio/src/translations/de.h.txt
	radio/src/translations/en.h
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h.txt
	radio/src/translations/it.h.txt
	radio/src/translations/pl.h.txt
	radio/src/translations/pt.h.txt
	radio/src/translations/se.h.txt
2014-02-01 13:19:27 +01:00
Jacek Drewniak e28e048e12 small fixes to Companion translation due to new things 2014-02-01 11:49:32 +01:00
Jacek Drewniak dbc29b4444 qMerge branch 'next' into driver33/PL_translation 2014-02-01 10:38:56 +01:00
Andre Bernet cdfc8b5b2b Merge pull request #630 from opentx/bsongis/Taranis_6Positions_Pot
Bsongis/taranis 6 positions pot
2014-02-01 01:24:21 -08:00
Andre Bernet 7d5e37d5fa Reset pot type to Pot if max no of steps exceeded to avoid stray switch entry 2014-02-01 10:13:18 +01:00
Andre Bernet a3b7852467 Overflow in S2 type selection 2014-02-01 09:52:27 +01:00
Bertrand Songis 298803ca04 Update DONATIONS.txt 2014-02-01 08:23:44 +01:00
Jacek Drewniak f8b0100655 Fix translation against new telemetry panels changed 2014-02-01 00:40:41 +01:00
Bertrand Songis b9ee9ee0d6 Merge pull request #619 from opentx/dvogonen/add_monowhite_borders
Added black outlines to 24x24, 32x32 and 48x48 icons to improve visibili...
2014-01-31 13:26:57 -08:00
Bertrand Songis c57e0fc6d3 Merge pull request #629 from opentx/driver33/PL_translation
Translation of Companion + changes in core files to make translation fil...
2014-01-31 13:26:27 -08:00
Bertrand Songis 582b14e919 Merge remote-tracking branch 'origin/next' into
bsongis/Issue554_trims_relative_default

Conflicts:
	companion/src/eeprominterface.h
	companion/src/firmwares/er9x/er9xinterface.cpp
	companion/src/firmwares/ersky9x/ersky9xinterface.cpp
2014-01-31 22:15:23 +01:00
Bertrand Songis 2d884d413a [Taranis] Pots type added to the Companion UI 2014-01-31 21:49:38 +01:00
Jacek Drewniak e44c49f189 Translation of Companion + changes in core files to make translation file aviable 2014-01-31 19:47:04 +01:00
Bertrand Songis 8ef1456fe9 EEPROM support in Companion for the 6pos pots on Taranis 2014-01-31 17:19:21 +01:00
Bertrand Songis 1cef62df48 Compilation error 2014-01-31 12:32:09 +01:00
Bertrand Songis 0446658f4b Issue #588 - S1/S2 Type added in Hardware configuration page 2014-01-31 12:13:46 +01:00
Bertrand Songis 38145a02f4 Merge remote-tracking branch 'origin/next' into
bsongis/Taranis_6Positions_Pot

Conflicts:
	radio/src/myeeprom.h
2014-01-31 11:28:34 +01:00
Bertrand Songis 2646307efd Update DONATIONS.txt 2014-01-31 10:57:44 +01:00
Bertrand Songis ce2b033ccb Issue #469 fixed (Telemetry tab in Companion rewritten - 20% code
removed). More tests needed!
2014-01-31 09:40:34 +01:00
Andre Bernet 59d8653b61 Merge pull request #625 from opentx/driver33/PL_translation
Polish translations
2014-01-30 15:39:01 -08:00
Andre Bernet 586b74b7f7 Little translation fixes 2014-01-31 00:36:35 +01:00
Jacek Drewniak e8744eb73c fixes + some hardcoding removed 2014-01-31 00:06:00 +01:00
Jacek Drewniak bffa086f72 More fixes to PL translation - opentx only 2014-01-30 23:12:38 +01:00
mhotar 7430620a8b EXPO_LINE_WEIGHT_POS shifted to fit into copy-box 2014-01-30 21:03:06 +01:00
openfsguruh c86123632c bugfix switch warning for stock
switch warnings in menu didn't tie up with the warning screen.
Now inside firmware the settings fit and working properly for stock.
2014-01-30 21:01:12 +01:00
Bertrand Songis f77e43c1f1 Update DONATIONS.txt 2014-01-30 17:01:49 +01:00
Bertrand Songis f74fc932cc Update DONATIONS.txt 2014-01-30 15:18:42 +01:00
Bertrand Songis 171245d892 Update DONATIONS.txt 2014-01-30 08:05:58 +01:00
Bertrand Songis 27fbd4b952 Update DONATIONS.txt 2014-01-30 07:30:02 +01:00
Jacek Drewniak 63529d77e3 Small fixes to the translation 2014-01-30 00:58:13 +01:00
Bertrand Songis 722a9686e4 Bars / Logical Switches in Companion should be ok on all boards 2014-01-29 08:30:34 +01:00
Bertrand Songis 35659a09a4 Telemetry bars should be again ok in Companion 2014-01-28 23:51:37 +01:00
Bertrand Songis 7d88ff506e Issue #541 fixed 2014-01-28 17:51:35 +01:00
Bertrand Songis f41f1a3f7b Input scale now added in Companion. I have broken all getStep / getMin /
getMax / getOffset used for custom switches and telemetry bars.
Everything needs to be tested again ...
2014-01-28 15:43:52 +01:00
Bertrand Songis 30b8a7e14b Makefile cosmetics 2014-01-27 17:33:50 +01:00
Bertrand Songis b44fa1432e [Taranis] Issue #554 - Constant used instead of hardcoded value 2014-01-27 17:30:50 +01:00
Bertrand Songis 80a6c4727d [Taranis] Issue #554 - Companion part done 2014-01-27 17:25:43 +01:00
Dvogonen 63193951e9 Added black outlines to 24x24, 32x32 and 48x48 icons to improve visibility
Replaced 16x16 icons whith monoblack icons, to make them visible in menus
2014-01-27 15:11:03 +01:00
Bertrand Songis cde59a2b22 [Taranis] Issue #554 - Automatic EEPROM conversions 2014-01-27 14:32:19 +01:00
mhotar 5c601a0bb7 Font related alignments 2014-01-27 13:10:21 +01:00
Bertrand Songis cb47c03f4f [Taranis] Issue #554 - Bug fixes (radio part) 2014-01-27 12:25:13 +01:00
Bertrand Songis 16c1bd01c6 [Taranis] Issue #554 - Default is now :0 (all trims linked to the
default phase)
2014-01-27 11:28:14 +01:00
Bertrand Songis 046a4d253d [Taranis] Issue #554 Radio part done. We have now modes on trims.
Let's say we are configuring the Rudder Trim on phase 1:
- R:0  => Rudder trim = Rudder trim(phase 0)
- R+0  => Rudder trim = Rudder trim(phase 0) + Rudder trim(phase 1)
- R--  => Rudder trim is OFF

Still needs to be done:
- The result on screen is awful. I need ideas. Martin?
- Companion conversions / UI for this feature
- R+1 when configuring Rudder Trim on phase 1 should be impossible
2014-01-27 11:28:10 +01:00
Bertrand Songis 6fd9c47649 [Taranis] Inputs / Mixes now correctly created on a fresh model 2014-01-27 10:51:09 +01:00
mhotar 746f9f93b7 newline for [All] -comment 2014-01-26 21:52:52 +01:00
mhotar 220ddb8bcf Merge branch 'next' of https://github.com/opentx/opentx into mhotar/layout_alignments_Issue#584 2014-01-26 21:18:45 +01:00
Bertrand Songis 0c015f321a Merge pull request #611 from opentx/dvogonen/607_translation_issues
Made the small input icon translatable (A-I available). Entered hard coded string to translations.
2014-01-26 11:50:33 -08:00
mhotar 7c1ff4949e STATS page labels joined together, 20B saved 2014-01-26 20:50:31 +01:00
Dvogonen 69da337b70 Fixes 607 2014-01-26 20:40:39 +01:00
Dvogonen 8936b3feec Fixes 607 2014-01-26 19:52:44 +01:00
mhotar 5d9293e8f5 Version page realigned, 10B saved
\036 -Newline code for all platforms
stamp strings joined together to vers_stamp
2014-01-26 19:33:47 +01:00
Bertrand Songis d695b53548 Merge pull request #606 from opentx/dvogonen/swedish_translation_branch_do_not_remove
Translated latest strings
2014-01-26 08:37:18 -08:00
Dvogonen 94bee30517 Translated latest strings 2014-01-26 17:28:54 +01:00
Bertrand Songis e58946dabd Update DONATIONS.txt 2014-01-26 17:14:13 +01:00
Andre Bernet 1d625bdac8 Realign translations 2014-01-26 14:42:59 +01:00
Andre Bernet 1451d7d37e Realign translations 2014-01-26 14:41:06 +01:00
Andre Bernet e9860ed649 Manual handling of pull request #596 - Polish translations 2014-01-26 14:06:26 +01:00
mhotar f676589989 Flash savings 24B
I am learning code optimisations, can someone check this comit please?
This have not to change anything, only save flash.
2014-01-26 12:32:09 +01:00
Bertrand Songis c5660353d2 Merge pull request #603 from opentx/dvogonen/590_next_Companion_Rename
Companion renaming done for now.
2014-01-26 01:59:22 -08:00
Bertrand Songis 3323875a63 Update DONATIONS.txt 2014-01-26 10:23:36 +01:00
Dvogonen 33d214234c Companion renaming done for now. 2014-01-26 01:19:52 +01:00
Bertrand Songis ad956ac0cf Merge pull request #599 from opentx/dvogonen/icon_optimizations
Icon optimizations finished.
2014-01-25 03:30:05 -08:00
Dvogonen ab67433c45 Merge branch 'origin/next' 2014-01-25 12:15:09 +01:00
Dvogonen 4ad86b5ac5 All 16x16 mono icons optimized 2014-01-25 12:07:26 +01:00
Dvogonen 0505836e33 All the 24x24 mono icons are done! Finally! 2014-01-25 10:28:47 +01:00
Dvogonen 2890259808 More 24x24 optimizations. Getting there slowly. 2014-01-25 10:20:32 +01:00
Bertrand Songis fccfe6eaf1 Merge pull request #598 from opentx/dvogonen/590_Rename_things_In_Companion
Dvogonen/590 rename things in companion
2014-01-25 00:02:37 -08:00
Bertrand Songis f184aa719f Update DONATIONS.txt 2014-01-25 08:57:14 +01:00
mhotar 1d0ebe5642 CFN alignments #584
costs 28B :(
2014-01-25 01:43:19 +01:00
Andre Bernet 9c5dd4072d Merge pull request #591 from opentx/bsongis/Issue557_antenna_defective_warning
Issue #557 fixed (Antenna defective warning when no XJT module started)
2014-01-24 14:54:06 -08:00
Dvogonen f89fc9a9ae Replaced Custom Switches with Logical Switches and LS in Companion UI.
Replaced Custom Functions with Switch Assignment in the Companion UI.
2014-01-24 23:24:53 +01:00
mhotar b66fafbec3 TR_VKEYS Left aligned #584 2014-01-24 23:07:43 +01:00
Kjell Kernen bf8e74b266 Merge pull request #597 from opentx/dvogonen/swedish_translation_branch_do_not_remove
Merged a couple of translations
2014-01-24 13:19:39 -08:00
Dvogonen c04387b7c0 Merge branch 'origin/next' 2014-01-24 22:11:39 +01:00
Dvogonen 1a6880400d A bunch of 24x24 icons optimized 2014-01-24 22:05:07 +01:00
Dvogonen 5690186fcc Merge branch 'origin/next' 2014-01-24 20:45:57 +01:00
Bertrand Songis cd245818fe Merge branch 'Rpm_Gear_Ratio' of https://github.com/TimGFoley/opentx into bsongis/Issue572_rpm_gear_ratio 2014-01-24 17:33:13 +01:00
Bertrand Songis a14948b66a Issue #557 fixed (Antenna defective warning when no XJT module started) 2014-01-24 17:02:20 +01:00
Kjell Kernen 802e7e64ff Optimezed some 24x24 icons, many to go 2014-01-24 12:21:01 +01:00
Kjell Kernen 764622f9d3 Translated a couple of new strings.
Removed tabs.
2014-01-24 11:41:36 +01:00
Bertrand Songis 3473b685b8 Merge pull request #589 from opentx/kilrah/588_Hardware_settings
Kilrah/588 hardware settings
2014-01-24 02:14:39 -08:00
Andre Bernet 947b691e2a Merge pull request #587 from opentx/dvogonen/swedish_translation
First version done
2014-01-24 00:24:06 -08:00
Dvogonen 8b33ba4576 Merge branch 'origin/next' 2014-01-24 09:13:45 +01:00
Andre Bernet 30c7e990fb Translations 2014-01-24 09:13:03 +01:00
Andre Bernet b32dcda598 EEPROM support for Hardware/UART mode, separated for easy cherry-picking (#588) 2014-01-24 00:35:24 +01:00
Andre Bernet 7d2d7cac08 Hardware tab with first item for #588 2014-01-24 00:19:17 +01:00
Dvogonen 7a60bd8203 First version done 2014-01-23 23:48:36 +01:00
Andre Bernet fcd1e69eb9 Merge pull request #586 from opentx/bsongis/remove_lbm_files
Bsongis/remove lbm files
2014-01-23 13:17:32 -08:00
Andre Bernet 7c2cfd4db3 .lbm's weren't actually untracked 2014-01-23 22:08:27 +01:00
Andre Bernet ecc2be0b3e 16-bit limits were broken on ARM 2014-01-23 21:15:32 +01:00
Dvogonen d0d9556498 corrected icon names. 2014-01-23 21:09:38 +01:00
Dvogonen 87bf0a163c Cleaning up the icon archive for the monochrome originals 2014-01-23 21:04:17 +01:00
Bertrand Songis 5741739360 Issue #585 fixed (Companion stack overflow on Windows, already fixed on
SVN)
2014-01-23 20:59:54 +01:00
Dvogonen 834c415028 Corected name of 22x22 icon 2014-01-23 20:54:51 +01:00
Bertrand Songis eea4f1c225 Update DONATIONS.txt 2014-01-23 20:35:33 +01:00
Dvogonen 0dcf67cd8e Added icons in in the outstanding Linux sizes. 2014-01-23 20:31:12 +01:00
Andre Bernet a9e8450578 Merge pull request #578 from opentx/bsongis/Issue552_checkbox_for_reset_custom_function
Issue #552 fixed
2014-01-23 11:25:01 -08:00
Andre Bernet e695b92a50 Issue #552 - Port string length change to all languages, please translate again as required 2014-01-23 20:21:49 +01:00
Bertrand Songis 08da268aff All .lbm files removed 2014-01-23 20:14:08 +01:00
Dvogonen 8438a5b044 Merge branch 'origin/next' 2014-01-23 19:57:15 +01:00
Andre Bernet 4764cc889c Merge pull request #577 from opentx/bsongis/Issue488_change_default_trim_mode_to_fine
Bsongis/issue488 change default trim mode to fine
2014-01-23 10:52:26 -08:00
Bertrand Songis c7707b2d4b [9x stock] 10bytes saved. To be checked by Martin 2014-01-23 18:00:05 +01:00
Kjell Kernen 2b3b0f5feb Resized Stop and Play icons to fit theme sizes 2014-01-23 17:40:07 +01:00
Bertrand Songis 96318e0c02 Merge pull request #571 from opentx/mhotar/proportional_fonts
Mhotar/proportional fonts
2014-01-23 08:36:16 -08:00
Bertrand Songis 63ab2ef141 Merge pull request #583 from opentx/dvogonen/simplified_companion_menu_580
Dvogonen/simplified companion menu 580
2014-01-23 08:27:11 -08:00
Kjell Kernen 8a8e143eb2 Removed unused customized.png copies from the themes packages. This file should not be changed by theme switches. 2014-01-23 17:22:06 +01:00
Bertrand Songis 916114eacd Merge pull request #534 from opentx/kilrah/FAS_Offset_compensation
Kilrah/fas offset compensation
2014-01-23 07:54:58 -08:00
Kjell Kernen 8e222b2800 Removed the menu selections and actions for the Window manu and the select direction function 2014-01-23 16:36:03 +01:00
Bertrand Songis 932553e403 Merge branch 'next' into kilrah/FAS_Offset_compensation
Conflicts:
	companion/src/modeledit/telemetry.cpp
2014-01-23 16:31:09 +01:00
Kjell Kernen 71f669bbef Removed all switch _dir icons 2014-01-23 16:20:14 +01:00
Bertrand Songis d3b66c849b [9x stock] Some bytes saved with trims usage 2014-01-23 16:08:49 +01:00
Andre Bernet c0f9a993a4 Merge pull request #581 from opentx/bsongis/Issue542_flash_usage_on_9x_stock
Bsongis/issue542 flash usage on 9x stock
2014-01-23 06:47:15 -08:00
Bertrand Songis f6ba7e26b7 [9x stock] Issue #542 - 8 bytes here 2014-01-23 15:00:09 +01:00
Bertrand Songis c1453cc6cb Google tests re-enabled 2014-01-23 14:49:19 +01:00
Bertrand Songis 8a32e769dc [9x stock] Issue #542 - 12 bytes here 2014-01-23 11:49:13 +01:00
Bertrand Songis 1c59184583 [9x stock] Issue #542 - 4 bytes here 2014-01-23 11:07:47 +01:00
Bertrand Songis 93646983b5 [9x stock] Issue #542 - 2 bytes here 2014-01-23 10:27:00 +01:00
Kjell Kernen 2cdbcc53b9 Merge branch 'origin/next' 2014-01-23 08:49:24 +01:00
Bertrand Songis bff28a6c28 [9x stock] Issue #542 - 8 bytes here 2014-01-23 07:57:55 +01:00
Bertrand Songis dc6c2bd665 Update DONATIONS.txt 2014-01-22 23:01:54 +01:00
Bertrand Songis a7fdad2a69 Merge pull request #576 from opentx/dvogonen/wrong_compare_icon_used
Two icons got mixed up in the icon theme work - Fixed
2014-01-22 13:17:02 -08:00
Bertrand Songis f3060e72e4 Issue #552 Companion part done 2014-01-22 22:04:58 +01:00
Bertrand Songis b66fd75b50 Issue #552 Radio part done 2014-01-22 22:04:16 +01:00
Bertrand Songis dddad5389a The failsafe frame was displayed even when the radio was not a Taranis 2014-01-22 21:25:15 +01:00
Bertrand Songis bb0ab55830 Issue #488 : Companion part done. 2014-01-22 17:43:55 +01:00
Bertrand Songis fc716b3a2a Issue #488. Firmware part done 2014-01-22 17:31:21 +01:00
Kjell Kernen 6c4e89a35a Two icons got mixed up in the icon theme work - Fixed 2014-01-22 17:05:16 +01:00
Bertrand Songis da2561b672 'next' EEPROM support continued: Timer countdown modes 2014-01-22 15:00:42 +01:00
Bertrand Songis 3332cbf051 'next' EEPROM support continued: curves (any number of points, smooth
curves)
2014-01-22 14:22:45 +01:00
Bertrand Songis f83446cea1 Merge pull request #575 from opentx/dvogonen/logo_update
Dvogonen/logo update
2014-01-21 22:08:45 -08:00
Bertrand Songis ee42fec3dd Update DONATIONS.txt 2014-01-22 07:04:36 +01:00
Dvogonen e3f2f08d24 Nicer about box and some more image tweaks. 2014-01-21 23:17:15 +01:00
Dvogonen 4c909224f3 Splash screens updated 2014-01-21 22:44:37 +01:00
Dvogonen 7f311aa748 Updated all other images and icons. 2014-01-21 22:10:58 +01:00
Dvogonen fe95960059 Linux icons updated 2014-01-21 21:52:36 +01:00
Bertrand Songis 9e1139c4e3 'next' EEPROM support continued. Altitude in Top Bar 2014-01-21 21:36:43 +01:00
Bertrand Songis 3d91abbd5b 'next' support continued: Repeat param for Play functions 2014-01-21 20:58:11 +01:00
Dvogonen ccd8d9d1fd Bit-optimized logo versions in the more common sizes 2014-01-21 20:45:40 +01:00
Dvogonen d1b95610e2 Updated logos with new official green color 009000 2014-01-21 17:03:49 +01:00
Bertrand Songis 0009c8b287 'next' EEPROM support continued. Trim mode in Inputs tab added 2014-01-21 16:30:44 +01:00
Dvogonen e7a8de750c Removed unused icons 2014-01-21 16:20:17 +01:00
Bertrand Songis b323c2e7a4 Issue #566 fixed 2014-01-21 16:02:14 +01:00
Bertrand Songis 6c798882aa Merge pull request #574 from opentx/dvogonen/blue_companion_theme_569
Fixes #569
2014-01-21 06:31:25 -08:00
Dvogonen 9829059e66 Fixed dual definition of application name and cleaned up code. This fixes a problem with dual config files beeing written in next. 2014-01-21 15:20:50 +01:00
Dvogonen 2925ab29a9 Merge branch 'origin/next' 2014-01-21 14:57:13 +01:00
Bertrand Songis 8a53e7345a Fixes #573 2014-01-21 14:22:07 +01:00
Bertrand Songis 004cac122a Update DONATIONS.txt 2014-01-21 12:59:46 +01:00
Dvogonen 84e02706e7 Merge branch 'origin/next'
Conflicts:
	companion/src/helpers.cpp
2014-01-21 10:04:52 +01:00
Dvogonen 9d1d36cd3b Added white theme 2014-01-21 09:56:19 +01:00
Tim G. Foley dfad662f18 Cleaned up comments 2014-01-20 20:02:44 -05:00
Tim G. Foley 522e0cd1f6 Cleaned up comments 2014-01-20 20:02:32 -05:00
Tim G. Foley b44879a7e1 Cleaned up comments 2014-01-20 20:02:22 -05:00
Tim G. Foley c7d84f741d Cleaned up comments 2014-01-20 20:02:13 -05:00
Tim G. Foley d790fa3d4b Cleaned up comments 2014-01-20 20:01:59 -05:00
Tim G. Foley 7e164f4b8d Cleaned up comments 2014-01-20 20:01:46 -05:00
Tim G. Foley bbb9a4ceda Cleaned up comments 2014-01-20 20:01:34 -05:00
Tim G. Foley 770b95507e Cleaned up comments 2014-01-20 20:01:23 -05:00
Tim G. Foley 2107f25765 Cleaned up comments 2014-01-20 20:01:04 -05:00
Tim G. Foley 392169591c Cleaned up comments 2014-01-20 20:00:55 -05:00
Tim G. Foley 30dd3cd41d Cleaned up comments 2014-01-20 20:00:39 -05:00
Tim G. Foley ff876880d5 Cleaned up comments 2014-01-20 20:00:11 -05:00
Tim G. Foley 1b46c80613 Cleaned up comments 2014-01-20 19:59:30 -05:00
Tim G. Foley 4dc9194a36 Cleaned up comments 2014-01-20 19:58:59 -05:00
Tim G. Foley 28fad3a306 Cleaned up comments 2014-01-20 19:58:18 -05:00
Dvogonen 60c1282c15 A bunch of red alternative icons for Bertrand. I have experimented with using reds mixed with yellow. More yellow and you get orange (which is horrible for onscreen use). Any lighter and the color turns pink. darker, and the color disappears in low resolutions. 2014-01-20 23:08:48 +01:00
Bertrand Songis a545bae3a6 Companion: no ON/OFF checkbox for Custom Function Start Logs 2014-01-20 22:50:22 +01:00
Bertrand Songis 448618cc7e Merge pull request #570 from opentx/romolo/companion9x_ge
Google Earth export fixes and proper process startup implementation on M...
2014-01-20 13:25:47 -08:00
mhotar 34009091fd comments removed 2014-01-20 22:24:26 +01:00
mhotar 676491412d lbm files back to git repo 2014-01-20 22:12:32 +01:00
Bertrand Songis 6fc35b523f Inside Companion, Custom Functions TrainerXXX didn't have the ON/OFF
Checkbox when no switch selected
2014-01-20 22:12:17 +01:00
Bertrand Songis 6bba2b14ca Virtual Inputs added inside Companion 2014-01-20 21:54:38 +01:00
Romolo Manfredini 125650d230 Google Earth export fixes and proper process startup implementation on MACOS 2014-01-20 20:49:13 +01:00
Andre Bernet b38d278c75 New switch warnings and displayText in companion. Import/export conversions not done yet 2014-01-20 19:26:30 +01:00
Bertrand Songis efa484a710 About dialog fixed 2014-01-20 17:45:13 +01:00
Bertrand Songis 42c39a9d5f Merge branch 'next' of https://github.com/opentx/opentx into next 2014-01-20 16:43:56 +01:00
Bertrand Songis 439cabe83c Another code reduction. Settings are now stored in "OpenTX/Companion",
instead of "companion/companion"
2014-01-20 16:50:06 +01:00
Dvogonen ba71d4ebda New README 2014-01-20 16:44:02 +01:00
Dvogonen ffeb7cd6b2 Adding the new theme files to the resources 2014-01-20 16:07:36 +01:00
Dvogonen 3acb7e5eff All the icons and a script conversion file added. 2014-01-20 15:16:42 +01:00
Romolo Manfredini 0d394ca7c6 References to companion9x were still present 2014-01-20 14:42:22 +01:00
Bertrand Songis 8f1ae2e529 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-01-20 13:40:42 +01:00
Bertrand Songis af1ab8ec59 Merge pull request #568 from opentx/romolo/customizable_toolbars
Romolo/customizable toolbars
2014-01-20 04:49:53 -08:00
Bertrand Songis 1a00145b1d A couple of other fixes 2014-01-20 13:47:42 +01:00
Bertrand Songis a3e4591144 Fixes #567 2014-01-20 12:58:28 +01:00
Romolo Manfredini 97de97c84e Small code cleanup 2014-01-20 12:26:50 +01:00
Romolo Manfredini fad6211789 Remove duplicated code 2014-01-20 00:56:14 +01:00
Romolo Manfredini 034130555e Companion now should fully support themes 2014-01-20 00:05:16 +01:00
Romolo Manfredini 0f2cc257cd Merge origin/romolo/customizable_toolbars into romolo/customizable_toolbars 2014-01-19 22:50:40 +01:00
Romolo Manfredini a3a698181e Further work in themes for the ui and some further bug fix. 2014-01-19 22:49:26 +01:00
Bertrand Songis 43059f3539 Merge pull request #561 from tensafefrogs/next
Fix missing curly braces and adjust some formatting.
2014-01-19 13:09:19 -08:00
Bertrand Songis 987b5eeecb Merge pull request #564 from opentx/romolo/fix_and_improve_contributors_dialog_506
Fixes #506
2014-01-19 13:07:35 -08:00
Geoff Stearns 261cdd4cca Fix missing curly braces and adjust some formatting. 2014-01-19 15:44:29 -05:00
Dvogonen 9ec25ed189 Merge branch 'origin/next'
Conflicts:
	companion/src/contributorsdialog.cpp
2014-01-19 20:33:11 +01:00
Dvogonen 95163bde66 Some pixel optimizaion 2014-01-19 19:27:11 +01:00
Dvogonen 540ca146b8 Added paintbrush icons to be used for customize TX action 2014-01-19 17:31:44 +01:00
Dvogonen 628f2eb1c8 Copied the oversized classic theme originals to a safe storage location. 2014-01-19 17:05:20 +01:00
Dvogonen f9f930afa3 Icons in all sizes 2014-01-19 16:54:04 +01:00
Romolo Manfredini 15203266ac Preferences had icon embeddeed in the ui 2014-01-19 15:58:23 +01:00
Romolo Manfredini a4e3cf6f3c Allow themes and icon preferences 2014-01-19 15:35:45 +01:00
Romolo Manfredini 0bf7410145 Properly reset windows geometry and state 2014-01-19 15:34:32 +01:00
Dvogonen 0326a3d27f Creating logo folder and a proposed new logo. Only storage for the time beeing. Not used in build. 2014-01-19 15:18:33 +01:00
Bertrand Songis 57d3fe53bc Update DONATIONS.txt 2014-01-19 15:08:36 +01:00
Romolo Manfredini f0e7accae8 Properly reset windows geometry and state 2014-01-19 10:01:48 +01:00
Romolo Manfredini 0c0662711e Revert to old renderer 2014-01-19 08:10:28 +01:00
Andre Bernet eb3cc1447b obj dir not required anymore for bootloader 2014-01-18 20:43:41 +01:00
Andre Bernet 229dfc1938 Mike's bootloader sources + added as option, for Taranis only for now (not as clean as it could be, bootloader is always built even if not selected - didn't find how to nest ifs in makefile :\ ) (Issue #546) 2014-01-18 20:00:31 +01:00
Bertrand Songis 5160fd8503 Issue #555 fixed (core in customizetxdialog) 2014-01-18 07:49:05 +01:00
Bertrand Songis 296b12ffdb Merge pull request #553 from opentx/dvogonen/graphical_improvemens
Dvogonen/graphical improvemens
2014-01-17 11:24:25 -08:00
Kjell Kernen 9ce093dfd0 Fixes #532 2014-01-17 18:57:49 +01:00
Bertrand Songis b30fdf841d Update DONATIONS.txt 2014-01-17 18:24:54 +01:00
mhotar 988103d785 TX action icons v2 2014-01-17 16:53:37 +01:00
Bertrand Songis 8662736e22 Merge branch 'next' of https://github.com/opentx/opentx into next 2014-01-17 16:31:40 +01:00
Bertrand Songis d134c063e5 ModelEdit channels 'next' support 2014-01-17 16:43:36 +01:00
Bertrand Songis 11e83de0d3 Support of inputs / mixes from 'next' continued. More duplicated code
removed.
2014-01-17 15:46:19 +01:00
Kjell Kernen 3326d6ac6b New icons from Martin Hotar 2014-01-17 14:40:18 +01:00
Bertrand Songis 88602a88c7 Update DONATIONS.txt 2014-01-17 07:05:33 +01:00
Bertrand Songis f2bc9e2fe1 Update DONATIONS.txt 2014-01-17 07:04:17 +01:00
Tim G. Foley 753c5e3119 Remove accidental file 2014-01-16 21:54:21 -05:00
Tim G. Foley 8b739815e3 Update README.txt 2014-01-16 21:08:27 -05:00
Tim G. Foley 3b570db6ba Merge branch 'next' of https://github.com/TimGFoley/opentx into next 2014-01-16 18:07:39 -08:00
Tim G. Foley acd974403b Fixed cross initialization error 2014-01-16 18:06:34 -08:00
Tim G. Foley 9244350737 Update README.txt 2014-01-16 20:50:57 -05:00
Tim G. Foley 508a3edf8d Merge branch 'next' of https://github.com/TimGFoley/opentx into next 2014-01-16 17:49:20 -08:00
Tim G. Foley 1589f33443 Update README.txt 2014-01-16 20:49:00 -05:00
Tim G. Foley 6158f80c06 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:48:12 -05:00
Tim G. Foley f48ed4b0d5 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:47:52 -05:00
Tim G. Foley 2398f5d59c Added Spur and Pinion Gear Strings (English) 2014-01-16 20:47:06 -05:00
Tim G. Foley 9f4fe67508 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:46:20 -05:00
Tim G. Foley 4d3747e5b6 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:45:59 -05:00
Tim G. Foley 933e2c4001 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:45:29 -05:00
Tim G. Foley ea4abdf9bf Added Spur and Pinion Gear Strings (English) 2014-01-16 20:44:49 -05:00
Tim G. Foley 93ba07eaf6 Merge branch 'next' of https://github.com/TimGFoley/opentx into next 2014-01-16 17:41:02 -08:00
Tim G. Foley 600dc5e9f4 Merge branch 'master' of https://github.com/TimGFoley/opentx into next 2014-01-16 17:35:57 -08:00
Tim G. Foley f49d281330 Added Spur and Pinion Gear Strings (English) 2014-01-16 20:31:02 -05:00
Tim G. Foley ce6e9aefc9 Delete en.h~ 2014-01-16 20:28:49 -05:00
Tim G. Foley 57ea7937d8 Delete simu.cpp~ 2014-01-16 20:27:54 -05:00
Tim G. Foley 8cdfe1040d Delete myeeprom.h~ 2014-01-16 20:27:45 -05:00
Tim G. Foley dda6069fef Delete translations.h~ 2014-01-16 20:27:36 -05:00
Tim G. Foley 5219d9d53b Delete translations.cpp~ 2014-01-16 20:27:27 -05:00
Tim G. Foley ccc4096106 Update README.txt 2014-01-16 20:25:50 -05:00
Tim G. Foley 2ea96f15d2 Merge branch 'next' of https://github.com/TimGFoley/opentx into next 2014-01-16 17:13:01 -08:00
Tim G. Foley 01c2413a0c Added RPM calculation based on Spur and Pinion Gear 2014-01-16 17:10:04 -08:00
Tim G. Foley 1edd98f501 Update README.txt 2014-01-16 19:42:48 -05:00
Kjell Kernen c19c592035 THe rest of the monochrome icons originals. 2014-01-17 00:23:44 +01:00
Bertrand Songis ddd8d137fc Replace SVN strings by a VERS string (2.0) 2014-01-16 22:31:03 +01:00
Dvogonen eca1273b59 Final icon commit. I have a couple of original icons on another computer hat I will add tomorrow. Besides that I thing this thing is ready for prime time (except if there is some kind of an uproar against mhotars new nice icons). 2014-01-16 21:47:54 +01:00
Dvogonen e0e16a4256 Icons optimized for sharpness 2014-01-16 21:03:21 +01:00
Bertrand Songis bf54445c94 Merge remote-tracking branch 'origin/kilrah/Taranis_120MHz' into next 2014-01-16 13:05:21 +01:00
Kjell Kernen d2e510792d First round of 32x32 optimized icons 2014-01-16 12:44:27 +01:00
Bertrand Songis 1574df9e12 Update DONATIONS.txt 2014-01-16 12:32:51 +01:00
Bertrand Songis c27c4f2c78 Update DONATIONS.txt 2014-01-16 07:07:37 +01:00
Andre Bernet 34776b24c0 Mike's bootloader added 2014-01-16 00:02:18 +01:00
Andre Bernet 006eee1411 Merge branch 'dvogonen/automatically_convert_settings_511' of https://github.com/opentx/opentx into next
Conflicts:
	companion/src/main.cpp
2014-01-15 23:02:21 +01:00
Dvogonen 4f087a216f Fixes #511 - Again :-) 2014-01-15 22:24:31 +01:00
Andre Bernet 0b2b9ea1c3 Merge branch 'next' into kilrah/Switch_and_pot_warnings
Conflicts:
	radio/src/myeeprom.h
	radio/src/translations/cz.h
	radio/src/translations/de.h
	radio/src/translations/es.h
	radio/src/translations/fr.h
	radio/src/translations/fr.h.txt
	radio/src/translations/it.h
	radio/src/translations/pl.h
	radio/src/translations/pt.h
	radio/src/translations/se.h
2014-01-15 22:16:16 +01:00
Dvogonen 18a5883f66 Merge branch 'origin/next' 2014-01-15 22:06:10 +01:00
Andre Bernet cfec9ed00e Merge pull request #535 from opentx/dvogonen/Rename_companion9x_qrc_to_companion_qrc_512
Fixes #512
2014-01-15 12:59:15 -08:00
Dvogonen 9fd20a87fe Fixes #511 2014-01-15 21:54:43 +01:00
Dvogonen 20ddf27fff Merge branch 'origin/next' 2014-01-15 21:30:05 +01:00
Bertrand Songis b4c6d123c8 Better implementation for the automatic detection of a 6pos switch 2014-01-15 21:15:28 +01:00
Dvogonen 2f67344b81 Fixes #512 2014-01-15 21:13:57 +01:00
Dvogonen 78b28444e6 Example of optimized icons for actual resolution. 2014-01-15 20:46:53 +01:00
Andre Bernet bea9c74243 Companion support for FAS offset, Persistent mAh and Altitude in top bar 2014-01-15 20:40:53 +01:00
Kjell Kernen fb705d66df New, flat icons for everything. Optimized for 32x32. Work needed to optimize for 16x16 used in menus. 2014-01-15 17:32:49 +01:00
Andre Bernet ba9f55cb67 Merge was resolved the wrong way, files that should have been deleted were reinstated 2014-01-15 16:30:54 +01:00
Andre Bernet f246c992c0 Merge branch 'next' of https://github.com/opentx/opentx into kilrah/FAS_Offset_compensation 2014-01-15 16:26:56 +01:00
Bertrand Songis e7dc6644c7 Merge remote-tracking branch 'origin/dvogonen/rename_companion_485' into next
Conflicts:
	companion/src/CMakeLists.txt
	companion/src/main.cpp
	companion/src/modeledit.cpp
	companion/src/xsimulatordialog.cpp
2014-01-15 16:09:17 +01:00
Andre Bernet 06a2e757f1 Merge branch 'next' into kilrah/FAS_Offset_compensation
Conflicts:
	companion/src/modeledit.ui
	radio/src/translations/cz.h
	radio/src/translations/de.h
	radio/src/translations/fr.h
	radio/src/translations/it.h
	radio/src/translations/pl.h
	radio/src/translations/pt.h
	radio/src/translations/se.h
2014-01-15 16:02:32 +01:00
Andre Bernet 02f75dedd9 Merge branch 'bsongis/Companion_ModelEdit_split' into next 2014-01-15 14:55:15 +01:00
Andre Bernet 9b6c0e4fd1 Multiplex was collated to source 2014-01-15 14:41:54 +01:00
Bertrand Songis 691b52572f Fixes in ExpoDialog. Some more code refactoring 2014-01-15 14:05:33 +01:00
Bertrand Songis 888895b60b Corrections on Curves in MixerDialog and ExpoDialog (introduction of
CurveGroup to share code)
2014-01-15 11:50:00 +01:00
Dvogonen f11c961be4 Enlarged and moved icons 2014-01-15 08:28:11 +01:00
Bertrand Songis 0f0db5e1d3 Companion core in simu now understood: the stickMode was completely out,
and the Tx trims were shifted!
2014-01-14 22:44:10 +01:00
Bertrand Songis d945052c82 Removes the core in companion simu, compiled on VC++. A compiler bug? I
don't get it...
2014-01-14 20:06:01 +01:00
Bertrand Songis bea06a1772 Update DONATIONS.txt 2014-01-14 07:13:15 +01:00
Bertrand Songis cedddfe8d2 EEPROM 'next' support. A lot of corrections. 2014-01-13 19:09:05 +01:00
Andre Bernet b6be6222f3 Indents 2014-01-13 16:46:56 +01:00
Dvogonen 9cc9e115a4 Icons regenerated to correct font related problem. 2014-01-13 14:02:39 +01:00
Bertrand Songis 0b387a2467 [Companion] Assert on EEPROM import errors removed 2014-01-13 11:54:08 +01:00
Bertrand Songis 7755ae6063 Update DONATIONS.txt 2014-01-13 07:12:18 +01:00
Bertrand Songis bbf5e9608d Update CREDITS.txt 2014-01-12 22:02:52 +01:00
Bertrand Songis 01cb2411c8 Update DONATIONS.txt 2014-01-12 21:08:15 +01:00
Bertrand Songis 1bdca8ae9c Update DONATIONS.txt 2014-01-12 16:47:31 +01:00
Romolo Manfredini 9419f565aa Merge origin/romolo/fix_and_improve_contributors_dialog_506 into romolo/fix_and_improve_contributors_dialog_506 2014-01-12 14:29:30 +01:00
Bertrand Songis a292fabb02 [Taranis] 6Pos switch support is now ok. Calibration is automatic. More
tests needed
2014-01-12 12:57:14 +01:00
Romolo Manfredini f2c5e428d9 more space between sections 2014-01-12 10:49:37 +01:00
Dvogonen bcf072708d Corrected name of releae notes 2014-01-12 10:46:16 +01:00
Romolo Manfredini a025d325dd Contributor dialog fixed 2014-01-12 10:14:55 +01:00
Bertrand Songis 278f5013ab Update DONATIONS.txt 2014-01-12 09:25:24 +01:00
Dvogonen 00779bc33a Settled on 5 rows. Fixed minor bug that prevented the changelog of companion from diaplying. 2014-01-12 01:16:37 +01:00
Dvogonen f7e1c6cb8b Now formatted in 6 columns. Looks rather nice. Stripped http:// tags in donors text file to improve automatic formatting. 2014-01-11 22:33:01 +01:00
Bertrand Songis 8ad6f3d5e6 Update DONATIONS.txt 2014-01-11 19:55:10 +01:00
mhotar 7255f47a85 comments cleanup 2014-01-11 11:17:47 +01:00
Dvogonen 817dea8f1e Fetch donors and coders from files. Improved dialog appearance. 2014-01-11 00:54:45 +01:00
mhotar 4312e708fe Bold fonts "Y,S" characters 2014-01-11 00:34:39 +01:00
mhotar 32213baf9e att&STRCONDENSED BUG ??
It seems to me att&STRCONDENSED colides with att&BOLD.
It removes switch suffix in Custom Functions when the switch is
active(when it is BOLD)
I am not sure this behaviour was meant to work this way.
2014-01-10 21:51:48 +01:00
mhotar 33cb784ff1 Bold SQT5 correction
Makefile -clean- removes lbm files
2014-01-10 20:13:36 +01:00
Bertrand Songis 7426aa7738 Update DONATIONS.txt 2014-01-10 17:04:58 +01:00
Bertrand Songis cb4286d99d make clean now removes all .o files 2014-01-10 15:58:58 +01:00
Bertrand Songis 96e1dcbcd8 Issue #193 fixed (curves names shifted) 2014-01-10 15:57:25 +01:00
Bertrand Songis 7880d144f6 Issue #193 fixed (shift when importing Taranis EEPROM v215) 2014-01-10 11:43:10 +01:00
Bertrand Songis 7f6bdd87cb Update DONATIONS.txt 2014-01-09 20:43:56 +01:00
Bertrand Songis cb6d13bf6a Merge branch 'bsongis/Companion_ModelEdit_split' of github.com:bsongis/opentx into bsongis/Companion_ModelEdit_split 2014-01-09 19:44:00 +01:00
Bertrand Songis e8d54d35f1 Sources shift when exporting EEPROM (Virtual and Lua inputs) 2014-01-09 19:47:18 +01:00
Bertrand Songis 9a2b668956 GvarsOfsNum (er9x) removed 2014-01-09 18:53:35 +01:00
mhotar ef3f8a7405 Font definitions 2014-01-09 18:35:25 +01:00
Bertrand Songis 691d568b1a FixOffset (from er9x) removed 2014-01-09 18:03:22 +01:00
Bertrand Songis 84661b20d4 Update DONATIONS.txt 2014-01-09 17:12:54 +01:00
Bertrand Songis b94da82e17 [9XR-PRO] i2c was not initialized 2014-01-09 11:42:13 +01:00
Bertrand Songis b6aca8c0f5 [9XR-PRO] No bootloader for the moment 2014-01-09 11:20:11 +01:00
Bertrand Songis b5435ce940 Update DONATIONS.txt 2014-01-09 07:15:06 +01:00
Bertrand Songis df4c7afdbb Update DONATIONS.txt 2014-01-08 17:32:37 +01:00
Bertrand Songis f647971d71 [9XR-PRO] Should fix the RTC issue (Date&Time was never read) 2014-01-08 16:20:07 +01:00
Bertrand Songis 6480741e42 [9XR-PRO] 64K Flash, 512K RAM 2014-01-08 15:01:08 +01:00
Bertrand Songis 1dff05dc02 User scripts ignored 2014-01-08 12:08:33 +01:00
Andre Bernet 3ade8707a7 Nicer module UI 2014-01-07 21:30:57 +01:00
Bertrand Songis 57f9489d81 EEPROM import bugfixing 2014-01-07 19:33:29 +01:00
Bertrand Songis 27f8be304a The non active curves are not drawn in bold (pen width 2) 2014-01-07 18:03:50 +01:00
Bertrand Songis 3b59d07724 Support of current EEPROM inside Companion. Some more code around
EEPROMS export removed (needed to be fixed, so I preferred to remove in
the same commit).
2014-01-07 17:57:42 +01:00
Bertrand Songis 3dfdd1b61d Update DONATIONS.txt 2014-01-07 15:13:26 +01:00
Bertrand Songis 5d3c827488 Merge remote-tracking branch 'origin/next' into bsongis/Companion_ModelEdit_split 2014-01-07 07:12:14 +01:00
Dvogonen d0281da58d The part where the old companion9x settings are automatically transferred to companion settings is done. Tested on Linux. Should work on Windows/OSX.
Now remains only to rename all the hundreds of seting references from companion9x to companion. This is blocked until Bertrand merges his reworked edit dialogs.
2014-01-07 02:10:50 +01:00
mhotar d72d8f609f putsSwitches suffix alignment fix 2014-01-07 00:50:52 +01:00
mhotar 4a6acab3c9 BOLD FONT
added Bold font definitions
MIXER: active mix weight is BOLDed instead of source, because we now have no international Bold definitions.
Bolded numbers are wider than before, but it seems it can fit.
2014-01-06 22:15:08 +01:00
Dvogonen 893eb3c061 Fixed problem with language selection in dropbox. 2014-01-06 19:11:30 +01:00
Dvogonen a646e240fb Fixed last companion9x strings. Getting very close. 2014-01-06 18:21:30 +01:00
Dvogonen 57718d0100 Cleaning up graphics and about box 2014-01-06 15:15:14 +01:00
Bertrand Songis e4b3b3af85 [Taranis] Automatic detection of the 6pos switch within the calibration
process
2014-01-06 11:52:05 +01:00
Andre Bernet c90e167594 Better location for switch warning enables to avoid a big shift (fixes #193) 2014-01-06 09:48:17 +01:00
Dvogonen a86ab46bb1 And now the infernal Linux install path should be correct. I hope... 2014-01-06 01:48:45 +01:00
Dvogonen 0494118089 Improved customized splash for burn dialog with OpenTX logo. 2014-01-06 01:31:16 +01:00
Dvogonen c2d220e94b Fixed Linux desktop file, which was badly broken. Added more and better icons to propper locations. 2014-01-06 01:29:53 +01:00
mhotar bddfa3938a STD font bitmaps 2014-01-06 00:29:32 +01:00
mhotar 8d1d456721 layout fix of displayHeaderChannelName 2014-01-05 22:39:46 +01:00
Bertrand Songis d19f50772e Update DONATIONS.txt 2014-01-05 20:57:12 +01:00
Andre Bernet 8dcd1da919 Some timers are receiving 120MHz 2014-01-05 20:42:59 +01:00
Andre Bernet 0090b9ae78 Cell labels as defines with the rest 2014-01-05 16:10:19 +01:00
Andre Bernet 1615fd7593 Switch CPU speed to 120MHz. Rest should not be affected. 2014-01-05 15:52:30 +01:00
Andre Bernet 55fc49edba 12 cells logged only on ARM boards 2014-01-05 15:39:43 +01:00
Andre Bernet 04c4912449 12 cells logged 2014-01-05 15:24:55 +01:00
Andre Bernet b33fbdd274 12 cells in telemetry view for Taranis. Can't test in real life as I can't find my 2nd FLVS, but it's OK on simu. 2014-01-05 15:11:17 +01:00
Andre Bernet 300d6af086 Avoid Telemetry Lost / Telemetry Recovered voice alerts playing back to back when using the Reset Telemetry / Flight functions 2014-01-05 14:13:10 +01:00
Andre Bernet 4ffe49ef01 A2 was also disabled in custom switches in D16 mode 2014-01-05 14:02:25 +01:00
Andre Bernet c177824601 Reinstate A2 alarms in D16 mode for the 3rd party adapter 2014-01-05 14:02:20 +01:00
Bertrand Songis b185cc7fd8 Fix for #197 (non audio chunks > 256 bytes) 2014-01-05 14:00:57 +01:00
Bertrand Songis 132aa15ab6 [Taranis] Best fix for the audio freeze by Mike, thanks! 2014-01-05 13:59:54 +01:00
Bertrand Songis 0f242f5565 [Taranis] No more audio freeze! 2014-01-05 13:57:11 +01:00
Bertrand Songis 499092b479 Fixes #155 2014-01-05 13:55:57 +01:00
Andre Bernet b3f1716f82 Merge pull request #509 from opentx/bsongis/Companion_crash_190
Fixes #190
2014-01-05 04:53:00 -08:00
Andre Bernet 5d3c3f4a21 Merge pull request #508 from opentx/bsongis/Donations_update
Merge new donations
2014-01-05 04:51:43 -08:00
Dvogonen 9b1f36c155 Mac Icon genereated online from vector image by iconverticons.com. I have no way of checking it. Hope it is acceptable.
Improved 48x48 png icon. Also generated online at iconverticons.com. They must use a good rendering machine. The result is better than from Gimp.
2014-01-05 13:37:36 +01:00
Andre Bernet 7a5154305b Fix mac paths - app icon still needs updating 2014-01-05 12:51:30 +01:00
Andre Bernet 63dd5927fb Merge branch 'bsongis/Sky9x_Stick_Gain_Issue_155' of https://github.com/opentx/opentx into next 2014-01-05 12:26:45 +01:00
Andre Bernet 624bab7826 Merge branch 'bsongis/Taranis_audio_freeze' of https://github.com/opentx/opentx into next 2014-01-05 12:26:14 +01:00
Andre Bernet d65b74269b More renaming. Just for the life of me can't get the translations to be recognised. Also, while a clean install will use the new app folders, the nsi scripts are currently configured to retrieve the install folder from registry if present. Might want to think about whether we want to remove this or not. 2014-01-05 12:13:38 +01:00
Dvogonen 0d189b87da Removed old graphics.
Created scalable version of the Companion logo.
Regenerated icons for Windows and Linux.
2014-01-05 12:11:18 +01:00
mhotar 32c16f9f28 FIXEDWIDTH flag
Editing fields are now in FIXED mode to show its real width on LCD.
TODO: font bitmaps have to be altered to center shorter characters to the center of the field.
2014-01-05 10:56:17 +01:00
Andre Bernet 7645fec55d Merge pull request #507 from opentx/bsongis/Bug_wav_files_with_large_nondata_sections_issue_197
Fix for #197 (non audio chunks > 256 bytes)
2014-01-05 01:40:51 -08:00
Bertrand Songis 3783648a7c Update DONATIONS.txt 2014-01-05 10:38:29 +01:00
Dvogonen 7c9470a745 Merge branch 'origin/next' 2014-01-05 10:23:56 +01:00
kilrah 370cec86a9 Merge pull request #505 from opentx/dvogonen/companion_splash_problem_504
Fixed #504.
2014-01-05 00:50:02 -08:00
Dvogonen e5ad887be9 companion9x renamed Companion 2014-01-05 02:23:06 +01:00
Dvogonen 353eab083f Fixed problem on Linux. Hopfully did not break Windows. 2014-01-05 01:28:12 +01:00
Bertrand Songis 24f4535655 Update DONATIONS.txt 2014-01-04 23:38:42 +01:00
Andre Bernet b90a621db8 Telemetry view fix for new font 2014-01-04 23:20:54 +01:00
Andre Bernet ca61fe4298 Switch Warnings disabled by default on ARM 2014-01-04 22:12:41 +01:00
Andre Bernet fce51a6945 A2 was also disabled in custom switches in D16 mode 2014-01-04 20:41:19 +01:00
Andre Bernet dbf39608eb Reinstate A2 alarms in D16 mode for the 3rd party adapter 2014-01-04 18:21:08 +01:00
Andre Bernet 0618f98a13 Avoid Telemetry Lost / Telemetry Recovered voice alerts playing back to back when using the Reset Telemetry / Flight functions 2014-01-04 18:11:33 +01:00
Bertrand Songis 3d5806cb3c Update DONATIONS.txt 2014-01-04 12:14:37 +01:00
Bertrand Songis ab5d5dd835 Update DONATIONS.txt 2014-01-04 12:13:50 +01:00
Bertrand Songis 26dc8723bb Update DONATIONS.txt 2014-01-03 22:58:26 +01:00
Bertrand Songis 58a3ff84a7 Update DONATIONS.txt 2014-01-03 15:07:17 +01:00
Bertrand Songis 5741bcfc7c Update DONATIONS.txt 2014-01-03 10:25:41 +01:00
mhotar 655169aa7a STD font bitmaps -symbols 2014-01-03 00:04:59 +01:00
Bertrand Songis 33eeb4cc64 [all] Compilation was broken except for Taranis :( 2014-01-02 12:38:18 +01:00
Bertrand Songis 3aee625cd7 Update DONATIONS.txt 2014-01-02 10:42:13 +01:00
mhotar ef28d7e233 Layout fixes 2014-01-01 20:51:02 +01:00
Bertrand Songis 91da126cba Update DONATIONS.txt 2013-12-31 13:05:26 +01:00
Bertrand Songis 1c8b865d89 [Taranis] Support for the 6POS Pots 2013-12-31 13:02:53 +01:00
Bertrand Songis 445899b58b [9XR-PRO] USB Bootloader fix 2013-12-31 11:05:55 +01:00
Bertrand Songis 0d49c5eee6 Jenkins test++ 2013-12-30 16:49:38 +01:00
Bertrand Songis ed61ce0a19 Jenkins test++ 2013-12-30 16:44:37 +01:00
Bertrand Songis 86ee17eba0 Jenkins test++ 2013-12-30 16:37:01 +01:00
Bertrand Songis 7a1f11862e Update DONATIONS.txt 2013-12-30 16:26:30 +01:00
Bertrand Songis 7313d13532 Jenkins test++ 2013-12-30 15:53:25 +01:00
Bertrand Songis d779aa732c Jenkins test++ 2013-12-30 15:34:08 +01:00
Bertrand Songis 337757f8c6 Jenkins test++ 2013-12-30 15:20:10 +01:00
Bertrand Songis 5fbaefa004 Jenkins test 2013-12-30 15:15:06 +01:00
Bertrand Songis 304eaae751 Update DONATIONS.txt 2013-12-30 15:11:15 +01:00
Romolo Manfredini 64419ffd3f Companion google-earth export: remove absolute path for icons. 2013-12-30 09:46:34 +01:00
Bertrand Songis c33e7c313c New donations, thanks\! 2013-12-30 08:39:21 +01:00
root e250806eb7 Merge origin/next into next 2013-12-29 23:18:55 +01:00
romoloman@github.com aadce547a5 Merge origin/romolo/companion9x_ge 2013-12-29 23:17:02 +01:00
romoloman@github.com 53f48dc487 Allow selection of fields for GE export 2013-12-29 18:19:14 +01:00
romoloman@github.com 447ee71698 FrSky S/PORT GPS support 2013-12-29 13:15:13 +01:00
romoloman@github.com f31e14153a KML support for logs 2013-12-29 12:12:55 +01:00
mhotar 97907215c7 Merge remote-tracking branch 'origin/next' into mhotar/proportional_fonts 2013-12-27 21:42:55 +01:00
Bertrand Songis 1be0977330 Fix for #197 (non audio chunks > 256 bytes) 2013-12-27 10:33:45 +01:00
mhotar bbae0f7533 layout fixes 2013-12-27 01:44:58 +01:00
Bertrand Songis 1f4086f381 New donations, thanks! 2013-12-27 00:04:22 +01:00
mhotar 7e5d0a8bba Some graphics glitches corrected and some more flash savings
All features costs only 4bytes so far
2013-12-26 14:58:10 +01:00
Andre Bernet f879c54f8e Fix German translations 2013-12-26 10:18:05 +01:00
H. Renz 4fece76edb German translations by H. Renz 2013-12-26 10:15:50 +01:00
mhotar 682517b0ed putsTime(..) chanaged to save some flash
- newline implemented, thanks to ChrisNisbet01. I will try later to save
some flash with It.
2013-12-25 23:41:27 +01:00
romoloman@github.com 200ad04660 KML support for logs (almost finished) 2013-12-24 12:58:45 +01:00
root ee08415077 KML support for logs (almost finished) 2013-12-24 10:19:43 +01:00
Bertrand Songis 77bd6e5b25 Ignore list updated 2013-12-24 09:08:55 +01:00
romoloman@github.com 69ae9805e9 KML support for logs (almost finished) 2013-12-23 23:30:18 +01:00
Bertrand Songis 76a7674272 [Taranis] Best fix for the audio freeze by Mike, thanks! 2013-12-23 17:30:30 +01:00
Bertrand Songis 57c6738ab7 Merge branch 'next' into bsongis/9XR-PRO_port 2013-12-23 16:12:41 +01:00
Bertrand Songis e436e9dc79 9XR-PRO soft power issue fixed 2013-12-23 16:31:28 +01:00
Bertrand Songis e18499925e New donation, thanks! 2013-12-23 15:45:41 +01:00
Bertrand Songis 271075ec16 Ignore list updated 2013-12-23 15:00:49 +01:00
Bertrand Songis e9839b6b0c Ignored files updated 2013-12-23 14:59:41 +01:00
Bertrand Songis 3cfbd189f8 Translations generated files removed from the git server 2013-12-23 14:56:18 +01:00
Bertrand Songis eb41750e9e [Taranis] No more audio freeze! 2013-12-23 10:42:57 +01:00
mhotar a2e9c6cdca Bold font creation modified to skip some collumns 2013-12-23 02:41:21 +01:00
Bertrand Songis 20ef6984ee Now the FW compiles on 9XR-PRO. Still fighting with the drivers on my Windows machine... 2013-12-22 22:33:42 +01:00
Bertrand Songis b3c7bb1e8c Fixes #155 2013-12-22 18:17:24 +01:00
Bertrand Songis 9a334e44f4 Merge branch 'bsongis/TelemetryCorruption-154' 2013-12-22 17:03:26 +01:00
Bertrand Songis e16500de9e Model Setup reworked again! 2013-12-22 17:01:41 +01:00
mhotar a14ba678b4 tinsize number length corrected 2013-12-22 01:54:01 +01:00
mhotar 97ff1828d1 proportional SQT5 font bitmaps 2013-12-22 00:36:40 +01:00
root 76eec92bdd 9XR support n companion, still not finished 2013-12-21 20:06:05 +01:00
romoloman@github.com 4eedf94f03 9XR support n companion, still not finished 2013-12-21 20:05:20 +01:00
root ee1b51b214 9XR support n companion, still not finished 2013-12-21 15:45:05 +01:00
openfsguruh 8c6bfb208b reverted throttle change for TARANIS
fixed compile issue for PCBTARANIS, because rawAnas didn't exist anymore
for PCBTARANIS.
2013-12-21 10:57:33 +01:00
Bertrand Songis 5b7654e475 StartupSwitches and BeepCenter in ModelSetup rewritten 2013-12-20 19:59:47 +01:00
Bertrand Songis 70102b2fa5 [stock / gruvin9x] DSM2=SERIAL was broken since r2725, thanks Cam for
reporting this issue!
2013-12-20 10:51:34 +01:00
Bertrand Songis 350e910a57 TelemetryAnalog widget resized 2013-12-20 09:47:15 +01:00
mhotar fe30a393b5 fonts corrected 2013-12-20 02:14:11 +01:00
mhotar 1244b7642c Only one font-engine used, costs only 30B for M64
Tab function removed, used absolute X adressing instead (0x1F, X-coord)
2013-12-20 02:12:48 +01:00
mhotar 7e567fdb15 STD and STDV2 fonts defined in lcd.cpp 2013-12-19 23:16:09 +01:00
mhotar d840c8acd4 PWFONT defined in Makefile for STD option
INVERTED string has black borders from all sides
2013-12-19 20:26:56 +01:00
Bertrand Songis 833dd62611 Telemetry tab layout fix 2013-12-19 20:00:17 +01:00
Bertrand Songis 38caa56387 New donations, thanks! 2013-12-19 19:38:44 +01:00
Bertrand Songis b802bc5db2 ModelEdit window splitted (one file per tab). Templates/Wizard still have to be re-introduced, but in a menu instead of a Model tab 2013-12-19 19:19:44 +01:00
mhotar c38f7f9941 Deleted unused folders 2013-12-17 16:23:01 +01:00
mhotar a0eb087d11 Font folders- fighting with git 2013-12-17 16:08:46 +01:00
mhotar 3569272812 PWFONT option added to Makefile 2013-12-17 15:36:04 +01:00
Bertrand Songis bacb65338c Merge branch 'bsongis/Donations_update' into next 2013-12-17 07:31:10 +01:00
Bertrand Songis 14ae917da7 New donations, thanks! 2013-12-17 07:29:24 +01:00
Bertrand Songis ac3981373c Merge remote-tracking branch 'origin/dvogonen/companion_flash_rename_458' into next 2013-12-17 07:18:56 +01:00
openfsguruh 0395dbef0a Throttle counter takes trainer input into account
Now uses combined input from calibratedSticks and trainer port into
account for throttle calculation.
2013-12-16 11:02:11 +01:00
mhotar 2cb5586fd6 Tab function in the strings \037 will help to align columns for different font types 2013-12-15 18:26:02 +01:00
mhotar b6f8fb689f Fixed width fonts added for M64 (bitmaps only) 2013-12-15 17:42:55 +01:00
mhotar 207c0cac8c Czech translations 2013-12-15 15:15:49 +01:00
romoloman@github.com 6f98c73ac2 Italian translation 2013-12-15 00:09:04 +01:00
Kjell Kernen e551118b38 Changed string after comment from Romolo 2013-12-14 22:02:11 +01:00
Andre Bernet 1f6bd16d8e UI for FAS offset in companion 2013-12-14 13:19:03 +01:00
Andre Bernet 6d0398ec64 Merge branch 'next' into kilrah/FAS_Offset_compensation
Conflicts:
	radio/src/translations/es.h
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h
	radio/src/translations/fr.h.txt
2013-12-14 13:03:25 +01:00
Andre Bernet 595258e3e8 French translations 2013-12-14 12:29:46 +01:00
Kjell Kernen 45c563086c Changes after comments from Romolo 2013-12-13 21:08:52 +01:00
Kjell Kernen f648c53443 Translation files re-indexed to prepare for translation.
Obsolete text strings kept to make translation easier.
2013-12-13 20:55:42 +01:00
Kjell Kernen b2540a9fc1 Revert "Translation files updated for all languages. The fix for #458 introduced very visible user interface changes so it is a good idea to translate as many languages as possible before the next release. All obsolete strings removed from translation files. All code indexes rewritten for the new source code structure."
This reverts commit 1998a75eff.
2013-12-13 20:46:03 +01:00
Kjell Kernen 1998a75eff Translation files updated for all languages. The fix for #458 introduced very visible user interface changes so it is a good idea to translate as many languages as possible before the next release. All obsolete strings removed from translation files. All code indexes rewritten for the new source code structure. 2013-12-13 16:53:36 +01:00
Kjell Kernen 51ed610ba5 Added Swedish translation of GUI changes for issue #458 2013-12-13 16:32:04 +01:00
Kjell Kernen dda4a157b1 Correction after comment from Romolo 2013-12-12 23:08:33 +01:00
Kjell Kernen adec1f4cf1 Fixes #485 2013-12-12 16:42:32 +01:00
mhotar d263552c27 Smlsize font correction 2013-12-12 16:04:29 +01:00
mhotar a6863e3d1c Proportional Fonts - merged from SVN
-font definitions are left aligned and width defined
-numbers have fixed width, but are shrinked
-INVerted strings ara black surrounded from left and right sides
2013-12-12 11:41:22 +01:00
Bertrand Songis 39a4b8e39d Merge branch 'bsongis/Companion9x_merge' into next 2013-12-10 22:21:38 +01:00
romoloman 44c6ed07f5 Fixed linux packager 2013-12-10 12:42:36 +01:00
Bertrand Songis ec0f7b3b37 Donations, thanks! 2013-12-09 22:03:11 +01:00
Bertrand Songis 0b61e17454 Donations, thanks! 2013-12-09 08:32:03 +01:00
Bertrand Songis f2c89f31d8 Donations, thanks! 2013-12-07 08:28:26 +01:00
Bertrand Songis 7317a6f8a9 New donations, thanks! 2013-12-06 14:33:48 +01:00
Bertrand Songis b6246e7ae9 Credits updated 2013-12-06 14:33:35 +01:00
Andre Bernet 825cc28bd8 Pot warning mode labels 2013-12-05 12:42:48 +01:00
Andre Bernet 7c9b0960ea mAh and pot positions weren't saved on model change 2013-12-05 11:27:21 +01:00
Bertrand Songis d396e85fe0 9XR-PRO support. Still not finished. 2013-12-05 11:06:58 +01:00
Bertrand Songis e4428849f3 Fixes #190 2013-12-04 21:05:08 +01:00
Andre Bernet 9c5e8881fc Reorder pot warning modes to simplify potential stock board implementation
Might be good to make an enum too.
2013-12-04 12:04:52 +01:00
Andre Bernet 05fca48115 [Taranis] Option to display checklist at startup if present - done here to avoid merge conflicts 2013-12-03 23:04:45 +01:00
Andre Bernet d125e408f2 FAS offset now an option for M64 only 2013-12-03 22:29:22 +01:00
Andre Bernet ab1c367dba French translation 2013-12-03 16:07:22 +01:00
Andre Bernet 6749d26333 Translations 2013-12-03 16:04:00 +01:00
Andre Bernet 413119efc5 French translation 2013-12-03 15:47:25 +01:00
Andre Bernet 7f6591edad Pot warning finished on Taranis, ready to merge once tested by more people :) 2013-12-03 14:56:55 +01:00
Bertrand Songis 32b0aaa19a CREDITS and DONATIONS were swapped 2013-12-02 22:10:52 +01:00
Bertrand Songis b2db04f4bb Visual C++ compilation 2013-12-02 21:13:42 +01:00
Bertrand Songis 2f8f2df3c7 Companion build on Linux 2013-12-02 18:47:43 +01:00
Andre Bernet 43b0c00e11 More pot checking - still need to find how to read the pot's position on the warning screen, the current solution only works the first time. 2013-12-02 15:51:12 +01:00
Andre Bernet 452e987fca checkSwitches() hopefully more sane 2013-12-02 14:54:02 +01:00
Andre Bernet 74918e4d12 Pot warning beta - needs testing, and checkSwitches() needs reviewing! 2013-12-02 14:11:35 +01:00
Bertrand Songis 4e58605333 Problem in LIMITS screen (min and max fields) when GVARS=NO 2013-12-02 12:41:18 +01:00
Bertrand Songis 772d1ca4c8 Directory transmitter renamed to radio 2013-12-02 12:11:38 +01:00
Bertrand Songis 9a57ec0acc Directory transmitter renamed to radio 2013-12-02 12:10:47 +01:00
Andre Bernet eab9fdc24c Pot warning UI done (Taranis only) 2013-12-02 12:07:01 +01:00
Bertrand Songis 942e658c8e Directory transmitter renamed to radio 2013-12-02 07:13:57 +01:00
mhotar@gmail.com 2ce10db3fe No sw_read button for M64 2013-12-01 22:36:28 +01:00
Andre Bernet 5c582390f6 Confirmation blink added to trim reset and failsafe set 2013-12-01 22:19:19 +01:00
Andre Bernet 0fefe2f2dd Beep for switch warning definition, had gone missing in the various changes.... 2013-12-01 21:48:03 +01:00
mhotar@gmail.com 8c81cb5ec0 Switch warning menu button action 2013-12-01 21:46:11 +01:00
Bertrand Songis eb20e5e7b6 OpenTX code moved to transmitter directory 2013-12-01 21:27:31 +01:00
Bertrand Songis 97dda47e5b OpenTX code moved to transmitter directory 2013-12-01 21:26:00 +01:00
Bertrand Songis 589e02755b Fixes #154 2013-11-30 22:42:51 +01:00
Bertrand Songis f4df52a033 OpenTX code moved to transmitter directory 2013-11-30 21:23:55 +01:00
Andre Bernet ad7c110179 Safer switch warning entry - fixed 2013-11-30 15:34:22 +01:00
Andre Bernet f9adb56d10 Shouldn't have been in that branch 2013-11-30 15:25:49 +01:00
Andre Bernet 4bfb7caaa8 Merge branch 'next' into kilrah/Switch_and_pot_warnings 2013-11-30 15:08:10 +01:00
Andre Bernet f088c481f8 Shouldn't have been committed to next 2013-11-30 15:03:58 +01:00
Andre 037bfb373a Safer switch warning entry 2013-11-30 13:08:30 +01:00
Andre Bernet 9f25f558fd Merge branch 'kilrah/FAS_Offset_compensation' into kilrah/Switch_and_pot_warnings
Conflicts:
	src/translations/es.h
	src/translations/es.h.txt
2013-11-30 12:40:25 +01:00
Andre Bernet 9aa5e6d5b5 Merge branch 'kilrah/Pot_warning' into kilrah/Switch_and_pot_warnings
Conflicts:
	src/gui/menu_model.cpp
2013-11-30 12:16:22 +01:00
Andre Bernet 0b267c4a4c [ARM] Pot warning UI first steps 2013-11-30 12:11:31 +01:00
Andre Bernet c7dac9c9a9 Merge branch 'next' into kilrah/Switch_and_pot_warnings 2013-11-30 11:59:13 +01:00
josemoreno259@gmail.com 05be5429a2 Spanish translations 2013-11-30 11:55:53 +01:00
mhotar@gmail.com 5b78409920 [All] Switch-check read state button instead of Enter_Long 2013-11-30 11:54:54 +01:00
mhotar@gmail.com e6bd812f85 [9X] "-" character instead of empty space in switch check line 2013-11-30 11:53:21 +01:00
Andre Bernet 11521c128c [ARM] Reserve EEPROM for stored pot positions and startup checklist display 2013-11-30 11:51:38 +01:00
Andre Bernet d563f64fe3 [Taranis] Text display menu entry was inoperative 2013-11-30 11:51:11 +01:00
Andre Bernet ea98552365 [ARM] Better import of existing switch warnings 2013-11-30 11:49:57 +01:00
Andre Bernet b13fbade78 [all] Switch warnings can be enabled/disabled for each individual switch 2013-11-30 11:49:17 +01:00
bsongis 6e310b922d [Taranis] Missing string translation 2013-11-30 11:45:42 +01:00
Andre Bernet c31f184813 [all] FAS Offset compensation, +/- 1.5A ( issue 166 ) 2013-11-30 11:43:59 +01:00
Andre Bernet 0c0f559f75 [Taranis] Add cumulative usage timer in Statistics view, reset with MENU LONG 2013-11-30 11:40:59 +01:00
Andre Bernet aee3a1c25e [ARM] mAh count can be stored when the radio is powered down between flights ( issue 186 ) 2013-11-30 11:39:11 +01:00
Andre Bernet 1c510326cb [ARM] Adapt DBLKEYS for new limits with decimals 2013-11-30 11:34:37 +01:00
bsongis 84680a674b [Taranis] DSM2 ModelId max is 20 2013-11-30 11:32:35 +01:00
pienk@planet.nl 503e652906 [Mavlink] Compilation failure due to incorrect define of OFS_COUNTRYCODES when CPUARM was not defined and ext MAVLINK was used. 2013-11-30 11:31:04 +01:00
Andre Bernet 023051bf47 Polish translations, other translation fixes 2013-11-30 11:27:02 +01:00
bsongis 38a2643001 Taranis] Issue 132 - Change order in the menu inside the main view 2013-11-30 11:18:42 +01:00
bsongis 3c1a2bddbc [Taranis] Compilation failure when no GVARS 2013-11-30 11:17:31 +01:00
bsongis 1dd8737b0d DSM2 helper script to check the transitions 2013-11-30 11:15:51 +01:00
bsongis 4b9270182e [Taranis] A lot of new features, >100 hours work in one commit... 2013-11-30 11:11:14 +01:00
bsongis 89c6bb2513 [Taranis/sky9x] Problem on trims-mode display in Flight Modes screen (when scrolling) 2013-11-04 15:53:06 +00:00
romolo.manfredini@gmail.com 4318f6f00d revert of Makefile changes 2013-11-03 23:26:54 +00:00
romolo.manfredini@gmail.com 35250f30c2 DSM2 for taranis didn't compiled 2013-11-03 23:03:22 +00:00
bsongis 82f111d249 [Taranis] DSM2 now ok on the logic analyser. I cannot test with a module, as I don't have a module ready for... 2013-11-03 14:17:54 +00:00
bsongis 0592960262 [Taranis] DSM2 next bug fixed. Still fighting... 2013-11-03 07:43:16 +00:00
josemoreno259@gmail.com ee486897df Last changes since August 2013-11-02 18:22:14 +00:00
bsongis b41762bcf4 [all] Fix for issue 177. Ported to all other languages 2013-11-02 07:44:59 +00:00
bsongis 3a1c4b1379 [all] Fix for issue 177. To be tested and ported to all other languages if OK 2013-11-01 18:55:42 +00:00
pienk@planet.nl 4f690f33e3 [Mavlink] Fixed bug saving rssi_scale value to flash. 2013-10-30 17:17:21 +00:00
romolo.manfredini@gmail.com 41b8409975 release notes 2013-10-29 22:39:35 +00:00
2398 changed files with 379209 additions and 22697 deletions
+8
View File
@@ -0,0 +1,8 @@
/.*project
/.settings
/.autotools
radio/src/bootloader/.dep/
radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc
+22
View File
@@ -0,0 +1,22 @@
Bertrand Songis
Romolo Manfredini
André Bernet
Michael Blandford
Rob Thomson
Bryan J. Rentoul (aka Gruvin)
Cameron Weeks
Martin Hotař
Andreas Weitl
Kjell Kernen
Gabriel Birkus
Jean-Pierre Parisy
Karl Szmutny
Michal Hlavinka
Pat Mackenzie
Michael Byrne (logos and official splashes)
Severino Anedda (splash screens)
Grootwitbaas - 9xforums.com (mac)
Adrian Amberg (splash screens)
Wallaguest1 - 9xforums.com (splash screens)
HC1969 - 9xforums.com (splash screens)
+469
View File
@@ -0,0 +1,469 @@
Mario Sette
Felice Baratto
Alessandro Mari
Gianpiero Spontina
Ingo Kuzniak
Hans-Åke Rahm
Tamas Varga
Thomas Gregg
Didier Christien
Alain Pinard
Sergio Melas
Paul Montenot
Chris Guy
Adrien Gravouille
Thomas Black
Marc Lucht
Michel Baily
Zdenek Trojanek
Martin Hotar
[Devo] Stefan Grundevik
[Devo] Fabio Eboli
Federico Zotti
Albin Esbjörnsson
Kilian Hüttenhofer
Stephen Stough
Adilson Oliveira
Robert Saint Marie
Tad Leake
Andreas Weitl
Chan Lofland
Dirk Kasten
Denisov Alexander
Timo Varppee
Ondrej Hatapka
Valérie Billon
R. Scott Page
Johan Cronje
Renato Aranghelovici
Jeffrey Irvin
Aloft Hobbies
John Rodgers
Kenneth Crump
Damjan Adamic
Martin Wilson
Joe Street
John Holdsworth
Daniel Schwartz
Dean Church (monthly)
Michael Halse
David Mark
Ted Moss
Jim Wagner
Nicola Porzi
Michael Halse
Chewytm
Espen Solbu
Mike Frizell
Bruce Jones
Stefano Airaghi
Dan Eeckhout
Alex Calderhead
Leonard MacKey
Heung Jin Choi
Mike Retterer
Keith Wood
Viljo Liukku
Eric Beier
Burt Pickard-Richardson
Helmut Renz
Rick Harms
Vincenzo Vavala
Patricia Martin
Harald Klein
Carl Petersen
Douglas Burkett
Clifford Evans
Teodor Yantchev
Jarad Berkman
Christian Schulz
Gregory J Shepherd
Michael Shellim
Ming Wang
R. Scott Page
Bernard Lukaschek
Nigel Chippindale
Mike Perkins
Ted Hammond
David Beanland
Bernd Koehler
Frédéric Duflos
Dave Fasken
Heinrich Illig
Michael Collins
Michael Manning
Craig Lorentz
Jonathan Modellismo - jonathan.it
André Lasseret
Felipe Alexandre de Oliveira
Brian Harris
Philippe Herbots
Rainer Nelte
Franck Bernhard
Erhard Werner
Stig Jøran Moen
Keith Hertzog
Christophe Dauvergne
Michel Baily
Tauno Rautakorpi
Sven Assmus
Paul Dittman
Mike Matheny
Cheryl Wynne
Emay Toha
Don Nolder
André Lasseret
Filip Lowette
Arnaldo Gabella
Fiorenzo Agnelli
Michele Villa
Christophe Rodriguez
Larisa Filocamo
Hartmut Sahm
Åke Brodin
Aloft Hobbies - www.alofthobbies.com
Ted Moss
Filippos Tigarakis
Chewytm
Eric Burdis
Nigel Chippindale
Michael Deasy
Stephen Stough
Kenneth Lilja (monthly)
Robert Jero
Gary Bancroft
Robert Cotsford
NorthSide
George Constandinides
Robert Schonk Jr
Kevin Berkefeld
Peter Webster
Mike Matheny
Martin Sniedze
Fernando Rimoldi
Sidney Fisher
Bruce Anderson
John Rodgers
Ed Pare
Thomas Kilduff
Robert Ferguson
Bryan Green
Kevin Berkefeld
Julien Michel
Krittikun Chiraphanda
Douglas Law
Alberto Scotti
Oliver Kunkel
D. Joseph Frazier
Heiko Polig
Andrew Fernie
Marco Lange
Nick McMillan
Michel Baily (monthly)
Patrick Mullen
Scott Campbell
Erich Roeder
Wayne Davy
Michael Fontenot
Willie Swanepoel
Satoru Sasaki
Tyler Darby
Nicholas Crego
Keith Hertzog
Johan Moelich
Timo Esser
Dean Church (monthly)
Brian Paddock (monthly)
Jean Pierre Parisy
Norbert Martsch
Jean-Marie Guitard
Mike Perkins
Tilman Baumann (monthly)
Fred Larssen
Ari Aalto
Robert Sams
Kirk Robertson
John Koontz
Jeffery Golias
Paul Robinson
Dave Matison
Mike Matheny
Pino Agostino
Graham Boucher (monthly)
Nelson Noura
Joel Allamy
Philip David Martin
Sean Stephen
Bruce Mackay
Blake Spilman
Timothy Pelletier
Glen Roe (ShowMaster)
Jan Van Ooteghem
David Ankers - Special thanks here to the OpenPilot project!
Lawrence Christensen (monthly)
Leo Duflou
Bruce Wood
Arnd Feige
Tauno Rautakorpi
Steve Coley
Stefan Kiendl
Gregory Nuspel
Mitchell Brenner
Ronnnie DePrez
Ferenc Koller
Robert Sessler
Didier Lanot
Rodney Hunt
Steve Bernard
Paul Nazaroff
Gordon Ernenputsch
Ksamak
Marc Gittelman
David Poole
Ralph Sauer
Karl-Heinz Gansel
Michels Bernhard
Thomas Demmelbauer
Felice Baratto
Michael Halse
Horst Kampen
Ian Gough
Matthew Brett
Lexington S Morley
Clemens Drews
Axel Stöckle
Roberto Orsello
Richard Ruck
Hugh Caldwell
Christian Marauli
Albin Esbjörnsson
Per Esbjörnsson
Bernd Hohmann
Sławomir Juszczak
Stephen Henderson
David Morgan
Aloft Hobbies
Netanel Hobara
Cameron Galipo
Doug Schafer
Pietro Rossin
Earl Killingsworth
Victor B Wright
Terry McKinley
Марков Алексей
Offer Shmuely
Ian Lobley
Keith Hertzog
Stéphane Fortas
Peter Mitrik
Thomas Majewski
ANF King
Henrik Hammarström
Kenneth Lilja (monthly)
R Wells
Uwe Jordt
Harald Wilczak
Bernhard Lohmann
Ferenc Koller
Robert Ferguson
Daniel Byers
Tyler Darby
Miguel Villalpando
Kim Dong Hoon
Terry McKinley
Walter Bell
wsTech - http://wstech.de
Clinton Linck
Josep Clodas Sola
Thierry Martin
Peter Mauro
Mitchell Brenner
Yak
Lluis Bullich Rañe
Steffen Rohr
Eric Jacquin
Harvest Lane
Ville Kuvaja
DK-System
Heinz Vogel
Heung Jin Choi
MMJS van der Helm
Dan Neelands
Yashiro Masayuki
Isaac Sloan
Harold Baird
Roy Bender
Bradley Murchie
Maximilian Süß
Dean Jansa
Ronald Donker
Paul Oldenkamp
Dietmar Drees
Bradley Murchie
Richard Fahie
James Kaufman
Henry Deucker
Christian Fuchs
Arold Reinders
Robert Miller
Aviomotive - www.aviomotive.com
Mark Gaskievicz
Roland Müller
Frank Gewalt
Remi Viard
Reginald H Millsom
Pierluigi Sommaruga
A Harris
Stefan Grunenberg
Francisco Gutierrez Muñoz
Steve Coley
Sean Cull
Roberto Orsello
David Finger
FrSky - www.frsky-rc.com (monthly)
Jean-Marie Oddo
Mike Matheny
Glen Roe (Showmaster)
Arron Bates
Tim Spurr
Daniel Morgan
Trent Ready
Mark Maskiell
Robert Crockford
Mark Illum
David McGuire
Martyn Coles
Jose Sobral
Heung Jin Choi
Tomasz Janiak
Fabien Gagné
Joe Street
Micha Ronen
Albert Blondin
Klaus Schuebel
Evening Shade Pottery
Thomas Kilduff
Sven Assmus
Markus Eberl
Nicholas Field
Harald Wilczak
Michel Baily
John Grepps
Anthony Burbidge
Sherba Baine
Gordon Evans
Fred Figge
Uwe Kuehn
David Beatty
Aaron Stringer
Alan J Wasserman
Wolfgang Rauser
Samuel Cook
BoltRC - www.boltrc.com
Friedrich Ipolt
Barrington Cole
Charles Lakins
Thos. O'Meara Photography
Adam Chevalier
Mike Mulligan
Serge Michaux
Robert Young
Wilco Hijink
Roy Nixon
Lexington S Morley
Daryl Dacko
Beat Zurflueh
Piotr Kundu
Kevin Berkefeld
Tomasz Klys
Mirco Didone'
Christoph Schroeter
Zdenek Trojanek
Bryan Anderson
Kamco Enterprises
Robert Bates
Robert Brown
Dennis Marinus
Ronald Van Putte
Thomas Kvitle Jenssen
Patrick Tuxbury
Istvan Magi
Sasaki Satoru
David Laburthe
Vit Jelinek
Pablo Gomez Martinez
Alan Thoren
Jack Clodfelter
William Simon
James Houck
Peter Fithern
Thomas Svedman
TechFixPros
Rafael Eric Suarez Nordlow
Colin Rycroft
Emanuel Stassar
Michael Gregory
Robert Russell
Gordon Stahl
Felix Kaiser
Joshua Bardwell
Davd Goodall
Leonard MacKey
Miles Kelly
Sergio Robledo
Mikael Wallbäck
Daniel Malcman
Paul Dittman
Attilio Rausse
Sidney Gates
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
Jonathan Gillis
DK-System
Lexington S Morley
Bernd Koehler
Davis RC
Pete Johnson
Patricia Martin
Florian Tschacher
Brian Spearing
Craig Hall
Joseph Case
Harald Klein
Robert Crockford
Chris Boultinghouse
Kitsew
Georgios Papadopoulos
Fourmost Products
Dennis Miller
Dave Matison
Maximilian Radig
Juan Rodriguez
Robert Sessler
John Murray
Martin Sniedze
David Poole
Manfred Delakowitz
Martijn Kruissen
Jörgen Norman
Nathan Kinney
John Godden
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+8
View File
@@ -0,0 +1,8 @@
##OpenTX Next Branch
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
The stable release code is not here, it is in the master branch.
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
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.
+172
View File
@@ -0,0 +1,172 @@
<h2>Version 2.0.2</h2>
<ul>
<li>Mouse scroll wheel behaves differently</li>
<li>Play Sounds should now work on all platforms</li>
<li>A lot of small bug fixes</li>
</ul>
<h2>Version 2.0.1</h2>
<ul>
<li>Fix on recursive GVars</li>
<li>Sky9x EEPROM read/write fix</li>
<li>Translations updated
<li>Wizard fixes
<li>Fix on invalid splashes bitmaps
</ul>
<h2>Version 2.0.0</h2>
<ul>
<li>Companion now merged into OpenTX</li>
<li>Too many changes to list them all!</li>
</ul>
<h2>Version 1.52</h2>
<ul>
<li>Fix crash when writing certain EEPROMS</li>
<li>Google Earth export of logs containing GPS positions</li>
<li>DSM2 added for Taranis</li>
</ul>
<h2>Version 1.51</h2>
<ul>
<li>Wrong DFU-Util default path (MAC)</li>
<li>new voices download server (ip address changed to new fiber connection)</li>
<li>Fixed contributor list</li>
</ul>
<h2>Version 1.50</h2>
<ul>
<li>solved issue with taranis radio with some linux distributions</li>
<li>blank eeprom created using a radio profile that holds calibration data, will contain calibration data from the profile</li>
<li>new opentx compilation server (ip address changed to new fiber connection)</li>
</ul>
<h2>Version 1.49</h2>
<ul>
<li>Stack usage optimizations</li>
<li>Playsound order is misaligned between companion9x and the TX</li>
<li>Model image could not be reset.</li>
</ul>
<h2>Version 1.48</h2>
<ul>
<li>Interface fixes</li>
<li>Hide include dr/expo when not applicable</li>
<li>Fix extraction of grayscale images from taranis firmwares</li>
<li>No TX and RX in Taranis telemetry fields</li>
<li>Issue 255 fixed - "No GVAR selection possible for PLAY VALUE"</li>
<li>Issue 254 fixed - "SE Language for building opentx"</li>
<li>Issue 253 fixed - "OpenTX doesn't accept this protocol (DSM2 on Sky9x)"</li>
<li>Prevent segfault while parsing wrong log files or files with broken lines</li>
<li>Small bug in model printout</li>
<li>Fixed wrong display of values in custom functions</li>
<li>Image in preferences was saved only black & white</li>
<li>Issue 247 fixed - "Labelled items on radio should not be translated."</li>
<li>Added support of tstick (taranis like stick) compile option for sky9x opentx firmware</li>
</ul>
<h2>Version 1.47</h2>
<ul>
<li>Interface fixes (issues 232,233,238,241)</li>
<li>Fix for print/compare models</li>
<li>Function switch parameter on screen different than printout.</li>
<li>Translations fixes</li>
<li>Command line print mode</li>
<li>Better mavlink support</li>
<li>SE tts language added for taranis</li>
<li>Alternate font option for opentx added</li>
</ul>
<h2>Version 1.46</h2>
<ul>
<li>Interface fixes (issues 224,225)</li>
<li>Show persistent timers value in modeledit</li>
<li>Consistent naming of Custom Switches in c9x</li>
</ul>
<h2>Version 1.45</h2>
<ul>
<li>Various fixes</li>
</ul>
<h2>Version 1.44</h2>
<ul>
<li>Fix regression on AND parameter in custom functions</li>
<li>Add mavlink support for stock and m128 boards</li>
</ul>
<h2>Version 1.43</h2>
<ul>
<li>Copy Malfunctions in Custom Functions (Issue 205)</li>
<li>Enable repeat parameter in functions for all boards</li>
<li>Remove sink tones from vario for stock/m128 board</li>
<li>Fix for wrongly named channels in mixerlist (Issue 210)</li>
<li>Fix badly exported gvars in mixers</li>
<li>Fix while editing custom switches</li>
<li>Add access to the release notes of currently selected firmware</li>
</ul>
<h2>Version 1.42</h2>
<ul>
<li>Add Companion9X changelog</li>
<li>Add Fw release notes browser</li>
<li>Simplify burn menu for sky9x and Taranis.</li>
<li>Fix in telemetry conversion (rssi alarm) for stock board</li>
<li>Drop support of sky9x boards on MacOS due to missing SAM-BA tool.</li>
</ul>
<h2>Version 1.41</h2>
<ul>
<li>Fix unneeded rescaling of splash images</li>
<li>Fix for telemetry screens for Taranis</li>
</ul>
<h2>Version 1.40</h2>
<ul>
<li>Log dialog - Split of logging sessions.</li>
<li>Telemetry screen 1 as default (issue 206)</li>
<li>Rename all channels in mixer tab accordingly to limits names</li>
<li>Fix a segfault in phases tabs (Issue 203 regression introduced in release 2140)</li>
</ul>
<h2>Version 1.39</h2>
<ul>
<li>Custom functions cut&paste </li>
<li>Custom switches cut&paste </li>
<li>Color button text in curve editor for MACOSX</li>
<li>Adjust name lengths for Taranis</li>
</ul>
<h2>Version 1.38</h2>
<ul>
<li>Core when model names were > 10 chars</li>
</ul>
<h2>Version 1.37</h2>
<ul>
<li>Fix OpenTX segfault in Taranis simulator</li>
<li>Implement brightness control for Taranis</li>
<li>Reduce modeledit windows size</li>
<li>Taranis splash screen in grayscale</li>
</ul>
<h2>Version 1.36</h2>
<ul>
<li>Burning windows (with progress bar) now in foreground (Issue 197)</li>
<li>Allow a selection of tracks for Background Music (Issue 199)</li>
</ul>
<h2>Version 1.35</h2>
<ul>
<li>Country names mismatch between Taranis and Companion 9X (Issue 198)</li>
<li>TIM function in custom switches</li>
<li>Fix timer switches.</li>
<li>Taranis LCD adjustment in general settings.</li>
<li>New tool in curve editor</li>
<li>Minor fixes</li>
<li>Expo move bug + invalid chars in channels, expo and mixer names</li>
<li>Try to reduce modeledit window form MAC</li>
<li>Wrong init of RF-Module data</li>
<li>Read flash from TX didn't worked for Taranis</li>
</ul>
+463
View File
@@ -0,0 +1,463 @@
PROJECT( companion )
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "2" )
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
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 Xsd " )
FIND_PACKAGE(Xsd)
IF ( XSD_FOUND )
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
ELSE()
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
ENDIF()
MESSAGE( STATUS "Looking for SDL " )
FIND_PACKAGE(Sdl)
IF ( SDL_FOUND )
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS( -DJOYSTICKS )
ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled" )
ENDIF()
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
MESSAGE( STATUS "Looking for PHONON " )
FIND_PACKAGE(Phonon)
IF ( PHONON_FOUND )
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
ADD_DEFINITIONS( -DPHONON )
ELSE()
MESSAGE( "PHONON not found!" )
ENDIF()
ADD_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}/stamp-opentx.h
COMMAND make stamp_header
DEPENDS ${RADIO_SRC_DIRECTORY}/Makefile
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/../..
${SIMU_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}/fonts/std
${RADIO_SRC_DIRECTORY}/lua/src
${XSD_INCLUDE_DIR}
)
add_subdirectory(modeledit)
add_subdirectory(simulation)
set(common_SRCS
eeprominterface.cpp
firmwares/th9x/th9xeeprom.cpp # TODO not needed
firmwares/th9x/th9xinterface.cpp
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
firmwares/opentx/open9xSky9xeeprom.cpp
firmwares/opentx/opentxinterface.cpp
firmwares/opentx/opentxTaranisSimulator.cpp
firmwares/opentx/opentxSky9xsimulator.cpp
firmwares/opentx/opentxGruvin9xsimulator.cpp
firmwares/opentx/opentxM128simulator.cpp
firmwares/opentx/opentxM64simulator.cpp
file.cpp
googleanalytics.cpp
appdata.cpp
)
set(common_MOC_HDRS
googleanalytics.h
)
qt4_wrap_cpp( common_SRCS ${common_MOC_HDRS} )
add_library(common ${common_SRCS})
set(companion_SRCS
hexinterface.cpp
flashinterface.cpp
# xmlinterface.cpp
# ${PROJECT_BINARY_DIR}/radio.cxx
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
helpers.cpp
mdichild.cpp
generaledit.cpp
modelslist.cpp
mountlist.cpp
avroutputdialog.cpp
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
burnconfigdialog.cpp
comparedialog.cpp
contributorsdialog.cpp
customizesplashdialog.cpp
burndialog.cpp
printdialog.cpp
fusesdialog.cpp
logsdialog.cpp
downloaddialog.cpp
splashlibrary.cpp
mainwindow.cpp
companion.cpp
radionotfound.cpp
qcustomplot.cpp
wizarddata.cpp
wizarddialog.cpp
)
set(companion_MOC_HDRS
avroutputdialog.h
apppreferencesdialog.h
fwpreferencesdialog.h
burnconfigdialog.h
comparedialog.h
printdialog.h
fusesdialog.h
logsdialog.h
contributorsdialog.h
customizesplashdialog.h
splashlibrary.h
splashlabel.h
burndialog.h
downloaddialog.h
generaledit.h
modelslist.h
mdichild.h
mainwindow.h
radionotfound.h
qcustomplot.h
qautocombobox.h
helpers.h
wizarddialog.h
)
set(companion_UIS
mdichild.ui
avroutputdialog.ui
comparedialog.ui
fusesdialog.ui
logsdialog.ui
apppreferencesdialog.ui
fwpreferencesdialog.ui
burnconfigdialog.ui
downloaddialog.ui
generaledit.ui
printdialog.ui
contributorsdialog.ui
customizesplashdialog.ui
splashlibrary.ui
burndialog.ui
radionotfound.ui
)
set(companion_RCS
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 00.00.0000)
ENDIF (WIN32)
ENDMACRO (TODAY)
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)
TODAY(DATE)
NOW(TIME)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR}/../${FIRMWARE} G9X )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
IF( WIN32 )
SET( companion_SRCS ${companion_SRCS} icon.rc )
IF ( NOT MSVC )
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
ENDIF( )
ENDIF( )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
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 )
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( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
ELSE( )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ENDIF( )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
############# Standalone simu ###############
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
add_custom_command(
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
)
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
add_custom_command(
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
)
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
add_custom_command(
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
set(simu_SRCS
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
)
set(simu_MOC_HDRS
modeledit/node.h
)
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()
add_executable(simulator WIN32 ${simu_SRCS})
if(SDL_FOUND)
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
else()
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
endif()
############# Packaging ####################
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${PROJECT_NAME} 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-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( NSI_IN_FILE companion-vs.nsi.in )
ELSE( )
SET( NSI_IN_FILE companion-msys.nsi.in )
ENDIF( )
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
COMMENT "Windows NSIS Installer")
ADD_CUSTOM_TARGET( installer
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
SOURCES ${PROJECT_BINARY_DIR}/companion.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()
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${PROJECT_NAME} )
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks )
ENDIF( )
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
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)
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-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 ${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)
+695
View File
@@ -0,0 +1,695 @@
/*
* Author - Kjell Kernen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 "appdata.h"
// Global data and storage object
AppData g;
// ** CompStoreObj class********************
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
{
QSettings settings(PRODUCT, COMPANY);
if (tag2.isEmpty())
{
settings.remove(tag1);
}
else if (tag3.isEmpty())
{
settings.beginGroup(tag1);
settings.remove(tag2);
settings.endGroup();
}
else
{
settings.beginGroup(tag1);
settings.beginGroup(tag2);
settings.remove(tag3);
settings.endGroup();
settings.endGroup();
}
}
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newArray);
array = newArray;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newSList);
stringList = newSList;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newString);
string = newString;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newTruth);
truth = newTruth;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newNumber);
number = newNumber;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
// Retrieval functions
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
array = settings.value(tag, def).toByteArray();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
stringList = settings.value(tag, def).toStringList();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
string = settings.value(tag, def).toString();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
truth = settings.value(tag, def).toBool();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
{
QSettings settings(PRODUCT, COMPANY);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
number = settings.value(tag, def).toInt();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
// Retrieve and Store functions
void CompStoreObj::getset( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( array, tag, def, group1, group2);
store(array, array, tag, group1, group2);
}
void CompStoreObj::getset( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( stringList, tag, def, group1, group2);
store(stringList, stringList, tag, group1, group2);
}
void CompStoreObj::getset( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( string, tag, def, group1, group2);
store(string, string, tag, group1, group2);
}
void CompStoreObj::getset( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
{
retrieve( truth, tag, def, group1, group2);
store(truth, truth, tag, group1, group2);
}
void CompStoreObj::getset( int &number, const QString tag, const int def, const QString group1, const QString group2 )
{
retrieve( number, tag, def, group1, group2);
store(number, number, tag, group1, group2);
}
// ** FwRevision class********************
int FwRevision::get( const QString fwType )
{
QString result;
retrieve( result, fwType, "", "FwRevisions" );
return result.toInt();
}
void FwRevision::set( const QString fwType, const int fwRevision )
{
QString tempString = QString("%1").arg(fwRevision);
store( tempString, tempString, fwType, "FwRevisions" );
}
void FwRevision::remove( const QString tag )
{
clear( "FwRevisions", tag );
}
// ** JStickData class********************
// Get declarations
int JStickData::stick_axe() { return _stickAxe; }
int JStickData::stick_min() { return _stickMin; }
int JStickData::stick_med() { return _stickMed; }
int JStickData::stick_max() { return _stickMax; }
int JStickData::stick_inv() { return _stickInv; }
// Set declarations
void JStickData::stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );}
void JStickData::stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );}
void JStickData::stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );}
void JStickData::stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );}
void JStickData::stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );}
// Constructor
JStickData::JStickData()
{
index = -1;
}
void JStickData::remove()
{
// Remove all JStickData values from settings file
QSettings settings(PRODUCT, COMPANY);
settings.beginGroup( "JsCalibration" );
settings.remove( QString( "stick%1_axe").arg(index) );
settings.remove( QString( "stick%1_min").arg(index) );
settings.remove( QString( "stick%1_med").arg(index) );
settings.remove( QString( "stick%1_max").arg(index) );
settings.remove( QString( "stick%1_inv").arg(index) );
settings.endGroup();
// Reset all JStickData variables to initial values
init(index);
}
bool JStickData::existsOnDisk()
{
QSettings settings(PRODUCT, COMPANY);
settings.beginGroup("JsCalibration");
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
settings.endGroup();
return (axe > -1);
}
void JStickData::init(int newIndex)
{
index = newIndex;
_stickAxe = -1;
_stickMin = -32767;
_stickMed = 0;
_stickMax = 0;
_stickInv = 0;
// Do not write empty joystick calibrations to disk.
if ( !existsOnDisk() )
return;
flush();
}
void JStickData::flush()
{
getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" );
getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" );
getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
}
// ** Profile class********************
// Get declarations
QString Profile::fwName() const { return _fwName; }
QString Profile::fwType() const { return _fwType; }
QString Profile::name() const { return _name; }
QString Profile::sdPath() const { return _sdPath; }
QString Profile::splashFile() const { return _splashFile; }
bool Profile::burnFirmware() const { return _burnFirmware; }
bool Profile::renameFwFiles() const { return _renameFwFiles; }
int Profile::channelOrder() const { return _channelOrder; }
int Profile::defaultMode() const { return _defaultMode; }
QString Profile::beeper() const { return _beeper; }
QString Profile::countryCode() const { return _countryCode; }
QString Profile::display() const { return _display; }
QString Profile::haptic() const { return _haptic; }
QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
int Profile::currentCalib() const { return _currentCalib; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
int Profile::vBatCalib() const { return _vBatCalib; }
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::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
void Profile::haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
void Profile::speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
// Constructor
Profile::Profile()
{
index = -1;
}
// The default copy operator can not be used since the index variable would be destroyed
Profile& Profile::operator=(const Profile& rhs)
{
name ( rhs.name() );
fwName ( rhs.fwName() );
fwType ( rhs.fwType() );
sdPath ( rhs.sdPath() );
splashFile ( rhs.splashFile() );
burnFirmware ( rhs.burnFirmware() );
renameFwFiles( rhs.renameFwFiles() );
channelOrder ( rhs.channelOrder() );
defaultMode ( rhs.defaultMode() );
beeper ( rhs.beeper() );
countryCode ( rhs.countryCode() );
display ( rhs.display() );
haptic ( rhs.haptic() );
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
currentCalib ( rhs.currentCalib() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
vBatCalib ( rhs.vBatCalib() );
vBatWarn ( rhs.vBatWarn() );
return *this;
}
void Profile::remove()
{
// Remove all profile values from settings file
QSettings settings(PRODUCT, COMPANY);
settings.beginGroup("Profiles");
settings.remove(QString("profile%1").arg(index));
settings.endGroup();
// Reset all profile variables to initial values
init(index);
}
bool Profile::existsOnDisk()
{
QSettings settings(PRODUCT, COMPANY);
settings.beginGroup("Profiles");
settings.beginGroup(QString("profile%1").arg(index));
QStringList keyList = settings.allKeys();
settings.endGroup();
settings.endGroup();
return (keyList.length() > 0);
}
void Profile::initFwVariables()
{
_beeper = "";
_countryCode = "";
_display = "";
_haptic = "";
_speaker = "";
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_currentCalib = 0;
_gsStickMode = 0;
_ppmMultiplier = 0;
_vBatCalib = 0;
_vBatWarn = 0;
}
void Profile::init(int newIndex)
{
index = newIndex;
_fwName = "";
_fwType = "";
_name = "";
_sdPath = "";
_splashFile = "";
_burnFirmware = false;
_renameFwFiles = false;
_channelOrder = 0;
_defaultMode = 1;
initFwVariables();
// Do not write empty profiles to disk except the default (0) profile.
if ( index > 0 && !existsOnDisk())
return;
flush();
}
void Profile::flush()
{
// Load and store all variables. Use default values if setting values are missing
getset( _fwName, "fwName" ,"" ,"Profiles", QString("profile%1").arg(index));
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( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
}
// ** AppData class********************
// Get declarations
QStringList AppData::recentFiles() { return _recentFiles; }
QByteArray AppData::mainWinGeo() { return _mainWinGeo; }
QByteArray AppData::mainWinState() { return _mainWinState; }
QByteArray AppData::modelEditGeo() { return _modelEditGeo; }
QString AppData::armMcu() { return _armMcu; }
QString AppData::avrArguments() { return _avrArguments; }
QString AppData::avrPort() { return _avrPort; }
QString AppData::avrdudeLocation() { return _avrdudeLocation; }
QString AppData::dfuArguments() { return _dfuArguments; }
QString AppData::dfuLocation() { return _dfuLocation; }
QString AppData::locale() { return _locale; }
QString AppData::mcu() { return _mcu; }
QString AppData::programmer() { return _programmer; }
QString AppData::sambaLocation() { return _sambaLocation; }
QString AppData::sambaPort() { return _sambaPort; }
QString AppData::backupDir() { return _backupDir; }
QString AppData::gePath() { return _gePath; }
QString AppData::eepromDir() { return _eepromDir; }
QString AppData::flashDir() { return _flashDir; }
QString AppData::imagesDir() { return _imagesDir; }
QString AppData::logDir() { return _logDir; }
QString AppData::libDir() { return _libDir; }
QString AppData::snapshotDir() { return _snapshotDir; }
QString AppData::updatesDir() { return _updatesDir; }
bool AppData::enableBackup() { return _enableBackup; }
bool AppData::backupOnFlash() { return _backupOnFlash; }
bool AppData::jsSupport() { return _jsSupport; }
bool AppData::maximized() { return _maximized; }
bool AppData::showSplash() { return _showSplash; }
bool AppData::snapToClpbrd() { return _snapToClpbrd; }
bool AppData::autoCheckApp() { return _autoCheckApp; }
bool AppData::autoCheckFw() { return _autoCheckFw; }
bool AppData::simuSW() { return _simuSW; }
bool AppData::useWizard() { return _useWizard; }
int AppData::backLight() { return _backLight; }
int AppData::embedSplashes() { return _embedSplashes; }
int AppData::fwServerFails() { return _fwServerFails; }
int AppData::generalEditTab() { return _generalEditTab; }
int AppData::iconSize() { return _iconSize; }
int AppData::historySize() { return _historySize; }
int AppData::jsCtrl() { return _jsCtrl; }
int AppData::id() { return _id; }
int AppData::theme() { return _theme; }
int AppData::warningId() { return _warningId; }
// Set declarations
void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
void AppData::mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );}
void AppData::mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );}
void AppData::modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );}
void AppData::armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );}
void AppData::avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );}
void AppData::avrPort (const QString x) { store(x, _avrPort, "avr_port" );}
void AppData::avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );}
void AppData::dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );}
void AppData::dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );}
void AppData::locale (const QString x) { store(x, _locale, "locale" );}
void AppData::mcu (const QString x) { store(x, _mcu, "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::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
void AppData::eepromDir (const QString x) { store(x, _eepromDir, "lastDir" );}
void AppData::flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );}
void AppData::imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );}
void AppData::logDir (const QString x) { store(x, _logDir, "lastLogDir" );}
void AppData::libDir (const QString x) { store(x, _libDir, "libraryPath" );}
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );}
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
void AppData::useWizard (const bool x) { store(x, _useWizard, "useWizard" );}
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
void AppData::fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );}
void AppData::generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );}
void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );}
void AppData::historySize (const int x) { store(x, _historySize, "history_size" );}
void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
void AppData::id (const int x) { store(x, _id, "profileId" );}
void AppData::theme (const int x) { store(x, _theme, "theme" );}
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
// Constructor
AppData::AppData()
{
//Initialize the profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
//Initialize the joysticks
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
// Import settings from companion9x, but only do it one time.
QSettings c9x_settings("companion9x", "companion9x");
QSettings settings(PRODUCT, COMPANY);
if (profile[0].name().isEmpty() )
{
// Copy all settings from companion9x to companion
QStringList keys = c9x_settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
settings.setValue(*i, c9x_settings.value(*i));
}
// Store old values in new locations
autoCheckApp(settings.value("startup_check_companion9x", true).toBool());
useWizard(settings.value("wizardEnable", true).toBool());
// Convert and store the firmware type
QString fwType = settings.value("firmware", "").toString();
fwType.replace("open9x","opentx");
fwType.replace("x9da","taranis");
profile[0].fwType( fwType );
// Move the Companion9x profile settings to profile0, the new default profile
profile[0].name( settings.value( "Name", "" ).toString());
profile[0].sdPath( settings.value( "sdPath", "" ).toString());
profile[0].splashFile( settings.value( "SplashFileName", "" ).toString());
profile[0].burnFirmware( settings.value( "burnFirmware", false ).toBool());
profile[0].renameFwFiles( settings.value( "rename_firmware_files", false ).toBool());
profile[0].channelOrder( settings.value( "default_channel_order", "0" ).toInt());
profile[0].defaultMode( settings.value( "default_mode", "1" ).toInt());
// Ensure that the default profile has a name
if ( profile[0].name().isEmpty() )
profile[0].name("My Radio");
// Delete obsolete settings fields from companion9x
settings.remove("ActiveProfile");
settings.remove("burnFirmware");
settings.remove("custom_id");
settings.remove("default_channel_order");
settings.remove("default_mode");
settings.remove("firmware");
settings.remove("lastFw");
settings.remove("modelEditTab");
settings.remove("Name");
settings.remove("patchImage");
settings.remove("rename_firmware_files");
settings.remove("sdPath");
settings.remove("SplashFileName");
settings.remove("startup_check_companion9x");
settings.remove("wizardEnable");
// Select the new default profile as current profile
id( 0 );
}
// Remove settings that have been made obsolete during companion2.0 development
settings.remove("compilation-server");
// Load and store all variables. Use default values if setting values are missing
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"20" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
getset( _mainWinState, "mainWindowState" ,"" );
getset( _modelEditGeo, "modelEditGeometry" ,"" );
getset( _armMcu, "arm_mcu" ,"at91sam3s4-9x" );
getset( _avrArguments, "avr_arguments" ,"" );
getset( _avrPort, "avr_port" ,"" );
getset( _avrdudeLocation, "avrdudeLocation" ,"" );
getset( _dfuArguments, "dfu_arguments" ,"-a 0" );
getset( _dfuLocation, "dfu_location" ,"" );
getset( _locale, "locale" ,"" );
getset( _mcu, "mcu" ,"m64" );
getset( _programmer, "programmer" ,"usbasp" );
getset( _sambaLocation, "samba_location" ,"" );
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
getset( _backupDir, "backupPath" ,"" );
getset( _gePath, "gePath" ,"" );
getset( _eepromDir, "lastDir" ,"" );
getset( _flashDir, "lastFlashDir" ,"" );
getset( _imagesDir, "lastImagesDir" ,"" );
getset( _logDir, "lastLogDir" ,"" );
getset( _libDir, "libraryPath" ,"" );
getset( _snapshotDir, "snapshotpath" ,"" );
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _enableBackup, "backupEnable" ,false );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _jsSupport, "js_support" ,false );
getset( _maximized, "maximized" ,false );
getset( _showSplash, "show_splash" ,true );
getset( _snapToClpbrd, "snapshot_to_clipboard" ,false );
getset( _autoCheckApp, "startup_check_companion" ,true );
getset( _autoCheckFw, "startup_check_fw" ,true );
getset( _simuSW, "simuSW" ,false );
getset( _useWizard, "useWizard" ,true );
getset( _backLight, "backLight" ,0 );
getset( _embedSplashes, "embedded_splashes" ,0 );
getset( _fwServerFails, "fwserver" ,0 );
getset( _generalEditTab, "generalEditTab" ,0 );
getset( _iconSize, "icon_size" ,2 );
getset( _jsCtrl, "js_ctrl" ,0 );
getset( _historySize, "history_size" ,10 );
getset( _id, "profileId" ,0 );
getset( _theme, "theme" ,1 );
getset( _warningId, "warningId" ,0 );
}
+359
View File
@@ -0,0 +1,359 @@
/*
* Author - Kjell Kernen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
*/
// All temporary and permanent global variables are defined here to make
// initialization and storage safe and visible.
// Do not access variables in QSettings directly, it is not type safe!
#ifndef COMPANION_APPDATA_H
#define COMPANION_APPDATA_H
#include <QByteArray>
#include <QStringList>
#include <QString>
#include <QSettings>
#define COMPANY "OpenTX Companion"
#define PRODUCT "OpenTX"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
class CompStoreObj
{
public:
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
void store(const QString newString, QString &string, const QString tag, const QString group1="", const QString group2="" );
void store(const bool newTruth, bool &truth, const QString tag, const QString group1="", const QString group2="" );
void store(const int newNumber, int &number, const QString tag, const QString group1="", const QString group2="" );
// Retrieval functions
void retrieve( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
void retrieve( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
// Retrieve and Store functions
void getset( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
};
class FwRevision: protected CompStoreObj
{
public:
int get( const QString);
void set( const QString, const int );
void remove( const QString );
};
class JStickData: protected CompStoreObj
{
private:
int index;
int _stickAxe;
int _stickMin;
int _stickMed;
int _stickMax;
int _stickInv;
public:
// All the get definitions
int stick_axe();
int stick_min();
int stick_med();
int stick_max();
int stick_inv();
// All the set definitions
void stick_axe(const int);
void stick_min(const int);
void stick_med(const int);
void stick_max(const int);
void stick_inv(const int);
JStickData();
void remove();
bool existsOnDisk();
void init(int index);
void flush();
};
class Profile: protected CompStoreObj
{
private:
// Class Internal Variable
int index;
// Application Variables
QString _fwName;
QString _fwType;
QString _name;
QString _sdPath;
QString _splashFile;
bool _burnFirmware;
bool _renameFwFiles;
int _channelOrder;
int _defaultMode;
// Firmware Variables
QString _beeper;
QString _countryCode;
QString _display;
QString _haptic;
QString _speaker;
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
int _currentCalib;
int _gsStickMode;
int _ppmMultiplier;
int _vBatCalib;
int _vBatWarn;
public:
// All the get definitions
QString fwName() const;
QString fwType() const;
QString name() const;
QString sdPath() const;
QString splashFile() const;
bool burnFirmware() const;
bool renameFwFiles() const;
int channelOrder() const;
int defaultMode() const;
QString beeper() const;
QString countryCode() const;
QString display() const;
QString haptic() const;
QString speaker() const;
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
int currentCalib() const;
int gsStickMode() const;
int ppmMultiplier() const;
int vBatCalib() const;
int vBatWarn() const;
// All the set definitions
void name (const QString);
void fwName (const QString);
void fwType (const QString);
void sdPath (const QString);
void splashFile (const QString);
void burnFirmware (const bool);
void renameFwFiles (const bool);
void channelOrder (const int);
void defaultMode (const int);
void beeper (const QString);
void countryCode (const QString);
void display (const QString);
void haptic (const QString);
void speaker (const QString);
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void currentCalib (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
void vBatCalib (const int);
void vBatWarn (const int);
Profile();
Profile& operator=(const Profile&);
void remove();
bool existsOnDisk();
void init(int newIndex);
void initFwVariables();
void flush();
};
class AppData: protected CompStoreObj
{
// All the global variables
public:
Profile profile[MAX_PROFILES];
JStickData joystick[MAX_JOYSTICKS];
FwRevision fwRev;
private:
QStringList _recentFiles;
QByteArray _mainWinGeo;
QByteArray _mainWinState;
QByteArray _modelEditGeo;
QString _armMcu;
QString _avrArguments;
QString _avrPort;
QString _avrdudeLocation;
QString _dfuArguments;
QString _dfuLocation;
QString _locale;
QString _mcu;
QString _programmer;
QString _sambaLocation;
QString _sambaPort;
QString _backupDir;
QString _gePath;
QString _eepromDir;
QString _flashDir;
QString _imagesDir;
QString _logDir;
QString _libDir;
QString _snapshotDir;
QString _updatesDir;
bool _enableBackup;
bool _backupOnFlash;
bool _maximized;
bool _jsSupport;
bool _showSplash;
bool _snapToClpbrd;
bool _autoCheckApp;
bool _autoCheckFw;
bool _simuSW;
bool _useWizard;
int _backLight;
int _embedSplashes;
int _fwServerFails;
int _generalEditTab;
int _iconSize;
int _jsCtrl;
int _historySize;
int _id;
int _theme;
int _warningId;
public:
// All the get definitions
QStringList recentFiles();
QByteArray mainWinGeo();
QByteArray mainWinState();
QByteArray modelEditGeo();
QString armMcu();
QString avrArguments();
QString avrPort();
QString avrdudeLocation();
QString dfuArguments();
QString dfuLocation();
QString lastFw();
QString locale();
QString mcu();
QString programmer();
QString sambaLocation();
QString sambaPort();
QString backupDir();
QString gePath();
QString eepromDir();
QString flashDir();
QString imagesDir();
QString logDir();
QString libDir();
QString snapshotDir();
QString updatesDir();
bool enableBackup();
bool backupOnFlash();
bool jsSupport();
bool maximized();
bool showSplash();
bool snapToClpbrd();
bool autoCheckApp();
bool autoCheckFw();
bool simuSW();
bool useWizard();
int backLight();
int embedSplashes();
int fwServerFails();
int generalEditTab();
int iconSize();
int historySize();
int jsCtrl();
int id();
int theme();
int warningId();
// All the set definitions
void recentFiles (const QStringList x);
void mainWinGeo (const QByteArray);
void mainWinState (const QByteArray);
void modelEditGeo (const QByteArray);
void armMcu (const QString);
void avrArguments (const QString);
void avrPort (const QString);
void avrdudeLocation (const QString);
void dfuArguments (const QString);
void dfuLocation (const QString);
void lastFw (const QString);
void locale (const QString);
void mcu (const QString);
void programmer (const QString);
void sambaLocation (const QString);
void sambaPort (const QString);
void backupDir (const QString);
void gePath (const QString);
void eepromDir (const QString);
void flashDir (const QString);
void imagesDir (const QString);
void logDir (const QString);
void libDir (const QString);
void snapshotDir (const QString);
void updatesDir (const QString);
void enableBackup (const bool);
void backupOnFlash (const bool);
void maximized (const bool);
void jsSupport (const bool);
void showSplash (const bool);
void snapToClpbrd (const bool);
void autoCheckApp (const bool);
void autoCheckFw (const bool);
void simuSW (const bool);
void useWizard (const bool);
void backLight (const int);
void embedSplashes (const int);
void fwServerFails (const int);
void generalEditTab (const int);
void iconSize (const int);
void historySize (const int);
void jsCtrl (const int);
void modelEditTab (const int);
void id (const int);
void theme (const int);
void warningId (const int);
// Constructor
AppData();
};
extern AppData g;
#endif // COMPANION_APPDATA_H
+531
View File
@@ -0,0 +1,531 @@
#include "apppreferencesdialog.h"
#include "ui_apppreferencesdialog.h"
#include "mainwindow.h"
#include "appdata.h"
#include "helpers.h"
#include "flashinterface.h"
#ifdef JOYSTICKS
#include "joystick.h"
#include "joystickdialog.h"
#endif
#include <QDesktopServices>
#include <QtGui>
AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AppPreferencesDialog)
{
ui->setupUi(this);
updateLock=false;
setWindowIcon(CompanionIcon("apppreferences.png"));
voice=NULL;
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
initSettings();
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
#ifndef JOYSTICKS
ui->joystickCB->hide();
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->hide();
ui->joystickChkB->hide();
ui->label_11->hide();
#endif
shrink();
}
AppPreferencesDialog::~AppPreferencesDialog()
{
delete ui;
}
void AppPreferencesDialog::writeValues()
{
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.libDir(ui->libraryPath->text());
g.gePath(ui->ge_lineedit->text());
g.embedSplashes(ui->splashincludeCB->currentIndex());
g.enableBackup(ui->backupEnable->isChecked());
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsCtrl(ui->joystickCB ->currentIndex());
}
else {
g.jsSupport(false);
g.jsCtrl(0);
}
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
g.profile[g.id()].sdPath(ui->sdPath->text());
g.profile[g.id()].splashFile(ui->SplashFileName->text());
// The profile name may NEVER be empty
if (ui->profileNameLE->text().isEmpty())
g.profile[g.id()].name(tr("My Radio"));
else
g.profile[g.id()].name(ui->profileNameLE->text());
// If a new fw type has been choosen, several things need to reset
current_firmware_variant = getFirmwareVariant();
if (g.profile[g.id()].fwType() != current_firmware_variant.id) {
g.profile[g.id()].fwName("");
g.profile[g.id()].initFwVariables();
g.profile[g.id()].fwType( current_firmware_variant.id );
}
}
void AppPreferencesDialog::on_snapshotPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
if (!fileName.isEmpty()) {
g.snapshotDir(fileName);
g.snapToClpbrd(false);
ui->snapshotPath->setText(fileName);
}
}
void AppPreferencesDialog::initSettings()
{
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
ui->snapshotPath->setText(g.snapshotDir());
ui->snapshotPath->setReadOnly(true);
if (ui->snapshotClipboardCKB->isChecked())
{
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
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());
if (IS_TARANIS(GetCurrentFirmware()->getBoard()))
ui->backLightColor->setEnabled(false);
ui->simuSW->setChecked(g.simuSW());
ui->modelWizard_CB->setChecked(g.useWizard());
ui->libraryPath->setText(g.libDir());
ui->ge_lineedit->setText(g.gePath());
if (!g.backupDir().isEmpty()) {
if (QDir(g.backupDir()).exists()) {
ui->backupPath->setText(g.backupDir());
ui->backupEnable->setEnabled(true);
ui->backupEnable->setChecked(g.enableBackup());
} else {
ui->backupEnable->setDisabled(true);
}
} else {
ui->backupEnable->setDisabled(true);
}
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
#ifdef JOYSTICKS
ui->joystickChkB->setChecked(g.jsSupport());
if (ui->joystickChkB->isChecked()) {
QStringList joystickNames;
joystickNames << tr("No joysticks found");
joystick = new Joystick(0,false,0,0);
ui->joystickcalButton->setDisabled(true);
ui->joystickCB->setDisabled(true);
if ( joystick ) {
if ( joystick->joystickNames.count() > 0 ) {
joystickNames = joystick->joystickNames;
ui->joystickCB->setEnabled(true);
ui->joystickcalButton->setEnabled(true);
}
joystick->close();
}
ui->joystickCB->clear();
ui->joystickCB->insertItems(0, joystickNames);
ui->joystickCB->setCurrentIndex(g.jsCtrl());
}
else {
ui->joystickCB->clear();
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->setDisabled(true);
}
#endif
// Profile Tab Inits
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
ui->sdPath->setText(g.profile[g.id()].sdPath());
ui->profileNameLE->setText(g.profile[g.id()].name());
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
displayImage( g.profile[g.id()].splashFile() );
QString hwSettings;
if (g.profile[g.id()].stickPotCalib() == "" ) {
hwSettings = tr("EMPTY: No radio settings stored in profile");
}
else {
QString str = g.profile[g.id()].timeStamp();
if (str.isEmpty())
hwSettings = tr("AVAILABLE: Radio settings of unknown age");
else
hwSettings = tr("AVAILABLE: Radio settings stored %1").arg(str);
}
ui->lblGeneralSettings->setText(hwSettings);
FirmwareInterface * current_firmware = GetCurrentFirmware();
foreach(FirmwareInterface * firmware, firmwares) {
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
if (current_firmware == firmware) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
}
}
baseFirmwareChanged();
firmwareChanged();
}
void AppPreferencesDialog::on_libraryPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir());
if (!fileName.isEmpty()) {
g.libDir(fileName);
ui->libraryPath->setText(fileName);
}
}
void AppPreferencesDialog::on_snapshotClipboardCKB_clicked()
{
if (ui->snapshotClipboardCKB->isChecked()) {
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
g.snapToClpbrd(true);
}
else {
ui->snapshotPath->setEnabled(true);
ui->snapshotPath->setReadOnly(true);
ui->snapshotPathButton->setEnabled(true);
g.snapToClpbrd(false);
}
}
void AppPreferencesDialog::on_backupPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
if (!fileName.isEmpty()) {
g.backupDir(fileName);
ui->backupPath->setText(fileName);
}
ui->backupEnable->setEnabled(true);
}
void AppPreferencesDialog::on_ge_pathButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
if (!fileName.isEmpty()) {
ui->ge_lineedit->setText(fileName);
}
}
#ifdef JOYSTICKS
void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) {
QStringList joystickNames;
joystickNames << tr("No joysticks found");
joystick = new Joystick(0,false,0,0);
ui->joystickcalButton->setDisabled(true);
ui->joystickCB->setDisabled(true);
if ( joystick ) {
if ( joystick->joystickNames.count() > 0 ) {
joystickNames = joystick->joystickNames;
ui->joystickCB->setEnabled(true);
ui->joystickcalButton->setEnabled(true);
}
joystick->close();
}
ui->joystickCB->clear();
ui->joystickCB->insertItems(0, joystickNames);
}
else {
ui->joystickCB->clear();
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->setDisabled(true);
}
}
void AppPreferencesDialog::on_joystickcalButton_clicked() {
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
jd->exec();
}
#endif
// ******** Profile tab functions
void AppPreferencesDialog::on_sdPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath());
if (!fileName.isEmpty()) {
ui->sdPath->setText(fileName);
}
}
void AppPreferencesDialog::on_removeProfileButton_clicked()
{
if ( g.id() == 0 ) {
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
}
else {
g.profile[g.id()].remove();
g.id( 0 );
initSettings();
}
}
bool AppPreferencesDialog::displayImage( QString fileName )
{
// Start by clearing the pixmap
ui->imageLabel->setPixmap(QPixmap());
QImage image(fileName);
if (image.isNull())
return false;
// Use the firmware name to determine splash width
int width = SPLASH_WIDTH;
if (g.profile[g.id()].fwType().contains("taranis"))
width = SPLASHX9D_WIDTH;
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
ui->imageLabel->setFixedSize(width, SPLASH_HEIGHT);
return true;
}
void AppPreferencesDialog::on_SplashSelect_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 to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()){
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
displayImage(fileName);
ui->SplashFileName->setText(fileName);
}
}
void AppPreferencesDialog::on_clearImageButton_clicked() {
ui->imageLabel->clear();
ui->SplashFileName->clear();
}
void AppPreferencesDialog::showVoice(bool show)
{
if (show)
showVoice();
else
hideVoice();
}
void AppPreferencesDialog::showVoice()
{
ui->voiceLabel->show();
ui->voiceCombo->show();
}
void AppPreferencesDialog::hideVoice()
{
ui->voiceLabel->hide();
ui->voiceCombo->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
void AppPreferencesDialog::baseFirmwareChanged()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
voice=NULL;
foreach(FirmwareInterface * firmware, firmwares) {
if (firmware->getId() == selected_firmware) {
showVoice(firmware->voice);
populateFirmwareOptions(firmware);
break;
}
}
firmwareChanged();
}
FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
bool voice=false;
foreach(FirmwareInterface * firmware, firmwares) {
QString id = firmware->getId();
if (id == selected_firmware) {
foreach(QCheckBox *cb, optionsCheckBoxes) {
if (cb->isChecked()) {
if (cb->text()=="voice" && cb->isChecked())
voice=true;
id += QString("-") + cb->text();
}
}
if (voice) {
if (ui->voiceCombo->count() && (voice || firmware->voice))
id += QString("-tts") + ui->voiceCombo->currentText();
}
else {
hideVoice();
}
if (ui->langCombo->count())
id += QString("-") + ui->langCombo->currentText();
return GetFirmwareVariant(id);
}
}
// Should never occur...
return default_firmware_variant;
}
void AppPreferencesDialog::firmwareOptionChanged(bool state)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
FirmwareInterface * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
if (firmware->getId() == selected_firmware) {
foreach(QList<Option> opts, firmware->opts) {
foreach(Option opt, opts) {
if (cb->text() == opt.name) {
foreach(Option other, opts) {
if (other.name != opt.name) {
foreach(QCheckBox *ocb, optionsCheckBoxes) {
if (ocb->text() == other.name)
ocb->setChecked(false);
}
}
}
if (voice) {
showVoice(voice->isChecked());
}
return firmwareChanged();
}
}
}
}
}
}
else if (cb && !state) {
if (cb->text()=="voice") {
hideVoice();
}
}
if (voice) {
showVoice(voice->isChecked());
}
else if (firmware) {
if (firmware->voice) {
showVoice();
}
}
return firmwareChanged();
}
void AppPreferencesDialog::firmwareLangChanged()
{
firmwareChanged();
}
void AppPreferencesDialog::firmwareChanged()
{
if (updateLock)
return;
FirmwareVariant variant = getFirmwareVariant();
QString stamp;
stamp.append(variant.firmware->getStampUrl());
QString url = variant.getFirmwareUrl();
}
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
{
const FirmwareInterface * parent = /*firmware->parent ? firmware->parent : */ firmware;
updateLock = true;
ui->langCombo->clear();
foreach(const char *lang, parent->languages) {
ui->langCombo->addItem(lang);
if (current_firmware_variant.id.endsWith(lang))
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
}
ui->voiceCombo->clear();
foreach(const char *lang, parent->ttslanguages) {
ui->voiceCombo->addItem(lang);
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
}
showVoice(ui->langCombo->count()!=0);
int index = 0;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
QCheckBox * checkbox = new QCheckBox(ui->profileTab);
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
optionsCheckBoxes.push_back(checkbox);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
}
QCheckBox *cb = optionsCheckBoxes.at(index++);
if (cb) {
cb->show();
cb->setText(opt.name);
cb->setToolTip(opt.tooltip);
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
if (opt.name==QString("voice")) {
voice=cb;
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
}
}
}
}
for (; index<optionsCheckBoxes.size(); index++) {
QCheckBox *cb = optionsCheckBoxes.at(index);
cb->hide();
cb->setCheckState(Qt::Unchecked);
}
updateLock = false;
QTimer::singleShot(0, this, SLOT(shrink()));
}
void AppPreferencesDialog::shrink()
{
resize(0,0);
}
+65
View File
@@ -0,0 +1,65 @@
#ifndef APPPREFERENCESDIALOG_H
#define APPPREFERENCESDIALOG_H
#include <QDialog>
#include <QCheckBox>
#include "eeprominterface.h"
namespace Ui {
class AppPreferencesDialog;
}
class Joystick;
class AppPreferencesDialog : public QDialog
{
Q_OBJECT
public:
explicit AppPreferencesDialog(QWidget *parent = 0);
~AppPreferencesDialog();
Joystick *joystick;
private:
QList<QCheckBox *> optionsCheckBoxes;
bool updateLock;
void showVoice(bool);
void showVoice();
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const FirmwareInterface *);
FirmwareVariant getFirmwareVariant();
QCheckBox * voice;
Ui::AppPreferencesDialog *ui;
void initSettings();
bool displayImage( QString fileName );
void loadProfileString(QString profile, QString label);
void loadFromProfile();
protected slots:
void shrink();
void firmwareLangChanged();
void baseFirmwareChanged();
void firmwareOptionChanged(bool state);
void firmwareChanged();
void writeValues();
void on_libraryPathButton_clicked();
void on_snapshotPathButton_clicked();
void on_snapshotClipboardCKB_clicked();
void on_backupPathButton_clicked();
void on_ge_pathButton_clicked();
void on_sdPathButton_clicked();
void on_removeProfileButton_clicked();
void on_SplashSelect_clicked();
void on_clearImageButton_clicked();
#ifdef JOYSTICKS
void on_joystickChkB_clicked();
void on_joystickcalButton_clicked();
#endif
};
#endif // APPPREFERENCESDIALOG_H
File diff suppressed because it is too large Load Diff
+507
View File
@@ -0,0 +1,507 @@
#include "avroutputdialog.h"
#include "ui_avroutputdialog.h"
#include <QtGui>
#include "eeprominterface.h"
#include "flashinterface.h"
#include "googleanalytics.h"
#if defined WIN32 || !defined __GNUC__
#include <Windows.h>
#include <WinBase.h>
#include <tlhelp32.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#include "mountlist.h"
#endif
avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour, bool displayDetails) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::avrOutputDialog),
kill_timer(NULL),
hasErrors(false)
{
ui->setupUi(this);
#ifdef __APPLE__
QFont newFont("Courier", 13);
ui->plainTextEdit->setFont(newFont);
ui->plainTextEdit->setAttribute(Qt::WA_MacNormalSize);
#endif
#if defined WIN32 || !defined __GNUC__
QFont newFont("Courier", 9);
ui->plainTextEdit->setFont(newFont);
#endif
cmdLine = prog;
closeOpt = closeBehaviour;
if (cmdLine.isEmpty()) {
if (arg.count()<2) {
closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose()));
}
else {
sourceFile=arg.at(0);
destFile=arg.at(1);
if (!displayDetails) {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
} else {
ui->checkBox->setChecked(true);
}
ui->progressBar->setMaximum(127);
QTimer::singleShot(500, this, SLOT(doCopy()));
}
}
else {
if (wTitle.isEmpty())
setWindowTitle(getProgrammer() + " " + tr("result"));
else
setWindowTitle(getProgrammer() + " - " + wTitle);
QFile exec;
winTitle=wTitle;
if (!(exec.exists(prog))) {
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose()));
}
else {
foreach(QString str, arg) cmdLine.append(" " + str);
lfuse = 0;
hfuse = 0;
efuse = 0;
phase=0;
currLine.clear();
if (!displayDetails) {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
else {
ui->checkBox->setChecked(true);
}
process = new QProcess(this);
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
connect(process,SIGNAL(started()),this,SLOT(doProcessStarted()));
connect(process,SIGNAL(readyReadStandardOutput()),this,SLOT(doAddTextStdOut()));
connect(process,SIGNAL(finished(int)),this,SLOT(doFinished(int)));
#if !__GNUC__
kill_timer = new QTimer(this);
connect(kill_timer, SIGNAL(timeout()), this, SLOT(killTimerElapsed()));
kill_timer->start(2000);
#endif
process->start(prog,arg);
}
}
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
}
# if !__GNUC__
BOOL KillProcessByName(char *szProcessToKill){
HANDLE hProcessSnap;
HANDLE hProcess;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes
if(hProcessSnap == INVALID_HANDLE_VALUE){
return( FALSE );
}
pe32.dwSize = sizeof(PROCESSENTRY32);
if(!Process32First(hProcessSnap, &pe32)){
CloseHandle(hProcessSnap);
return( FALSE );
}
do{
if(!strcmp(pe32.szExeFile,szProcessToKill)){ // checks if process at current position has the name of to be killed app
hProcess = OpenProcess(PROCESS_TERMINATE,0, pe32.th32ProcessID); // gets handle to process
TerminateProcess(hProcess,0); // Terminate process by handle
CloseHandle(hProcess); // close the handle
}
}while(Process32Next(hProcessSnap,&pe32)); // gets next member of snapshot
CloseHandle(hProcessSnap); // closes the snapshot handle
return( TRUE );
}
#endif
void avrOutputDialog::doCopy()
{
char buf[BLKSIZE];
QFile source(sourceFile);
int blocks = (source.size() + BLKSIZE - 1) / BLKSIZE;
ui->progressBar->setMaximum(blocks-1);
if (source.open(QIODevice::ReadOnly)) {
QFile dest(destFile);
if (dest.open(QIODevice::WriteOnly)) {
for (int i=0; i<blocks; i++) {
addText(tr("Writing file: "));
int read = source.read(buf, BLKSIZE);
if (dest.write(buf, read) == read) {
dest.flush();
ui->progressBar->setValue(i);
if ((i%2) != 0)
addText("#");
}
else {
QMessageBox::warning(this, tr("Error"), tr("Write error"));
break;
}
}
dest.close();
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
}
source.close();
doFinished(0);
}
void avrOutputDialog::killTimerElapsed()
{
delete kill_timer;
kill_timer = NULL;
# if !__GNUC__
KillProcessByName("tasklist.exe");
#endif
}
avrOutputDialog::~avrOutputDialog()
{
delete ui;
delete kill_timer;
}
void avrOutputDialog::runAgain(QString prog, QStringList arg, int closeBehaviour)
{
cmdLine = prog;
foreach(QString str, arg) cmdLine.append(" " + str);
closeOpt = closeBehaviour;
currLine.clear();
process->start(prog,arg);
}
void avrOutputDialog::waitForFinish()
{
process->waitForFinished();
}
void avrOutputDialog::addText(const QString &text)
{
QTextCursor cursor(ui->plainTextEdit->textCursor());
// is the scrollbar at the end?
bool atEnd = (ui->plainTextEdit->verticalScrollBar()->value() == ui->plainTextEdit->verticalScrollBar()->maximum());
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
cursor.insertText(text);
if (atEnd) {
ui->plainTextEdit->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
}
}
void avrOutputDialog::doAddTextStdOut()
{
QByteArray data = process->readAllStandardOutput();
QString text = QString(data);
QString temp;
int nlPos, pos, size;
addText(text);
currStdLine.append(text);
if (currStdLine.contains("size = ")) {
pos = currStdLine.lastIndexOf("size = ");
temp = currStdLine.mid(pos+7);
pos = temp.lastIndexOf("\n");
size = temp.left(pos).toInt();
ui->progressBar->setMaximum(size/2048);
}
if (currStdLine.contains("\n")) {
nlPos = currStdLine.lastIndexOf("\n");
currStdLine = currStdLine.mid(nlPos+1);
}
if (!currStdLine.isEmpty()) {
if (currStdLine.at(0) == QChar('.')) {
pos = currStdLine.lastIndexOf(".");
ui->progressBar->setValue(pos);
}
else if (currStdLine.startsWith("Starting upload: [")) {
pos = (currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
ui->progressBar->setValue(pos);
}
}
if (text.contains("Complete ")) {
#if !__GNUC__
delete kill_timer;
kill_timer = NULL;
#endif
int start = text.indexOf("Complete ");
int end = text.indexOf("%");
if (start > 0) {
start += 9;
int value = text.mid(start, end-start).toInt();
ui->progressBar->setValue(value);
}
}
if (text.contains(":010000")) {
//contains fuse info
QStringList stl = text.split(":01000000");
foreach (QString t, stl) {
bool ok = false;
if (!lfuse) lfuse = t.left(2).toInt(&ok,16);
if (!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
if (!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
}
}
if (text.contains("-E-")) {
hasErrors = true;
}
}
QString avrOutputDialog::getProgrammer()
{
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) {
return "DFU Util";
}
else if IS_SKY9X(eepromInterface->getBoard()) {
return "SAM-BA";
}
else {
return "AVRDUDE";
}
}
void avrOutputDialog::errorWizard()
{
QString output=ui->plainTextEdit->toPlainText();
if (output.contains("avrdude: Expected signature for")) { // wrong signature
int pos=output.indexOf("avrdude: Device signature = ");
bool fwexist=false;
QString DeviceStr="Unknown";
QString FwStr="";
if (pos>0) {
QString DeviceId=output.mid(pos+28,8);
if (DeviceId=="0x1e9602") {
DeviceStr="Atmega 64";
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
fwexist=true;
}
else if (DeviceId=="0x1e9702") {
DeviceStr="Atmega 128";
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
fwexist=true;
}
else if (DeviceId=="0x1e9703") {
DeviceStr="Atmega 1280";
}
else if (DeviceId=="0x1e9704") {
DeviceStr="Atmega 1281";
}
else if (DeviceId=="0x1e9801") {
DeviceStr="Atmega 2560";
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board");
fwexist=true;
}
else if (DeviceId=="0x1e9802") {
DeviceStr="Atmega 2561";
}
}
if (fwexist==false) {
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
}
else {
FirmwareInterface *firmware = GetCurrentFirmware();
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName()));
}
}
}
void avrOutputDialog::doAddTextStdErr()
{
int nlPos;
int pbvalue;
QString avrphase;
QByteArray data = process->readAllStandardError();
QString text = QString(data);
currLine.append(text);
if (currLine.contains("#")) {
avrphase = currLine.left(1).toLower();
if (avrphase=="w") {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #ff0000; text-align:center;}:");
phase=1;
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Writing"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Writing"));
pbvalue=currLine.count("#")*2;
ui->progressBar->setValue(pbvalue);
}
else if (avrphase=="r") {
if (phase==0) {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #00ff00; text-align:center;}:");
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Reading"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Reading"));
}
else {
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #0000ff; text-align:center;}:");
phase=2;
if(winTitle.isEmpty())
setWindowTitle(getProgrammer() + " - " + tr("Verifying"));
else
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Verifying"));
}
pbvalue=currLine.count("#")*2;
ui->progressBar->setValue(pbvalue);
}
}
if (currLine.contains("\n")) {
nlPos = currLine.lastIndexOf("\n");
currLine = currLine.mid(nlPos+1);
}
if (text.contains("-E-") && !text.contains("-E- No receive file name")) {
hasErrors = true;
}
addText(text);
}
#define HLINE_SEPARATOR "================================================================================="
void avrOutputDialog::doFinished(int code=0)
{
addText("\n" HLINE_SEPARATOR);
if (code==1 && getProgrammer()=="SAM-BA")
code=0;
if (code) {
ui->checkBox->setChecked(true);
addText("\n" + getProgrammer() + " " + tr("done - exit code %1").arg(code));
}
else if (hasErrors) {
ui->checkBox->setChecked(true);
addText("\n" + getProgrammer() + " " + tr("done with errors"));
}
else if (!cmdLine.isEmpty()) {
addText("\n" + getProgrammer() + " " + tr("done - SUCCESSFUL"));
}
else {
addText(tr("done - SUCCESSFUL"));
}
addText("\n" HLINE_SEPARATOR "\n");
if(lfuse || hfuse || efuse) {
addReadFuses();
}
switch(closeOpt)
{
case AVR_DIALOG_CLOSE_IF_SUCCESSFUL:
if (!hasErrors && !code) accept();
if (code) {
errorWizard();
}
break;
case AVR_DIALOG_FORCE_CLOSE:
if (hasErrors || code)
reject();
else
accept();
break;
case AVR_DIALOG_SHOW_DONE:
if (hasErrors || code) {
if (!cmdLine.isEmpty()) {
if (getProgrammer()!="AVRDUDE") {
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
}
else {
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
if (res != QMessageBox::No) {
errorWizard();
}
}
}
else {
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
}
// reject();
}
else {
if (!cmdLine.isEmpty()) {
ui->progressBar->setValue(ui->progressBar->maximum());
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
accept();
}
else {
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
accept();
}
}
break;
default: //AVR_DIALOG_KEEP_OPEN
break;
}
}
void avrOutputDialog::doProcessStarted()
{
addText(HLINE_SEPARATOR "\n");
addText(tr("Started") + " " + getProgrammer() + "\n");
addText(cmdLine);
addText("\n" HLINE_SEPARATOR "\n");
}
void avrOutputDialog::addReadFuses()
{
addText(HLINE_SEPARATOR "\n");
addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse,2,16,QChar('0')).arg(hfuse,2,16,QChar('0')).arg(efuse,2,16,QChar('0')));
addText("\n" HLINE_SEPARATOR "\n");
}
void avrOutputDialog::on_checkBox_toggled(bool checked)
{
if (checked) {
ui->plainTextEdit->show();
}
else {
ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
}
void avrOutputDialog::shrink()
{
resize(0,0);
}
void avrOutputDialog::forceClose()
{
accept();
}
+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
+115
View File
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>avrOutputDialog</class>
<widget class="QDialog" name="avrOutputDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>348</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<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="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>0</height>
</size>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Show Details</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>312</height>
</size>
</property>
<property name="font">
<font>
<family>Courier</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::WidgetWidth</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+448
View File
@@ -0,0 +1,448 @@
#include "burnconfigdialog.h"
#include "ui_burnconfigdialog.h"
#include "avroutputdialog.h"
#include "eeprominterface.h"
#include "helpers.h"
#include "appdata.h"
#include <QtGui>
#if !defined WIN32 && defined __GNUC__
#include <unistd.h>
#endif
burnConfigDialog::burnConfigDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::burnConfigDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("configure.png"));
ui->avrdude_programmer->model()->sort(0);
getSettings();
populateProgrammers();
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) {
setWindowTitle(tr("DFU-UTIL Configuration"));
ui->avrArgs->hide();
ui->avrdude_location->hide();
ui->avrdude_port->hide();
ui->avrdude_programmer->hide();
ui->label_av1->hide();
ui->label_av2->hide();
ui->label_av4->hide();
ui->label_av5->hide();
ui->pushButton->hide();
ui->pushButton_3->hide();
ui->pushButton_4->hide();
ui->label_sb1->hide();
ui->label_sb3->hide();
ui->samba_location->hide();
ui->samba_port->hide();
ui->sb_browse->hide();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
setWindowTitle(tr("SAM-BA Configuration"));
ui->avrArgs->hide();
ui->avrdude_location->hide();
ui->avrdude_port->hide();
ui->avrdude_programmer->hide();
ui->label_av1->hide();
ui->label_av2->hide();
ui->label_av4->hide();
ui->label_av5->hide();
ui->pushButton->hide();
ui->pushButton_3->hide();
ui->pushButton_4->hide();
ui->label_dfu1->hide();
ui->dfu_location->hide();
ui->dfu_browse->hide();
}
else {
setWindowTitle(tr("AVRDUDE Configuration"));
ui->label_sb1->hide();
ui->label_sb3->hide();
ui->samba_location->hide();
ui->samba_port->hide();
ui->sb_browse->hide();
ui->label_dfu1->hide();
ui->label_dfu2->hide();
ui->dfu_location->hide();
ui->dfu_browse->hide();
}
ui->label_av3->hide();
ui->avrdude_mcu->hide();
ui->label_sb2->hide();
ui->arm_mcu->hide();
ui->label_dfu2->hide();
ui->dfuArgs->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
connect(this,SIGNAL(accepted()),this,SLOT(putSettings()));
}
burnConfigDialog::~burnConfigDialog()
{
delete ui;
}
void burnConfigDialog::getSettings()
{
avrLoc = g.avrdudeLocation();
sambaLoc = g.sambaLocation();
dfuLoc = g.dfuLocation();
#if defined WIN32 || !defined __GNUC__
if ( avrLoc.isEmpty())
avrLoc = QFileInfo("avrdude.exe").absoluteFilePath();
if ( sambaLoc.isEmpty())
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
if ( dfuLoc.isEmpty())
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
#elif defined __APPLE__
if ( avrLoc.isEmpty())
avrLoc = "/usr/local/bin/avrdude";
if ( sambaLoc.isEmpty())
sambaLoc = "/usr/local/bin/sam-ba";
if ( dfuLoc.isEmpty())
dfuLoc = QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath();
#else
if ( avrLoc.isEmpty())
avrLoc = "/usr/bin/avrdude";
if ( sambaLoc.isEmpty())
sambaLoc = "/usr/bin/sam-ba";
if ( dfuLoc.isEmpty())
dfuLoc = QFileInfo("/usr/bin/dfu-util").absoluteFilePath();
#endif
dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts);
avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts);
avrProgrammer = g.programmer();
avrPort = g.avrPort();
avrMCU = g.mcu();
armMCU = g.armMcu();
sambaPort = g.sambaPort();
ui->avrdude_location->setText(getAVRDUDE());
ui->avrArgs->setText(getAVRArgs().join(" "));
ui->samba_location->setText(getSAMBA());
ui->samba_port->setText(getSambaPort());
ui->dfu_location->setText(getDFU());
ui->dfuArgs->setText(getDFUArgs().join(" "));
int idx1 = ui->avrdude_programmer->findText(getProgrammer());
int idx2 = ui->avrdude_port->findText(getPort());
int idx3 = ui->avrdude_mcu->findText(getMCU());
int idx4 = ui->arm_mcu->findText(getArmMCU());
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
if(idx2>=0) ui->avrdude_port->setCurrentIndex(idx2);
if(idx3>=0) ui->avrdude_mcu->setCurrentIndex(idx3);
if(idx4>=0) ui->arm_mcu->setCurrentIndex(idx4);
QFile file;
if (file.exists(avrLoc)) {
ui->pushButton_3->setEnabled(true);
} else {
ui->pushButton_3->setDisabled(true);
}
}
void burnConfigDialog::putSettings()
{
g.avrdudeLocation( avrLoc );
g.programmer( avrProgrammer);
g.mcu( avrMCU );
g.avrPort( avrPort );
g.avrArguments( avrArgs.join(" ") );
g.sambaLocation( sambaLoc );
g.sambaPort( sambaPort );
g.armMcu( armMCU );
g.dfuLocation( dfuLoc );
g.dfuArguments( dfuArgs.join(" ") );
}
void burnConfigDialog::populateProgrammers()
{
QString fileName = QFileInfo(avrLoc).canonicalPath() + "/avrdude.conf"; //for windows
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude.conf"; //for linux
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude/avrdude.conf"; //for linux
if(!QFileInfo(fileName).exists()) return; // not found avrdude.conf - returning
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return;
QStringList items;
QString line = "";
QString prevline = "";
QTextStream in(&file);
while (!in.atEnd())
{
prevline = line;
line = in.readLine();
if(prevline.left(10).toLower()=="programmer")
items << line.section('"',1,1);
}
file.close();
items.sort();
QString avrProgrammer_temp = avrProgrammer;
ui->avrdude_programmer->clear();
ui->avrdude_programmer->addItems(items);
int idx1 = ui->avrdude_programmer->findText(avrProgrammer_temp);
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
}
void burnConfigDialog::on_avrdude_programmer_currentIndexChanged(QString )
{
avrProgrammer = ui->avrdude_programmer->currentText();
}
void burnConfigDialog::on_avrdude_mcu_currentIndexChanged(QString )
{
avrMCU = ui->avrdude_mcu->currentText();
}
void burnConfigDialog::on_avrdude_location_editingFinished()
{
avrLoc = ui->avrdude_location->text();
if (avrLoc.isEmpty()) {
ui->pushButton_3->setDisabled(true);
} else {
QFile file;
if (file.exists(avrLoc)) {
ui->pushButton_3->setEnabled(true);
}
}
}
void burnConfigDialog::on_avrArgs_editingFinished()
{
avrArgs = ui->avrArgs->text().split(" ", QString::SkipEmptyParts);
}
void burnConfigDialog::on_avrdude_port_currentIndexChanged(QString )
{
avrPort = ui->avrdude_port->currentText();
}
void burnConfigDialog::on_samba_location_editingFinished()
{
sambaLoc = ui->samba_location->text();
}
void burnConfigDialog::on_samba_port_editingFinished()
{
sambaPort = ui->samba_port->text();
}
void burnConfigDialog::on_arm_mcu_currentIndexChanged(QString )
{
armMCU = ui->arm_mcu->currentText();
}
void burnConfigDialog::on_pushButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->avrdude_location->text());
if(!fileName.isEmpty())
{
ui->avrdude_location->setText(fileName);
avrLoc = fileName;
}
}
void burnConfigDialog::on_sb_browse_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->samba_location->text());
if(!fileName.isEmpty())
{
ui->samba_location->setText(fileName);
sambaLoc = fileName;
}
}
void burnConfigDialog::on_dfu_browse_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->dfu_location->text());
if(!fileName.isEmpty())
{
ui->dfu_location->setText(fileName);
dfuLoc = fileName;
}
}
void burnConfigDialog::on_dfu_location_editingFinished()
{
dfuLoc = ui->dfu_location->text();
}
void burnConfigDialog::on_dfuArgs_editingFinished()
{
dfuArgs = ui->dfuArgs->text().split(" ", QString::SkipEmptyParts);
}
void burnConfigDialog::listProgrammers()
{
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;
}
void burnConfigDialog::on_pushButton_3_clicked()
{
listProgrammers();
}
void burnConfigDialog::on_pushButton_4_clicked()
{
QStringList arguments;
arguments << "-?";
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("configure.png"));
ad->show();
delete ad;
}
void burnConfigDialog::readFuses()
{
QStringList args = avrArgs;
if(!avrPort.isEmpty()) args << "-P" << avrPort;
QStringList str;
str << "-U" << "lfuse:r:-:i" << "-U" << "hfuse:r:-:i" << "-U" << "efuse:r:-:i";
QStringList arguments;
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->show();
delete ad;
}
void burnConfigDialog::restFuses(bool eeProtect)
{
//fuses
//avrdude -c usbasp -p m64 -U lfuse:w:<0x0E>:m
//avrdude -c usbasp -p m64 -U hfuse:w:<0x89>:m 0x81 for eeprom protection
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
QMessageBox::StandardButton ret = QMessageBox::No;
ret = QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes)
{
QStringList args = avrArgs;
if(!avrPort.isEmpty()) args << "-P" << avrPort;
QStringList str;
if (avrMCU=="m2560") {
args << "-B8";
QString erStr = eeProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
else {
QString tempDir = QDir::tempPath();
QString tempFile;
QString lfuses;
tempFile = tempDir + "/ftemp.bin";
QStringList argread;
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->exec();
delete ad;
QFile file(tempFile);
if (file.exists() && file.size()==1) {
file.open(QIODevice::ReadOnly);
char bin_flash[1];
file.read(bin_flash, 1);
if (bin_flash[0]==0x0E) {
lfuses="lfuse:w:0x0E:m";
}
else {
lfuses="lfuse:w:0x3F:m";
}
file.close();
unlink(tempFile.toAscii());
}
else {
lfuses="lfuse:w:0x3F:m";
}
QString erStr = eeProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
QStringList arguments;
if (avrMCU=="m2560") {
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-u" << str;
}
else {
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
}
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
ad->setWindowIcon(CompanionIcon("fuses.png"));
ad->show();
delete ad;
}
}
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
{
EEPROMInterface *eepromInterface = GetEepromInterface();
if (checked) {
if (IS_TARANIS(eepromInterface->getBoard())) {
ui->label_dfu2->show();
ui->dfuArgs->show();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
ui->label_sb2->show();
ui->arm_mcu->show();
}
else {
ui->label_av3->show();
ui->avrdude_mcu->show();
QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent."),
QMessageBox::Ok);
}
}
else {
if (IS_TARANIS(eepromInterface->getBoard())) {
ui->label_dfu2->hide();
ui->dfuArgs->hide();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
ui->label_sb2->hide();
ui->arm_mcu->hide();
}
else {
ui->label_av3->hide();
ui->avrdude_mcu->hide();
}
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
void burnConfigDialog::shrink()
{
resize(0,0);
}
+76
View File
@@ -0,0 +1,76 @@
#ifndef BURNCONFIGDIALOG_H
#define BURNCONFIGDIALOG_H
#include <QDialog>
#include <QtGui>
#define MEM_TYPE_EEPROM 1
#define MEM_TYPE_FLASH 2
#define OPR_TYPE_READ 1
#define OPR_TYPE_WRITE 2
namespace Ui {
class burnConfigDialog;
}
class burnConfigDialog : public QDialog {
Q_OBJECT
public:
burnConfigDialog(QWidget *parent = 0);
~burnConfigDialog();
QString getAVRDUDE() {return avrLoc;}
QString getSAMBA() {return sambaLoc;}
QString getDFU() {return dfuLoc;}
QStringList getAVRArgs() {return avrArgs;}
QStringList getDFUArgs() {return dfuArgs;}
QString getProgrammer() {return avrProgrammer;}
QString getMCU() {return avrMCU;}
QString getArmMCU() {return armMCU;}
QString getPort() {return avrPort;}
QString getSambaPort() {return sambaPort;}
void listProgrammers();
void restFuses(bool eeProtect);
void readFuses();
private:
Ui::burnConfigDialog *ui;
void populateProgrammers();
QString avrLoc;
QString sambaLoc;
QString dfuLoc;
QStringList avrArgs;
QString avrProgrammer;
QString avrMCU;
QString armMCU;
QString avrPort;
QString sambaPort;
QStringList dfuArgs;
private slots:
void shrink();
void on_avrArgs_editingFinished();
void on_pushButton_4_clicked();
void on_pushButton_3_clicked();
void on_pushButton_clicked();
void on_avrdude_location_editingFinished();
void on_avrdude_programmer_currentIndexChanged(QString );
void on_avrdude_mcu_currentIndexChanged(QString );
void on_avrdude_port_currentIndexChanged(QString );
void on_samba_location_editingFinished();
void on_samba_port_editingFinished();
void on_arm_mcu_currentIndexChanged(QString );
void on_sb_browse_clicked();
void on_dfu_browse_clicked();
void on_dfu_location_editingFinished();
void on_dfuArgs_editingFinished();
void on_advCtrChkB_toggled(bool checked);
void getSettings();
void putSettings();
};
#endif // BURNCONFIGDIALOG_H
+859
View File
@@ -0,0 +1,859 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>burnConfigDialog</class>
<widget class="QDialog" name="burnConfigDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<height>335</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>531</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Programmer Configuration</string>
</property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="9" column="2">
<widget class="QLineEdit" name="dfu_location">
<property name="toolTip">
<string>Location of sam-ba executable</string>
</property>
<property name="whatsThis">
<string>The location of the AVRDUDE executable.</string>
</property>
<property name="text">
<string notr="true">dfu-util</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_dfu1">
<property name="text">
<string>DFU-Util Location</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="avrdude_location">
<property name="toolTip">
<string>Location of AVRDUDE executable</string>
</property>
<property name="whatsThis">
<string>The location of the AVRDUDE executable.</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="4" rowspan="2">
<widget class="QPushButton" name="pushButton">
<property name="whatsThis">
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_av2">
<property name="text">
<string>Programmer</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="avrdude_programmer">
<property name="whatsThis">
<string>Programmer used for communicating with the controller.
Please consult the programmer's documentation and the AVRDUDE documentation to select the appropriate programmer.</string>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAlphabetically</enum>
</property>
<item>
<property name="text">
<string notr="true">c2n232i</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dasa3</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dasa</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">siprog</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">ponyser</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">89isp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">frank-stk200</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">blaster</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">ere-isp-avr</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">atisp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dapa</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">xil</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">futurlec</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">abcmini</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">picoweb</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">sp12</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">alf</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">bascom</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dt006</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">pony-stk200</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk200</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">bsd</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">pavr</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_pdi</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_dw</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_hvsp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_pp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_isp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">dragon_jtag</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2pdi</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2avr32</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtagmkII_avr32</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2dw</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2isp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2fast</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag2slow</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtagmkII</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag1slow</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtag1</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">jtagmkI</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avr911</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avr109</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">butterfly</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">usbtiny</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">usbasp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avr910</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk600hvsp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk600pp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk600</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk500hvsp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk500pp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk500v2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">mib510</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk500v1</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">stk500</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">buspirate</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avrisp2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avrispmkII</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avrispv2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avrisp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">arduino</string>
</property>
</item>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="pushButton_3">
<property name="whatsThis">
<string>List all available programmers.</string>
</property>
<property name="text">
<string>List Available</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="avrArgs">
<property name="toolTip">
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
</property>
<property name="whatsThis">
<string>Extra arguments used in AVRDUDE.
This can be used for providing extra information to AVRDUDE.
Please only use this if you know what you are doing. There are no error checks and you could cripple your controller.</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_av5">
<property name="text">
<string>Extra Arguments</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="pushButton_4">
<property name="whatsThis">
<string>Show AVRDUDE help</string>
</property>
<property name="text">
<string>Show Help</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="avrdude_port">
<property name="whatsThis">
<string>Communication port to the programmer.
</string>
</property>
<item>
<property name="text">
<string notr="true"/>
</property>
</item>
<item>
<property name="text">
<string notr="true">usb</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com1</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com3</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com4</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com5</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com6</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com7</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com8</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com9</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com10</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com11</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com12</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com13</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com14</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">com15</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">lpt1</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">lpt2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">lpt3</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">lpt4</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">avrdoper</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">/dev/ttyUSB0</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">/dev/ttyUSB1</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_av4">
<property name="text">
<string>Port</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_av1">
<property name="text">
<string>AVRDUDE Location</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_av3">
<property name="text">
<string>MCU</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="avrdude_mcu">
<property name="toolTip">
<string>CPU of your TX</string>
</property>
<property name="whatsThis">
<string>CPU present on your 9x radio
Should be m64 for stock radios
m2560 for v4.1 boards</string>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAlphabetically</enum>
</property>
<item>
<property name="text">
<string notr="true">m64</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">m128</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">m2560</string>
</property>
</item>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="arm_mcu">
<property name="toolTip">
<string>CPU of your TX</string>
</property>
<property name="whatsThis">
<string>CPU present on your 9x radio
Should be m64 for stock radios
m2560 for v4.1 boards</string>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAlphabetically</enum>
</property>
<item>
<property name="text">
<string notr="true">at91sam3s4-9x</string>
</property>
</item>
<item>
<property name="text">
<string>at91sam3s8-9xr</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_sb1">
<property name="text">
<string>SAM-BA Location</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLineEdit" name="samba_location">
<property name="toolTip">
<string>Location of sam-ba executable</string>
</property>
<property name="whatsThis">
<string>The location of the AVRDUDE executable.</string>
</property>
<property name="text">
<string notr="true">sam-ba.exe</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_sb2">
<property name="text">
<string>ARM MCU</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_sb3">
<property name="text">
<string>Port</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLineEdit" name="samba_port">
<property name="toolTip">
<string>sam-ba serial port</string>
</property>
<property name="whatsThis">
<string>The location of the AVRDUDE executable.</string>
</property>
<property name="text">
<string notr="true">\USBserial\COM23</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_dfu2">
<property name="text">
<string>Alternate device</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QLineEdit" name="dfuArgs">
<property name="toolTip">
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
</property>
<property name="whatsThis">
<string>Extra arguments used in AVRDUDE.
This can be used for providing extra information to AVRDUDE.
Please only use this if you know what you are doing. There are no error checks and you could cripple your controller.</string>
</property>
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QPushButton" name="sb_browse">
<property name="whatsThis">
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="QPushButton" name="dfu_browse">
<property name="whatsThis">
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QCheckBox" name="advCtrChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Use advanced controls</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
<tabstop>avrdude_location</tabstop>
<tabstop>pushButton</tabstop>
<tabstop>avrdude_programmer</tabstop>
<tabstop>pushButton_3</tabstop>
<tabstop>avrdude_mcu</tabstop>
<tabstop>avrdude_port</tabstop>
<tabstop>avrArgs</tabstop>
<tabstop>pushButton_4</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>burnConfigDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>burnConfigDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+620
View File
@@ -0,0 +1,620 @@
#include "burndialog.h"
#include "ui_burndialog.h"
#include <QtGui>
#include "eeprominterface.h"
#include "helpers.h"
#include "splashlibrary.h"
#include "flashinterface.h"
#include "hexinterface.h"
#include "appdata.h"
// Type 1 = Burn EEPROM, Type 2= Burn Flash
burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName):
QDialog(parent),
ui(new Ui::burnDialog),
hexfileName(fileName),
backup(backupEE),
hexType(Type)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("write_flash.png"));
if (!g.profile[g.id()].splashFile().isEmpty()){
imageSource=PROFILE;
imageFile=g.profile[g.id()].splashFile();
}
else {
ui->useProfileImageCB->setDisabled(true);
imageSource=FIRMWARE;
imageFile="";
}
ui->SplashFrame->hide();
ui->FramFWInfo->hide();
ui->EEbackupCB->hide();
ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked);
if (Type == FLASH_FILE_TYPE ) {
ui->EEpromCB->hide();
ui->profile_label->hide();
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
setWindowTitle(tr("Write firmware to Radio"));
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->hide();
}
}
else {
ui->FlashLoadButton->setText(tr("Browse for file"));
ui->profile_label->hide();
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
ui->EEpromCB->hide();
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
ui->versionField->clear();
ui->ModField->clear();
ui->FramFWInfo->hide();
ui->SplashFrame->hide();
ui->BurnFlashButton->setDisabled(true);
ui->EEbackupCB->hide();
if (DocName.isEmpty()) {
setWindowTitle(tr("Write Backup to Radio"));
}
else {
setWindowTitle(tr("Write Backup from %1 to Radio").arg(DocName));
}
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
}
if (!hexfileName->isEmpty()) {
ui->FWFileName->setText(*hexfileName);
if (Type==FLASH_FILE_TYPE) {
checkFw(*hexfileName);
}
else {
burnraw=false;
if (checkeEprom(*hexfileName)) {
QString Name = g.profile[g.id()].name();
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
QString DisplaySet = g.profile[g.id()].display();
QString BeeperSet = g.profile[g.id()].beeper();
QString HapticSet = g.profile[g.id()].haptic();
QString SpeakerSet = g.profile[g.id()].speaker();
if (!Name.isEmpty()) {
ui->profile_label->show();
ui->patchcalib_CB->show();
ui->patchhw_CB->show();
// TODO I hardcode the number of pots here, should be dependant on the board?
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
ui->patchcalib_CB->setDisabled(true);
}
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
ui->patchhw_CB->setDisabled(true);
}
}
else {
ui->profile_label->hide();
}
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEpromCB->show();
}
else {
ui->EEpromCB->setChecked(false);
}
ui->BurnFlashButton->setEnabled(true);
}
}
ui->FWFileName->hide();
ui->FlashLoadButton->hide();
hexfileName->clear();
}
else if (Type==FLASH_FILE_TYPE) {
QString FileName = g.profile[g.id()].fwName();
QFile file(FileName);
if (file.exists()) {
checkFw(FileName);
}
}
updateUI();
resize(0, 0);
}
burnDialog::~burnDialog()
{
delete ui;
}
void burnDialog::on_FlashLoadButton_clicked()
{
QString fileName;
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
ui->versionField->clear();
ui->ModField->clear();
ui->FramFWInfo->hide();
ui->SplashFrame->hide();
ui->BurnFlashButton->setDisabled(true);
ui->EEbackupCB->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
if (hexType==FLASH_FILE_TYPE) {
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if(fileName.isEmpty())
return;
checkFw(fileName);
}
else {
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
if (checkeEprom(fileName)) {
if (burnraw==false) {
ui->BurnFlashButton->setEnabled(true);
ui->profile_label->show();
ui->patchcalib_CB->show();
ui->patchhw_CB->show();
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEpromCB->show();
}
else {
ui->EEpromCB->setChecked(false);
}
}
else {
ui->BurnFlashButton->setEnabled(true);
ui->profile_label->hide();
ui->patchcalib_CB->setChecked(false);
ui->patchhw_CB->setChecked(false);
ui->patchhw_CB->hide();
ui->patchcalib_CB->hide();
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
}
updateUI();
}
void burnDialog::checkFw(QString fileName)
{
if (fileName.isEmpty()) {
return;
}
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->show();
}
else {
ui->EEbackupCB->setChecked(false);
*backup=false;
}
ui->FWFileName->setText(fileName);
FlashInterface flash(fileName);
if (flash.isValid()) {
ui->FramFWInfo->show();
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
ui->versionField->setText(flash.getVersion());
ui->ModField->setText(flash.getEEpromId());
ui->SplashFrame->hide();
if (flash.hasSplash()) {
ui->SplashFrame->show();
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
}
}
else {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
}
ui->BurnFlashButton->setEnabled(true);
QTimer::singleShot(0, this, SLOT(shrink()));
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
bool burnDialog::checkeEprom(QString fileName)
{
if (fileName.isEmpty()) {
return false;
}
QFile file(fileName);
if (!file.exists()) {
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
return false;
}
burnraw=false;
int fileType = getFileType(fileName);
#if 0
if (fileType==FILE_TYPE_XML) {
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
QTextStream inputStream(&file);
XmlInterface(inputStream).load(radioData);
}
else
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (!LoadEepromXml(radioData, doc)){
return false;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
QString hline = inputStream.readLine();
if (hline!=EEPE_EEPROM_FILE_HEADER) {
file.close();
return false;
}
}
uint8_t eeprom[EESIZE_RLC_MAX];
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
if (!eeprom_size) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
ui->FWFileName->setText(fileName);
return true;
}
file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
ui->FWFileName->setText(fileName);
return true;
}
}
else if (fileType==FILE_TYPE_BIN) { //read binary
int eeprom_size = file.size();
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
uint8_t *eeprom = (uint8_t *)malloc(eeprom_size);
memset(eeprom, 0, eeprom_size);
long result = file.read((char*)eeprom, eeprom_size);
file.close();
if (result != eeprom_size) {
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
return false;
}
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
burnraw=true;
}
}
ui->FWFileName->setText(fileName);
return true;
}
void burnDialog::displaySplash()
{
QImage image;
if (imageSource == FIRMWARE){
FlashInterface flash(ui->FWFileName->text());
image = flash.getSplash();
}
else {
image.load(imageFile);
}
if (image.isNull()) {
return;
}
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
}
void burnDialog::updateUI()
{
if (hexType==EEPROM_FILE_TYPE)
return;
ui->useProfileImageCB->setChecked( imageSource == PROFILE );
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
displaySplash();
}
void burnDialog::on_useFwImageCB_clicked()
{
QString fileName = ui->FWFileName->text();
FlashInterface flash(fileName);
if (!flash.isValid()) {
QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." ));
}
else {
if (!flash.hasSplash()) {
QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
}
else{
imageSource = FIRMWARE;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useProfileImageCB_clicked()
{
QString fileName = g.profile[g.id()].splashFile();
if (!fileName.isEmpty()){
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
}
else {
imageSource = PROFILE;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useAnotherImageCB_clicked()
{
QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
}
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()){
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
}
else{
imageSource = ANOTHER;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_useLibraryImageCB_clicked()
{
QString fileName;
splashLibrary *ld = new splashLibrary(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
}
else{
imageSource = LIBRARY;
imageFile = fileName;
}
}
updateUI();
}
void burnDialog::on_BurnFlashButton_clicked()
{
if (hexType==FLASH_FILE_TYPE) {
QString fileName=ui->FWFileName->text();
if (!fileName.isEmpty()) {
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
if (!ui->useFwImageCB->isChecked()) {
const QPixmap * pixmap = ui->imageLabel->pixmap();
QImage image;
if (pixmap) {
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
}
if (!image.isNull()) {
QString tempDir = QDir::tempPath();
QString tempFile;
if (getFileType(fileName) == FILE_TYPE_HEX)
tempFile = tempDir + "/flash.hex";
else
tempFile = tempDir + "/flash.bin";
FlashInterface flash(fileName);
flash.setSplash(image);
if (flash.saveFlash(tempFile) > 0) {
hexfileName->clear();
hexfileName->append(tempFile);
}
else {
hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
}
}
else {
hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
}
}
else {
hexfileName->clear();
hexfileName->append(fileName);
}
}
else {
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
hexfileName->clear();
}
}
if (hexType==EEPROM_FILE_TYPE) {
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
QString DisplaySet= g.profile[g.id()].display();
QString BeeperSet= g.profile[g.id()].beeper();
QString HapticSet= g.profile[g.id()].haptic();
QString SpeakerSet= g.profile[g.id()].speaker();
bool patch=false;
if (ui->patchcalib_CB->isChecked()) {
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
QString Byte;
int16_t byte16;
bool ok;
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
Byte=calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibMid[i]=byte16;
Byte=calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibSpanNeg[i]=byte16;
Byte=calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.calibSpanPos[i]=byte16;
}
for (int i=0; i<4; i++) {
Byte=trainercalib.mid(i*4,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
radioData.generalSettings.trainer.calib[i]=byte16;
}
radioData.generalSettings.currentCalib=currentCalib;
radioData.generalSettings.vBatCalib=vBatCalib;
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
patch=true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
}
}
if (ui->patchhw_CB->isChecked()) {
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
radioData.generalSettings.vBatWarn=vBatWarn;
radioData.generalSettings.stickMode=GSStickMode;
uint8_t byte8u;
int8_t byte8;
bool ok;
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.contrast=byte8u;
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.backlightBright=byte8u;
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.beeperMode=(BeeperMode)byte8u;
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.beeperLength=byte8;
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.hapticMode=(BeeperMode)byte8u;
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.hapticStrength=byte8u;
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
if (ok)
radioData.generalSettings.hapticLength=byte8;
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerMode=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerPitch=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok)
radioData.generalSettings.speakerVolume=byte8u;
patch=true;
}
else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
}
QString fileName;
if (patch) {
QString tempDir = QDir::tempPath();
fileName = tempDir + "/temp.bin";
QFile file(fileName);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = 0;
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant());
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
hexfileName->clear();
}
if (!file.open(QIODevice::WriteOnly)) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
hexfileName->clear();
}
QTextStream outputStream(&file);
long result = file.write((char*)eeprom, eeprom_size);
if (result!=eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(fileName).arg(file.errorString()));
hexfileName->clear();
}
hexfileName->clear();
hexfileName->append(fileName);
}
else {
hexfileName->clear();
hexfileName->append(ui->FWFileName->text());
}
}
else {
hexfileName->clear();
hexfileName->append(ui->FWFileName->text());
}
}
this->close();
}
void burnDialog::on_cancelButton_clicked()
{
hexfileName->clear();
this->close();
}
void burnDialog::on_EEpromCB_toggled(bool checked)
{
*backup = ui->EEpromCB->isChecked();
}
void burnDialog::shrink()
{
resize(0,0);
}
void burnDialog::on_EEbackupCB_clicked()
{
*backup = ui->EEbackupCB->isChecked();
}
+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
+379
View File
@@ -0,0 +1,379 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>burnDialog</class>
<widget class="QDialog" name="burnDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>399</width>
<height>564</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Customize Splash</string>
</property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="hs2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="BurnFlashButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Write to TX</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="5" column="0">
<widget class="QCheckBox" name="patchcalib_CB">
<property name="toolTip">
<string>&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">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
<tabstop>BurnFlashButton</tabstop>
<tabstop>FWFileName</tabstop>
<tabstop>FlashLoadButton</tabstop>
<tabstop>versionField</tabstop>
<tabstop>ModField</tabstop>
<tabstop>useProfileImageCB</tabstop>
<tabstop>useFwImageCB</tabstop>
<tabstop>useLibraryImageCB</tabstop>
<tabstop>useAnotherImageCB</tabstop>
<tabstop>EEbackupCB</tabstop>
<tabstop>patchcalib_CB</tabstop>
<tabstop>patchhw_CB</tabstop>
<tabstop>EEpromCB</tabstop>
<tabstop>cancelButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+67
View File
@@ -0,0 +1,67 @@
# Find libphonon
# Once done this will define
#
# PHONON_FOUND - system has Phonon Library
# PHONON_INCLUDES - the Phonon include directory
# PHONON_LIBS - link these to use Phonon
# PHONON_VERSION - the version of the Phonon Library
# Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro(_phonon_find_version)
file(READ "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h" _phonon_header LIMIT 5000 OFFSET 1000)
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
set(PHONON_VERSION "${CMAKE_MATCH_1}")
message(STATUS "Phonon Version: ${PHONON_VERSION}")
endmacro(_phonon_find_version)
if(PHONON_FOUND)
# Already found, nothing more to do except figuring out the version
_phonon_find_version()
else(PHONON_FOUND)
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_FIND_QUIETLY TRUE)
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
# As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir)
find_library(PHONON_LIBRARY NAMES phonon phonon4 PATHS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
# then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
find_library(PHONON_LIBRARY NAMES phonon)
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
set(PHONON_FOUND TRUE)
_phonon_find_version()
else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_FOUND FALSE)
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
if(PHONON_FOUND)
if(NOT PHONON_FIND_QUIETLY)
message(STATUS "Found Phonon: ${PHONON_LIBRARY}")
message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}")
endif(NOT PHONON_FIND_QUIETLY)
else(PHONON_FOUND)
if(Phonon_FIND_REQUIRED)
if(NOT PHONON_INCLUDE_DIR)
message(STATUS "Phonon includes NOT found!")
endif(NOT PHONON_INCLUDE_DIR)
if(NOT PHONON_LIBRARY)
message(STATUS "Phonon library NOT found!")
endif(NOT PHONON_LIBRARY)
message(FATAL_ERROR "Phonon library or includes NOT found!")
else(Phonon_FIND_REQUIRED)
message(STATUS "Unable to find Phonon")
endif(Phonon_FIND_REQUIRED)
endif(PHONON_FOUND)
mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES)
endif(PHONON_FOUND)
+165
View File
@@ -0,0 +1,165 @@
# - Locate the SDL library
# This module defines
# SDL_LIBRARY, the library to link against
# 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
# 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
# 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).
# 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
# SDL_LIBRARY to override this selection.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD).
FIND_PATH(SDL_INCLUDE_DIR SDL.h
$ENV{SDLDIR}/include
~/Library/Frameworks/SDL.framework/Headers
/Library/Frameworks/SDL.framework/Headers
/usr/local/include/SDL
/usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
/usr/local/include
/usr/include
/sw/include/SDL # Fink
/sw/include
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/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
# unlikely that other Unix systems will find the framework path.
# 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.
# Remember that the OS X framework version expects you to drop in
# SDLmain.h and SDLmain.m directly into your project.
# (Cocoa link moved to bottom of this script.)
# SET (SDL_LIBRARY "-framework SDL -framework Cocoa" CACHE STRING "SDL framework for OSX")
# SET(SDL_LIBRARY "-framework SDL" CACHE STRING "SDL framework for OSX")
# Extract the path the framework resides in so we can use it for the -F flag
STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDL_FRAMEWORK_PATH_TEMP ${SDL_INCLUDE_DIR})
IF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# String is in default search path, don't need to use -F
SET(SDL_LIBRARY_TEMP "-framework SDL")
ELSE("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# String is not /Library/Frameworks, need to use -F
SET(SDL_LIBRARY_TEMP "-F${SDL_FRAMEWORK_PATH_TEMP} -framework SDL")
ENDIF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# Clear the temp variable so nobody can see it
SET(SDL_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "")
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
NAMES SDL SDL-1.1
PATHS
$ENV{SDLDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
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
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
PATHS
$ENV{SDLDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/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.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP)
# For SDLmain
IF(SDLMAIN_LIBRARY)
SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${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
# 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.
IF(NOT APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
+68
View File
@@ -0,0 +1,68 @@
# Find Xerces-C
# The following setings are defined
# XERCESC_ROOT_DIR, the root of the include and lib directory
# XERCESC_INCLUDE_DIR, the full path of the include dir (ADVANCED)
# XERCESC_LIBRARIES, the name of the xerces-c library (ADVANCED)
# Look for a root installation
IF( MSVC )
SET( XERCES_WINDIR C:/Programs/xerces-vc )
ELSE( )
SET( XERCES_WINDIR C:/Programs/xerces )
ENDIF( )
FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
${XERCES_WINDIR}
"C:/mingw/msys/1.0/local"
"C:/Program Files/CodeSynthesis XSD 3.2"
/usr
/usr/local
"C:/MinGW"
$ENV{CODESYNTH}
DOC "The root of an installed xerces-c installation"
)
# try to find the header
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
${XERCESC_ROOT_DIR}/include
/usr/include
/usr/local/include
)
# Find the library
FIND_LIBRARY(XERCESC_LIBRARY
NAMES xerces-c xerces-c_3
PATHS
${XERCESC_ROOT_DIR}/lib
${XERCESC_ROOT_DIR}/lib/vc-9.0
${XERCESC_ROOT_DIR}/lib64/vc-9.0
/usr/lib
/usr/local/lib
DOC "The name of the xerces-c library"
)
IF (XERCESC_ROOT_DIR)
IF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
SET (XERCESC_FOUND TRUE)
SET (XERCESC_LIBRARIES "${XERCESC_LIBRARY}")
# FIXME: There should be a better way of handling this?
# FIXME: How can we test to see if the lib dir isn't
# FIXME: one of the default dirs?
LINK_DIRECTORIES(${XERCESC_ROOT_DIR}/lib)
ENDIF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
ENDIF (XERCESC_ROOT_DIR)
IF (XERCESC_FOUND)
IF (NOT XERCESC_FIND_QUIETLY)
MESSAGE (STATUS " found xerces-c: ${XERCESC_LIBRARY}")
ENDIF (NOT XERCESC_FIND_QUIETLY)
ELSE (XERCESC_FOUND)
IF (XERCESC_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Xerces-C")
ENDIF (XERCESC_FIND_REQUIRED)
ENDIF (XERCESC_FOUND)
MARK_AS_ADVANCED(
XERCESC_INCLUDE_DIR
XERCESC_LIBRARY
)
+52
View File
@@ -0,0 +1,52 @@
# Locate Xsd from code synthesis include paths and binary
# Xsd can be found at http://codesynthesis.com/products/xsd/
# Written by Frederic Heem, frederic.heem _at_ telsey.it
# This module defines
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
# XSD_EXECUTABLE, where is the xsd compiler
# XSD_FOUND, If false, don't try to use xsd
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
"C:/Programs/xsd-3.3.0/libxsd"
"C:/Program Files/CodeSynthesis XSD 3.2/include"
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
$ENV{XSDDIR}/include
$ENV{CODESYNTH}/include
/usr/local/include /usr/include
)
IF( WIN32 )
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
ELSE( )
SET( XSDCXX_FILENAME1 xsdcxx )
SET( XSDCXX_FILENAME2 xsd )
ENDIF( )
FIND_PROGRAM( XSDCXX_EXECUTABLE
NAMES
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
PATHS
"/opt/local/xsd-3.3.0-i686-macosx/bin"
"C:/Programs/xsd-3.3.0/bin"
"C:/mingw/xsd-3.3.0-i686-windows/bin"
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
)
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
# if the include and the program are found then we have it
IF( XSD_INCLUDE_DIR )
IF( XSDCXX_EXECUTABLE )
SET( XSD_FOUND "YES" )
ENDIF( XSDCXX_EXECUTABLE )
ENDIF( XSD_INCLUDE_DIR )
MARK_AS_ADVANCED(
XSD_INCLUDE_DIR
XSDCXX_EXECUTABLE
)
+132
View File
@@ -0,0 +1,132 @@
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QApplication>
#include <QTranslator>
#include <QLocale>
#include <QString>
#include <QDir>
#include <QFileInfo>
#include <QSplashScreen>
#include <QThread>
#include <iostream>
#include "mainwindow.h"
#include "eeprominterface.h"
#include "appdata.h"
#if defined WIN32 || !defined __GNUC__
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#endif
#ifdef __APPLE__
#include <QProxyStyle>
class MyProxyStyle : public QProxyStyle
{
public:
void polish ( QWidget * w ) {
QMenu* mn = dynamic_cast<QMenu*>(w);
QPushButton* pb = dynamic_cast<QPushButton*>(w);
if(!(mn || pb) && !w->testAttribute(Qt::WA_MacNormalSize))
w->setAttribute(Qt::WA_MacSmallSize);
}
};
#endif
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);
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
QTranslator companionTranslator;
companionTranslator.load(":/companion_" + g.locale());
QTranslator qtTranslator;
qtTranslator.load((QString)"qt_" + g.locale().left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant.id);
g.profile[g.id()].fwName("");
}
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
RegisterEepromInterfaces();
registerOpenTxFirmwares();
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
MainWindow *mainWin = new MainWindow();
if (g.showSplash()) {
splash->show();
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
}
else {
mainWin->show();
}
int result = app.exec();
delete splash;
delete mainWin;
UnregisterFirmwares();
UnregisterEepromInterfaces();
return result;
}
+11
View File
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Companion
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=companion
Exec='companion'
Terminal=false
StartupNotify=false
Categories=Application
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
#ifndef COMPAREDIALOG_H
#define COMPAREDIALOG_H
#include <QDialog>
#include <QtGui>
#include <QDir>
#include "eeprominterface.h"
namespace Ui {
class CompareDialog;
}
class CompareDialog : public QDialog
{
Q_OBJECT
public:
CompareDialog(QWidget *parent);
~CompareDialog();
protected:
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);
QTextEdit * te;
QString curvefile5;
QString curvefile9;
QDir *qd;
private slots:
void on_printButton_clicked();
void on_printFileButton_clicked();
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
+148
View File
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CompareDialog</class>
<widget class="QDialog" name="CompareDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>580</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>780</width>
<height>0</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="windowTitle">
<string>Compare Models</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_1">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color:green;</string>
</property>
<property name="text">
<string>Drag first model here</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color:red;</string>
</property>
<property name="text">
<string>Drag second model here</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTextEdit" name="textEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="printButton">
<property name="text">
<string>Print</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="printFileButton">
<property name="text">
<string>Print to file</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<connections>
<connection>
<sender>closeButton</sender>
<signal>clicked()</signal>
<receiver>CompareDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>739</x>
<y>636</y>
</hint>
<hint type="destinationlabel">
<x>565</x>
<y>623</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+132
View File
@@ -0,0 +1,132 @@
#include "contributorsdialog.h"
#include "ui_contributorsdialog.h"
#include <QtGui>
#include "helpers.h"
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::contributorsDialog)
{
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;
}
case 1:
{
this->setWindowIcon(CompanionIcon("changelog.png"));
QFile file(":/releasenotes.txt");
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
ui->textEditor->setHtml(file.readAll());
}
ui->textEditor->scroll(0,0);
setWindowTitle(tr("Companion Release Notes"));
break;
}
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;
}
}
}
void contributorsDialog::showEvent ( QShowEvent * )
{
ui->textEditor->scroll(0, 0);
}
contributorsDialog::~contributorsDialog()
{
delete ui;
}
void contributorsDialog::replyFinished(QNetworkReply * reply)
{
ui->textEditor->setHtml(reply->readAll());
}
void contributorsDialog::forceClose()
{
accept();;
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef CONTRIBUTORSDIALOG_H
#define CONTRIBUTORSDIALOG_H
#include <QDialog>
#include "eeprominterface.h"
#include "downloaddialog.h"
namespace Ui {
class contributorsDialog;
}
class contributorsDialog : public QDialog
{
Q_OBJECT
public:
explicit contributorsDialog(QWidget *parent = 0, int contest = 0, QString rnurl = QString() );
~contributorsDialog();
private:
Ui::contributorsDialog *ui;
QNetworkAccessManager *manager;
void showEvent ( QShowEvent * );
private slots:
void forceClose();
void replyFinished(QNetworkReply * reply);
};
#endif // CONTRIBUTORSDIALOG_H
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>contributorsDialog</class>
<widget class="QDialog" name="contributorsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>788</width>
<height>528</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="textEditor">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+269
View File
@@ -0,0 +1,269 @@
#include "customizesplashdialog.h"
#include "ui_customizesplashdialog.h"
#include <QtGui>
#include "appdata.h"
#include "helpers.h"
#include "burndialog.h"
#include "splashlibrary.h"
#include "flashinterface.h"
//*** Side Class ***
Side::Side(){
imageLabel = 0;
fileNameEdit = 0;
saveButton = 0;
loadFwButton=0;
loadPictButton = 0;
loadProfileButton = 0;
saveToFileName = new QString("");
source = new Source(UNDEFINED);
format = new LCDFormat(LCDTARANIS);
}
void Side::markSourceButton()
{
loadFwButton->setChecked(*source == FW ? true : false );
loadPictButton->setChecked(*source == PICT ? true : false );
loadProfileButton->setChecked(*source == PROFILE ? true : false );
}
void Side::copyImage( Side side )
{
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
imageLabel->setPixmap(*side.imageLabel->pixmap());
}
bool Side::displayImage( QString fileName, Source pictSource )
{
QImage image;
if (fileName.isEmpty())
return false;
// Determine which picture format to use
if (pictSource == FW ){
FlashInterface flash(fileName);
if (!flash.hasSplash())
return false;
else
image = flash.getSplash();
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
}
else {
image.load(fileName);
if (pictSource== PICT)
*format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X;
else if (pictSource == PROFILE)
*format = (g.profile[g.id()].fwType().contains("taranis")) ? LCDTARANIS : LCD9X;
}
if (image.isNull()) {
return false;
}
// Load image
if (*format==LCDTARANIS) {
imageLabel->setPixmap( makePixMap( image, "taranis" ));
imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2);
}
else {
imageLabel->setPixmap( makePixMap( image, "9x" ));
imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2);
}
switch (pictSource){
case FW:
fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName));
*saveToFileName = fileName;
*source=FW;
break;
case PICT:
fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName));
*saveToFileName = fileName;
*source=PICT;
break;
case PROFILE:
fileNameEdit->setText(QObject::tr("Profile image"));
*saveToFileName = fileName;
*source=PROFILE;
break;
default:
break;
}
saveButton->setEnabled(true);
libraryButton->setEnabled(true);
invertButton->setEnabled(true);
return true;
}
bool Side::refreshImage()
{
return displayImage( *saveToFileName, *source );
}
bool Side::saveImage()
{
if (*source == FW )
{
FlashInterface flash(*saveToFileName);
if (!flash.hasSplash()) {
return false;
}
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 {
return false;
}
}
else if (*source == PICT) {
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
if (image.save(*saveToFileName)) {
g.imagesDir( QFileInfo(*saveToFileName).dir().absolutePath() );
}
else {
return false;
}
}
else if (*source == PROFILE) {
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
if (!image.save(*saveToFileName)) {
return false;
}
}
return true;
}
//*** customizeSplashDialog Class ***
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::customizeSplashDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("paintbrush.png"));
ui->leftLibraryButton->setIcon(CompanionIcon("library.png"));
ui->rightLibraryButton->setIcon(CompanionIcon("library.png"));
left.imageLabel = ui->leftImageLabel;
right.imageLabel = ui->rightImageLabel;
left.fileNameEdit = ui->leftFileNameEdit;
right.fileNameEdit = ui->rightFileNameEdit;
left.saveButton = ui->leftSaveButton;
right.saveButton = ui->rightSaveButton;
left.libraryButton = ui->leftLibraryButton;
right.libraryButton = ui->rightLibraryButton;
left.invertButton = ui->leftInvertButton;
right.invertButton = ui->rightInvertButton;
left.loadFwButton = ui->leftLoadFwButton;
right.loadFwButton = ui->rightLoadFwButton;
left.loadPictButton = ui->leftLoadPictButton;
right.loadPictButton = ui->rightLoadPictButton;
left.loadProfileButton = ui->leftLoadProfileButton;
right.loadProfileButton = ui->rightLoadProfileButton;
loadProfile(left);
left.markSourceButton();
resize(0,0);
}
customizeSplashDialog::~customizeSplashDialog()
{
delete ui;
}
void customizeSplashDialog::on_copyRightToLeftButton_clicked() {
left.copyImage(right);
}
void customizeSplashDialog::on_copyLeftToRightButton_clicked() {
right.copyImage(left);
}
void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
void customizeSplashDialog::loadFirmware(Side side)
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, FW ))
QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName));
else
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
void customizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
void customizeSplashDialog::loadPicture(Side side)
{
QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
}
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PICT ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
else
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
void customizeSplashDialog::loadProfile(Side side)
{
QString fileName=g.profile[g.id()].splashFile();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PROFILE ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load profile image %1.").arg(fileName));
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
void customizeSplashDialog::libraryButton_clicked( Side side )
{
QString fileName;
splashLibrary *ld = new splashLibrary(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, UNDEFINED ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the library image %1.").arg(fileName));
}
}
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
void customizeSplashDialog::saveButton_clicked( Side side )
{
if (side.saveImage()){
QMessageBox::information(this, tr("File Saved"), tr("The image was saved to the file %1").arg(*side.saveToFileName));
if ( !side.refreshImage()){
QMessageBox::critical(this, tr("Image Refresh Error"), tr("Failed to refresh image from file %1").arg(*side.saveToFileName));
}
}
else
QMessageBox::critical(this, tr("File Save Error"), tr("Failed to write image to %1").arg(*side.saveToFileName));
}
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
void customizeSplashDialog::on_rightInvertButton_clicked(){invertButton_clicked(right);}
void customizeSplashDialog::invertButton_clicked(Side side)
{
QImage image = side.imageLabel->pixmap()->toImage();
image.invertPixels();
side.imageLabel->setPixmap(QPixmap::fromImage(image));
}
+87
View File
@@ -0,0 +1,87 @@
#ifndef CUSTOMIZESPLASHDIALOG_H
#define CUSTOMIZESPLASHDIALOG_H
#include <QtGui>
#include <QDialog>
#include "flashinterface.h"
namespace Ui
{
class customizeSplashDialog;
}
const int WIDTH_TARANIS = 212;
const int HEIGHT_TARANIS = 64;
const int WIDTH_9X = 128;
const int HEIGHT_9X = 64;
enum Source {FW, PICT, PROFILE, UNDEFINED};
enum LCDFormat {LCD9X, LCDTARANIS};
class Side
{
public:
Side();
void markSourceButton();
void copyImage( Side );
bool displayImage( QString fileName, Source source );
bool saveImage();
bool refreshImage();
QLabel *imageLabel;
QLineEdit *fileNameEdit;
QPushButton *saveButton;
QPushButton *invertButton;
QToolButton *libraryButton;
QPushButton *loadFwButton;
QPushButton *loadPictButton;
QPushButton *loadProfileButton;
QString *saveToFileName;
private:
Source *source;
LCDFormat *format;
};
class customizeSplashDialog : public QDialog
{
Q_OBJECT
Side left;
Side right;
public:
explicit customizeSplashDialog(QWidget *parent = 0);
~customizeSplashDialog();
private slots:
void on_leftLoadFwButton_clicked();
void on_leftLoadPictButton_clicked();
void on_leftLoadProfileButton_clicked();
void on_leftLibraryButton_clicked();
void on_leftSaveButton_clicked();
void on_leftInvertButton_clicked();
void on_rightLoadFwButton_clicked();
void on_rightLoadPictButton_clicked();
void on_rightLoadProfileButton_clicked();
void on_rightLibraryButton_clicked();
void on_rightSaveButton_clicked();
void on_rightInvertButton_clicked();
void on_copyRightToLeftButton_clicked();
void on_copyLeftToRightButton_clicked();
private:
void loadFirmware( Side );
void loadPicture( Side );
void loadProfile( Side );
void libraryButton_clicked( Side );
void saveButton_clicked( Side );
void invertButton_clicked( Side );
Ui::customizeSplashDialog *ui;
enum sideEnum { LEFT, RIGHT };
};
#endif // CUSTOMIZESPLASHDIALOG_H
+667
View File
@@ -0,0 +1,667 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>customizeSplashDialog</class>
<widget class="QDialog" name="customizeSplashDialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1087</width>
<height>298</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Transmitter Splash Screen Editor</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="Line" name="line_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_11">
<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="QLineEdit" name="leftFileNameEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>426</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_6">
<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="QLabel" name="leftImageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>128</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>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="leftInvertButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="leftLibraryButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Open Splash Library</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QPushButton" name="leftLoadProfileButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Load Profile</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="leftLoadFwButton">
<property name="text">
<string>Load FW</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="leftLoadPictButton">
<property name="text">
<string>Load Pict</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="leftSaveButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QToolButton" name="copyRightToLeftButton">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="copyLeftToRightButton">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="Line" name="line_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_9">
<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="QLineEdit" name="rightFileNameEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>426</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
<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="QLabel" name="rightImageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>128</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>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPushButton" name="rightInvertButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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="QToolButton" name="rightLibraryButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Open Splash Library</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="rightLoadProfileButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Load Profile</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="rightLoadFwButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Load FW</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="rightLoadPictButton">
<property name="text">
<string>Load Pict</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="rightSaveButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>leftFileNameEdit</tabstop>
<tabstop>leftInvertButton</tabstop>
<tabstop>leftLibraryButton</tabstop>
<tabstop>leftLoadProfileButton</tabstop>
<tabstop>leftLoadFwButton</tabstop>
<tabstop>leftLoadPictButton</tabstop>
<tabstop>leftSaveButton</tabstop>
<tabstop>copyLeftToRightButton</tabstop>
<tabstop>copyRightToLeftButton</tabstop>
<tabstop>rightFileNameEdit</tabstop>
<tabstop>rightInvertButton</tabstop>
<tabstop>rightLibraryButton</tabstop>
<tabstop>rightLoadProfileButton</tabstop>
<tabstop>rightLoadFwButton</tabstop>
<tabstop>rightLoadPictButton</tabstop>
<tabstop>rightSaveButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+100
View File
@@ -0,0 +1,100 @@
#include "downloaddialog.h"
#include "ui_downloaddialog.h"
#include <QMessageBox>
#include <QtGui>
#include <QTime>
#include "helpers.h"
downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt):
QDialog(parent),
ui(new Ui::downloadDialog),
file(NULL)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("fwpreferences.png"));
ui->progressBar->setValue(1);
ui->progressBar->setMinimum(0);
ui->progressBar->setMaximum(0);
if (tgt.isEmpty()) {
setWindowTitle(src);
return; // just show wait dialog.
}
file = new QFile(tgt);
if (!file->open(QIODevice::WriteOnly)) {
QMessageBox::critical(this, "Companion",
tr("Unable to save the file %1: %2.")
.arg(tgt).arg(file->errorString()));
QTimer::singleShot(0, this, SLOT(fileError()));
}
else {
reply = qnam.get(QNetworkRequest(QUrl(src)));
connect(reply, SIGNAL(finished()), this, SLOT(httpFinished()));
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateDataReadProgress(qint64,qint64)));
}
}
downloadDialog::~downloadDialog()
{
delete ui;
delete file;
}
void downloadDialog::httpFinished()
{
file->flush();
file->close();
bool ok = true;
if (reply->error()) {
file->remove();
QMessageBox::information(this, tr("Companion"),
tr("Download failed: %1.")
.arg(reply->errorString()));
ok = false;
}
reply->deleteLater();
reply = 0;
delete file;
file = NULL;
if (ok)
accept();
else
reject();
}
void downloadDialog::httpReadyRead()
{
if (file) {
file->write(reply->readAll());
}
}
void downloadDialog::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
{
ui->progressBar->setMaximum(totalBytes);
ui->progressBar->setValue(bytesRead);
}
void downloadDialog::fileError()
{
delete file;
file = NULL;
reject();
}
#if 0
void downloadDialog::closeEvent( QCloseEvent * event)
{
// Delay closing 2 seconds to avoid unpleasant flashing download dialogs
QTime closeTime= QTime::currentTime().addSecs(2);
while( QTime::currentTime() < closeTime )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
event->accept();
}
#endif
+41
View File
@@ -0,0 +1,41 @@
#ifndef DOWNLOADDIALOG_H
#define DOWNLOADDIALOG_H
#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QFile>
namespace Ui {
class downloadDialog;
}
class downloadDialog : public QDialog
{
Q_OBJECT
public:
explicit downloadDialog(QWidget *parent = 0, QString src = "", QString tgt = "");
~downloadDialog();
private slots:
void fileError();
void httpFinished();
void httpReadyRead();
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
private:
#if 0
void closeEvent( QCloseEvent * event);
#endif
Ui::downloadDialog *ui;
QNetworkAccessManager qnam;
QNetworkReply *reply;
QFile *file;
};
#endif // DOWNLOADDIALOG_H
+86
View File
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>downloadDialog</class>
<widget class="QDialog" name="downloadDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>82</height>
</rect>
</property>
<property name="windowTitle">
<string>Downloading: </string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel</set>
</property>
</widget>
</item>
<item>
<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>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>downloadDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>downloadDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+701
View File
@@ -0,0 +1,701 @@
/*
* 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 eeprom_importexport_h
#define eeprom_importexport_h
#define DIM(arr) (sizeof((arr))/sizeof((arr)[0]))
class DataField {
public:
DataField(const char *name=""):
name(name)
{
}
virtual const char *getName() { return name; }
virtual ~DataField() { }
virtual void ExportBits(QBitArray & output) = 0;
virtual void ImportBits(QBitArray & input) = 0;
virtual unsigned int size() = 0;
QBitArray bytesToBits(QByteArray bytes)
{
QBitArray bits(bytes.count()*8);
// Convert from QByteArray to QBitArray
for (int i=0; i<bytes.count(); ++i)
for (int b=0; b<8; ++b)
bits.setBit(i*8+b, bytes.at(i)&(1<<b));
return bits;
}
QByteArray bitsToBytes(QBitArray bits, int offset=0)
{
QByteArray bytes;
bytes.resize((offset+bits.count()+7)/8);
bytes.fill(0);
// Convert from QBitArray to QByteArray
for (int b=0; b<bits.count(); ++b)
bytes[(b+offset)/8] = ( bytes.at((b+offset)/8) | ((bits[b]?1:0)<<((b+offset)%8)));
return bytes;
}
int Export(QByteArray & output)
{
QBitArray result;
ExportBits(result);
output = bitsToBytes(result);
return 0;
}
int Import(QByteArray & input)
{
QBitArray bits = bytesToBits(input);
ImportBits(bits);
return 0;
}
virtual int Dump(int level=0, int offset=0)
{
QBitArray bits;
ExportBits(bits);
QByteArray bytes = bitsToBytes(bits);
int result = (offset+bits.count()) % 8;
for (int i=0; i<level; i++) printf(" ");
if (bits.count() % 8 == 0)
printf("%s (%dbytes) ", getName(), bytes.count());
else
printf("%s (%dbits) ", getName(), bits.count());
for (int i=0; i<bytes.count(); i++) {
unsigned char c = bytes[i];
if ((i==0 && offset) || (i==bytes.count()-1 && result!=0))
printf("(%02x) ", c);
else
printf("%02x ", c);
}
printf("\n"); fflush(stdout);
return result;
}
protected:
const char *name;
};
class ProxyField: public DataField {
public:
ProxyField():
DataField("Proxy")
{
}
virtual DataField * getField() = 0;
};
template<int N>
class UnsignedField: public DataField {
public:
explicit UnsignedField(unsigned int & field):
DataField("Unsigned"),
field(field),
min(0),
max(UINT_MAX)
{
}
UnsignedField(unsigned int & field, const char *name):
DataField(name),
field(field),
min(0),
max(UINT_MAX)
{
}
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
DataField(name),
field(field),
min(min),
max(max)
{
}
virtual void ExportBits(QBitArray & output)
{
unsigned int value = field;
if (value > max) value = max;
if (value < min) value = min;
output.resize(N);
for (int i=0; i<N; i++) {
if (value & (1<<i))
output.setBit(i);
}
}
virtual void ImportBits(QBitArray & input)
{
field = 0;
for (int i=0; i<N; i++) {
if (input[i])
field |= (1<<i);
}
}
virtual unsigned int size()
{
return N;
}
protected:
unsigned int & field;
unsigned int min;
unsigned int max;
private:
UnsignedField();
};
template<int N>
class BoolField: public DataField {
public:
explicit BoolField(bool & field):
DataField("Bool"),
field(field)
{
}
virtual void ExportBits(QBitArray & output)
{
output.resize(N);
if (field) {
output.setBit(0);
}
}
virtual void ImportBits(QBitArray & input)
{
field = input[0] ? true : false;
}
virtual unsigned int size()
{
return N;
}
protected:
bool & field;
private:
BoolField();
};
template<int N>
class SignedField: public DataField {
public:
SignedField(int & field):
DataField("Signed"),
field(field),
min(INT_MIN),
max(INT_MAX)
{
}
SignedField(int & field, const char *name):
DataField(name),
field(field),
min(INT_MIN),
max(INT_MAX)
{
}
SignedField(int & field, int min, int max, const char *name="Signed"):
DataField(name),
field(field),
min(min),
max(max)
{
}
virtual void ExportBits(QBitArray & output)
{
int value = field;
if (value > max) value = max;
if (value < min) value = min;
output.resize(N);
for (int i=0; i<N; i++) {
if (((unsigned int)value) & (1<<i))
output.setBit(i);
}
}
virtual void ImportBits(QBitArray & input)
{
unsigned int value = 0;
for (int i=0; i<N; i++) {
if (input[i])
value |= (1<<i);
}
if (input[N-1]) {
for (unsigned int i=N; i<8*sizeof(int); i++) {
value |= (1<<i);
}
}
field = (int)value;
}
virtual unsigned int size()
{
return N;
}
protected:
int & field;
int min;
int max;
};
template<int N>
class SpareBitsField: public UnsignedField<N> {
public:
SpareBitsField():
UnsignedField<N>(spare, 0, 0, "Spare"),
spare(0)
{
}
protected:
unsigned int spare;
};
template<int N>
class CharField: public DataField {
public:
CharField(char *field, bool truncate=true):
DataField("Char"),
field(field),
truncate(truncate)
{
}
virtual void ExportBits(QBitArray & output)
{
output.resize(N*8);
int b = 0;
int len = truncate ? strlen(field) : N;
for (int i=0; i<N; i++) {
int idx = (i>=len ? 0 : field[i]);
for (int j=0; j<8; j++, b++) {
if (idx & (1<<j))
output.setBit(b);
}
}
}
virtual void ImportBits(QBitArray & input)
{
unsigned int b = 0;
for (int i=0; i<N; i++) {
int8_t idx = 0;
for (int j=0; j<8; j++) {
if (input[b++])
idx |= (1<<j);
}
field[i] = idx;
}
}
virtual unsigned int size()
{
return 8*N;
}
protected:
char * field;
bool truncate;
};
int8_t char2idx(char c);
char idx2char(int8_t idx);
template<int N>
class ZCharField: public DataField {
public:
ZCharField(char *field):
DataField("ZChar"),
field(field)
{
}
virtual void ExportBits(QBitArray & output)
{
output.resize(N*8);
int b = 0;
int len = strlen(field);
for (int i=0; i<N; i++) {
int idx = i>=len ? 0 : char2idx(field[i]);
for (int j=0; j<8; j++, b++) {
if (idx & (1<<j))
output.setBit(b);
}
}
}
virtual void ImportBits(QBitArray & input)
{
unsigned int b = 0;
for (int i=0; i<N; i++) {
int8_t idx = 0;
for (int j=0; j<8; j++) {
if (input[b++])
idx |= (1<<j);
}
field[i] = idx2char(idx);
}
field[N] = '\0';
for (int i=N-1; i>=0; i--) {
if (field[i] == ' ')
field[i] = '\0';
else
break;
}
}
virtual unsigned int size()
{
return 8*N;
}
protected:
char * field;
};
class StructField: public DataField {
public:
StructField(const char *name="Struct"):
DataField(name)
{
}
~StructField() {
foreach(DataField *field, fields) {
delete field;
}
}
inline void Append(DataField *field) {
fields.append(field);
}
virtual void ExportBits(QBitArray & output)
{
int offset = 0;
output.resize(size());
foreach(DataField *field, fields) {
QBitArray bits;
field->ExportBits(bits);
for (int i=0; i<bits.size(); i++)
output[offset++] = bits[i];
}
}
virtual void ImportBits(QBitArray & input)
{
int offset = 0;
foreach(DataField *field, fields) {
unsigned int size = field->size();
QBitArray bits(size);
for (unsigned int i=0; i<size; i++) {
bits[i] = input[offset++];
}
field->ImportBits(bits);
}
}
virtual unsigned int size()
{
unsigned int result = 0;
foreach(DataField *field, fields) {
result += field->size();
}
return result;
}
virtual int Dump(int level=0, int offset=0)
{
for (int i=0; i<level; i++) printf(" ");
printf("%s (%d bytes)\n", getName(), size()/8);
foreach(DataField *field, fields) {
offset = field->Dump(level+1, offset);
}
return offset;
}
protected:
QList<DataField *> fields;
};
class TransformedField: public DataField {
public:
TransformedField(DataField & field):
DataField(),
field(field)
{
}
virtual ~TransformedField()
{
}
virtual void ExportBits(QBitArray & output)
{
beforeExport();
field.ExportBits(output);
}
virtual void ImportBits(QBitArray & input)
{
field.ImportBits(input);
afterImport();
}
virtual const char *getName()
{
return field.getName();
}
virtual unsigned int size()
{
return field.size();
}
virtual void beforeExport() = 0;
virtual void afterImport() = 0;
virtual int Dump(int level=0, int offset=0)
{
beforeExport();
return field.Dump(level, offset);
}
protected:
DataField & field;
};
class ConversionTable {
public:
bool exportValue(const int before, int &after)
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.a) {
after = tuple.b;
return true;
}
}
return false;
}
bool importValue(const int before, int &after)
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.b) {
after = tuple.a;
return true;
}
}
return false;
}
protected:
class ConversionTuple {
public:
ConversionTuple(const int a, const int b):
a(a),
b(b)
{
}
int a;
int b;
};
void addConversion(const int a, const int b)
{
internalTable.push_back(ConversionTuple(a, b));
}
std::list<ConversionTuple> internalTable;
};
template<class T>
class ConversionField: public TransformedField {
public:
ConversionField(int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(internalField),
internalField(_field, name),
field(field),
_field(0),
table(table),
shift(0),
scale(1),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
importFunc(NULL),
error(error)
{
}
ConversionField(unsigned int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(internalField),
internalField((unsigned int &)_field, name),
field((int &)field),
_field(0),
table(table),
shift(0),
scale(0),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
importFunc(NULL),
error(error)
{
}
ConversionField(int & field, int (*exportFunc)(int), int (*importFunc)(int)):
TransformedField(internalField),
internalField(_field),
field(field),
_field(0),
table(NULL),
shift(0),
scale(0),
min(INT_MIN),
max(INT_MAX),
exportFunc(exportFunc),
importFunc(importFunc),
error("")
{
}
ConversionField(int & field, int shift, int scale=0, int min=INT_MIN, int max=INT_MAX, const char *name = "Signed shifted"):
TransformedField(internalField),
internalField(_field, name),
field(field),
_field(0),
table(NULL),
shift(shift),
scale(scale),
min(min),
max(max),
exportFunc(NULL),
importFunc(NULL),
error("")
{
}
ConversionField(unsigned int & field, int shift, int scale=0):
TransformedField(internalField),
internalField((unsigned int &)_field),
field((int &)field),
_field(0),
table(NULL),
shift(shift),
scale(scale),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
importFunc(NULL),
error("")
{
}
virtual void beforeExport()
{
_field = field;
if (scale) {
_field /= scale;
}
if (table) {
if (table->exportValue(_field, _field))
return;
if (!error.isEmpty())
EEPROMWarnings += error + "\n";
}
if (shift) {
if (_field < min) _field = min + shift;
else if (_field > max) _field = max + shift;
else _field += shift;
}
if (exportFunc) {
_field = exportFunc(_field);
}
}
virtual void afterImport()
{
field = _field;
if (table) {
if (table->importValue(field, field))
return;
}
if (shift) {
field -= shift;
}
if (importFunc) {
field = importFunc(field);
}
if (scale) {
field *= scale;
}
}
protected:
T internalField;
int & field;
int _field;
ConversionTable * table;
int shift;
int scale;
int min;
int max;
int (*exportFunc)(int);
int (*importFunc)(int);
const QString error;
};
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+608
View File
@@ -0,0 +1,608 @@
/*
* 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 "stdio.h"
#include "inttypes.h"
#include "string.h"
#include "file.h"
#include <assert.h>
#include <algorithm>
#include "eeprominterface.h"
RleFile::RleFile():
eeprom(NULL),
eeprom_size(0),
eeFs(NULL),
eeFsArm(NULL)
{
}
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
this->eeprom_size = size;
this->board = board;
if (IS_SKY9X(board)) {
memset(eeprom, 0xFF, size);
}
else if (IS_TARANIS(board)) {
eeFsArm = (EeFsArm *)eeprom;
eeFsVersion = 5;
eeFsSize = 8+4*62;
eeFsBlockSize = 64;
eeFsFirstBlock = 1;
eeFsBlocksOffset = eeFsSize - eeFsBlockSize;
eeFsBlocksMax = 1 + (EESIZE_TARANIS-eeFsSize)/eeFsBlockSize;
eeFsLinkSize = sizeof(int16_t);
memset(eeprom, 0, size);
eeFsArm->version = eeFsVersion;
eeFsArm->mySize = eeFsSize;
eeFsArm->freeList = 0;
eeFsArm->bs = 64;
for (unsigned int i=eeFsFirstBlock; i<eeFsBlocksMax-1; i++)
EeFsSetLink(i, i+1);
EeFsSetLink(eeFsBlocksMax-1, 0);
eeFsArm->freeList = eeFsFirstBlock;
// EeFsFlush();
}
else {
eeFs = (EeFs *)eeprom;
eeFsVersion = (board==BOARD_GRUVIN9X || board==BOARD_M128) ? 5 : 4;
eeFsBlockSize = 16;
eeFsLinkSize = 1;
if (eeFsVersion == 5) {
eeFsSize = 4+3*36;
eeFsFirstBlock = 1;
eeFsBlocksOffset = 112 - 16;
eeFsBlocksMax = 1 + (4096-112)/16;
}
else {
eeFsSize = 4+3*20;
eeFsFirstBlock = 4;
eeFsBlocksOffset = 0;
eeFsBlocksMax = 2048/16;
}
memset(eeprom, 0, size);
eeFs->version = eeFsVersion;
eeFs->mySize = eeFsSize;
eeFs->freeList = 0;
eeFs->bs = eeFsBlockSize;
for (unsigned int i=eeFsFirstBlock; i<eeFsBlocksMax-1; i++)
EeFsSetLink(i, i+1);
EeFsSetLink(eeFsBlocksMax-1, 0);
eeFs->freeList = eeFsFirstBlock;
// EeFsFlush();
}
}
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
this->eeprom_size = size;
this->board = board;
if (IS_SKY9X(board)) {
return 1;
}
else if (IS_TARANIS(board)) {
eeFsArm = (EeFsArm *)eeprom;
eeFsVersion = eeFsArm->version;
eeFsSize = 8+4*62;
eeFsBlockSize = 64;
eeFsLinkSize = sizeof(int16_t);
eeFsFirstBlock = 1;
eeFsBlocksOffset = eeFsSize - eeFsBlockSize;
eeFsBlocksMax = 1 + (EESIZE_TARANIS-eeFsSize)/eeFsBlockSize;
return eeFsArm->mySize == eeFsSize;
}
else {
eeFs = (EeFs *)eeprom;
eeFsVersion = eeFs->version;
eeFsBlockSize = 16;
eeFsLinkSize = 1;
if (eeFsVersion == 5) {
eeFsSize = 4+3*36;
eeFsFirstBlock = 1;
eeFsBlocksOffset = 112 - 16;
eeFsBlocksMax = 1 + (4096-112)/16;
}
else if (eeFsVersion == 4) {
eeFsSize = 4+3*20;
eeFsFirstBlock = 4;
eeFsBlocksOffset = 0;
eeFsBlocksMax = 2048/16;
}
else {
return 0;
}
return eeFs->mySize == eeFsSize;
}
}
void RleFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
{
memcpy(pointer_ram, &eeprom[pointer_eeprom], size);
}
void RleFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
{
memcpy(&eeprom[pointer_eeprom], pointer_ram, size);
}
uint8_t RleFile::EeFsRead(unsigned int blk, unsigned int ofs)
{
uint8_t ret;
eeprom_read_block(&ret, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
return ret;
}
void RleFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
{
eeprom_write_block(&val, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
}
unsigned int RleFile::EeFsGetLink(unsigned int blk)
{
if (IS_ARM(board)) {
int16_t ret;
eeprom_read_block((uint8_t *)&ret, blk*eeFsBlockSize+eeFsBlocksOffset, eeFsLinkSize);
return ret;
}
else {
return EeFsRead(blk, 0);
}
}
void RleFile::EeFsSetLink(unsigned int blk, unsigned int val)
{
if (IS_ARM(board)) {
int16_t s_link = val;
eeprom_write_block((uint8_t *)&s_link, (blk*eeFsBlockSize)+eeFsBlocksOffset, eeFsLinkSize);
}
else {
EeFsWrite(blk, 0, val);
}
}
uint8_t RleFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
{
return EeFsRead(blk, ofs+eeFsLinkSize);
}
void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
{
eeprom_write_block(buf, blk*eeFsBlockSize+ofs+eeFsLinkSize+eeFsBlocksOffset, len);
}
unsigned int RleFile::EeFsGetFree()
{
unsigned int ret = 0;
unsigned int i;
if (IS_ARM(board))
i = eeFsArm->freeList;
else
i = eeFs->freeList;
while (i) {
ret += eeFsBlockSize-eeFsLinkSize;
i = EeFsGetLink(i);
}
return ret;
}
/*
* free one or more blocks
*/
void RleFile::EeFsFree(unsigned int blk)
{
unsigned int i = blk;
while (EeFsGetLink(i)) i = EeFsGetLink(i);
if (IS_ARM(board)) {
EeFsSetLink(i, eeFsArm->freeList);
eeFsArm->freeList = blk; //chain in front
}
else {
EeFsSetLink(i, eeFs->freeList);
eeFs->freeList = blk; //chain in front
}
}
/*
* alloc one block from freelist
*/
unsigned int RleFile::EeFsAlloc()
{
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
if (IS_ARM(board))
eeFsArm->freeList = EeFsGetLink(ret);
else
eeFs->freeList = EeFsGetLink(ret);
EeFsSetLink(ret, 0);
}
return ret;
}
unsigned int RleFile::size(unsigned int id)
{
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
}
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_SKY9X(board)) {
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
m_pos = sizeof(t_eeprom_header);
return 1;
}
else {
m_fileId = i_fileId;
m_pos = 0;
m_currBlk = (IS_ARM(board) ? eeFsArm->files[m_fileId].startBlk : eeFs->files[m_fileId].startBlk);
m_ofs = 0;
m_zeroes = 0;
m_bRlc = 0;
m_err = ERR_NONE; //error reasons
if (IS_ARM(board))
return eeFsArm->files[m_fileId].typ;
else
return eeFs->files[m_fileId].typ;
}
}
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
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;
len = i_len;
while(len) {
if (!m_currBlk) break;
*buf++ = EeFsGetDat(m_currBlk, m_ofs++);
if (m_ofs >= (eeFsBlockSize-(IS_ARM(board)? 2 : 1))) {
m_ofs = 0;
m_currBlk = EeFsGetLink(m_currBlk);
}
len--;
}
m_pos += i_len - len;
return i_len - len;
}
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
memset(buf, 0, i_len);
if (IS_SKY9X(board)) {
int len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
if (len > 0) {
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
m_pos += len;
}
return len;
}
else {
unsigned int i=0;
for( ; 1; ) {
uint8_t ln = std::min<uint16_t>(m_zeroes, i_len-i);
memset(&buf[i], 0, ln);
i += ln;
m_zeroes -= ln;
if(m_zeroes) break;
ln = std::min<uint16_t>(m_bRlc, i_len-i);
uint8_t lr = read(&buf[i], ln);
i += lr ;
m_bRlc -= lr;
if(m_bRlc) break;
if (read(&m_bRlc, 1) !=1) break; //read how many bytes to read
if (!(m_bRlc & 0x7f)) {
qDebug() << "RLC decoding error!";
return 0;
}
if (rlc2) {
if(m_bRlc&0x80){ // if contains high byte
m_zeroes =(m_bRlc>>4) & 0x7;
m_bRlc = m_bRlc & 0x0f;
}
else if(m_bRlc&0x40){
m_zeroes = m_bRlc & 0x3f;
m_bRlc = 0;
}
//else m_bRlc
}
else {
if(m_bRlc&0x80){ // if contains high byte
m_zeroes = m_bRlc & 0x7f;
m_bRlc = 0;
}
}
}
return i;
}
}
unsigned int RleFile::write1(uint8_t b)
{
return write(&b, 1);
}
unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
{
unsigned int len = i_len;
if (!m_currBlk && m_pos==0)
{
if (IS_ARM(board))
eeFsArm->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
else
eeFs->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
}
while (len)
{
if (!m_currBlk) {
m_err = ERR_FULL;
return 0;
}
if (m_ofs >= eeFsBlockSize-eeFsLinkSize) {
m_ofs = 0;
if (!EeFsGetLink(m_currBlk) ){
EeFsSetLink(m_currBlk, EeFsAlloc());
}
m_currBlk = EeFsGetLink(m_currBlk);
}
if (!m_currBlk) {
m_err = ERR_FULL;
return 0;
}
uint8_t l = eeFsBlockSize-eeFsLinkSize-m_ofs; if(l>len) l=len;
EeFsSetDat(m_currBlk, m_ofs, buf, l);
buf +=l;
m_ofs +=l;
len -=l;
}
m_pos += i_len - len;
return i_len - len;
}
void RleFile::create(unsigned int i_fileId, unsigned int typ)
{
openRd(i_fileId); //internal use
if (IS_ARM(board)) {
eeFsArm->files[i_fileId].typ = typ;
eeFsArm->files[i_fileId].size = 0;
}
else {
eeFs->files[i_fileId].typ = typ;
eeFs->files[i_fileId].size = 0;
}
}
void RleFile::closeTrunc()
{
unsigned int fri=0;
if (IS_ARM(board))
eeFsArm->files[m_fileId].size = m_pos;
else
eeFs->files[m_fileId].size = m_pos;
if (m_currBlk && ( fri = EeFsGetLink(m_currBlk))) EeFsSetLink(m_currBlk, 0);
if(fri) EeFsFree( fri ); //chain in
}
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
create(i_fileId, typ);
bool state0 = true;
uint8_t cnt = 0;
uint16_t i;
//RLE compression:
//rb = read byte
//if (rb | 0x80) write rb & 0x7F zeros
//else write rb bytes
for (i=0; i<=i_len; i++)
{
bool nst0 = (buf[i] == 0);
if (nst0 && !state0 && buf[i+1]!=0) nst0 = false ;
if (nst0 != state0 || cnt>=0x7f || i==i_len) {
if (state0) {
if(cnt>0) {
cnt |= 0x80;
if (write(&cnt,1)!=1) goto error;
cnt=0;
}
}
else {
if (cnt>0) {
if (write(&cnt,1) !=1) goto error;
uint8_t ret=write(&buf[i-cnt],cnt);
if (ret!=cnt) { cnt-=ret; goto error;}
cnt=0;
}
}
state0 = nst0;
}
cnt++;
}
if(0){
error:
i_len = i - (cnt & 0x7f);
}
closeTrunc();
return i_len;
}
/*
* Write runlength (RLE) compressed bytes
*/
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_SKY9X(board)) {
openRd(i_fileId);
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
t_eeprom_header header;
header.sequence_no = 1;
header.data_size = i_len;
header.flags = 0;
header.hcsum = byte_checksum((uint8_t *) &header, 7);
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
return i_len;
}
else {
create(i_fileId, typ);
bool run0 = buf[0] == 0;
uint8_t cnt = 1;
uint8_t cnt0 = 0;
uint16_t i = 0;
if (i_len==0) goto close;
//RLE compression:
//rb = read byte
//if (rb | 0x80) write rb & 0x7F zeros
//else write rb bytes
for (i=1; 1; i++) { // !! laeuft ein byte zu weit !!
bool cur0 = buf[i] == 0;
if (i==i_len || cur0 != run0 || cnt==0x3f || (cnt0 && cnt==0xf)) {
if (run0){
assert(cnt0==0);
if (cnt<8 && i!=i_len)
cnt0 = cnt; //aufbew fuer spaeter
else {
if (write1(cnt|0x40)!=1) goto error;//-cnt&0x3f
}
}
else {
if (cnt0) {
if (write1(0x80 | (cnt0<<4) | cnt)!=1) goto error;//-cnt0xx-cnt
cnt0 = 0;
}
else {
if (write1(cnt)!=1) goto error;//-cnt
}
uint8_t ret = write(&buf[i-cnt], cnt);
if (ret != cnt) { cnt-=ret; goto error;}//-cnt
}
cnt=0;
if (i==i_len) break;
run0 = cur0;
}
cnt++;
}
if (0) {
error:
i-=cnt+cnt0;
}
close:
closeTrunc();
return i;
}
}
uint8_t RleFile::byte_checksum( uint8_t *p, unsigned int size )
{
uint32_t csum ;
csum = 0 ;
while( size )
{
csum += *p++ ;
size -= 1 ;
}
return csum ;
}
uint32_t RleFile::ee32_check_header( struct t_eeprom_header *hptr )
{
uint8_t csum ;
csum = byte_checksum( ( uint8_t *) hptr, 7 ) ;
if ( csum == hptr->hcsum )
{
return 1 ;
}
return 0 ;
}
// Pass in an even block number, this and the next block will be checked
// to see which is the most recent, the block_no of the most recent
// is returned, with the corresponding data size if required
// and the sequence number if required
uint32_t RleFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
{
struct t_eeprom_header b0 ;
struct t_eeprom_header b1 ;
// uint32_t sequence_no ;
uint16_t size ;
eeprom_read_block( ( uint8_t *)&b0, block_no << 12, sizeof(b0) ) ; // Sequence # 0
eeprom_read_block( ( uint8_t *)&b1, (block_no+1) << 12, sizeof(b1) ) ; // Sequence # 1
if ( ee32_check_header( &b0 ) == 0 )
{
b0.sequence_no = 0 ;
b0.data_size = 0 ;
b0.flags = 0 ;
}
size = b0.data_size ;
// sequence_no = b0.sequence_no ;
if ( ee32_check_header( &b0 ) == 0 )
{
if ( ee32_check_header( &b1 ) != 0 )
{
size = b1.data_size ;
// sequence_no = b1.sequence_no ;
block_no += 1 ;
}
else
{
size = 0 ;
// sequence_no = 1 ;
}
}
else
{
if ( ee32_check_header( &b1 ) != 0 )
{
if ( b1.sequence_no > b0.sequence_no )
{
size = b1.data_size ;
// sequence_no = b1.sequence_no ;
block_no += 1 ;
}
}
}
if ( size == 0xFFFF )
{
size = 0 ;
}
if ( p_size )
{
*p_size = size ;
}
return block_no ;
}
+149
View File
@@ -0,0 +1,149 @@
// TODO should be rle
/*
* 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 file_h
#define file_h
#include "eeprominterface.h"
#define ERR_NONE 0
#define ERR_FULL 1
#define ERR_TMO 2
PACK(struct DirEnt {
uint8_t startBlk;
uint16_t size:12;
uint16_t typ:4;
});
PACK(struct DirEntArm {
uint16_t startBlk;
uint16_t size:12;
uint16_t typ:4;
});
PACK(struct EeFs{
uint8_t version;
uint8_t mySize;
uint8_t freeList;
uint8_t bs;
DirEnt files[36];
});
PACK(struct EeFsArm {
uint8_t version;
uint16_t mySize;
uint16_t freeList;
uint8_t bs;
uint8_t spare[2];
DirEntArm files[62];
});
struct t_eeprom_header
{
uint32_t sequence_no ; // sequence # to decide which block is most recent
uint16_t data_size ; // # bytes in data area
uint8_t flags ;
uint8_t hcsum ;
};
class RleFile
{
uint8_t m_fileId; //index of file in directory = filename
unsigned int m_pos; //over all filepos
unsigned int m_currBlk; //current block.id
unsigned int m_ofs; //offset inside of the current block
uint8_t m_zeroes; //control byte for run length decoder
uint8_t m_bRlc; //control byte for run length decoder
unsigned int m_err; //error reasons
uint16_t m_size;
BoardEnum board;
uint8_t *eeprom;
unsigned int eeprom_size;
EeFs *eeFs;
EeFsArm *eeFsArm;
unsigned int eeFsVersion;
unsigned int eeFsBlockSize;
unsigned int eeFsSize;
unsigned int eeFsFirstBlock;
unsigned int eeFsBlocksOffset;
unsigned int eeFsBlocksMax;
unsigned int eeFsLinkSize;
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);
uint8_t EeFsRead(unsigned int blk, unsigned int ofs);
void EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val);
unsigned int EeFsGetLink(unsigned int blk);
void EeFsSetLink(unsigned int blk, unsigned int val);
uint8_t EeFsGetDat(unsigned int blk, unsigned int ofs);
void EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len);
unsigned int EeFsGetFree();
void EeFsFree(unsigned int blk); // free one or more blocks
unsigned int EeFsAlloc(); // alloc one block from freelist
public:
RleFile();
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
bool EeFsOpen(uint8_t *eeprom, int size, BoardEnum board);
///open file for reading, no close necessary
///for writing use writeRlc() or create()
unsigned int openRd(unsigned int i_fileId);
/// create a new file with given fileId,
/// !!! if this file already exists, then all blocks are reused
/// and all contents will be overwritten.
/// after writing closeTrunc has to be called
void create(unsigned int i_fileId, unsigned int typ);
/// close file and truncate the blockchain if to long.
void closeTrunc();
///open file, write to file and close it.
///If file existed before, then contents is overwritten.
///If file was larger before, then unused blocks are freed
unsigned int writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len);
unsigned int writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len);
unsigned int read(uint8_t *buf, unsigned int i_len);
unsigned int write1(uint8_t b);
unsigned int write(const uint8_t *buf, unsigned int i_len);
///return size of compressed file without block overhead
unsigned int size(unsigned int id);
///read from opened file and decode rlc-coded data
unsigned int readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2);
inline unsigned int readRlc1(uint8_t *buf, unsigned int i_len)
{
return readRlc12(buf, i_len, false);
}
inline unsigned int readRlc2(uint8_t *buf, unsigned int i_len)
{
return readRlc12(buf, i_len, true);
}
uint8_t byte_checksum(uint8_t *p, unsigned int size);
unsigned int ee32_check_header(struct t_eeprom_header *hptr);
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
};
#endif
+475
View File
@@ -0,0 +1,475 @@
#include <algorithm>
#include "er9xeeprom.h"
#include "helpers.h"
#include <QObject>
RawSwitch er9xToSwitch(int8_t sw)
{
uint8_t swa = abs(sw);
if (swa == 0)
return RawSwitch(SWITCH_TYPE_NONE);
else if (swa <= 9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
else if (swa <= 21)
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
else if (sw == 22)
return RawSwitch(SWITCH_TYPE_ON);
else if (sw == -22)
return RawSwitch(SWITCH_TYPE_OFF);
else if (swa <= 22+9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw > 0 ? sw-22 : sw+22);
else
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-22-9 : sw+22+9);
}
t_Er9xTrainerMix::t_Er9xTrainerMix()
{
memset(this, 0, sizeof(t_Er9xTrainerMix));
}
t_Er9xTrainerMix::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.swtch = er9xToSwitch(swtch);
c9x.weight = (25 * studWeight) / 8;
c9x.mode = mode;
return c9x;
}
t_Er9xTrainerData::t_Er9xTrainerData()
{
memset(this, 0, sizeof(t_Er9xTrainerData));
}
t_Er9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
t_Er9xGeneral::t_Er9xGeneral()
{
memset(this, 0, sizeof(t_Er9xGeneral));
}
Er9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
result.version = myVers;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.trainer = trainer;
result.blightinv=blightinv;
result.stickScroll=stickScroll;
result.crosstrim=crosstrim;
result.hideNameOnSplash=hideNameOnSplash;
result.enablePpmsim=enablePpmsim;
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
case 0:
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
result.inactivityTimer = inactivityTimer + 10;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.disablePotScroll=(disablePotScroll==1);
result.disableBG=(disableBG==1);
result.frskyinternalalarm = frskyinternalalarm;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
else if (lightOnStickMove) {
result.backlightMode |= 2;
result.backlightDelay = lightOnStickMove;
}
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
result.speakerPitch = speakerPitch;
result.hapticStrength = hapticStrength - 3;
result.speakerMode = speakerMode;
result.switchWarningStates =switchWarningStates;
return result;
}
t_Er9xLimitData::t_Er9xLimitData()
{
memset(this, 0, sizeof(t_Er9xLimitData));
}
t_Er9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.revert = revert;
c9x.offset = offset;
return c9x;
}
t_Er9xMixData::t_Er9xMixData()
{
memset(this, 0, sizeof(t_Er9xMixData));
}
t_Er9xMixData::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
if (abs(weight)>125) {
int gvar;
if (weight>0) {
gvar=weight-125;
} else {
gvar=weight+131;
}
gvar+=10000;
c9x.weight=gvar;
} else {
c9x.weight = weight;
}
if (abs(sOffset)>125) {
int gvar;
if (sOffset>0) {
gvar=sOffset-125;
} else {
gvar=sOffset+131;
}
gvar+=10000;
c9x.sOffset=gvar;
} else {
c9x.sOffset=sOffset;
}
c9x.swtch = er9xToSwitch(swtch);
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw == 8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 9) {
if (swtch < 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
c9x.weight = -weight;
}
else if (swtch > 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
if (mltpx != MLTPX_REP)
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
}
else if (srcRaw <= 12) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
}
else if (srcRaw <= 20) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
}
else if (srcRaw <=37) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_GVAR, srcRaw-38);
}
if (differential==1) {
c9x.curve.type = CurveReference::CURVE_REF_DIFF;
c9x.curve.value = differential;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
// c9x.lateOffset=lateOffset;
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
// c9x.enableFmTrim=enableFmTrim;
return c9x;
}
RawSource er9xToSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value == 9) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
Er9xLogicalSwitchData::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = er9xToSource(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = er9xToSource(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = er9xToSwitch(v1).toValue();
c9x.val2 = er9xToSwitch(v2).toValue();
}
return c9x;
}
t_Er9xSafetySwData::t_Er9xSafetySwData()
{
memset(this, 0, sizeof(t_Er9xSafetySwData));
}
t_Er9xFrSkyChannelData::t_Er9xFrSkyChannelData()
{
memset(this, 0, sizeof(t_Er9xFrSkyChannelData));
}
t_Er9xFrSkyChannelData::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
c9x.ratio = ratio;
c9x.alarms[0].value = alarms_value[0];
c9x.alarms[0].level = alarms_level & 3;
c9x.alarms[0].greater = alarms_greater & 1;
c9x.alarms[1].value = alarms_value[1];
c9x.alarms[1].level = (alarms_level >> 2) & 3;
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
if (type==2) {
c9x.type = 0;
c9x.multiplier=1;
} else {
c9x.type = type;
}
return c9x;
}
t_Er9xFrSkyData::t_Er9xFrSkyData()
{
memset(this, 0, sizeof(t_Er9xFrSkyData));
}
t_Er9xFrSkyData::operator FrSkyData ()
{
FrSkyData c9x;
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
return c9x;
}
RawSwitch getEr9xTimerMode(int mode)
{
/*
if (mode <= -33)
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+33));
else if (mode <= -1)
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+1));
else if (mode < 16)
return TimerMode(mode);
else if (mode < 16+21)
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16));
else
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16-21));
*/
return RawSwitch();
}
t_Er9xModelData::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
c9x.timers[0].dir = tmrDir;
c9x.timers[0].val = tmrVal;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = er9xToSource(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
for (int i=0; i<ER9X_MAX_MIXERS; i++) {
Er9xMixData mix = mixData[i];
c9x.mixData[i] = mix;
}
for (int i=0; i<ER9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
break;
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
pos = dr == 0 ? 1 : 0;
}
else {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
}
c9x.expoData[e].chn = ch;
if (expoData[ch].expo[pos][0][0]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
}
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
c9x.expoData[e++].mode = 3;
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
if (expoData[ch].expo[pos][0][1]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
}
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
}
}
}
}
for (int i=0; i<NUM_STICKS; i++)
c9x.phaseData[0].trim[i] = trim[i];
for (int i=0; i<ER9X_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<ER9X_MAX_CURVE9; i++) {
c9x.curves[ER9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[ER9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[ER9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<ER9X_NUM_CSW; 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.imperial=FrSkyImperial;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
+260
View File
@@ -0,0 +1,260 @@
/*
* 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 er9xeeprom_h
#define er9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
//eeprom data
#define ER9X_MAX_MIXERS 32
#define ER9X_MAX_CURVE5 8
#define ER9X_MAX_CURVE9 8
#define ER9X_MAX_CSFUNC 13
#define MDVERS 10
#define ER9X_NUM_CHNOUT 16 //number of real outputchannels CH1-CH8
#define ER9X_NUM_CSW 12 //number of custom switches
#define NUM_STICKSnPOTS 7 //number of sticks and pots
#define ER9X_MAX_GVARS 7
#define ER9X_MAX_MODES 4
PACK(typedef struct t_Er9xTrainerMix {
uint8_t srcChn:3; //0-7 = ch1-8
int8_t swtch:5;
int8_t studWeight:6;
uint8_t mode:2; // off, add-mode, subst-mode
operator TrainerMix();
t_Er9xTrainerMix();
}) Er9xTrainerMix; //
PACK(typedef struct t_Er9xTrainerData {
int16_t calib[4];
Er9xTrainerMix mix[4];
operator TrainerData();
t_Er9xTrainerData();
}) Er9xTrainerData;
PACK(typedef struct t_Er9xGeneral {
uint8_t myVers;
int16_t calibMid[NUM_STICKSnPOTS];
int16_t calibSpanNeg[NUM_STICKSnPOTS];
int16_t calibSpanPos[NUM_STICKSnPOTS];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t lightSw;
Er9xTrainerData trainer;
uint8_t view;
uint8_t disableThrottleWarning:1;
uint8_t disableSwitchWarning:1;
uint8_t disableMemoryWarning:1;
uint8_t beeperVal:3;
uint8_t reserveWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
int8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t disablePotScroll:1;
uint8_t disableBG:1;
uint8_t frskyinternalalarm:1;
uint8_t spare_filter ; // No longer needed, left for eepe compatibility for now
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
uint8_t unused1;
uint8_t unused2:4;
uint8_t hideNameOnSplash:1;
uint8_t enablePpmsim:1;
uint8_t blightinv:1;
uint8_t stickScroll:1;
uint8_t speakerPitch;
uint8_t hapticStrength;
uint8_t speakerMode;
uint8_t lightOnStickMove;
char ownerName[10];
uint8_t switchWarningStates;
uint8_t volume ;
uint8_t res[3];
uint8_t crosstrim:1;
uint8_t spare1:7;
operator GeneralSettings();
t_Er9xGeneral();
}) Er9xGeneral;
PACK(typedef struct t_Er9xExpoData {
int8_t expo[3][2][2];
int8_t drSw1;
int8_t drSw2;
t_Er9xExpoData() { memset(this, 0, sizeof(t_Er9xExpoData)); }
}) Er9xExpoData;
PACK(typedef struct t_Er9xLimitData {
int8_t min;
int8_t max;
bool revert;
int16_t offset;
operator LimitData();
t_Er9xLimitData();
}) Er9xLimitData;
#define MLTPX_ADD 0
#define MLTPX_MUL 1
#define MLTPX_REP 2
PACK(typedef struct t_Er9xMixData {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:2; // multiplex method 0=+ 1=* 2=replace
uint8_t lateOffset:1; // Add offset later
uint8_t mixWarn:2; // mixer warning
uint8_t enableFmTrim:1;
uint8_t differential:1;
int8_t sOffset;
int8_t res;
operator MixData();
t_Er9xMixData();
}) Er9xMixData;
PACK(typedef struct t_Er9xLogicalSwitchData { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func:4;
uint8_t andsw:4;
operator LogicalSwitchData();
t_Er9xLogicalSwitchData() { memset(this, 0, sizeof(t_Er9xLogicalSwitchData)); }
}) Er9xLogicalSwitchData;
PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
int8_t swtch;
int8_t val;
t_Er9xSafetySwData();
}) Er9xSafetySwData;
PACK(typedef struct t_Er9xFrSkyChannelData {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t type:2; // future use: 0=volts, ...
operator FrSkyChannelData();
t_Er9xFrSkyChannelData();
}) Er9xFrSkyChannelData;
PACK(typedef struct t_Er9xFrSkyData {
Er9xFrSkyChannelData channels[2];
operator FrSkyData();
t_Er9xFrSkyData();
}) Er9xFrSkyData;
PACK(typedef struct t_gvar {
int8_t gvar ;
uint8_t gvsource ;
// int8_t gvswitch ;
}) Er9xGvarData ;
PACK(typedef struct t_PhaseData {
// Trim store as -1001 to -1, trim value-501, 0-5 use trim of phase 0-5
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of modes 1|2|3|4 instead
int8_t swtch; // Try 0-5 use trim of phase 0-5, 1000-2000, trim + 1500 ???
uint8_t fadeIn:4;
uint8_t fadeOut:4;
}) Er9xPhaseData;
PACK(typedef struct t_Er9xModelData {
char name[10]; // 10 must be first for eeLoadModelName
uint8_t modelVoice ; // Index to model name voice (260+value)
int8_t tmrMode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint8_t tmrDir:1; //0=>Count Down, 1=>Count Up
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
uint8_t t2throttle:1 ; // Start timer2 using throttle
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
uint8_t FrSkyAltAlarm:2;
uint16_t tmrVal;
uint8_t protocol;
int8_t ppmNCH;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t xnumBlades:2; // RPM scaling
uint8_t spare10:1;
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t ppmStart:3 ; // Start channel for PPM
int8_t trimInc; // Trim Increments
int8_t ppmDelay;
int8_t trimSw;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t swashInvertELE:1;
uint8_t swashInvertAIL:1;
uint8_t swashInvertCOL:1;
uint8_t swashType:3;
uint8_t swashCollectiveSource;
uint8_t swashRingValue;
int8_t ppmFrameLength;
Er9xMixData mixData[ER9X_MAX_MIXERS];
Er9xLimitData limitData[ER9X_NUM_CHNOUT];
Er9xExpoData expoData[4];
int8_t trim[4];
int8_t curves5[ER9X_MAX_CURVE5][5];
int8_t curves9[ER9X_MAX_CURVE9][9];
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
uint8_t frSkyVoltThreshold ;
int8_t tmrModeB;
uint8_t numVoice;
Er9xSafetySwData safetySw[ER9X_NUM_CHNOUT];
Er9xFrSkyData frsky;
uint8_t numBlades ;
uint8_t unused1[8] ;
uint8_t CustomDisplayIndex[6] ;
Er9xGvarData gvars[ER9X_MAX_GVARS] ;
Er9xPhaseData phaseData[ER9X_MAX_MODES] ;
operator ModelData();
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
}) Er9xModelData;
#endif
@@ -0,0 +1,323 @@
/*
* 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 <iostream>
#include "er9xinterface.h"
#include "er9xeeprom.h"
#include "er9xsimulator.h"
#include "file.h"
#include "appdata.h"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
#define FILE_GENERAL 0
#define FILE_MODEL(n) (1+n)
Er9xInterface::Er9xInterface():
EEPROMInterface(BOARD_STOCK),
efile(new RleFile())
{
}
Er9xInterface::~Er9xInterface()
{
delete efile;
}
const char * Er9xInterface::getName()
{
return "Er9x";
}
const int Er9xInterface::getEEpromSize()
{
QString avrMCU = g.mcu();
if (avrMCU==QString("m128")) {
return 2*EESIZE_STOCK;
}
return EESIZE_STOCK;
}
const int Er9xInterface::getMaxModels()
{
return 16;
}
inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
{
for (int i=0; i<2; i++) {
int stick = applyStickMode(i+1, mode) - 1;
{
int tmp = model.trim[i];
model.trim[i] = model.trim[stick];
model.trim[stick] = tmp;
}
{
Er9xExpoData tmp = model.expoData[i];
model.expoData[i] = model.expoData[stick];
model.expoData[stick] = tmp;
}
}
for (int i=0; i<ER9X_MAX_MIXERS; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ER9X_NUM_CSW; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
}
}
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
Er9xGeneral er9xGeneral;
memset(&er9xGeneral,0,sizeof(er9xGeneral));
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
return false;
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
}
for(int i=0; i<getMaxModels(); i++)
{
Er9xModelData er9xModel;
memset(&er9xModel,0,sizeof(er9xModel));
if(loadModelDataXML(&doc, &er9xModel, i)) {
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = er9xModel;
}
}
std::cout << "ok\n";
return true;
}
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
efile->openRd(FILE_GENERAL);
Er9xGeneral er9xGeneral;
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
switch(er9xGeneral.myVers) {
case 3:
std::cout << "(old gruvin9x) ";
case 4:
// case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
break;
default:
std::cout << "not er9x\n";
return false;
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
return false;
}
radioData.generalSettings = er9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
Er9xModelData er9xModel;
efile->openRd(FILE_MODEL(i));
if (!efile->readRlc1((uint8_t*)&er9xModel, sizeof(Er9xModelData))) {
radioData.models[i].clear();
}
else {
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = er9xModel;
}
}
std::cout << "ok\n";
return true;
}
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
}
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Er9xInterface::getSize(ModelData &model)
{
return 0;
}
int Er9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Er9xInterface::isAvailable(Protocol prot, int port)
{
switch (prot) {
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
return 1;
default:
return 0;
}
}
void Er9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
{
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(value);
e.appendChild(t);
pe->appendChild(e);
}
void Er9xInterface::appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite)
{
if(value || forceZeroWrite) {
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(QString("%1").arg(value));
e.appendChild(t);
pe->appendChild(e);
}
}
void Er9xInterface::appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size)
{
QDomElement e = qdoc->createElement(name);
QDomCDATASection t = qdoc->createCDATASection(name);
t.setData(QByteArray(data, size).toBase64());
e.appendChild(t);
pe->appendChild(e);
}
QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
return gd;
}
QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver)
{
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::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
return md;
}
bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
{
//look for "GENERAL_DATA" tag
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
if(gde.isNull()) // couldn't find
return false;
//load cdata into tgen
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tgen, data, sizeof(Er9xGeneral));
break;
}
n = n.nextSibling();
}
//check version?
return true;
}
bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum)
{
//look for MODEL_DATA with modelNum attribute.
//if modelNum = -1 then just pick the first one
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
//cycle through nodes to find correct model number
QDomNode k = ndl.at(0);
if(modelNum>=0) {
while(!k.isNull()) {
int a = k.toElement().attribute("number").toInt();
if(a==modelNum)
break;
k = k.nextSibling();
}
}
if(k.isNull()) // couldn't find
return false;
//load cdata into tgen
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tmod, data, sizeof(Er9xModelData));
break;
}
n = n.nextSibling();
}
//check version?
return true;
}
@@ -0,0 +1,72 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef er9x_interface_h
#define er9x_interface_h
#include <QtXml>
#include "eeprominterface.h"
#include "er9xeeprom.h"
class RleFile;
class Er9xInterface : public EEPROMInterface
{
public:
Er9xInterface();
virtual ~Er9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual 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(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
protected:
RleFile *efile;
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
};
#endif
@@ -0,0 +1,224 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "firmwares/er9x/er9xsimulator.h"
#include "firmwares/er9x/er9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define FRSKY
#define PHASES
#undef min
#undef max
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#include <exception>
namespace Er9x {
#include "simpgmspace.h"
#include "er9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "simpgmspace.cpp"
#include "templates.cpp"
#include "frsky.cpp"
#include "audio.cpp"
uint8_t pxxFlag = 0;
int16_t g_anas[7];
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define GPIO_TRIM_LH_L pind
#define GPIO_TRIM_LV_DN pind
#define GPIO_TRIM_RV_UP pind
#define GPIO_TRIM_RH_L pind
#define GPIO_TRIM_LH_R pind
#define GPIO_TRIM_LV_UP pind
#define GPIO_TRIM_RV_DN pind
#define GPIO_TRIM_RH_R pind
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
#define TRIM_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin &= ~(mask); else pin |= (mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
switch (swtch) {
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
default:
break;
}
}
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
}
}
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Er9x;
Er9xSimulator::Er9xSimulator(Er9xInterface * er9xInterface):
er9xInterface(er9xInterface)
{
}
bool Er9xSimulator::timer10ms()
{
AUDIO_DRIVER(); // the tone generator
AUDIO_HEARTBEAT(); // the queue processing
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Er9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::start(RadioData &radioData, bool tests)
{
er9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Er9xSimulator::stop()
{
StopMainThread();
}
void Er9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
outputs.beep = audio.busy();
}
void Er9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::setTrim(unsigned int idx, int value)
{
Er9x::setTrim(idx, value);
}
void Er9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Er9x::getTrims(trims.values);
}
const char * Er9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,62 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef er9x_simulator_h
#define er9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Er9xInterface;
class Er9xSimulator : public SimulatorInterface {
public:
Er9xSimulator(Er9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Er9xInterface * er9xInterface;
};
#endif
@@ -0,0 +1,734 @@
#include <algorithm>
#include "helpers.h"
#include "ersky9xeeprom.h"
#include <QObject>
extern RawSwitch er9xToSwitch(int8_t sw);
RawSwitch getErSky9xTimerMode(int mode)
{
if (mode<4)
return RawSwitch(SWITCH_TYPE_TIMER_MODE, mode);
else
return RawSwitch();
}
RawSwitch ersky9xToSwitch(int8_t sw)
{
uint8_t swa = abs(sw);
if (swa == 0)
return RawSwitch(SWITCH_TYPE_NONE);
else if (swa <= 9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
else if (swa <= 33)
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
else if (sw == 34)
return RawSwitch(SWITCH_TYPE_ON);
else if (sw == -34)
return RawSwitch(SWITCH_TYPE_OFF);
else if (swa <= 34+9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw > 0 ? sw-34 : sw+34);
else
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-34-9 : sw+34+9);
}
t_Ersky9xTrainerMix::t_Ersky9xTrainerMix()
{
memset(this, 0, sizeof(t_Ersky9xTrainerMix));
}
t_Ersky9xTrainerMix::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.swtch = er9xToSwitch(swtch);
c9x.weight = (25 * studWeight) / 8;
c9x.mode = mode;
return c9x;
}
t_Ersky9xTrainerData::t_Ersky9xTrainerData()
{
memset(this, 0, sizeof(t_Ersky9xTrainerData));
}
t_Ersky9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
t_Ersky9xGeneral::t_Ersky9xGeneral()
{
memset(this, 0, sizeof(t_Ersky9xGeneral));
}
Ersky9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
result.version = myVers;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
else if (lightOnStickMove) {
result.backlightMode |= 2;
result.backlightDelay = lightOnStickMove;
}
result.trainer = trainer;
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
case 0:
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
result.inactivityTimer = inactivityTimer + 10;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.disablePotScroll=(disablePotScroll==1);
result.disableBG=(disableBG==1);
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
result.optrexDisplay = optrexDisplay;
result.speakerPitch = speakerPitch;
result.hapticStrength = hapticStrength - 3;
result.speakerMode = speakerMode;
result.switchWarningStates = switchWarningStates;
result.speakerVolume = volume;
result.backlightBright = bright ;
result.currentCalib = current_calib;
return result;
}
t_Ersky9xLimitData::t_Ersky9xLimitData()
{
memset(this, 0, sizeof(t_Ersky9xLimitData));
}
t_Ersky9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.revert = revert;
c9x.offset = offset;
return c9x;
}
t_Ersky9xMixData_v10::t_Ersky9xMixData_v10()
{
memset(this, 0, sizeof(t_Ersky9xMixData_v10));
}
t_Ersky9xMixData_v10::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
c9x.weight = weight;
c9x.swtch = er9xToSwitch(swtch);
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw == 8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 9) {
if (swtch < 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
c9x.weight = -weight;
}
else if (swtch > 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
if (mltpx != MLTPX_REP)
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
}
else if (srcRaw == 37) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 12) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
}
else if (srcRaw <= 20) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
// c9x.enableFmTrim=enableFmTrim;
c9x.sOffset = sOffset;
return c9x;
}
t_Ersky9xMixData_v11::t_Ersky9xMixData_v11()
{
memset(this, 0, sizeof(t_Ersky9xMixData_v11));
}
t_Ersky9xMixData_v11::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
c9x.weight = weight;
c9x.swtch = ersky9xToSwitch(swtch);
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw == 8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 9) {
if (swtch < 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
c9x.weight = -weight;
}
else if (swtch > 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
if (mltpx != MLTPX_REP)
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
}
else if (srcRaw == 45) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw > 45) {
c9x.srcRaw = RawSource(SOURCE_TYPE_GVAR, srcRaw-46);
}
else if (srcRaw <= 12) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
}
else if (srcRaw <= 20) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
// c9x.enableFmTrim=enableFmTrim;
c9x.sOffset = sOffset;
return c9x;
}
RawSource ersky9xToSource_v10(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value == 9) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
RawSource ersky9xToSource_v11(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value == 9) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
Ersky9xLogicalSwitchData_v10::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = ersky9xToSource_v10(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = ersky9xToSource_v10(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = er9xToSwitch(v1).toValue();
c9x.val2 = er9xToSwitch(v2).toValue();
}
return c9x;
}
Ersky9xLogicalSwitchData_v11::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = ersky9xToSource_v11(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = ersky9xToSource_v11(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = er9xToSwitch(v1).toValue();
c9x.val2 = er9xToSwitch(v2).toValue();
}
return c9x;
}
t_Ersky9xSafetySwData_v10::t_Ersky9xSafetySwData_v10()
{
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v10));
}
t_Ersky9xSafetySwData_v11::t_Ersky9xSafetySwData_v11()
{
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v11));
}
t_Ersky9xFrSkyChannelData_v10::t_Ersky9xFrSkyChannelData_v10()
{
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v10));
}
t_Ersky9xFrSkyChannelData_v10::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
c9x.ratio = ratio;
c9x.alarms[0].value = alarms_value[0];
c9x.alarms[0].level = alarms_level & 3;
c9x.alarms[0].greater = alarms_greater & 1;
c9x.alarms[1].value = alarms_value[1];
c9x.alarms[1].level = (alarms_level >> 2) & 3;
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
if (type==2) {
c9x.type = 0;
c9x.multiplier=1;
} else {
c9x.type = type;
}
return c9x;
}
t_Ersky9xFrSkyChannelData_v11::t_Ersky9xFrSkyChannelData_v11()
{
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v11));
}
t_Ersky9xFrSkyChannelData_v11::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
c9x.ratio = ratio;
c9x.alarms[0].value = alarms_value[0];
c9x.alarms[0].level = alarms_level & 3;
c9x.alarms[0].greater = alarms_greater & 1;
c9x.alarms[1].value = alarms_value[1];
c9x.alarms[1].level = (alarms_level >> 2) & 3;
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
if (type==2) {
c9x.type = 0;
c9x.multiplier=1;
} else {
c9x.type = type;
}
return c9x;
}
t_Ersky9xFrSkyData_v10::t_Ersky9xFrSkyData_v10()
{
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v10));
}
t_Ersky9xFrSkyData_v10::operator FrSkyData ()
{
FrSkyData c9x;
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
return c9x;
}
t_Ersky9xFrSkyData_v11::t_Ersky9xFrSkyData_v11()
{
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v11));
}
t_Ersky9xFrSkyData_v11::operator FrSkyData ()
{
FrSkyData c9x;
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
return c9x;
}
t_Ersky9xModelData_v10::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = ersky9xToSource_v10(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
c9x.limitData[i] = limitData[i];
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
break;
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
pos = dr == 0 ? 1 : 0;
}
else {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
}
c9x.expoData[e].chn = ch;
if (expoData[ch].expo[pos][0][0]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
}
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
c9x.expoData[e++].mode = 3;
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
if (expoData[ch].expo[pos][0][1]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
}
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
}
}
}
}
for (int i=0; i<NUM_STICKS; i++)
c9x.phaseData[0].trim[i] = trim[i];
for (int i=0; i<ERSKY9X_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<ERSKY9X_MAX_CURVE9; i++) {
c9x.curves[ERSKY9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<ERSKY9X_NUM_CSW_V10; 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.imperial=FrSkyImperial;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
return c9x;
}
t_Ersky9xModelData_v11::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = ersky9xToSource_v11(swashCollectiveSource);
c9x.swashRingData.value = swashRingValue;
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
c9x.limitData[i] = limitData[i];
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
break;
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
pos = dr == 0 ? 1 : 0;
}
else {
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
}
c9x.expoData[e].chn = ch;
if (expoData[ch].expo[pos][0][0]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
}
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
c9x.expoData[e++].mode = 3;
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
if (expoData[ch].expo[pos][0][1]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
}
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
}
}
}
}
for (int i=0; i<NUM_STICKS; i++)
c9x.phaseData[0].trim[i] = trim[i];
for (int i=0; i<ERSKY9X_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<ERSKY9X_MAX_CURVE9; i++) {
c9x.curves[ERSKY9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
c9x.customSw[i] = customSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.frsky = frsky;
c9x.frsky.usrProto=FrSkyUsrProto;
c9x.frsky.imperial=FrSkyImperial;
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
// for (int i=0; i<8; i++) {
// c9x.frskyalarms[i].frskyAlarmLimit=frskyAlarms.alarmData[i].frskyAlarmLimit;
// c9x.frskyalarms[i].frskyAlarmSound=frskyAlarms.alarmData[i].frskyAlarmSound;
// c9x.frskyalarms[i].frskyAlarmType=frskyAlarms.alarmData[i].frskyAlarmType;
// }
// for (int i=0; i<8; i++) {
// c9x.customdisplay[i]=customDisplayIndex[i];
// }
for (int i=0; i<5;i++) {
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
// c9x.gvsource[i]=gvars[i].gvsource;
}
return c9x;
}
@@ -0,0 +1,431 @@
/*
* 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 ersky9xeeprom_h
#define ersky9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
extern RawSwitch getEr9xTimerMode(int mode);
//eeprom data
#define ERSKY9X_MAX_MIXERS_V10 32
#define ERSKY9X_MAX_MIXERS_V11 48
#define ERSKY9X_MAX_CURVE5 8
#define ERSKY9X_MAX_CURVE9 8
#define ERSKY9X_MAX_CSFUNC 13
#define ERSKY9X_MDVERS10 10
#define ERSKY9X_MDVERS11 11
#define ERSKY9X_GENERAL_OWNER_NAME_LEN 10
#define ERSKY9X_NUM_CHNOUT_V10 16 //number of real outputchannels CH1-CH8
#define ERSKY9X_NUM_CHNOUT_V11 24 //number of real outputchannels CH1-CH8
#define ERSKY9X_NUM_CSW_V10 12 //number of custom switches
#define ERSKY9X_NUM_CSW_V11 24
#define ERSKY9X_NUM_FSW 16
#define ERSKY9X_NUM_VOICE 8
#define ERSKY9X_MAX_GVARS 7
#define NUM_STICKSnPOTS 7 //number of sticks and pots
PACK(typedef struct t_Ersky9xTrainerMix {
uint8_t srcChn:3; //0-7 = ch1-8
int8_t swtch:5;
int8_t studWeight:6;
uint8_t mode:2; // off, add-mode, subst-mode
operator TrainerMix();
t_Ersky9xTrainerMix();
}) Ersky9xTrainerMix; //
PACK(typedef struct t_Ersky9xTrainerData {
int16_t calib[4];
Ersky9xTrainerMix mix[4];
operator TrainerData();
t_Ersky9xTrainerData();
}) Ersky9xTrainerData;
PACK(typedef struct t_Ersky9xGeneral {
uint8_t myVers;
int16_t calibMid[NUM_STICKSnPOTS];
int16_t calibSpanNeg[NUM_STICKSnPOTS];
int16_t calibSpanPos[NUM_STICKSnPOTS];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t lightSw;
Ersky9xTrainerData trainer;
uint8_t view;
uint8_t disableThrottleWarning:1;
uint8_t disableSwitchWarning:1;
uint8_t disableMemoryWarning:1;
uint8_t beeperVal:3;
uint8_t reserveWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
int8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t disablePotScroll:1;
uint8_t disableBG:1;
uint8_t res1:1;
uint8_t filterInput;
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
uint8_t FRSkyYellow:4;
uint8_t FRSkyOrange:4;
uint8_t FRSkyRed:4; //mike please check these are correct
uint8_t hideNameOnSplash:1;
uint8_t optrexDisplay:1;
uint8_t spare:2;
uint8_t speakerPitch;
uint8_t hapticStrength;
uint8_t speakerMode;
uint8_t lightOnStickMove;
char ownerName[10];
uint8_t switchWarningStates;
uint8_t volume ;
uint8_t bright ; // backlight
uint8_t stickGain;
uint8_t mAh_alarm ;
uint16_t mAh_used ;
uint16_t run_time ;
int8_t current_calib ;
uint8_t bt_baudrate ;
uint8_t rotaryDivisor ;
operator GeneralSettings();
t_Ersky9xGeneral();
}) Ersky9xGeneral;
PACK(typedef struct t_Ersky9xExpoData {
int8_t expo[3][2][2];
int8_t drSw1;
int8_t drSw2;
t_Ersky9xExpoData() { memset(this, 0, sizeof(t_Ersky9xExpoData)); }
}) Ersky9xExpoData;
PACK(typedef struct t_Ersky9xLimitData {
int8_t min;
int8_t max;
bool revert;
int16_t offset;
operator LimitData();
t_Ersky9xLimitData() ;
}) Ersky9xLimitData;
#define MLTPX_ADD 0
#define MLTPX_MUL 1
#define MLTPX_REP 2
PACK(typedef struct t_Ersky9xMixData_v10 {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
uint8_t mixWarn:2; // mixer warning
uint8_t enableFmTrim:1;
uint8_t mixres:1;
int8_t sOffset;
int8_t res;
operator MixData();
t_Ersky9xMixData_v10();
}) Ersky9xMixData_v10;
PACK(typedef struct t_Ersky9xMixData_v11 {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
uint8_t delayUp;
uint8_t delayDown;
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
uint8_t mixWarn:2; // mixer warning
uint8_t enableFmTrim:1;
uint8_t mixres:1;
int8_t sOffset;
uint8_t res[4];
operator MixData();
t_Ersky9xMixData_v11();
}) Ersky9xMixData_v11;
PACK(typedef struct t_Ersky9xLogicalSwitchData_v10 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Ersky9xLogicalSwitchData_v10() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
}) Ersky9xLogicalSwitchData_v10;
PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
uint8_t andsw;
uint8_t res ;
operator LogicalSwitchData();
t_Ersky9xLogicalSwitchData_v11() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
}) Ersky9xLogicalSwitchData_v11;
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
int8_t swtch;
int8_t val;
t_Ersky9xSafetySwData_v10();
}) Ersky9xSafetySwData_v10;
PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
union opt {
struct ss {
int8_t swtch ;
uint8_t mode ;
int8_t val ;
uint8_t res ;
} ss ;
struct vs {
uint8_t vswtch ;
uint8_t vmode ; // ON, OFF, BOTH, 15Secs, 30Secs, 60Secs, Varibl
uint8_t vval;
uint8_t vres ;
} vs ;
} opt ;
t_Ersky9xSafetySwData_v11();
}) Ersky9xSafetySwData_v11;
PACK(typedef struct t_Ersky9xgvar {
int8_t gvar ;
uint8_t gvsource ;
// int8_t gvswitch ;
}) Ersky9xGvarData ;
PACK(typedef struct t_Ersky9xPhaseData {
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
uint16_t spare ; // Future expansion
}) Ersky9xPhaseData;
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
int8_t swtch; //input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
}) 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.
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t type:2; // future use: 0=volts, ...
operator FrSkyChannelData();
t_Ersky9xFrSkyChannelData_v10();
}) Ersky9xFrSkyChannelData_v10;
PACK(typedef struct t_Ersky9xFrSkyData_v10 {
Ersky9xFrSkyChannelData_v10 channels[2];
operator FrSkyData();
t_Ersky9xFrSkyData_v10();
}) Ersky9xFrSkyData_v10;
PACK(typedef struct t_Ersky9xFrSkyChannelData_v11 {
uint8_t ratio ; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t offset ; //
uint8_t gain ; //
uint8_t alarms_value[2] ; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level ;
uint8_t alarms_greater ; // 0=LT(<), 1=GT(>)
uint8_t type ; // 0=volts, 1=raw, 2=volts*2, 3=Amps
operator FrSkyChannelData();
t_Ersky9xFrSkyChannelData_v11();
}) Ersky9xFrSkyChannelData_v11;
PACK(typedef struct t_Ersky9xFrSkyData_v11 {
Ersky9xFrSkyChannelData_v11 channels[2];
operator FrSkyData();
t_Ersky9xFrSkyData_v11();
}) Ersky9xFrSkyData_v11;
PACK(typedef struct t_Ersky9xFrSkyalarms_v11 {
uint8_t frskyAlarmType ;
uint8_t frskyAlarmLimit ;
uint8_t frskyAlarmSound ;
}) Ersky9xFrSkyAlData_v11;
PACK(typedef struct t_Ersky9xFrSkyAlarmData_v11 {
Ersky9xFrSkyAlData_v11 alarmData[8] ;
}) Ersky9xFrSkyAlarmData_v11;
PACK(typedef struct t_Ersky9xTimerMode_v10 {
uint8_t tmrModeA:7 ; // timer trigger source -> off, abs, stk, stk%, cx%
uint8_t tmrDir:1 ; // Timer direction
int8_t tmrModeB ; // timer trigger source -> !sw, none, sw, m_sw
uint16_t tmrVal ;
}) Ersky9xTimerMode_v10;
PACK(typedef struct t_Ersky9xTimerMode_v11 {
uint8_t tmrModeA:7 ; // timer trigger source -> off, abs, stk, stk%, cx%
uint8_t tmrDir:1 ; // Timer direction
int8_t tmrModeB ; // timer trigger source -> !sw, none, sw, m_sw
uint16_t tmrVal ;
}) Ersky9xTimerMode_v11;
PACK(typedef struct te_Ersky9xswVoice {
uint8_t swtch ;
uint8_t mode ; // ON, OFF, BOTH, 15Secs, 30Secs, 60Secs
uint8_t val ;
uint8_t vres ;
}) Ersky9xvoiceSwData ;
PACK(typedef struct t_Ersky9xModelData_v10 {
char name[10]; // 10 must be first for eeLoadModelName
uint8_t reserved_spare; //used to be MDVERS - now depreciated
int8_t spare21; // was timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
// uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
// uint8_t tmrDir:1; // was tmrDir, now use tmrVal>0 => count down
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
uint8_t spare22:1 ; // Start timer2 using throttle
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
uint8_t FrSkyAltAlarm:2;
uint16_t spare_u16 ; // Was timerval
uint8_t protocol;
int8_t ppmNCH;
int8_t thrTrim:4; // Enable Throttle Trim
int8_t thrExpo:4; // Enable Throttle Expo
int8_t trimInc; // Trim Increments
int8_t ppmDelay;
int8_t trimSw;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t swashInvertELE:1;
uint8_t swashInvertAIL:1;
uint8_t swashInvertCOL:1;
uint8_t swashType:3;
uint8_t swashCollectiveSource;
uint8_t swashRingValue;
int8_t ppmFrameLength; //0=22.5 (10msec-30msec) 0.5msec increments
Ersky9xMixData_v10 mixData[ERSKY9X_MAX_MIXERS_V10];
Ersky9xLimitData limitData[ERSKY9X_NUM_CHNOUT_V10];
Ersky9xExpoData expoData[4];
int8_t trim[4];
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
uint8_t frSkyVoltThreshold ;
uint8_t res3[2];
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
Ersky9xFrSkyData_v10 frsky;
Ersky9xTimerMode_v10 timer[2] ;
operator ModelData();
t_Ersky9xModelData_v10() { memset(this, 0, sizeof(t_Ersky9xModelData_v10)); }
}) Ersky9xModelData_v10;
PACK(typedef struct t_Ersky9xModelData_v11 {
char name[10]; // 10 must be first for eeLoadModelName
uint8_t modelVoice ; // Index to model name voice (261+value)
uint8_t RxNum ; // was timer trigger source, now RxNum for model match
uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
uint8_t spare22:1 ; // Start timer2 using throttle
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
uint8_t FrSkyAltAlarm:2;
uint8_t version ;
uint8_t protocol;
int8_t ppmNCH;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t numBlades:2; // RPM scaling
uint8_t spare10:1;
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t spare11:3;
int8_t trimInc; // Trim Increments
int8_t ppmDelay;
int8_t trimSw;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t swashInvertELE:1;
uint8_t swashInvertAIL:1;
uint8_t swashInvertCOL:1;
uint8_t swashType:3;
uint8_t swashCollectiveSource;
uint8_t swashRingValue;
int8_t ppmFrameLength; //0=22.5 (10msec-30msec) 0.5msec increments
Ersky9xMixData_v11 mixData[ERSKY9X_MAX_MIXERS_V11];
Ersky9xLimitData limitData[ERSKY9X_NUM_CHNOUT_V11];
Ersky9xExpoData expoData[4];
int8_t trim[4];
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
int8_t curvexy[18];
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
uint8_t frSkyVoltThreshold ;
uint8_t bt_telemetry;
uint8_t numVoice; // 0-16, rest are Safety switches
Ersky9xSafetySwData_v11 safetySw[ERSKY9X_NUM_CHNOUT_V11];
Ersky9xvoiceSwData voiceSwitches[ERSKY9X_NUM_VOICE] ;
Ersky9xFrSkyData_v11 frsky;
Ersky9xTimerMode_v11 timer[2] ;
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
// Add 6 bytes for custom telemetry screen
uint8_t customDisplayIndex[6] ;
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
Ersky9xPhaseData phaseData[6] ;
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
operator ModelData();
t_Ersky9xModelData_v11() { memset(this, 0, sizeof(t_Ersky9xModelData_v11)); }
}) Ersky9xModelData_v11;
#endif
@@ -0,0 +1,372 @@
/*
* 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 <iostream>
#include <QMessageBox>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "ersky9xsimulator.h"
#include "file.h"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
/// fileId of general file
#define FILE_GENERAL 0
/// convert model number 0..MAX_MODELS-1 int fileId
#define FILE_MODEL(n) (1+n)
#define FILE_TMP (1+16)
Ersky9xInterface::Ersky9xInterface():
EEPROMInterface(BOARD_SKY9X),
efile(new RleFile())
{
}
Ersky9xInterface::~Ersky9xInterface()
{
delete efile;
}
const char * Ersky9xInterface::getName()
{
return "Ersky9x";
}
const int Ersky9xInterface::getEEpromSize()
{
return EESIZE_SKY9X;
}
const int Ersky9xInterface::getMaxModels()
{
return 20;
}
inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mode)
{
for (int i=0; i<2; i++) {
int stick = applyStickMode(i+1, mode) - 1;
{
int tmp = model.trim[i];
model.trim[i] = model.trim[stick];
model.trim[stick] = tmp;
}
{
Ersky9xExpoData tmp = model.expoData[i];
model.expoData[i] = model.expoData[stick];
model.expoData[stick] = tmp;
}
}
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
}
}
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mode)
{
for (int i=0; i<2; i++) {
int stick = applyStickMode(i+1, mode) - 1;
{
int tmp = model.trim[i];
model.trim[i] = model.trim[stick];
model.trim[stick] = tmp;
}
{
Ersky9xExpoData tmp = model.expoData[i];
model.expoData[i] = model.expoData[stick];
model.expoData[stick] = tmp;
}
}
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
break;
default:
break;
}
}
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
Ersky9xGeneral ersky9xGeneral;
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
return false;
}
else {
radioData.generalSettings=ersky9xGeneral;
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
}
for(int i=0; i<getMaxModels(); i++) {
if (ersky9xGeneral.myVers == 10) {
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
}
}
}
std::cout << "ok\n";
return true;
}
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
if (size != EESIZE_SKY9X) {
std::cout << "wrong size\n";
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
return false;
}
efile->openRd(FILE_GENERAL);
Ersky9xGeneral ersky9xGeneral;
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
switch(ersky9xGeneral.myVers) {
case 10:
break;
case 11:
break;
default:
std::cout << "not ersky9x\n";
return false;
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
return false;
}
radioData.generalSettings = ersky9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
uint8_t buffer[4096];
uint size;
memset(buffer,0,sizeof(buffer));
efile->openRd(FILE_MODEL(i));
// if (!efile->readRlc2((uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData))) {
size=efile->readRlc2(buffer, 4096);
if (!size) {
radioData.models[i].clear();
}
else {
if (size<720) {
Ersky9xModelData_v10 ersky9xModel;
memcpy(&ersky9xModel, buffer, sizeof(ersky9xModel));
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = ersky9xModel;
} else {
Ersky9xModelData_v11 ersky9xModel;
memcpy(&ersky9xModel, buffer, sizeof(ersky9xModel));
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = ersky9xModel;
}
}
}
std::cout << "ok\n";
return true;
}
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
}
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Ersky9xInterface::getSize(ModelData &model)
{
return 0;
}
int Ersky9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Ersky9xInterface::isAvailable(Protocol prot, int port)
{
switch (prot) {
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
return 1;
default:
return 0;
}
}
void Ersky9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
{
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(value);
e.appendChild(t);
pe->appendChild(e);
}
void Ersky9xInterface::appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite)
{
if(value || forceZeroWrite) {
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(QString("%1").arg(value));
e.appendChild(t);
pe->appendChild(e);
}
}
void Ersky9xInterface::appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size)
{
QDomElement e = qdoc->createElement(name);
QDomCDATASection t = qdoc->createCDATASection(name);
t.setData(QByteArray(data, size).toBase64());
e.appendChild(t);
pe->appendChild(e);
}
QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
return gd;
}
QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver)
{
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::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
return md;
}
bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
{
//look for "GENERAL_DATA" tag
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
if(gde.isNull()) // couldn't find
return false;
//load cdata into tgen
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
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;
}
n = n.nextSibling();
}
//check version?
return true;
}
template <class T>
bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, int modelNum, int stickMode)
{
T ersky9xModel;
memset(&ersky9xModel, 0, sizeof(ersky9xModel));
//look for MODEL_DATA with modelNum attribute.
//if modelNum = -1 then just pick the first one
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
//cycle through nodes to find correct model number
QDomNode k = ndl.at(0);
if (modelNum>=0) {
while(!k.isNull()) {
int a = k.toElement().attribute("number").toInt();
if(a==modelNum)
break;
k = k.nextSibling();
}
}
if (k.isNull()) // couldn't find
return false;
//load cdata into tgen
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
break;
}
n = n.nextSibling();
}
applyStickModeToModel(ersky9xModel, stickMode);
*model = ersky9xModel;
return true;
}
@@ -0,0 +1,73 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ersky9x_interface_h
#define ersky9x_interface_h
#include <QtXml>
#include "eeprominterface.h"
#include "ersky9xeeprom.h"
class RleFile;
class Ersky9xInterface : public EEPROMInterface
{
public:
Ersky9xInterface();
virtual ~Ersky9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual 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(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
protected:
RleFile *efile;
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
QDomElement getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); //parse out data to XML format
QDomElement getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
template <class T>
bool loadModelDataXML(QDomDocument * qdoc, ModelData * model, int modelNum, int stickMode); // get data from XML
};
#endif
@@ -0,0 +1,247 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "firmwares/ersky9x/ersky9xsimulator.h"
#include "firmwares/ersky9x/ersky9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSKY9X
#define PCBSKY
#define STAMP
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define TEMPLATES
#define HELI
#define HAPTIC
#define AUDIO
#define REVB
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#undef min
#undef max
#include <exception>
namespace Ersky9x {
#include "../ersky9x/timers.h"
#include "../ersky9x/ersky9x.cpp"
#include "../ersky9x/stamp.cpp"
#include "../ersky9x/menus.cpp"
#include "../ersky9x/pers.cpp"
#include "../ersky9x/file.cpp"
#include "../ersky9x/lcd.cpp"
#include "../ersky9x/drivers.cpp"
#include "../ersky9x/logicio.cpp"
#include "../ersky9x/timers.cpp"
#include "../ersky9x/simpgmspace.cpp"
#include "../ersky9x/templates.cpp"
#include "../ersky9x/frsky.cpp"
#include "../ersky9x/audio.cpp"
#include "../ersky9x/sound.cpp"
#include "../ersky9x/diskio.cpp"
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
//uint8_t pxxFlag = 0;
int16_t g_anas[7];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin |= (mask); else pin &= ~(mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state < 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
switch (swtch) {
SWITCH_CASE(0, PIOC->PIO_PDSR, 1<<20)
SWITCH_CASE(1, PIOA->PIO_PDSR, 1<<15)
SWITCH_CASE(2, PIOC->PIO_PDSR, 1<<31)
SWITCH_3_CASE(3, PIOC->PIO_PDSR, PIOC->PIO_PDSR, 0x00004000, 0x00000800)
SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2)
SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16)
SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8)
default:
break;
}
}
#define GPIO_BUTTON_MENU PIOB->PIO_PDSR
#define GPIO_BUTTON_EXIT PIOC->PIO_PDSR
#define GPIO_BUTTON_UP PIOC->PIO_PDSR
#define GPIO_BUTTON_DOWN PIOC->PIO_PDSR
#define GPIO_BUTTON_RIGHT PIOC->PIO_PDSR
#define GPIO_BUTTON_LEFT PIOC->PIO_PDSR
#define PIN_BUTTON_MENU 0x00000020
#define PIN_BUTTON_EXIT 0x01000000
#define PIN_BUTTON_UP 0x00000002
#define PIN_BUTTON_DOWN 0x00000020
#define PIN_BUTTON_RIGHT 0x00000010
#define PIN_BUTTON_LEFT 0x00000008
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin &= ~mask; else pin |= mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, GPIO_BUTTON_MENU, PIN_BUTTON_MENU)
KEY_CASE(KEY_EXIT, GPIO_BUTTON_EXIT, PIN_BUTTON_EXIT)
KEY_CASE(KEY_RIGHT, GPIO_BUTTON_RIGHT, PIN_BUTTON_RIGHT)
KEY_CASE(KEY_LEFT, GPIO_BUTTON_LEFT, PIN_BUTTON_LEFT)
KEY_CASE(KEY_UP, GPIO_BUTTON_UP, PIN_BUTTON_UP)
KEY_CASE(KEY_DOWN, GPIO_BUTTON_DOWN, PIN_BUTTON_DOWN)
}
}
#define GPIO_TRIM_LH_L PIOA->PIO_PDSR
#define GPIO_TRIM_LV_DN PIOA->PIO_PDSR
#define GPIO_TRIM_RV_UP PIOA->PIO_PDSR
#define GPIO_TRIM_RH_L PIOA->PIO_PDSR
#define GPIO_TRIM_LH_R PIOB->PIO_PDSR
#define GPIO_TRIM_LV_UP PIOC->PIO_PDSR
#define GPIO_TRIM_RV_DN PIOC->PIO_PDSR
#define GPIO_TRIM_RH_R PIOC->PIO_PDSR
#define PIN_TRIM_LH_L 0x00800000
#define PIN_TRIM_LV_DN 0x01000000
#define PIN_TRIM_RV_UP 0x00000002
#define PIN_TRIM_RH_L 0x00000001
#define PIN_TRIM_LH_R 0x00000010
#define PIN_TRIM_LV_UP 0x10000000
#define PIN_TRIM_RV_DN 0x00000400
#define PIN_TRIM_RH_R 0x00000200
#define TRIM_CASE KEY_CASE
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
}
using namespace Ersky9x;
Ersky9xSimulator::Ersky9xSimulator(Ersky9xInterface * ersky9xInterface):
ersky9xInterface(ersky9xInterface)
{
}
bool Ersky9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Ersky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
{
ersky9xInterface->save(Ersky9x::eeprom, radioData);
StartEepromThread(NULL);
StartMainThread(tests);
}
void Ersky9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Ersky9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setTrim(unsigned int idx, int value)
{
Ersky9x::setTrim(idx, value);
}
void Ersky9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Ersky9x::getTrims(trims.values);
}
const char * Ersky9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,62 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ersky9x_simulator_h
#define ersky9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Ersky9xInterface;
class Ersky9xSimulator : public SimulatorInterface {
public:
Ersky9xSimulator(Ersky9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Ersky9xInterface * ersky9xInterface;
};
#endif
@@ -0,0 +1,734 @@
#include <stdlib.h>
#include <algorithm>
#include "helpers.h"
#include "gruvin9xeeprom.h"
#include <QObject>
#define EEPROM_VER 106
extern void getEEPROMZString(char *dst, const char *src, int size);
RawSwitch gruvin9xToSwitch(int8_t sw)
{
if (sw == 0)
return RawSwitch(SWITCH_TYPE_NONE);
else if (sw <= 9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
else
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
}
t_Gruvin9xTrainerMix_v103::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.weight = (25 * studWeight) / 8;
c9x.mode = mode;
return c9x;
}
t_Gruvin9xTrainerMix_v104::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.weight = studWeight;
c9x.mode = mode;
return c9x;
}
t_Gruvin9xTrainerData_v103::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
t_Gruvin9xTrainerData_v104::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
Gruvin9xGeneral_v103::operator GeneralSettings ()
{
GeneralSettings result;
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
result.trainer = trainer;
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = switchWarning;
switch (beeperVal) {
case 0:
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = e_no_keys;
break;
default:
result.beeperMode = e_all;
result.beeperLength = beeperVal - 4;
break;
}
result.disableMemoryWarning = disableMemoryWarning;
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.enableTelemetryAlarm = enableTelemetryAlarm;
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
// TODO frskyRssiAlarms[2];
return result;
}
Gruvin9xGeneral_v104::operator GeneralSettings ()
{
GeneralSettings result;
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
result.trainer = trainer;
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = switchWarning;
result.beeperMode = (BeeperMode)beeperVal;
result.disableMemoryWarning = disableMemoryWarning;
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.enableTelemetryAlarm = enableTelemetryAlarm;
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
// TODO frskyRssiAlarms[2];
return result;
}
t_Gruvin9xExpoData::t_Gruvin9xExpoData()
{
memset(this, 0, sizeof(t_Gruvin9xExpoData));
}
t_Gruvin9xExpoData::operator ExpoData ()
{
ExpoData c9x;
c9x.mode = mode;
c9x.chn = chn;
c9x.swtch = gruvin9xToSwitch(swtch);
if (negPhase) {
c9x.phases= 1 << (phase -1);
} else if (phase==0) {
c9x.phases=0;
} else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.weight = weight;
if (expo) {
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
c9x.curve.value = expo;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
t_Gruvin9xLimitData::t_Gruvin9xLimitData()
{
memset(this, 0, sizeof(t_Gruvin9xLimitData));
}
t_Gruvin9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.revert = revert;
c9x.offset = offset;
return c9x;
}
t_Gruvin9xMixData::t_Gruvin9xMixData()
{
memset(this, 0, sizeof(t_Gruvin9xMixData));
}
t_Gruvin9xMixData::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
c9x.weight = weight;
c9x.swtch = gruvin9xToSwitch(swtch);
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw == 8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 9) {
if (swtch < 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, -swtch - 1);
c9x.weight = -weight;
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch - 1);
}
if (mltpx != MLTPX_REP)
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
}
else if (srcRaw <= 12) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
}
else if (srcRaw <= 20) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.sOffset = sOffset;
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
RawSource gruvin9xToSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value == 9) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = gruvin9xToSource(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = gruvin9xToSource(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = gruvin9xToSwitch(v1).toValue();
c9x.val2 = gruvin9xToSwitch(v2).toValue();
}
return c9x;
}
Gruvin9xFuncSwData::operator FuncSwData ()
{
FuncSwData c9x;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
return c9x;
}
t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
{
memset(this, 0, sizeof(t_Gruvin9xSwashRingData));
}
t_Gruvin9xSwashRingData::operator SwashRingData ()
{
SwashRingData c9x;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = gruvin9xToSource(collectiveSource);
c9x.value = value;
return c9x;
}
t_Gruvin9xPhaseData_v102::operator PhaseData ()
{
PhaseData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = trim[i];
c9x.swtch = gruvin9xToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
return c9x;
}
t_Gruvin9xPhaseData_v106::operator PhaseData ()
{
PhaseData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
c9x.swtch = gruvin9xToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
return c9x;
}
extern RawSwitch getEr9xTimerMode(int mode);
t_Gruvin9xTimerData::operator TimerData ()
{
TimerData c9x;
c9x.mode = getEr9xTimerMode(mode);
c9x.val = val;
c9x.dir = dir;
return c9x;
}
t_Gruvin9xFrSkyChannelData::t_Gruvin9xFrSkyChannelData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyChannelData));
}
t_Gruvin9xFrSkyChannelData::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
c9x.ratio = ratio;
c9x.alarms[0].value = alarms_value[0];
c9x.alarms[0].level = alarms_level & 3;
c9x.alarms[0].greater = alarms_greater & 1;
c9x.alarms[1].value = alarms_value[1];
c9x.alarms[1].level = (alarms_level >> 2) & 3;
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
c9x.type = type;
return c9x;
}
t_Gruvin9xFrSkyData::t_Gruvin9xFrSkyData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyData));
}
t_Gruvin9xFrSkyData::operator FrSkyData ()
{
FrSkyData c9x;
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
return c9x;
}
t_Gruvin9xModelData_v102::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.phaseData[i] = phaseData[i];
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_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<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v103::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.phaseData[i] = phaseData[i];
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_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<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v105::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (phaseData[i].trim[j] > 125) {
c9x.phaseData[i].trimRef[j] = 0;
c9x.phaseData[i].trim[j] = 0;
}
else if (phaseData[i].trim[j] < -125) {
c9x.phaseData[i].trimRef[j] = 129 + phaseData[i].trim[j];
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
else {
c9x.phaseData[i].trim[j] += subtrim[j];
}
}
}
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_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<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v106::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_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<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
@@ -0,0 +1,421 @@
/*
* 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 gruvin9xeeprom_h
#define gruvin9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
#define GR9X_MAX_CSFUNC 13
PACK(typedef struct t_Gruvin9xTrainerMix_v103 {
uint8_t srcChn:3; //0-7 = ch1-8
int8_t swtch:5;
int8_t studWeight:6;
uint8_t mode:2; //off,add-mode,subst-mode
operator TrainerMix();
t_Gruvin9xTrainerMix_v103() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v103)); }
}) Gruvin9xTrainerMix_v103; //
PACK(typedef struct t_Gruvin9xTrainerMix_v104 {
uint8_t srcChn:6; // 0-7 = ch1-8
uint8_t mode:2; // off,add-mode,subst-mode
int8_t studWeight;
operator TrainerMix();
t_Gruvin9xTrainerMix_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v104)); }
}) Gruvin9xTrainerMix_v104; //
PACK(typedef struct t_Gruvin9xTrainerData_v103 {
int16_t calib[4];
Gruvin9xTrainerMix_v103 mix[4];
operator TrainerData();
}) Gruvin9xTrainerData_v103;
PACK(typedef struct t_Gruvin9xTrainerData_v104 {
int16_t calib[4];
Gruvin9xTrainerMix_v104 mix[4];
operator TrainerData();
t_Gruvin9xTrainerData_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerData_v104)); }
}) Gruvin9xTrainerData_v104;
PACK(typedef struct t_Gruvin9xFrSkyRSSIAlarm {
uint8_t level:2;
int8_t value:6;
}) Gruvin9xFrSkyRSSIAlarm;
PACK(typedef struct t_Gruvin9xGeneral_v103 {
uint8_t myVers;
int16_t calibMid[7];
int16_t calibSpanNeg[7];
int16_t calibSpanPos[7];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t lightSw;
Gruvin9xTrainerData_v103 trainer;
uint8_t view; //index of subview in main scrren
uint8_t disableThrottleWarning:1;
int8_t switchWarning:2; // -1=down, 0=off, 1=up
uint8_t beeperVal:3;
uint8_t disableMemoryWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
uint8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
uint8_t spare:2;
uint8_t filterInput;
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
operator GeneralSettings();
t_Gruvin9xGeneral_v103() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v103)); }
}) Gruvin9xGeneral_v103;
PACK(typedef struct t_Gruvin9xGeneral_v104 {
uint8_t myVers;
int16_t calibMid[7];
int16_t calibSpanNeg[7];
int16_t calibSpanPos[7];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t lightSw;
Gruvin9xTrainerData_v104 trainer;
uint8_t view; //index of subview in main scrren
uint8_t disableThrottleWarning:1;
int8_t switchWarning:2; // -1=down, 0=off, 1=up
uint8_t beeperVal:3;
uint8_t disableMemoryWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
uint8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
uint8_t spare:2;
uint8_t filterInput;
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
operator GeneralSettings();
t_Gruvin9xGeneral_v104() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v104)); }
}) Gruvin9xGeneral_v104;
typedef Gruvin9xGeneral_v104 Gruvin9xGeneral;
// eeprom modelspec
PACK(typedef struct t_Gruvin9xExpoData {
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn:2;
uint8_t curve:4; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
int8_t swtch:5;
uint8_t phase:3; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
uint8_t negPhase:1;
uint8_t weight:7;
int8_t expo;
operator ExpoData();
t_Gruvin9xExpoData();
}) Gruvin9xExpoData;
PACK(typedef struct t_Gruvin9xLimitData {
int8_t min;
int8_t max;
bool revert;
int16_t offset;
operator LimitData();
t_Gruvin9xLimitData();
}) Gruvin9xLimitData;
#define MLTPX_ADD 0
#define MLTPX_MUL 1
#define MLTPX_REP 2
PACK(typedef struct t_Gruvin9xMixData {
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
uint8_t mixWarn:3; // mixer warning
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; // 0=symmetrisch, 1=no neg, 2=no pos
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t sOffset;
operator MixData();
t_Gruvin9xMixData();
}) Gruvin9xMixData;
PACK(typedef struct t_Gruvin9xLogicalSwitchData { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Gruvin9xLogicalSwitchData() { memset(this, 0, sizeof(t_Gruvin9xLogicalSwitchData)); }
}) Gruvin9xLogicalSwitchData;
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
int8_t swtch;
int8_t val;
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
int8_t swtch; // input
uint8_t func;
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.
// 0.01v steps from 0 to 40.95V. Ex. 6.60 Volts = 660. 40.95V = 4095
uint16_t type:4; // channel display unit (0=volts, 1=raw, 2-15=reserverd.)
uint8_t alarms_value[2]; // raw sample values 0..255
uint8_t alarms_level:4; // two pairs of 2bits. none=0, yel=1, org=2, red=3
uint8_t alarms_greater:2; // two alarms, 1 bit each. 0=LT(<), 1=GT(>)
uint8_t spare:2;
uint8_t barMin; // minimum for bar display (raw ADC value)
uint8_t barMax; // ditto for max display (would G:NOT usually = ratio)
operator FrSkyChannelData();
t_Gruvin9xFrSkyChannelData();
}) Gruvin9xFrSkyChannelData;
PACK(typedef struct t_Gruvin9xFrSkyData {
Gruvin9xFrSkyChannelData channels[2];
operator FrSkyData();
t_Gruvin9xFrSkyData();
}) Gruvin9xFrSkyData;
PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Gruvin9xSwashRingData();
}) Gruvin9xSwashRingData;
PACK(typedef struct t_Gruvin9xPhaseData_v102 {
int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator PhaseData();
t_Gruvin9xPhaseData_v102() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v102)); }
}) Gruvin9xPhaseData_v102;
PACK(typedef struct t_Gruvin9xPhaseData_v106 {
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator PhaseData();
t_Gruvin9xPhaseData_v106() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v106)); }
}) Gruvin9xPhaseData_v106;
PACK(typedef struct t_Gruvin9xTimerData {
int8_t mode:7; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint8_t dir:1; // 0=>Count Down, 1=>Count Up
uint16_t val;
operator TimerData();
t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); }
}) Gruvin9xTimerData;
#define G9X_MAX_FLIGHT_MODES 5
#define G9X_MAX_MIXERS 32
#define G9X_MAX_EXPOS 14
#define G9X_MAX_CURVE5 8
#define G9X_MAX_CURVE9 8
#define G9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
#define G9X_NUM_CSW 12 // number of custom switches
#define G9X_NUM_FSW 12 // number of functions assigned to switches
// TODO
PACK(typedef struct t_Gruvin9xModelData_v102 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v102() { memset(this, 0, sizeof(t_Gruvin9xModelData_v102)); }
}) Gruvin9xModelData_v102;
PACK(typedef struct t_Gruvin9xModelData_v103 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v103() { memset(this, 0, sizeof(t_Gruvin9xModelData_v103)); }
}) Gruvin9xModelData_v103;
PACK(typedef struct t_Gruvin9xModelData_v105 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
int16_t subtrim[NUM_STICKS];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v105() { memset(this, 0, sizeof(t_Gruvin9xModelData_v105)); }
}) Gruvin9xModelData_v105;
PACK(typedef struct t_Gruvin9xModelData_v106 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v106() { memset(this, 0, sizeof(t_Gruvin9xModelData_v106)); }
}) Gruvin9xModelData_v106;
typedef Gruvin9xModelData_v106 Gruvin9xModelData;
#endif
@@ -0,0 +1,232 @@
/*
* 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 <iostream>
#include "gruvin9xinterface.h"
#include "gruvin9xeeprom.h"
#include "file.h"
#include "appdata.h"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
#define FILE_GENERAL 0
#define FILE_MODEL(n) (1+n)
Gruvin9xInterface::Gruvin9xInterface(BoardEnum board):
EEPROMInterface(board),
efile(new RleFile())
{
}
Gruvin9xInterface::~Gruvin9xInterface()
{
delete efile;
}
const char * Gruvin9xInterface::getName()
{
if (board == BOARD_STOCK)
return "Gruvin9x";
else
return "Gruvin9x v4";
}
const int Gruvin9xInterface::getEEpromSize()
{
if (board == BOARD_STOCK) {
QString avrMCU = g.mcu();
if (avrMCU==QString("m128")) {
return EESIZE_STOCK*2;
}
return EESIZE_STOCK;
} else {
return EESIZE_GRUVIN9X;
}
}
const int Gruvin9xInterface::getMaxModels()
{
return 16;
}
template <class T>
void Gruvin9xInterface::loadModel(ModelData &model, unsigned int stickMode, int version)
{
T _model;
if ((version == 2 && efile->readRlc2((uint8_t*)&_model, sizeof(T))) ||
(version == 1 && efile->readRlc1((uint8_t*)&_model, sizeof(T)))) {
model = _model;
if (stickMode) {
applyStickModeToModel(model, stickMode);
}
}
else {
model.clear();
}
}
template <class T>
bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
{
T _settings;
if ((version == 2 && efile->readRlc2((uint8_t*)&_settings, sizeof(T))) ||
(version == 1 && efile->readRlc1((uint8_t*)&_settings, sizeof(T)))) {
settings = _settings;
return true;
}
std::cerr << "error when loading general settings";
return false;
}
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
}
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import... ";
if (size != this->getEEpromSize()) {
std::cout << "wrong size\n";
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
efile->openRd(FILE_GENERAL);
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << "no\n";
return false;
}
if (version == 0) {
efile->openRd(FILE_GENERAL);
if (efile->readRlc1(&version, 1) != 1) {
std::cout << "no\n";
return false;
}
}
std::cout << "version " << (unsigned int)version << " ";
switch(version) {
case 5:
case 100:
case 101:
case 102:
case 103:
case 104:
case 105:
// subtrims(16bits) + function switches added
case 106:
// trims(10bits), no subtrims
break;
default:
std::cout << "not gruvin9x\n";
return false;
}
efile->openRd(FILE_GENERAL);
if (version == 5) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
return false;
}
else if (version < 104) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
return false;
}
else if (version <= 106) {
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
return false;
}
else {
std::cout << "ko\n";
return false;
}
for (int i=0; i<getMaxModels(); i++) {
efile->openRd(FILE_MODEL(i));
if (version == 5) {
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1, 1);
}
else if (version < 103) {
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 103) {
loadModel<Gruvin9xModelData_v103>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 105) {
loadModel<Gruvin9xModelData_v105>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 106) {
loadModel<Gruvin9xModelData_v106>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else {
std::cout << "ko\n";
return false;
}
}
std::cout << "ok\n";
return true;
}
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
}
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Gruvin9xInterface::getSize(ModelData &model)
{
return 0;
}
int Gruvin9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
{
switch (proto) {
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
case DSM2:
return 1;
default:
return 0;
}
}
@@ -0,0 +1,64 @@
/*
* 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 gruvin9x_interface_h
#define gruvin9x_interface_h
#include "eeprominterface.h"
class RleFile;
class Gruvin9xInterface : public EEPROMInterface
{
public:
Gruvin9xInterface(BoardEnum board);
virtual ~Gruvin9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual 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(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int isAvailable(Protocol proto, int port=0);
protected:
template <class T>
void loadModel(ModelData &model, unsigned int stickMode=0, int version=2);
template <class T>
bool loadGeneral(GeneralSettings &settings, int version=2);
RleFile *efile;
};
#endif
@@ -0,0 +1,859 @@
#include <stdlib.h>
#include <algorithm>
#include "helpers.h"
#include "open9xGruvin9xeeprom.h"
#include <QObject>
#include <QMessageBox>
extern void getEEPROMZString(char *dst, const char *src, int size);
extern RawSwitch open9xStockToSwitch(int8_t sw);
t_Open9xGruvin9xPhaseData_v207::operator PhaseData ()
{
PhaseData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
c9x.swtch = open9xStockToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
for (int i=0; i<2; i++)
c9x.rotaryEncoders[i] = rotaryEncoders[i];
return c9x;
}
t_Open9xGruvin9xPhaseData_v208::operator PhaseData ()
{
PhaseData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = trim[i];
c9x.swtch = open9xStockToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
for (int i=0; i<2; i++)
c9x.rotaryEncoders[i] = rotaryEncoders[i];
return c9x;
}
t_Open9xGruvin9xMixData_v207::operator MixData ()
{
MixData c9x;
if (srcRaw) {
c9x.destCh = destCh+1;
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw <= 9) {
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
}
else if (srcRaw == 10) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
/* else if (srcRaw == 11) {
c9x.srcRaw = RawSource(SOURCE_TYPE_3POS);
} */
else if (srcRaw <= 32) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-11);
}
else if (srcRaw <= 35) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-33);
}
else if (srcRaw <= 43) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-36);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-44);
}
c9x.weight = weight;
if (differential) {
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, differential*2);
}
else {
// TODO c9x.curve = curve;
}
c9x.swtch = open9xStockToSwitch(swtch);
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
return c9x;
}
t_Open9xGruvin9xMixData_v209::operator MixData ()
{
MixData c9x;
if (srcRaw) {
c9x.destCh = destCh+1;
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw <= 9) {
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
}
else if (srcRaw <= 13) {
c9x.srcRaw = RawSource(SOURCE_TYPE_TRIM, srcRaw-10);
}
else if (srcRaw == 14) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 15) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 36) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-15);
}
else if (srcRaw <= 39) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-37);
}
else if (srcRaw <= 47) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-40);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-48);
}
c9x.weight = weight;
if (differential) {
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, differential*2);
}
else {
// TODO c9x.curve = curve;
}
c9x.swtch = open9xStockToSwitch(swtch);
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
return c9x;
}
t_Open9xGruvin9xMixData_v211::operator MixData ()
{
MixData c9x;
if (srcRaw) {
c9x.destCh = destCh+1;
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw <= 9) {
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
}
else if (srcRaw <= 13) {
c9x.srcRaw = RawSource(SOURCE_TYPE_TRIM, srcRaw-10);
}
else if (srcRaw == 14) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 15) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
}
else if (srcRaw <= 36) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-15);
}
else if (srcRaw <= 39) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-37);
}
else if (srcRaw <= 47) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-40);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-48);
}
c9x.weight = weight;
c9x.swtch = open9xStockToSwitch(swtch);
if (curveMode==0) {
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, curveParam);
}
else {
// TODO c9x.curve = curve;
}
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.phases = phases;
c9x.sOffset = sOffset;
}
return c9x;
}
RawSource open9xV4207ToSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value <= 9) {
return RawSource(SOURCE_TYPE_ROTARY_ENCODER, value - 8);
}
else if (value == 10) {
return RawSource(SOURCE_TYPE_MAX);
}
/* else if (value == 11) {
return RawSource(SOURCE_TYPE_3POS);
} */
else if (value <= 14) {
return RawSource(SOURCE_TYPE_CYC, value-12);
}
else if (value <= 22) {
return RawSource(SOURCE_TYPE_PPM, value-15);
}
else if (value <= 38) {
return RawSource(SOURCE_TYPE_CH, value-23);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-38);
}
}
RawSource open9xV4209ToSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value <= 9) {
return RawSource(SOURCE_TYPE_ROTARY_ENCODER, value - 8);
}
else if (value <= 13) {
return RawSource(SOURCE_TYPE_STICK, value - 10);
}
else if (value == 14) {
return RawSource(SOURCE_TYPE_MAX);
}
/* else if (value == 15) {
return RawSource(SOURCE_TYPE_3POS);
} */
else if (value <= 18) {
return RawSource(SOURCE_TYPE_CYC, value-16);
}
else if (value <= 26) {
return RawSource(SOURCE_TYPE_PPM, value-19);
}
else if (value <= 42) {
return RawSource(SOURCE_TYPE_CH, value-27);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-42);
}
}
Open9xGruvin9xLogicalSwitchData_v207::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = open9xV4207ToSource(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = open9xV4207ToSource(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = open9xStockToSwitch(v1).toValue();
c9x.val2 = open9xStockToSwitch(v2).toValue();
}
return c9x;
}
Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = open9xV4209ToSource(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL && c9x.func <= LS_FN_ELESS) {
c9x.val2 = open9xV4209ToSource(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = open9xStockToSwitch(v1).toValue();
c9x.val2 = open9xStockToSwitch(v2).toValue();
}
return c9x;
}
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
{
FuncSwData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.func = (AssignFunc)(func);
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
}
else {
c9x.param = param;
if (func <= 20)
c9x.func = (AssignFunc)(func);
else if (func == 21)
c9x.func = FuncInstantTrim;
else if (func == 22)
c9x.func = FuncPlaySound;
else if (func == 23)
c9x.func = FuncPlayHaptic;
else if (func == 24)
c9x.func = FuncReset;
else if (func == 25)
c9x.func = FuncVario;
else if (func == 26)
c9x.func = FuncPlayPrompt;
else if (func == 27)
c9x.func = FuncPlayValue;
else if (func == 28)
c9x.func = FuncLogs;
else if (func == 29)
c9x.func = FuncBacklight;
else if (func >= 30 && func <= 34)
c9x.func = AssignFunc(FuncAdjustGV1 + func - 30);
else
c9x.clear();
}
return c9x;
}
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
{
FuncSwData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
c9x.func = (AssignFunc)(func);
c9x.enabled = delay;
} else {
if (func == 22)
c9x.func = FuncPlaySound;
else if (func == 23)
c9x.func = FuncPlayHaptic;
else if (func == 24)
c9x.func = FuncReset;
else if (func == 25)
c9x.func = FuncVario;
else if (func == 26)
c9x.func = FuncPlayPrompt;
else if (func == 27)
c9x.func = FuncPlayValue;
else if (func == 28)
c9x.func = FuncLogs;
else
c9x.clear();
}
return c9x;
}
t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
{
SwashRingData c9x;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xV4207ToSource(collectiveSource);
c9x.value = value;
return c9x;
}
t_Open9xGruvin9xSwashRingData_v209::operator SwashRingData ()
{
SwashRingData c9x;
c9x.invertELE = invertELE;
c9x.invertAIL = invertAIL;
c9x.invertCOL = invertCOL;
c9x.type = type;
c9x.collectiveSource = open9xV4209ToSource(collectiveSource);
c9x.value = value;
return c9x;
}
t_Open9xGruvin9xModelData_v207::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[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<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
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.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;
}
t_Open9xGruvin9xModelData_v208::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[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<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
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;
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
return c9x;
}
t_Open9xGruvin9xModelData_v209::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[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<O9X_209_MAX_CURVE9; i++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
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;
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
}
}
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
return c9x;
}
t_Open9xGruvin9xModelData_v210::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<O9X_MAX_TIMERS; i++)
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[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;
for (int j=0; j<crvinfo.points; j++)
c9x.curves[i].points[j].y = crvinfo.crv[j];
if (crvinfo.custom) {
c9x.curves[i].points[0].x = -100;
for (int j=1; j<crvinfo.points-1; j++)
c9x.curves[i].points[j].x = crvinfo.crv[crvinfo.points+j-1];
c9x.curves[i].points[crvinfo.points-1].x = +100;
}
else {
for (int j=0; j<crvinfo.points; j++)
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
return c9x;
}
t_Open9xGruvin9xModelData_v211::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
for (int i=0; i<O9X_MAX_TIMERS; i++) {
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 = PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
c9x.phaseData[i] = phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.phaseData[i].trim[j] > 500) {
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
if (c9x.phaseData[i].trimRef[j] >= i)
c9x.phaseData[i].trimRef[j] += 1;
c9x.phaseData[i].trim[j] = 0;
}
}
}
for (int i=0; i<O9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<O9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<O9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[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;
for (int j=0; j<crvinfo.points; j++)
c9x.curves[i].points[j].y = crvinfo.crv[j];
if (crvinfo.custom) {
c9x.curves[i].points[0].x = -100;
for (int j=1; j<crvinfo.points-1; j++)
c9x.curves[i].points[j].x = crvinfo.crv[crvinfo.points+j-1];
c9x.curves[i].points[crvinfo.points-1].x = +100;
}
else {
for (int j=0; j<crvinfo.points; j++)
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
}
}
for (int i=0; i<O9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
for (int i=0; i<O9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
return c9x;
}
@@ -0,0 +1,365 @@
/*
* 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 open9xGruvin9xeeprom_h
#define open9xGruvin9xeeprom_h
#define O9X_V4_MAX_CSFUNCOLD 13
#define O9X_V4_MAX_CSFUNC 15
#include "open9xStockeeprom.h"
PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
int16_t rotaryEncoders[2];
operator PhaseData();
t_Open9xGruvin9xPhaseData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v207)); }
}) Open9xGruvin9xPhaseData_v207;
PACK(typedef struct t_Open9xGruvin9xPhaseData_v208 {
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
int16_t rotaryEncoders[2];
operator PhaseData();
t_Open9xGruvin9xPhaseData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v208)); }
}) Open9xGruvin9xPhaseData_v208;
PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint16_t srcRaw:7; //
uint16_t differential:7;
uint16_t carryTrim:2;
int8_t sOffset;
operator MixData();
t_Open9xGruvin9xMixData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v207)); }
}) Open9xGruvin9xMixData_v207;
PACK(typedef struct t_Open9xGruvin9xMixData_v209 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint16_t srcRaw:6; //
int16_t differential:7;
int16_t carryTrim:3;
int8_t sOffset;
operator MixData();
t_Open9xGruvin9xMixData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v209)); }
}) Open9xGruvin9xMixData_v209;
PACK(typedef struct t_Open9xGruvin9xMixData_v211 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
uint8_t curveMode:1; // O=curve, 1=differential
uint8_t noExpo:1;
uint8_t spare:2;
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
uint8_t phases:5;
int8_t carryTrim:3;
uint8_t srcRaw:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4;
uint8_t speedDown:4;
int8_t curveParam;
int8_t sOffset;
operator MixData();
t_Open9xGruvin9xMixData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v211)); }
}) Open9xGruvin9xMixData_v211;
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v207 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xGruvin9xLogicalSwitchData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v207)); }
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Open9xGruvin9xLogicalSwitchData_v207;
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xGruvin9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v209)); }
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Open9xGruvin9xLogicalSwitchData_v209;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
}) Open9xGruvin9xFuncSwData_v203;
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 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;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xGruvin9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v208)); }
}) Open9xGruvin9xSwashRingData_v208;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xGruvin9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v209)); }
}) Open9xGruvin9xSwashRingData_v209;
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xPhaseData_v207 phaseData[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;
operator ModelData();
t_Open9xGruvin9xModelData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v207)); }
}) Open9xGruvin9xModelData_v207;
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[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[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
operator ModelData();
t_Open9xGruvin9xModelData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v208)); }
}) Open9xGruvin9xModelData_v208;
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[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[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
uint8_t switchWarningStates;
operator ModelData();
t_Open9xGruvin9xModelData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v209)); }
}) Open9xGruvin9xModelData_v209;
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t switchWarningStates;
Open9xFrSkyData_v210 frsky;
operator ModelData();
t_Open9xGruvin9xModelData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v210)); }
}) Open9xGruvin9xModelData_v210;
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare1:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xGruvin9xMixData_v211 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t switchWarningStates;
Open9xFrSkyData_v210 frsky;
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
operator ModelData();
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
}) Open9xGruvin9xModelData_v211;
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,519 @@
/*
* 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 open9xSky9xeeprom_h
#define open9xSky9xeeprom_h
#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;
operator TimerData();
t_Open9xArmTimerData_v202() { memset(this, 0, sizeof(t_Open9xArmTimerData_v202)); }
}) Open9xArmTimerData_v202;
PACK(typedef struct t_Open9xArmExpoData_v208 {
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn;
int8_t curve; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
int8_t swtch;
int8_t phase; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
uint8_t weight;
int8_t expo;
operator ExpoData();
t_Open9xArmExpoData_v208() { memset(this, 0, sizeof(t_Open9xArmExpoData_v208)); }
}) Open9xArmExpoData_v208;
PACK(typedef struct t_Open9xArmExpoData_v210 {
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn;
int8_t curve; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
int8_t swtch;
int8_t phase; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
uint8_t weight;
int8_t expo;
char name[6];
uint8_t spare[4];
operator ExpoData();
t_Open9xArmExpoData_v210() { memset(this, 0, sizeof(t_Open9xArmExpoData_v210)); }
}) Open9xArmExpoData_v210;
PACK(typedef struct t_Open9xArmExpoData_v212 {
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn;
int8_t swtch;
uint16_t phases;
int8_t weight;
uint8_t curveMode;
char name[6];
int8_t curveParam;
operator ExpoData();
t_Open9xArmExpoData_v212() { memset(this, 0, sizeof(t_Open9xArmExpoData_v212)); }
}) Open9xArmExpoData_v212;
PACK(typedef struct t_Open9xArmMixData_v208 {
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch;
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve;
uint8_t mixWarn; // mixer warning
uint8_t delayUp;
uint8_t delayDown;
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown; // 0 nichts
uint8_t srcRaw; //
int8_t differential;
uint8_t carryTrim;
int8_t sOffset;
operator MixData();
t_Open9xArmMixData_v208() { memset(this, 0, sizeof(t_Open9xArmMixData_v208)); }
}) Open9xArmMixData_v208;
PACK(typedef struct t_Open9xArmMixData_v209 {
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch;
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve;
uint8_t mixWarn; // mixer warning
uint8_t delayUp;
uint8_t delayDown;
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown; // 0 nichts
uint8_t srcRaw; //
int8_t differential;
int8_t carryTrim;
int8_t sOffset;
operator MixData();
t_Open9xArmMixData_v209() { memset(this, 0, sizeof(t_Open9xArmMixData_v209)); }
}) Open9xArmMixData_v209;
PACK(typedef struct t_Open9xArmMixData_v210 {
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch;
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve;
uint8_t mixWarn; // mixer warning
uint8_t delayUp;
uint8_t delayDown;
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown; // 0 nichts
uint8_t srcRaw; //
int8_t differential;
int8_t carryTrim;
int8_t sOffset;
char name[6];
uint8_t spare[4];
operator MixData();
t_Open9xArmMixData_v210() { memset(this, 0, sizeof(t_Open9xArmMixData_v210)); }
}) Open9xArmMixData_v210;
PACK(typedef struct t_Open9xArmMixData_v212 {
uint8_t destCh;
uint16_t phases;
uint8_t curveMode:1; // O=curve, 1=differential
uint8_t noExpo:1;
int8_t carryTrim:3;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
uint8_t spare:1;
int8_t weight;
int8_t swtch;
int8_t curveParam;
uint8_t mixWarn; // mixer warning
uint8_t delayUp;
uint8_t delayDown;
uint8_t speedUp;
uint8_t speedDown;
uint8_t srcRaw;
int8_t sOffset;
char name[6];
operator MixData();
t_Open9xArmMixData_v212() { memset(this, 0, sizeof(t_Open9xArmMixData_v212)); }
}) Open9xArmMixData_v212;
PACK(typedef struct t_Open9xArmPhaseData_v208 {
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator PhaseData();
t_Open9xArmPhaseData_v208() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v208)); }
}) Open9xArmPhaseData_v208;
PACK(typedef struct t_Open9xArmPhaseData_v212 {
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
int16_t rotaryEncoders[1];
operator PhaseData();
t_Open9xArmPhaseData_v212() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v212)); }
}) Open9xArmPhaseData_v212;
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xArmLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v208)); }
}) Open9xArmLogicalSwitchData_v208;
PACK(typedef struct t_Open9xArmLogicalSwitchData_v209 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xArmLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v209)); }
}) Open9xArmLogicalSwitchData_v209;
PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
uint8_t delay;
uint8_t duration;
operator LogicalSwitchData();
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
}) Open9xArmLogicalSwitchData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
}) Open9xArmFuncSwData_v208;
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
operator FuncSwData();
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
}) Open9xArmFuncSwData_v210;
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 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;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xArmSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v208)); }
}) Open9xArmSwashRingData_v208;
PACK(typedef struct t_Open9xArmSwashRingData_v209 { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xArmSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v209)); }
}) Open9xArmSwashRingData_v209;
PACK(typedef struct t_Open9xArmSwashRingData_v210 { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xArmSwashRingData_v210() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v210)); }
}) Open9xArmSwashRingData_v210;
PACK(typedef struct t_Open9xArmFrSkyBarData_v210 {
uint8_t source;
uint8_t barMin; // minimum for bar display
uint8_t barMax; // ditto for max display (would usually = ratio)
}) Open9xArmFrSkyBarData_v210;
PACK(typedef struct t_Open9xArmFrSkyData_v210 {
Open9xFrSkyChannelData_v208 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t voltsSource:2;
uint8_t blades:2;
uint8_t currentSource:2;
Open9xArmFrSkyBarData_v210 bars[4];
Open9xFrSkyRSSIAlarm rssiAlarms[2];
uint8_t lines[4*2*2];
uint8_t spare[4];
operator FrSkyData();
t_Open9xArmFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v210)); }
}) Open9xArmFrSkyData_v210;
PACK(typedef struct t_Open9xArmFrSkyData_v211 {
Open9xFrSkyChannelData_v208 channels[2];
Open9xFrSkyRSSIAlarm rssiAlarms[2];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t voltsSource;
uint8_t blades; // How many blades for RPMs, 0=2 blades, 1=3 blades
uint8_t currentSource;
Open9xArmFrSkyBarData_v210 bars[4];
uint8_t lines[4*2*2];
uint8_t varioSource;
uint8_t varioSpeedUpMin; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
uint8_t spare[4];
operator FrSkyData();
t_Open9xArmFrSkyData_v211() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v211)); }
}) Open9xArmFrSkyData_v211;
PACK(typedef struct t_Open9xArmModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v208 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v208 swashR;
Open9xArmPhaseData_v208 phaseData[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[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
operator ModelData();
t_Open9xArmModelData_v208() { memset(this, 0, sizeof(t_Open9xArmModelData_v208)); }
}) Open9xArmModelData_v208;
PACK(typedef struct t_Open9xArmModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v209 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[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[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
uint8_t switchWarningStates;
operator ModelData();
t_Open9xArmModelData_v209() { memset(this, 0, sizeof(t_Open9xArmModelData_v209)); }
}) Open9xArmModelData_v209;
PACK(typedef struct t_Open9xArmModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[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[O9X_ARM_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
uint8_t switchWarningStates;
operator ModelData();
t_Open9xArmModelData_v210() { memset(this, 0, sizeof(t_Open9xArmModelData_v210)); }
}) Open9xArmModelData_v210;
PACK(typedef struct t_Open9xArmModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
int16_t curves[O9X_ARM_MAX_CURVES];
int8_t points[O9X_ARM_NUM_POINTS];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v209 swashR;
Open9xArmPhaseData_v208 phaseData[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[O9X_ARM_NUM_CHNOUT];
uint8_t switchWarningStates;
Open9xArmFrSkyData_v211 frsky;
operator ModelData();
t_Open9xArmModelData_v211() { memset(this, 0, sizeof(t_Open9xArmModelData_v211)); }
}) Open9xArmModelData_v211;
PACK(typedef struct t_Open9xArmModelData_v212 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare1:1;
int8_t ppmDelay;
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xArmMixData_v212 mixData[O9X_ARM_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_ARM_NUM_CHNOUT];
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
int16_t curves[O9X_ARM_MAX_CURVES];
int8_t points[O9X_ARM_NUM_POINTS];
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
Open9xArmSwashRingData_v210 swashR;
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t switchWarningStates;
Open9xArmFrSkyData_v211 frsky;
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
operator ModelData();
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
}) Open9xArmModelData_v212;
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,819 @@
/*
* 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 open9xstockeeprom_h
#define open9xstockeeprom_h
#define O9X_MAX_CSFUNCOLD 13
#define O9X_MAX_CSFUNC 15
#include <inttypes.h>
#include "eeprominterface.h"
#include <qbytearray.h>
int8_t open9xV4209FromSource(RawSource source);
int8_t open9xStock209FromSource(RawSource source);
RawSource open9xV4209ToSource(int8_t value);
RawSource open9xStock209ToSource(int8_t value);
int8_t open9xStockFromSwitch(const RawSwitch & sw);
RawSwitch open9xStockToSwitch(int8_t sw);
struct CurveInfo {
int8_t *crv;
uint8_t points;
bool custom;
};
template <class T>
int8_t *curveaddress(T * model, uint8_t idx)
{
return &model->points[idx==0 ? 0 : 5*idx+model->curves[idx-1]];
}
template <class T>
extern CurveInfo curveinfo(T * model, uint8_t idx)
{
CurveInfo result;
result.crv = curveaddress(model, idx);
int8_t *next = curveaddress(model, idx+1);
uint8_t size = next - result.crv;
if (size % 2 == 0) {
result.points = (size / 2) + 1;
result.custom = true;
}
else {
result.points = size;
result.custom = false;
}
return result;
}
PACK(typedef struct t_Open9xFrSkyRSSIAlarm {
uint8_t level:2;
int8_t value:6;
FrSkyRSSIAlarm get(int index);
t_Open9xFrSkyRSSIAlarm() { memset(this, 0, sizeof(t_Open9xFrSkyRSSIAlarm)); }
}) Open9xFrSkyRSSIAlarm;
PACK(typedef struct t_Open9xExpoData_v201 {
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn:2;
uint8_t curve:4; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
int8_t swtch:5;
uint8_t phase:3; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
uint8_t negPhase:1;
uint8_t weight:7;
int8_t expo;
operator ExpoData();
t_Open9xExpoData_v201() { memset(this, 0, sizeof(t_Open9xExpoData_v201)); }
}) Open9xExpoData_v201;
PACK(typedef struct t_Open9xExpoData_v211 {
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
int8_t swtch:6;
uint8_t chn:2;
uint8_t phases:5;
uint8_t curveMode:1;
uint8_t weight; // we have one bit spare here :)
int8_t curveParam;
operator ExpoData();
t_Open9xExpoData_v211() { memset(this, 0, sizeof(t_Open9xExpoData_v211)); }
}) Open9xExpoData_v211;
PACK(typedef struct t_Open9xLimitData_v201 {
int8_t min;
int8_t max;
bool revert;
int16_t offset;
operator LimitData();
t_Open9xLimitData_v201() { memset(this, 0, sizeof(t_Open9xLimitData_v201)); }
}) Open9xLimitData_v201;
PACK(typedef struct t_Open9xLimitData_v211 {
int8_t min;
int8_t max;
int8_t ppmCenter;
int16_t offset:14;
uint16_t symetrical:1;
uint16_t revert:1;
operator LimitData();
t_Open9xLimitData_v211() { memset(this, 0, sizeof(t_Open9xLimitData_v211)); }
}) Open9xLimitData_v211;
PACK(typedef struct t_Open9xMixData_v201 {
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
uint8_t mixWarn:3; // mixer warning
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; // 0=symmetrisch, 1=no neg, 2=no pos
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t sOffset;
operator MixData();
t_Open9xMixData_v201() { memset(this, 0, sizeof(t_Open9xMixData_v201)); }
}) Open9xMixData_v201;
PACK(typedef struct t_Open9xMixData_v203 {
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
uint8_t mixWarn:3; // mixer warning
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve;
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:2;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t sOffset;
operator MixData();
t_Open9xMixData_v203() { memset(this, 0, sizeof(t_Open9xMixData_v203)); }
}) Open9xMixData_v203;
PACK(typedef struct t_Open9xMixData_v205 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint16_t srcRaw:7; //
int16_t differential:7;
uint16_t carryTrim:2;
int8_t sOffset;
operator MixData();
t_Open9xMixData_v205() { memset(this, 0, sizeof(t_Open9xMixData_v205)); }
}) Open9xMixData_v205;
PACK(typedef struct t_Open9xMixData_v209 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
int8_t curve:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint16_t srcRaw:6;
int16_t differential:7;
int16_t carryTrim:3;
int8_t sOffset;
operator MixData();
t_Open9xMixData_v209() { memset(this, 0, sizeof(t_Open9xMixData_v209)); }
}) Open9xMixData_v209;
PACK(typedef struct t_Open9xMixData_v211 {
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
uint8_t curveMode:1; // O=curve, 1=differential
uint8_t noExpo:1;
uint8_t spare:2;
int8_t weight;
int8_t swtch:6;
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
uint8_t phases:5;
int8_t carryTrim:3;
uint8_t srcRaw:6;
uint8_t mixWarn:2; // mixer warning
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4;
uint8_t speedDown:4;
int8_t curveParam;
int8_t sOffset;
operator MixData();
t_Open9xMixData_v211() { memset(this, 0, sizeof(t_Open9xMixData_v211)); }
}) Open9xMixData_v211;
PACK(typedef struct t_Open9xLogicalSwitchData_v208 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v208)); }
t_Open9xLogicalSwitchData_v208(LogicalSwitchData&);
}) Open9xLogicalSwitchData_v208;
PACK(typedef struct t_Open9xLogicalSwitchData_v209 { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Open9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v209)); }
}) Open9xLogicalSwitchData_v209;
PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
int8_t swtch;
int8_t val;
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
}) Open9xSafetySwData;
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator FuncSwData();
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
}) Open9xFuncSwData_v201;
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
}) Open9xFuncSwData_v203;
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 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.
uint8_t type:4; // channel unit (0=volts, ...)
int8_t offset:4; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t spare:2;
uint8_t barMin; // minimum for bar display
uint8_t barMax; // ditto for max display (would usually = ratio)
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v201)); }
}) Open9xFrSkyChannelData_v201;
PACK(typedef struct t_Open9xFrSkyChannelData_v203 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t type; // channel unit (0=volts, ...)
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t spare:2;
uint8_t barMin:4; // minimum for bar display
uint8_t barMax:4; // ditto for max display (would usually = ratio)
int8_t offset; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v203)); }
}) Open9xFrSkyChannelData_v203;
PACK(typedef struct t_Open9xFrSkyChannelData_v204 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t type; // channel unit (0=volts, ...)
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t multiplier:2;
int8_t offset; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v204)); }
}) Open9xFrSkyChannelData_v204;
PACK(typedef struct t_Open9xFrSkyChannelData_v208 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
int16_t offset:12;
uint16_t type:4; // channel unit (0=volts, ...)
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t multiplier:2;
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v208)); }
}) Open9xFrSkyChannelData_v208;
PACK(typedef struct t_Open9xFrSkyData_v201 {
Open9xFrSkyChannelData_v201 channels[2];
operator FrSkyData();
t_Open9xFrSkyData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyData_v201)); }
}) Open9xFrSkyData_v201;
PACK(typedef struct t_Open9xFrSkyData_v202 {
Open9xFrSkyChannelData_v201 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t spare:6;
operator FrSkyData();
t_Open9xFrSkyData_v202() { memset(this, 0, sizeof(t_Open9xFrSkyData_v202)); }
}) Open9xFrSkyData_v202;
PACK(typedef struct t_Open9xFrSkyData_v203 {
Open9xFrSkyChannelData_v203 channels[2];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
operator FrSkyData();
t_Open9xFrSkyData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyData_v203)); }
}) Open9xFrSkyData_v203;
PACK(typedef struct t_Open9xFrSkyBarData_v204 {
uint16_t source:4;
uint16_t barMin:6; // minimum for bar display
uint16_t barMax:6; // ditto for max display (would usually = ratio)
operator FrSkyBarData();
t_Open9xFrSkyBarData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyBarData_v204)); }
}) Open9xFrSkyBarData_v204;
PACK(typedef struct t_Open9xFrSkyData_v204 {
Open9xFrSkyChannelData_v204 channels[2];
uint8_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t imperial:1;
uint8_t blades:2;
uint8_t spare:2;
Open9xFrSkyBarData_v204 bars[4];
operator FrSkyData();
t_Open9xFrSkyData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyData_v204)); }
}) Open9xFrSkyData_v204;
PACK(typedef struct t_Open9xFrSkyData_v205 {
Open9xFrSkyChannelData_v204 channels[2];
uint8_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t imperial:1;
uint8_t blades:2;
uint8_t spare:2;
Open9xFrSkyBarData_v204 bars[4];
Open9xFrSkyRSSIAlarm rssiAlarms[2];
operator FrSkyData();
t_Open9xFrSkyData_v205() { memset(this, 0, sizeof(t_Open9xFrSkyData_v205)); }
}) Open9xFrSkyData_v205;
PACK(typedef struct t_Open9xFrSkyData_v208 {
Open9xFrSkyChannelData_v208 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t voltsSource:2;
uint8_t blades:2;
uint8_t currentSource:2;
Open9xFrSkyBarData_v204 bars[4];
Open9xFrSkyRSSIAlarm rssiAlarms[2];
operator FrSkyData();
t_Open9xFrSkyData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyData_v208)); }
}) Open9xFrSkyData_v208;
PACK(typedef struct t_Open9xFrSkyData_v210 {
Open9xFrSkyChannelData_v208 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t blades:2; // How many blades for RPMs, 0=2 blades, 1=3 blades
uint8_t spare1:4;
uint8_t voltsSource:3;
uint8_t currentSource:3;
uint8_t spare2:2;
Open9xFrSkyBarData_v204 bars[4];
Open9xFrSkyRSSIAlarm rssiAlarms[2];
uint8_t lines[4];
uint16_t linesXtra;
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
operator FrSkyData();
t_Open9xFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xFrSkyData_v210)); }
}) Open9xFrSkyData_v210;
PACK(typedef struct t_Open9xSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xSwashRingData_v208)); }
}) Open9xSwashRingData_v208;
PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Open9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xSwashRingData_v209)); }
}) Open9xSwashRingData_v209;
PACK(typedef struct t_Open9xPhaseData_v201 {
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator PhaseData();
t_Open9xPhaseData_v201() { memset(this, 0, sizeof(t_Open9xPhaseData_v201)); }
}) Open9xPhaseData_v201;
PACK(typedef struct t_Open9xTimerData_v201 {
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint16_t val:14;
uint16_t persistent:1;
uint16_t dir:1; // 0=>Count Down, 1=>Count Up
operator TimerData();
t_Open9xTimerData_v201() { memset(this, 0, sizeof(t_Open9xTimerData_v201)); }
}) Open9xTimerData_v201;
PACK(typedef struct t_Open9xTimerData_v202 {
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint16_t val;
operator TimerData();
t_Open9xTimerData_v202() { memset(this, 0, sizeof(t_Open9xTimerData_v202)); }
}) Open9xTimerData_v202;
PACK(typedef struct t_Open9xTimerDataExtra {
uint16_t remanent:1;
uint16_t value:15;
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;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v201 timer2;
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v201 frsky;
operator ModelData();
t_Open9xModelData_v201() { memset(this, 0, sizeof(t_Open9xModelData_v201)); }
}) Open9xModelData_v201;
PACK(typedef struct t_Open9xModelData_v202 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timer1;
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
Open9xFuncSwData_v201 funcSw[12];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
operator ModelData();
t_Open9xModelData_v202() { memset(this, 0, sizeof(t_Open9xModelData_v202)); }
}) Open9xModelData_v202;
PACK(typedef struct t_Open9xModelData_v203 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timer1;
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v202 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
operator ModelData();
t_Open9xModelData_v203() { memset(this, 0, sizeof(t_Open9xModelData_v203)); }
}) Open9xModelData_v203;
PACK(typedef struct t_Open9xModelData_v204 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timer1;
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xTimerData_v202 timer2;
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
Open9xFrSkyData_v204 frsky;
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
Open9xFrSkyRSSIAlarm frskyRssiAlarms[2];
operator ModelData();
t_Open9xModelData_v204() { memset(this, 0, sizeof(t_Open9xModelData_v204)); }
}) Open9xModelData_v204;
PACK(typedef struct t_Open9xModelData_v205 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[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[O9X_NUM_CHNOUT];
operator ModelData();
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
}) Open9xModelData_v205;
PACK(typedef struct t_Open9xModelData_v208 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v208 swashR;
Open9xPhaseData_v201 phaseData[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[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
operator ModelData();
t_Open9xModelData_v208() { memset(this, 0, sizeof(t_Open9xModelData_v208)); }
}) Open9xModelData_v208;
PACK(typedef struct t_Open9xModelData_v209 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves5[O9X_209_MAX_CURVE5][5];
int8_t curves9[O9X_209_MAX_CURVE9][9];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[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[O9X_NUM_CHNOUT];
uint8_t varioSource:3;
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
uint8_t varioSpeedDownMin;
uint8_t switchWarningStates;
operator ModelData();
t_Open9xModelData_v209() { memset(this, 0, sizeof(t_Open9xModelData_v209)); }
}) Open9xModelData_v209;
PACK(typedef struct t_Open9xModelData_v210 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
int8_t servoCenter[O9X_NUM_CHNOUT];
uint8_t switchWarningStates;
Open9xFrSkyData_v210 frsky;
operator ModelData();
t_Open9xModelData_v210() { memset(this, 0, sizeof(t_Open9xModelData_v210)); }
}) Open9xModelData_v210;
PACK(typedef struct t_Open9xModelData_v211 {
char name[10]; // 10 must be first for eeLoadModelName
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t disableThrottleWarning:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare1:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Open9xMixData_v211 mixData[O9X_MAX_MIXERS];
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
int8_t curves[O9X_MAX_CURVES];
int8_t points[O9X_NUM_POINTS];
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
Open9xSwashRingData_v209 swashR;
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
uint8_t thrTraceSrc;
uint8_t modelId;
uint8_t switchWarningStates;
Open9xFrSkyData_v210 frsky;
operator ModelData();
t_Open9xModelData_v211() { memset(this, 0, sizeof(t_Open9xModelData_v211)); }
}) Open9xModelData_v211;
#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 "opentxGruvin9xsimulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBGRUVIN9X
#define CPUM2560
#define ROTARY_ENCODERS 2
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define BUZZER
#define AUDIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT 3
#undef min
#undef max
#include <exception>
namespace Open9xGruvin9x {
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/targets/gruvin9x/somo14d.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 150;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace Open9xGruvin9x;
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
{
}
bool Open9xGruvin9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Open9xGruvin9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
{
g_rotenc[0] = 0;
g_rotenc[1] = 0;
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
{
g_rotenc[0] = 0;
g_rotenc[1] = 0;
StartEepromThread(filename);
StartMainThread(tests);
}
void Open9xGruvin9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Open9xGruvin9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
{
g_rotenc[0] += steps;
}
unsigned int Open9xGruvin9xSimulator::getPhase()
{
return getFlightPhase();
}
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.phaseData[0].name)+1];
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
return buff;
}
const char * Open9xGruvin9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,61 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9xGruvin9x_simulator_h
#define open9xGruvin9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class Open9xGruvin9xSimulator : public SimulatorInterface {
public:
Open9xGruvin9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
};
#endif
@@ -0,0 +1,212 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxM128simulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSTD
#define CPUM128
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
#undef min
#undef max
#include <exception>
namespace OpenTxM128 {
#include "radio/src/targets/stock/board_stock.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/targets/stock/voice.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 150;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace OpenTxM128;
OpenTxM128Simulator::OpenTxM128Simulator()
{
}
bool OpenTxM128Simulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * OpenTxM128Simulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
{
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void OpenTxM128Simulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartMainThread(tests);
}
void OpenTxM128Simulator::stop()
{
StopMainThread();
StopEepromThread();
}
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
}
void OpenTxM128Simulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM128Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
{
}
unsigned int OpenTxM128Simulator::getPhase()
{
return getFlightPhase();
}
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.phaseData[0].name)+1];
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
return buff;
}
const char * OpenTxM128Simulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,61 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef OpenTxM128_simulator_h
#define OpenTxM128_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class OpenTxM128Simulator : public SimulatorInterface {
public:
OpenTxM128Simulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
};
#endif
@@ -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 "opentxM64simulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define HELI
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSTD
#define CPUM64
#define SPLASH
#define FLIGHT_MODES
#define PPM_UNIT_PERCENT_PREC1
#define HELI
#define TEMPLATES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define PXX
#define DSM2
#define DSM2_PPM
#define VARIO
#define HAPTIC
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define VOICE
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define BUZZER
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES
#define NUM_POTS 3
#undef min
#undef max
#include <exception>
namespace OpenTxM64 {
#include "radio/src/targets/stock/board_stock.cpp"
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/targets/stock/voice.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/haptic.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace OpenTxM64;
OpenTxM64Simulator::OpenTxM64Simulator()
{
#define INIT_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM64Simulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * OpenTxM64Simulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
{
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
StartEepromThread(NULL);
StartMainThread(tests);
}
void OpenTxM64Simulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartMainThread(tests);
}
void OpenTxM64Simulator::stop()
{
StopMainThread();
StopEepromThread();
}
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void OpenTxM64Simulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
{
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxM64Simulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
unsigned int OpenTxM64Simulator::getPhase()
{
return getFlightPhase();
}
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.phaseData[0].name)+1];
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
return buff;
}
const char * OpenTxM64Simulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,60 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9x_simulator_h
#define open9x_simulator_h
#include "simulatorinterface.h"
class OpenTxEepromInterface;
class OpenTxM64Simulator : public SimulatorInterface {
public:
OpenTxM64Simulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
};
#endif
@@ -0,0 +1,256 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxSky9xsimulator.h"
#include "opentxinterface.h"
#include "appdata.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSKY9X
#define CPUARM
#define REVB
#define ROTARY_ENCODERS 1
#define HELI
#define TEMPLATES
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define VARIO
#define PPM_UNIT_PERCENT_PREC1
#define BUZZER
#define AUDIO
#define VOICE
#define HAPTIC
// #define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define SDCARD
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define NUM_POTS 3
#define EEPROM_VARIANT 3
#undef min
#undef max
#include <exception>
namespace Open9xSky9x {
#include "radio/src/targets/sky9x/board_sky9x.cpp"
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
#include "radio/src/targets/sky9x/pwr_driver.cpp"
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_raw.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/targets/sky9x/audio_driver.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/buzzer.cpp"
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
#include "radio/src/targets/sky9x/coproc_driver.cpp"
#include "radio/src/targets/sky9x/haptic_driver.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator()
{
QString path=g.profile[g.id()].sdPath()+"/";
int i=0;
for (i=0; i< std::min(path.length(),1022); i++) {
simuSdDirectory[i]=path.at(i).toAscii();
}
simuSdDirectory[i]=0;
}
bool Open9xSky9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Open9xSky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
{
g_rotenc[0] = 0;
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void Open9xSky9xSimulator::start(const char * filename, bool tests)
{
g_rotenc[0] = 0;
StartEepromThread(filename);
StartMainThread(tests);
}
void Open9xSky9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Open9xSky9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
outputs.beep = g_beepCnt;
g_beepCnt = 0;
}
void Open9xSky9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
void Open9xSky9xSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
{
g_rotenc[0] += steps*4;
}
unsigned int Open9xSky9xSimulator::getPhase()
{
return getFlightPhase();
}
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.phaseData[0].name)+1];
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
return buff;
}
const char * Open9xSky9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,61 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef open9xSky9x_simulator_h
#define open9xSky9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class Open9xSky9xSimulator : public SimulatorInterface {
public:
Open9xSky9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
};
#endif
@@ -0,0 +1,295 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxTaranisSimulator.h"
#include "opentxinterface.h"
#include "appdata.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBTARANIS
#define CPUARM
#define HELI
#define SPLASH
#define FLIGHT_MODES
#define FRSKY
#define FRSKY_HUB
#define FRSKY_SPORT
#define GPS
#define VARIO
#define GAUGES
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define VOICE
#define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define SDCARD
#define RTCLOCK
#define CURVES
#define XCURVES
#define GVARS
#define BOLD_FONT
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define FAI_CHOICE
#define LUA
#define LUA_MODEL_SCRIPTS
#define EEPROM_VARIANT 3
#define HAPTIC
#define REVPLUS
#define NUM_POTS 5
#undef min
#undef max
#include <exception>
namespace Open9xX9D {
int taranisSimulatorBoard = 0;
inline int geteepromsize() {
return 32*1024;
}
#define EESIZE geteepromsize()
#include "radio/src/targets/taranis/board_taranis.cpp"
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/eeprom_common.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/targets/taranis/pulses_driver.cpp"
#include "radio/src/targets/taranis/rtc_driver.cpp"
#include "radio/src/targets/taranis/trainer_driver.cpp"
#include "radio/src/targets/taranis/uart3_driver.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/gui/menus.cpp"
#include "radio/src/gui/menu_model.cpp"
#include "radio/src/gui/menu_general.cpp"
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_channels.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/rtc.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/bmp.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/targets/taranis/haptic_driver.cpp"
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#undef SDCARD
#include "radio/src/simpgmspace.cpp"
#define SDCARD
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/targets/taranis/audio_driver.cpp"
#include "radio/src/targets/taranis/telemetry_driver.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_en.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/lua.cpp"
#include "radio/src/lua/src/lapi.c"
#include "radio/src/lua/src/lcode.c"
#include "radio/src/lua/src/lctype.c"
#include "radio/src/lua/src/ldebug.c"
#include "radio/src/lua/src/ldo.c"
#include "radio/src/lua/src/ldump.c"
#include "radio/src/lua/src/lfunc.c"
#include "radio/src/lua/src/lgc.c"
#include "radio/src/lua/src/llex.c"
#include "radio/src/lua/src/lmem.c"
#include "radio/src/lua/src/lobject.c"
#include "radio/src/lua/src/lopcodes.c"
#include "radio/src/lua/src/lparser.c"
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
#include "radio/src/lua/src/lzio.c"
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
#include "radio/src/lua/src/lcorolib.c"
int16_t g_anas[NUM_STICKS+5];
uint16_t anaIn(uint8_t chan)
{
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
void resetTrims()
{
GPIOE->IDR |= PIN_TRIM_LH_L | PIN_TRIM_LH_R | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP;
GPIOC->IDR |= PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
}
}
using namespace Open9xX9D;
OpentxTaranisSimulator::OpentxTaranisSimulator()
{
taranisSimulatorBoard = GetEepromInterface()->getBoard();
QString path=g.profile[g.id()].sdPath()+"/";
int i=0;
for (i=0; i< std::min(path.length(),1022); i++) {
simuSdDirectory[i]=path.at(i).toAscii();
}
simuSdDirectory[i]=0;
}
bool OpentxTaranisSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * OpentxTaranisSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpentxTaranisSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
StartEepromThread(NULL);
StartMainThread(tests);
}
void OpentxTaranisSimulator::start(const char * filename, bool tests)
{
StartEepromThread(filename);
StartMainThread(tests);
}
void OpentxTaranisSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void OpentxTaranisSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
void OpentxTaranisSimulator::getTrims(Trims & trims)
{
uint8_t phase = getFlightPhase();
trims.extended = hasExtendedTrims();
for (uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
{
// g_rotenc[0] += steps*4;
}
unsigned int OpentxTaranisSimulator::getPhase()
{
return getFlightPhase();
}
const char * OpentxTaranisSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.phaseData[0].name)+1];
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
return buff;
}
const char * OpentxTaranisSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,61 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef opentx_taranis_simulator_h
#define opentx_taranis_simulator_h
#include "simulatorinterface.h"
class RadioData;
class OpenTxEepromInterface;
class OpentxTaranisSimulator : public SimulatorInterface {
public:
OpentxTaranisSimulator();
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase();
virtual const char * getPhaseName(unsigned int phase);
virtual void wheelEvent(uint8_t steps);
virtual const char * getError();
};
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,148 @@
/*
* 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 open9xeeprom_h
#define open9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
#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 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:
OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
protected:
virtual void beforeExport();
virtual void afterImport();
StructField internalField;
GeneralSettings & generalData;
BoardEnum board;
unsigned int version;
int inputsCount;
unsigned int chkSum;
unsigned int potsType[4];
};
class ProtocolsConversionTable: public ConversionTable
{
public:
ProtocolsConversionTable(BoardEnum board)
{
int val = 0;
if (IS_ARM(board)) {
addConversion(OFF, val++);
}
addConversion(PPM, val++);
if (!IS_ARM(board)) {
addConversion(PPM16, val++);
addConversion(PPMSIM, val++);
}
if (IS_ARM(board)) {
addConversion(PXX_XJT_X16, val);
addConversion(PXX_XJT_D8, val);
addConversion(PXX_XJT_LR12, val++);
}
else {
addConversion(PXX_DJT, val++);
}
if (IS_ARM(board)) {
addConversion(LP45, val);
addConversion(DSM2, val);
addConversion(DSMX, val++);
}
else {
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:
ChannelsConversionTable()
{
for (int i=4; i<=16; i+= 2)
addConversion(i, -4+i/2);
}
};
class OpenTxModelData: public TransformedField {
public:
OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
const char * getName() { return name; }
protected:
virtual void beforeExport();
virtual void afterImport();
StructField internalField;
ModelData & modelData;
BoardEnum board;
unsigned int version;
unsigned int variant;
private:
char name[256];
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
ProtocolsConversionTable protocolsConversionTable;
ThrottleSourceConversionTable throttleSourceConversionTable;
ChannelsConversionTable channelsConversionTable;
};
void OpenTxEepromCleanup(void);
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,123 @@
/*
* 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_interface_h
#define open9x_interface_h
#include "eeprominterface.h"
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
class RleFile;
class OpenTxEepromInterface : public EEPROMInterface
{
public:
OpenTxEepromInterface(BoardEnum board);
virtual ~OpenTxEepromInterface();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
protected:
const char * getName();
bool checkVersion(unsigned int version);
bool checkVariant(unsigned int version, unsigned int variant);
template <class T>
bool loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode=0);
template <class T>
bool loadModelVariant(unsigned int index, ModelData &model, uint8_t *data, unsigned int version, unsigned int variant);
bool loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode=0);
template <class T>
bool saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant);
template <class T>
bool loadGeneral(GeneralSettings &settings, unsigned int version);
template <class T>
bool saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant);
RleFile *efile;
};
class OpenTxFirmware: public FirmwareInterface {
public:
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board, bool voice = false):
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board), voice)
{
addLanguage("en");
addLanguage("fr");
addLanguage("it");
addLanguage("de");
addLanguage("se");
addLanguage("cz");
addLanguage("es");
addLanguage("pl");
addLanguage("pt");
addTTSLanguage("en");
addTTSLanguage("fr");
addTTSLanguage("it");
addTTSLanguage("de");
addTTSLanguage("se");
addTTSLanguage("cz");
addTTSLanguage("sk");
addTTSLanguage("pl");
addTTSLanguage("pt");
addTTSLanguage("es");
}
virtual QString getStampUrl();
virtual QString getReleaseNotesUrl();
virtual QString getFirmwareUrl(QString & id);
virtual int getCapability(const Capability);
virtual SimulatorInterface * getSimulator();
};
void registerOpenTxFirmwares();
#endif
@@ -0,0 +1,5 @@
// Automatically generated file (CMake) - do not edit
#define DATE_STR "@DATE@"
#define TIME_STR "@TIME@"
#define VERS_STR "@C9X_VERSION@"
#define MOD_STR "FH"
+323
View File
@@ -0,0 +1,323 @@
#include <algorithm>
#include "helpers.h"
#include "th9xeeprom.h"
RawSwitch th9xToSwitch(int8_t sw)
{
if (sw == 0)
return RawSwitch(SWITCH_TYPE_NONE);
else if (sw <= 9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
else
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
}
t_Th9xTrainerMix::t_Th9xTrainerMix()
{
memset(this, 0, sizeof(t_Th9xTrainerMix));
}
t_Th9xTrainerMix::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.swtch = th9xToSwitch(swtch);
c9x.weight = (25 * studWeight) / 8;
c9x.mode = mode;
return c9x;
}
t_Th9xTrainerData::t_Th9xTrainerData()
{
memset(this, 0, sizeof(t_Th9xTrainerData));
}
t_Th9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
t_Th9xGeneral::t_Th9xGeneral()
{
memset(this, 0, sizeof(t_Th9xGeneral));
}
Th9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
result.version = myVers;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
// result.lightSw = th9xToSwitch(lightSw);
result.trainer = trainer;
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
case 0:
result.beeperMode = e_quiet;
break;
case 1:
result.beeperMode = e_no_keys;
break;
case 2:
result.beeperMode = e_all;
break;
case 3:
result.beeperMode = e_all;
result.beeperLength = 2;
}
result.stickMode = stickMode;
result.inactivityTimer = inactivityMin;
return result;
}
t_Th9xExpoData::t_Th9xExpoData()
{
memset(this, 0, sizeof(t_Th9xExpoData));
}
t_Th9xExpoData::operator ExpoData ()
{
ExpoData c9x;
if (exp5) {
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
c9x.curve.value = exp5;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.mode = mode3;
c9x.weight = weight6;
c9x.chn = chn;
c9x.swtch = th9xToSwitch(drSw);
return c9x;
}
t_Th9xLimitData::t_Th9xLimitData()
{
memset(this, 0, sizeof(t_Th9xLimitData));
}
t_Th9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.revert = revert;
c9x.offset = offset;
return c9x;
}
t_Th9xMixData::t_Th9xMixData()
{
memset(this, 0, sizeof(t_Th9xMixData));
}
t_Th9xMixData::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
if (srcRaw < 7)
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw);
else if (srcRaw < 10)
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE); // TODO
else if (srcRaw == 10)
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
else if (srcRaw == 11)
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE); // TODO CUR
else if (srcRaw < 24)
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-12);
else /* always true if (srcRaw < 32) */
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-24);
c9x.weight = weight;
c9x.swtch = th9xToSwitch(swtch);
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.mltpx = (MltpxValue)mixMode;
return c9x;
}
t_Th9xLogicalSwitchData::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = opCmp;
c9x.val1 = val1;
c9x.val2 = val2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = toSource(val1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = toSource(val2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = th9xToSwitch(val1).toValue();
c9x.val2 = th9xToSwitch(val2).toValue();
}
return c9x;
}
int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
{
int v1 = 0;
if (source.type == SOURCE_TYPE_STICK)
v1 = 1+source.index;
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("th9x on this board doesn't have Rotary Encoders") + "\n";
v1 = 5+source.index;
}
else if (source.type == SOURCE_TYPE_MAX)
v1 = 8;
/* else if (source.type == SOURCE_TYPE_3POS)
v1 = 9; */
else if (source.type == SOURCE_TYPE_CYC)
v1 = 10+source.index;
else if (source.type == SOURCE_TYPE_PPM)
v1 = 13+source.index;
else if (source.type == SOURCE_TYPE_CH)
v1 = 21+source.index;
else if (source.type == SOURCE_TYPE_TELEMETRY)
v1 = 36+source.index;
return v1;
}
RawSource t_Th9xLogicalSwitchData::toSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
/* else if (value == 9) {
return RawSource(SOURCE_TYPE_3POS);
} */
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
t_Th9xModelData::t_Th9xModelData()
{
memset(this, 0, sizeof(t_Th9xModelData));
}
t_Th9xModelData::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
/*switch(tmrMode) {
case 1:
c9x.timers[0].mode = TMRMODE_ABS;
break;
case 2:
c9x.timers[0].mode = TMRMODE_THs;
break;
case 3:
c9x.timers[0].mode = TMRMODE_THp;
break;
default:
c9x.timers[0].mode = TMRMODE_OFF;
break;
}*/
// c9x.timers[0].dir = tmrDir;
c9x.timers[0].val = tmrVal;
/*c9x.protocol = (Protocol)protocol;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncTrims2Offsets;
if (trimSw) {
c9x.funcSw[0].swtch = trimSw;
}
c9x.beepANACenter = beepANACenter;
c9x.pulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.invertELE = swashInvertELE;
c9x.swashRingData.invertAIL = swashInvertAIL;
c9x.swashRingData.invertCOL = swashInvertCOL;
c9x.swashRingData.type = swashType;
c9x.swashRingData.collectiveSource = swashCollectiveSource;
c9x.swashRingData.value = swashRingValue;*/
for (int i=0; i<TH9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<TH9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoTab[i];
for (int i=0; i<TH9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<NUM_STICKS; i++)
c9x.phaseData[0].trim[i] = trimData[i].itrim;
for (int i=0; i<TH9X_MAX_CURVES3; i++) {
c9x.curves[i].count = 3;
for (int j=0; j<3; j++) {
c9x.curves[i].points[j].x = -100 + 100*i;
c9x.curves[i].points[j].y = curves3[i][j];
}
}
for (int i=0; i<TH9X_MAX_CURVES5; i++) {
c9x.curves[i+TH9X_MAX_CURVES3].count = 5;
for (int j=0; j<5; j++) {
c9x.curves[i+TH9X_MAX_CURVES3].points[j].x = -100 + 50*i;
c9x.curves[i+TH9X_MAX_CURVES3].points[j].y = curves5[i][j];
}
}
for (int i=0; i<TH9X_MAX_CURVES9; i++) {
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].count = 5;
for (int j=0; j<9; j++) {
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].points[j].x = -100 + 50*i;
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].points[j].y = curves9[i][j];
}
}
return c9x;
}
+182
View File
@@ -0,0 +1,182 @@
/*
* 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 th9xeeprom_h
#define th9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
//eeprom data
#define TH9X_NUM_CHNOUT 8
#define TH9X_MAX_EXPOS 15
#define TH9X_MAX_MIXERS 25
#define TH9X_MAX_SWITCHES 16
#define TH9X_MAX_CURVES3 3
#define TH9X_MAX_CURVES5 2
#define TH9X_MAX_CURVES9 2
#define TH9X_MAX_CSFUNC 13
#define MDVERS 6
#define TH9X_NUM_CSW 12 //number of custom switches
#define NUM_STICKSnPOTS 7 //number of sticks and pots
PACK(typedef struct t_Th9xTrainerMix {
uint8_t srcChn:3; //0-7 = ch1-8
int8_t swtch:5;
int8_t studWeight:6;
uint8_t mode:2; // off, add-mode, subst-mode
operator TrainerMix();
t_Th9xTrainerMix();
}) Th9xTrainerMix; //
PACK(typedef struct t_Th9xTrainerData {
int16_t calib[8];
Th9xTrainerMix mix[4];
operator TrainerData();
t_Th9xTrainerData();
}) Th9xTrainerData;
PACK(typedef struct t_Th9xGeneral {
uint8_t myVers;
int16_t calibMid[NUM_STICKSnPOTS];
int16_t calibSpanNeg[NUM_STICKSnPOTS];
int16_t calibSpanPos[NUM_STICKSnPOTS];
uint8_t inactivityMin; //ge150
uint8_t iTrimSwitch:4; //ge192
uint8_t iTrimTme1:2;
uint8_t iTrimTme2:2;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t lightSw;
Th9xTrainerData trainer;
uint8_t adcFilt:2;
uint8_t keySpeed:2;
uint8_t thr0pos:4;
uint8_t disableThrottleWarning:1;
uint8_t disableSwitchWarning:1;
uint8_t disableMemoryWarning:1;
uint8_t beeperVal:2;
uint8_t view:3;
uint8_t stickMode:2;
uint8_t naviMode:2;
operator GeneralSettings();
t_Th9xGeneral();
}) Th9xGeneral;
/*
* ModelData
*/
PACK(typedef struct t_Th9xExpoData {
int8_t exp5:5;
uint8_t mode3:3; //0=end 1=pos 2=neg 3=both 4=trimNeg
int8_t weight6:6;
uint8_t chn:2; //
int8_t drSw:5;
uint8_t curve:3; //
operator ExpoData();
t_Th9xExpoData();
}) Th9xExpoData;
PACK(typedef struct t_Th9xLimitData {
int8_t min:7;
bool scale:1;
int8_t max:7;
bool resv:1;
bool revert:1;
int8_t offset:7;
operator LimitData();
t_Th9xLimitData();
}) Th9xLimitData;
#define MLTPX_ADD 0
#define MLTPX_MUL 1
#define MLTPX_REP 2
PACK(typedef struct t_Th9xMixData {
uint8_t destCh:4; // 1..C9X_NUM_CHNOUT,X1-X4
uint8_t mixMode:2; // + * =
uint8_t dmy1:2; //
uint8_t srcRaw:5; // S1-4,P1-3,max,cur,X1-X4,p1-3,T1-8 24
uint8_t switchMode:2; // switchMode oOff\tiNeg\tiNul\tiPos
uint8_t curveNeg:1; // Cv cV
int8_t weight;
int8_t swtch:5;
uint8_t curve:3; // 0=off 1..7=cv1..7
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
operator MixData();
t_Th9xMixData();
}) Th9xMixData;
PACK(typedef struct t_Th9xLogicalSwitchData {
uint8_t sw:3; // 0..7
uint8_t opCmp:2; // < & | ^
uint8_t opRes:3; // 0 => 1=> 0=> !=> & | ^
int8_t val1;
int8_t val2;
operator LogicalSwitchData();
t_Th9xLogicalSwitchData() { memset(this, 0, sizeof(t_Th9xLogicalSwitchData)); }
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Th9xLogicalSwitchData;
PACK(typedef struct t_Th9xTrimData {
int8_t itrim:6; //trim index
uint8_t tmode:2;
t_Th9xTrimData() { }
}) Th9xTrimData;
PACK(typedef struct t_Th9xModelData {
char name[10]; // 10 must be first for eeLoadModelName
uint8_t mdVers; // 1
uint8_t tmrMode:3; // 1
int8_t tmrSw:5; //
uint16_t tmrVal; // 2
uint8_t protocol:5; // 1
uint8_t protocolPar:3; //
char res[3]; // 3
Th9xLimitData limitData[TH9X_NUM_CHNOUT];// 3*8
Th9xExpoData expoTab[TH9X_MAX_EXPOS]; // 5*4 -> 3*15
Th9xMixData mixData[TH9X_MAX_MIXERS]; //0 5*25
int8_t curves3[TH9X_MAX_CURVES3][3]; // 9 new143
int8_t curves5[TH9X_MAX_CURVES5][5]; // 10
int8_t curves9[TH9X_MAX_CURVES9][9]; // 18
Th9xLogicalSwitchData switchTab[TH9X_MAX_SWITCHES];//
Th9xTrimData trimData[NUM_STICKS]; // 3*4 -> 1*4
operator ModelData();
t_Th9xModelData();
}) Th9xModelData;
#endif
@@ -0,0 +1,155 @@
/*
* 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 <iostream>
#include "th9xinterface.h"
#include "th9xeeprom.h"
#include "th9xsimulator.h"
#include "file.h"
#include "appdata.h"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
#define FILE_GENERAL 0
#define FILE_MODEL(n) (1+n)
Th9xInterface::Th9xInterface():
EEPROMInterface(BOARD_STOCK),
efile(new RleFile())
{
}
Th9xInterface::~Th9xInterface()
{
delete efile;
}
const char * Th9xInterface::getName()
{
return "Th9x";
}
const int Th9xInterface::getEEpromSize()
{
QString avrMCU = g.mcu();
if (avrMCU==QString("m128")) {
return 2*EESIZE_STOCK;
}
return EESIZE_STOCK;
}
const int Th9xInterface::getMaxModels()
{
return 16;
}
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
}
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying th9x import... ";
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
efile->openRd(FILE_GENERAL);
Th9xGeneral th9xGeneral;
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
}
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
switch(th9xGeneral.myVers) {
case 6:
break;
default:
std::cout << "not th9x\n";
return false;
}
efile->openRd(FILE_GENERAL);
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if (len != sizeof(Th9xGeneral)) {
std::cout << "not th9x\n";
return false;
}
radioData.generalSettings = th9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
Th9xModelData th9xModel;
efile->openRd(FILE_MODEL(i));
if (!efile->readRlc2((uint8_t*)&th9xModel, sizeof(Th9xModelData))) {
radioData.models[i].clear();
}
else {
radioData.models[i] = th9xModel;
}
}
std::cout << "ok\n";
return true;
}
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
}
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
std::cout << "NO!\n";
// TODO a warning
return 0;
}
int Th9xInterface::getSize(ModelData &model)
{
return 0;
}
int Th9xInterface::getSize(GeneralSettings &settings)
{
return 0;
}
int Th9xInterface::isAvailable(Protocol proto, int port)
{
switch (proto) {
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
return 1;
default:
return 0;
}
}
@@ -0,0 +1,57 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef th9x_interface_h
#define th9x_interface_h
#include "eeprominterface.h"
class RleFile;
class Th9xInterface : public EEPROMInterface
{
public:
Th9xInterface();
virtual ~Th9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
protected:
RleFile *efile;
};
#endif
@@ -0,0 +1,233 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "firmwares/th9x/th9xsimulator.h"
#include "firmwares/th9x/th9xinterface.h"
#define SIM
#define SIMU
#define SIMU_EXCEPTIONS
#undef min
#undef max
#define NUM_POTS 3
#define NUM_CSW 12
#define SWSRC_SW1 10
#include <exception>
#include <algorithm>
namespace Th9x {
#include "simpgmspace.h"
#include "th9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "foldedlist.cpp"
#include "simpgmspace.cpp"
#include "pulses.cpp"
int16_t g_anas[7];
char g_title[80] = "";
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 750;
else
return 512 + g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trimData[idx].itrim = trimRevertM(value, g_model.trimData[idx].tmode);
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++) {
values[i] = trimVal(i);
}
}
void eeprom_RESV_mismatch(void)
{
assert(!"Should never been called. Only needed by VC++ (debug mode)");
}
#define GPIO_TRIM_LH_L pind
#define GPIO_TRIM_LV_DN pind
#define GPIO_TRIM_RV_UP pind
#define GPIO_TRIM_RH_L pind
#define GPIO_TRIM_LH_R pind
#define GPIO_TRIM_LV_UP pind
#define GPIO_TRIM_RV_DN pind
#define GPIO_TRIM_RH_R pind
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
#define TRIM_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
}
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin &= ~(mask); else pin |= (mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
switch (swtch) {
SWITCH_CASE(0, pine, 1<<INP_E_ThrCt)
SWITCH_CASE(4, pine, 1<<INP_E_AileDR)
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
default:
break;
}
}
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
}
}
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Th9x;
Th9xSimulator::Th9xSimulator(Th9xInterface * th9xInterface):
th9xInterface(th9xInterface)
{
}
bool Th9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Th9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::start(RadioData &radioData, bool tests)
{
th9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Th9xSimulator::stop()
{
StopMainThread();
}
void Th9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
for (int i=0; i<8; i++)
outputs.chans[i] *= 2;
}
void Th9xSimulator::setValues(TxInputs &_inputs)
{
TxInputs inputs = _inputs;
for (int i=0; i<4; i++)
inputs.sticks[i] /= 2;
for (int i=0; i<3; i++)
inputs.pots[i] /= 2;
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::setTrim(unsigned int idx, int value)
{
Th9x::setTrim(idx, value);
}
void Th9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Th9x::getTrims(trims.values);
}
const char * Th9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -0,0 +1,60 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef th9x_simulator_h
#define th9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Th9xInterface;
class Th9xSimulator : public SimulatorInterface {
public:
Th9xSimulator(Th9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual void wheelEvent(uint8_t steps) { }
virtual const char * getError();
protected:
Th9xInterface * th9xInterface;
};
#endif
+340
View File
@@ -0,0 +1,340 @@
/*
* 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 <QtGui>
#include "hexinterface.h"
#include "splash.h"
#include "flashinterface.h"
#include "helpers.h"
#define VERS_MARK "VERS"
#define DATE_MARK "DATE"
#define TIME_MARK "TIME"
#define EEPR_MARK "EEPR"
int getFileType(const QString &fullFileName)
{
QString suffix = QFileInfo(fullFileName).suffix().toUpper();
if (suffix == "HEX")
return FILE_TYPE_HEX;
else if (suffix == "BIN")
return FILE_TYPE_BIN;
else if (suffix == "EEPM")
return FILE_TYPE_EEPM;
else if (suffix == "EEPE")
return FILE_TYPE_EEPE;
else if (suffix == "XML")
return FILE_TYPE_XML;
else
return 0;
}
FlashInterface::FlashInterface(QString fileName):
flash(MAX_FSIZE, 0),
flash_size(0),
versionId(0),
splash_offset(0),
splash_size(0),
splash_width(0),
splash_height(0),
isValidFlag(false)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
QTextStream inputStream(&file);
flash_size = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
file.close();
if (flash_size == 0) {
file.open(QIODevice::ReadOnly);
flash_size = file.read((char *)flash.data(), MAX_FSIZE);
}
}
}
if (flash_size > 0) {
version = seekLabel(VERS_MARK);
date = seekLabel(DATE_MARK);
time = seekLabel(TIME_MARK);
eepromId = seekLabel(EEPR_MARK);
if (eepromId.contains('-')) {
QStringList list = eepromId.split('-');
eepromVersion = list[0].toInt();
eepromVariant = list[1].toInt();
}
else {
eepromVersion = eepromId.toInt();
}
versionId = version2index(version);
SeekSplash();
isValidFlag = true;
}
}
QString FlashInterface::seekString(const QString & string)
{
QString result = "";
int start = flash.indexOf(string);
if (start > 0) {
start += string.length();
int end = -1;
for (int i=start; i<start+20; i++) {
char c = flash.at(i);
if (c == '\0' || c == '\036') {
end = i;
break;
}
}
if (end > 0) {
result = flash.mid(start, (end - start)).trimmed();
}
}
return result;
}
QString FlashInterface::seekLabel(const QString & label)
{
QString result = seekString(label + "\037\033:");
if (!result.isEmpty())
return result;
return seekString(label + ":");
}
bool FlashInterface::SeekSplash(QByteArray splash)
{
int start = flash.indexOf(splash);
if (start>0) {
splash_offset = start;
splash_size = splash.size();
return true;
}
else {
return false;
}
}
bool FlashInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
{
int start = 0;
while (start>=0) {
start = flash.indexOf(sps, start+1);
if (start>0) {
int end = start + sps.size() + size;
if (end == flash.indexOf(spe, end)) {
splash_offset = start + sps.size();
splash_size = end - start - sps.size();
return true;
}
else {
qDebug() << flash.indexOf(spe, start) << end << sps.size() << spe;
}
}
}
return false;
}
#define OTX_SPS_9X "SPS\0\200\100"
#define OTX_SPS_TARANIS "SPS\0\324\100"
#define OTX_SPS_SIZE 6
#define OTX_SPE "SPE"
#define OTX_SPE_SIZE 4
void FlashInterface::SeekSplash(void)
{
splash_size = 0;
splash_offset = 0;
splash_width = SPLASH_WIDTH;
splash_height = SPLASH_HEIGHT;
splash_format = QImage::Format_Mono;
if (SeekSplash(QByteArray((const char *)gr9x_splash, sizeof(gr9x_splash))) || SeekSplash(QByteArray((const char *)gr9xv4_splash, sizeof(gr9xv4_splash)))) {
return;
}
if (SeekSplash(QByteArray((const char *)er9x_splash, sizeof(er9x_splash)))) {
return;
}
if (SeekSplash(QByteArray((const char *)opentx_splash, sizeof(opentx_splash)))) {
return;
}
if (SeekSplash(QByteArray((const char *)opentxtaranis_splash, sizeof(opentxtaranis_splash)))) {
splash_width = SPLASHX9D_WIDTH;
splash_height = SPLASHX9D_HEIGHT;
splash_format = QImage::Format_Indexed8;
return;
}
if (SeekSplash(QByteArray((const char *)ersky9x_splash, sizeof(ersky9x_splash)))) {
return;
}
if (SeekSplash(QByteArray(OTX_SPS_9X, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 1024)) {
return;
}
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 6784)) {
splash_width = SPLASHX9D_WIDTH;
splash_height = SPLASHX9D_HEIGHT;
splash_format = QImage::Format_Indexed8;
return;
}
if (SeekSplash(QByteArray(ERSKY9X_SPS, sizeof(ERSKY9X_SPS)), QByteArray(ERSKY9X_SPE, sizeof(ERSKY9X_SPE)), 1030)) {
return;
}
if (SeekSplash(QByteArray(ERSPLASH_MARKER, sizeof(ERSPLASH_MARKER)))) {
splash_offset += sizeof(ERSPLASH_MARKER);
splash_size = sizeof(er9x_splash);
}
}
bool FlashInterface::setSplash(const QImage & newsplash)
{
if (splash_offset == 0 || splash_size == 0) {
return false;
}
char b[SPLASH_SIZE_MAX] = {0};
QColor color;
QByteArray splash;
if (splash_format == QImage::Format_Indexed8) {
unsigned int idx = 0;
for (unsigned int y=0; y<splash_height; y+=8) {
for (unsigned int x=0; x<splash_width; x++) {
unsigned int values[] = { 255, 255, 255, 255 };
for (unsigned int z=0; z<8; z++) {
if (y+z < splash_height) {
QRgb gray = qGray(newsplash.pixel(x, y+z));
for (unsigned int i=0; i<4; i++) {
if (gray & (1<<(4+i)))
values[i] -= 1 << z;
}
}
}
for (int i=0; i<4; i++)
b[idx++] = values[i];
}
}
}
else {
QColor black = QColor(0,0,0);
QImage blackNwhite = newsplash.convertToFormat(QImage::Format_MonoLSB);
for (uint y=0; y<splash_height; y++) {
for (uint x=0; x<splash_width; x++) {
color = QColor(blackNwhite.pixel(x,y));
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
}
}
}
splash.clear();
splash.append(b, splash_size);
flash.replace(splash_offset, splash_size, splash);
return true;
}
int FlashInterface::getSplashWidth()
{
return splash_width;
}
uint FlashInterface::getSplashHeight()
{
return splash_height;
}
QImage::Format FlashInterface::getSplashFormat()
{
return splash_format;
}
QImage FlashInterface::getSplash()
{
if (splash_offset == 0 || splash_size == 0) {
return QImage(); // empty image
}
if (splash_format == QImage::Format_Indexed8) {
QImage image(splash_width, splash_height, QImage::Format_RGB888);
if (splash_offset > 0) {
for (unsigned int y=0; y<splash_height; y++) {
unsigned int idx = (y/8)*splash_width*4;
unsigned int mask = (1 << (y%8));
for (unsigned int x=0; x<splash_width; x++, idx+=4) {
unsigned int z = ((flash.at(splash_offset+idx) & mask) ? 0x1 : 0) + ((flash.at(splash_offset+idx+1) & mask) ? 0x2 : 0) + ((flash.at(splash_offset+idx+2) & mask) ? 0x4 : 0) + ((flash.at(splash_offset+idx+3) & mask) ? 0x8 : 0);
z = 255-(z*255)/15;
QRgb rgb = qRgb(z, z, z);
image.setPixel(x, y, rgb);
}
}
}
return image;
}
else {
QImage image(splash_width, splash_height, QImage::Format_Mono);
if (splash_offset > 0) {
for (unsigned int y=0; y<splash_height; y++)
for(unsigned int x=0; x<splash_width; x++)
image.setPixel(x, y, (flash.at(splash_offset+(splash_width*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
}
return image;
}
}
bool FlashInterface::hasSplash()
{
return (splash_offset > 0 ? true : false);
}
bool FlashInterface::isValid()
{
return isValidFlag;
}
uint FlashInterface::saveFlash(QString fileName)
{
uint8_t binflash[MAX_FSIZE];
memcpy(&binflash, flash.constData(), flash_size);
QFile file(fileName);
int fileType = getFileType(fileName);
if (fileType == FILE_TYPE_HEX) {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { //reading HEX TEXT file
return -1;
}
QTextStream outputStream(&file);
HexInterface hex=HexInterface(outputStream);
hex.save(binflash, flash_size);
}
else {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { //reading HEX TEXT file
return -1;
}
file.write((char*)binflash, flash_size);
}
file.close();
return flash_size;
}
+90
View File
@@ -0,0 +1,90 @@
/*
* Author - Romolo Manfredini <romolo.manfredini@gmail.com>
*
* 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 FLASHINTERFACE_H
#define FLASHINTERFACE_H
#include <QDialog>
#include <QtGui>
#include <inttypes.h>
#include "file.h"
#define MAX_FSIZE (512*1024)
#define SPLASH_WIDTH (128)
#define SPLASH_HEIGHT (64)
#define SPLASHX9D_WIDTH (212)
#define SPLASHX9D_HEIGHT (64)
#define SPLASH_SIZE_MAX (SPLASHX9D_WIDTH*SPLASHX9D_HEIGHT/2)
#define ERSPLASH_MARKER "Splash"
#define ERSPLASH_OFFSET (10)
#define ERSKY9X_SPS "SPS"
#define ERSKY9X_SPE "SPE"
#define ERSKY9X_OFFSET (7)
#define FILE_TYPE_BIN 1
#define FILE_TYPE_HEX 2
#define FILE_TYPE_EEPE 3
#define FILE_TYPE_EEPM 4
#define FILE_TYPE_XML 5
int getFileType(const QString &fullFileName);
class FlashInterface
{
public:
FlashInterface(QString filename);
inline QString getDate() { return date; }
inline QString getTime() { return time; }
int getSize() { return flash_size; }
inline QString getVersion() { return version; }
unsigned int getVersionId() { return versionId; }
inline int getEEpromVersion() { return eepromVersion; }
inline int getEEpromVariant() { return eepromVariant; }
inline QString getEEpromId() { return eepromId; }
QImage getSplash();
bool setSplash(const QImage & newsplash);
bool hasSplash();
int getSplashWidth();
uint getSplashHeight();
QImage::Format getSplashFormat();
uint saveFlash(QString fileName);
bool isValid();
private:
QByteArray flash;
uint flash_size;
QString seekString(const QString & string);
QString seekLabel(const QString & label);
void SeekSplash();
bool SeekSplash(QByteArray sps, QByteArray spe, int size);
bool SeekSplash(QByteArray splash);
QString filename;
QString date;
QString time;
QString version;
int versionId;
QString eepromId;
int eepromVersion;
int eepromVariant;
QByteArray splash;
uint splash_offset;
uint splash_size;
uint splash_width;
uint splash_height;
QImage::Format splash_format;
bool isValidFlag;
};
#endif /* FLASHINTERFACE_H */
+35
View File
@@ -0,0 +1,35 @@
#include "fusesdialog.h"
#include "ui_fusesdialog.h"
#include "burnconfigdialog.h"
#include "helpers.h"
fusesDialog::fusesDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::fusesDialog)
{
ui->setupUi(this);
this->setWindowIcon(CompanionIcon("fuses.png"));
}
fusesDialog::~fusesDialog()
{
delete ui;
}
void fusesDialog::on_resetFuses_EEprotect_clicked()
{
burnConfigDialog *bcd = new burnConfigDialog(this);
bcd->restFuses(true);
}
void fusesDialog::on_resetFuses_EEdelete_clicked()
{
burnConfigDialog *bcd = new burnConfigDialog(this);
bcd->restFuses(false);
}
void fusesDialog::on_readFuses_clicked()
{
burnConfigDialog *bcd = new burnConfigDialog(this);
bcd->readFuses();
}
+27
View File
@@ -0,0 +1,27 @@
#ifndef FUSESDIALOG_H
#define FUSESDIALOG_H
#include <QDialog>
namespace Ui {
class fusesDialog;
}
class fusesDialog : public QDialog
{
Q_OBJECT
public:
explicit fusesDialog(QWidget *parent = 0);
~fusesDialog();
private:
Ui::fusesDialog *ui;
private slots:
void on_readFuses_clicked();
void on_resetFuses_EEdelete_clicked();
void on_resetFuses_EEprotect_clicked();
};
#endif // FUSESDIALOG_H
+118
View File
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>fusesDialog</class>
<widget class="QDialog" name="fusesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>374</width>
<height>207</height>
</rect>
</property>
<property name="windowTitle">
<string>Fuses</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<widget class="QPushButton" name="readFuses">
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Reads the current fuses in the AVR controller.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Proper states for &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;AtMega 64 &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;EEPROM erase fuse not set: 0E, 81, FF&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;EEPROM erase fuse set: 0E, 89, FF&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Proper states for AtMega 2560 :&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;EEPROM erase fuse not set: D7, 11, FC&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;EEPROM erase fuse set: D7, 19, FC&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Read Fuses</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="resetFuses_EEprotect">
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;Reset Fuses&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Fuses in the AVR tell it how to behave. Pressing this button sets the fuses to the default parameters needed in the FW. These parameters are different for stock and 4.1 MB, please verify you selected the appropriate processor type in preferences.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;This button also sets the &amp;quot;EEPROM protect&amp;quot; Fuse.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;This prevents erasing of the EEPROM when the flash memory is written.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;WARNING&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Setting fuses can lead to problems and even a total lockout from your controller. Do this only if you know what you are doing.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;When in doubt consult either the project's page or the 9xforum (http://9xforums.com/forum/)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;If you do get locked out - google lookup for &amp;quot;dealing with Fuse Bricks&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reset Fuses
EEPROM - PROTECT</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="resetFuses_EEdelete">
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;Reset Fuses&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Fuses in the AVR tell it how to behave. Pressing this button sets the fuses to the default parameters needed in the &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;FW. These parameters are different for stock and 4.1 MB, please verify you selected the appropriate processor type in preferences.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;This button also clears the &amp;quot;EEPROM protect&amp;quot; Fuse.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;This causes erasing of the EEPROM when the flash memory is written.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;WARNING&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Setting fuses can lead to problems and even a total lockout from your controller. Do this only if you know what you are doing.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;When in doubt consult either the project's page or the 9xforum (http://9xforums.com/forum/)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;If you do get locked out - google lookup for &amp;quot;dealing with Fuse Bricks&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reset Fuses
EEPROM - DELETE</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;WARNING&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Changing the fuses can mess up your radio.&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Proceed only if you know what you are doing.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<connections/>
</ui>
+57
View File
@@ -0,0 +1,57 @@
#include "fwpreferencesdialog.h"
#include "ui_fwpreferencesdialog.h"
#include "mainwindow.h"
#include "eeprominterface.h"
#include "helpers.h"
#include "appdata.h"
#include <QDesktopServices>
#include <QtGui>
FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::FirmwarePreferencesDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("fwpreferences.png"));
initSettings();
}
FirmwarePreferencesDialog::~FirmwarePreferencesDialog()
{
delete ui;
}
void FirmwarePreferencesDialog::initSettings()
{
ui->fwTypeLbl->setText(g.profile[g.id()].fwType());
int version = g.fwRev.get(g.profile[g.id()].fwType());
if (version > 0) {
ui->lastRevisionLbl->setText(index2version(version));
}
}
void FirmwarePreferencesDialog::on_checkFWUpdates_clicked()
{
MainWindow * mw = (MainWindow *)this->parent();
mw->checkForFirmwareUpdate();
initSettings();
}
void FirmwarePreferencesDialog::on_fw_dnld_clicked()
{
MainWindow * mw = (MainWindow *)this->parent();
mw->dowloadLastFirmwareUpdate();
initSettings();
}
void FirmwarePreferencesDialog::on_voice_dnld_clicked()
{
QString url = "http://voices-20.open-tx.org/";
QString fwType = g.profile[g.id()].fwType();
QStringList list = fwType.split("-");
QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]);
url.append(QString("%1/%2/").arg(firmware).arg(ui->voiceCombo->currentText().toLower()));
QDesktopServices::openUrl(url);
}
+32
View File
@@ -0,0 +1,32 @@
#ifndef FWPREFERENCESDIALOG_H
#define FWPREFERENCESDIALOG_H
#include <QDialog>
#include <QCheckBox>
#include "eeprominterface.h"
namespace Ui {
class FirmwarePreferencesDialog;
}
class Joystick;
class FirmwarePreferencesDialog : public QDialog
{
Q_OBJECT
public:
explicit FirmwarePreferencesDialog(QWidget *parent = 0);
~FirmwarePreferencesDialog();
private:
Ui::FirmwarePreferencesDialog *ui;
void initSettings();
private slots:
void on_fw_dnld_clicked();
void on_voice_dnld_clicked();
void on_checkFWUpdates_clicked();
};
#endif // FWPREFERENCESDIALOG_H
+253
View File
@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FirmwarePreferencesDialog</class>
<widget class="QDialog" name="FirmwarePreferencesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>416</width>
<height>153</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Downloads</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item row="24" column="5">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QPushButton" name="checkFWUpdates">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="voiceLabel">
<property name="font">
<font>
<family>Sans Serif</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Voice</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="voiceCombo">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set voice language.
May be different from firmware language</string>
</property>
<item>
<property name="text">
<string>en</string>
</property>
</item>
<item>
<property name="text">
<string>cz</string>
</property>
</item>
<item>
<property name="text">
<string>de</string>
</property>
</item>
<item>
<property name="text">
<string>es</string>
</property>
</item>
<item>
<property name="text">
<string>fi</string>
</property>
</item>
<item>
<property name="text">
<string>fr</string>
</property>
</item>
<item>
<property name="text">
<string>it</string>
</property>
</item>
<item>
<property name="text">
<string>pl</string>
</property>
</item>
<item>
<property name="text">
<string>pt</string>
</property>
</item>
<item>
<property name="text">
<string>se</string>
</property>
</item>
</widget>
</item>
<item row="7" column="5">
<widget class="QPushButton" name="voice_dnld">
<property name="text">
<string>Download Voice</string>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QPushButton" name="fw_dnld">
<property name="text">
<string>Download FW</string>
</property>
</widget>
</item>
<item row="7" 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="6" column="0" colspan="6">
<widget class="Line" name="voiceLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="23" column="0" colspan="6">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Firmware</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2" colspan="4">
<widget class="QLabel" name="fwTypeLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">FwType</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="lastRevisionLbl">
<property name="text">
<string notr="true">-</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Latest Download</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>FirmwarePreferencesDialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>345</x>
<y>133</y>
</hint>
<hint type="destinationlabel">
<x>207</x>
<y>76</y>
</hint>
</hints>
</connection>
</connections>
</ui>
File diff suppressed because it is too large Load Diff
+142
View File
@@ -0,0 +1,142 @@
#ifndef GENERALEDIT_H
#define GENERALEDIT_H
#include <QDialog>
#include "eeprominterface.h"
namespace Ui {
class GeneralEdit;
}
class GeneralEdit : public QDialog
{
Q_OBJECT
public:
explicit GeneralEdit(RadioData &radioData, QWidget *parent = 0);
~GeneralEdit();
void updateSettings();
private:
Ui::GeneralEdit *ui;
RadioData &radioData;
GeneralSettings g_eeGeneral;
bool switchDefPosEditLock;
bool voiceLangEditLock;
bool mavbaudEditLock;
void getGeneralSwitchDefPos(int i, bool val);
void setSwitchDefPos();
void updateVarioPitchRange();
void disableMouseScrolling();
protected:
virtual bool eventFilter(QObject *obj, QEvent *event);
signals:
void modelValuesChanged();
private slots:
void on_faimode_CB_stateChanged(int );
void on_speakerPitchSB_editingFinished();
void on_timezoneSB_editingFinished();
void on_hapticStrength_valueChanged();
void on_soundModeCB_currentIndexChanged(int index);
void on_beeperlenCB_currentIndexChanged(int index);
void on_volume_SB_editingFinished();
void on_hapticmodeCB_currentIndexChanged(int index);
void on_hapticLengthCB_currentIndexChanged(int index);
void on_PPM_MultiplierDSB_editingFinished();
void on_splashScreenChkB_stateChanged(int);
void on_splashScreenDuration_currentIndexChanged(int index);
void on_alarmwarnChkB_stateChanged(int );
void on_gpsFormatCB_currentIndexChanged(int index);
void on_tabWidget_currentChanged(int index);
void on_displayTypeCB_currentIndexChanged(int index);
void on_BLBright_SB_editingFinished();
void on_backlightColor_SL_valueChanged();
void on_re_CB_currentIndexChanged(int index);
void on_countrycode_CB_currentIndexChanged(int index);
void on_units_CB_currentIndexChanged(int index);
void on_trnMode_1_currentIndexChanged(int index);
void on_trnChn_1_currentIndexChanged(int index);
void on_trnWeight_1_editingFinished();
void on_trnMode_2_currentIndexChanged(int index);
void on_trnChn_2_currentIndexChanged(int index);
void on_trnWeight_2_editingFinished();
void on_trnMode_3_currentIndexChanged(int index);
void on_trnChn_3_currentIndexChanged(int index);
void on_trnWeight_3_editingFinished();
void on_trnMode_4_currentIndexChanged(int index);
void on_trnChn_4_currentIndexChanged(int index);
void on_trnWeight_4_editingFinished();
void on_CurrentCalib_SB_editingFinished();
void on_ana1Neg_editingFinished();
void on_ana2Neg_editingFinished();
void on_ana3Neg_editingFinished();
void on_ana4Neg_editingFinished();
void on_ana5Neg_editingFinished();
void on_ana6Neg_editingFinished();
void on_ana7Neg_editingFinished();
void on_ana8Neg_editingFinished();
void on_ana1Mid_editingFinished();
void on_ana2Mid_editingFinished();
void on_ana3Mid_editingFinished();
void on_ana4Mid_editingFinished();
void on_ana5Mid_editingFinished();
void on_ana6Mid_editingFinished();
void on_ana7Mid_editingFinished();
void on_ana8Mid_editingFinished();
void on_ana1Pos_editingFinished();
void on_ana2Pos_editingFinished();
void on_ana3Pos_editingFinished();
void on_ana4Pos_editingFinished();
void on_ana5Pos_editingFinished();
void on_ana6Pos_editingFinished();
void on_ana7Pos_editingFinished();
void on_ana8Pos_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_beepVolume_SL_valueChanged();
void on_bgVolume_SL_valueChanged();
void on_varioVolume_SL_valueChanged();
void on_wavVolume_SL_valueChanged();
void on_varioP0_SB_editingFinished();
void on_varioPMax_SB_editingFinished();
void on_varioR0_SB_editingFinished();
void on_pot1Type_currentIndexChanged(int index);
void on_pot2Type_currentIndexChanged(int index);
void on_pot3Type_currentIndexChanged(int index);
void on_serialPortMode_currentIndexChanged(int index);
void on_stickmodeCB_currentIndexChanged(int index);
void on_channelorderCB_currentIndexChanged(int index);
void on_beeperCB_currentIndexChanged(int index);
void on_memwarnChkB_stateChanged(int );
void on_inactimerSB_editingFinished();
void on_backlightautoSB_editingFinished();
void on_backlightswCB_currentIndexChanged(int index);
void on_mavbaud_CB_currentIndexChanged(int index);
void on_voiceLang_CB_currentIndexChanged(int index);
void on_battCalibDSB_editingFinished();
void on_battwarningDSB_editingFinished();
void on_contrastSB_editingFinished();
void on_calretrieve_PB_clicked();
void on_calstore_PB_clicked();
void unlockSwitchEdited();
void setValues();
void shrink();
void stickReverseEdited();
void on_switchesDelay_valueChanged();
};
#endif // GENERALEDIT_H
File diff suppressed because it is too large Load Diff
+73
View File
@@ -0,0 +1,73 @@
#include "googleanalytics.h"
#include <QtGui>
#define TRACKING_ID "UA-40098569-1"
GoogleAnalytics ga;
GoogleAnalytics::GoogleAnalytics():
userId(qrand()),
networkManager(new QNetworkAccessManager(this))
{
}
GoogleAnalytics::~GoogleAnalytics()
{
delete networkManager;
}
void GoogleAnalytics::sendPageView(QString title)
{
// create request and set URL of receiver
QNetworkRequest request;
QUrl host("http://www.google-analytics.com/collect");
request.setUrl(host);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
// setup parameters of request
QString requestParams;
requestParams += "v=1"; // version of protocol
requestParams += "&t=pageview"; // type of request
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
requestParams += "&cid=" + QString::number(userId); // unique user identifier
requestParams += "&dp=companion-" + title.toLower().replace(" ", "-"); // name of page
requestParams += "&dt=" + title; // title of page
requestParams += "&ul=" + QLocale::system().name(); // language
// send request via post method
networkManager->post(request, requestParams.toStdString().c_str());
}
void GoogleAnalytics::sendEvent(QString category, QString action, QString label)
{
// create request and set URL of receiver
QNetworkRequest request;
QUrl host("http://www.google-analytics.com/collect");
request.setUrl(host);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
// setup parameters of request
QString requestParams;
requestParams += "v=1"; // version of protocol
requestParams += "&t=event"; // type of request
requestParams += "&ec=" + category;
requestParams += "&ea=" + action;
requestParams += "&el=" + label;
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
requestParams += "&cid=" + QString::number(userId); // unique user identifier
requestParams += "&dt=Companion"; // name of page (or app name)
requestParams += "&ul=" + QLocale::system().name(); // language
// send request via post method
networkManager->post(request, requestParams.toStdString().c_str());
}
void GoogleAnalytics::slot_receive(QNetworkReply * reply)
{
// output information about reply
qDebug() << "RequestUrl:" << reply->request().url();
qDebug() << "Status:" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
qDebug() << "Error:"<< reply->error();
QByteArray bytes = reply->readAll();
qDebug() << "Contents" << QString::fromUtf8(bytes.data(), bytes.size());
}

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