Compare commits

...

892 Commits

Author SHA1 Message Date
3djc cca7180834 Release prep 2017-12-17 10:07:54 +01:00
Bertrand Songis 104ab8c7f3 Typo fix
Because omeone asked to to explain what means LDC today ...
2017-12-16 22:09:38 +01:00
Bertrand Songis e4d273aa0e Update CREDITS.txt 2017-12-16 17:12:32 +01:00
Bertrand Songis df61a1ab4e Update CREDITS.txt 2017-12-16 17:11:01 +01:00
Raphael Coeffic 1dcd8cc419 small fixes for french translation (#5517)
* fixed VKEYS french

fixes #5481

* fix french confirmation popup

fixes #5475
2017-12-16 15:42:26 +01:00
Max Paperno b55b68f191 [Companion] Fix incorrect Settings dialog tab shown by default (closes #5511). 2017-12-15 19:15:14 -05:00
3djc 2c2339e229 Merge pull request #5514 from opentx/bsongis/r9m_navigation_issue
R9M navigation issue (when external module is R9M-EU and internal mod…
2017-12-14 15:35:40 +01:00
Bertrand Songis d7645252bb Power issue with R9M (always max power) (#5513) 2017-12-14 15:34:14 +01:00
3djc dc89bb1dfc Fix SHUTDOWN_CONFIRMATION compile 2017-12-14 07:58:31 +01:00
Bertrand Songis 47383fd053 Update CREDITS.txt 2017-12-13 22:15:32 +01:00
Bertrand Songis f80406c7cb R9M navigation issue (when external module is R9M-EU and internal module is OFF) 2017-12-13 22:13:40 +01:00
3djc 75b382e619 Simply hide unavailable choices (#5509) 2017-12-13 12:51:01 +01:00
Bertrand Songis 566c616abb Update CREDITS.txt 2017-12-13 09:18:47 +01:00
Arne Schwabe 59d2ef8aa1 Rework rssi code a bit (#5507)
* Switch backlight on when displaying a warning.

This is especially visible on the power off RSSI warning. This will also show the other warnings at start with backlight, even when blocklight is set to always off. But my X9D+ will switch its backlight on after boot once even with backlight on, so backlight=off is not so off as it seems.

* Rework power rssi code a bit

- Cleanup shutdown_confirm code
- allow x9d+ to be compiled as power button too to be able to test these things on the x9d+
- Fix shutoff after 10s in warning dialog on x9d
- Make warning dialog always turn on backlight

* Revert CMakeLists.txt
2017-12-12 22:01:32 +01:00
3djc 977262232a Better handle interactions with internal module telemetry (#5506) 2017-12-12 20:32:53 +01:00
Bertrand Songis fa5895de39 Update CREDITS.txt 2017-12-11 19:27:40 +01:00
Sebastien Charpentier f2fb788eac Fixed some typo. (#5499) 2017-12-11 18:12:04 +01:00
Max Paperno c8c3b79f2d [X10] Accept old OTX_FOURCC for X12 as valid when reading data. (#5497) 2017-12-11 13:05:40 +01:00
Bertrand Songis 1c7012726a FourCC added for X10 (last minute change, not tested at all (#5495)
FourCC added for X10
2017-12-10 20:23:59 +01:00
Arne Schwabe e3bbbdcecf Fix compiler warning is Russian tts 2017-12-10 13:00:03 +01:00
Max Paperno 4e8867c819 [Companion] Include global functions and function source types in conversions. 2017-12-10 06:21:17 -05:00
Max Paperno cffb5e767f [Companion] Ensure proper number of model slots after radio data conversion. 2017-12-10 06:10:26 -05:00
Max Paperno 204711d313 [Companion] Fix possible out-of-bounds array access crash. 2017-12-10 06:05:41 -05:00
Max Paperno e43807540e [Companion] Adjust X10/S hardware options to match radio (no L1/L2/JSx/JSy). Fixes #5488 (#5493) 2017-12-10 10:09:24 +01:00
Bertrand Songis eb79d4f774 Update CREDITS.txt 2017-12-10 10:02:05 +01:00
Bertrand Songis e80b63f66f Update CREDITS.txt 2017-12-09 22:09:04 +01:00
Kilrah ada0712e1a French translations 2017-12-09 11:53:35 +01:00
3djc 0a7aece40f Inc SDCard version for RC2 2017-12-09 10:32:26 +01:00
3djc 63bcb4693d Merge pull request #5485 from opentx/LapinFou/Update_Wizard
Updated Wizard
2017-12-09 10:30:46 +01:00
Max Paperno dec630efa0 [X9] Allow LSs 33-64 in main view & fix X9E view of channels 17-32 (#5486)
* [212x64] Main view toggle LS groups 1-32 and 33-64 with +/-/encoder. Closes #5476

* [212x64] Also allow encoder events in channels view for switching channels range (fix for X9E).

* Pad LS range numerals to 2 digits.
2017-12-09 10:20:07 +01:00
Sebastien Charpentier 2a0984408f Updated French Translation (#5484)
* Initial version

* Updated French Translation.
2017-12-09 10:19:06 +01:00
3djc 8e5027dcb2 Better support for R9M EU (#5487)
* POC for X9, requires -DBINDING_OPTIONS=YES

* There are apparently 4 valid choices

* - make BINDING_OPTIONS part of standard code
- adapt R9M EU LBT dialog to choice on bind

* - remove option from Companion
- cosmetics

* Compilation fixes
2017-12-09 10:17:56 +01:00
3djc f489742c9e Fix German compilation 2017-12-09 09:23:54 +01:00
LapinFou bcc6e3c67d Updated Wizard: reduced mixers name to 6 caracters. 2017-12-08 16:53:18 +01:00
3djc 12ad7b0d9c Reorganize ana display for X7 (#5482) 2017-12-08 11:27:37 +01:00
Bertrand Songis a6044a684d Bsongis/r9 m fixes (#5406)
R9M support
2017-12-08 11:26:46 +01:00
Max Paperno 9c27947345 [Companion] Ensure no duplicates in recent files menu (thanks capitaineflam25). Fixes #5336 (#5478) 2017-12-08 09:26:01 +01:00
Max Paperno c96a30aea0 [Companion] Fix GVar min corrupted when upgrading from firmware <= v217 (fixes #5466). (#5477) 2017-12-08 09:25:22 +01:00
Raphael Coeffic 934578118b added support for min/max contrast to eeprom interface and use it (#5473)
Added support for min/max contrast to eeprom interface and use it. Fixes #5468
2017-12-07 22:10:24 +01:00
3djc 81dbebb663 Show multi failsafe to x7 UI (#5471)
* Show multi failsafe to x7 UI

* Cosmetics

* Fix also horus ui and remove useless ifs
2017-12-07 18:49:55 +01:00
Arne Schwabe afd3103506 Update multi protocols (#5461)
* Update multi protocols

* SFHSS also has failsafe implemented

* Show failsafe setting in Companion

* Fix missing protocol names

* Update failsafe format and only show bind when module reports to support it
2017-12-07 18:48:10 +01:00
Raphael Coeffic 8b34c96a2d fixed switch direction in X10 simulator (#5472) 2017-12-07 18:41:49 +01:00
Bertrand Songis ec2c4302cb Update CREDITS.txt 2017-12-07 18:12:07 +01:00
Alexander Novikov 23eeccec9c Ru tts (#5456)
Russian TTS
2017-12-05 20:02:10 +01:00
Bertrand Songis 421f16d0dd Update CREDITS.txt 2017-12-05 18:08:35 +01:00
Bertrand Songis cb73261c60 Update CREDITS.txt 2017-12-04 23:18:10 +01:00
Arne Schwabe 6bc02fd838 Add sane defaults for X10/X12. Also set battery warnings when creating general settings in simulator/companion (#5465) 2017-12-04 21:17:02 +01:00
3djc a7e4b0b062 Post RC1 fixes 2017-12-04 16:53:10 +01:00
3djc 4b75c42218 Fix 2017-12-04 07:50:45 +01:00
3djc 4a187699fa Fix for rc on strech 2017-12-04 07:45:58 +01:00
Bertrand Songis b4710f0f0c Update CREDITS.txt 2017-12-02 21:30:18 +01:00
Arne Schwabe 99c4c4a0ef add cgi build script 2017-12-01 19:51:21 +01:00
Sebastien Charpentier adb9a55719 Fr translation (#5451)
Fr translation.
2017-12-01 19:47:02 +01:00
3djc 078748243d RC auto increment 2017-12-01 19:45:29 +01:00
3djc eaa5c7a7b0 Suffix handling for RC builds 2017-12-01 19:41:59 +01:00
3djc 8dafd4680b Fix 2017-12-01 19:32:12 +01:00
3djc 6c6fc2d7db Workaround 2017-12-01 16:29:34 +01:00
3djc 3eccbc2963 Allow RC type version number ( translated 900 to 999) (#5450)
Allow RC type version number (translated 900 to 999)
2017-12-01 15:59:29 +01:00
3djc d90ac05d6e One settings to rule them all ! (#5449) 2017-12-01 11:54:30 +01:00
Bertrand Songis bdf0983642 Update CREDITS.txt 2017-11-30 23:39:26 +01:00
Neil Horne 16f219d6d3 Various model print fixes (#5433)
* Fixes #5411 print curve
Rename Limits to Outputs for consistency with radio and Companion
Fix gvars printed as values
Print PPM Center and Linear Subtrims

* code formatting
2017-11-30 19:14:02 +01:00
Max Paperno ba1073ace6 [Lua] Allow global functions to play scripts. (#5440) 2017-11-30 19:10:11 +01:00
Sebastien Charpentier 1d5c06ccd6 Fixed #5443 & Updated French translation (#5444)
* Initial version

* Updated French Translation.
Fixed and enhanced X7 Wizard.
2017-11-30 19:03:03 +01:00
Bertrand Songis afeba0d07e Update CREDITS.txt 2017-11-30 18:30:23 +01:00
3djc 4ad2bbdf2c Fix some server side build path 2017-11-30 12:02:53 +01:00
Bertrand Songis 0faee13bc3 A 3rd branch for RC compilation (#5441)
A 3rd branch for RC compilation
2017-11-30 11:51:22 +01:00
3djc e74349e36c Prep work 2017-11-29 18:05:51 +01:00
Bertrand Songis 2c2bbdd912 Update .travis.yml
Stop Sonar PR check
2017-11-29 12:58:13 +01:00
3djc d772cd39ea Allow RC builds 2017-11-29 10:17:28 +01:00
3djc 13f364d96a Add American time format to lua getDateTime() (#5431)
Add American time format to lua getDateTime()
2017-11-29 09:18:50 +01:00
3djc 779b39e237 Use X10 picture during X10 calibration (#5435)
* Use X10 picture during X10 calibration

* Scale down radio picture a little

* last x10 change requires a sd version bump

* Differentiate X10 and X10S
2017-11-29 09:17:33 +01:00
Max Paperno 0f34bf3850 [Companion] Fix crash when closing main window while model/radio editor is open and cursor is in a field which has editingFinished() event handler. 2017-11-27 07:05:18 -05:00
Max Paperno f085f11ea8 [Companion] Fix custom functions availability: set timer was available on AVR and screenshot on non-Taranis. 2017-11-27 06:18:11 -05:00
Kilrah 1c1624b8a6 [companion] Adjust GVAR not possible in global functions (fix #5425) 2017-11-26 23:03:43 +01:00
Max Paperno caa9cd3060 [Companion] Telemetry screen bar range limits were unsigned (but are signed on ARM radios), didn't allow negative values. 2017-11-25 14:56:49 -05:00
Max Paperno b8042c9da1 [Companion] Default RSSI low and critical alarm values were reversed (fixes #5407). 2017-11-25 14:36:46 -05:00
Bertrand Songis 478411bf82 [Sonar] Condition always evaluated to false 2017-11-24 09:27:45 +01:00
Damjan Adamic 49a63d43b3 Fix some bugs found by Sonar (#5392)
* Fix some bugs found by Sonar

* Different syntax for NOSONAR

* Switch Sonar badge to proper branch
2017-11-23 23:28:36 +01:00
Neil Horne 5b4dc4ee08 Fixes 4944 Skeleton input after cancel of add (#5397) 2017-11-23 23:27:26 +01:00
Max Paperno 2cf2603155 [Companion] Fix conversion of switches between X7 and X9/10/12 radios. (#5415)
* [Companion] Fix conversion of switches between X7 and X9/10/12 radios.

* [Companion] Also convert raw sources in ExpoData (inputs) when switching radio types.
2017-11-23 23:26:22 +01:00
3djc 462e5f05e6 Also play model name on model changes (#5416)
Fixes #5414
2017-11-23 23:25:38 +01:00
Max Paperno 3caf83e920 [Companion] Fix crash when editing model with gvars but no GvarsFlightModes (most AVR radios); Always show value label; Update unit/prec/min/max fields for Horus. (#5417) 2017-11-23 23:25:18 +01:00
Bertrand Songis 58df785d70 Revert ... 2017-11-23 14:25:13 +01:00
Bertrand Songis 4c0526ce0c Sonar fix - test
use `[[fallthrough]];` instead of `// no break`
2017-11-23 13:59:03 +01:00
Bertrand Songis 6c2de17229 Update README.md 2017-11-23 13:31:54 +01:00
Bertrand Songis d649420212 Fixes #5402 (#5405) 2017-11-22 21:08:13 +01:00
Sebastien Charpentier 7f53f340ad French Translation (#5409)
* Initial version before translation.

* Updated French translation.
2017-11-22 21:08:00 +01:00
3djc c4c5516315 fix typo 2017-11-22 20:15:39 +01:00
Andre Bernet 8662de39f5 USB modes cleanup (#5396)
* USB modes cleanup

* Forgot a couple

* Exclude joystick code from bootloader
2017-11-22 10:41:19 +01:00
Bertrand Songis f2cf444a64 Update CREDITS.txt 2017-11-22 10:35:49 +01:00
Max Paperno 1634d81e4a Fix brackets in MEGA2560 isBacklightEnabled() macro (caused comparison warning in simpgmspace.cpp). 2017-11-21 13:21:00 -05:00
Max Paperno 9c74cc215c Fix gvars build error on libsimulator for PCBSTD. 2017-11-21 11:54:55 -05:00
Kilrah 659f506e5f Build libsimulator on commit tests instead of simu 2017-11-21 17:48:32 +01:00
Kilrah 7df776e7ed Typo 2017-11-21 17:34:22 +01:00
Kilrah 5762fd61e9 Add GVARs option to commit tests 2017-11-21 17:28:56 +01:00
Andre Bernet 39ea315c97 Fix X10 power loop (fix #5270) (#5391)
* Fix X10 power loop (fix #5270)

* "EMERGENCY MODE" text wasn't visible anymore since d4a00dec3b
2017-11-21 07:25:38 +01:00
3djc 6fc40cb7cb Move to simple menu to prevent the need for dual RTN when scroll wheel is used (#5390) 2017-11-20 19:04:02 +01:00
Kilrah 0658b2a2c4 UI speedup 2017-11-20 12:47:32 +01:00
3djc 6064d3222b Cosmetics on companion radio names 2017-11-20 08:37:01 +01:00
3djc d13fb8918f - X7S option removed (#5388)
- runtime detection of bluetooth chip
2017-11-19 23:49:38 +01:00
Martin Hotar d11618eb3f x10 simulator skin fixes (#5389) 2017-11-19 17:47:08 +01:00
Bertrand Songis 3b4f5e0882 Update README.md 2017-11-19 16:49:26 +01:00
Bertrand Songis 01f5c65eb9 Update README.md 2017-11-19 16:38:10 +01:00
Bertrand Songis 94bdeb6929 Update README.md 2017-11-19 16:37:05 +01:00
Bertrand Songis f36615f1e2 Update README.md 2017-11-19 16:34:00 +01:00
Sonar agent ab4b159d06 Bsongis/sonar (#5382)
Sonar integration
2017-11-19 15:27:49 +01:00
Max Paperno 90e58e4a5f [Simulator] Fix coordinate of X10 skin encoder button. (#5387) 2017-11-19 14:31:23 +01:00
Max Paperno 7759403f3e [Simulator] Quick fix for showing gvars with precision and unit in Radio Outputs view (fixes #5360). (#5384) 2017-11-19 11:21:20 +01:00
Kilrah 18aa849cc7 Trainer detect on X10 is inverted compared to X12 (fix #5378) 2017-11-19 10:54:33 +01:00
Harpalyke a9c25d1935 Adding a button to the log viewer to save the currently selected session to its own CSV log file (#5379) 2017-11-18 12:14:55 +01:00
Andre Bernet 7f4daf3f5b Lua themes with no options wouldn't load anymore (got broken in b4939… (#5351)
* Lua themes with no options wouldn't load anymore (got broken in b493973d7d)

* Keep protection

* Changes according to PR comments
2017-11-18 11:59:59 +01:00
Neil Horne f7828ad4a3 Companion gvar refactor for special functions to match radio (#5361) 2017-11-18 11:25:46 +01:00
Raphael Coeffic 2631ad00bd allow additional cake params to be passed via env variables (#5371)
This allows for non-standard paths and the likes (helps a lot on OSX).
2017-11-18 11:24:16 +01:00
Raphael Coeffic d4a00dec3b small cosmetic colour changes (#5367)
Small cosmetic colour changes

This allows the RSSI/Tx-Battery/Volume display to be displayed with the proper background colour when changing the main theme colour. Also puts the background colour at some use, as I could not see it used anywhere.
2017-11-18 11:23:34 +01:00
Bertrand Songis 46e8474e77 Update CREDITS.txt 2017-11-18 09:24:17 +01:00
Martin Hotar c8dfccc365 X10 simu (#5376)
* X10 simu images

* X10 simu UI
2017-11-16 21:49:39 +01:00
3djc 2e14773f1a Make stat bottom bar text more V centered 2017-11-16 10:35:16 +01:00
Bertrand Songis 968fbd4c60 Update CREDITS.txt 2017-11-16 07:43:58 +01:00
Arne Schwabe 37b7b25208 Use IS_PXX instead of IS_XJT for failsafe, closes #5373 2017-11-15 22:19:47 +01:00
Bertrand Songis a2c6d60782 Update CREDITS.txt 2017-11-15 19:21:23 +01:00
Kilrah 808e44388a Update AND switch list on paste (fix #5365) 2017-11-15 10:22:10 +01:00
Kilrah f8ff44c78f No copy/paste on SF/LS (fix #5366) 2017-11-15 10:01:39 +01:00
3djc 7e29932072 Shift 3rd column a bit right (#5364) 2017-11-15 09:52:09 +01:00
Bertrand Songis c1b0e9fea3 Update CREDITS.txt 2017-11-14 18:17:21 +01:00
3djc df91e93034 Tiny cosmetic 2017-11-14 10:37:02 +01:00
Harpalyke fd265eccbb Adding regex check for crossfire gps format when reading logs in tele… (#5347)
* Adding regex check for crossfire gps format when reading logs in telemetry simulator

Adding a regex check when the telemetry simulator parses gps cords from a log file to see if the if the cords are in the crossfire gps log format. 
The GPS telemetry sensor from crossfire logs the coordinates as latitude with a precision of six decimal places followed by a space and then longitude also to six decimal places. e.g. "53.279969 -7.701416"
When the cords are already in this format their is no need to call convertDegMin on the values

* Fixing code styling

* Updating code style

* Updating code style

* Checking the gps coordinates format once before the full file is processed instead of evaluating the regex for every line of the file.

Optimize regex by removing surrounding parenthesis
2017-11-13 22:21:22 +01:00
Bertrand Songis 57d53abd6e Fixes #5300 (#5353) 2017-11-13 22:18:07 +01:00
Sebastien Charpentier c62e0cc7d1 Updated French Translation (#5356)
* Starting point before translation.

* Updated French translation.
2017-11-13 22:17:48 +01:00
Bertrand Songis e5b2b8ef64 Bsongis/issue 5311 (#5354)
Fixes #5311
2017-11-13 22:17:13 +01:00
Neil Horne e6542a78d0 Fix displayed file path for Windows OS (#5355) 2017-11-13 15:30:15 +01:00
Arne Schwabe 084680b5fd Fix custom string in multiprotocols companion 2017-11-13 11:11:41 +01:00
3djc bdfcc5d181 Improve commit tests 2017-11-13 10:55:19 +01:00
Arne Schwabe 2d6962d937 Also fix compiler warning on sky9x 2017-11-13 10:52:33 +01:00
Arne Schwabe d8210b832f Fix multi build on Sky9X 2017-11-13 10:42:25 +01:00
Kilrah ac22e33cec Missing def 2017-11-13 09:41:55 +01:00
Kilrah 7f05df2627 Only apply theme option changes when exiting edit mode for color type options (fix #3799) 2017-11-13 00:17:35 +01:00
Bertrand Songis 9d7dab724b Bsongis/issue 5338 (#5344)
Fixes #5338
2017-11-12 14:15:19 +01:00
3djc b8b67ba864 Push model name audio after hello (#5350) 2017-11-12 14:07:26 +01:00
Bertrand Songis f6309138f6 Fixes #5312 (#5345) 2017-11-11 22:20:05 +01:00
Sebastien Charpentier 7ca3f60999 Updated Wizard for X9 radios. (#4910) 2017-11-11 09:46:38 +01:00
Damjan Adamic f0f3e35bf6 Lua memory (de)allocation tracer: (#5191)
* Lua memory (de)allocation tracer:

Usage:
 * turn on: `cmake -DLUA=YES -DLUA_ALLOCATOR_TRACER=YES -DDEBUG=YES -DNANO=NO`
 * get debug output and make plot data: `./simu 2>&1 | grep "^LT" | ../radio/util/lua_trace2plot.py > data.plot`
 * plot: `gnuplot  -e 'set xtics rotate;  plot "data.plot" using 2:xtic(1) ; pause mouse close'`

* Changes based on Bertrand comments
2017-11-11 09:41:05 +01:00
3djc c30ff28f85 Replace S6R text by SxR since it handles both S6R and S8R 2017-11-11 09:38:10 +01:00
Bertrand Songis 5a121bfcb8 License dates changed and contents converted to UTF-8 2017-11-11 09:33:14 +01:00
Arne Schwabe 613b2edf49 Multi improvements (#5322)
* implementing syncing with multi

* Send config command

* Implement setting failsafe for multimodule

* Fix

* Fix last bugs. Multi sync now working as expected.

* Add eww multi protocol
2017-11-11 08:57:04 +01:00
Neil Horne 8e9d370770 Companion global variables refactor (#5328)
* Companion Global Variables refactor to support changes to radio in 2.2

* Update model print for global variables refactor

* Check and if necessary update all flight modes gvar after updating min or max

* Fix loop limit

* Add clear single gvar context menu
Add gvar popup values to model print
Minor fixes
2017-11-11 08:56:30 +01:00
Damjan Adamic 69afa9d0f8 Fixes #5302: added zesty (Ubuntu 17.04) and artful (Ubuntu 17.10) and removed yakkety (Ubuntu 16.10) 2017-11-10 19:23:01 +01:00
Damjan Adamic 955d5775cb Add Lua getUsage() function that returns percent of already used up i… (#5313)
* Add Lua getUsage() function that returns percent of already used up instructions in current script execution cycle. It can be used to avoid script being killed when doing long lasting tasks (like telemetry logs loading and parsing)

* Compilation fixes

* Doc fix

* Disable Lua script instructions limit in DEBUG mode
2017-11-10 17:23:37 +01:00
Damjan Adamic 6c7e4b5597 Debug Timers: add 10ms period measurement, delete unused timer debugT… (#5319)
* Debug Timers: add 10ms period measurement, delete unused timer debugTimerPerMainPeriod

* Typo in drawSplash() if MENUS_LOCK == 1
2017-11-10 17:23:09 +01:00
3djc ff8f4a3a92 Reassigns stats icon to better match actual screen content (#5339) 2017-11-10 17:22:32 +01:00
Arne Schwabe 2e248e7bc0 Do double pythrogoras if altitude is involved (fixes #5280) (#5341) 2017-11-10 16:41:52 +01:00
Arne Schwabe f9d5201b0c Only set telemetry to streaming when receiving rssi from RX on crossfire (closes #5340) 2017-11-10 10:48:57 +01:00
Kilrah baa3938f06 [companion] Edit checklist always available 2017-11-10 10:16:36 +01:00
Kilrah 12a0d6d5bc [companion] LCD type was not read (fix #5337) 2017-11-10 10:12:27 +01:00
Bertrand Songis 0f8c868d6b Update CREDITS.txt 2017-11-10 07:20:31 +01:00
Kilrah 761b0e0cfa Simu compilation fix 2017-11-08 22:01:35 +01:00
Neil Horne 5bb759a0e7 Replace spaces in model name with underscores for file name (#5335) 2017-11-08 21:33:12 +01:00
Kilrah 1ef1109b5f Add some saves (related to #5137) 2017-11-08 13:57:56 +01:00
Kilrah 36789bff3f 128x64 telemetry page was out of sync (fix #5166) 2017-11-08 13:49:42 +01:00
Kilrah d8f1ad3a82 Flight mode 0 value of a Global Variable should not be able to refer to another FM (fix #5310) 2017-11-08 13:30:28 +01:00
Bertrand Songis f197aa52ac Update CREDITS.txt 2017-11-08 13:06:29 +01:00
Kilrah fdec738485 Prevent lockup on boot in case of 32kHz oscillator failure (fix #5294) 2017-11-08 13:02:32 +01:00
Kilrah e2858dbb03 [companion] Some fields missing for Sky9x (fix #5326) 2017-11-08 12:55:31 +01:00
3djc 8d75f9c991 Merge pull request #5318 from opentx/3djc/more-datetime-fixes
Fix datetime
2017-11-07 08:30:23 +01:00
Bertrand Songis 8c6b5717f7 Update CREDITS.txt 2017-11-05 19:25:22 +01:00
Kilrah 63536b9819 Cosmetics 2017-11-04 10:15:56 +01:00
Kilrah 8780339c72 Crossfire baudrate selection for X10 (fix #5315) 2017-11-04 10:14:22 +01:00
Kilrah 90542b189c Cosmetics 2017-11-04 10:14:22 +01:00
Kilrah 83766bc3f6 Simu Debug compile fix 2017-11-04 10:14:22 +01:00
Bertrand Songis 6a61a911de Update CREDITS.txt 2017-11-02 17:45:15 +01:00
3djc 7b074305af Instead off dealing with individual exception, rule out all 'internal' sensors 2017-11-01 09:05:46 +01:00
RCdiy 973716fbfa Companion Build Option Lua Toot Tip change wording from "model" to "custom" (#5277)
* Companion Build Option Lua Toot Tip Change model to custom
2017-10-31 21:56:54 +01:00
Damjan Adamic b153cdec93 Fixes #5266: Lua docs updated: radio type has different names for the various radios in 2.2.0 2017-10-31 18:04:21 +01:00
Bertrand Songis c63ad89a8c Update CREDITS.txt 2017-10-29 22:42:53 +01:00
3djc 9a95b47c96 Prevent negative values in DMAFillRect (#5308) 2017-10-29 16:28:51 +01:00
Kilrah b4cf7315a5 X10 sport connector support 2017-10-29 16:22:31 +01:00
Kilrah d775a09095 Fix X10 backlight (min level of 46 to prevent display interference, must be hardware problem, FrOS uses same lower limit) 2017-10-29 16:02:51 +01:00
Arne Schwabe 318d77e863 Show telemetry UART errors in statistics debug page (#5185)
* Show telemetry errors in Debug statistics

This introduces a second debug page on X7 and X9 platform since the original page is almost full.
Also fix the X7 menu navigation to be able to go back and forth

* Fix compile error on platforms without key_page

* avr-gcc bails on missing eolf

* Fix navigation

* Just keep pushing ....

* compile fixes of 9x and use chainMenu

* Fixes

* Align x9 behavior to x7 (for once !)

* Allow total timer reset on both long menu and long enter

* Improve 9x handling
2017-10-29 09:06:17 +01:00
Florent Martel 1962336316 Add access to vBatWarn from luaGetGeneralSettings() (#5293) 2017-10-29 08:38:50 +01:00
3djc 3fed1aa157 Fix timer display (is DATETIME but no date available) (#5299) 2017-10-29 08:36:30 +01:00
Bertrand Songis 176845047d Update CREDITS.txt 2017-10-27 08:06:13 +02:00
Bertrand Songis 62662159e1 Update CREDITS.txt 2017-10-26 22:14:36 +02:00
Bertrand Songis c932090ed5 Update CREDITS.txt 2017-10-26 21:28:57 +02:00
Bertrand Songis 24b8ead576 Update CREDITS.txt 2017-10-25 22:20:12 +02:00
Bertrand Songis cb2e9be6cd Update CREDITS.txt 2017-10-25 19:25:32 +02:00
Bertrand Songis 6ff301bf27 Update CREDITS.txt 2017-10-15 21:22:07 +02:00
3djc fe3a7babcc Fix NL compîle with heli mode 2017-10-14 11:19:20 +02:00
Bertrand Songis f611942f61 Update CREDITS.txt 2017-10-11 16:36:22 +02:00
Bertrand Songis 979e93c7be Update CREDITS.txt 2017-10-11 09:45:10 +02:00
Bertrand Songis 83383df4dd Update CREDITS.txt 2017-10-09 18:00:29 +02:00
Kilrah a54c0a435e Remove unused files 2017-10-09 13:43:31 +02:00
Kilrah 3d8f1c4780 Fix gtests 2017-10-09 10:20:27 +02:00
Kilrah 64a4f10ec7 X10 simu upright and working 2017-10-09 09:56:37 +02:00
Kilrah 380adaad3b Fix X10 simu crash 2017-10-09 09:41:18 +02:00
Kilrah 69118a96be Python not just for Windows... 2017-10-08 21:14:02 +02:00
Kilrah 6a14fe728e Bundle OpenSSL libs in Windows installer (fix #5217) and image format plugins the app loads 2017-10-08 20:06:18 +02:00
Bertrand Songis b58be017f4 Update CREDITS.txt 2017-10-07 09:17:58 +02:00
Bertrand Songis 408a44110f Update CREDITS.txt 2017-10-03 20:05:57 +02:00
3djc aa527fc6bd GPS datetime display fixes (#5254)
* Fix x9

* Fix x7

* Apparently - is standard separator for dates

* Consistency
2017-10-03 07:45:40 +02:00
Bertrand Songis cbd824eb10 [X10S] PWM sticks support - with autodetection (#5251)
[X10S] PWM sticks support - with autodetection
2017-10-01 09:07:07 +02:00
Bertrand Songis a1c0aafc16 Update CREDITS.txt 2017-09-30 19:49:20 +02:00
Arne Schwabe fd782538d8 Implement SBUS output for external module bay. (#5225)
* Implement SBUS output for external module bay.

* Bugfixes and Companion support
2017-09-29 18:29:39 +02:00
Arne Schwabe 710e6ddc4c Also use https for nightlies 2017-09-28 15:05:57 +02:00
Sebastien Charpentier 3ce754137d French translation (#5244)
* Comparison point before translation.

* Updated French translation.

* Match radio strings
2017-09-28 11:29:18 +02:00
3djc f4ea92d1fc move to https (#5247) 2017-09-28 11:25:09 +02:00
Kilrah 24917a9952 Adjust SD card download folder for firmware nightlies 2017-09-28 08:28:25 +02:00
Bertrand Songis f60ea00fb8 Update CREDITS.txt 2017-09-26 17:57:26 +02:00
Bertrand Songis 851da15bc7 Update CREDITS.txt 2017-09-25 18:08:28 +02:00
Kilrah f6e7b4e291 Hide F000 sensor from GRX8 2017-09-25 09:53:45 +02:00
Arne Schwabe a502a99768 Fix logic mistake I made earlier (closes #5229) 2017-09-23 19:17:51 +02:00
Bertrand Songis 39386676d8 External module on X10 now tested OK 2017-09-21 23:15:50 +02:00
Bertrand Songis f48d6bba35 Update CREDITS.txt 2017-09-21 16:47:35 +02:00
Bertrand Songis fcbb23af92 Update CREDITS.txt 2017-09-21 07:36:23 +02:00
Bertrand Songis 7f7dfeab12 Compilation fix 2017-09-20 21:09:49 +02:00
Bertrand Songis 450ba42558 External module not working on X10 2017-09-20 09:16:11 +02:00
Bertrand Songis 76f27ae452 Update CREDITS.txt 2017-09-20 07:18:31 +02:00
Kilrah 6bb7ba3795 Fix typo 2017-09-18 18:02:00 +02:00
Bertrand Songis 509df44c4f X10 fixes (#5221)
1. BackLight < 42 was bad
2. SWB D E F direction inverted
3. Wrong battery voltage
2017-09-17 21:40:51 +02:00
Roderick Taylor 9cb4b782e1 Fix FrSky D cable telementry for 9XR PRO and DJT module. (#5220)
* Fix FrSky D cable telementry for 9XR PRO and DJT module.

* Revert a breaking change.
2017-09-17 19:10:45 +02:00
3djc 6f3577c9a5 x9e with horus bt module (#5214)
* Basics to allow Horus BT module on X9E

* wip

* Temporary hack to prevent X9E to enter reset loop

* The wait game starts :)

* Temporary compil fixes

* More sensibles defines
2017-09-16 16:08:21 +02:00
Bertrand Songis 06f5e408ee Update CREDITS.txt 2017-09-16 12:03:25 +02:00
Arne Schwabe 0402c37a07 Shorten a too long string in German translation 2017-09-14 18:13:01 +02:00
3djc 7ae9bfef0f Remove Visual C++ warning 2017-09-14 08:15:54 +02:00
3djc 1bfcdb5dfa Fix compilation server 2017-09-13 20:23:44 +02:00
3djc 2983cfc531 Merge pull request #5212 from opentx/bsongis/nightly_warning_setup
Nightly build enabled when suffix starts with 'N'
2017-09-13 19:02:41 +02:00
Bertrand Songis d80861db37 Nightly build enabled when suffix starts with 'N' 2017-09-13 18:43:01 +02:00
Arne Schwabe 23ceb830b3 Translate nightly warning (#5211)
* Translate nightly warning

* Oops, move define to right place
2017-09-13 15:44:01 +02:00
Arne Schwabe 4c5f0ca83c Let other python Qt scripts also fallback to Qt5 2017-09-13 14:18:17 +02:00
Bertrand Songis 1b370076b6 Update CREDITS.txt 2017-09-13 13:12:49 +02:00
3djc 9415b3086d More nightly prep 2017-09-12 19:55:42 +02:00
3djc e7fcc71d8e Prep for nightly 2017-09-12 19:14:41 +02:00
Arne Schwabe 7e21e13ec9 Disallow writing running firmware (#5208)
Overwriting running firmware leads to crash and incompletely written firmware
2017-09-12 18:49:40 +02:00
Arne Schwabe 360a521f11 Improve German translations (#5207)
- No different menu heading than other languages (also in NL)
- Fix a few strings
- also don't shorten two strings in English where we have the space
2017-09-12 18:49:01 +02:00
3djc 53d4547918 x7 rssi indicator (#5205)
Draw horizontal bars next to Batt (only for FRSKY Telem)
2017-09-12 18:48:37 +02:00
Kilrah 2d0c14c3c0 String lengths 2017-09-12 08:24:46 +02:00
Bertrand Songis b9fd1b01d1 Update CREDITS.txt 2017-09-12 07:32:07 +02:00
Arne Schwabe 45213124dd Remove unused CASE_PWM_BACKLIGHT entires
212x64 does not even have the ITEM_BACKLIGHT entries for it
2017-09-11 22:52:28 +02:00
Kilrah 76371d6087 Cosmetics 2017-09-11 22:47:24 +02:00
Kilrah 37c0589a27 Menu navigation was broken by USB setting addition 2017-09-11 22:46:22 +02:00
3djc da71f4cbbc Make Horus widgets 'shadow' effect an option (#5203)
* Add shadows to c++ widgets

* Add BOOL zone option to Horus LUA

* LUA widgets too
2017-09-11 07:34:49 +02:00
Arne Schwabe 093034f9e7 German translations for USB 2017-09-11 03:30:17 +02:00
Kilrah a7b9b30108 Fix DEBUG=YES build for sky9x family (better fix would be to implement rtcGetTime on the platform) 2017-09-10 22:36:55 +02:00
Kilrah 6a2a730cdc X7 simu compilation 2017-09-10 21:48:33 +02:00
Kilrah 97b777ae4f String cosmetics 2017-09-10 21:44:23 +02:00
Kilrah 09f257026e Disable Serial USB choice if !DEBUG (no function currently) 2017-09-10 21:23:36 +02:00
Kilrah e59afb6ec1 Enum was misaligned with UI text... 2017-09-10 20:50:05 +02:00
Arne Schwabe b7acee5723 Allow USB mode selection on USB connect (#5193)
Allow all USB modes to be compiled in at the same time
2017-09-10 17:28:08 +02:00
3djc 2910488a30 Add nightly warning (#5202)
Nightly build Warning
2017-09-10 17:25:04 +02:00
3djc 67817918f4 Add SQT5 that was missing in 2.2 (#5179)
Add SQT5 that was missing in 2.2
2017-09-10 17:17:23 +02:00
sirPerna 390342af78 Crossfire baudrate selection for X7 support ( fixes #4922 ) (#5194)
* Crossfire baudrate selection for X7 support ( fixes #4922 )

* Moved baurate selection to general settings

* renamed mavbaud to telemetryBaudrate for ARM targets
translation added

* typo fixed
2017-09-10 17:10:47 +02:00
3djc 653273f82e X7 and X9E have been left out ! (#5199) 2017-09-09 15:42:39 +02:00
3djc b33a88a69f Do not display blank space when switch is not available (#5183) 2017-09-09 15:11:06 +02:00
NiklasVoigt 7cd7869d6a Taranis Q X7 optimized wizard (#5198)
* Redesigned Wizard for the X7

Check this out:
https://www.youtube.com/watch?v=86H1YKcVyB4

* Removed the developers name

* Rendering issue fix

* Removed bottom bar & removed Heli

uncommented Heli for easier implementing in the future
2017-09-09 13:47:05 +02:00
3djc 9ae429e03b Shouldn't copyright be there too ? (#5200) 2017-09-09 13:43:38 +02:00
Bertrand Songis 0053412f87 Update CREDITS.txt 2017-09-06 18:11:01 +02:00
Arne Schwabe 63baa76cba Remove dead code (from pre 2.1 telemetry) 2017-09-05 18:58:36 +02:00
Bertrand Songis bd6bd4deeb Bluetooth fixes (reconnection issues, telemetry mode not working) (#5186)
Bluetooth fixes (reconnection issues, telemetry mode not working)
2017-09-05 18:21:29 +02:00
Arne Schwabe 5b5c88fb4e Switch to nano version of newlib (#5180)
* Switch to nano version of newlib

save about 50k of flash and 2k of RAM on Taranis

* Make nano optional, default=off and use bin_alloc for it
2017-09-01 18:37:30 +02:00
3djc fdacf83ad0 Improve pilotPosition when internal GPS is available (#5187)
* Update pilotposition when internal GPS does have a fix *** UNTESTED YET ***

* Cosmetics, tested OK
2017-08-31 19:11:44 +02:00
3djc 8e04a6e2e4 Horus : improve add widgets (#5189)
* Go automatically to widget setup after adding a widget

* Cosmetics
2017-08-31 19:11:04 +02:00
IdefixRC 5791645877 Crossfire LUA for Horus (#5190)
* First iteration of the Horus Crossfire LUA

Under development.
- crossfire.lua working and tested with micro TX and micro RX
- devices.lua basic layout working. Work in process:
     - getLastPos which is not available in Horus hard-coded currently. needs to be adjusted
     - Taranis page method replaced by Horus single page approach with 22 lines in 2 columns. Still throws an error message and unclear if 22 lines of settings are enough for all devices and whether different approach will work better.
    - Save menu not tested.

* Working script (tested with MicroTX)

- updated getlastpos and concenated strings instead
- went back to single column and implemented scrolling
- still need to figure out speed (fields are sometimes populated very slowly)
2017-08-31 19:10:37 +02:00
Damjan Adamic 6cc40c65b2 Lua docs update (CrossfireTelemetryPush and crossfireTelemetryPop and some small spelling fixes) 2017-08-27 16:45:56 +02:00
Bertrand Songis 1bb8aab866 Update CREDITS.txt 2017-08-25 08:22:32 +02:00
Bertrand Songis 13b566746d Update CREDITS.txt 2017-08-24 21:00:49 +02:00
Bertrand Songis 4b5bd10aa2 Update CREDITS.txt 2017-08-23 16:17:15 +02:00
3djc 251e83b1a4 Looks like FRSKY_STICKS option was missing in 2.2 (#5177) 2017-08-22 13:07:21 +02:00
OhmEye d4f108a849 Add TBS Crossfire lua scripts or X7 SDCard (#5176)
I edited the scripts for X9D to change the input events for the rotary wheel and the drawing coordinates for the smaller LCD. Tested by a handful of volunteers and myself on X7's with working CRSF.
2017-08-22 13:07:00 +02:00
Bertrand Songis 19219bf8f8 Update CREDITS.txt 2017-08-22 02:37:54 -07:00
3djc 74db7dafa7 Merge pull request #5173 from opentx/3djc/build-fixes
Fix currently known compile errors
2017-08-22 08:28:31 +02:00
Arne Schwabe 9bc8fc493d Fix German multi protocol string 2017-08-21 20:59:03 +02:00
Arne Schwabe abe857225a Fix assert in multiprotocol 2017-08-20 19:30:51 +02:00
3djc 9c46b9afa0 Fix currently know compile errors 2017-08-20 16:55:25 +02:00
Bertrand Songis a41d2af10d Update CREDITS.txt 2017-08-20 07:06:33 -07:00
Bertrand Songis 42cbc56880 Comment added 2017-08-18 18:02:22 +02:00
Kilrah 9ba843d82f Enable X10 2017-08-18 14:50:44 +02:00
3djc 81589d22f8 B&W LCD receiver ID improvement (#5018)
* - Use @schwabe int/ext matching
- Display model name where the receiver in currently used

* French colom doesn't seem to be standard (wonder why :D)

* Implement showing multiple names

* Another way

* Improvement suggested by @schwabe (thx m8!)

* let's say it's a typo ..

* By unanimous vote of participants

* Updates based on Bertrtand's comments

* Colon right this time ?

* Cosmetics
2017-08-16 23:27:04 -07:00
Bertrand Songis 576be96935 Update CREDITS.txt 2017-08-16 11:59:47 -07:00
Bertrand Songis f487cdd581 Update CREDITS.txt 2017-08-16 11:01:03 -07:00
Sebastien Charpentier bf177d6cce French translation update (#5163)
* Initial version.

* French translation.
2017-08-16 10:08:19 -07:00
Arne Schwabe e16b48db30 Reduce RF_PROTO_OFF logic, disable R9M Sport out when internal telemetry is on (#5159)
* Remove most of the special logic associated with RF_PROTO_OFF

This simplifies code in many areas since the internal module does not require special handling and also fixes a few bugs with INTERNAL_PPM

* Disable R9M sport option if internal module has telemetry

* Fix X12s build

* Use macros instead of direct comparisions

* Fix sport bit sent the wrong way. Rename S.port out to Telemetry

* Compile fix
2017-08-15 21:47:45 -07:00
Arne Schwabe 8e84724c62 Implement R9M Companion support (#5157)
also implement (like with multi) own pxx struct for pxx options
2017-08-15 21:45:15 -07:00
3djc 2f7694dee7 3djc/horus chan mon fix (#5152)
* Fixes : #5124

* Adjust display accordingly
2017-08-15 21:44:45 -07:00
3djc 019e2aee1b Merge pull request #5161 from opentx/3djc/Timer-name-handling
Timer name handling
2017-08-15 17:27:16 +02:00
3djc 8cb7031cf6 Cosmetics based on Bertrand's commments 2017-08-15 17:02:51 +02:00
Damjan Adamic a167e9f751 Fixes #5055: infinite loop in lcdDrawFilledRect() when h parameter is bigger than 127. Similar fixes in other places. (#5058) 2017-08-15 06:57:29 -07:00
Arne Schwabe 824f39330f Reorder mm_protocol struct and remove pack to silence compiler warnings (#5158)
Since chance costs 48 byte of flash space
2017-08-15 06:51:21 -07:00
3djc bf600140d3 480x272 2017-08-15 10:55:15 +02:00
3djc 871302a1b1 128x64 and 212x64 2017-08-15 10:49:59 +02:00
3djc 5a8a074f0c Neutralise BT on X9E, unless DEBUG is defined (#5148)
* Neutralise BT on X9E, unless DEBUG is defined

* Adjust to Bertrand comments
2017-08-14 22:03:26 -07:00
Bertrand Songis 0e139fd0d6 X10 HAL update
- ADC OK
2017-08-12 16:15:40 +02:00
Bertrand Songis de00d223c4 X10 HAL update
- LCD OK
 - Backlight OK
 - Sound OK
 - Keys OK
 - Haptic OK

 - ADC KO
2017-08-12 10:48:38 +02:00
Bertrand Songis 8d8fef23c9 Bsongis/x7 bluetooth (#5068)
* Trainer Bluetooth support added
X7S board added (X7 has no bluetooth while X7S has)
X10 HAL updated

* Bluetooth Telemetry

* En fix
Add all languages

* Temporary test for @bsongis

* Missing translations
2017-08-12 00:49:54 +02:00
Arne Schwabe 51be7b000e Add support for R9M module (#5101)
* Implement R9M protocol according to PXX spec 1.7

Some of the things here are guesswork as I don’t have a R9M at hand. Also Companion support for the extra R9M options is not implemented yet.

* Fix build errors
2017-08-12 00:27:23 +02:00
Arne Schwabe 87295776ff Fix issue #4961 (#5009)
* Fix issue #4961

Fix yet another reference to HORUS_OR_TARANIS that should be IS_ARM
Also rename C9X function to export/import to be inline with the rest

* Another two IS_ARM/HORUS_TARANIS mixups

* Fix condition

* Simplify/fix two if statements

* Really fix if statement
2017-08-12 00:26:28 +02:00
Andre Bernet b3e9d8d97d Improve settings migration and management (#5107)
* Settings can now be optionally removed during uninstall (didn't find how to translate)

* Settings import from previous versions now optional

* Hopefully cleaner implementation

* This crashes (already on 2.2)

* Translation

* Remove broken settings import from companion9x

* Fixes for MainWindow
2017-08-11 17:42:30 +02:00
Bertrand Songis 96f1a16744 Avoid repeat i.e. Telemetry Lost / Trainer Lost until prompts fifo is… (#5121)
* Avoid repeat i.e. Telemetry Lost / Trainer Lost until prompts fifo is full ...

* Rename functions

* Belt and braces
2017-08-09 11:59:13 +02:00
Kilrah 7d386e7821 Merge branch 'bsongis/companion_sensor_switches' into 2.2 2017-08-09 11:37:56 +02:00
Bertrand Songis ee258b8ec8 Curves buttons broken on Linux 2017-08-09 11:02:57 +02:00
Bertrand Songis 0641adc5f4 Segfault fixed 2017-08-09 10:47:01 +02:00
Bertrand Songis 045294d53b Unify element names 2017-08-09 10:29:33 +02:00
Bertrand Songis 169df7130b Update CREDITS.txt 2017-08-08 20:39:47 +02:00
Bertrand Songis 49e252337e Sensors names changed to "SensorX:YYYY" 2017-08-08 20:38:29 +02:00
Bertrand Songis 7906107d6c Update CREDITS.txt 2017-08-06 22:15:35 +02:00
Bertrand Songis e3d881be76 Update CREDITS.txt 2017-08-05 20:46:15 +02:00
Arne Schwabe bd968bd60f Bundle and use avrdude.conf on OS X (closes #5050) (#5127) 2017-08-04 12:19:27 +02:00
Bertrand Songis 541aa459cf Lua drawBitmap on X7 2017-08-04 12:08:10 +02:00
Kilrah c82c7ee5db No serial debug on X7 2017-08-04 11:22:42 +02:00
Bertrand Songis 76e72c8a86 RssiPowerOff alarm enabled by default (#5129)
* RssiPowerOff alarm enabled by default
+ Companion support

* Fix continuously toggling RSSI on shutdown setting on X9
2017-08-04 11:01:52 +02:00
Bertrand Songis 6304f0daf6 Sleep bitmap on X7 (#5125) 2017-08-04 10:41:36 +02:00
Bertrand Songis e00efb1566 Cosmetics 2017-08-03 21:50:26 +02:00
Bertrand Songis 258347fbd1 Warning fix 2017-08-01 17:04:20 +02:00
Bertrand Songis 7434e330c8 3djc/rssi poweroff safety (#5126)
Shutdown RSSI Alert
2017-08-01 14:13:25 +02:00
Bertrand Songis b55070f939 [Companion] Sensor switches support added
+ some refactoring to hide irrelevant switches in the combobox

More refactoring to come:
 - have only one SwitchModel per model instead of one per tab
 - only do the update work if something has changed
2017-07-30 12:12:27 +02:00
Arne Schwabe a7524ba74d Fix clang warnings (#4988)
* Fix clang warnings

- signed char on AVR vs unsigned char on ARM
- use references instead of points in calculation (same code size)
- Ignore packed address warning for mavlink includes
- Turn error on packed addresses to warning for Horus (Cannot fix that without major refactoring, might even need eeprom change)

* Revert fixes for clang on AVR as the old AVR gcc does not like them
2017-07-30 09:59:15 +02:00
Damjan Adamic 3436273fdf Fixes #5090: periodically update sensor ratios from the radio when the telemetry simulator is running. (#5110) 2017-07-30 09:56:16 +02:00
Damjan Adamic 4dcd49a516 Fixes #5093: usbasp udev were rules missing from the installation package (#5111) 2017-07-30 09:55:16 +02:00
Sebastien Charpentier 2f4ed3b35f Updated Fr Translation (#5115)
* Initial version

* Update French translation.
2017-07-30 09:52:06 +02:00
Bertrand Songis b814f997f8 Update CREDITS.txt 2017-07-27 16:17:44 +02:00
Bertrand Songis e37872398e Fixes #5100 2017-07-27 12:22:24 +02:00
Kilrah 3b7c3fb217 Clarify upgrade text (fix #2967) 2017-07-24 12:41:42 +02:00
Kilrah e04aa4b3cc Revert "Add sam-ba location to list of settings that must not be imported"
This reverts commit 1bb6a82cf3.
2017-07-24 11:51:26 +02:00
Kilrah 1bb6a82cf3 Add sam-ba location to list of settings that must not be imported 2017-07-24 11:43:02 +02:00
Kilrah 022f7121b4 Fix unneeded conversions between 9XR-Pro and AR9X/Sky9x 2017-07-24 11:33:13 +02:00
Bertrand Songis cc19c8027a Update CREDITS.txt 2017-07-22 19:14:00 +02:00
Sebastien Charpentier 7dfb5b6a28 Updated French translation (#5074)
* Starting point.

* French translation.
2017-07-21 11:06:51 +02:00
Bertrand Songis 397b78fe06 Update CREDITS.txt 2017-07-21 11:02:05 +02:00
3djc 1e2f4d6c0c - Add 'quick' mode compatibility (#5099)
- Add compatibility with previous receiver firmware
- rename S6R to SxR to acknowledge S8R is supported too
2017-07-20 13:38:30 +02:00
Bertrand Songis 387cd98efe Update CREDITS.txt 2017-07-19 14:08:02 +02:00
Bertrand Songis 7eddd662e7 Update CREDITS.txt 2017-07-18 20:00:30 +02:00
Bertrand Songis 21f61fe498 Update CREDITS.txt 2017-07-13 07:25:39 +02:00
Bertrand Songis 0437314ae3 Update CREDITS.txt 2017-07-10 07:34:43 +02:00
Bertrand Songis 21e8551787 Update CREDITS.txt 2017-07-09 21:35:48 +02:00
Arne Schwabe 129bbe2198 Fix getcurve reporting 0 as first x value instead of -100 2017-07-07 23:44:23 +02:00
Bertrand Songis cfcac8c51d Update CREDITS.txt 2017-07-04 18:18:40 +02:00
Bertrand Songis eaeb90dc07 Update CREDITS.txt 2017-07-01 23:01:20 +02:00
Bertrand Songis ae68dea923 Update CREDITS.txt 2017-07-01 12:06:37 +02:00
Arne Schwabe 1ae8e40a3f Fix setCurve not probably working for custom curves
ypoints used for x instead of xpoints
2017-07-01 01:55:31 +02:00
3djc 779aecfbee Add mechanics for x9 IMAGES import into sd card file 2017-06-29 15:56:18 +02:00
3djc 1c62b19f9f Fully adjustable splash timer on x7, matching x9 implementation (#5008)
* Fully adjustable splash timer on x7, matching x9 implementation

* Make splash adjustable for all ARM, and just check box for AVR
2017-06-28 22:10:40 +02:00
Neil Horne c00775b2d1 Add model checklist edit to Companion (#5047)
* Add model checklist edit to Companion

* minor fix

* Add only write file if text changed.
Add @bsongis feedback.
Minor code changes.
2017-06-28 22:09:47 +02:00
3djc b7b7c48d8e x7/x9 GPS datetime fix (#5051)
* Fix x7 display in telemetry widget (only time is displayed)

* rename drawDate to a more specific name, since it is not generic
fix for x9

* Travis build fix

* Introduce time FONTSIZE_MASK macro

* Cosmetics based on Bertrand's last feedbacks
2017-06-28 20:28:57 +02:00
3djc 76ffd4fcb4 Do not display popup menu on last line (cpy trim -> sub for all chan) (#5061) 2017-06-28 13:22:37 +02:00
Arne Schwabe 9ad5094909 Display XJT version in analogs (#5039)
* Display XJT version

* On Horus too
2017-06-26 21:28:30 +02:00
3djc 0fd23d3e61 Fix COLORLCD compile for PT (#5063) 2017-06-26 18:05:53 +02:00
Andre Bernet a587f8b825 Edge detection only on "Reset Flight", commit 6bc6e074e17e28138fcb23b1e6a3e91eef0b406a introduced unnecessary change in behavior for Reset Timer (fix #5036) 2017-06-25 17:40:54 +02:00
Bertrand Songis fb1098c16e Update CREDITS.txt 2017-06-25 16:47:45 +02:00
Damjan Adamic 97ef444648 Travis build fix 2017-06-24 19:17:51 +02:00
Bertrand Songis c672d2544b Update CREDITS.txt 2017-06-19 22:30:02 +02:00
Sebastien Charpentier 72ca1b021a Fixed Typo. (#5046) 2017-06-19 16:09:34 +02:00
Sebastien Charpentier 044b3a706c French Translation (#5045)
* Starting point for French translation.

* Updated French translation.
2017-06-19 15:10:05 +02:00
3djc 4c40aec8b3 x7/x9e startup review (#5033)
* Turn on X7 like it is done on X9

* 4 squares like shutdown + prep for firmware option to disable

* Compile option

* - rollback firmware option
- fast one second power on
- unchanged power off
- animation added for x7 power on
- animation for power off changed to 'removing' quarter instead of adding (ie the power on anim fills in, the power down fills out)

* Cosmetics

* Cosmetics
2017-06-18 20:55:49 +02:00
Bertrand Songis 4226e9cc45 Update CREDITS.txt 2017-06-18 19:29:25 +02:00
3djc f659e98a52 Improve default voice tempo (pith remains untouched) 2017-06-18 10:01:53 +02:00
Bertrand Songis 97b2aa804d Crossfire parsing script updated 2017-06-17 09:12:13 +02:00
Arne Schwabe 8e07f9b0f4 Allow to disable telemetry alarams (#4981)
* Allow to disable telemetry alarams

This mainly useful for cheap transceivers that have telemetry but no power amplifier and very limited range of often 10-20 meters. This includes fishpepper's tinyFISH FC (and its legal/illegal clones) and also Spektrum BNF models.

* Always disable a warning when RSSI Warnings are disabled

* Compile fix

* Fix typos, also mute sensor lost

Refactor the FrskyRSSIAlarm[2] into a EEPROM compatible RssiAlarm struct

* Compile fixes

* Also refactor Companion

* Cleanup unused datastruct on ARM

* Compile fix for AVR

* Change int to uin8_t for avr

* Fix strings
2017-06-14 23:34:27 +02:00
3djc 656daa75fa Fix SDcard size and format issue (#5004)
* - fix overflow in SDcard size computation
- fix format function
- implement more informative format error handling

* Move to a function
2017-06-14 23:33:31 +02:00
3djc 547606b44e Cleanup unused (#5027) 2017-06-14 23:27:35 +02:00
3djc 15a29f3a43 Adjust audio for X9E hardware (#5028) 2017-06-14 23:27:02 +02:00
3djc ab81838d87 Merge pull request #5020 from opentx/3djc/isSwitchAvailable-fix
Review isSwitchAvailable for correct context detection
2017-06-11 10:00:12 +02:00
3djc 854ce93c07 Missed indent 2017-06-11 09:36:14 +02:00
Bertrand Songis 08ae9ddedb Update CREDITS.txt 2017-06-10 23:38:22 +02:00
Max Paperno 3f5a3995cc [Companion] Inputs and Mixes lists formatting & DnD fixes: (#4919)
* Fix/improve margin/padding issues, consistent between inp/mix views, better x-platform and older Qt (closes #4599, closes #4341);
    * Allow dropping onto lines instead of only between them;
    * Fix dropped data always going to line above the actual drop target (closes #4622);
    * Always force DnD move operations between windows to copy instead (fixes deletion of any selected line in target window, and source line was never actually removed but looked like it was);
    * Add alternate-row coloring for each Input/Mixer group;
    * Fix non-contrasting selected row font color on Linux & OS X (was black on blue);
    * Add actions to change font size (size persists until app close);
    * Show inactive lines with dimmer font for input/channel name;
    * Make drop indicator more obvious;
    * Restore mouse hover highlight (Win), which also helps indicate actual drop target (also re: #4622);
    * cosmetics: Code indentation in MixersListWidget.
2017-06-10 23:35:16 +02:00
3djc 2a86918508 Add varioCenterSilent option to x7 and rework telem screen accordingly (#4923) 2017-06-10 23:34:33 +02:00
Max Paperno f50ee3fb39 [Companion] Add optional logging of all debug output. (#4974)
* [AppDebugMessageHandler] Add ability to write debug output to any number of QIODevices.

* [Simulator][DebugOutput] Use new QIODevice hook in AppDebugMessageHandler instead of signal/slot.

* [AppData] Add new settings for debug logging; Refactor property creation macro to work with any data type and add varName_init() method to set default; Refactor all boolean settings to use new macro (others to be migrated later).

* [AppPreferencesDialog] Add UI for appDebugLog, fwTraceLog, & appLogsDir settings; Clean up layout on application prefs. tab, move and re-label a couple items.

* [Companion][Simulator] Enable optional application debug output logging.

* [Simulator] Enable optional logging of firmware debug output to file.

* [EEPROMInterface] Use qDebug() instead of std::cout so that now all debug output can be routed via custom message handler/logger.

* [Companion][Simulator] Add missing #include.
2017-06-10 23:33:03 +02:00
3djc bae44d2812 Review handling is global function detection.
Fixes !sensor been selectable in global scripts

Thanks to @Max for his help
2017-06-09 09:47:34 +02:00
Bertrand Songis 2e4775b19a Create CREDITS.txt 2017-06-09 08:05:25 +02:00
Max Paperno 655e2f9010 [Companion][AppData] Fix possible crash when importing settings from Companion < v2.1 (fixes #5016). 2017-06-07 10:49:48 -04:00
3djc a4008a2550 Enable FAI Choice for Horus (#4994)
* Test a different approach

* Implement jump over

* Much better implementation (and fixing an existing bug on top of that :))
2017-06-03 12:08:12 +02:00
Andre Bernet 9e39dfa9d7 Fix #4997 2017-06-03 11:46:22 +02:00
Bertrand Songis 94ee3c65b3 Update CREDITS.txt 2017-06-02 20:25:15 +02:00
Arne Schwabe d609d37798 Ignore UNIX dotfiles (#4973)
* Ignore UNIX dotfiles

This has the advantage of hiding all the stupid .DS_STORE and ._foo.lua attributes files from Mac OS X

* Do not ignore ..
2017-06-02 16:37:35 +02:00
3djc d0a57d4c47 Align Taranis 128*64 stats to its larger sister (#4985)
* Align Taranis 128*64 stats to it's larger sister

* Make it for all ARM
2017-06-02 16:37:12 +02:00
3djc 726b989f6c Horus Shadowed (#4979)
* Introduce SHADOWED and use it for BattCheck

* numbers too

* For drawTimer too

* Compilation fix
2017-06-02 16:36:27 +02:00
3djc 5f76e61240 Handle tinsize dot blinking (#4986) 2017-06-01 23:22:09 +02:00
Bertrand Songis 42d66bb2c1 Compilation fix (PCB=9X CURVES=NO HELI=NO TEMPLATES=YES) (#4983)
* Compilation fix (PCB=9X CURVES=NO HELI=NO TEMPLATES=YES)

* String length fixes
2017-06-01 23:21:47 +02:00
3djc e4135a9adb Merge pull request #4984 from cprinos/patch-1
drawComboBox luadoc fix
2017-06-01 07:08:22 +02:00
Chris Prinos fe1146b62c drawComboBox luadoc fix
remove extraneous 'page' param
2017-05-31 21:17:46 -04:00
Damjan Adamic 7956bd6bab Launchpad files for 2.2.0 release:
* updated changelogs
 * use suffix only for nightly builds
2017-05-31 23:31:16 +02:00
Arne Schwabe 32142e25ea add multimedia libs depency (#4982) 2017-05-31 22:31:28 +02:00
3djc 85bb6ea3a7 This fixes #4980 2017-05-31 10:47:20 +02:00
3djc d5e42992d2 2.2.1Nxx pre prep 2017-05-31 10:24:07 +02:00
Andre Bernet fbdcef3733 Release notes updated (a bit late) 2017-05-30 21:42:41 +02:00
Andre Bernet a13c857b53 Release notes updated (a bit late) 2017-05-30 21:40:32 +02:00
Max Paperno 85863358fb [Horus] Outputs widget: Fix bar graph overflow with extended limits (#4969)
* [Horus][Widgets] Outputs widget: Fix bar graph overflow with extended limits (closes #4968); Show standard/translatable source names (CHxx) when no custom name is defined; More const-ness, less math.

* [OutputsWidget] Yet more const-ness and less calculation repetition.
2017-05-30 18:37:38 +02:00
3djc b397af1bac Fix overflow when firmware filename is too long (#4971) 2017-05-30 18:36:36 +02:00
Max Paperno 0906bdc6d7 Adjust logical switch abbreviations. (#4965)
* [Companion] Change logical switch abbreviations to "LS##" in Source/Switch selection lists.

* [LogicalSwitchesPanel] Normalize LS name label.

* We had decided on "Lxx"

* Match firmware side

* ARM wasn't using the translations

* Update strhelpers.cpp
2017-05-30 18:36:04 +02:00
Arne Schwabe 77925f6abc Fix issue #4961 (#4963) 2017-05-29 18:16:01 +02:00
Martin Hotar 0a0893e6cc cz translations of companion (#4964) 2017-05-29 18:15:21 +02:00
3djc 3d17023bc9 Fixes numbering discrepancy for Horus inputs (#4967)
Fixes #4966
2017-05-29 13:24:29 +02:00
3djc fd16151850 Update CREDITS.txt 2017-05-28 10:21:12 +02:00
Arne Schwabe 2ae0472f76 Minor fixes to lua dua 2017-05-28 09:48:34 +02:00
Arne Schwabe cd23fedb56 Schwabe/lua set curve (#4955)
* Implement setCurve for lua

* Bug fixes after actual testing of API

* Fix documentation

* Even more error checking

* Add example code how to use this function

* Silence gcc warnings

* Drop points and start array index at 1 and note about wrong index in getCurve

* Add standard example

* Fixes

* Don’t use an invalid number in example

* fix missing 0
2017-05-28 07:30:43 +02:00
Bertrand Songis 1cb0156cd0 Update CREDITS.txt 2017-05-25 11:25:30 +02:00
Arne Schwabe 4880c029b7 Schwabe/fix curve overflow (#4951)
* Fix curve editing function not checking if there is space for the curve

* Fix compile error
2017-05-24 18:42:56 +02:00
Arne Schwabe c79994d812 Exit if the FindSDL script finds 2.x instead of 1.x (#4948) 2017-05-23 16:46:36 +02:00
Sebastien Charpentier f462af1b0e Updated French translation (#4946)
* Updated French .ts file.

* Updated French Translation.

* Missing space.
2017-05-23 16:12:04 +02:00
David Zumbrunnen 8729bbc41b Fixed syntax error in UDEV rules (#4945)
Extraneous semicolon results in an error saying: `invalid key/value pair in
file /lib/udev/rules.d/45-companion22-taranis.rules on line 1, starting
at character 83 (';')`
2017-05-23 13:46:10 +02:00
Max Paperno 0fc1681d5c [Companion] Improve first use of Companion & upgrade notice (#4940)
* [Companion] On first use of Companion show preferences dialog and new welcome message (closes #4731); Improve detection of new version upgrade & reformat message; Add download link URL to Linux update notice (closes #4774); Fix issue with leftover top-level settings categories when checking for older versions which don't exist; Introduce basic structure for warnings/messages to be suppressed by user preferences (eg. "don't show this message again" option).

* Welcome msg typo fix.
2017-05-23 09:44:47 +02:00
Max Paperno 69576cb17d [Companion] Speed up/fix findMassstoragePath(): Use Qt methods when available (v5.4+) and only check for path on FAT[32] file systems; For older Qt, skip root (/), /net, /proc, & /run devices on Linux/macOS; Fixes long delay on eg. macOS due to network access. Remove unused #include "mountlist.h" in process_flash.cpp. (#4937) 2017-05-20 21:34:26 +02:00
3djc 1a85956dcb Tentative fix (#4939) 2017-05-20 21:33:43 +02:00
Arne Schwabe 01150497bb Schwabe/log sensors by default (#4932)
* Log telemetry sensors by default

* Renome now redundant logs = True code from Frsky
2017-05-19 17:19:43 +02:00
Sebastien Charpentier 0ed7f5a5ad French translation (#4936)
* Created French .ts file.

* Fixed some French translation.
2017-05-19 17:18:59 +02:00
Bertrand Songis ce83cf00e0 Update CREDITS.txt 2017-05-19 17:16:38 +02:00
Andre Bernet 8eea072cd1 Don’t spam simulator with dummy values on telemetry reset anymore (#4933)
* Don’t spam simulator with dummy values on telemetry reset anymore, simulator can be used if needed

* Ditch more dummies
2017-05-18 07:11:48 +02:00
Andre Bernet 4d23292ad3 Empty error message box is no fun 2017-05-16 14:39:27 +04:00
Damjan Adamic 618832974e Re #4718: added missing dependency libqt5multimedia5-plugins for Debian/Ubuntu packages (missing sound when using Qt Multimedia) 2017-05-14 19:20:51 +02:00
3djc c80fbf2de7 Get lua fields info from inside docker 2017-05-14 12:35:13 +02:00
3djc 5b69ceff0d Further follow up 2017-05-14 08:40:47 +02:00
3djc 3cc3687dcb Follow up on next rename 2017-05-14 08:11:04 +02:00
Andre Bernet eb7c73668f Leftover stuff on Windows uninstall 2017-05-13 16:18:56 +02:00
Damjan Adamic d35d3b5e22 Prepare Launchpad scripts for non-nightly release 2017-05-13 14:02:59 +02:00
3djc 935518f6dd Let's build a few more 2017-05-13 13:37:02 +02:00
3djc 20dcee3a5c Release prep 2017-05-13 13:17:14 +02:00
Arne Schwabe 5825a2ec2c remove dubious GNUC and rename 9x refrences 2017-05-13 13:05:47 +02:00
Arne Schwabe 355f4b5f92 Also download and open new updates on OS X (#4926)
* Also download and open new updates on OS X

* Cosmetics
2017-05-13 13:03:39 +02:00
Andre Bernet 9437d98df9 Merge branch 'kilrah/companion_sdcard_download' into next 2017-05-13 11:55:59 +02:00
3djc 7a8ca1c675 Match release dir struct 2017-05-13 11:49:58 +02:00
3djc 79d9359e56 More release prep 2017-05-13 11:46:13 +02:00
3djc 006166a25c Release helping change 2017-05-13 11:17:48 +02:00
3djc 33cc0861a6 Release prep 2017-05-13 11:00:07 +02:00
Bertrand Songis d48ab63497 Update CREDITS.txt 2017-05-12 22:09:07 +02:00
3djc bd62281144 X12 : split S6R settings and calibration scripts (#4920)
* Quick and dirty split

* Some cleanups
2017-05-12 19:53:46 +02:00
Bertrand Songis 50397d0052 3djc added
Thanks for your help!
2017-05-12 07:56:00 +02:00
Andre Bernet 460e6aab96 Update all custom screen references after deleting one (fix #4909) (#4914) 2017-05-11 18:39:26 +02:00
3djc 95b0a21cfc Introduce S6R calibration tool to x7 (#4916)
Introduce real time position feedback
Autosense between S6R and S8R (not same sensor orientation)
2017-05-11 18:39:10 +02:00
Max Paperno f7b6d95910 [Companion] Input names formatting (#4888)
* [Companion] Re-format Inputs list to format input name consistently with rest of UI; Add leading zeros to RawSource numbers in names; Show custom channel name in MixerDialog.

* [Companion] Remove colon separator between input number and custom name.

* Fix segfault when no model pointer is passed to RawSource::toString() (problem was only on this branch).
2017-05-11 07:37:13 +02:00
Sebastien Charpentier 6e0bec9db4 Update French translation (#4908)
* Generated new French .ts file.

* Update French translation concerning the new SD sync mechanism.

* Skip must be translated as "Ignorer", not "Sauter".

* French mistake.
2017-05-11 07:36:54 +02:00
Bertrand Songis 83132ef041 Update README.md 2017-05-09 09:30:06 +02:00
Max Paperno c1586b72bb [Companion] SD Sync reworked: (#4906)
* Complete re-write of SyncProcess, now more robust, UI-independent, runs in own thread, large speed boost;
    * Use file hash comparisons instead of byte-level compare with string methods (probable fixes for #4837 and #4848);
    * New pre-sync options dialog with selectable folders and other settings (settings are remembered until app exit);
    * Option to choose sync direction(s) (up/down/bi) and the order in which bi-directional sync runs;
    * Option to choose file comparison mode (timestamp/hash/both) or force overwrite (for one-way sync);
    * Option to set a maximum file size to copy;
    * Option to do a test run w/out actually copying any files;
    * Better reporting of progress, total counts (copied/updated/skipped), and errors, with color coding;
    * Much more reliable to cancel long-running/hung copy process;
    * ProgressWidget can now display rich-text in the text browser, added some new functions for usage;
    * Misc. small layout tweaks to ProgressDialog and ProgressWidget to make them behave/look better;
2017-05-08 20:51:26 +02:00
Max Paperno ca25696d1a [Companion] Radio module setup: Fix custom failsafe no-pulse and hold options not being saved properly (closes #4904). 2017-05-08 08:29:11 -04:00
Bertrand Songis 11579d9118 Update CREDITS.txt 2017-05-08 13:48:13 +02:00
Andre Bernet 32714fb841 No more subdomain 2017-05-08 12:33:15 +02:00
Andre Bernet 2bc2030f86 Merge branch 'next' into kilrah/companion_sdcard_download
# Conflicts:
#	companion/src/fwpreferencesdialog.cpp
2017-05-08 09:48:53 +02:00
Bertrand Songis 93dbdf8680 Just some comments, the very minimum 2017-05-07 22:27:10 +02:00
3djc 301e33a271 gTTS (#4899)
* Release prep work

* Add CZ support

* Prep for release

* No more need to prefix unicode strings (we use python3)
Some fixes
Italian fixes
2017-05-07 17:39:31 +02:00
Sebastien Charpentier 53bb8bc6c3 Updated French translation. (#4902)
* Generate nex French .ts file.

* Updated French translation.
2017-05-07 17:39:06 +02:00
Max Paperno e2502772cb [Companion] Model Setup: Prevent bogus modification signals. (#4896)
* [Companion] Model editor Setup panel: Prevent bogus modification signals, eg. when populating protocols box or when removing focus from some fields w/out the value actually changing; Remove unnecessary function.

* [SetupPanel] Fix comparison warning and also a translation issue with Multiprotocols subtype and option names.

* [ModelPrinter] Add a missing include.
2017-05-06 18:09:20 +02:00
Max Paperno 24de312a30 [Companion] Some radio settings Hardware tab fixes. (#4895)
* [Companion] Radio -> General Settings -> Hardware: Hide external serial port option for Horus; Fix battery voltage and current calibration changes not registering (wrong signal handler name); Prevent modified() event if edited value wasn't actually changed (this is a problem in all panels with onEditingFinished() signals); Fix some cosmetic layout issues when no hardware names are editable.

* [HardwarePanel] Minor layout fix for BT option.

* [HardwarePanel] Fix comparison issue.
2017-05-06 18:08:55 +02:00
3djc efe53eb034 Fix translation for audio files (#4889)
Switch the time mechanic to english one (may not be perfect, but current italian is not working at all)
2017-05-06 18:08:28 +02:00
Max Paperno 96ccb4cb3f [Companion] Fix a few translations. (#4890)
* [Simulator] Fix keymap translations.

* [Companion] Fix translations in file type selector dialogs.

* [Simulator] Fix inadvertent help text delimiter change.
2017-05-06 18:04:51 +02:00
Bertrand Songis 3f06037e1b [Companion] Credits dialog refactoring 2017-05-06 17:55:03 +02:00
Bertrand Songis 38d8f6a326 Update DONATIONS.txt 2017-05-06 00:13:12 +02:00
Bertrand Songis 2bec60517a Update DONATIONS.txt 2017-05-05 07:28:32 +02:00
Bertrand Songis d3b8133ee2 Add LapinFou to CREDITS.txt 2017-05-02 07:33:10 +02:00
Sebastien Charpentier 4b2b5a9d37 Logical switch L% or LSw% are now translated in IL% (Interrupteur Logique). (#4886) 2017-05-01 17:44:08 +02:00
Bertrand Songis 6edc3b61ff Update DONATIONS.txt 2017-05-01 08:29:22 +02:00
Arne Schwabe f525b1762b Fix #4881 (#4884)
Thanks Mike for noticing: In pxx_arm.cpp, the pulse duration is set to either 48 or 32. This value gets put into the ARR register of the timer (via DMA). Counters count from 0 to the ARR value, then go back to 0. This will result in either 49 or 33 counts for the pulse width, thus making the pulses 0.5uS too long.

Tested only with external PXX
2017-05-01 00:33:45 +02:00
3djc 4f5f241669 Fix opentx-9x-autoswitch-autosource-dblkeys-battgraph-telemetrez-sp22-stickrev-pgbar-en.hex (#4883) 2017-04-30 23:19:43 +02:00
Bertrand Songis 0b25332171 Add @schwabe to CREDITS.txt 2017-04-30 12:58:49 +02:00
3djc 054c87c91e Fix adjust GVAR and Volume (#4880) 2017-04-30 12:53:25 +02:00
Bertrand Songis e053abfc3e Max added to the CREDITS.txt 2017-04-30 08:57:36 +02:00
Max Paperno 6abd36d628 [Simulator] Revert logic switch names in Radio Outputs view to numbers-only (since @72b1ad0, closes #4877). 2017-04-29 20:49:04 -04:00
Damjan Adamic 582546f8ed Fixes #4839: path buffer overflow if LUA widget or theme directory name was too long (max length of directory name is 13 characters) (#4876) 2017-04-29 22:18:11 +02:00
Damjan Adamic c1e7235375 Launchpad changelogs for 2.2.0 RC18 2017-04-29 19:26:49 +02:00
Bertrand Songis 975023bdc7 Update DONATIONS.txt 2017-04-29 16:02:37 +02:00
Max Paperno 4df32f8247 [Companion] Prevent crash when importing (converting) more models than current radio can handle. 2017-04-29 07:30:44 -04:00
Sebastien Charpentier 630dec62f5 Fixed French translations (#4875)
* Updated French .ts file.

* Updated French translations.
2017-04-29 10:34:50 +02:00
3djc a58a541bb6 Only display RAS for XJT modules (#4869) 2017-04-29 09:10:15 +02:00
3djc 0cff67e032 Fix some too long translation (#4873)
* Fix FR, DE, PL

* Such a better fix thanks to @mhotar !

* Create conditional linebreak for 128pixels and Horus, but not X9

* CosmeticsCo
2017-04-29 09:04:23 +02:00
Max Paperno 72b1ad085f [Companion] Show custom channel, G-Var, and Curve names throughout UI. (#4874)
* [Companion] Move RadioData constructor.

* [Companion] Move getCapability(SwitchPositions) to Boards class.

* [Companion] Show custom channel, g-var, & curve names throughout UI; Remove redundant name formatting and other unused functions in ModelPrinter and Helpers; Add CustomFunctionData::isEmpty().

* [Companion] Add LogicalSwitchData::isEmpty().

* [Companion] Fix small bug in HardwarePanel.

* [Companion] Rename logical switches to "LSw##" in selections lists to avoid confusion with "L#" and "LS" hardware controls; remove unused RotaryEncoderString().
2017-04-29 09:03:53 +02:00
3djc 04bcc70422 X7 output main view : dynamic PREC also for PPM_US (#4871)
* Differentiate PREC threshold for PPM_US and PPM_PERCENT

* Cosmetics
2017-04-28 16:14:48 +02:00
Sebastien Charpentier d5eec9b8dc Fixed typo. (#4870) 2017-04-28 16:13:19 +02:00
Bertrand Songis 36afe4127c Update DONATIONS.txt 2017-04-28 16:12:41 +02:00
Bertrand Songis 572463bb0d Update DONATIONS.txt 2017-04-27 21:13:09 +02:00
3djc 6f066253f0 Proper (?) fix (#4868) 2017-04-27 21:08:46 +02:00
Sebastien Charpentier f3cbc37067 Fix French translation (#4862)
* Fixed too long French translation for the Horus.

* Fixed some French translations.
2017-04-27 21:06:40 +02:00
Arne Schwabe 37b0dab9da Add RAS to X7 analogs screen (#4865)
* Add RAS to X7 analogs screen

* Also fix SWR->RAS in simulator UI

* Only display RAS for external XJT module

The „this is almost useless but I have done the work, now it stays commit“
2017-04-27 20:31:00 +02:00
Damjan Adamic c6d15c6f37 Launchpad changelogs for 2.2.0 RC17 2017-04-27 11:19:57 +02:00
Damjan Adamic 73f4b8f172 Projectkk2glider/issue 4827 (#4855)
* Reverting a part of f94b4c743d that deals with the size of table hash. Fixes 4827, but uses more memory and CPU.

* New internal Lua traces
2017-04-26 21:45:46 +02:00
Bertrand Songis 3aceed62c9 [Companion] Fixes #4777 (#4860) 2017-04-26 21:43:35 +02:00
Bertrand Songis f10bad7abe Proposal to fix #4831 (CZ TTS problem with PREC1 and units) (#4856)
* Proposal to fix #4831

* Next fix for #4831

* Initiate some CZ docs

* Some more structure, still a workframe

* My attempt to help with #4831

* Update tts_doc_cz.md

* copy/paste error

* Update tts_doc_cz.md

* missed one number/qr.quot

* Cosmetics

* Consistency in parameters order

* Nearly complete doc

* Cosmetics to facilitate coding for non CZ devs

* Fix integer+unit, cosmetics

* Update tts_doc Radians and Mililiters are Male gender

* Radian and Millimeter are Male (so i've been told)

* Cosmetics

* Invers pushUnitPrompt parameters as per bsongis request
2017-04-26 21:42:01 +02:00
Bertrand Songis c15922a942 Update DONATIONS.txt 2017-04-26 17:30:34 +02:00
Bertrand Songis c2a6a20fc1 [TTS] Fixes 2017-04-26 13:13:55 +02:00
Bertrand Songis 37155363ff [TTS] gTTS method added 2017-04-26 12:33:12 +02:00
Bertrand Songis b0183efaf1 Fixes #4841 2017-04-25 21:25:46 +02:00
3djc 6dd8524ea5 Differentiate message despite so little space :s (#4850) 2017-04-25 12:08:20 +02:00
Arne Schwabe 50cb102a34 [MULTI] Fix fallback to Flysky and Spektrum telemetry without MULTI_TELEMETRY (#4851) 2017-04-25 12:07:34 +02:00
3djc be20e90630 3djc/gps display fixes (#4852)
* Remove top GPS coord display on X7 sensor edit (not enough space for it)

* Improve GPS coord display on X9
2017-04-25 12:06:40 +02:00
Martin Hotar c15a86dc19 cz rtanslation fixes and mode sources aligned a bit -it fixes EN version as well (#4854) 2017-04-24 20:53:09 +02:00
Bertrand Songis b790a844f1 Fixes #4806 2017-04-24 19:33:06 +02:00
Bertrand Songis faacf7f9c5 Update DONATIONS.txt 2017-04-24 18:00:45 +02:00
Max Paperno f9b7f567c3 [Companion] Fix Special/Global Functions action selector being reset for all lines when one line is deleted/cut/pasted (closes #4825). 2017-04-23 21:10:17 -04:00
3djc 591522c25a fix drawSource (#4843) 2017-04-23 18:00:11 +02:00
3djc 9193604aff X7 : fix calibration interuption (#4835)
* Fix 4833

* Less worse fix ?

* Trying something else
2017-04-23 12:38:50 +02:00
Bertrand Songis 1ad8769fff [Horus] Vector table updated (#4842) 2017-04-23 10:11:01 +02:00
3djc fbc3bac6d3 Review handling of combine INTERNAL_PPM and MULTIMODULE (#4826)
* First attempt

* Fix

* Review IS_INTERNAL_MODULE_ENABLED() macro
2017-04-23 10:10:43 +02:00
Bertrand Songis ea5401084c Update DONATIONS.txt 2017-04-22 20:50:50 +02:00
Bertrand Songis 902473fe6f Update 2017-04-20 09:39:44 +02:00
Sebastien Charpentier bc6ed93b0f Updated Frencht ranslation for "SimulatorMain". (#4817) 2017-04-19 10:57:31 +02:00
reichi b5f5e64d95 Fix DS3231 RTC read/write on AR9X (#4819) 2017-04-19 10:55:48 +02:00
3djc fa951acf40 Review line ending handling (#4820)
* New line end handling rules

* Normalize all the line endings
2017-04-19 10:54:43 +02:00
Bertrand Songis 189b65b724 Update DONATIONS.txt 2017-04-18 22:11:39 +02:00
3djc 6e427bca74 Do not allow past SWSRC_TELEMETRY_STREAMING for global functions (#4814) 2017-04-18 12:56:03 +02:00
3djc 0c260ce12d Invert outputs limits when output is reversed (#4813)
* Invert outputs limits when output is reversed

* Cosmetics
2017-04-18 12:55:43 +02:00
Bertrand Songis 9a93d85ef6 Update DONATIONS.txt 2017-04-18 08:33:23 +02:00
3djc 46f0384828 No reason for that just yet 2017-04-17 12:02:33 +02:00
Arne Schwabe 54c1f22312 Multimodule has a pulldown resistor and does not work with open drain, use push pull instead (#4808) 2017-04-17 10:25:56 +02:00
Bertrand Songis 2b41ba94ff Update opentxsimulator.cpp 2017-04-17 10:23:09 +02:00
Arne Schwabe 471c38628f Fix key variable not initialised (#4790) 2017-04-17 10:22:21 +02:00
Andre Bernet b0b270963c Cosmetics 2017-04-17 10:16:20 +02:00
Bertrand Songis a719c391a1 Fixes #4768 (#4807) 2017-04-17 10:04:09 +02:00
3djc 13e6ae1d08 Move tm_year to unsigned (#4811)
Fixes 4627
2017-04-17 10:03:45 +02:00
Bertrand Songis c6148c109c Update DONATIONS.txt 2017-04-17 09:59:12 +02:00
3djc 95bc595f50 Better manage additional switches declared as toggle or 2pos (#4793) 2017-04-16 21:13:51 +02:00
Max Paperno 1d6f2acbc2 [Simulator] Refactor CLI option parsing, add "--sd-path" and "--start-with" options (#4798)
* [Simulator] Refactor CLI option parsing to use QCommandLineParser, remove QxtCommandOptions external lib; Add "--sd-path" and "--start-with" options; Qualify all translatable text (SimulatorMain context).

* Add date string to version.
2017-04-16 21:03:31 +02:00
Andre Bernet 5d5c915ea9 [Horus] Language specific char handling was missing in text view 2017-04-16 21:02:10 +02:00
Sebastien Charpentier f795528d21 Translate last missing field + correct some translation (confirmation box) when deleting models/categories. (#4797) 2017-04-16 20:58:14 +02:00
3djc 1d4ec6f73e 3djc/fix #4795 (#4802)
* Prevent popup in undue places

* Working fix ?
2017-04-16 10:18:52 +02:00
Damjan Adamic 723b5df4f1 Launchpad changelogs for 2.2.0 RC16 2017-04-15 11:54:12 +02:00
mhotar f197268ca7 Merge branch 'next' of https://github.com/opentx/opentx into next 2017-04-13 21:58:45 +02:00
mhotar c152f983da yerico add model and category icons 2017-04-13 21:57:42 +02:00
Arne Schwabe adeb088e93 Fix IBUS telemetry scaling (#4784)
In my first implementation I guess some scalings wrong (and forgot PREC1 when trying to subtract 40)
2017-04-13 18:31:50 +02:00
Jacek Drewniak 70c837f9f0 Driver33/pl translation (#4785)
* partial pl translation

* pl partial translation

* partial pl translation

* partial pl translation

* pl translation changes

* pl translation changes
2017-04-13 18:31:33 +02:00
Arne Schwabe 78c5bf1ec2 Fix high dpi on Windows 2017-04-13 12:13:02 +02:00
Sebastien Charpentier c6a024289f Updated FR translation for Companion 2.2.0N368 (#4771) 2017-04-12 14:20:11 +02:00
3djc fe55889495 Prevent delay to be accessible for edge LS (#4781) 2017-04-12 14:19:15 +02:00
Max Paperno 111bcad9a7 [Companion] Do not create a category in new file when loading data from radio; Fix crashes when editing category name. 2017-04-12 07:18:01 -04:00
Max Paperno a062efeb21 [Companion] Fix some Special/Global Functions editor source selection lists being broken and Action selector disappearing for simple actions with no parameters (fixes #4775 and #4779). 2017-04-12 05:41:04 -04:00
Andre Bernet d4ed05c98c Fix translations again 2017-04-12 10:13:05 +02:00
3djc 39a631d31d Dramaticaly reduce spam on companion/simu 'debug' output 2017-04-12 10:07:47 +02:00
Bertrand Songis 0a6518eb30 Compilation fix for french firmware / AVR 2017-04-12 09:50:17 +02:00
Bertrand Songis 37a21ffef6 Update DONATIONS.txt 2017-04-12 09:06:11 +02:00
Max Paperno 2808b85fce [Companion] Clean up some AppPreferencesDialog layout size policies and fix height shrinking when options change; Fixes issues on HiDPI displays. 2017-04-12 02:51:25 -04:00
Max Paperno 924ecced98 [Companion] Fix issue with category edit and dbl-click not working after category name edit; Add translator warnings on default model names; Remove redundant variable and consolidate filename change routines. 2017-04-11 22:54:58 -04:00
Max Paperno 077a651dc3 [Simulator] Fix intermittent crc errors with telemetry simulator. 2017-04-11 21:21:09 -04:00
Max Paperno c2ef10724d [Simulator] Fix data not being saved back to file in standalone simulator when using .otx file with non-Horus radio types. 2017-04-11 19:12:58 -04:00
Max Paperno 350c3a6d44 [Companion] Do not run model wizard on a duplicated/copied model (fixes #4773); Replace existing file extension with .otx when first saving a converted bin/hex/eepe file (fixes #4772); Make sure no other models exist before setting first model as default (fix index 0 always being auto-selected). 2017-04-11 16:42:20 -04:00
Max Paperno de3c503e02 [Companion] Fix startup switch warnings wraparound issue with X9E SQ-SR switches (closes #3359). 2017-04-11 12:07:09 -04:00
Bertrand Songis 95b31ee147 Update DONATIONS.txt 2017-04-11 07:52:50 +02:00
Arne Schwabe 7779bc51cd Remove unused pointer startP (#4770)
Clang complains about startP pointer pointing to a member of a packed structure, resulting on in a unaligned pointered address. The compiler will optimise the pointer out anyway
2017-04-11 07:50:02 +02:00
Bertrand Songis df0e306458 Update DONATIONS.txt 2017-04-11 07:48:23 +02:00
Max Paperno d864a67c3b [Companion] Restore model drag/drop/compare, many UI improvements to main and sub-windows. (#4769)
* [Companion] Refactor MdiChild & TreeModel, restore drag/drop, and more:
    * Add full drag-and-drop functions to the models list, including model copy, move, and insert actions (also between windows);
    * Add general radio settings copy/paste across file windows;
    * Full MIME support with distinct types for various data (eg. models vs. general settings), also add new type for metadata (header);
    * Copied/cut models can now be inserted in any spot (similar to drop-insert);
    * Deleted/cut models can now be removed entirely (including the empty slot) for all radio types (any models after the removed one move up, like for Horus) (may need to make this an option);
    * Empty model slots can now also be removed (any models after the removed slot move up)  (but total # of slots is still maintained);
    * Default model can be deleted (new default is picked);
    * Completely revamp the actions system (copy/paste/edit/etc) to make it fully functional:
      * Actions exist in the window, not just context menu, therefore all keyboard shortcuts actually work, w/out any duplicated code;
      * Provides access from MainWindow in a comprehensive manner: all actions are available and properly updated based on selections in current editor window, w/out awkward event monitoring;
      * More actions available from context menu, and somewhat reorganized;
      * Also show all actions on mini toolbars right in the MDI window (possibly make optional later);
      * Updated English localization file to account for plurals usage in new action item names (other languages need to be updated);
    * Keyboard navigation in the model list now works/practical;
    * MDI window uses all available height by default;
    * Newly added models/categories are selected and highlighted; Category names are immediately editable; Model editor is/can be launched if wizard is not (need to make option);
    * MainWindow updates:
      * Edit toolbar and menu now showing all available edit actions, with proper context;
      * File menu properly updates with all "general" radio actions: edit/copy/paste settings and simulate radio;
      * Added Windows menu showing list of open windows (eg. to switch when full screen) and tabbed window option (need to make persistent setting);
      * Immediate update of icon size preference;
      * Do not delete toolbars when re-translating UI (they don't lose assigned position);

* [Companion] Restore model compare functionality by using new MIME data exchange system; Add ability to compare any number of models at a time; Multi-model printer now shows custom hardware settings for each dropped model (even from different radios).

* [Companion] Add missing monoblue & monowhite theme sdsync icons.

* [Companion] Model wizard starts with default model name populated.

* [Companion] Properly re-translate UI instead of recreating all the actions/etc.; Tell Mac specifically where to put our actions (seems to make it happier too).

* [Companion] Further improve handling of Window menu items/detection of sub-window changes.

* [Companion] Add file-close action.

* [Companion] Add user options and save preferences:
    * Option to use wizard, open editor, or do nothing on new model creation;
    * Option to remove empty model slots when deleting/moving models (in non-Horus radios);
    * Options to hide toolbars in document windows (r-click on TBs);
    * Save/restore size of document windows, and maximized/tabbed state;
    * Save/restore size/position of model compare window;
    * Add shortcuts for model compare, FW download, log viewer;

* [Companion] Disable being able to "delete" empty model slots (more awkward than helpful).
2017-04-10 19:29:41 +02:00
3djc 9c19889309 Remove trailing silence from audio files 2017-04-10 13:16:39 +02:00
3djc 0a1cacf77c Fixes to BattCheck widget 2017-04-10 10:39:14 +02:00
Andre Bernet eca531d743 More translation fixes 2017-04-10 10:14:15 +02:00
Andre Bernet 3326ff3f61 Translation fixes 2017-04-10 09:31:37 +02:00
3djc d4c3ff743b 3djc/x7 draw timer (#4764)
* Use drawText with tiem string like x12s. Change font ':' which where way to large for SMLSIZE

* MIDSIZE ':' lower dot was not horizontaly symetrical, moving it up one pixel

* Make it all ARM

* Let's try not to brake timer adjust

* Fix
2017-04-08 16:59:21 +02:00
Bertrand Songis d04cb84c5b Update DONATIONS file on 'next' 2017-04-08 12:41:36 +02:00
Bertrand Songis 0359cb244e Bsongis/server compilation fix (#4763)
* Fix following automatic server emails

CMake options:
-DTHR_TRACE=YES -DVARIO=YES -DGAUGES=NO -DAUTOSWITCH=YES -DTRANSLATIONS=FR -DACCURAT_THROTTLE_STATS=NO -DSP22=NO -DPCB=9X -DARITHMETIC_OVERFLOW_CHECK=NO -DFONT=SQT5 -DHELI=NO -DEEPROM_PROGRESS_BAR=YES -DTEMPLATES=NO -DFRSKY_STICKS=NO -DVOICE=NO -DDBLKEYS=NO -DGRAPHICS=YES -DFAI=YES -DBATTGRAPH=YES -DTURNIGY_TRANSMITTER_FIX=NO -DPWM_BACKLIGHT=NO -DNAVIGATION=NO -DBOLD=YES -DDSM2=NO -DGVARS=NO -DAUTOSOURCE=YES -DCURVES=NO -DWS_HOW_HIGH=YES -DPPM_LIMITS_SYMETRICAL=NO -DHAPTIC=NO -DUNITS=METRIC -DPPM_UNIT=PERCENT_PREC1 -DAUDIO=YES -DGPS=NO -DPPM_CENTER_ADJUSTABLE=NO -DSPLASH=YES -DFAS_OFFSET=NO -DFLIGHT_MODES=NO -DOVERRIDE_CHANNEL_FUNCTION=YES

* Fix some missing translations for avr

* Compilation fixes
2017-04-08 12:39:30 +02:00
3djc 76f3edb50d Handles premature exit (no pun intended) (#4762) 2017-04-08 10:32:59 +02:00
3djc 116d24ec37 Horus : adjust INVERS background for all text sizes (#4755)
* Adjust INVERS background for all text sizes

* More proper fix (I think)
2017-04-08 10:32:30 +02:00
Andre Bernet 87c45beba2 Remove throttle reverse warning for AVR too 2017-04-08 10:32:10 +02:00
Andre Bernet db48158956 Main view index is now in model settings (fix #4761) 2017-04-07 19:52:28 +02:00
Andre Bernet f3d56d31c0 Export Horus joystick to lua 2017-04-07 18:45:59 +02:00
Max Paperno ee50096754 [Companion] Fix another possible crash during model conversions (divide by zero). 2017-04-07 04:46:50 -04:00
Max Paperno 629d82fe27 [Simulator] Fix trims issue with AVR simulators (build failure since 57dc015); Fix possible array bounds issue if data is corrupt. 2017-04-07 03:50:40 -04:00
3djc 3a8f9adb4d Enable set binding mode as a firmware option for frsky radios (#4743)
* Enable set binding mode as a firmware option for frsky radios

* Improvements based on Bertrand's comments

* Last feedbacks
2017-04-06 22:36:10 +02:00
Andre Bernet 8794f45816 Check for confirming inversion of throttle channel is no more possible since Virtual Inputs got introduced (Fix #4757) (#4758) 2017-04-06 22:34:11 +02:00
3djc b291faf7a7 Add unit to lua getFieldInfo (#4750)
* Create getUnit lua function

* Cosmetics

* Expend getFieldInfo instead of creating a new function

* Streamline units table

* @projeckk2glider comments

* Cosmetics

* Use simple division
2017-04-06 22:31:17 +02:00
3djc 537fe906ce Add GVAR handling similar to X9 (#4749) 2017-04-06 22:30:50 +02:00
Max Paperno 339592d681 [Companion] Fix model setup panel not being populated with data upon initial load (since 4c0dbfc). 2017-04-05 03:56:31 -04:00
Sebastien Charpentier 3d7d57df7c Fixed typo 2017-04-04 15:39:31 +02:00
3djc 0cdff35bd3 More italian plural unit support (that will just say something, since I do not speak italian, don't know if it will be right) 2017-04-03 09:50:53 +02:00
3djc e7c882e826 Needed for #4742 2017-04-03 09:35:51 +02:00
3djc 7e8cec005b Fix #4742 2017-04-03 09:03:07 +02:00
Sebastien Charpentier e264a06670 Updated French translation. (#4740)
* Updated French translation.

* Fixed some mistakes.

* Updated kebyboard shortcut according @mpaperno comment.
2017-04-02 22:24:10 +02:00
Max Paperno 57dc0159d6 [Simulator] Asynchronous SimulatorInterface & a few new features. (#4738)
* [Simulator] Create RadioKeyWidget class for UI buttons & refactor ButtonsWidget; Refactor SimulatedUIWidget (and subtypes) to use new RadioKeyWidgets/ButtonsWidget; Centralize help text for key mappings and get creative with some icons; Simplify some radio UI setups with rectangular buttons.

* [Simulator] Convert all simulator data I/O to signals/slots mechanism:
    * SimulatorInterface/OpenTxSimulator:
       - Now inherits from QObject to allow signal/slot interface;
       - Allows data exchange on a per-item basis (eg. each I/O value is treated separately instead of sending whole arrays or structs of data);
       - Checks for data changes and only emits signals when change is detected (GUI can now assume only new values are being sent);
       - Manages its own 10ms timer (doesn't rely on GUI to do that);
       - Sends "heartbeat" signals @ 1Hz for status monitoring;
    * Simulator GUI:
       - All data is exchanged between GUI elements as well as SimulatorInterface via signals/slots using standardized methods;
       - Data is sent immediately, and only, when actually changed (eg. a control is moved) instead of in bulk at specific time intervals;
       - Similarly, an asynchronous method is used for reading incoming data, w/out timers or loops;
       - Improve VirtualJoystickWidget to be more encapsulated and configurable;
       - Pause telemetry simulator if window is hidden;

* [Simulator] Move SimulatorInterface instance to separate thread, ensure safe asynchronous operations & proper timer interactions; Protect/remove some functions, & reorganize the order (cosmetics).

* [Simulator] Traces are now delivered to OpenTxSimulator and one or more QIODevice(s) can be added as recipient(s); Add SimulatorInterface::getCapability() for compile-time settings; Remove reversed POT1/SLIDER1 mixer exception (Taranis) requirement for SIMU; Fix plus/minus key delay on wheel event w/out encoder.

* [Simulator] Add current knob/slider/trim input value in tool-tips (KnobWidget and SliderWidget).

* [Simulator] Fix trims widget internal value not properly updating, and remove trim influence on virtual joystick X/Y value display (closes #4671).

* [SimulatorInterface] Add handling of transmitter input voltage, including a rough conversion of volts to ADC value for different boards, and default battery volts lookup function; Clear analogs array before starting.

* [Simulator] Add SimulatorInterface::init() method to separate pre-startup tasks; Report actual trim range, not just extended on/off; Change how radio widget states are restored; VirtualJoystickWidget: Connect trim changes directly from simulator, connect joystick events directly, report stick mode directly instead of setting values/constraints externally.

* [Simulator] Calculate default Tx V input based on configured range in radio settings (or warning V+2 for radios which don't support a range).

* [Simulator] Add functional aux. trims for Horus (closes #4699).

* [Companion] Remove problematic QMessageLogContext from AppDebugMessageHandler::messageOutput().

* [Simulator] Prevent trim change via slider if disabled for flight mode (closes #4600).

* [OpenTxSimulator] Fixes for Qt < 5.4.

* [OpenTxSimulator] Fix slot name.
2017-04-02 12:17:37 +02:00
Max Paperno 36bb951314 [Companion] Radio profile/current firmware handling: (#4737)
* Fix possible confusion/data corruption when deleting radio profile (closes #4734, ref: #4686);
    * Add Delete Profile action to Radio Profiles menu (closes #4736) (but remove from from app prefs. panel);
    * Add confirmation prompt before deleting profile;
    * Open profile settings dialog when creating/copying a profile (closes #4735);
    * Make sure current (global) firmware flavor is properly updated when changing fw type/options in profile;
    * Append "-Copy" to name of copied profile;
    * Factor out Firmware global vars/functions in favor of static members.
2017-04-02 12:17:06 +02:00
Arne Schwabe 8d0db05e78 Copy useful links from 2.1 to 2.2 (#4732) 2017-04-02 12:16:12 +02:00
Max Paperno 8b61cd56bc [Simulator] Prevent two possible concurrency issues with FIFOBufferDevice/FilteredTextBuffer. 2017-04-01 20:50:13 -04:00
Max Paperno 5dabe53af4 Minor misc. fixes (#4729)
* [Simulator] Remove extraneous format value in microsTimer; Better way to delete SimulatorStartupDialog (in case no event loop starts).

* [Simulator] No helpers dependency for SimulatorStartupDialog.

* [simpgmspace] Rename micros timer function and make externally available.

* [Companion] Fix possible uninitialized value in TreeModel (compiler warning).

* [multi_arm] Fix minor compiler warning (MSVC: "unsafe mix of type 'uint8_t' and type 'bool' in operation").

* [lua] Fix compiler warning ("'data' may be used uninitialized in this function").

* [OpenTxSimulator] Fix analogs array range.

* [Simulator] Auto-start simulator when SimulatorMainWindow is first shown (vs. before it was shown).

* [Simulator] DebugOutput: prevent possible mutex deadlock on buffer overflow (force queued connection for Qt < 5.3).

* [Companion] Display calibration data for Horus joysticks (MOUSE1/MOUSE2)
2017-04-01 08:13:24 +02:00
Damjan Adamic 9c7c8244f4 Fixes #4715: model notes were read from the settings path, but should be read from SD card path (#4728) 2017-04-01 08:11:16 +02:00
3djc b22e45cf18 Companion : display warning on eeprom upgrade (#4724)
* Display warning on eeprom upgrade

* Use existing function
2017-04-01 08:10:46 +02:00
Damjan Adamic fa275793ad simpgmspace CoGetOSTime() was returning wrong values (too big) 2017-03-31 19:52:20 +02:00
Max Paperno 9d3960f0f5 [Simulator] TelemetrySimulator: Fix instance values not being populated with radio settings (also now reloads instance values with rest of radio data). (closes #4711) 2017-03-31 13:19:12 -04:00
Damjan Adamic 2aebcb842a Lua docs update: lcd.drawText() added link to fonts 2017-03-31 18:33:48 +02:00
3djc e2722509f7 Instead of copying current profile, start from a blank one (#4714)
* Instead of copying current profile, start from a blank one

* Handle both add profile (which add a new (ie blank) one) and copy current profile which behaves like before (but says it)

* Avoid duplicate code
2017-03-31 16:14:00 +02:00
3djc b17a6d470f Only allow saving to OTX format (#4727) 2017-03-31 16:13:36 +02:00
3djc d1cacc2f0f Use filename when no name is defined (#4726) 2017-03-31 16:12:43 +02:00
3djc 9ff1dab6b8 Hide non working serial2 for Horus 2017-03-31 10:06:34 +02:00
Max Paperno 369bac9950 [Companion] Improve handling of non-supported splash image (Horus) in radio profile settings page. (#4720) 2017-03-31 07:56:22 +02:00
Max Paperno 4c0dbfcb6c [Companion] Make simulator startup from ModelEdit panel act the same as simulating a model from the models list widget (that is, including the other radio data as well); Simplify some code, remove automatic signal connections and use new syntax. (#4721) 2017-03-31 07:55:25 +02:00
Arne Schwabe 965849ee41 Small progress on German translations (#4719) 2017-03-31 07:53:40 +02:00
3djc 89bfd6dcf4 Earlier is better 2017-03-30 08:43:50 +02:00
3djc 361b2b707f Do not recompile if firmware is already there
Always print filename on compile error so that the email handler can attach the error log
2017-03-30 08:15:58 +02:00
3djc 443d75c0ac Make default category translatable (with dev warning) (#4712) 2017-03-29 15:10:29 -04:00
Max Paperno 3eb39ddac2 [build] Add "all-libsimulators" target to build all simulator flavors at once. (#4710)
* [build] Add "all-libsimulators" target to build all simulator flavors at once.

* [build] Refine the "all simulators" target setup and deal with GNU 'make' parallelism issue (ninja=faster); rename to "all-simu-libs".
2017-03-29 15:46:48 +02:00
Max Paperno 6709c55fea [Simulator] Fix timing issues in all AVR simulators on Windows (MSVC) (#4709)
* [simpgmspace] Fix 2MHz and 16KHz timers on MSVC builds (fixes LCD/key/switch response delay on all AVR simulators); Introduce experimental use of Qt to simplify x-platform code (disabled by default).

* Qt timer scaling fix.
2017-03-29 15:44:51 +02:00
Arne Schwabe 10c6c9a1ec Add DM002 multipl protocol (#4716) 2017-03-29 15:43:16 +02:00
Andre Bernet 19e3fba836 [companion] Update all translation files 2017-03-28 11:16:07 +02:00
Andre Bernet 061297e9b5 Harmonize play delay across radios 2017-03-28 10:51:09 +02:00
Andre Bernet 02c7ef70ea Add headers to GVAR grid... (Re #4707) 2017-03-28 09:49:31 +02:00
3djc 19688ff924 Add warning for translators 2017-03-28 09:38:40 +02:00
Max Paperno c8be6d406d [Companion] Replace erroneously removed File menu items (closes #4708). 2017-03-27 23:03:12 -04:00
Bertrand Songis c9df941ee6 Conversion issues #4570 and #4264 2017-03-27 19:56:55 +02:00
Max Paperno f5ab145d2f [Companion] Show custom control names throughout the UI (& internal refactoring) (#4693)
* [Companion] Introduce new Boards class to further consolidate hardware metadata and remove some globals.

* [Companion] * RawSource::toString() and RawSwitch::toString() can now return custom hardware names (if given a GeneralSettings object) for the following types (respectively):
    SOURCE_TYPE_STICK, SOURCE_TYPE_SWITCH, SWITCH_TYPE_SWITCH, & SWITCH_TYPE_MULTIPOS_POT;
* RawSource::isPot() and isSlider() can now return their own index position in potConfig[]/sliderConfig[];
* Switch indicator strings can be localized if necessary.

* [Companion] Refactor model printers to use new RawSource/RawSwitch capabilities; Simplify model-to-printer mapping scheme in multimodelprinter; Use const ModelData pointer.

* [Companion] Refactor how RawSource and RawSwitch selection combo boxes are populated, using cache-able data models instead of direct manipulation; Refactor some other Helpers function into their own namespace.

* Cosmetics & forgotten qualifier.
2017-03-27 19:02:19 +02:00
3djc 627347a48c Horus as vario handling too (#4700) 2017-03-27 18:59:34 +02:00
Bertrand Songis 4086374249 Compilation fixes 2017-03-27 18:43:23 +02:00
Max Paperno aaaaf1a806 [simulation] Fix reported multi-position switch output being outside of normal range due to SIMU exception in mixer.cpp. 2017-03-27 01:31:59 -04:00
Bertrand Songis 6c28efdd4f Fixes #4695 2017-03-26 20:40:13 +02:00
Damjan Adamic 29018fae9c Keys code cleanup and documentation (#4692) 2017-03-26 20:11:06 +02:00
Thibault Jouan 36a6ba24b8 Add firmware update tools location for FreeBSD (#4688)
Add paths for avrdude and dfu-util programs under FreeBSD. SAM-BA does
not exist yet in the FreeBSD port collection.
2017-03-26 20:07:35 +02:00
Max Paperno 1d21309935 [Companion] Speed up loading of model editor (#4689)
* [Companion] Speed up loading of model editor by only displaying Logical Switches and Custom Functions which are actually used.

* [Companion[ Constrain size of Repeat options combo box.

* Missing indent.
2017-03-26 20:06:55 +02:00
3djc bed9f56b9d Fix non overlapping text (#4691) 2017-03-26 20:04:49 +02:00
Sebastien Charpentier fc5835a327 Added some tiny cosmetic changes in order to help user to make the link between Companion and the radio menu. (#4694) 2017-03-26 19:51:58 +02:00
Damjan Adamic 2bbb704c3e Fixed: AudioQueue::playTone() with 0 frequency caused radio reboot (divide by zero) 2017-03-26 19:16:08 +02:00
3djc 8c52e57c46 Eeprom upgrade checks tools 2017-03-26 13:28:12 +02:00
Damjan Adamic 5e55a3f5d3 Lua killEvents() docs update 2017-03-25 20:37:05 +01:00
mhotar 701125b0ca Images converted to plain SVG #4677 2017-03-25 15:11:29 +01:00
3djc 380024547a Merge pull request #4687 from opentx/LapinFou/FR_Translation
Updated French translation
2017-03-25 13:56:52 +01:00
LapinFou 259f76e1b5 Updated French translation. 2017-03-25 13:53:05 +01:00
LapinFou 0fa50df355 Update French transation. 2017-03-25 13:27:28 +01:00
Max Paperno dcdbff74b0 [Companion] Translation system improvements. (#4676)
* [Companion] I18N:
    * Introduce new Translations class to centralize all related functionality;
    * Add ability to search multiple locations for .qm translation binaries (local folders, resources, system paths);
    * Add ability to reload translations dynamically w/out application restart;
    * Improve support for loading Qt translations (if available);

* [build][i18n] Look for and include pre-built Qt translations with other translation resources; Generate translations.qrc dynamically with rest of build files;  Add EN "translation" file (simpler UI string edits and possible abstractions); Rename ZH translation file to be country-specific.

* [build] Centralize finding all the Qt bits into root CMakeLists; Make sure QT_QMAKE_EXECUTABLE is defined; Disable dysfunctional simulator installer script generation.

* Cosmetics (unused includes).

* [Companion] Make language options menu dynamic based on available translations, and always show native language name; Allow changing language of some elements w/out restarting (esp. menus/toolbar buttons); Simplify menus/actions/handlers for themes and icon sizes.

* [build] Better way to generate translations.qrc using input file again (previous method was generating new qrc for each reconfig);  Make sure common library is linked to other modules which may need it; Remove unused script.
2017-03-25 13:06:36 +01:00
Martin Hotar d5560d68f4 simuicons (#4677)
* simuicons

* exported as plainSVG

* restart icons

* some more of the -active ctates
2017-03-25 13:06:25 +01:00
3djc 98388a7ec8 Used rouding like arm radios (#4683) 2017-03-25 13:04:33 +01:00
Thibault Jouan 1f7dd5a5bc Improve companion CMake programs name condition (#4684)
* Refactor condition to avoid repeating the test in `else' and `endif';
* Suffix programs name with `${C9X_NAME_SUFFIX}' under FreeBSD, as for
  Linux build, else cmake build is failing because a `companion'
  directory already exist in the build directory.
2017-03-25 13:03:52 +01:00
Max Paperno 64e960adc5 [Simulator] Fix startup error in standalone mode when eeprom file does not exist (create file instead, as usual). 2017-03-24 03:40:31 -04:00
Max Paperno d82244adc0 [Companion] Allow translating some "missing" strings (fixes lupdate warning in multiprotocols.cpp). 2017-03-23 15:27:08 -04:00
Damjan Adamic 93f6abd81a Launchpad changelogs for 2.2.0 RC14 (and compilation fix for trusty) 2017-03-23 19:48:13 +01:00
Martin Hotar e1dac6e58e cz translations - radio part (#4675)
* cz translations

* cz translations
2017-03-23 18:22:32 +01:00
3djc 7de823f140 Only increment nightly index on successful processing 2017-03-23 12:17:09 +01:00
3djc 1856334e7e Still build firmware stamps even if .deb binary is already there 2017-03-23 10:36:06 +01:00
3djc a7050e4b51 Allow 'pre put' of 'exe' for release too 2017-03-23 10:20:19 +01:00
3djc 99f1965aa6 fix typo 2017-03-23 10:09:27 +01:00
3djc 3ddd809b2c Skip building if nightly item already there 2017-03-23 10:06:11 +01:00
3djc d586b7cd2b Allow neg value for telem comparison fonctions (#4667)
* Allow neg value for telem comparison fonctions

* Protect avr
2017-03-22 21:57:45 +01:00
Max Paperno d68778ec81 [Simulator] Virtual joystick tweaks. (#4666)
* [Simulator] Create a reusable RadioTrimWidget; Move all trim-related enums to boards.h; Make sure aux trims are accounted for in SimulatorInterface; Trims now use toolbuttons with icons instead of pushbuttons with text.

* [Simulator] New buttons & icons for virtual joystick axis hold/fix toggles; Joystick ball is now slightly scaled to stick area.

* [Simulator] Virtual joystick now "follows" mouse clicks within the stick area (left-click on empty space will attract the control node).
2017-03-22 21:05:27 +01:00
Max Paperno 919e8eb962 [build] Only build companion/simulator resources files once. (#4670)
* [build] Only build companion/simulator resources files once and include in common lib; Consolidate/cosmetics.

* [build] Fix "missing" translation resource files with some builds (since last commit); move resource file declarations to after app init as recommended; fix name of Qt translation file since v5.3 (this still only works on some systems with Qt installed and on the build machine).
2017-03-22 21:03:17 +01:00
Max Paperno 4faf323aed [Simulator] Fix and refactor Joystick configuration dialog and internal stick-to-radio axis mapping system. Stick was not always showing active in config. dialog, and mappings were sometimes wrong. (#4672) 2017-03-22 21:02:04 +01:00
Arne Schwabe 4f6931faab Fix typo in multi model name (H3 3D instead of H8 3D) 2017-03-22 15:55:37 +01:00
Max Paperno dc00757cd7 [Simulator] New skin for channel output indicators. (Fix #4638 ) (#4669) 2017-03-22 12:39:02 +01:00
Bertrand Songis 76f5d029a0 Warning when Multiply used on first mix of a channel, fix #4525 (#4647)
* Proposal to fix #4525

* Clearer text

* Companion side

* Translation not needed
2017-03-22 11:39:09 +01:00
Bertrand Songis 618345a2ef Fixes #4589 (#4644)
Produces a segfault with the telenowa script (missing bitmap)
2017-03-22 09:41:07 +01:00
Andre Bernet 12d231443c Output reset wasn't saved (Fix #4662)
Remove dead code
2017-03-22 08:38:23 +01:00
Bertrand Songis b81c483be3 Fixes #3795 (#4643)
Multiple bugs found
2017-03-21 20:11:48 +01:00
Bertrand Songis e0022ac287 Bitmaps with a too big filename were displayed in the selection popup (#4646) 2017-03-21 19:49:58 +01:00
Max Paperno e48b1fd07d {Companion] Unload simulator libraries after each use -- reset all statically initialized firmware variables. (#4655)
* [simulatormainwindow] Move sub-window destructors to main destructor.

* [simulation] Move SimulatorInterface creation/ownership to SimulatorMainWindow.

* [simulation] Add option to unload simulator libraries after each use (eg. from Companion) so as to properly reset all statically initialized firmware variables; Introduce new SimulatorLoader class.
2017-03-21 19:48:25 +01:00
Damjan Adamic dc89d2d630 Projectkk2glider/performance tests (#4658)
* Transparency and fonts gtests added (Horus)

* Added to CLI: Graphics performance test, memory speed test (Horus)

* Gtests fixes
2017-03-21 19:47:41 +01:00
Arne Schwabe fc376b3603 Define multi subtype strings in the same way as all other strings (#4656) 2017-03-21 19:40:08 +01:00
3djc f953087311 Merge pull request #4657 from opentx/LapinFou/FR_Translation
French Translation
2017-03-21 14:37:45 +01:00
LapinFou facbfc7cf8 Small typo. 2017-03-21 13:47:55 +01:00
LapinFou cfcc120183 Intermediate version. 2017-03-21 13:47:14 +01:00
3djc c16256bb8a Fix 4652 (#4653) 2017-03-21 10:06:01 +01:00
Bertrand Songis 91a042200b Fixes #4619 (#4645) 2017-03-21 07:45:05 +01:00
Max Paperno 4aa0c1bbe4 [simulation] Fix some potential crashes & 26 memory leaks, improve LCD redraws. (#4634)
* [simulation] Hardening: Fix some potential crashes & 26 memory leaks, improve LCD performance.
  * [simpgmspace] Init trims; Make sure `REa` is really defined (to match board files).
  * [simpgmspace][opentxsimulator] Verify current running state before start/stop; Move rotary enc. init.
  * [simpgmspace][LcdWidget] Improve performance by moving LCD content change check to lcdRefresh() & limiting LcdWidget refresh time to 60 fps max.
  * [simueeprom] Ensure thread could be started, set default running state to false.
  * [simufatfs] Fix paths report trace.
  * [eepromimportexport] Fix memory leaks resulting from import debugging scheme being used.
  * [customdebug] Introduce new scheme for custom debug output in compliance with Qt recommendations (see docs for QLoggingCategory).
  * [opentxeeprom] Fix extra conversion table cache elements being created and also not properly deleted (and hence leaking).
  * [opentxinterface] Unregister EEpromInterfaces in unregisterOpenTxFirmwares();
  * [storage] Unregister storage factories on exit (fixes leak); create virtual StorageFormat/StorageFactory destructors (prevents warnings).
  * [helpers] GVarGroup now emits own signal, no need to pass ModelPanel pointer (removes dependency on modeledit.h)
  * [DebugOutput] Clear simulator trace hook before exiting (prevent possible issues); Fix leak and possible bad QString allocations when reading from buffer; Fix leak with combo box event filter.
  * [TelemetrySimulator] Fix leak by deleting LogPlaybackController object on exit; Only set up data fields once; convert timers to static.
  * [build] Consolidate all Companion/Simulator shared items in `common` library to reduce build time/etc (node & edge still remain awkward).

* [simulatorwidget] Delete removed spacer object (previously-forgotten "26th" leak).

* [DebugOutput] Fix stray trailing characters issue with new text buffer allocation (from previous commit); Increase maximum buffer sizes to better accommodate slower systems.

* Cosmetics.
2017-03-21 07:43:40 +01:00
3djc 52e65179a8 Tools for 2.2 release handling (#4649)
* Scripts

* No suffix for docker image

* generate sdcard file to subdirectories to match companion changes

* Massively increase options for simus
backup lua_fields info for lua docs

* Allow both nightly and release to be built

* $ ambiguity

* Cleanup

* Tidy up

* Cosmetics
2017-03-21 07:43:13 +01:00
Damjan Adamic 8375304d61 Several fixes for Lua Widgets and Themes options (#4648) 2017-03-21 07:42:00 +01:00
Damjan Adamic 1f1098e270 Lua getValue() docs updated (fixed source links for 2.2 added) 2017-03-20 17:51:02 +01:00
LapinFou 8ae0bb88fa @3djc send me the new French .ts file. 2017-03-20 16:47:53 +01:00
Andre Bernet b8e0f26a22 Cosmetics 2017-03-20 10:31:39 +01:00
Andre Bernet 22217e8e22 [companion] Replace voice download by SD download, new URL for 2.2 (sd-22.open-tx.org, needs to be created) 2017-03-20 10:24:43 +01:00
Damjan Adamic fab3b96815 Compilation fix for gcc 6.2.0 2017-03-19 22:30:40 +01:00
Damjan Adamic 4ecc41229a Launchpad changelogs for 2.2.0 RC13 2017-03-19 20:51:06 +01:00
Max Paperno 1973eaf67c [Simulator] Improve CoGetOSTime() for MSVC. (#4635)
* [Simulator] Increase resolution of CoGetOSTime() on Windows MSVC (possible fix for #4529, ref. #4342).

* Return total time, not delta time.

* Improve efficiency.
2017-03-19 20:07:30 +01:00
3djc eba95dd227 Allow HAPTIC to be defined for avr too (#4633) 2017-03-19 20:06:31 +01:00
3djc 6807a08a7e It is usually better to not deleted a file before needing to copy it ! 2017-03-19 17:33:43 +01:00
Andre Bernet b01de7797c Remove dangling empty file after download error 2017-03-19 17:22:15 +01:00
Andre Bernet 87ef351b03 Multi missing in FW build script for arsky9xrpro... 2017-03-19 17:05:37 +01:00
Andre Bernet 91b4ff60c6 Multi can now be exported to all ARM boards 2017-03-19 16:47:40 +01:00
Andre Bernet ab737c05f3 Remove templates in build script too 2017-03-19 16:31:15 +01:00
Andre Bernet 0362ddbc94 No more templates on ARM (since they all support virtual inputs now) 2017-03-19 16:18:48 +01:00
3djc b443d4b60e Prep for nightly 2017-03-19 08:42:20 +01:00
Andre Bernet 7628866def Register .otx files on Win 2017-03-18 23:59:57 +01:00
Bertrand Songis 87685cf84c Fixes #4631 - Same problem was happening on ATTITUDE (16bits signed value)
Tested by @sirPerma
2017-03-18 11:00:39 +01:00
Bertrand Songis 99472b4fb3 Fixes #4631
Tested by @sirPerma
2017-03-18 10:30:55 +01:00
Franck Aguerre 49d1aafc1b Jivarofad/m2560 update (#4593)
* New drivers : buzzer/speaker, voice wtv20 / jq6500 , i2c

First commit, testings to be done

* Voice correction

* Better way to drive voice modules

Same thing as LCD drivers

* Issue #2337 (error mismatch) solved

* Font correction

* Fonts correction again

* oups...

* Voice modules (Companion) & flash saving (ST7920)

* Documentation update

* I2C driver correction

* Mega2560 directory renamed to mega2560

* M2560 driver correction

* Voice directory correction

* Voice=ON does not works with MEGA2560 (OFF/WTV20/JQ6500)

* Compliant to cmake documentation

* On M2560, audioAVR use playnumber et playduration declared in voice.h
Don't know why, must be discuted...

* ‘{’ token forgotten

* Simplier way for AVR voice
2017-03-18 09:44:47 +01:00
3djc 225ca3160e Merge pull request #4630 from craftandtheory/horiz_vert_drawline
LUA horizontal and vertical lcd.drawLine(...) fix
2017-03-17 16:41:32 +01:00
Florent Martel 47f029f01c LUA horizontal and vertical lcd.drawLine(...) fix
Fixes #4608
2017-03-17 10:04:36 -05:00
3djc b18ae12e08 Make smlsize font '.' a single dot and remove corresponding X9 code (#4626) 2017-03-16 18:50:02 +01:00
3djc 8a84c215a9 Fix #4582 (#4623) 2017-03-15 18:52:43 +01:00
Bertrand Songis 04d506b1e4 Fixes #4587 2017-03-15 17:45:55 +01:00
3djc df8ef1074f Fix #4603 (#4605)
* Fix #4603

* Don't break 9XR-PRO !

* Fix

* I should stop drinking
2017-03-15 08:57:28 +01:00
Damjan Adamic b965cac481 Projectkk2glider/issue 4099 leaks (#4617)
* Re #4099: memory leaks on model select screen fixed [Horus]

* Re #4099: memory leak in wizard background image [Horus]
2017-03-14 20:09:53 +01:00
3djc 0020941740 Re-organize nightly sequence (#4597)
* Re-organize nightly sequence

* Remove ambiguity around vars
2017-03-14 18:27:47 +01:00
3djc 7cb3d27174 Filter out hidden and system files (#4609) 2017-03-14 18:26:04 +01:00
Sebastien Charpentier 13cf25e829 French translation for the new simulator (#4602)
* update fr translations file for LapinFou

* Intermediate version.

* Intermediate version.

* Updated most of the new stuff.
Remaining: new simulator windows.

* 1st final version based on OTX 2.2.RC11
2017-03-14 18:25:40 +01:00
3djc c5a09270a6 Update tts_fr.py 2017-03-14 17:17:20 +01:00
Max Paperno 2fb92e3d23 [Companion] Fix missing curve image(s) in model printer (fixes #4612). 2017-03-14 11:25:53 -04:00
Arne Schwabe 3de35e5b60 [AR9X/9XPRO] Fix multi module not selectable for not Frsky radios (fix #4607) 2017-03-14 11:36:47 +01:00
3djc 457b271c86 Fine tune 6 pos dispay on main view (#4610)
* Fine tune 6 pos dispay on main view

* Fine tune after real radio tests
2017-03-14 11:33:19 +01:00
Andre Bernet 8921f5528b +/- sources of unnamed telemetry sensors were visible (fix #4586) 2017-03-14 11:22:58 +01:00
Damjan Adamic ac2a424353 Lua docs update: lcd.clear() 2017-03-13 20:21:53 +01:00
Damjan Adamic 7aae618ff8 Lua docs fix: playNumber() units table correction 2017-03-13 20:16:58 +01:00
Damjan Adamic 97734f2d9a Fixed a leak in Companion import: name can't be const char, it must store the string locally because some classes construct name dynamically. 2017-03-13 18:28:05 +01:00
Damjan Adamic c05ea013f6 OpenTX 2.2.0 RC12 Launchpad files 2017-03-13 18:26:12 +01:00
3djc aaad391a4a Update build-nightly.sh
Force some docker operations
2017-03-13 10:07:53 +01:00
3djc 67ee51b976 Fix #459 2017-03-13 07:05:43 +01:00
joaquins 59f8ee3283 Fix #4590 (horus->x12s rename) (#4591) 2017-03-12 10:02:17 +01:00
Max Paperno f103c8851f [Simulator] Improve middle mouse button handling over radio navigation key areas: clicks were ignored, now either activates the current key under mouse, if any, or triggers default middle-mouse action (enter/menu/rotary press). (closes #4585) 2017-03-11 20:11:45 -05:00
3djc 2144bb77e3 Remove mixermon option (make it always true) (#4573)
* Remove mixermon option (make it always true)

* Cosmetics

* Compile fix
2017-03-11 10:26:05 +01:00
3djc d04193e62d 3djc/x7 swcheck improve (#4579)
* Switch more like x9

* Fix

* The shift is only for x7

* Add pots check and compil fixes

* Fix SF cannot be disabled

* Various fixes
2017-03-11 10:25:01 +01:00
3djc 1cc59f4298 X7 review telem bars screen (#4580)
* SMLSIZE version

* Leave existing code untouched for non arm

* Fine tune rect

* bars title in SMLSIZE and v centered
2017-03-11 10:23:52 +01:00
3djc a0b3c46c2b LUA drawline fix (#4581) 2017-03-11 10:23:06 +01:00
Max Paperno 0a5732b953 [Simulator] Fix Radio Outputs window not updating GVars/flight mode when re-launched from Companion or restarting radio in Simulator. 2017-03-10 22:06:02 -05:00
Andre Bernet c6ba263572 [companion] No GVAR popups on Horus 2017-03-10 19:46:47 +01:00
Arne Schwabe 4c42769104 cosmetics (remove ifdef indentation for HORUSSTICKS) 2017-03-10 13:05:50 +01:00
3djc 2868c079e6 Update tts_en.py 2017-03-10 13:00:59 +01:00
Arne Schwabe 2c80679eb9 Also define ana_mppings if horus sticks are used (closes #4565) (#4566) 2017-03-08 22:05:09 +01:00
Bertrand Songis 0c37e04bfc Fixes #4478 (#4577) 2017-03-08 22:03:53 +01:00
Damjan Adamic 03b65b06b6 Projectkk2glider/issue 4479 slow joystick (#4569)
* Missing debug timer

* USB driver cleanup

* Re #4479: Joystick update called from mixer thread every 10ms

* Cosmetics

* Compilation fix

* Cosmetics

* Another compilation fix
2017-03-07 22:59:32 +01:00
3djc 15a373c1cd Casting fix (#4572) 2017-03-07 20:47:41 +01:00
Arne Schwabe 1dd30598fd Also add QT5Svg_plugins bundle as QT_GUI includes all image formats but not sag 2017-03-07 12:40:38 +01:00
Damjan Adamic acfeb7b47a Closes #4560: Lua uses double (again) for numbers. The float usage was not good for bit32 library where only ~24bits (out of 32) were correct, others were lost. This is supposed to be a temporary solution. 2017-03-06 18:21:41 +01:00
Max Paperno 6c493fddd9 [Companion][Simulator] Misc. minor fixes:
Fix Qt < 5.3 compat. issue in DebugOutput;
  AppDebugMessageHandler: Filter out verbose QPainter warnings on Linux Qt < 5.3; Do not return any instance if disabled entirely;
  Fix style sheet for simulator radio background.
2017-03-06 06:28:33 -05:00
Damjan Adamic 0e906162e1 Added files and scripts to enable Launchpad.net package building 2017-03-05 21:11:22 +01:00
alteman d9c95f97d7 Add support for PX4 RSSI (#4559) 2017-03-05 17:41:15 +01:00
alteman cd6eef2cfa Replace thirdparty/GCS_MAVLink with a git submodule (#4556)
* Replace thirdparty/GCS_MAVLink with a git submodule

* Try to recover from missing submodules
2017-03-05 13:04:52 +01:00
Andre Bernet 2af7751caa [companion] Missing options for sky9x family 2017-03-05 12:39:43 +01:00
Andre Bernet c3febf3560 [companion] Default category on new file was added at the wrong place and also created when reading form radio 2017-03-05 10:37:18 +01:00
alteman b4059849e2 Update third party mavlink header files to git revision 8e864d2 (#4552)
* Update mavlink protocol definitions to mavlink GIT revision 8e864d2

* Change struct initializers due to updated mavlink proto headers
2017-03-05 08:50:28 +01:00
Max Paperno 45cfcd67ff [simu][horus] Replace 2nd knob/pot with functional 6-pos switch (must be calibrated). (#4554) 2017-03-05 08:48:10 +01:00
Max Paperno c1da4b9b4f [Companion][MdiChild] Add model context-menu actions for moving a model between categories (only if > 1 category exists). (#4555)
(ref. #4224 : Horus models cannot be moved from one category to another)
2017-03-05 08:47:10 +01:00
Max Paperno 2540e166b0 [Companion][Horus] Add joystick axes (JSx & JSy) and trims T5 & T6 as usable sources. (#4550)
* [Companion][Horus] Add joystick axes (JSx & JSy) to sources list (fixes #4336).

* [Companion][Horus] Add aux trims T5 & T6 and associated switches to respective selector lists. Rename "Joysticks" enum to "MouseAnalogs".
2017-03-05 08:46:27 +01:00
Andre Bernet d911d382f2 [companion] X7 only has 6 chars for sound file names 2017-03-05 08:42:07 +01:00
Andre Bernet 86fbb071da [companion] Horus models didn't get their defaults set (thanks @Max) 2017-03-05 08:40:16 +01:00
Max Paperno 51cad78030 [Companion][Multiprotocol] Fix exception when selecting DIY Multiprotocol Module in model editor.
Cosmetics.
2017-03-04 17:01:54 -05:00
Andre Bernet 8e3f86383c [companion] Add first category automatically when creating a new Horus file 2017-03-04 22:56:21 +01:00
Andre Bernet 8bced60784 [companion] Horus splash replacement currently unavailable 2017-03-04 22:12:09 +01:00
Max Paperno 2778040497 [Simulator] Fix 6-position switch operation (only last 3 pos. were usable and were reported incorrectly). NOTE that for these switches calibration IS important (either from actual radio settings or done in standalone Simulator/simu). 2017-03-04 15:03:08 -05:00
Max Paperno 8563ed8eac [lua-api] Prettify loadScript() API docs. [ci skip] 2017-03-04 04:25:06 -05:00
3djc 80b44444ec Fix lcdLastPos (#4487)
* Fix lcdLastPos
Introduce lcdLeftPos

* Cosmetics

* Cosmetics

* Non ARM code cleanup

* Move telem screen to midsize

* Fine tune

* Renaming
2017-03-04 10:16:45 +01:00
alteman 4a2bbc665c Update thirdparty/GCS_MAVLink sync script to work with updated mavlink repo (#4548) 2017-03-04 10:16:21 +01:00
Bertrand Songis 6f0e58351a [Horus] Fixes #4407 (#4543)
* [Horus] Fixes #4407

* Tab replace by spaces
2017-03-04 10:15:06 +01:00
Bertrand Songis 481df9ee3d [Horus] Fixes #3775 (#4544)
* [Horus] Fixes #3775

Quick fix ... comments welcome :)

* Better hash function for strings

* One comment, one!

* One comment, one!
2017-03-04 10:14:38 +01:00
3djc 883ab9a937 Reduce colon size in DBL font (#4540) 2017-03-02 23:27:51 +01:00
Bertrand Songis bfb6e855e0 [Companion] Compilation fix on ArchLinux
Dones as adviced here:
https://bugs.archlinux.org/task/52956
2017-03-02 21:49:49 +01:00
Bertrand Songis d724ec1128 Fixes #4136 - Reset all logical switch fields on change of function type - By @elecpower 2017-03-02 20:24:01 +01:00
Arne Schwabe 40dae8a8a7 [MULTI] Implement option Value adjustment in Companion (#4459)
* [MULTI] Implement option Value adjustment in Companion

Also refactor ui code to use the same multi table as the radio to make updates easier and consistent

* Fix warnings with gcc 6

* Make the whole thing more C++ like

Using QVector instead of std::vector gives me strange errors.

* Fix gcc warning

* another signedness fix

* Add missing include

* Add Gw008 protocol and move subtype definitions out of the translations

* Add note about struct

* More cleanups

Integrate @mpaperno’s latest ideas about cleaning up
2017-03-02 18:40:31 +01:00
Max Paperno 00b2799427 [Companion][Simulator] Add custom qDebug message handler/formatter (#4475)
* [Companion][Simulator] Add custom qDebug message handler/formatter as an option. Keeps support for QT_MESSAGE_PATTERN env. var.

* [Simulator] Show system messages of level qInfo and above in debug console.

* [Simulator] Still capture screenshot to clipboard if path is not accessible (and screenshot results now print to simulator debug console).

* Fix for older CMake.

* [Companion] Do not start debug message handler if app is shutting down, and add null checks before using it; Increase backtrace report depth; Add OTx headers; Add Companion exit status debug; Clean up unused code.

* [Simulator] Add asynchronous FIFO buffer for handling debug output/display more efficiently. (#4488)
(cherry-picked from b12bd7d7be)
2017-03-02 18:35:00 +01:00
Nathan 620094e358 remove src/radio/stamp.h from the gitignore list to make it make cmake idempotent (#4530) 2017-03-02 18:33:29 +01:00
3djc c9555e510c Allow datestamp for ARM 128x64 model backups (#4534)
* Allow datestamp for x7 model backups

* Add ability to restore too

* Make this all 128x64 instead of x7 only
2017-03-02 18:32:24 +01:00
3djc b800642090 Add popup menu to Play value SF on X7 (#4535) 2017-03-02 18:30:37 +01:00
3djc f1b83e7295 Remove Heli choice from model wiz as we do not have one (#4538) 2017-03-02 18:29:36 +01:00
alteman 26259f398d Fix a regression that omitted filenames from allsrc.cpp (#4531) 2017-03-02 18:28:10 +01:00
Max Paperno d8b4f8594d [Companion] Smarter app settings import from old versions... (#4485)
* [Companion] Smarter app settings import from old versions; Do not import flash tool locations on Windows which are already included with Companion (closes #4330).

* [Companion] Exclude Windows installation-specific keys when importing settings from previous versions (truly fixes #2645).
2017-02-28 17:48:52 +01:00
3djc 865e04c9ec Fix binaries names 2017-02-28 09:42:04 +01:00
Jim Taylor b75fa3b06f Change text "not" to ! to fix VS15 Build Issue_4522 (#4523)
* Change text "not" to ! to fix VS15 Build (closes #4522)
* Change !cb_fp[i]->checkState() to !cb_fp[i]->isChecked() per comments in PR
2017-02-27 18:14:32 -05:00
Bertrand Songis 9f3898ae1e [9XR-PRO] Navigation issue in FlightModeOne screen 2017-02-27 14:04:44 +01:00
3djc 4d847e6943 Fix FM screen on X7 (#4515)
* Fix 4513

* Fix 9XR-PRO (hopefully)
2017-02-27 13:51:19 +01:00
Bertrand Songis 7bc557b4eb Trainer code simplification (#4519) 2017-02-27 13:50:03 +01:00
Bertrand Songis 89e1dfeeff [Warnings] Removed sRGB warnings raised by libpng 2017-02-27 13:49:35 +01:00
Bertrand Songis 99b01d396c [Sky9x] skipHiddenLines broken on 128x64 LCD 2017-02-27 13:46:37 +01:00
Bertrand Songis 029e12860a Cosmetics 2017-02-27 13:43:54 +01:00
Damjan Adamic d7801f4a06 Lcd gtests added for Horus 2017-02-26 20:33:43 +01:00
Damjan Adamic cc36f189f2 Re #4502: Removed cache in Lua rotable search, tests have proven it does not speed up search significantly. Scripts that use some function a lot can use simple local variable to store pointer to the function - simpler and faster that cache. 2017-02-26 18:12:37 +01:00
Damjan Adamic ca6a31016a Re #4498: Comment removed 2017-02-26 17:57:39 +01:00
Max Paperno 171e08c2fd [Companion][ModelEdit] Fix/improve module custom failsafe value settings (fixes #4443): (#4492)
* Properly set limits based on model's Extended Limits setting;
    * Fix rounding issues between percentile display and underlying value in μs;
    * Add ability to display values in μs as well as percent.
    * Channels numbering & count is responsive to module's defined start/end channels.
2017-02-26 13:00:49 +01:00
Damjan Adamic a1a58ad8f8 Lua: All usage of double converted to float (#4502)
* Lua: All usage of double converted to float. printf("%f") still uses promotion to double, (floating point va_args are always promoted to double)
Speed improvements:
 * reordering of rotable to put most used tables at the top
 * caching of last found global table
Use real pointer to rotable instead of misusing void* to pass integer value
Lua internal traces now turned on by TRACE_LUA_INTERNALS cmake option

* Replaced floating point division with multiplication (where possible), the hardware FPU is much faster at multiplication vs division.
stb_image: enabled STBI_NO_HDR and STBI_NO_LINEAR (removes code that we don't need)
2017-02-26 12:59:39 +01:00
Neil Horne 3b149a22d1 Inputs and Mixes dialogs - add flight modes context menu to set, clear and invert all modes (#4494) 2017-02-26 12:51:06 +01:00
Damjan Adamic 455fc1f79f Proper skipping of hidden menu lines, old code accessed mstate_tab[] out of bounds (#4491) 2017-02-26 12:43:06 +01:00
Damjan Adamic 7081f924de Some memory leaks and out of bounds array access fixed (#4498) 2017-02-26 12:39:26 +01:00
3djc 1910af51b6 Make lcd.clear() color aware on color screens (#4504)
* Make lcd.clear() color aware on color screens

* Compilation fix
2017-02-26 11:46:23 +01:00
Andre Bernet 86d897b23f [Horus] Restore emergency mode priority over "no SD card" warning 2017-02-23 23:20:16 +01:00
Andre Bernet b866baae65 [Horus] Restore emergency mode priority over "no SD card" warning 2017-02-23 23:04:09 +01:00
3djc 0857e27665 Merge pull request #4497 from opentx/3djc/x7-trainer-fix
X7 fix
2017-02-22 23:40:25 +01:00
Damjan Adamic 2c99de86d0 RTC Year fix for simulators 2017-02-22 16:26:21 +01:00
3djc f3e951e0fb X7 fix 2017-02-22 15:19:17 +01:00
Max Paperno 051a4638f3 [radio] Improve TRACE macro. (#4484) 2017-02-21 11:05:54 +01:00
Max Paperno b12bd7d7be [Simulator] Add asynchronous FIFO buffer for handling debug output/display more efficiently. (#4488) 2017-02-21 11:04:53 +01:00
Bertrand Songis 24c0f5008d [X7] S.PORT devices update is now done on the bottom connector (#4457)
* [X7] S.PORT devices update is now done on the bottom connector

* [X7] I introduce a PCBREV option, as previous versions didn't have this S.PORT bottom connector

* [X7] Introduce a PCBREV PIN to avoid having different 2 different firmware on X7

* Compilation fix

* [X7] PCBREV PIN was inverted

* [X7] PULL DOWN on PCBREV PIN

* S.PORT bottom connector is powered by PB.02, not PB.01

* [X7] PCBREV resistor changed

* [X7] PCBREV resistor changed
2017-02-21 11:03:37 +01:00
Damjan Adamic 2fbd1d8955 Re #4477: All usage (except Lua) of double converted to float. printf("%f") still uses promotion to double, (floating point va_args are always promoted to double) (#4483) 2017-02-21 11:02:26 +01:00
Damjan Adamic f36d01d560 Fixes #4438: wrong cast used when setting Lua mixer script input source (#4470)
* Fixes #4438: wrong cast used when setting Lua mixer script input source
Improved parsing of Lua mixer script inputs

* Additional type check

* ScriptDataInput union introduced.
Fixed: when using SOURCE input, do not use default value
Fixed: when using SOURCE input, min-max range is fixed
2017-02-21 10:59:47 +01:00
Max Paperno 177acb95e5 [212x64] Fix channels display view with PPM_UNIT_PERCENT_PREC1. 2017-02-20 12:14:17 -05:00
Max Paperno bb8dd1294f [480x272] Fix extra channel showing up in custom failsafe settings menu. (closes #4486) 2017-02-20 03:41:40 -05:00
Max Paperno a19748dba7 [Companion] Fix model being moved to wrong category after wizard run (closes #4482) 2017-02-19 18:38:15 -05:00
Max Paperno ac9b781647 [build] Minor fixes for Windows and OS X. 2017-02-19 17:20:10 -05:00
3djc 95668a2bcf Fixes #4345: Enable print (even for model idx 0) (#4474) 2017-02-19 09:33:37 +01:00
3djc e4c3326c0a isExtensionMatching is case insensitive, but not further checks, making those whole function case sensitive, which it should not 2017-02-18 11:00:13 +01:00
Damjan Adamic 299c5924fa Projectkk2glider/hardware floating point (#4477)
* Turn on compiler hardware floating point support for F4 targets

* Fixes, works on Horus

* Comment updated
2017-02-18 00:52:52 +01:00
Bertrand Songis 3e84e7930c Bsongis/9x fixes (#4463)
[9x] Fixes + make firmware target added
2017-02-17 17:11:38 +01:00
Arne Schwabe 6106d1b228 Fix warnings with avr-gcc 6.2 (#4471) 2017-02-17 17:00:39 +01:00
Max Paperno 357ffd0b92 [Simulator] Debug console output listener now starts immediately upon creation; Fix debug console not printing last line in buffer; Shorten debug output print time by 2ms; Don't check buffer if not appending line; Report buffer overflow errors every 30s (if still needed). 2017-02-17 04:24:17 -05:00
Bertrand Songis 25ea90817a Added Coverity badge
Crossing the fingers :)
2017-02-16 13:58:37 +01:00
Damjan Adamic 0e97d30363 DebugOutput buffer increased and overflow message only printed once. 2017-02-16 10:22:01 +01:00
3djc aecd7d15f1 Fix companion wizard behavior for Horus (#4467)
* Fix wizard behavior for Horus (was treated like an 9X)

* Cosmetics
2017-02-16 09:19:34 +01:00
Damjan Adamic ee43d3fb97 Projectkk2glider/issue 4449 drawline (#4464)
* Gtest pattern changed

* Fixes #4449: lcdDrawLine_line() was wrong for slanted lines [128x64]

* Fixes #4449: lcdDrawLine_line() was wrong for slanted lines [480x272]

* lcdDrawLine() coordinates check moved to Lua API
2017-02-16 00:23:42 +01:00
Bertrand Songis 53f55f8e1d Fixes #4399: problem getting/setting curve on output with Lua (#4455) 2017-02-15 21:25:08 +01:00
Bertrand Songis 27b1255584 [X9D/X9D+/X9E] Fixes #4334 (#4451) 2017-02-15 18:25:26 +01:00
Bertrand Songis 733cfb3218 Fixes #3865 (#4456) 2017-02-15 18:18:08 +01:00
Andre Bernet fe49fb5442 Multiprotocol working on sky9x and co (#4409)
* MULTI working on sky9x

* Fix crash with module OFF

* Cosmetics

* Compilation fix / cosmetics

* Typo....

* Multi now available on all ARM platforms

* Does this help?

* Compilation fix
2017-02-15 17:31:38 +01:00
hrenz e8b04cdee6 Updated german translations (#4390)
* Update de.h.txt

shorten some texts for Q X7 Display

* Update de.h.txt

shorten some texts for Q X7 Display

* Update de.h.txt

shorten some Texts for Q X7 display

* shorten some Text for  Q X7 display

* Shorten some texts for QX7
2017-02-15 16:55:40 +01:00
Bertrand Songis d44848022c In addition to #4454 2017-02-15 16:40:18 +01:00
3djc b5798e219d Menu updates handling cat/models for Horus (#4452)
* Alt+S is properly set

* Copy menu fixed

* Cosmetics

* Better handling of model and categories signaling

* Cosmetics

* Cosmetics and handling of special case after model or cat creation

* Remove unused viableModelSelected

* Take 2

* Start work on connect to new standards
2017-02-15 16:28:39 +01:00
Max Paperno 7762bac360 [firmware][gui] Extended limits fixes, issue #4447 (#4453)
* [firmware][gui] Adjust custom failsafe (and some channel display) ranges for proper extended limits (fixes #4447).  This also fixes some display issues in *x64 GUIs when adjusting failsafe settings and cleans up code in those functions.

* [firmware][gui] Fix 480x272 channel output progress bars to show full extended limits; Fix alignment issues on all 212x & 480x gui mixes screens with custom channel names; Streamline some channel outputs display code.

* Fix AVR build.
2017-02-15 16:25:40 +01:00
Arne Schwabe fb49d1197d Use gawk if available, fixes running on OS X if gawk is installed (#4460) 2017-02-15 16:14:58 +01:00
3djc 03125ccad6 Fix X7 sd logs (#4462)
* X7 has only 6 switches
2017-02-15 14:27:23 +01:00
3djc f2841bf904 X7 add copy/paste/.. long press menu to global func and custom funcs (#4454)
* Custom functions

* Enable long push for Global functions too

* Cleanup commented code

* Compilation fix
2017-02-14 20:59:27 +01:00
Bertrand Songis 777707db43 Fix telemetry protocol switching on Horus (Fix #4404) (#4450)
* Cosmetics

* Fixes #4404

* [9XR-PRO] Telemetry bug

* DMA apparently doesn't like being reinitialized before a deinit
2017-02-14 09:43:36 +01:00
Andre Bernet 5fc685d598 Crudely fix switch shift for X7 in hardware tab 2017-02-13 09:52:45 +01:00
Andre Bernet a87afcecdb Naming consistency (Fix #4437) 2017-02-13 09:43:18 +01:00
Bertrand Songis 4170acba79 [X12S] No additional duration for the splash (#4448) 2017-02-13 09:10:49 +01:00
Max Paperno 9e268eba89 [128x64] Fix switch diagnostics display on 9X family. (#4176) 2017-02-12 23:10:19 +01:00
Bertrand Songis 8cb46f2425 [SKY9X / 9XR-PRO] A couple of UI bugfixes 2017-02-12 22:58:24 +01:00
Bertrand Songis 85bdca8d44 Remaining trace removed 2017-02-12 22:26:09 +01:00
Bertrand Songis 5d2220c842 [SKY9X/9XR-PRO] Shift in Switches display 2017-02-12 22:22:58 +01:00
Max Paperno d90b1e0640 [Simulator] Fix crash if error happens at startup before timer was created. 2017-02-12 16:01:43 -05:00
Max Paperno 586567927a [Companion] Prevent error when trying to simulate a model right after wizard run. 2017-02-12 16:01:43 -05:00
Bertrand Songis b96ad42f20 [Simu] Simu did shutdown on its own 2017-02-12 21:46:57 +01:00
Bertrand Songis b9bb831b7f Bsongis/horus flash external device (#4446)
* CMake options changed to UNEXPECTED_SHUTDOWN=YES/NO and  PWR_BUTTON=PRESS/SWITCH

* [X12S / X10] Flash an external device is now OK
2017-02-12 21:04:46 +01:00
Bertrand Songis 808d7749c7 Travis builds failure (missing force-yes) 2017-02-12 20:58:46 +01:00
Max Paperno d5476af719 [build][Windows] Fix date parsing regex for varying locales. 2017-02-12 06:53:22 -05:00
Bertrand Songis 5e63bbcd83 [X12S] Cosmetics 2017-02-12 11:42:00 +01:00
3djc 0af868a852 Reduce HORUS modelset left top icon width by 5 pixels to avoid selected model box to 'hit' it.
SD Version INCREMENTED
2017-02-12 10:26:18 +01:00
Bertrand Songis bd954478c6 [X12S] AUDIO is back 2017-02-11 23:35:47 +01:00
Max Paperno 3542c8b807 Make build setup a little more Windows-friendly (#4435)
* [build][CMake] Use `find_package(Git)` to confirm existence before trying to use git for version stamp; Use friendlier detection of grep executable on Windows; Use "del" on Windows instead of "rm".

* [build][Windows] Include dirent and msinttypes headers in source tree.

* Remove grep dependency for lua exports generation

* Sneaky pythons hiding in code.

* [build] Change `git_id` macro to skip check if no git directory is present, also now fails gracefully; Fix `today` macro on Windows; Report git revision; Make sure QtSvg module is found.
2017-02-11 22:23:07 +01:00
Damjan Adamic e80c4c858e Prevent Lua from allocating all heap memory (Horus) (#4440)
* Fixes #4284: Prevent Lua from allocating all heap memory (Horus)
Lua bitmap functions cleanup and docs update
Added x or y < 0 check to drawBitmap()

* Proper float constant
2017-02-11 22:21:14 +01:00
Damjan Adamic be61e07939 Lua documentation update 2017-02-11 19:08:55 +01:00
3djc a53db11e1a Horus : limit model bitmaps filemane to 6 chars (#4432)
* Limit filename to 6 as sdcardfilelist controls size without extension.

* Bring constant in line with naming convention
2017-02-10 22:24:30 +01:00
Bertrand Songis 9511923581 RAM used for nothing on Taranis (change made originally for Horus) 2017-02-10 22:16:45 +01:00
Damjan Adamic 12a5af98b4 Fix for f_readdir() in simulator. 2017-02-10 20:58:44 +01:00
Bertrand Songis 70cfbbd646 Bsongis/issue 4400 (#4425)
* Cosmetics before fixing #4400

* Cosmetics before fixing #4400

* Now one more conversion issue (SF => SH sources conversion from X9D to X7)

I don't know what is exactly the conversion issue as I don't have the original EEPROM, but I used this one for my tests, so I fix it

* Now we display correctly the corrupted mixers list so that copy/paste will work correctly (it was not consistent)

+ some cosmetics

* Test removed too quickly

* One global removed ;)
2017-02-10 17:17:52 +01:00
Sebastien Charpentier 4d16e8391e Updated again French Translation. (#4436)
Rotary Encoder is now translated in "Sélecteur Rotatif" with the abbreviation "Sel.Rot."
2017-02-10 17:17:33 +01:00
3djc 3bccefe2fc Introduce S6R lua script for X7 2017-02-10 12:39:00 +01:00
3djc 022b773205 Not implemented yet 2017-02-09 10:58:37 +01:00
Andre Bernet 62e0e38635 Revert "Add translation"
This reverts commit 7bfc13fc3e.
2017-02-09 10:44:15 +01:00
Andre Bernet 7bfc13fc3e Add translation 2017-02-09 10:23:49 +01:00
3djc d6fc134e26 Default model in french should not include accents, as those are not handled at radio end 2017-02-09 07:38:47 +01:00
3djc 100bcd3c2d Merge pull request #4430 from opentx/LapinFou/FR_Translation_Companion
Type correction, again.... ;)
2017-02-08 09:53:23 -08:00
LapinFou e6fe518ed3 Type correction, again.... ;) 2017-02-08 18:47:15 +01:00
3djc 5a46b6ecbd Cosmetics 2017-02-08 17:54:29 +01:00
3djc ed6a74c2c6 X7 switch warning, take 2 (#4428)
* More like X9 proposal

* There's no E

* Fixes for compatibility
2017-02-08 16:42:42 +01:00
Sebastien Charpentier dc9129e6f1 Corrected some typo. (#4429) 2017-02-08 16:40:32 +01:00
Max Paperno a60e080ce1 [Simulator] Cosmetics: rename SimulatorDialog -> SimulatorWidget. 2017-02-08 00:37:07 -05:00
Max Paperno c4acbf6054 [Simulator] LCD screenshot file name now includes radio type; Remove unnecessary class dependence in SimulatedUIWidget initializer; Show exit status debug; Cosmetics. 2017-02-08 00:02:34 -05:00
Andre Bernet 62bcfb52c0 We only have 32 inputs! (Fix #4423) 2017-02-07 22:56:00 +01:00
Max Paperno 4e24d0ef7d [Companion][ModulePanel] Clean up some layout issues in outputs/trainer protocol setup UI; Make sure proper form fields are shown for radios with only one external radio system (eg. PPM on 9X). (#4424) 2017-02-07 22:17:05 +01:00
Max Paperno 3a026a80f2 [Simulator] Add ability to update .otx files. (#4422)
* [SimulatorInterface] Add ability to read eeprom data back from simulator instance.

* [Simulator] If started with .otx file, Simulator will now update (or create) the file upon exit using current radio/model data; Consolidate internal startup and shutdown code for handling various data sources.
2017-02-07 22:15:18 +01:00
Max Paperno 2589e35ad5 [Companion] Fix crash when converting radio splash image to RGB32 (closes #4420). 2017-02-07 15:54:29 -05:00
3djc 25848a83bb Merge pull request #4405 from opentx/3djc/X7-sw-warning-v2
X7 switch warning setup
2017-02-07 11:10:11 -08:00
3djc 343446a86d Merge pull request #4417 from opentx/3djc/X7-fix-#4412
Do not reset telem on ENT push while in telem view
2017-02-07 00:20:38 -08:00
Max Paperno cdf4335d95 [Simulator] Set main window title based on radio type & flight mode. 2017-02-07 03:01:54 -05:00
Max Paperno 7e1c05fcab [Simulator] Navigation buttons in radio UIs are now animated in response to keyboard shortcuts. 2017-02-06 22:16:48 -05:00
Max Paperno 5309b527a5 [Simulator] Add X9E radio skin. 2017-02-06 22:16:48 -05:00
Max Paperno b28bd82515 [Simulator] Improve radio UI keyboard shortcut handling for commonly used keys (pg. up/down, arrows); Cosmetics. 2017-02-06 22:16:48 -05:00
Raphael Coeffic 559bde6b4a make “reset” menu consistent with X9D (long enter press) 2017-02-06 22:18:23 +01:00
Andre Bernet 1e0046f9d6 Leftover cast (Fix #4416) 2017-02-06 20:07:55 +01:00
3djc dc3a26df1c Fix #4412 2017-02-06 19:49:29 +01:00
Max Paperno bb5c092d4f [build] Add MIXERS_MONITOR option to taranis/CMakeLists.txt (but disable for X7). 2017-02-06 13:49:26 -05:00
3djc 65249db838 Fine tune X7 trim display (#4410)
* Fine tune trim display

* Further fine tune
2017-02-06 18:28:36 +01:00
Arne Schwabe 561501a337 No longer ignore output files (#4411)
* No longer ignore output files

If these are present in a 2.2 OpenTX repo, they are remainds from a
OpenTX 2.1 build

* more output files from 2.1
2017-02-06 18:27:57 +01:00
Max Paperno ded843b989 [Simulator] UI tweaks for last major update. (#4414)
* [Simulator] Debug output: Adjust exclusion filter, help text <kbd> background color, fix help text typos & mark as translatable.

* [Simulator] Radio Outputs: Fix wrong FM highlighted (closes #4408) and current FM not highlighted until switched once; Change highlight color role of active LS/FM so it is always shown (fixes #4393); Active LSs now much more obvious (bold font & sunken frame).

* [Simulator] Rework some SimulatorMainWindow functionality:
    * Fix floating dock widgets appearing behind other applications on Linux (https://github.com/opentx/opentx/issues/4403#issuecomment-277510273);
    * Fix previously-unused floating dock widgets appearing in top-left corner upon subsequent launches of application (https://github.com/opentx/opentx/pull/4385#issuecomment-277315158);
    * Fix various anomalies due to not using a "central widget" in QMainWindow (extra separators appearing, vertical resize not working in some cases), radio widget is now central by default;
    * Add (keep) option to float the radio widget separate from main window, though this may cause the minor visual anomalies mentioned above;
    * Add options to disable radio widget size constraints while docked.
2017-02-06 18:27:03 +01:00
Bertrand Songis b0eeeb4dbc Fixes #4315 (#4406) 2017-02-05 22:01:44 +01:00
3djc 08989fb745 Another option 2017-02-05 13:21:00 +01:00
3djc 7e2271905e Fix switch warning setup on X7 2017-02-05 13:06:53 +01:00
Andre Bernet 93781748c3 X7 has no mixersmon for now (re #4402) 2017-02-05 12:24:09 +01:00
Bertrand Songis fcadd48444 Cosmetics 2017-02-05 10:34:13 +01:00
Arne Schwabe 32f7e322b2 [Companion] Add missing mask when reading multi protocol (fixes #4372) 2017-02-05 02:54:41 +01:00
Kelly Byrd 3bd37bf4e0 Removed const modifer to Widget::update in the 480x272 GUI. (#4397)
I was getting const errors with a recent gcc. So I removed the const modifer
to Widget::update in the 480x272 GUI. This caused menu_settings.cpp
menuSettings() to complain, because it was being passed a param called
'object' of type pointer to a const T, and then called object->update(),
which is not a const function.

However, the one call site I found to menuSettings() (menu_settings.cpp:224)
is passing currentWidget, which is of type Widget*.
2017-02-04 21:28:04 +01:00
3djc 38934767c8 Fix missing line on X7 and on x9 and x7 prevent unnecessary redraw of line (#4398) 2017-02-04 21:26:05 +01:00
Damjan Adamic 17a77114d0 Re #3882: parse theme/widget options depending on option type (#4391) 2017-02-04 15:35:00 +01:00
3djc b17122acf8 Fix GPS display in telem screen for X9. (#4389)
* Fix for X9. Right now, it is working, but maybe could be improved later by moving to right aligned

* X7 work

* X7 and X9 working

* Another fix for processTelemetryData
2017-02-04 15:33:52 +01:00
Damjan Adamic c66e45f0f7 Another fix for processTelemetryData 2017-02-04 14:47:33 +01:00
Arne Schwabe 839f8ae557 Fix another instance of processTelemetryData 2017-02-04 13:09:02 +01:00
Andre Bernet 101eb91c8f Hopefully fix broken PR... 2017-02-04 12:59:49 +01:00
Andre Bernet a95626ca9d Missing rename in f83aef4606 2017-02-04 12:53:04 +01:00
PT_Dreamer fbd881f8d9 Telemetry/AVR/Function renaming
renamed processSerialData to processTelemetryData acording to PR review
2017-02-04 12:08:26 +01:00
PT_Dreamer b87fddf3e7 Telemetry/Mavlink add 58798bps 2017-02-04 12:08:26 +01:00
PT_Dreamer 503422d2f7 Cmake fix telemetry option 2017-02-04 12:08:25 +01:00
PT_Dreamer 6cb86dd16b Telemetry/Mavlink clean and bugfix 2017-02-04 12:03:20 +01:00
PT_Dreamer f83aef4606 Telemetry/AVR/Unify serial driver 2017-02-04 12:03:20 +01:00
Max Paperno 2f9d9c1a99 [Simulator] New main UI window, debug console, separate outputs window, more. (#4385)
* [package] Add QtSvg support DLLs for Windows.

* [Simulator] Add images/css resources for new version; Create SimulatorIcon and SimulatorStyle classes; Build with SVG support, remove unused bitmaps.

* [Simulator] Improve and simplify VirtualJoystickWidget resize event (sticks maintain X/Y position) & improve values layout w/out trims.

* [Simulator] Refactor Trainer simulator to use VirtualJoystickWidget, gains lock/hold buttons and X/Y position readout.

* [Simulator] More compact layout for Telemetry simulator, reduces min. width and adds scrolling columns to allow smaller window sizes.

* [Simulator] Add new SimulatorMainWindow and RadioOutputsWidget UI classes.

* [storage] Add non-persistent sessionId() to AppData for tracking currently active radio profile ID.

* [Simulator] Major UI updates:
    * Use a MainWindow interface with dockable/floatable windows, proper toolbar & menu;
    * Persistent size/layout state of all windows/docks/etc between uses, per radio profile;
    * Completely separate radio Outputs window with configurable layout (also persistent between uses);
    * Translations now enabled in standalone Simulator, follows main Companion setting (they need a lot of updates);
    * New custom icons throughout, toolbar icon sizes adhere to user preference in Companion.

* [Simulator] Debug Output console updates:
    * New filter feature with optional full RegEx support, can work in inclusive or exclusive modes (full help text is included in UI);
    * Up to 50 user-defined filters are saved to permanent settings, also a few predefined filters are provided;
    * Saves/restores the last filter used and if it was en/disabled;
    * Added word wrap and clear screen features;
    * Configurable scroll-back buffer size;
    * Increased efficiency & performance of the buffering/printing process.

* [Simulator][OSX] Visual UI tweaks for OS X.

* [Simulator] Fix some debug console settings not being restored properly.

* [Simulator] Add ability to hide/show menu bar; Persist view state of menu bar and radio title bar; Reduce font size on OS X; Other small visual tweaks and improvements.

* [build] Add QtSvg to Linux build scripts (a guess for Dockerfile).

* [build] Fix for Qt 5.3.

* Add OpenTx headers to new files.

* [Companion][storage] Update GeneralSettings() initializer to use current sessionId for profile data retrieval, removes workaround for standalone Simulator being started with arbitrary profile; AppData: always update sessionId when global id() changes.

* [X10] Fixes for new simulator
2017-02-04 11:59:42 +01:00
Damjan Adamic b493973d7d Lua: Use incremental GC and also call it for Widgets (#4369)
Fixes #3885: Error in Lua Widget options handled better (does not disable entire Lua state)
Disable Lua Widget if any of its functions has error.
2017-02-04 10:58:06 +01:00
RealTadango d594843de2 Fixes telemetry stream confusion (#4386)
[S.PORT] DIY range updated:

0x5000 to 0x52ff is full DIY range
0x5000 to 0x50ff is DIY streaming range
0x5100 to 0x52ff is DIY sensor range
2017-02-04 10:49:03 +01:00
Bertrand Songis 40ece81de2 X10 (#4377)
[X10] New radio supported!
2017-02-04 10:42:50 +01:00
Kongse ebee591990 Layout tweak (#4388)
Chineses fonts width of ubuntu is differents from windows, layout re-modified for windows, considering most people use windows version
2017-02-04 10:10:11 +01:00
Martin Hotar de572b53e4 X9E simu images for @mpaperno 2017-02-04 00:19:49 +01:00
Kelly Byrd 86d0ac6745 Fixes #4368: Don't duplicate categories in OTX's models.txt (#4370) 2017-02-03 20:55:18 +01:00
Damjan Adamic fc01f77d49 Re #4384: Lua doc updated: added max image size to lcd.drawPixmap() 2017-02-03 20:22:55 +01:00
3djc 3dba82622e Fix fields name (mixer,GC,..) (#4383) 2017-02-03 13:58:29 +01:00
Kelly Byrd a0aa883743 Fixed #4375, fix pasting multiple items in Companion. (#4381) 2017-02-03 10:26:31 +01:00
Damjan Adamic 2b83160284 Fix needed to get f98f63fa5 working (PR was based on some older code) 2017-02-03 10:18:49 +01:00
Kelly Byrd f98f63fa55 Issue #4224: Implement "duplicate model" in Companion (#4367) 2017-02-03 10:10:51 +01:00
3djc fb44581496 Merge pull request #4376 from opentx/3djc/comp-french-uncomplete
3djc/comp french uncomplete
2017-02-02 22:17:47 -08:00
LapinFou e911922430 Updated French translation. 2017-02-02 15:49:45 +01:00
Andre Bernet 00074c508f Module compartment trainer input currently unavailable on Horus 2017-02-02 15:28:53 +01:00
3djc 0c550588bb Make lcd.drawScreenTitle and lcd.drawCombobox compatible with X7 (#4374) 2017-02-02 10:33:42 +01:00
Andre Bernet 8775550147 [128] Navigation fix 2017-02-02 09:42:35 +01:00
Andre Bernet c8d0154a9e VC++ compilation 2017-02-02 09:12:59 +01:00
Kelly Byrd bdd62104c1 Issue #4224: Paste into and across categories in Companion (#4371)
* Issue #4224. Allow pasting models into and across categories.
* Issue #4224: Add "Paste" to category conext menu.
2017-02-02 09:05:26 +01:00
3djc e7d7f9df95 Fix some events not sent to LUA telemetry scripts scripts.
Thix fixes #4366
2017-02-02 08:02:18 +01:00
Andre Bernet d2415b35db Change physical ID for remote SPORT lua scripts to 0x17 to avoid conflict with existing sensor. Also matches info from back in 2013 and FrSky's own implmentation of a ground setup device (smart dashboard).
Should actually be an OpenTX setting, possibly even hardcoded instead of scripts being able to choose it.
2017-02-01 22:44:41 +01:00
Andre Bernet 4554f19a4a Screenshot SF currently unsupported on Horus 2017-02-01 21:10:31 +01:00
Arne Schwabe 5790b36589 Check X7 epprom sizes (#4364)
Since X7 is released now, we should not modify its data struct sizes anymore

X7 is too different from Taranis/sky9x to merge it into one of the other blocks
2017-02-01 16:36:13 +01:00
3djc ba21aec79f Update doc for functions not available on X7 (#4363) 2017-02-01 15:44:23 +01:00
Max Paperno 9c6a543434 [Simulator] Make sure a default Data File is always suggested in startup dialog; Fix silent exit upon startup if no file/data was provided. 2017-02-01 04:04:51 -05:00
Damjan Adamic fe76ecfe02 Re #4353: Header background color is now 70% of base color. 2017-02-01 09:56:43 +01:00
3djc 883154dad6 Make dot smaller (#4361) 2017-02-01 09:04:37 +01:00
Arne Schwabe 8ba5af7049 Use C++11 clock implementation instead implementation platform specific code ourselves (#4358)
* Use C++11 standard chrono API instead of platform specific code (fixes Mac OS X < 10.12)

* Divide by /2 to get 2ms steps
2017-02-01 07:37:29 +01:00
Kelly Byrd c6026e8a0f Re #4224 Add "rename" item to Category context menu in companion. (#4360)
- Adds "rename" to the context menu for categories, it uses the
same code path as the default dblClick handler for the base class.

- Added a separator so the context menu looks more like the one
for models

- Some whitespace changes in mdichild.h, my editor truncates
whitespace on blank lines.
2017-02-01 07:35:46 +01:00
3djc 58971dffea Move antenna switch to module switches (#4355)
* Move antenna switches to module switches and fix display when moduel is OFF

* One line is missing and the whole field feels empty...
2017-01-31 14:50:18 +01:00
Arne Schwabe 7fb9aad61f [MULTI] Fix Frksy EU pulses actually send the right type 2017-01-31 07:48:58 +01:00
Damjan Adamic baa5929671 Fixes #4350: Horus 2pos switches need different switch conditions, fixes SF and SH switches in simulator (#4351) 2017-01-31 07:41:59 +01:00
Arne Schwabe 59d9ec131b Schwabe/multi protocol update (#4352)
* Add multi frisky eu protocols

* Also implement MULTI_STATUS, the alternative to MULTI_TELEMETRY used by er9x/ersky9x
2017-01-31 07:41:08 +01:00
Max Paperno cab26a6a0f [Simulator] Make 2-way switches return -1 || 1 instead of 0 || 1. Fixes https://github.com/opentx/opentx/issues/4343 . 2017-01-30 20:19:04 -05:00
Damjan Adamic dcbfa92b03 Lua docs update: playNumber units updated 2017-01-30 21:53:06 +01:00
Damjan Adamic a45aafff33 Fixes: Mixers were not calculated in simulator. CoGetOSTime() needed … (#4342)
* Fixes: Mixers were not calculated in simulator. CoGetOSTime() needed implementation.

* Cleanup
2017-01-30 15:33:22 +01:00
Damjan Adamic bbe82db087 Cosmetics 2017-01-30 14:52:37 +01:00
Andre Bernet 5077b10274 Only convert storage if boards are actually different 2017-01-30 11:03:42 +01:00
Andre Bernet 00adc318ce The "Downloads" dialog (previously firmware preferences) doesn't actually change anything anymore, so shouldn't update anything and thus run a storage conversion 2017-01-30 10:54:26 +01:00
Andre Bernet b05d57fcce One more qt plugin needed on Win for jpg Horus model images 2017-01-30 10:02:35 +01:00
Bertrand Songis 11c20a5c2c [Build] Filelock added to avoid to compile the same firmware many tim… (#4333)
* [Build] Filelock added to avoid to compile the same firmware many times simultaneously
2017-01-30 09:16:18 +01:00
Bertrand Songis cc8de81128 [Build process] Rather move the binary than copy it to avoid race conditions 2017-01-29 13:42:46 +01:00
3djc 2a1e5914f5 Translate some of the new stuff 2017-01-27 20:35:29 +01:00
1319 changed files with 356421 additions and 351732 deletions
+111
View File
@@ -1 +1,112 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
# Source files
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
*.lua text
*.pxd text
*.py text
*.py3 text
*.pyw text
*.pyx text
*.pl text
*.pm text
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wmaproj text eol=crlf
*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf
*.sh eol=lf
# Compiled Object files
*.slo binary
*.lo binary
*.o binary
*.obj binary
# Precompiled Headers
*.gch binary
*.pch binary
# Compiled Dynamic libraries
*.so binary
*.dylib binary
*.dll binary
# Compiled Static libraries
*.lai binary
*.la binary
*.a binary
*.lib binary
# Executables
*.exe binary
*.out binary
*.app binary
# Binary files
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyd binary
*.pyo binary
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text
*.adoc text
*.textile text
*.mustache text
*.csv text
*.tab text
*.tsv text
*.sql text
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as an asset (binary) by default. If you want to treat it as text,
# comment-out the following line and uncomment the line after.
*.svg binary
#*.svg text
*.eps binary
+1 -7
View File
@@ -2,13 +2,7 @@
/.*project
/.settings
/.autotools
radio/src/bootloader/.dep/
radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.stamp
radio/src/lua/lua_fields_*.txt
radio/src/lua/lua_exports_*.txt
build*/
cmake-build-*/
/debian/
+3
View File
@@ -0,0 +1,3 @@
[submodule "radio/src/thirdparty/GCS_MAVLink/include_v1.0"]
path = radio/src/thirdparty/GCS_MAVLink/include_v1.0
url = https://github.com/mavlink/c_library_v1.git
+21 -3
View File
@@ -18,6 +18,7 @@ env:
# - QT_BASE=57
#- GCC_ARM=/opt/gcc-arm-none-eabi/bin
- AVR_FLAVORS="AVR9X 9X GRUVIN9X MEGA2560"
- PYTHONPATH=${PYTHONPATH}:/usr/lib/python3/dist-packages
matrix:
#
# ALL will build every individual board & DEFAULT, sequentially.
@@ -38,7 +39,8 @@ env:
# - FLAVOR=X9D
# - FLAVOR=X9D+
# - FLAVOR=X9E
- FLAVOR=X12
- FLAVOR=HORUS
# - FLAVOR=X10
# - FLAVOR=X12Sr10
# - FLAVOR=X12S
@@ -69,7 +71,23 @@ install:
# - tar xjf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2
# - mv gcc-arm-none-eabi-4_7-2013q3 /opt/gcc-arm-none-eabi
fi
- sudo apt-get install -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh
- sudo apt-get install --yes --force-yes -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}svg qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh
addons:
sonarcloud:
organization: "opentx-github"
token:
secure: "BuQrGRijNpL2V/IQNcOxvjChj8PScfCdiv403EE73Nqb4+sB8YL92Fnzrnw9bC8wF7BVSDJVpYF0gbdaTzuCmaeZfM8NJK0TOJAbH6+B8bhIrU/V1SBuVjHQnndV/wysieruKnK/KxYJZqItgSlnPo+PmiFxtXJNlas0Kstb2O4="
# github_token:
# secure: "Qkmp4VrQJtKgZ/pz65SNnCDiF4slgFfQS/3whyLXLcDbFb1Hv1oj7Hqz9EVDUSO2eEhgQGaOKkRc0CfAAOBwW6OvhE0xh7P1CJEjzOp6+3gI/LyZUNsqa+awVRZTsfm1YZaOPaPWJ7cI0uz3/OoSUeIecs4PDWPrQMGRlsrq7Q8="
branches:
- "2.2"
script:
- ./tools/commit-tests.sh
- build-wrapper-linux-x86-64 --out-dir bw_output ./tools/commit-tests.sh
- sonar-scanner
cache:
directories:
- '$HOME/.sonar/cache'
+88 -18
View File
@@ -2,13 +2,11 @@ project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "2")
set(VERSION_REVISION "0")
set(VERSION_REVISION "1")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
message(STATUS "OpenTX ${VERSION}")
set(SDCARD_REVISION "0005")
set(SDCARD_REVISION "0013")
set(SDCARD_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}V${SDCARD_REVISION})
cmake_minimum_required(VERSION 2.8)
@@ -23,6 +21,9 @@ endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW) # for ninja
endif()
set(CMAKE_COLOR_MAKEFILE ON)
@@ -37,23 +38,93 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
message(STATUS "OpenTX ${VERSION} @${GIT_STR}")
# options shared by all targets
option(APP_CUSTOM_DBG_HANDLER "Use custom message handler for debug output in all Qt apps." ON)
set(APP_CUSTOM_DBG_LEVEL "0" CACHE STRING
"Debug output level: 0=debug+; 1=info+; 2=warn+; 3=critical+; 4=fatal only.")
set(APP_CUSTOM_DBG_SHOW_FILE "DEFAULT" CACHE STRING
"Show source file names in debug output. 1/0/DEFAULT (default is ON with DEBUG builds).")
option(VERBOSE_CMAKELISTS "Show extra information while processing CMakeLists.txt files." OFF)
option(WARNINGS_AS_ERRORS "Treat any compiler warning as an error (adds -Werror flag)." OFF)
if(WIN32)
set(WIN_EXTRA_LIBS_PATH "C:/Programs" CACHE PATH
"Base path to extra libs/headers on Windows (SDL, dirent, pthreads, msinttypes folders should be in here).")
"Base path to extra libs/headers on Windows (SDL & pthreads folders should be in here).")
list(APPEND CMAKE_PREFIX_PATH "${WIN_EXTRA_LIBS_PATH}" "${WIN_EXTRA_LIBS_PATH}/SDL") # hints for FindSDL
endif()
# Python check
find_package("PythonInterp")
if(PYTHONINTERP_FOUND)
message(STATUS "Python found, version: ${PYTHON_VERSION_STRING}")
get_filename_component(PYTHON_DIRECTORY ${PYTHON_EXECUTABLE} DIRECTORY)
else()
message(WARNING "Python not found! Most firmware and simu flavors not buildable.")
set(LUA NO)
endif()
find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
find_package(Qt5Svg)
if(Qt5Core_FOUND)
message(STATUS "Qt Version: ${Qt5Core_VERSION}")
### Get locations of Qt binary executables & libs (libs are for distros, not for linking)
# first set up some hints
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(qt_core_path ${QtCore_LOCATION} PATH)
if(APPLE)
get_filename_component(qt_core_path "${qt_core_path}/.." ABSOLUTE)
endif()
set(QT_LIB_DIR ${qt_core_path} CACHE PATH "Path to Qt libraries (.dll|.framework|.so).")
find_path(QT_BIN_DIR NAMES "qmake" "qmake.exe" HINTS "${CMAKE_PREFIX_PATH}/bin" "${qt_core_path}/../bin" "${qt_core_path}" DOC "Path to Qt binaries (qmake, lupdate, etc.).")
find_program(QT_QMAKE_EXECUTABLE qmake HINTS "${QT_BIN_DIR}" DOC "Location of qmake program.")
find_program(QT_LUPDATE_EXECUTABLE lupdate HINTS "${QT_BIN_DIR}" DOC "Location of Qt's 'lupdate' program for updating translation files.")
# Try to find Qt translations
if(QT_QMAKE_EXECUTABLE)
execute_process(
COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE qt_translations_hint
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
find_path(QT_TRANSLATIONS_DIR NAMES "qt_en.qm" HINTS "${qt_translations_hint}" DOC "Path to prebuilt Qt translations (qt_*.qm).")
### Common definitions for the Qt-based apps
list(APPEND APP_COMMON_DEFINES -DSIMU)
list(APPEND APP_COMMON_DEFINES -DQXT_STATIC)
list(APPEND APP_COMMON_DEFINES -DQT_USE_QSTRINGBUILDER) # more efficient QString construction using % operator
if(APP_CUSTOM_DBG_HANDLER)
# provide full qDebug log context to our custom handler. This may also affect libsimulator, which is why it is here
list(APPEND APP_COMMON_DEFINES -DQT_MESSAGELOGCONTEXT)
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_ENABLE=1)
if(APP_CUSTOM_DBG_LEVEL GREATER -1 AND APP_CUSTOM_DBG_LEVEL LESS 5)
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_DEFAULT_LEVEL=${APP_CUSTOM_DBG_LEVEL})
endif()
if(NOT APP_CUSTOM_DBG_SHOW_FILE STREQUAL "DEFAULT" AND (APP_CUSTOM_DBG_SHOW_FILE STREQUAL "1" OR APP_CUSTOM_DBG_SHOW_FILE STREQUAL "0"))
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_SHOW_SRC_PATH=${APP_CUSTOM_DBG_SHOW_FILE})
endif()
else()
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_ENABLE=0)
endif()
if(Qt5Widgets_FOUND)
message(STATUS "Qt Version: ${Qt5Widgets_VERSION}")
else()
message(WARNING "Qt not found! Companion and Simulator builds disabled.")
endif()
@@ -67,13 +138,16 @@ if(NOT WIN32)
endif()
endif()
if(Qt5Widgets_FOUND OR FOX_FOUND)
if(Qt5Core_FOUND OR FOX_FOUND)
set(SDL_BUILDING_LIBRARY YES) # this prevents FindSDL from appending SDLmain lib to the results, which we don't want
find_package("SDL")
if(SDL_FOUND)
message(STATUS "SDL Lib: ${SDL_LIBRARY}; Headers: ${SDL_INCLUDE_DIR}; Version: ${SDL_VERSION_STRING}")
if (NOT ${SDL_VERSION_STRING} VERSION_LESS "2.0")
message(FATAL_ERROR "OpenTX requires SDL 1.x, not 2.x")
endif()
else()
message(STATUS "SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
message(STATUS "SDL not found! Simulator audio, and joystick inputs, will not work.")
endif()
endif()
@@ -84,10 +158,11 @@ endif()
# Windows-specific includes and libs shared by sub-projects
if(WIN32)
list(APPEND WIN_INCLUDE_DIRS "${WIN_EXTRA_LIBS_PATH}/dirent/include")
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIRECTORY}/thirdparty/windows/dirent")
if(MSVC)
set(WIN_PTHREAD_BASE_PATH "${WIN_EXTRA_LIBS_PATH}/pthreads/Pre-built.2")
list(APPEND WIN_INCLUDE_DIRS "${WIN_PTHREAD_BASE_PATH}/include" "${WIN_EXTRA_LIBS_PATH}/msinttypes")
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIRECTORY}/thirdparty/windows/msinttypes")
set(WIN_PTHREAD_BASE_PATH "${WIN_EXTRA_LIBS_PATH}/pthreads/Pre-built.2" CACHE PATH "Where to find pthreads include and lib folders.")
list(APPEND WIN_INCLUDE_DIRS "${WIN_PTHREAD_BASE_PATH}/include")
find_file(WIN_PTHREAD_LIB pthreadVC2.lib PATHS "${WIN_PTHREAD_BASE_PATH}" PATH_SUFFIXES lib/x86 lib NO_DEFAULT_PATH)
find_file(WIN_PTHREAD_DLL pthreadVC2.dll PATHS "${WIN_PTHREAD_BASE_PATH}" PATH_SUFFIXES lib/x86 lib dll/x86 dll NO_DEFAULT_PATH)
if(WIN_PTHREAD_LIB)
@@ -103,13 +178,8 @@ if(WIN32)
endif()
endif()
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
add_subdirectory(${RADIO_SRC_DIRECTORY})
if(Qt5Widgets_FOUND)
if(Qt5Core_FOUND)
add_subdirectory(${COMPANION_SRC_DIRECTORY})
endif()
+1284
View File
File diff suppressed because it is too large Load Diff
-852
View File
@@ -1,852 +0,0 @@
<a href="http://frsky-rc.com">FrSky (monthly)</a>
<a href="http://alofthobbies.com">Aloft Hobbies</a>
<a href="http://jonathan.it">Jonathan Modellismo</a>
<a href="http://wstech.de">WsTech</a>
<a href="http://aviomotive.com">Aviomotive</a>
<a href="http://boltrc.com">BoltRC</a>
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
<a href="http://litepilots.com">LitePilots</a>
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
<a href="http://3drobotics.com">3D Robotics</a>
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
Mario Sette
Felice Baratto
Alessandro Mari
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
Zdenek Trojanek
Martin Hotar
Stefan Grundevik
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
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
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
André Lasseret
Felipe Alexandre de Oliveira
Brian Harris
Philippe Herbots
Rainer Nelte
Franck Bernhard
Erhard Werner
Stig Jøran Moen
Keith Hertzog
Christophe Dauvergne
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
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
Johan Moelich
Timo Esser
Brian Paddock
Jean Pierre Parisy
Norbert Martsch
Jean-Marie Guitard
Tilman Baumann
Fred Larssen
Ari Aalto
Robert Sams
Kirk Robertson
John Koontz
Jeffery Golias
Paul Robinson
Dave Matison
Mike Matheny
Pino Agostino
Graham Boucher
Nelson Noura
Joel Allamy
Philip David Martin
Sean Stephen
Bruce Mackay
Blake Spilman
Timothy Pelletier
Glen Roe (ShowMaster)
Jan Van Ooteghem
Lawrence Christensen
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
Stéphane Fortas
Peter Mitrik
Thomas Majewski
ANF King
Henrik Hammarström
Kenneth Lilja
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
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
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
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
John Grepps
Anthony Burbidge
Sherba Baine
Gordon Evans
Fred Figge
Uwe Kuehn
David Beatty
Aaron Stringer
Alan J Wasserman
Wolfgang Rauser
Samuel Cook
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
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
Matthias Hase
Markus Wolf
Andrew Fazio
Stefan Künst
Stephen Adams
Tauno Rautakorpi
Frank Houvenaghel
George Neusse
Andreja Rusjakovski
Axel Stöckle
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
Larry Roper
Mike Frizell
Daniel Pospolita
Peter Herz
Don Mondrik
Paul Fram
Charles Knight
Matthew Adams
Kenneth Reed
Gary Wild
Christof Ramm
Bruno Bedard
Salih Samim Aydin
Alexander Pils
Andrew Scerbina
Donovan Bodishbaugh
Ray Dunn
Burt Pickard-Richardson
Robert Ferguson
CY Enterprise
Michel Stathakis Neto
Beat Zurflueh
Portstate Pty Ltd
Jens Hoffmann
Ricardo Santos
Jean-Francois Le Breton
Michael Deasy
Anindya Mukerjee
Emay Toha
Kamco Enterprises
Peter Mueller
Giovanni Trentini
Cecil Porter
Robert Canavan
Greg Higginbottom
Tim Walker
Spis Ltd/TurboNote
Patricia Cox
Matthew Lukes
Sabine Witte
Phillip Perry
Beat Zurflueh
Russell Stutzman
Dietmar Drees
Kenneth Ward
Jens Lochmüller
Anthony Witham
Peter Hauke
Arizona Action Photos
Francis F Dale
Willie Swanepoel
Edward Hauser
Adilson Oliveira
Joseph Ordille
Michael Shellim
Teddie Holmes
Alexandre Rault
Eric Albin
Lukas Kliment
Bernard Philippe
Bernard Delpy
Didier Klein
Arnaldo Guedes
Cyberauto Systems
John Alsbrooks
John Kearney
Christopher Borden
Marc Virgilio Ricci
Frederick Davie
Jürgen Enders
Terrence Pitts
Thomas Sandner
Marco Coltorti
Harald Wilczak
Rodney Lorimor
Richard Davis
Stephen Palmer
Michael Napolitan
Joshua Bardwell
Fred Dawson
Jim Wagner
Peter Johnson
Fredrik Lewerth
Arvin Stenersen
Daniel Morgan
Roy Nixon
Joachim Blunck
Karl-Heinz Gansel
Monrovia Mountain Enterprises
Alessandro Villa
Jan-Åke Nilsson
Matthias Rei
DVR Solutions BV
Bertrand Condevaux Lanloy
Henri Mirra
Aurélien Planiol
Kevin Caldwell
Andrew Garello
Tomasz Maziarz
Russell Flack
Fernando Rimoldi
Greg Reid
Dietmar Drees
Holger Landwehr
Arno Loehdorf
Boon Sripattha
Patrik Åkerfeldt
Alonzo Fretwell
Renjith Chandrasekharan
Ruben Gomez Hernandez
Michael Gardner
Judith Green
Timo Ruppell
John Lipscomb
Norbert Wenke
Erik Frieberg
Raimo Ruotsalainen
Brian Harris
Sebastian Blüml
Efisio Maxia
Jeff Theobald
Anthony Rizzo
Rodney Huddleston
Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Donald Burke
Ronald Donker
Fredie Singh
Patrizio Simoncini
Harald Gabler
Michael Brown
Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Christian Grandjean
Roger Bergevin
NorthSide
Sigmund Martinsen
Lionel Lafraise
Gisli Ofeigsson
The Gruvin9x Project
Manuel McLure
Fernando Rimoldi
Hiltenkamp Stephan
Sandeep Kishore Jain
Greg Parker
Norman Maaß
Adriano Del Ben
Justin Poole
Kenneth Harrison
Eugene LaFaille
John O'Shaughnessy
Uwe Jordt
Stuart Olson
Frédéric Devillard
Cheung Leo
Peter Webster
Jean-Claude Bachetta
Delfin Perena
Sae-wook Yoon
Focus on Excellence
Jeffery Golias
Nick Milton
Paul Zasso
Reidar Johannes Lillebotn
Handley William
Luke Williams
Michael Shellim
Brian Spearing
Derek Foster
Pasi Pitkänen
Lexington S Morley
Jeff Roberson
Volkov Victor
Bryan Anderson
Daniel Garber
Pavel Stein
Ravi Gupta
Patrick Tuxbury
Mark Deverell
John Capell
Neil McVean
Matthew Elyash
Kerry Cochrell
Willem Aandewiel
Reg Bell
Jean Chenoz
Philippe Grand
Tauno Rautakorpi
Jeff Dillingham
Brad Kelley
Shaun Currier
Danilo Schiara
John Hennig
RK Custom Homes
James Houck
Piet Teekens
Tommy Widenflycht
Johan Petrus Theophilus
Maria van Melis
Ralph Gustafson
Paul Luby
Andrew Duncan
Stephen Crowther
Edward Glover
Kelly Byrd
Brad Curtis
Wolfgang Kuhl
John Beidl
Roy Nixon
Glen Roe
CY Enterprise
Evening Shade Pottery
Gilles Dando
Patrick Richard
Justin Altemeier
Constant Dupuis
Tony Kenward
Pierre Rondel
Ernest Luguera Sanchez
Adam Brackney
Joe Baker
单 雷平
Ben Fay
Chris Monk
Stan von Miller
Christian Krebs
Michel Motte
Graziano Rampinelli
Joe Baker
Jean-Philippe Laurent
Romain Rouzaud
Michel Garbarino
Henri Mirra
Otto Fröhlich
Thomas Cramer
Anthony Trombetta
Fernando Rimoldi
Dietmar Drees
Michal Kowalski
Ivan Correa
Modellbau
Massimo Luigi Stara
Graham Baldwin
Tomasz Rejman
Wolfgang Lang
John Greenwood
Till von Reumont
Paul Pereira Brunner
Donald L Singer
Junsun Lee
Guy Lamaison
Erwin Dulken
Mike H Dailey
Jon Cammarata
Martin Krueger
Adolfo Perogio
Sylvain Techer
Wes Warner
Kevin Caldwell
Ali Ersan Gur
Hans-Rudolf Riniker
Sébastien Boutard
Jean Chessé
Mike H Dailey
Don Polk
Roberto Orsello
Borovikov Dmitriy
John Lipscomb
Peter Glassey
Joseph Kramer
F.Javier Martinez Velasco
Claudio Piccinini
John Jackson
John Beech
Rene TraaJohn Jackson
Sebastien Charpentier (monthly)
Nigel Hendriks
Frédéric Devillard
Albert Herzog
Anindya Mukerjee
Kenny Stanberry
Tauno Rautakorpi
Mathias Krapp
Fernando Rimoldi
Wolfgang Rauser
Richard Shagam
Stephen Bailey
DK-System
Casa Kuxtal
Christopher Potts
Douglas George
Michael Banks
Jon Wiltshire
David Green
Guy Willems
Xavier Mestelan Pinon
Maik Gottschalk
Scott Sparks
John Dunning
RAD51
Ron Powell
Alain Labonne
Carol Sills
Franck Aßmann
Larry Anderson
Mikael Wallbäck
Wes Warner
Christoffer H Henni
Donna Bayer
Garry Ogilvie
Karlheinz Sirsch
Fred Larssen
Rob Coppock
Franz Josef Hahn
Serge Ribault
Tanguy Le Moign
Barrett Powell
Patrice Lafeuille
Martin Blume
Marek Kopyto
Marco Lange
Gary Nix
Jack Oliphant
John Lever
Adolphe Montefiore
Steven De Weerdt
Håkan Berggen
Ayelet Egosi
Jean-Frederic Gaudreault
Jim Wagner
Lee Scott
Roger Keatley
Sherman Lovell
Hugh Caldwell
JB Fisher Company
Michels Bernhard
Pietro Rossin
Carsten Wache
Brock White
Steven Poretz
David Huelster
Gordon Stahl (monthly)
John Mathison
Richard Duczmal
Gregory Barron
Marcel Fischer
Klas Mälman
Viljo Liukku
Eric Smith
Sven Assmus
Luke Mole
NorthSide
Hannes Mössler
James Kaufman
Ravi Gupta
Lexington S Morley
Ralph Segar
Frédéric Devillard
Cory Theurer
Valentinos Zachariou
Garrett Paquette
Heung Jin Choi
Kerry Cochrell
Doug Miller
Andrzej Weydmann
Chair-man.nl
Eric Beier
Jay Warren
Marian Matej
Alastair Smith
Timothy Senecal
Dietmar Drees
Bruce Jones
Adil Busaidy
Herman Hofman
Jean Paul Michel
Peter McHenry
Julien lecoquierre
Jean-Marie Clay
Robert Nicoll
Dan Nixon
Ewald Moehring
Giovanni Carnesecchi
Paul Dumsday
Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
+10 -3
View File
@@ -1,9 +1,16 @@
##OpenTX 2.2 Branch
## OpenTX 2.2 Branch
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=next)](https://travis-ci.org/opentx/opentx)
[![Travis build Status](https://travis-ci.org/opentx/opentx.svg?branch=2.2)](https://travis-ci.org/opentx/opentx)
[![Quality Gate](https://sonarcloud.io/api/badges/gate?key=OpenTX:2.2)](https://sonarcloud.io/dashboard?id=OpenTX:2.2)
[![Join the chat at https://opentx.rocket.chat](https://camo.githubusercontent.com/3d659054abd6ce21c0e47cf3b83a51bda69ca282/68747470733a2f2f64656d6f2e726f636b65742e636861742f696d616765732f6a6f696e2d636861742e737667)](https://opentx.rocket.chat)
[![Donate using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
The ongoing development on 2.2.x is done in this branch.
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.
Refer to the [OpenTX wiki](https://github.com/opentx/opentx/wiki) for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
Useful links:
* OpenTX Main Site http://www.open-tx.org/
* OpenTx University http://open-txu.org/
* OpenTX User Manual https://www.gitbook.com/book/opentx/opentx-taranis-manual/details
* OpenTX Lua Reference Guide https://www.gitbook.com/book/opentx/opentx-lua-reference-guide/details
+3 -3
View File
@@ -6,7 +6,7 @@ macro(add_bitmaps_target targetname filter width format)
set(target ${target}.lbm)
add_custom_command(
OUTPUT ${target}
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
DEPENDS ${bitmap}
)
list(APPEND bitmaps_files ${target})
@@ -17,8 +17,8 @@ endmacro(add_bitmaps_target)
macro(add_truetype_font_target radio name font size bold)
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
add_custom_target(ttf_${radio}_${name}
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set(ttf_${radio}_fonts_targets ${ttf_${radio}_fonts_targets} ttf_${radio}_${name})
endmacro(add_truetype_font_target)
endmacro(add_truetype_font_target)
-17
View File
@@ -1,17 +0,0 @@
# Locate lupdate binary from QT
# This module defines
# LUPDATE_EXECUTABLE, where is QT lupdate
# LUPDATE_FOUND, if false, don't try to use lupdate
FIND_PROGRAM( LUPDATE_EXECUTABLE
NAMES
lupdate lupdate-qt4
)
# if the program is found then we have it
IF( LUPDATE_EXECUTABLE )
SET( LUPDATE_FOUND "YES" )
ENDIF( LUPDATE_EXECUTABLE )
MARK_AS_ADVANCED( LUPDATE_EXECUTABLE )
+67 -67
View File
@@ -1,68 +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
# 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
)
+19 -15
View File
@@ -1,14 +1,13 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
string(REGEX REPLACE "[^0-9]*([0-9]+)[^0-9]([0-9]+)[^0-9]([0-9]+).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "date not implemented")
set(${RESULT} 00.00.0000)
message(WARNING "date not implemented")
set(${RESULT} 00-00-0000)
endif(WIN32)
endmacro(today)
@@ -20,22 +19,27 @@ macro(now RESULT)
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")
message(WARNING "time not implemented")
set(${RESULT} 00:00:00)
endif(WIN32)
endmacro(now)
find_package(Git)
macro(git_id RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse --short=8 HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "--short=8" "HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "Git ID implemented")
set(${RESULT} 0)
endif(WIN32)
set(${RESULT} 0)
if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(COMMAND "${GIT_EXECUTABLE}" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "--short=8" "HEAD" OUTPUT_VARIABLE proc_out ERROR_VARIABLE proc_err)
if(proc_err)
message(WARNING "Git failed with error: ${proc_err}")
else()
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${proc_out})
endif()
elseif(NOT GIT_FOUND)
message(WARNING "Git executable not found, revision number not available.")
else()
message(STATUS "Git repository not found, revision number not available.")
endif()
endmacro(git_id)
macro(use_cxx11)
+70 -1
View File
@@ -1,5 +1,74 @@
<h2>Version 2.2.0 / 2017-05-30</h2>
Major release! Please see <a href=http://www.open-tx.org/2017/05/30/opentx-2.2.0>this page</a> for details.
<h2>Version 2.1.9 / 2016-09-14</h2>
<ul>
<li>SD sync fixes (<a href=https://github.com/opentx/opentx/issues/3351>#3351</a>)</li>
<li>Fixed: Telemetry mode "FrSky D (cable)" choice was missing for Taranis (<a href=https://github.com/opentx/opentx/issues/3372>#3372</a>)</li>
<li>Show persistent option only for calculated sensors (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
<li>Fixed Flight mode clear command (<a href=https://github.com/opentx/opentx/issues/3214>#3214</a>)</li>
<li>Fixed a problem with Rotary encoders linked to flight mode (could freeze Companion) (<a href=https://github.com/opentx/opentx/issues/3459>#3459</a>, <a href=https://github.com/opentx/opentx/issues/3470>#3470</a>)</li>
<li>Telemetry simulator improvements: added fuel quantity sensor, increased RPM range (<a href=https://github.com/opentx/opentx/issues/3505>#3505</a>, <a href=https://github.com/opentx/opentx/issues/3506>#3506</a>)</li>
<li>Implemented minimal support for the DYI Multimodule (<a href=https://github.com/opentx/opentx/issues/3526>#3526</a>)</li>
<li>Fixed: GVar combo-box not being refreshed when GV check-box (re-)selected (<a href=https://github.com/opentx/opentx/issues/3518>#3518</a>)</li>
<li>Fixed: Heli inversion not correctly shown/saved from Companion on Radios without virtual inputs (<a href=https://github.com/opentx/opentx/issues/3510>#3510</a>)</li>
<li>Implemented print functions for the Heli setup screen (<a href=https://github.com/opentx/opentx/issues/3554>#3554</a>)</li>
<li>Fixed: Flight modes linked trims display value (<a href=https://github.com/opentx/opentx/issues/3547>#3547</a>, <a href=https://github.com/opentx/opentx/issues/3568>#3568</a>)</li>
<li>Fixed: New model global variables and rotary encoders initialisation (<a href=https://github.com/opentx/opentx/issues/3473>#3473</a>)</li>
<li>Fixed: Prevent circular linked global variables and rotary encoders (<a href=https://github.com/opentx/opentx/issues/3472>#3472</a>)</li>
<li>Fixed wrong log replay speed issue in Telemetry simulator (<a href=https://github.com/opentx/opentx/issues/3708>#3708</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.8 / 2016-04-14</h2>
<ul>
<li>Telemetry Simulator sensor instance number fixed (<a href=https://github.com/opentx/opentx/issues/3207>#3207</a>)</li>
<li>Fixed: Throttle Source combo-box was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
<li>RTC option tool-tip corrected (<a href=https://github.com/opentx/opentx/issues/3225>#3225</a>)</li>
<li>Fixed: Companion was looking for custom scripts at the wrong place (<a href=https://github.com/opentx/opentx/issues/3237>#3237</a>)</li>
<li>Offset displayed in inputs screen (<a href=https://github.com/opentx/opentx/issues/3248>#3248</a>)</li>
<li>Import/export handling was broken for Average formula telemetry sensors (<a href=https://github.com/opentx/opentx/issues/3262>#3262</a>)</li>
<li>Fixed: Hardware Setup control types and names were not stored in profile (<a href=https://github.com/opentx/opentx/issues/3260>#3260</a>)</li>
<li>Fixed voice language list (<a href=https://github.com/opentx/opentx/issues/3338>#3338</a>)</li>
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
<li>Fixed: Sync dialog new line problem (only present for some UI languages) (<a href=https://github.com/opentx/opentx/issues/3350>#3350</a>)</li>
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
<li>Default AVR fuse settings changed to disable JTAG interface (<a href=https://github.com/opentx/opentx/issues/3379>#3379</a>)</li>
<li>Channel range fix (Start, Channels) in Model Settings, Setup page, int/ext module settings</li>
<li>Use friendly GVAR names in dialogs (if available) (<a href=https://github.com/opentx/opentx/issues/3353>#3353</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.7 / 2016-01-04</h2>
<ul>
<li>Lua 'execute' failed in non-root directory (in Simulator) (<a href=https://github.com/opentx/opentx/issues/3024>#3024</a>)</li>
<!-- this is disabled until the speed problem is fixed <li>Header line always visible in Outputs, Logical Switches and Special Functions (<a href=https://github.com/opentx/opentx/issues/2861>#2861</a>)</li> -->
<li>LR12 changes: removed option for remote failsafe configuration, added in EU firmware variant</li>
<li>Added Clear option to the flight mode context menu (right click on the Name label) (<a href=https://github.com/opentx/opentx/issues/3026>#3026</a>)</li>
<li>New features for Telemetry Simulator: log replay, user friendly sensor values (<a href=https://github.com/opentx/opentx/issues/3124>#3124</a>)</li>
<li>Added F7 key to reload LUA permanent scripts in radio simulator (<a href=https://github.com/opentx/opentx/issues/3141>#3141</a>)</li>
<li>AR9X firmware flashing fall-back was wrong</li>
<li>Command line options support added to standalone simulator (try "./simulator21 --help" on Linux and "simulator.exe /help" on Windows for usage) (<a href=https://github.com/opentx/opentx/issues/3160>#3160</a>)</li>
<li>Various rounding problem fixed: Telemetry sensor Ratio parameter (<a href=https://github.com/opentx/opentx/issues/3117>#3117</a>),
Outputs Sub-trim, Min and Max values (<a href=https://github.com/opentx/opentx/issues/3156>#3156</a>)</li>
<li>Fixed: telemetry sensors Ratio and Offset value increment/decrement step (<a href=https://github.com/opentx/opentx/issues/3121>#3121</a>)</li>
<li>Hardware/Calibration tab split int two tabs (<a href=https://github.com/opentx/opentx/issues/2974>#2974</a>)</li>
<li>Fixed Fahrenheit temperature conversion error (if PREC was not 0) (<a href=https://github.com/opentx/opentx/issues/3146>#3146</a>)</li>
<li>Application Setting 'Enable automatic backup before writing firmware' was not saved (<a href=https://github.com/opentx/opentx/issues/3040>#3040</a>)</li>
<li>Fixed RPM package problem on Fedora (<a href=https://github.com/opentx/opentx/issues/3130>#3130</a>)</li>
<li>Fixed conversion errors when loading 2.0.x EEPE (<a href=https://github.com/opentx/opentx/issues/3177>#3177</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.6 / 2015-11-11</h2>
[Taranis]
<ul>
<li>Telemetry custom screen changes didn't emit modified signal (<a href=https://github.com/opentx/opentx/issues/3029>#3029</a>)</li>
<li>Hide D8/LR12 when eu firmware option is selected</li>
+131 -117
View File
@@ -1,12 +1,20 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(SIMULATOR_INSTALL_PREFIX "" CACHE STRING "Alternative simulator library search path")
if(${CMAKE_SYSTEM_NAME} MATCHES "(Linux|FreeBSD)")
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (NOT ${SIMULATOR_INSTALL_PREFIX} STREQUAL "")
set(SIMULATOR_LIB_PATH ${SIMULATOR_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else()
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
endif()
message(STATUS "Simulators library search path: " ${SIMULATOR_LIB_PATH})
set(SIMULATOR_LIB_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else()
set(COMPANION_NAME "companion")
set(SIMULATOR_NAME "simulator")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
# This the name that the user will see in the generated DMG and what the application
# will be called under /Applications. We include the version string to make installing
@@ -17,6 +25,7 @@ set(COMPANION_OSX_APP_BUNDLE_NAME "OpenTX Companion ${VERSION_MAJOR}.${VERSION_M
# the binary (default homebrew path)
set(DFU_UTIL_PATH "/usr/local/bin/dfu-util")
set(AVRDUDE_PATH "/usr/local/bin/avrdude")
set(AVRDUDE_CONF "/usr/local/etc/avrdude.conf")
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
if(ALLOW_NIGHTLY_BUILDS)
@@ -49,12 +58,9 @@ endif()
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
add_definitions(-DJOYSTICKS)
else()
remove_definitions(-DSIMU_AUDIO)
endif()
add_definitions(-DSIMU)
add_definitions(-DQXT_STATIC)
add_definitions(${APP_COMMON_DEFINES}) # set in top-level CMakeLists
if(NOT MSVC)
set(WARNING_FLAGS "${WARNING_FLAGS} -Wall")
@@ -95,15 +101,104 @@ use_cxx11() # ensure gnu++11 in CXX_FLAGS with CMake < 3.1
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${COMPANION_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/shared
${SIMU_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/thirdparty/qxtcommandoptions
${COMPANION_SRC_DIRECTORY}/thirdparty/qcustomplot
${COMPANION_SRC_DIRECTORY}/thirdparty/miniz
${COMPANION_SRC_DIRECTORY}/storage
)
############# Do macro replacements on input files #############
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
############# Translations ###############
### Generate .qm files and assemble resource (qrc) file.
# available Companion translations (src/translations/*.ts)
set(LANGUAGES cs de en es fi fr it pl sv zh_CN)
foreach(language ${LANGUAGES})
list(APPEND companion_TS translations/companion_${language}.ts)
endforeach(language)
# .ts -> .qm
qt5_add_translation(companion_QM ${companion_TS})
# add Qt translations if found
if(QT_TRANSLATIONS_DIR)
# Some languages have all translations in one qt_*.qm file and others break them up into modules, in which case we need qt_base_*.qm
file(GLOB qtbase_QM "${QT_TRANSLATIONS_DIR}/qtbase_*.qm")
file(GLOB qt_QM "${QT_TRANSLATIONS_DIR}/qt_??.qm") # don't want to match "qt_help_*.qm"
list(APPEND qt_QM "${QT_TRANSLATIONS_DIR}/qt_zh_CN.qm" "${QT_TRANSLATIONS_DIR}/qt_zh_TW.qm") # exceptions not matched by the GLOB
else()
message(STATUS "QT_TRANSLATIONS_DIR not found, unable to package pre-built Qt translations with application.")
endif()
set(TRANSLATIONS_QRC "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc")
# Dynamically create translations.qrc file (XML) from all collected translation files.
foreach(qm_file ${companion_QM} ${qt_QM} ${qtbase_QM})
get_filename_component(qm_file_name ${qm_file} NAME)
# Add file with full path and file name (w/out path) as alias to be used in actual code
set(TRANSLATION_FILES_LIST "${TRANSLATION_FILES_LIST} <file alias=\"${qm_file_name}\">${qm_file}</file>\n")
endforeach()
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${TRANSLATIONS_QRC} @ONLY)
### Add optional "translations" target for updating .ts files
if(QT_LUPDATE_EXECUTABLE)
add_custom_target(translations
WORKING_DIRECTORY ${COMPANION_SRC_DIRECTORY}
COMMAND ${QT_LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
message(STATUS "Qt lupdate not found, 'translations' target will not be availabe.")
endif()
############# Common lib ###############
set(common_SRCS
appdebugmessagehandler.cpp
boards.cpp
customdebug.cpp
eeprominterface.cpp
helpers.cpp
radiodata.cpp
translations.cpp
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/opentxinterface.cpp
modeledit/node.cpp # used in simulator
modeledit/edge.cpp # used by node
)
set(common_MOC_HDRS
appdebugmessagehandler.h
helpers.h
modeledit/node.h
)
set(common_RESOURCES
companion.qrc
${TRANSLATIONS_QRC}
)
qt5_wrap_cpp(common_SRCS ${common_MOC_HDRS})
qt5_add_resources(common_RCC ${common_RESOURCES})
#add_custom_target(gen_qrc DEPENDS ${common_RCC} ${companion_QM})
add_library(common ${common_SRCS} ${common_RCC})
qt5_use_modules(common Core Xml Widgets)
target_link_libraries(common PRIVATE simulation)
#add_dependencies(common gen_qrc)
set(CPN_COMMON_LIB common)
############# Supporting libraries ###############
add_subdirectory(shared)
@@ -112,31 +207,10 @@ add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(storage)
add_subdirectory(thirdparty/qcustomplot)
add_subdirectory(thirdparty/qxtcommandoptions)
############# Common lib ###############
set(common_SRCS
boards.cpp
eeprominterface.cpp
radiodata.cpp
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/opentxinterface.cpp
)
qt5_wrap_cpp(common_SRCS)
add_library(common ${common_SRCS})
qt5_use_modules(common Core Xml Widgets)
############# Companion ###############
set(companion_SRCS
helpers.cpp
helpers_html.cpp
mdichild.cpp
modelslist.cpp
@@ -145,7 +219,7 @@ set(companion_SRCS
burnconfigdialog.cpp
multimodelprinter.cpp
comparedialog.cpp
contributorsdialog.cpp
creditsdialog.cpp
releasenotesdialog.cpp
releasenotesfirmwaredialog.cpp
customizesplashdialog.cpp
@@ -168,6 +242,7 @@ set(companion_SRCS
radionotfound.cpp
wizarddata.cpp
wizarddialog.cpp
multiprotocols.cpp
)
set(companion_MOC_HDRS
@@ -178,7 +253,7 @@ set(companion_MOC_HDRS
printdialog.h
fusesdialog.h
logsdialog.h
contributorsdialog.h
creditsdialog.h
releasenotesdialog.h
releasenotesfirmwaredialog.h
customizesplashdialog.h
@@ -195,7 +270,6 @@ set(companion_MOC_HDRS
mdichild.h
mainwindow.h
radionotfound.h
helpers.h
wizarddialog.h
modelprinter.h
multimodelprinter.h
@@ -222,84 +296,25 @@ set(companion_UIS
radionotfound.ui
)
set(companion_RESOURCES
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
if(WIN32)
list(APPEND companion_SRCS icon.rc)
set(icon_RC icon.rc)
endif()
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})
set(LANGUAGES pl de fr es it sv cs fi zh)
foreach(language ${LANGUAGES})
list(APPEND companion_TS translations/companion_${language}.ts)
endforeach(language)
qt5_wrap_ui(companion_SRCS ${companion_UIS})
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
qt5_add_translation(companion_QM ${companion_TS})
qt5_add_resources(companion_RCC ${companion_RESOURCES})
add_custom_target(gen_qrc DEPENDS ${companion_RCC})
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${companion_SRCS} ${companion_RCC} ${companion_QM})
add_dependencies(${COMPANION_NAME} gen_qrc)
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${companion_SRCS} ${icon_RC})
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared storage ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${WIN_LINK_LIBRARIES})
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation ${CPN_COMMON_LIB} qcustomplot shared storage ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${WIN_LINK_LIBRARIES})
PrintTargetReport("${COMPANION_NAME}")
############# Standalone simulator ###############
set(simu_SRCS
modeledit/node.cpp
modeledit/edge.cpp
helpers.cpp
simulator.cpp
)
set(simu_SRCS simulator.cpp )
set(simu_MOC_HDRS
modeledit/node.h
helpers.h
)
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
if(WIN32)
list(APPEND simu_SRCS icon.rc)
endif()
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${simu_SRCS} ${companion_RCC})
add_dependencies(${SIMULATOR_NAME} gen_qrc)
qt5_use_modules(${SIMULATOR_NAME} Core Widgets Multimedia)
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common shared storage qxtcommandoptions ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${WIN_LINK_LIBRARIES})
############# Translations ####################
find_package(Lupdate)
if(LUPDATE_FOUND)
message(STATUS "Qt lupdate: " ${LUPDATE_EXECUTABLE})
add_custom_target(translations
WORKING_DIRECTORY ${COMPANION_SRC_DIRECTORY}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
message(STATUS "Qt lupdate not found, 'translations' target will not be availabe.")
endif()
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${simu_SRCS} ${icon_RC})
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation ${CPN_COMMON_LIB} storage ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${WIN_LINK_LIBRARIES})
############# Install ####################
@@ -319,7 +334,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "install " ${CMAKE_BINARY_DIR} " to " ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES ${simulator_plugins} DESTINATION "${SIMULATOR_LIB_PATH}")
install(FILES ${simulator_plugins} DESTINATION "${SIMULATOR_LIB_INSTALL_PATH}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
if(${CMAKE_INSTALL_PREFIX} MATCHES "/usr/local")
@@ -336,14 +351,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES images/linuxicons/512x512/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION ${INSTALL_TEMP_LIB_PFX}lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
install(FILES ../targets/linux/45-usbasp.rules DESTINATION ${INSTALL_TEMP_LIB_PFX}lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-usbasp.rules)
# Linux specific code
set(OperatingSystem "Linux")
elseif(WIN32)
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
set(INSTALL_TEMP_QTDLL_FILES Qt5Core Qt5Gui Qt5Widgets Qt5Xml Qt5Network Qt5PrintSupport Qt5Multimedia)
set(QT_DLL_DIR ${QT_LIB_DIR})
set(INSTALL_TEMP_QTDLL_FILES Qt5Core Qt5Gui Qt5Widgets Qt5Xml Qt5Network Qt5PrintSupport Qt5Multimedia Qt5Svg)
set(INSTALL_TEMP_ICUDLL_FILES icudt54.dll icuin54.dll icuuc54.dll)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(INSTALL_TEMP_QTDLL_SFX "d")
@@ -421,7 +436,7 @@ if(WIN32)
set(SYSDIR "$ENV{windir}/system32")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/companion.nsi @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/simulator.nsi @ONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/simulator.nsi @ONLY)
find_program(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
@@ -434,16 +449,16 @@ if(WIN32)
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/companion.nsi
COMMENT "Companion Windows NSIS Installer")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
COMMENT "Simulator Windows NSIS Installer")
# add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
# COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
# DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
# COMMENT "Simulator Windows NSIS Installer")
add_custom_target(installer
DEPENDS ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
DEPENDS ${PROJECT_BINARY_DIR}/companion/simulator-windows.exe
# DEPENDS ${PROJECT_BINARY_DIR}/companion/simulator-windows.exe
SOURCES ${PROJECT_BINARY_DIR}/companion/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
# SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
)
endif()
@@ -475,7 +490,6 @@ IF(APPLE)
RUNTIME DESTINATION bin COMPONENT Runtime
)
install(FILES ${simulator_plugins} DESTINATION "${companion_res_dir}" COMPONENT Runtime)
# Write qt.conf to tell qt where to find it plugins
@@ -489,7 +503,7 @@ IF(APPLE)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/companion/targets/mac/qt_menu.nib DESTINATION "${companion_res_dir}" COMPONENT Runtime)
# manually add the required plugins
foreach (plugin ${Qt5Multimedia_PLUGINS} ${Qt5PrintSupport_PLUGINS} ${Qt5Gui_PLUGINS})
foreach (plugin ${Qt5Multimedia_PLUGINS} ${Qt5PrintSupport_PLUGINS} ${Qt5Gui_PLUGINS} ${Qt5Svg_PLUGINS})
get_target_property(QPA_PLUGIN ${plugin} LOCATION)
get_filename_component(QPA_PLUGIN_FILENAME ${QPA_PLUGIN} NAME)
# Todo is there a nicer way to get the QT Plugin directory name?!
@@ -511,13 +525,12 @@ IF(APPLE)
# Copy dfu-util and avrdude, resolve symlink first
get_filename_component(DFU_UTIL_ABSOLUTE_PATH ${DFU_UTIL_PATH} REALPATH)
get_filename_component(AVRDUDE_ABSOLUTE_PATH ${AVRDUDE_PATH} REALPATH)
get_filename_component(AVRDUDECONF_ABSOLUTE_PATH ${AVRDUDE_CONF} REALPATH)
install(PROGRAMS ${DFU_UTIL_ABSOLUTE_PATH} ${AVRDUDE_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
install(FILES ${AVRDUDECONF_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
set(bundle_tools_path "\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/dfu-util;\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/avrdude")
# These needs to be relative to CMAKE_INSTALL_PREFIX
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE)
# Include depencies (adding frameworks, fixing the embbeded libraries)
# I get write errors without setting BU_CHMOD_BUNDLE_ITEMS even though it is
@@ -526,7 +539,7 @@ IF(APPLE)
include(BundleUtilities)
file(GLOB bundle_simulator_libs \"\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/libopentx-*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
set(BU_CHMOD_BUNDLE_ITEMS on)
fixup_bundle(\"${APPS}\" \"\${bundle_simulator_libs};${bundle_qt_libs};${bundle_tools_path}\" \"${QT_LIBRARY_DIR}\")
fixup_bundle(\"${APPS}\" \"\${bundle_simulator_libs};${bundle_qt_libs};${bundle_tools_path}\" \"${QT_LIB_DIR}\")
file(RENAME \"\${CMAKE_INSTALL_PREFIX}/${COMPANION_NAME}.app\" \"\${CMAKE_INSTALL_PREFIX}/${COMPANION_OSX_APP_BUNDLE_NAME}.app\")
" COMPONENT Runtime)
endif()
@@ -546,6 +559,7 @@ if(DPKG_PROGRAM)
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
elseif(APPLE)
set(CPACK_GENERATOR "DragNDrop")
+163
View File
@@ -0,0 +1,163 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* 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 "appdebugmessagehandler.h"
#include <QFileDevice>
AppDebugMessageHandler::AppDebugMessageHandler(QObject * parent) :
QObject(parent),
m_appDebugOutputLevel(APP_DBG_HANDLER_DEFAULT_LEVEL),
m_showSourcePath(APP_DBG_HANDLER_SHOW_SRC_PATH),
m_showFunctionDeclarations(APP_DBG_HANDLER_SHOW_FUNCTION_DECL)
{
m_srcPathFilter = QRegularExpression("^" APP_DBG_HANDLER_SRC_PATH "[\\\\\\/](.*?)$", QRegularExpression::InvertedGreedinessOption);
m_functionFilter = QRegularExpression("^.+?(\\w+\\().+$");
}
AppDebugMessageHandler * AppDebugMessageHandler::instance()
{
static AppDebugMessageHandler * _instance = NULL;
#if APP_DBG_HANDLER_ENABLE
if(_instance == NULL && !qApp->closingDown())
_instance = new AppDebugMessageHandler(qApp); // Ensure this object is cleaned up when the QApplication exits.
#endif
return _instance;
}
void AppDebugMessageHandler::setAppDebugOutputLevel(const quint8 & appDebugOutputLevel)
{
m_appDebugOutputLevel = appDebugOutputLevel;
}
void AppDebugMessageHandler::setShowSourcePath(bool showSourcePath)
{
m_showSourcePath = showSourcePath;
}
void AppDebugMessageHandler::setShowFunctionDeclarations(bool showFunctionDeclarations)
{
m_showFunctionDeclarations = showFunctionDeclarations;
}
void AppDebugMessageHandler::addOutputDevice(QIODevice * device)
{
if (device && !m_outputDevices.contains(device))
m_outputDevices.append(device);
}
void AppDebugMessageHandler::removeOutputDevice(QIODevice * device)
{
if (device) {
// no QVector::removeAll() in Qt < 5.4
int i = 0;
foreach (QIODevice * d, m_outputDevices) {
if (d == device)
m_outputDevices.remove(i);
++i;
}
}
}
void AppDebugMessageHandler::installAppMessageHandler()
{
m_defaultHandler = qInstallMessageHandler(g_appDebugMessageHandler);
}
void AppDebugMessageHandler::messageHandler(QtMsgType type, const QMessageLogContext & context, const QString & msg)
{
static const char symbols[] = { 'D', 'W', 'E', 'X', 'I' }; // correspond to QtMsgType enum
// normalize types, QtDebugMsg stays 0, QtInfoMsg becomes 1, rest are QtMsgType + 1
quint8 lvl = type;
if (type == QtInfoMsg)
lvl = 1;
else if (type > QtDebugMsg)
++lvl;
if (lvl < m_appDebugOutputLevel && type != QtFatalMsg)
return;
#if defined(Q_OS_LINUX) && (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
// Filter out lots of QPainter warnings from undocked QDockWidgets... hackish but effective (only workaround found so far)
if (lvl == 2 && QString(context.function).contains("QPainter::"))
return;
#endif
QString msgPattern = QString("[%1] ").arg(symbols[type]);
if (m_showSourcePath) {
QString file = QString("%1::").arg(context.file);
file.replace(m_srcPathFilter, "\\1");
msgPattern.append(file);
}
if (m_showFunctionDeclarations)
msgPattern.append(context.function);
else
msgPattern.append("%{function}()");
msgPattern.append(":%{line} -%{if-category} [%{category}]%{endif} %{message}");
if (type == QtFatalMsg)
msgPattern.append("\nBACKTRACE:\n%{backtrace depth=12 separator=\"\n\"}");
qSetMessagePattern(msgPattern);
if (!m_defaultHandler || m_outputDevices.size() || receivers(SIGNAL(messageOutput(quint8, const QString &)))) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
msgPattern = qFormatLogMessage(type, context, msg);
#else
msgPattern.replace("%{line}", QString::number(context.line));
msgPattern.replace("%{if-category} [%{category}]%{endif}", QString(context.category));
msgPattern.replace("%{message}", msg);
if (!m_showFunctionDeclarations) {
QString func = context.function;
msgPattern.replace("%{function}", func.replace(m_functionFilter, "\\1)"));
}
#endif
emit messageOutput(lvl, msgPattern);
foreach (QIODevice * d, m_outputDevices) {
if (d && d->isWritable() && (!d->property("level").isValid() || d->property("level").toInt() <= lvl)) {
d->write(qPrintable(msgPattern % "\n"));
if (QFileDevice * fd = qobject_cast<QFileDevice *>(d))
fd->flush();
}
}
}
// if (QThread::currentThread() == qApp->thread()) // gui thread
if (m_defaultHandler) {
m_defaultHandler(type, context, msg);
}
else {
fprintf(stderr, "%s", qPrintable(msgPattern));
if (type == QtFatalMsg)
abort();
}
}
// Message handler which is installed using qInstallMessageHandler. This needs to be global.
void g_appDebugMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
if (AppDebugMessageHandler::instance())
AppDebugMessageHandler::instance()->messageHandler(type, context, msg);
}
+142
View File
@@ -0,0 +1,142 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* 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 APPDEBUGMESSAGEHANDLER_H
#define APPDEBUGMESSAGEHANDLER_H
#include <cstdlib>
#include <iostream>
#include <QApplication>
#include <QDebug>
#include <QIODevice>
#include <QMessageLogContext>
#include <QObject>
#include <QRegularExpression>
#include <QString>
/*
* Custom debug/message handler class to work in conjunction with qDebug() family of functions.
* Formats all stderr output generated by the application in a consistent manner.
* It can also be used by other event listeners to intercept messages they may be interested in (connect to messageOutput() signal).
*
* Include this header to use qInfo() safely with Qt < v5.5 (qInfo becomes alias for qDebug).
*
* Note that the default message format can still be overriden by setting QT_MESSAGE_PATTERN environment variable at _runtime_.
* see: https://doc.qt.io/qt-5/qtglobal.html#qSetMessagePattern
*
* This is an app-wide "global" thread-safe singleton class, use it with AppDebugMessageHandler::instance().
* For example, at start of application:
*
* QApplication app(argc, argv);
* AppDebugMessageHandler::instance()->installAppMessageHandler();
*
* To connect to a signal:
*
* connect(AppDebugMessageHandler::instance(), &AppDebugMessageHandler::messageOutput, this, &DebugOutput::onAppDebugMessage);
*
* This singleton will self-destruct upon QApplication termination.
*
*/
#if defined(QT_DEBUG) || defined(DEBUG)
#define APP_DBG_HANDLER_IS_DBG_BUILD 1
#else
#define APP_DBG_HANDLER_IS_DBG_BUILD 0
#endif
// Enable/disable this custom handler handler entirely
#ifndef APP_DBG_HANDLER_ENABLE
#define APP_DBG_HANDLER_ENABLE 1
#endif
// Default log level (can also be set with setAppDebugOutputLevel()):
// 0 = debug+; 1 = info+; 2 = warn+; 3 = critical+; 4 = fatal only
#ifndef APP_DBG_HANDLER_DEFAULT_LEVEL
#define APP_DBG_HANDLER_DEFAULT_LEVEL 0
#endif
// Include source file path/name in output (filtered with APP_DBG_HANDLER_SRC_PATH)
#ifndef APP_DBG_HANDLER_SHOW_SRC_PATH
#define APP_DBG_HANDLER_SHOW_SRC_PATH APP_DBG_HANDLER_IS_DBG_BUILD
#endif
// Show just the function Class::name vs. full declaration with return and param types
#ifndef APP_DBG_HANDLER_SHOW_FUNCTION_DECL
#define APP_DBG_HANDLER_SHOW_FUNCTION_DECL 0
#endif
// base path for source file name filter, everything after this is kept; RegEx, non-greedy
#ifndef APP_DBG_HANDLER_SRC_PATH
#define APP_DBG_HANDLER_SRC_PATH ".*src"
#endif
// Make sure to include this header if using qInfo()
#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
#if defined(QT_NO_INFO_OUTPUT)
#define qInfo QT_NO_QDEBUG_MACRO
#else
#define qInfo qDebug
#endif
#define QtInfoMsg QtMsgType(4)
#endif
class AppDebugMessageHandler : public QObject
{
Q_OBJECT
public:
// This class implements the singleton design pattern and is therefore publicly accessible only through instance().
static AppDebugMessageHandler * instance();
AppDebugMessageHandler(AppDebugMessageHandler const &) = delete;
void operator = (AppDebugMessageHandler const &) = delete;
void setAppDebugOutputLevel(const quint8 & appDebugOutputLevel);
void setShowSourcePath(bool showSourcePath);
void setShowFunctionDeclarations(bool showFunctionDeclarations);
void addOutputDevice(QIODevice * device);
void removeOutputDevice(QIODevice * device);
void installAppMessageHandler();
void messageHandler(QtMsgType type, const QMessageLogContext & context, const QString & msg);
private:
// This class implements the singleton design pattern and therefore has only a private constructor.
explicit AppDebugMessageHandler(QObject * parent = Q_NULLPTR);
~AppDebugMessageHandler() { }
QtMessageHandler m_defaultHandler;
QRegularExpression m_srcPathFilter;
QRegularExpression m_functionFilter;
quint8 m_appDebugOutputLevel;
QVector<QIODevice *> m_outputDevices;
bool m_showSourcePath;
bool m_showFunctionDeclarations;
signals:
void messageOutput(quint8 level, const QString & msg);
};
// Message handler which is installed using qInstallMessageHandler. This needs to be global.
// Use AppDebugMessageHandler::instance()->installAppMessageHandler();
// instead of installing this function directly (it will verify this handler is enabled, etc).
void g_appDebugMessageHandler(QtMsgType, const QMessageLogContext &, const QString &);
#endif // APPDEBUGMESSAGEHANDLER_H
+84 -61
View File
@@ -23,13 +23,10 @@
#include "mainwindow.h"
#include "appdata.h"
#include "helpers.h"
#include "firmwareinterface.h"
#ifdef JOYSTICKS
#if defined(JOYSTICKS)
#include "joystick.h"
#include "joystickdialog.h"
#endif
#include <QDesktopServices>
#include <QtGui>
AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) :
QDialog(parent),
@@ -41,6 +38,8 @@ AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) :
initSettings();
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
connect(ui->opt_appDebugLog, &QCheckBox::toggled, this, &AppPreferencesDialog::toggleAppLogSettings);
connect(ui->opt_fwTraceLog, &QCheckBox::toggled, this, &AppPreferencesDialog::toggleAppLogSettings);
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
#if !defined(JOYSTICKS)
@@ -61,13 +60,13 @@ AppPreferencesDialog::~AppPreferencesDialog()
void AppPreferencesDialog::writeValues()
{
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
g.autoCheckApp(ui->autoCheckCompanion->isChecked());
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked());
g.OpenTxBranch(DownloadBranchType(ui->OpenTxBranch->currentIndex()));
g.autoCheckFw(ui->autoCheckFirmware->isChecked());
g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked());
g.useWizard(ui->modelWizard_CB->isChecked());
g.removeModelSlots(ui->opt_removeBlankSlots->isChecked());
g.newModelAction(ui->opt_newMdl_useWizard->isChecked() ? 1 : ui->opt_newMdl_useEditor->isChecked() ? 2 : 0);
g.historySize(ui->historySize->value());
g.backLight(ui->backLightColor->currentIndex());
g.profile[g.id()].volumeGain(round(ui->volumeGain->value() * 10.0));
@@ -76,8 +75,12 @@ void AppPreferencesDialog::writeValues()
g.embedSplashes(ui->splashincludeCB->currentIndex());
g.enableBackup(ui->backupEnable->isChecked());
g.appDebugLog(ui->opt_appDebugLog->isChecked());
g.fwTraceLog(ui->opt_fwTraceLog->isChecked());
g.appLogsDir(ui->appLogsDir->text());
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsCtrl(ui->joystickCB ->currentIndex());
}
else {
@@ -100,12 +103,13 @@ void AppPreferencesDialog::writeValues()
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();
QString id = current_firmware_variant->getId();
Firmware::setCurrentVariant(getFirmwareVariant());
QString id = Firmware::getCurrentVariant()->getId();
if (g.profile[g.id()].fwType() != id) {
g.profile[g.id()].fwName("");
g.profile[g.id()].initFwVariables();
g.profile[g.id()].fwType(id);
emit firmwareProfileChanged(g.id());
}
}
@@ -129,13 +133,10 @@ void AppPreferencesDialog::initSettings()
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
#if defined(ALLOW_NIGHTLY_BUILDS)
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
#else
ui->useCompanionNightlyBuilds->hide();
ui->useFirmwareNightlyBuilds->hide();
#if !defined(ALLOW_NIGHTLY_BUILDS)
// TODO should we gray out nightly builds here?
#endif
ui->OpenTxBranch->setCurrentIndex(g.OpenTxBranch());
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
ui->showSplash->setChecked(g.showSplash());
@@ -148,7 +149,10 @@ void AppPreferencesDialog::initSettings()
}
ui->simuSW->setChecked(g.simuSW());
ui->modelWizard_CB->setChecked(g.useWizard());
ui->opt_removeBlankSlots->setChecked(g.removeModelSlots());
ui->opt_newMdl_useNone->setChecked(g.newModelAction() == 0);
ui->opt_newMdl_useWizard->setChecked(g.newModelAction() == 1);
ui->opt_newMdl_useEditor->setChecked(g.newModelAction() == 2);
ui->libraryPath->setText(g.libDir());
ui->ge_lineedit->setText(g.gePath());
@@ -163,10 +167,15 @@ void AppPreferencesDialog::initSettings()
}
}
else {
ui->backupEnable->setDisabled(true);
ui->backupEnable->setDisabled(true);
}
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
ui->opt_appDebugLog->setChecked(g.appDebugLog());
ui->opt_fwTraceLog->setChecked(g.fwTraceLog());
ui->appLogsDir->setText(g.appLogsDir());
toggleAppLogSettings();
#if defined(JOYSTICKS)
ui->joystickChkB->setChecked(g.jsSupport());
if (ui->joystickChkB->isChecked()) {
@@ -193,7 +202,7 @@ void AppPreferencesDialog::initSettings()
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->setDisabled(true);
}
#endif
#endif
// Profile Tab Inits
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
@@ -213,9 +222,6 @@ void AppPreferencesDialog::initSettings()
}
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() == "" ) {
@@ -230,15 +236,14 @@ void AppPreferencesDialog::initSettings()
}
ui->lblGeneralSettings->setText(hwSettings);
Firmware * current_firmware = getCurrentFirmware();
foreach(Firmware * firmware, firmwares) {
QString currType = QStringList(g.profile[g.id()].fwType().split('-').mid(0, 2)).join('-');
foreach(Firmware * firmware, Firmware::getRegisteredFirmwares()) {
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
if (current_firmware->getFirmwareBase() == firmware) {
if (currType == firmware->getId()) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
}
}
baseFirmwareChanged();
}
@@ -285,6 +290,15 @@ void AppPreferencesDialog::on_ProfilebackupPathButton_clicked()
}
}
void AppPreferencesDialog::on_btn_appLogsDir_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this, tr("Select a folder for application logs"), ui->appLogsDir->text());
if (!fileName.isEmpty()) {
ui->appLogsDir->setText(fileName);
}
}
void AppPreferencesDialog::on_ge_pathButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
@@ -292,7 +306,7 @@ void AppPreferencesDialog::on_ge_pathButton_clicked()
ui->ge_lineedit->setText(fileName);
}
}
#if defined(JOYSTICKS)
void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) {
@@ -336,27 +350,18 @@ void AppPreferencesDialog::on_sdPathButton_clicked()
}
}
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(const QString & fileName)
{
// Start by clearing the label
ui->imageLabel->clear();
QImage image(fileName);
if (image.isNull())
if (fileName.isEmpty())
return false;
QImage image(fileName);
if (image.isNull())
return false;
ui->imageLabel->setPixmap(makePixMap(image));
ui->imageLabel->setFixedSize(getCurrentFirmware()->getCapability(LcdWidth), getCurrentFirmware()->getCapability(LcdHeight));
return true;
@@ -374,7 +379,7 @@ void AppPreferencesDialog::on_SplashSelect_clicked()
if (!fileName.isEmpty()){
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
displayImage(fileName);
ui->SplashFileName->setText(fileName);
}
@@ -391,14 +396,13 @@ void AppPreferencesDialog::showVoice(bool show)
{
ui->voiceLabel->setVisible(show);
ui->voiceCombo->setVisible(show);
QTimer::singleShot(0, this, SLOT(shrink()));
}
void AppPreferencesDialog::baseFirmwareChanged()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
QString selected_firmware = ui->downloadVerCB->currentData().toString();
foreach(Firmware * firmware, firmwares) {
foreach(Firmware * firmware, Firmware::getRegisteredFirmwares()) {
if (firmware->getId() == selected_firmware) {
populateFirmwareOptions(firmware);
break;
@@ -408,31 +412,31 @@ void AppPreferencesDialog::baseFirmwareChanged()
Firmware * AppPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
QString selected_firmware = ui->downloadVerCB->currentData().toString();
foreach(Firmware * firmware, firmwares) {
foreach(Firmware * firmware, Firmware::getRegisteredFirmwares()) {
QString id = firmware->getId();
if (id == selected_firmware) {
foreach(QCheckBox *cb, optionsCheckBoxes) {
if (cb->isChecked()) {
id += QString("-") + cb->text();
id += "-" + cb->text();
}
}
if (voice && voice->isChecked()) {
id += QString("-tts") + ui->voiceCombo->currentText();
id += "-tts" + ui->voiceCombo->currentText();
}
if (ui->langCombo->count()) {
id += QString("-") + ui->langCombo->currentText();
id += "-" + ui->langCombo->currentText();
}
return getFirmware(id);
return Firmware::getFirmwareForId(id);
}
}
// Should never occur...
return default_firmware_variant;
return Firmware::getDefaultVariant();
}
void AppPreferencesDialog::firmwareOptionChanged(bool state)
@@ -443,8 +447,8 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
}
Firmware * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
QVariant selected_firmware = ui->downloadVerCB->currentData();
foreach(firmware, Firmware::getRegisteredFirmwares()) {
if (firmware->getId() == selected_firmware) {
foreach(QList<Option> opts, firmware->opts) {
foreach(Option opt, opts) {
@@ -464,7 +468,15 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
}
}
}
}
}
}
void AppPreferencesDialog::toggleAppLogSettings()
{
bool vis = (ui->opt_appDebugLog->isChecked() || ui->opt_fwTraceLog->isChecked());
ui->appLogsDir->setVisible(vis);
ui->lbl_appLogsDir->setVisible(vis);
ui->btn_appLogsDir->setVisible(vis);
}
void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
@@ -473,7 +485,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
updateLock = true;
QString id = current_firmware_variant->getId();
QString id = Firmware::getCurrentVariant()->getId();
ui->langCombo->clear();
foreach(const char *lang, parent->languages) {
ui->langCombo->addItem(lang);
@@ -528,12 +540,23 @@ void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
showVoice(voice && voice->isChecked());
// TODO: Remove once splash replacement supported on Horus
// NOTE: 480x272 image causes issues on screens <800px high, needs a solution like scrolling once reinstated
if (IS_HORUS(parent->getBoard())) {
ui->widget_splashImage->hide();
ui->SplashFileName->setText("");
}
else {
ui->widget_splashImage->show();
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
displayImage(g.profile[g.id()].splashFile());
}
updateLock = false;
QTimer::singleShot(0, this, SLOT(shrink()));
QTimer::singleShot(50, this, SLOT(shrink()));
}
void AppPreferencesDialog::shrink()
{
resize(0,0);
adjustSize();
}
+5 -1
View File
@@ -40,6 +40,9 @@ class AppPreferencesDialog : public QDialog
~AppPreferencesDialog();
Joystick * joystick;
signals:
void firmwareProfileChanged(int profId);
private:
QList<QCheckBox *> optionsCheckBoxes;
bool updateLock;
@@ -59,6 +62,7 @@ class AppPreferencesDialog : public QDialog
void shrink();
void baseFirmwareChanged();
void firmwareOptionChanged(bool state);
void toggleAppLogSettings();
void writeValues();
void on_libraryPathButton_clicked();
@@ -69,9 +73,9 @@ class AppPreferencesDialog : public QDialog
void on_ge_pathButton_clicked();
void on_sdPathButton_clicked();
void on_removeProfileButton_clicked();
void on_SplashSelect_clicked();
void on_clearImageButton_clicked();
void on_btn_appLogsDir_clicked();
#if defined(JOYSTICKS)
void on_joystickChkB_clicked();
File diff suppressed because it is too large Load Diff
+232 -47
View File
@@ -21,79 +21,264 @@
#include "boards.h"
#include "macros.h"
// TODO remove all those constants
// Update: These are now all only used within this class.
// External access is only via getEEpromSize() and getFlashSize()
#define EESIZE_STOCK 2048
#define EESIZE_M128 4096
#define EESIZE_GRUVIN9X 4096
#define EESIZE_TARANIS (32*1024)
#define EESIZE_SKY9X (128*4096)
#define EESIZE_9XRPRO (128*4096)
#define EESIZE_MAX EESIZE_9XRPRO
// getFlashSize() (and these macros) is only used by radiointerface::getDfuArgs (perhaps can find a better way?)
#define FSIZE_STOCK (64*1024)
#define FSIZE_M128 (128*1024)
#define FSIZE_GRUVIN9X (256*1024)
#define FSIZE_TARANIS (512*1024)
#define FSIZE_SKY9X (256*1024)
#define FSIZE_9XRPRO (512*1024)
#define FSIZE_HORUS (2048*1024)
#define FSIZE_MAX FSIZE_HORUS
using namespace Board;
int getEEpromSize(Board::Type board)
void Boards::setBoardType(const Type & board)
{
if (board >= BOARD_UNKNOWN && board < BOARD_ENUM_COUNT)
m_boardType = board;
else
m_boardType = BOARD_UNKNOWN;
}
const int Boards::getEEpromSize(Board::Type board)
{
switch (board) {
case Board::BOARD_STOCK:
case BOARD_STOCK:
return EESIZE_STOCK;
case Board::BOARD_M128:
case BOARD_M128:
return EESIZE_M128;
case Board::BOARD_MEGA2560:
case Board::BOARD_GRUVIN9X:
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return EESIZE_GRUVIN9X;
case Board::BOARD_SKY9X:
case BOARD_SKY9X:
return EESIZE_SKY9X;
case Board::BOARD_9XRPRO:
case Board::BOARD_AR9X:
case BOARD_9XRPRO:
case BOARD_AR9X:
return EESIZE_9XRPRO;
case Board::BOARD_TARANIS_X7:
case Board::BOARD_TARANIS_X9D:
case Board::BOARD_TARANIS_X9DP:
case Board::BOARD_TARANIS_X9E:
case Board::BOARD_FLAMENCO:
case BOARD_TARANIS_X7:
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
case BOARD_TARANIS_X9E:
case BOARD_FLAMENCO:
return EESIZE_TARANIS;
case BOARD_UNKNOWN:
return EESIZE_MAX;
default:
return 0; // unlimited
}
}
Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index)
const int Boards::getFlashSize(Type board)
{
switch (board) {
case BOARD_STOCK:
return FSIZE_STOCK;
case BOARD_M128:
return FSIZE_M128;
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return FSIZE_GRUVIN9X;
case BOARD_SKY9X:
return FSIZE_SKY9X;
case BOARD_9XRPRO:
case BOARD_AR9X:
return FSIZE_9XRPRO;
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
case BOARD_TARANIS_X9E:
case BOARD_TARANIS_X7:
case BOARD_FLAMENCO:
return FSIZE_TARANIS;
case BOARD_X12S:
case BOARD_X10:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
default:
return 0;
}
}
const SwitchInfo Boards::getSwitchInfo(Board::Type board, unsigned index)
{
if (IS_TARANIS_X7(board)) {
const Board::SwitchInfo switches[] = {{Board::SWITCH_3POS, "SA"},
{Board::SWITCH_3POS, "SB"},
{Board::SWITCH_3POS, "SC"},
{Board::SWITCH_3POS, "SD"},
{Board::SWITCH_2POS, "SF"},
{Board::SWITCH_TOGGLE, "SH"}};
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_2POS, "SF"},
{SWITCH_TOGGLE, "SH"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_HORUS_OR_TARANIS(board)) {
const Board::SwitchInfo switches[] = {{Board::SWITCH_3POS, "SA"},
{Board::SWITCH_3POS, "SB"},
{Board::SWITCH_3POS, "SC"},
{Board::SWITCH_3POS, "SD"},
{Board::SWITCH_3POS, "SE"},
{Board::SWITCH_2POS, "SF"},
{Board::SWITCH_3POS, "SG"},
{Board::SWITCH_TOGGLE, "SH"},
{Board::SWITCH_3POS, "SI"},
{Board::SWITCH_3POS, "SJ"},
{Board::SWITCH_3POS, "SK"},
{Board::SWITCH_3POS, "SL"},
{Board::SWITCH_3POS, "SM"},
{Board::SWITCH_3POS, "SN"},
{Board::SWITCH_3POS, "SO"},
{Board::SWITCH_3POS, "SP"},
{Board::SWITCH_3POS, "SQ"},
{Board::SWITCH_3POS, "SR"}};
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_2POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_TOGGLE, "SH"},
{SWITCH_3POS, "SI"},
{SWITCH_3POS, "SJ"},
{SWITCH_3POS, "SK"},
{SWITCH_3POS, "SL"},
{SWITCH_3POS, "SM"},
{SWITCH_3POS, "SN"},
{SWITCH_3POS, "SO"},
{SWITCH_3POS, "SP"},
{SWITCH_3POS, "SQ"},
{SWITCH_3POS, "SR"}
};
if (index < DIM(switches))
return switches[index];
}
else {
const Board::SwitchInfo switches[] = {{Board::SWITCH_2POS, "THR"},
{Board::SWITCH_2POS, "RUD"},
{Board::SWITCH_2POS, "ELE"},
{Board::SWITCH_3POS, "3POS"},
{Board::SWITCH_2POS, "AIL"},
{Board::SWITCH_2POS, "GEA"},
{Board::SWITCH_TOGGLE, "TRN"}};
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "3POS"},
{SWITCH_2POS, "THR"},
{SWITCH_2POS, "RUD"},
{SWITCH_2POS, "ELE"},
{SWITCH_2POS, "AIL"},
{SWITCH_2POS, "GEA"},
{SWITCH_TOGGLE, "TRN"}
};
if (index < DIM(switches))
return switches[index];
}
return {Board::SWITCH_NOT_AVAILABLE, "???"};
}
return {SWITCH_NOT_AVAILABLE, "???"};
}
const int Boards::getCapability(Board::Type board, Board::Capability capability)
{
switch (capability) {
case Sticks:
return 4;
case Pots:
if (IS_TARANIS_X7(board))
return 2;
else if (IS_TARANIS_X9E(board))
return 4;
else
return 3;
case Sliders:
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board))
return 2;
else
return 0;
case MouseAnalogs:
if (IS_HORUS_X12S(board))
return 2;
else
return 0;
case Switches:
if (IS_TARANIS_X9E(board))
return 18;
else if (IS_TARANIS_X7(board))
return 6;
else if (IS_HORUS_OR_TARANIS(board))
return 8;
else
return 7;
case FactoryInstalledSwitches:
if (IS_TARANIS_X9E(board))
return 8;
else
return getCapability(board, Switches);
case SwitchPositions:
if (IS_HORUS_OR_TARANIS(board))
return getCapability(board, Switches) * 3;
else
return 9;
case NumTrims:
if (IS_HORUS(board))
return 6;
else
return 4;
case NumTrimSwitches:
return getCapability(board, NumTrims) * 2;
}
return 0;
}
const QString Boards::getAxisName(int index)
{
const QString axes[] = {
QObject::tr("Left Horizontal"),
QObject::tr("Left Vertical"),
QObject::tr("Right Vertical"),
QObject::tr("Right Horizontal"),
QObject::tr("Aux. 1"),
QObject::tr("Aux. 2"),
};
if (index < (int)DIM(axes))
return axes[index];
else
return QObject::tr("Unknown");
}
/* Currently unused
const QString Boards::getBoardName(Board::Type board)
{
switch (board) {
case BOARD_STOCK:
return "9X";
case BOARD_M128:
return "9X128";
case BOARD_GRUVIN9X:
return "Gruvin9x";
case BOARD_MEGA2560:
return "MEGA2560";
case BOARD_TARANIS_X7:
return "Taranis X7";
case BOARD_TARANIS_X9D:
return "Taranis X9D";
case BOARD_TARANIS_X9DP:
return "Taranis X9D+";
case BOARD_TARANIS_X9E:
return "Taranis X9E";
case BOARD_SKY9X:
return "Sky9x";
case BOARD_9XRPRO:
return "9XR-PRO";
case BOARD_AR9X:
return "AR9X";
case BOARD_X12S:
return "Horus";
case BOARD_X10:
return "X10";
default:
return QObject::tr("Unknown");
}
}
*/
+90 -24
View File
@@ -21,13 +21,17 @@
#ifndef _BOARDS_H_
#define _BOARDS_H_
#include <QObject>
#include <QString>
// TODO create a Board class with all these functions
namespace Board {
enum Type
{
BOARD_STOCK,
BOARD_UNKNOWN = -1,
BOARD_STOCK = 0,
BOARD_M128,
BOARD_MEGA2560,
BOARD_GRUVIN9X,
@@ -39,8 +43,9 @@ namespace Board {
BOARD_TARANIS_X9DP,
BOARD_TARANIS_X9E,
BOARD_FLAMENCO,
BOARD_HORUS,
BOARD_UNKNOWN = -1
BOARD_X12S,
BOARD_X10,
BOARD_ENUM_COUNT
};
enum PotType
@@ -65,10 +70,57 @@ namespace Board {
SWITCH_3POS
};
enum StickAxes {
STICK_AXIS_LH = 0,
STICK_AXIS_LV,
STICK_AXIS_RV,
STICK_AXIS_RH,
STICK_AXIS_COUNT
};
enum TrimAxes {
TRIM_AXIS_LH = 0,
TRIM_AXIS_LV,
TRIM_AXIS_RV,
TRIM_AXIS_RH,
TRIM_AXIS_T5,
TRIM_AXIS_T6,
TRIM_AXIS_COUNT
};
enum TrimSwitches
{
TRIM_SW_LH_DEC,
TRIM_SW_LH_INC,
TRIM_SW_LV_DEC,
TRIM_SW_LV_INC,
TRIM_SW_RV_DEC,
TRIM_SW_RV_INC,
TRIM_SW_RH_DEC,
TRIM_SW_RH_INC,
TRIM_SW_T5_DEC,
TRIM_SW_T5_INC,
TRIM_SW_T6_DEC,
TRIM_SW_T6_INC,
TRIM_SW_COUNT
};
enum Capability {
Sticks,
Pots,
Sliders,
MouseAnalogs,
Switches,
SwitchPositions,
FactoryInstalledSwitches,
NumTrims,
NumTrimSwitches
};
struct SwitchInfo
{
SwitchType config;
const char * name;
QString name;
};
struct SwitchPosition {
@@ -80,29 +132,41 @@ namespace Board {
unsigned int index;
unsigned int position;
};
}
// TODO remove all those constants
#define EESIZE_STOCK 2048
#define EESIZE_M128 4096
#define EESIZE_GRUVIN9X 4096
#define EESIZE_TARANIS (32*1024)
#define EESIZE_SKY9X (128*4096)
#define EESIZE_9XRPRO (128*4096)
#define EESIZE_MAX EESIZE_9XRPRO
class Boards
{
public:
// TODO remove all those constants
#define FSIZE_STOCK (64*1024)
#define FSIZE_M128 (128*1024)
#define FSIZE_GRUVIN9X (256*1024)
#define FSIZE_TARANIS (512*1024)
#define FSIZE_SKY9X (256*1024)
#define FSIZE_9XRPRO (512*1024)
#define FSIZE_HORUS (2048*1024)
#define FSIZE_MAX FSIZE_HORUS
Boards(Board::Type board)
{
setBoardType(board);
}
int getEEpromSize(Board::Type board);
Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index);
void setBoardType(const Board::Type & board);
Board::Type getBoardType() const { return m_boardType; }
const int getEEpromSize() { return getEEpromSize(m_boardType); }
const int getFlashSize() { return getFlashSize(m_boardType); }
const Board::SwitchInfo getSwitchInfo(unsigned index) { return getSwitchInfo(m_boardType, index); }
const int getCapability(Board::Capability capability) { return getCapability(m_boardType, capability); }
static const int getEEpromSize(Board::Type board);
static const int getFlashSize(Board::Type board);
static const Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index);
static const int getCapability(Board::Type board, Board::Capability capability);
static const QString getAxisName(int index);
protected:
Board::Type m_boardType;
};
// temporary aliases for transition period, use Boards class instead.
#define getBoardCapability(b__, c__) Boards::getCapability(b__, c__)
#define getEEpromSize(b__) Boards::getEEpromSize(b__)
#define getSwitchInfo(b__, i__) Boards::getSwitchInfo(b__, i__)
#define IS_9X(board) (board==Board::BOARD_STOCK || board==Board::BOARD_M128)
#define IS_STOCK(board) (board==Board::BOARD_STOCK)
@@ -115,7 +179,9 @@ Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index);
#define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
#define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
#define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board))
#define IS_HORUS(board) (board==Board::BOARD_HORUS)
#define IS_HORUS_X12S(board) (board==Board::BOARD_X12S)
#define IS_HORUS_X10(board) (board==Board::BOARD_X10)
#define IS_HORUS(board) (IS_HORUS_X12S(board) || IS_HORUS_X10(board))
#define IS_HORUS_OR_TARANIS(board) (IS_HORUS(board) || IS_TARANIS(board))
#define IS_FLAMENCO(board) (board==Board::BOARD_FLAMENCO)
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
+17
View File
@@ -105,6 +105,18 @@ burnConfigDialog::~burnConfigDialog()
delete ui;
}
QStringList burnConfigDialog::getAvrdudeArgs()
{
QStringList args = avrArgs;
if (!avrPort.isEmpty())
args << "-P" << avrPort;
#if defined(__APPLE__)
args << "-C" << QFileInfo(QApplication::applicationDirPath() + "/../Resources/avrdude.conf").absoluteFilePath();
#endif
return args;
}
void burnConfigDialog::getSettings()
{
avrLoc = g.avrdudeLocation();
@@ -125,6 +137,11 @@ void burnConfigDialog::getSettings()
sambaLoc = "/usr/local/bin/sam-ba";
if ( dfuLoc.isEmpty())
dfuLoc = QFileInfo(QApplication::applicationDirPath() + "/../Resources/dfu-util").absoluteFilePath();
#elif defined __FreeBSD__
if (avrLoc.isEmpty())
avrLoc = "/usr/local/bin/avrdude";
if (dfuLoc.isEmpty())
dfuLoc = "/usr/local/bin/dfu-util";
#else
if ( avrLoc.isEmpty())
avrLoc = "/usr/bin/avrdude";
+1 -1
View File
@@ -42,7 +42,7 @@ public:
QString getAVRDUDE() {return avrLoc;}
QString getSAMBA() {return sambaLoc;}
QString getDFU() {return dfuLoc;}
QStringList getAvrdudeArgs() { QStringList args = avrArgs; if (!avrPort.isEmpty()) args << "-P" << avrPort; return args; }
QStringList getAvrdudeArgs();
QStringList getDFUArgs() {return dfuArgs;}
QString getProgrammer() {return avrProgrammer;}
QString getMCU() {return avrMCU;}
+55 -28
View File
@@ -19,27 +19,25 @@
*/
#include <QApplication>
#include <QTranslator>
#include <QDateTime>
#include <QDir>
#include <QFile>
#include <QSplashScreen>
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
#include <SDL.h>
#undef main
#endif
#include "appdebugmessagehandler.h"
#include "customdebug.h"
#include "mainwindow.h"
#include "version.h"
#include "appdata.h"
#include "storage.h"
#if defined _MSC_VER || !defined __GNUC__
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#endif
#include "translations.h"
#ifdef __APPLE__
#include <QProxyStyle>
#include <QProxyStyle>
class MyProxyStyle : public QProxyStyle
{
@@ -55,18 +53,38 @@ class MyProxyStyle : public QProxyStyle
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(companion);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
/* From doc: This attribute must be set before Q(Gui)Application is constructed. */
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
app.setApplicationName("OpenTX Companion");
app.setOrganizationName("OpenTX");
app.setOrganizationDomain("open-tx.org");
app.setApplicationName(APP_COMPANION);
app.setOrganizationName(COMPANY);
app.setOrganizationDomain(COMPANY_DOMAIN);
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
Q_INIT_RESOURCE(companion);
if (AppDebugMessageHandler::instance())
AppDebugMessageHandler::instance()->installAppMessageHandler();
CustomDebug::setFilterRules();
if (!g.hasCurrentSettings()) {
QString previousVersion;
if (g.findPreviousVersionSettings(&previousVersion)) {
QMessageBox msgBox;
msgBox.setText(QObject::tr("We have found existing settings for Companion version: %1.\nDo you want to import them?").arg(previousVersion));
msgBox.setIcon(QMessageBox::Information);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
g.importSettings(previousVersion);
}
}
g.init();
QStringList strl = QApplication::arguments();
@@ -76,18 +94,20 @@ int main(int argc, char *argv[])
exit(0);
}
QFile dbgLog;
if (AppDebugMessageHandler::instance() && g.appDebugLog() && !g.appLogsDir().isEmpty() && QDir().mkpath(g.appLogsDir())) {
QString fn = g.appLogsDir() % "/CompanionDebug_" % QDateTime::currentDateTime().toString("yy-MM-dd_HH-mm-ss") % ".log";
dbgLog.setFileName(fn);
if (dbgLog.open(QIODevice::WriteOnly | QIODevice::Text)) {
AppDebugMessageHandler::instance()->addOutputDevice(&dbgLog);
}
}
#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"));
Translations::installTranslators();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
@@ -101,13 +121,13 @@ int main(int argc, char *argv[])
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
}
#endif
registerStorageFactories();
registerOpenTxFirmwares();
registerSimulators();
SimulatorLoader::registerSimulators();
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
g.profile[g.id()].fwType(Firmware::getDefaultVariant()->getId());
g.profile[g.id()].fwName("");
}
@@ -117,7 +137,7 @@ int main(int argc, char *argv[])
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
current_firmware_variant = getFirmware(g.profile[g.id()].fwType());
Firmware::setCurrentVariant(Firmware::getFirmwareForId(g.profile[g.id()].fwType()));
MainWindow *mainWin = new MainWindow();
if (g.showSplash()) {
@@ -134,13 +154,20 @@ int main(int argc, char *argv[])
delete splash;
delete mainWin;
unregisterSimulators();
SimulatorLoader::unregisterSimulators();
unregisterOpenTxFirmwares();
unregisterEEpromInterfaces();
unregisterStorageFactories();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
#endif
qDebug() << "COMPANION EXIT" << result;
if (dbgLog.isOpen()) {
AppDebugMessageHandler::instance()->removeOutputDevice(&dbgLog);
dbgLog.close();
}
return result;
}
+81 -18
View File
@@ -3,7 +3,6 @@
<file>images/customize.png</file>
<file>icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../releasenotes.txt</file>
<file>images/screenshot.png</file>
<file>images/splash.png</file>
@@ -12,23 +11,68 @@
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/taranison.png</file>
<file>images/simulator/icons/8/lock-locked.png</file>
<file>images/simulator/icons/8/lock-unlocked.png</file>
<file>images/simulator/Horus/middle.png</file>
<file>images/simulator/Horus/left.png</file>
<file>images/simulator/Horus/right.png</file>
<file>images/simulator/Horus/top.png</file>
<file>images/simulator/Horus/bottom.png</file>
<file>images/simulator/Horus/led.png</file>
<file>images/simulator/Horus/border-right.png</file>
<file>images/simulator/Horus/left_btn1.png</file>
<file>images/simulator/Horus/left_btn2.png</file>
<file>images/simulator/Horus/left_scrnsht.png</file>
<file>images/simulator/Horus/right_btnU.png</file>
<file>images/simulator/Horus/right_btnL.png</file>
<file>images/simulator/Horus/right_btnD.png</file>
<file>images/simulator/Horus/right_btnR.png</file>
<file>images/simulator/Horus/right_ent.png</file>
<file>images/simulator/icons/svg/arrow_click.svg</file>
<file>images/simulator/icons/svg/camera.svg</file>
<file>images/simulator/icons/svg/camera-active.svg</file>
<file>images/simulator/icons/svg/console.svg</file>
<file>images/simulator/icons/svg/console-active.svg</file>
<file>images/simulator/icons/svg/eraser.svg</file>
<file>images/simulator/icons/svg/eraser-active.svg</file>
<file>images/simulator/icons/svg/fixed_x.svg</file>
<file>images/simulator/icons/svg/fixed_x-on.svg</file>
<file>images/simulator/icons/svg/fixed_y.svg</file>
<file>images/simulator/icons/svg/fixed_y-on.svg</file>
<file>images/simulator/icons/svg/folder_open.svg</file>
<file>images/simulator/icons/svg/hold_x.svg</file>
<file>images/simulator/icons/svg/hold_x-on.svg</file>
<file>images/simulator/icons/svg/hold_y.svg</file>
<file>images/simulator/icons/svg/hold_y-on.svg</file>
<file>images/simulator/icons/svg/info.svg</file>
<file>images/simulator/icons/svg/info-active.svg</file>
<file>images/simulator/icons/svg/joystick_settings.svg</file>
<file>images/simulator/icons/svg/joystick_settings-active.svg</file>
<file>images/simulator/icons/svg/line_horiz.svg</file>
<file>images/simulator/icons/svg/mouse.svg</file>
<file>images/simulator/icons/svg/toggle_lock.svg</file>
<file>images/simulator/icons/svg/toggle_lock-on.svg</file>
<file>images/simulator/icons/svg/radio_outputs.svg</file>
<file>images/simulator/icons/svg/radio_outputs-active.svg</file>
<file>images/simulator/icons/svg/reload_script.svg</file>
<file>images/simulator/icons/svg/reload_script-active.svg</file>
<file>images/simulator/icons/svg/restart.svg</file>
<file>images/simulator/icons/svg/restart-active.svg</file>
<file>images/simulator/icons/svg/telemetry.svg</file>
<file>images/simulator/icons/svg/telemetry-active.svg</file>
<file>images/simulator/icons/svg/trainer.svg</file>
<file>images/simulator/icons/svg/trainer-active.svg</file>
<file>images/simulator/icons/svg/word_wrap.svg</file>
<file>images/simulator/icons/svg/word_wrap-on.svg</file>
<file>images/simulator/X12/middle.png</file>
<file>images/simulator/X12/left.png</file>
<file>images/simulator/X12/right.png</file>
<file>images/simulator/X12/top.png</file>
<file>images/simulator/X12/bottom.png</file>
<file>images/simulator/X12/led.png</file>
<file>images/simulator/X12/border-right.png</file>
<file>images/simulator/X12/left_btn1.png</file>
<file>images/simulator/X12/left_btn2.png</file>
<file>images/simulator/X12/left_scrnsht.png</file>
<file>images/simulator/X12/right_btnU.png</file>
<file>images/simulator/X12/right_btnL.png</file>
<file>images/simulator/X12/right_btnD.png</file>
<file>images/simulator/X12/right_btnR.png</file>
<file>images/simulator/X12/right_ent.png</file>
<file>images/simulator/X10/left.png</file>
<file>images/simulator/X10/right.png</file>
<file>images/simulator/X10/top.png</file>
<file>images/simulator/X10/bottom.png</file>
<file>images/simulator/X10/left_mdl.png</file>
<file>images/simulator/X10/left_page.png</file>
<file>images/simulator/X10/left_scrnsht.png</file>
<file>images/simulator/X10/left_rtn.png</file>
<file>images/simulator/X10/left_sys.png</file>
<file>images/simulator/X10/left_tele.png</file>
<file>images/simulator/X10/right_ent.png</file>
<file>images/simulator/9X/9xdb.png</file>
<file>images/simulator/9X/9xdl.png</file>
<file>images/simulator/9X/9xdr.png</file>
@@ -83,6 +127,15 @@
<file>images/simulator/X7/right.png</file>
<file>images/simulator/X7/right_ent.png</file>
<file>images/simulator/X7/top.png</file>
<file>images/simulator/X9E/bottom.png</file>
<file>images/simulator/X9E/left.png</file>
<file>images/simulator/X9E/left_exit.png</file>
<file>images/simulator/X9E/left_menu.png</file>
<file>images/simulator/X9E/left_page.png</file>
<file>images/simulator/X9E/left_scrnshot.png</file>
<file>images/simulator/X9E/right.png</file>
<file>images/simulator/X9E/right_enter.png</file>
<file>images/simulator/X9E/top.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
@@ -180,6 +233,8 @@
<file>images/library/10702.png</file>
<file>images/library/10801.png</file>
<file>images/library/10802.png</file>
<file>themes/default/style.css</file>
<file>themes/default/style-osx.css</file>
<file>themes/monochrome/16/paintbrush.png</file>
<file>themes/monochrome/16/open.png</file>
<file>themes/monochrome/16/edit.png</file>
@@ -575,6 +630,7 @@
<file>themes/monoblue/16/contributors.png</file>
<file>themes/monoblue/16/stop.png</file>
<file>themes/monoblue/16/write_eeprom.png</file>
<file>themes/monoblue/16/sdsync.png</file>
<file>themes/monoblue/24/paintbrush.png</file>
<file>themes/monoblue/24/open.png</file>
<file>themes/monoblue/24/edit.png</file>
@@ -618,6 +674,7 @@
<file>themes/monoblue/24/contributors.png</file>
<file>themes/monoblue/24/stop.png</file>
<file>themes/monoblue/24/write_eeprom.png</file>
<file>themes/monoblue/24/sdsync.png</file>
<file>themes/monoblue/32/paintbrush.png</file>
<file>themes/monoblue/32/open.png</file>
<file>themes/monoblue/32/edit.png</file>
@@ -661,6 +718,7 @@
<file>themes/monoblue/32/contributors.png</file>
<file>themes/monoblue/32/stop.png</file>
<file>themes/monoblue/32/write_eeprom.png</file>
<file>themes/monoblue/32/sdsync.png</file>
<file>themes/monoblue/48/paintbrush.png</file>
<file>themes/monoblue/48/open.png</file>
<file>themes/monoblue/48/edit.png</file>
@@ -704,6 +762,7 @@
<file>themes/monoblue/48/contributors.png</file>
<file>themes/monoblue/48/stop.png</file>
<file>themes/monoblue/48/write_eeprom.png</file>
<file>themes/monoblue/48/sdsync.png</file>
<file>themes/monowhite/16/paintbrush.png</file>
<file>themes/monowhite/16/open.png</file>
<file>themes/monowhite/16/edit.png</file>
@@ -747,6 +806,7 @@
<file>themes/monowhite/16/contributors.png</file>
<file>themes/monowhite/16/stop.png</file>
<file>themes/monowhite/16/write_eeprom.png</file>
<file>themes/monowhite/16/sdsync.png</file>
<file>themes/monowhite/24/paintbrush.png</file>
<file>themes/monowhite/24/open.png</file>
<file>themes/monowhite/24/edit.png</file>
@@ -790,6 +850,7 @@
<file>themes/monowhite/24/contributors.png</file>
<file>themes/monowhite/24/stop.png</file>
<file>themes/monowhite/24/write_eeprom.png</file>
<file>themes/monowhite/24/sdsync.png</file>
<file>themes/monowhite/32/paintbrush.png</file>
<file>themes/monowhite/32/open.png</file>
<file>themes/monowhite/32/edit.png</file>
@@ -833,6 +894,7 @@
<file>themes/monowhite/32/contributors.png</file>
<file>themes/monowhite/32/stop.png</file>
<file>themes/monowhite/32/write_eeprom.png</file>
<file>themes/monowhite/32/sdsync.png</file>
<file>themes/monowhite/48/paintbrush.png</file>
<file>themes/monowhite/48/open.png</file>
<file>themes/monowhite/48/edit.png</file>
@@ -876,6 +938,7 @@
<file>themes/monowhite/48/contributors.png</file>
<file>themes/monowhite/48/stop.png</file>
<file>themes/monowhite/48/write_eeprom.png</file>
<file>themes/monowhite/48/sdsync.png</file>
<file>themes/yerico/16/paintbrush.png</file>
<file>themes/yerico/16/open.png</file>
<file>themes/yerico/16/edit.png</file>
+91 -58
View File
@@ -20,42 +20,46 @@
#include "comparedialog.h"
#include "ui_comparedialog.h"
#include "appdata.h"
#include "helpers.h"
#include "modelslist.h"
#include <QPrinter>
#include <QPrintDialog>
class DragDropHeader {
public:
DragDropHeader():
general_settings(false),
models_count(0)
{
}
bool general_settings;
uint8_t models_count;
uint8_t models[CPN_MAX_MODELS];
};
//class DragDropHeader {
// public:
// DragDropHeader():
// general_settings(false),
// models_count(0)
// {
// }
// bool general_settings;
// uint8_t models_count;
// uint8_t models[CPN_MAX_MODELS];
//};
CompareDialog::CompareDialog(QWidget * parent, Firmware * firmware):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
multimodelprinter(firmware),
model1Valid(false),
model2Valid(false),
QDialog(parent, Qt::Window),
multimodelprinter(new MultiModelPrinter(firmware)),
ui(new Ui::CompareDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("compare.png"));
setAcceptDrops(true);
if (!g.compareWinGeo().isEmpty()) {
restoreGeometry(g.compareWinGeo());
}
}
//setDragDropOverwriteMode(true);
//setDropIndicatorShown(true);
// TODO scroll to top ... ui->textEdit->scrollToAnchor("1");
CompareDialog::~CompareDialog()
{
delete multimodelprinter;
delete ui;
}
void CompareDialog::dragMoveEvent(QDragMoveEvent * event)
{
if (event->mimeData()->hasFormat("application/x-companion")) {
if (event->mimeData()->hasFormat("application/x-companion-modeldata")) {
event->acceptProposedAction();
}
else {
@@ -65,8 +69,7 @@ void CompareDialog::dragMoveEvent(QDragMoveEvent * event)
void CompareDialog::dragEnterEvent(QDragEnterEvent * event)
{
// accept just text/uri-list mime format
if (event->mimeData()->hasFormat("application/x-companion")) {
if (event->mimeData()->hasFormat("application/x-companion-modeldata")) {
event->acceptProposedAction();
}
else {
@@ -79,55 +82,85 @@ void CompareDialog::dragLeaveEvent(QDragLeaveEvent * event)
event->accept();
}
bool CompareDialog::handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label)
bool CompareDialog::handleMimeData(const QMimeData * mimeData)
{
if (mimeData->hasFormat("application/x-companion")) {
QByteArray gmData = mimeData->data("application/x-companion");
DragDropHeader * header = (DragDropHeader *)gmData.data();
if (!header->general_settings) {
char * gData = gmData.data() + sizeof(DragDropHeader);
if (gData[0] == 'M') {
ModelData * modeltemp = (ModelData *)(gData + 1);
if (modeltemp->used) {
memcpy(&model, modeltemp, sizeof(ModelData));
QString name(model.name);
if (!name.isEmpty())
label->setText(name);
else
label->setText(tr("No name"));
return true;
}
}
}
QVector<ModelData> mList;
GeneralSettings gs;
if (!TreeModel::decodeMimeData(mimeData, &mList, &gs) || mList.isEmpty())
return false;
for (int i=0; i < mList.size(); ++i) {
GMData data;
data.model = mList[i];
data.gs = gs;
modelsList.append(data);
}
return false;
return true;
}
void CompareDialog::closeEvent(QCloseEvent * event)
{
g.compareWinGeo(saveGeometry());
}
void CompareDialog::dropEvent(QDropEvent *event)
{
QLabel * child = qobject_cast<QLabel*>(childAt(event->pos()));
if (!child) return;
if (child->objectName().contains("label_1")) {
model1Valid = handleDroppedModel(event->mimeData(), model1, ui->label_1);
}
else if (child->objectName().contains("label_2")) {
model2Valid = handleDroppedModel(event->mimeData(), model2, ui->label_2);
}
event->accept();
if (model1Valid && model2Valid) {
multimodelprinter.setModel(0, model1);
multimodelprinter.setModel(1, model2);
ui->textEdit->setHtml(multimodelprinter.print(ui->textEdit->document()));
if (handleMimeData(event->mimeData())) {
event->accept();
compare();
}
}
void CompareDialog::closeEvent(QCloseEvent *event)
void CompareDialog::compare()
{
QLayoutItem *child;
while ((child = ui->layout_modelNames->takeAt(0))) {
if (child->widget())
delete child->widget();
delete child;
}
multimodelprinter->clearModels();
ui->textEdit->clear();
for (int i=0; i < modelsList.size(); ++i) {
multimodelprinter->setModel(i, &modelsList[i].model, &modelsList[i].gs);
QString name(modelsList.at(i).model.name);
if (name.isEmpty())
name = tr("Unnamed Model %1").arg(i+1);
QWidget * hdr = new QWidget(this);
hdr->setLayout(new QHBoxLayout());
hdr->layout()->setContentsMargins(0, 0, 0, 0);
hdr->layout()->setSpacing(2);
QToolButton * btn = new QToolButton(hdr);
btn->setIcon(CompanionIcon("clear.png"));
btn->setProperty("index", i);
btn->setFixedSize(18, 18);
btn->setToolTip(tr("Click to remove this model."));
hdr->layout()->addWidget(btn);
QLabel * lbl = new QLabel(name, this);
lbl->setStyleSheet("font-weight: bold;");
hdr->layout()->addWidget(lbl);
connect(btn, &QToolButton::clicked, this, &CompareDialog::removeModelBtnClicked);
ui->layout_modelNames->addWidget(hdr);
}
if (modelsList.size())
ui->textEdit->setHtml(multimodelprinter->print(ui->textEdit->document()));
}
CompareDialog::~CompareDialog()
void CompareDialog::removeModel(int idx)
{
delete ui;
if (idx < modelsList.size()) {
modelsList.remove(idx);
compare();
}
}
void CompareDialog::removeModelBtnClicked()
{
if (sender() && sender()->property("index").isValid())
removeModel(sender()->property("index").toInt());
}
void CompareDialog::on_printButton_clicked()
+20 -15
View File
@@ -35,27 +35,32 @@ class CompareDialog : public QDialog
public:
CompareDialog(QWidget *parent, Firmware * firmware);
~CompareDialog();
protected:
MultiModelPrinter multimodelprinter;
ModelData model1;
ModelData model2;
bool model1Valid;
bool model2Valid;
struct GMData {
ModelData model;
GeneralSettings gs;
};
MultiModelPrinter * multimodelprinter;
QVector<GMData> modelsList;
QMap<int, GMData> modelsMap;
Ui::CompareDialog * ui;
protected slots:
void removeModelBtnClicked();
void on_printButton_clicked();
void on_printFileButton_clicked();
protected:
void closeEvent(QCloseEvent * event);
bool handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label);
void dropEvent(QDropEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void printDiff();
virtual void closeEvent(QCloseEvent * event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event);
bool handleMimeData(const QMimeData * mimeData);
void compare();
void removeModel(int idx);
};
#endif // _COMPAREDIALOG_H_
+29 -53
View File
@@ -29,63 +29,22 @@
<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">
<item row="2" column="0">
<widget class="QTextEdit" name="textEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>To compare models, drag and drop them anywhere in this window.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -122,11 +81,28 @@
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="layout_modelNames">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<resources/>
<connections>
<connection>
<sender>closeButton</sender>
+37 -21
View File
@@ -21,6 +21,8 @@
#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_
#include <QCoreApplication>
#define CPN_MAX_MODELS 60
#define CPN_MAX_TIMERS 3
#define CPN_MAX_FLIGHT_MODES 9
@@ -30,34 +32,48 @@
#define CPN_MAX_CURVES 32
#define CPN_MAX_POINTS 17
#define CPN_MAX_GVARS 9
#define CPN_MAX_ENCODERS 2
#define CPN_MAX_ENCODERS 2 // rotary encoders
#define CPN_MAX_CHNOUT 32 // number of real output channels
#define CPN_MAX_CSW 64 // number of custom switches
#define CPN_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
#define CPN_MAX_LOGICAL_SWITCHES 64 // number of custom switches
#define CPN_MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
#define CPN_MAX_MODULES 2
#define CPN_MAX_STICKS 4
#define CPN_MAX_AUX_TRIMS 2
#define CPN_MAX_POTS 8
#define CPN_MAX_STICKS Board::STICK_AXIS_COUNT
#define CPN_MAX_TRIMS Board::TRIM_AXIS_COUNT
#define CPN_MAX_TRIM_SW Board::TRIM_SW_COUNT
#define CPN_MAX_KNOBS 4
#define CPN_MAX_SLIDERS 4
#define CPN_MAX_POTS (CPN_MAX_KNOBS + CPN_MAX_SLIDERS)
#define CPN_MAX_CYC 3
#define CPN_MAX_SWITCHES 32
#define CPN_MAX_KEYS 32
#define CPN_MAX_MOUSE_ANALOGS 2
#define CPN_MAX_ANALOGS (CPN_MAX_STICKS + CPN_MAX_POTS + CPN_MAX_MOUSE_ANALOGS)
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define DFU_FILES_FILTER "DFU files (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE files (*.eepe);;"
#define OTX_FILES_FILTER "OpenTX files (*.otx);;"
#define EEPROM_FILES_FILTER "Radio and Models settings files (*.otx *.eepe *.bin *.hex);;" OTX_FILES_FILTER EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex *.dfu);;" BIN_FILES_FILTER HEX_FILES_FILTER DFU_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 CPN_STR_FILES QCoreApplication::translate("Companion", "files")
#define CPN_STR_RAD_MOD_SETTINGS QCoreApplication::translate("Companion", "Radio and Models settings")
#define HEX_FILES_FILTER "HEX " % CPN_STR_FILES % " (*.hex);;"
#define BIN_FILES_FILTER "BIN " % CPN_STR_FILES % " (*.bin);;"
#define DFU_FILES_FILTER "DFU " % CPN_STR_FILES % " (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE " % CPN_STR_FILES % " (*.eepe);;"
#define OTX_FILES_FILTER "OpenTX " % CPN_STR_FILES % " (*.otx);;"
#define EEPROM_FILES_FILTER CPN_STR_RAD_MOD_SETTINGS % " " % CPN_STR_FILES % " (*.otx *.eepe *.bin *.hex);;" % OTX_FILES_FILTER % EEPE_FILES_FILTER % BIN_FILES_FILTER % HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH " % CPN_STR_FILES % " (*.bin *.hex *.dfu);;" % BIN_FILES_FILTER % HEX_FILES_FILTER % DFU_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM " % CPN_STR_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"
const char * const ARROW_LEFT = "\xE2\x86\x90";
const char * const ARROW_UP = "\xE2\x86\x91";
const char * const ARROW_RIGHT = "\xE2\x86\x92";
const char * const ARROW_DOWN = "\xE2\x86\x93";
#define CPN_STR_SW_INDICATOR_UP QCoreApplication::translate("RawSwitch", "\xE2\x86\x91") // Switch up position indicator: Up arrow, or similar.
#define CPN_STR_SW_INDICATOR_DN QCoreApplication::translate("RawSwitch", "\xE2\x86\x93") // Switch down position indicator: Down arrow, or similar.
#define CPN_STR_SW_INDICATOR_NEUT QCoreApplication::translate("RawSwitch", "-") // Switch neutral (middle) position indicator.
#define CPN_STR_SW_INDICATOR_REV QCoreApplication::translate("RawSwitch", "!") // Switch reversed logic (NOT) indicator.
enum DownloadBranchType {
BRANCH_RELEASE_STABLE,
BRANCH_RC_TESTING,
BRANCH_NIGHTLY_UNSTABLE
};
Q_DECLARE_METATYPE(DownloadBranchType)
#endif // _CONSTANTS_H_
@@ -18,12 +18,12 @@
* GNU General Public License for more details.
*/
#include "contributorsdialog.h"
#include "creditsdialog.h"
#include "ui_htmldialog.h"
#include "helpers.h"
#include <QFile>
ContributorsDialog::ContributorsDialog(QWidget * parent):
CreditsDialog::CreditsDialog(QWidget * parent):
QDialog(parent),
ui(new Ui::HtmlDialog)
{
@@ -42,42 +42,8 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
"</head>"
"<body class=\"normal\">";
QFile credits(":/CREDITS.txt");
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
if (line.trimmed() == "")
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Main Developers"), names, 3));
names.clear();
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
names.append(line.trimmed());
}
str.append(formatTable(tr("Other contributors"), names, 3));
}
QFile donations(":/DONATIONS.txt");
if (donations.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
if (line.trimmed() == "")
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Companies and projects who have donated to OpenTX"), names, 3));
names.clear();
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
names.append(line);
}
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
foreach(CreditsSection section, readCredits()) {
str.append(formatTable(sectionTitle(section.title), section.names, 3));
}
str.append("<table><tr><td class=\"normal\">&nbsp;</td></tr>" \
@@ -87,9 +53,9 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
#if 0
QFile blacklist(":/BLACKLIST.txt");
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
}
#endif
@@ -99,12 +65,45 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
ui->textEditor->setOpenExternalLinks(true);
}
ContributorsDialog::~ContributorsDialog()
CreditsDialog::~CreditsDialog()
{
delete ui;
}
QString ContributorsDialog::formatTable(const QString & title, const QStringList & names, int columns)
QList<CreditsDialog::CreditsSection> CreditsDialog::readCredits()
{
QFile credits(":/CREDITS.txt");
QList<CreditsSection> result;
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
while (!credits.atEnd()) {
QByteArray line = credits.readLine().trimmed();
if (line.size() >= 2) {
if (line.startsWith("[") && line.endsWith("]")) {
result.push_back(CreditsSection(line.mid(1, line.size() - 2)));
} else {
result.back().addName(line);
}
}
}
}
return result;
}
QString CreditsDialog::sectionTitle(const QString & title)
{
if (title == "Main developers")
return tr("Main developers");
else if (title == "Translators")
return tr("Translators");
else if (title == "Companies and projects who have donated to OpenTX")
return tr("Companies and projects who have donated to OpenTX");
else if (title == "People who have donated to OpenTX")
return tr("People who have donated to OpenTX");
else
return tr("Other contributors");
}
QString CreditsDialog::formatTable(const QString & title, const QStringList & names, int columns)
{
const float cwidth = 100.0 / columns;
QString str = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>" \
@@ -18,8 +18,8 @@
* GNU General Public License for more details.
*/
#ifndef _CONTRIBUTORSDIALOG_H_
#define _CONTRIBUTORSDIALOG_H_
#ifndef _CREDITSDIALOG_H_
#define _CREDITSDIALOG_H_
#include <QDialog>
@@ -27,17 +27,36 @@ namespace Ui {
class HtmlDialog;
}
class ContributorsDialog : public QDialog
class CreditsDialog : public QDialog
{
Q_OBJECT
class CreditsSection
{
public:
CreditsSection(const QString & title):
title(title)
{
}
void addName(const QString & name)
{
names.push_back(name);
}
QString title;
QStringList names;
};
public:
explicit ContributorsDialog(QWidget * parent = 0);
~ContributorsDialog();
explicit CreditsDialog(QWidget * parent = 0);
~CreditsDialog();
private:
Ui::HtmlDialog * ui;
QList<CreditsSection> readCredits();
QString sectionTitle(const QString & title);
QString formatTable(const QString & title, const QStringList & names, int colums);
};
#endif // _CONTRIBUTORSDIALOG_H_
#endif // _CREDITSDIALOG_H_
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* 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 "customdebug.h"
Q_LOGGING_CATEGORY(eepromImport, "eeprom.import")
Q_LOGGING_CATEGORY(simulatorInterfaceLoader, "simulator.interface.loader")
void CustomDebug::setFilterRules()
{
QString rules;
rules.append("eeprom.import=");
#if defined(DEBUG_STORAGE_IMPORT)
rules.append("true\n");
#else
rules.append("false\n");
#endif
rules.append("simulator.interface.*=true\n");
QLoggingCategory::setFilterRules(rules);
}
+10 -7
View File
@@ -21,15 +21,18 @@
#ifndef _CUSTOMDEBUG_H_
#define _CUSTOMDEBUG_H_
#include <QDebug>
#include <QLoggingCategory>
// Controls the generation of debug output for EEPROM import
#if defined(DEBUG_STORAGE_IMPORT)
inline QDebug eepromImportDebug() { return QDebug(QtDebugMsg); }
#else
#undef eepromImportDebug
inline QNoDebug eepromImportDebug() { return QNoDebug(); }
#endif
Q_DECLARE_LOGGING_CATEGORY(eepromImport) // "eeprom.import"
// Controls the generation of debug output of SimulatorLoader class
Q_DECLARE_LOGGING_CATEGORY(simulatorInterfaceLoader) // "simulator.interface.loader"
class CustomDebug
{
public:
static void setFilterRules();
};
#endif // _CUSTOMDEBUG_H_
+23 -25
View File
@@ -150,11 +150,9 @@ bool Side::saveImage()
return true;
}
//*** customizeSplashDialog Class ***
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
CustomizeSplashDialog::CustomizeSplashDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::customizeSplashDialog)
ui(new Ui::CustomizeSplashDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("paintbrush.png"));
@@ -185,22 +183,22 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
resize(0,0);
}
customizeSplashDialog::~customizeSplashDialog()
CustomizeSplashDialog::~CustomizeSplashDialog()
{
delete ui;
}
void customizeSplashDialog::on_copyRightToLeftButton_clicked() {
void CustomizeSplashDialog::on_copyRightToLeftButton_clicked() {
left.copyImage(right);
}
void customizeSplashDialog::on_copyLeftToRightButton_clicked() {
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)
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()) {
@@ -212,9 +210,9 @@ void customizeSplashDialog::loadFirmware(Side side)
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
void customizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
void customizeSplashDialog::loadPicture(Side side)
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++) {
@@ -232,9 +230,9 @@ void customizeSplashDialog::loadPicture(Side side)
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
void customizeSplashDialog::loadProfile(Side side)
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();
@@ -245,9 +243,9 @@ void customizeSplashDialog::loadProfile(Side side)
side.markSourceButton();
}
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
void customizeSplashDialog::libraryButton_clicked( Side side )
void CustomizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
void CustomizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
void CustomizeSplashDialog::libraryButton_clicked( Side side )
{
QString fileName;
SplashLibraryDialog *ld = new SplashLibraryDialog(this,&fileName);
@@ -258,9 +256,9 @@ void customizeSplashDialog::libraryButton_clicked( Side side )
}
}
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
void customizeSplashDialog::saveButton_clicked( Side side )
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));
@@ -272,9 +270,9 @@ void customizeSplashDialog::saveButton_clicked( Side side )
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)
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();
+5 -5
View File
@@ -26,7 +26,7 @@
namespace Ui
{
class customizeSplashDialog;
class CustomizeSplashDialog;
}
const int WIDTH_TARANIS = 212;
@@ -63,15 +63,15 @@ private:
LCDFormat *format;
};
class customizeSplashDialog : public QDialog
class CustomizeSplashDialog : public QDialog
{
Q_OBJECT
Side left;
Side right;
public:
explicit customizeSplashDialog(QWidget *parent = 0);
~customizeSplashDialog();
explicit CustomizeSplashDialog(QWidget *parent = 0);
~CustomizeSplashDialog();
private slots:
void on_leftLoadFwButton_clicked();
@@ -99,7 +99,7 @@ private:
void saveButton_clicked( Side );
void invertButton_clicked( Side );
Ui::customizeSplashDialog *ui;
Ui::CustomizeSplashDialog *ui;
enum sideEnum { LEFT, RIGHT };
};
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>customizeSplashDialog</class>
<widget class="QDialog" name="customizeSplashDialog">
<class>CustomizeSplashDialog</class>
<widget class="QDialog" name="CustomizeSplashDialog">
<property name="enabled">
<bool>true</bool>
</property>
+99 -76
View File
@@ -26,15 +26,24 @@
class DataField {
public:
DataField(const char *name=""):
DataField(DataField * parent, const char * name=""):
parent(parent),
name(name)
{
}
virtual const char *getName() { return name; }
virtual ~DataField() { }
virtual ~DataField()
{
}
virtual const QString & getName()
{
return name;
}
virtual unsigned int size() = 0;
virtual void ExportBits(QBitArray & output) = 0;
virtual void ImportBits(const QBitArray & input) = 0;
virtual unsigned int size() = 0;
QBitArray bytesToBits(QByteArray bytes)
{
@@ -84,9 +93,9 @@ class DataField {
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());
printf("%s (%dbytes) ", getName().toLatin1().constData(), bytes.count());
else
printf("%s (%dbits) ", getName(), bits.count());
printf("%s (%dbits) ", getName().toLatin1().constData(), 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))
@@ -99,13 +108,24 @@ class DataField {
}
protected:
const char *name;
virtual void setError(const QString & error)
{
if (parent) {
parent->setError(error);
}
else {
qWarning() << qPrintable(error);
}
}
DataField * parent;
QString name;
};
class ProxyField: public DataField {
public:
ProxyField():
DataField("Proxy")
explicit ProxyField(DataField * parent):
DataField(parent, "Proxy")
{
}
@@ -116,24 +136,24 @@ class ProxyField: public DataField {
template<class container, int N>
class BaseUnsignedField: public DataField {
public:
explicit BaseUnsignedField(container & field):
DataField("Unsigned"),
BaseUnsignedField(DataField * parent, container & field):
DataField(parent, "Unsigned"),
field(field),
min(0),
max(std::numeric_limits<container>::max())
{
}
BaseUnsignedField(container & field, const char * name):
DataField(name),
BaseUnsignedField(DataField * parent, container & field, const char * name):
DataField(parent, name),
field(field),
min(0),
max(std::numeric_limits<container>::max())
{
}
BaseUnsignedField(container & field, container min, container max, const char * name="Unsigned"):
DataField(name),
BaseUnsignedField(DataField * parent, container & field, container min, container max, const char * name="Unsigned"):
DataField(parent, name),
field(field),
min(min),
max(max)
@@ -161,7 +181,7 @@ class BaseUnsignedField: public DataField {
if (input[i])
field |= ((container)1<<i);
}
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
qCDebug(eepromImport) << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -182,18 +202,18 @@ template <int N>
class UnsignedField : public BaseUnsignedField<unsigned int, N>
{
public:
explicit UnsignedField(unsigned int & field):
BaseUnsignedField<unsigned int, N>(field)
UnsignedField(DataField * parent, unsigned int & field):
BaseUnsignedField<unsigned int, N>(parent, field)
{
}
UnsignedField(unsigned int & field, const char *name):
BaseUnsignedField<unsigned int, N>(field, name)
UnsignedField(DataField * parent, unsigned int & field, const char *name):
BaseUnsignedField<unsigned int, N>(parent, field, name)
{
}
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
BaseUnsignedField<unsigned int, N>(field, min, max, name)
UnsignedField(DataField * parent, unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
BaseUnsignedField<unsigned int, N>(parent, field, min, max, name)
{
}
};
@@ -201,8 +221,8 @@ class UnsignedField : public BaseUnsignedField<unsigned int, N>
template<int N>
class BoolField: public DataField {
public:
explicit BoolField(bool & field):
DataField("Bool"),
explicit BoolField(DataField * parent, bool & field):
DataField(parent, "Bool"),
field(field)
{
}
@@ -218,7 +238,7 @@ class BoolField: public DataField {
virtual void ImportBits(const QBitArray & input)
{
field = input[0] ? true : false;
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
qCDebug(eepromImport) << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -236,24 +256,24 @@ class BoolField: public DataField {
template<int N>
class SignedField: public DataField {
public:
SignedField(int & field):
DataField("Signed"),
SignedField(DataField * parent, int & field):
DataField(parent, "Signed"),
field(field),
min(INT_MIN),
max(INT_MAX)
{
}
SignedField(int & field, const char *name):
DataField(name),
SignedField(DataField * parent, int & field, const char *name):
DataField(parent, name),
field(field),
min(INT_MIN),
max(INT_MAX)
{
}
SignedField(int & field, int min, int max, const char *name="Signed"):
DataField(name),
SignedField(DataField * parent, int & field, int min, int max, const char *name="Signed"):
DataField(parent, name),
field(field),
min(min),
max(max)
@@ -288,7 +308,7 @@ class SignedField: public DataField {
}
field = (int)value;
eepromImportDebug() << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
qCDebug(eepromImport) << QString("\timported %1<%2>: 0x%3(%4)").arg(name).arg(N).arg(field, 0, 16).arg(field);
}
virtual unsigned int size()
@@ -305,8 +325,8 @@ class SignedField: public DataField {
template<int N>
class SpareBitsField: public UnsignedField<N> {
public:
SpareBitsField():
UnsignedField<N>(spare, 0, 0, "Spare"),
SpareBitsField(DataField * parent):
UnsignedField<N>(parent, spare, 0, 0, "Spare"),
spare(0)
{
}
@@ -317,8 +337,8 @@ class SpareBitsField: public UnsignedField<N> {
template<int N>
class CharField: public DataField {
public:
CharField(char * field, bool truncate=true, const char * name="Char"):
DataField(name),
CharField(DataField * parent, char * field, bool truncate=true, const char * name="Char"):
DataField(parent, name),
field(field),
truncate(truncate)
{
@@ -349,7 +369,7 @@ class CharField: public DataField {
}
field[i] = idx;
}
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
qCDebug(eepromImport) << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
}
virtual unsigned int size()
@@ -368,8 +388,8 @@ char idx2char(int8_t idx);
template<int N>
class ZCharField: public DataField {
public:
ZCharField(char * field, const char * name = "ZChar"):
DataField(name),
ZCharField(DataField * parent, char * field, const char * name = "ZChar"):
DataField(parent, name),
field(field)
{
}
@@ -407,7 +427,7 @@ class ZCharField: public DataField {
else
break;
}
eepromImportDebug() << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
qCDebug(eepromImport) << QString("\timported %1<%2>: '%3'").arg(name).arg(N).arg(field);
}
virtual unsigned int size()
@@ -421,19 +441,19 @@ class ZCharField: public DataField {
class StructField: public DataField {
public:
StructField(const char * name="Struct"):
DataField(name)
StructField(DataField * parent, const char * name="Struct"):
DataField(parent, name)
{
}
~StructField() {
foreach(DataField *field, fields) {
foreach(DataField * field, fields) {
delete field;
}
}
inline void Append(DataField *field) {
//eepromImportDebug() << QString("StructField(%1) appending field: %2").arg(name).arg(field->getName());
inline void Append(DataField * field) {
//qCDebug(eepromImport) << QString("StructField(%1) appending field: %2").arg(name).arg(field->getName());
fields.append(field);
}
@@ -451,7 +471,7 @@ class StructField: public DataField {
virtual void ImportBits(const QBitArray & input)
{
eepromImportDebug() << QString("\timporting %1[%2]:").arg(name).arg(fields.size());
qCDebug(eepromImport) << QString("\timporting %1[%2]:").arg(name).arg(fields.size());
int offset = 0;
foreach(DataField *field, fields) {
unsigned int size = field->size();
@@ -475,7 +495,7 @@ class StructField: public DataField {
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);
printf("%s (%d bytes)\n", getName().toLatin1().constData(), size()/8);
foreach(DataField *field, fields) {
offset = field->Dump(level+1, offset);
}
@@ -488,8 +508,8 @@ class StructField: public DataField {
class TransformedField: public DataField {
public:
TransformedField(DataField & field):
DataField(),
TransformedField(DataField * parent, DataField & field):
DataField(parent),
field(field)
{
}
@@ -506,13 +526,13 @@ class TransformedField: public DataField {
virtual void ImportBits(const QBitArray & input)
{
eepromImportDebug() << QString("\timporting TransformedField %1:").arg(field.getName());
qCDebug(eepromImport) << QString("\timporting TransformedField %1:").arg(field.getName());
field.ImportBits(input);
afterImport();
}
virtual const char *getName()
virtual const QString & getName()
{
return field.getName();
}
@@ -544,7 +564,7 @@ class ConversionTable {
after = 0;
for (std::list<ConversionTuple>::iterator it=exportTable.begin(); it!=exportTable.end(); it++) {
ConversionTuple tuple = *it;
ConversionTuple & tuple = *it;
if (before == tuple.a) {
after = tuple.b;
return true;
@@ -559,7 +579,7 @@ class ConversionTable {
after = 0;
for (std::list<ConversionTuple>::iterator it=importTable.begin(); it!=importTable.end(); it++) {
ConversionTuple tuple = *it;
ConversionTuple & tuple = *it;
if (before == tuple.b) {
after = tuple.a;
return true;
@@ -607,9 +627,9 @@ class ConversionTable {
template<class T>
class ConversionField: public TransformedField {
public:
ConversionField(int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(internalField),
internalField(_field, name),
ConversionField(DataField * parent, int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(parent, internalField),
internalField(this, _field, name),
field(field),
_field(0),
table(table),
@@ -623,9 +643,9 @@ class ConversionField: public TransformedField {
{
}
ConversionField(unsigned int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(internalField),
internalField((unsigned int &)_field, name),
ConversionField(DataField * parent, unsigned int & field, ConversionTable *table, const char *name, const QString & error = ""):
TransformedField(parent, internalField),
internalField(this, (unsigned int &)_field, name),
field((int &)field),
_field(0),
table(table),
@@ -639,9 +659,9 @@ class ConversionField: public TransformedField {
{
}
ConversionField(int & field, int (*exportFunc)(int), int (*importFunc)(int)):
TransformedField(internalField),
internalField(_field),
ConversionField(DataField * parent, int & field, int (*exportFunc)(int), int (*importFunc)(int)):
TransformedField(parent, internalField),
internalField(this, _field),
field(field),
_field(0),
table(NULL),
@@ -655,9 +675,9 @@ class ConversionField: public TransformedField {
{
}
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),
ConversionField(DataField * parent, int & field, int shift, int scale=0, int min=INT_MIN, int max=INT_MAX, const char *name = "Signed shifted"):
TransformedField(parent, internalField),
internalField(this, _field, name),
field(field),
_field(0),
table(NULL),
@@ -671,9 +691,9 @@ class ConversionField: public TransformedField {
{
}
ConversionField(unsigned int & field, int shift, int scale=0):
TransformedField(internalField),
internalField((unsigned int &)_field),
ConversionField(DataField * parent, unsigned int & field, int shift, int scale=0):
TransformedField(parent, internalField),
internalField(this, (unsigned int &)_field),
field((int &)field),
_field(0),
table(NULL),
@@ -696,16 +716,19 @@ class ConversionField: public TransformedField {
}
if (table) {
if (table->exportValue(_field, _field))
return;
if (!error.isEmpty())
EEPROMWarnings.push_back(error);
if (!table->exportValue(_field, _field)) {
setError(error.isEmpty() ? QObject::tr("Conversion error on field %1").arg(name) : error);
}
return;
}
if (shift) {
if (_field < min) _field = min + shift;
else if (_field > max) _field = max + shift;
else _field += shift;
if (_field < min)
_field = min + shift;
else if (_field > max)
_field = max + shift;
else
_field += shift;
}
if (exportFunc) {
@@ -733,7 +756,7 @@ class ConversionField: public TransformedField {
if (scale) {
field *= scale;
}
eepromImportDebug() << QString("\timported ConversionField<%1>:").arg(internalField.getName()) << QString(" before: %1, after: %2").arg(_field).arg(field);
qCDebug(eepromImport) << QString("\timported ConversionField<%1>:").arg(internalField.getName()) << QString(" before: %1, after: %2").arg(_field).arg(field);
}
protected:
+359 -242
View File
@@ -28,6 +28,7 @@
#include "wizarddata.h"
#include "firmwareinterface.h"
#include "macros.h"
#include "multiprotocols.h"
#include <stdio.h>
#include <list>
#include <float.h>
@@ -35,8 +36,6 @@
#include <stdlib.h>
#include <bitset>
std::list<QString> EEPROMWarnings;
const uint8_t chout_ar[] = { // First number is 0..23 -> template setup, Second is relevant channel out
1,2,3,4 , 1,2,4,3 , 1,3,2,4 , 1,3,4,2 , 1,4,2,3 , 1,4,3,2,
2,1,3,4 , 2,1,4,3 , 2,3,1,4 , 2,3,4,1 , 2,4,1,3 , 2,4,3,1,
@@ -115,6 +114,23 @@ void getEEPROMZString(char *dst, const char *src, int size)
}
}
QString getElementName(const QString & prefix, unsigned int index, const char * name = NULL, bool padding = false)
{
QString result = prefix;
if (padding)
result += QString("%1").arg(index, 2, 10, QChar('0'));
else
result += QString("%1").arg(index);
if (name) {
QString trimmed = QString(name).trimmed();
if (trimmed.length() > 0) {
result += ":" + QString(name).trimmed();
}
}
return result;
}
float ValToTim(int value)
{
return ((value < -109 ? 129+value : (value < 7 ? (113+value)*5 : (53+value)*10))/10.0);
@@ -135,27 +151,6 @@ int TimToVal(float value)
return (temp-129);
}
QString getSignedStr(int value)
{
return value > 0 ? QString("+%1").arg(value) : QString("%1").arg(value);
}
QString getGVarString(int16_t val, bool sign)
{
if (val >= -10000 && val <= 10000) {
if (sign)
return QString("%1%").arg(getSignedStr(val));
else
return QString("%1%").arg(val);
}
else {
if (val<0)
return QObject::tr("-GV%1").arg(-val-10000);
else
return QObject::tr("GV%1").arg(val-10000);
}
}
void SensorData::updateUnit()
{
if (type == TELEM_TYPE_CALCULATED) {
@@ -240,7 +235,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
{
RawSourceRange result;
Firmware * firmware = getCurrentFirmware();
Firmware * firmware = Firmware::getCurrentVariant();
int board = firmware->getBoard();
bool singleprec = (flags & RANGE_SINGLE_PRECISION);
@@ -495,16 +490,10 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
return result;
}
QString RotaryEncoderString(int index)
{
static const QString rotary[] = { QObject::tr("REa"), QObject::tr("REb") };
return CHECK_IN_ARRAY(rotary, index);
}
QString RawSource::toString(const ModelData * model) const
QString RawSource::toString(const ModelData * model, const GeneralSettings * const generalSettings) const
{
static const QString trims[] = {
QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA")
QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA"), QObject::tr("Trm5"), QObject::tr("Trm6")
};
static const QString special[] = {
@@ -526,73 +515,137 @@ QString RawSource::toString(const ModelData * model) const
QObject::tr("ACC"), QObject::tr("GPS Time"),
};
static const QString rotary[] = { QObject::tr("REa"), QObject::tr("REb") };
if (index<0) {
return QObject::tr("----");
}
QString result;
int genAryIdx = 0;
switch (type) {
case SOURCE_TYPE_VIRTUAL_INPUT:
{
QString result = QObject::tr("[I%1]").arg(index+1);
if (model && strlen(model->inputNames[index]) > 0) {
result += QString(model->inputNames[index]);
}
return result;
const char * name = NULL;
if (model)
name = model->inputNames[index];
return getElementName(QCoreApplication::translate("Input", "I"), index + 1, name);
}
case SOURCE_TYPE_LUA_OUTPUT:
return QObject::tr("LUA%1%2").arg(index/16+1).arg(QChar('a'+index%16));
case SOURCE_TYPE_STICK:
return getCurrentFirmware()->getAnalogInputName(index);
if (generalSettings) {
if (isPot(&genAryIdx))
result = QString(generalSettings->potName[genAryIdx]);
else if (isSlider(&genAryIdx))
result = QString(generalSettings->sliderName[genAryIdx]);
else if (isStick(&genAryIdx))
result = QString(generalSettings->stickName[genAryIdx]);
}
if (result.isEmpty())
result = getCurrentFirmware()->getAnalogInputName(index);;
return result;
case SOURCE_TYPE_TRIM:
return CHECK_IN_ARRAY(trims, index);
case SOURCE_TYPE_ROTARY_ENCODER:
return RotaryEncoderString(index);
return CHECK_IN_ARRAY(rotary, index);
case SOURCE_TYPE_MAX:
return QObject::tr("MAX");
case SOURCE_TYPE_SWITCH:
return getSwitchInfo(getCurrentBoard(), index).name;
if (generalSettings)
result = QString(generalSettings->switchName[index]);
if (result.isEmpty())
result = getSwitchInfo(getCurrentBoard(), index).name;
return result;
case SOURCE_TYPE_CUSTOM_SWITCH:
return QObject::tr("L%1").arg(index+1);
return RawSwitch(SWITCH_TYPE_VIRTUAL, index+1).toString();
case SOURCE_TYPE_CYC:
return QObject::tr("CYC%1").arg(index+1);
case SOURCE_TYPE_PPM:
return QObject::tr("TR%1").arg(index+1);
return getElementName(QCoreApplication::translate("Trainer", "TR"), index + 1);
case SOURCE_TYPE_CH:
return QObject::tr("CH%1").arg(index+1);
{
const char * name = NULL;
if (getCurrentFirmware()->getCapability(ChannelsName) && model)
name = model->limitData[index].name;
return getElementName(QCoreApplication::translate("Channel", "CH"), index + 1, name);
}
case SOURCE_TYPE_SPECIAL:
return CHECK_IN_ARRAY(special, index);
case SOURCE_TYPE_TELEMETRY:
if (IS_ARM(getCurrentBoard())) {
div_t qr = div(index, 3);
QString result = QString(model ? model->sensorData[qr.quot].label : QString("[T%1]").arg(qr.quot+1));
if (qr.rem) result += qr.rem == 1 ? "-" : "+";
result = getElementName(QCoreApplication::translate("Telemetry", "TELE"), qr.quot+1, model ? model->sensorData[qr.quot].label : NULL);
if (qr.rem)
result += (qr.rem == 1 ? "-" : "+");
return result;
}
else {
return CHECK_IN_ARRAY(telemetry, index);
}
case SOURCE_TYPE_GVAR:
return QObject::tr("GV%1").arg(index+1);
{
const char * name = NULL;
if (getCurrentFirmware()->getCapability(GvarsName) && model)
name = model->gvarData[index].name;
return getElementName(QCoreApplication::translate("Global Variable", "GV"), index + 1, name);
}
default:
return QObject::tr("----");
}
}
bool RawSource::isPot() const
bool RawSource::isStick(int * stickIndex) const
{
return (type == SOURCE_TYPE_STICK &&
index >= CPN_MAX_STICKS &&
index < CPN_MAX_STICKS+getCurrentFirmware()->getCapability(Pots));
if (type == SOURCE_TYPE_STICK && index < getBoardCapability(getCurrentBoard(), Board::Sticks)) {
if (stickIndex)
*stickIndex = index;
return true;
}
return false;
}
bool RawSource::isSlider() const
bool RawSource::isPot(int * potsIndex) const
{
return (type == SOURCE_TYPE_STICK &&
index >= CPN_MAX_STICKS+getCurrentFirmware()->getCapability(Pots) &&
index < CPN_MAX_STICKS+getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders));
if (type == SOURCE_TYPE_STICK &&
index >= getBoardCapability(getCurrentBoard(), Board::Sticks) &&
index < getBoardCapability(getCurrentBoard(), Board::Sticks) + getBoardCapability(getCurrentBoard(), Board::Pots)) {
if (potsIndex)
*potsIndex = index - getBoardCapability(getCurrentBoard(), Board::Sticks);
return true;
}
return false;
}
QString RawSwitch::toString(Board::Type board) const
bool RawSource::isSlider(int * sliderIndex) const
{
if (type == SOURCE_TYPE_STICK &&
index >= getBoardCapability(getCurrentBoard(), Board::Sticks) + getBoardCapability(getCurrentBoard(), Board::Pots) &&
index < getBoardCapability(getCurrentBoard(), Board::Sticks) + getBoardCapability(getCurrentBoard(), Board::Pots) + getBoardCapability(getCurrentBoard(), Board::Sliders)) {
if (sliderIndex)
*sliderIndex = index - getBoardCapability(getCurrentBoard(), Board::Sticks) - getBoardCapability(getCurrentBoard(), Board::Pots);
return true;
}
return false;
}
/*
* RawSwitch
*/
QString RawSwitch::toString(Board::Type board, const GeneralSettings * const generalSettings, const ModelData * const modelData) const
{
if (board == Board::BOARD_UNKNOWN) {
board = getCurrentBoard();
@@ -604,21 +657,13 @@ QString RawSwitch::toString(Board::Type board) const
QString("AIL"), QString("GEA"), QString("TRN")
};
static const QString flightModes[] = {
QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8")
};
static const QString multiposPots[] = {
QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"),
QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"),
QObject::tr("S31"), QObject::tr("S32"), QObject::tr("S33"), QObject::tr("S34"), QObject::tr("S35"), QObject::tr("S36")
};
static const QString trimsSwitches[] = {
QObject::tr("RudTrim Left"), QObject::tr("RudTrim Right"),
QObject::tr("EleTrim Down"), QObject::tr("EleTrim Up"),
QObject::tr("ThrTrim Down"), QObject::tr("ThrTrim Up"),
QObject::tr("AilTrim Left"), QObject::tr("AilTrim Right")
QObject::tr("AilTrim Left"), QObject::tr("AilTrim Right"),
QObject::tr("Trim 5 Down"), QObject::tr("Trim 5 Up"),
QObject::tr("Trim 6 Down"), QObject::tr("Trim 6 Up")
};
static const QString rotaryEncoders[] = {
@@ -630,64 +675,127 @@ QString RawSwitch::toString(Board::Type board) const
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
};
const QStringList directionIndicators = QStringList()
<< CPN_STR_SW_INDICATOR_UP
<< CPN_STR_SW_INDICATOR_NEUT
<< CPN_STR_SW_INDICATOR_DN;
if (index < 0) {
return QString("!") + RawSwitch(type, -index).toString();
return CPN_STR_SW_INDICATOR_REV % RawSwitch(type, -index).toString(board, generalSettings, modelData);
}
else {
QString swName;
div_t qr;
switch(type) {
case SWITCH_TYPE_SWITCH:
if (IS_HORUS_OR_TARANIS(board)) {
div_t qr = div(index-1, 3);
Board::SwitchInfo switchInfo = getSwitchInfo(board, qr.quot);
const char * positions[] = { ARROW_UP, "-", ARROW_DOWN };
return QString(switchInfo.name) + QString(positions[qr.rem]);
qr = div(index-1, 3);
if (generalSettings)
swName = QString(generalSettings->switchName[qr.quot]);
if (swName.isEmpty())
swName = getSwitchInfo(board, qr.quot).name;
return swName + directionIndicators.at(qr.rem > -1 && qr.rem < directionIndicators.size() ? qr.rem : 1);
}
else {
return CHECK_IN_ARRAY(switches9X, index - 1);
}
case SWITCH_TYPE_VIRTUAL:
return QObject::tr("L%1").arg(index);
return getElementName(QCoreApplication::translate("Logic Switch", "L"), index, NULL, true);
case SWITCH_TYPE_MULTIPOS_POT:
return CHECK_IN_ARRAY(multiposPots, index-1);
if (!getCurrentFirmware()->getCapability(MultiposPotsPositions))
return QObject::tr("???");
qr = div(index - 1, getCurrentFirmware()->getCapability(MultiposPotsPositions));
if (generalSettings && qr.quot < (int)DIM(generalSettings->potConfig))
swName = QString(generalSettings->potName[qr.quot]);
if (swName.isEmpty())
swName = getCurrentFirmware()->getAnalogInputName(qr.quot + getBoardCapability(board, Board::Sticks));;
return swName + "_" + QString::number(qr.rem + 1);
case SWITCH_TYPE_TRIM:
return CHECK_IN_ARRAY(trimsSwitches, index-1);
case SWITCH_TYPE_ROTARY_ENCODER:
return CHECK_IN_ARRAY(rotaryEncoders, index-1);
case SWITCH_TYPE_ON:
return QObject::tr("ON");
case SWITCH_TYPE_OFF:
return QObject::tr("OFF");
case SWITCH_TYPE_ONE:
return QObject::tr("One");
case SWITCH_TYPE_FLIGHT_MODE:
return CHECK_IN_ARRAY(flightModes, index-1);
return getElementName(QCoreApplication::translate("Flight mode", "FM"), index - 1, modelData ? modelData->flightModeData[index-1].name : NULL);
case SWITCH_TYPE_NONE:
return QObject::tr("----");
case SWITCH_TYPE_TIMER_MODE:
return CHECK_IN_ARRAY(timerModes, index);
case SWITCH_TYPE_SENSOR:
return getElementName(QCoreApplication::translate("Telemetry", "TELE"), index, modelData ? modelData->sensorData[index-1].label : NULL);
case SWITCH_TYPE_TELEMETRY:
return QObject::tr("Telemetry");
default:
return QObject::tr("???");
}
}
}
QString CurveReference::toString() const
/*
* CurveReference
*/
QString CurveReference::toString(const ModelData * model, bool verbose) const
{
if (value == 0) {
return "----";
}
else {
switch(type) {
case CURVE_REF_DIFF:
return QObject::tr("Diff(%1)").arg(getGVarString(value));
case CURVE_REF_EXPO:
return QObject::tr("Expo(%1)").arg(getGVarString(value));
case CURVE_REF_FUNC:
return QObject::tr("Function(%1)").arg(QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3));
default:
return QString(value > 0 ? QObject::tr("Curve(%1)") : QObject::tr("!Curve(%1)")).arg(abs(value));
}
QString ret;
unsigned idx = abs(value) - 1;
switch(type) {
case CURVE_REF_DIFF:
ret = QObject::tr("Diff(%1)").arg(Helpers::getAdjustmentString(value, model));
break;
case CURVE_REF_EXPO:
ret = QObject::tr("Expo(%1)").arg(Helpers::getAdjustmentString(value, model));
break;
case CURVE_REF_FUNC:
ret = QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3);
if (verbose)
ret = QObject::tr("Function(%1)").arg(ret);
break;
default:
if (model)
ret = model->curves[idx].nameToString(idx);
else
ret = CurveData().nameToString(idx);
if (verbose)
ret = QObject::tr("Curve(%1)").arg(ret);
if (value < 0)
ret.prepend(CPN_STR_SW_INDICATOR_REV);
break;
}
return ret;
}
bool LogicalSwitchData::isEmpty() const
{
return (func == 0);
}
CSFunctionFamily LogicalSwitchData::getFunctionFamily() const
@@ -774,10 +882,15 @@ void CustomFunctionData::clear()
}
}
QString CustomFunctionData::funcToString() const
bool CustomFunctionData::isEmpty() const
{
return (swtch.type == SWITCH_TYPE_NONE);
}
QString CustomFunctionData::funcToString(const ModelData * model) const
{
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString());
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return QObject::tr("Trainer");
else if (func == FuncTrainerRUD)
@@ -821,7 +934,7 @@ QString CustomFunctionData::funcToString() const
else if (func == FuncBackgroundMusicPause)
return QObject::tr("Background Music Pause");
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast)
return QObject::tr("Adjust GV%1").arg(func-FuncAdjustGV1+1);
return QObject::tr("Adjust %1").arg(RawSource(SOURCE_TYPE_GVAR, func-FuncAdjustGV1).toString(model));
else if (func == FuncSetFailsafeInternalModule)
return QObject::tr("SetFailsafe Int. Module");
else if (func == FuncSetFailsafeExternalModule)
@@ -842,7 +955,7 @@ QString CustomFunctionData::funcToString() const
void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox * b, unsigned int value = 0)
{
int val = 0;
Firmware * firmware = getCurrentFirmware();
Firmware * firmware = Firmware::getCurrentVariant();
Board::Type board = firmware->getBoard();
b->addItem(QObject::tr("Timer1"), val++);
@@ -996,6 +1109,11 @@ bool CurveData::isEmpty() const
return true;
}
QString CurveData::nameToString(const int idx) const
{
return getElementName(QCoreApplication::translate("Curve", "CV"), idx + 1, name);
}
QString LimitData::minToString() const
{
return QString::number((qreal)min/10);
@@ -1045,13 +1163,13 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const
bool GeneralSettings::isPotAvailable(int index) const
{
if (index<0 || index>getCurrentFirmware()->getCapability(Pots)) return false;
if (index<0 || index>getBoardCapability(getCurrentBoard(), Board::Pots)) return false;
return potConfig[index] != Board::POT_NONE;
}
bool GeneralSettings::isSliderAvailable(int index) const
{
if (index<0 || index>getCurrentFirmware()->getCapability(Sliders)) return false;
if (index<0 || index>getBoardCapability(getCurrentBoard(), Board::Sliders)) return false;
return sliderConfig[index] != Board::SLIDER_NONE;
}
@@ -1060,19 +1178,40 @@ GeneralSettings::GeneralSettings()
memset(this, 0, sizeof(GeneralSettings));
contrast = 25;
vBatWarn = 90;
for (int i=0; i<CPN_MAX_STICKS+CPN_MAX_POTS; ++i) {
for (int i=0; i < CPN_MAX_ANALOGS; ++i) {
calibMid[i] = 0x200;
calibSpanNeg[i] = 0x180;
calibSpanPos[i] = 0x180;
}
Firmware * firmware = getCurrentFirmware();
Firmware * firmware = Firmware::getCurrentVariant();
Board::Type board = firmware->getBoard();
for (int i=0; i<firmware->getCapability(FactoryInstalledSwitches); i++) {
switchConfig[i] = getSwitchInfo(board, i).config;
// vBatWarn is voltage in 100mV, vBatMin is in 100mV but with -9V offset, vBatMax has a -12V offset
vBatWarn = 90;
if (IS_TARANIS_X9E(board) || IS_HORUS_X12S(board)) {
// NI-MH 9.6V
vBatWarn = 87;
vBatMin = -5; //8,5V
vBatMax = -5; //11,5V
}
else if (IS_HORUS_X10(board)) {
// Lipo 2V
vBatWarn = 66;
vBatMin = -28; // 6.2V
vBatMax = -38; // 8.2V
}
else if (IS_TARANIS(board)) {
// NI-MH 7.2V, X9D, X9D+ and X7
vBatWarn = 65;
vBatMin = -30; //6V
vBatMax = -40; //8V
}
for (int i=0; i<getBoardCapability(board, Board::FactoryInstalledSwitches); i++) {
switchConfig[i] = Boards::getSwitchInfo(board, i).config;
}
backlightMode = 3; // keys and sticks
@@ -1101,13 +1240,13 @@ GeneralSettings::GeneralSettings()
potConfig[2] = Board::POT_WITHOUT_DETENT;
}
if (IS_HORUS(board) || IS_TARANIS_X9E(board)) {
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board)) {
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
sliderConfig[2] = Board::SLIDER_WITH_DETENT;
sliderConfig[3] = Board::SLIDER_WITH_DETENT;
}
else if (IS_TARANIS(board) && !IS_TARANIS_X7(board)) {
else if (IS_TARANIS_X9(board) || IS_HORUS_X10(board)) {
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
}
@@ -1116,27 +1255,27 @@ GeneralSettings::GeneralSettings()
speakerVolume = 12;
}
if (IS_TARANIS_X9E(board)) {
if (IS_HORUS(board) || IS_TARANIS_X9E(board) || IS_TARANIS_X7(board)) {
strcpy(bluetoothName, "Taranis");
}
templateSetup = g.profile[g.id()].channelOrder();
stickMode = g.profile[g.id()].defaultMode();
templateSetup = g.profile[g.sessionId()].channelOrder();
stickMode = g.profile[g.sessionId()].defaultMode();
QString t_calib = g.profile[g.id()].stickPotCalib();
int potsnum = getCurrentFirmware()->getCapability(Pots);
QString t_calib = g.profile[g.sessionId()].stickPotCalib();
int potsnum = getBoardCapability(getCurrentBoard(), Board::Pots);
if (!t_calib.isEmpty()) {
QString t_trainercalib=g.profile[g.id()].trainerCalib();
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.id()].txVoltageCalibration();
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.id()].txCurrentCalibration();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
QString t_DisplaySet=g.profile[g.id()].display();
QString t_BeeperSet=g.profile[g.id()].beeper();
QString t_HapticSet=g.profile[g.id()].haptic();
QString t_SpeakerSet=g.profile[g.id()].speaker();
QString t_CountrySet=g.profile[g.id()].countryCode();
QString t_trainercalib=g.profile[g.sessionId()].trainerCalib();
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.sessionId()].txVoltageCalibration();
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.sessionId()].txCurrentCalibration();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.sessionId()].ppmMultiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.sessionId()].gsStickMode();
uint8_t t_vBatWarn=(uint8_t)g.profile[g.sessionId()].vBatWarn();
QString t_DisplaySet=g.profile[g.sessionId()].display();
QString t_BeeperSet=g.profile[g.sessionId()].beeper();
QString t_HapticSet=g.profile[g.sessionId()].haptic();
QString t_SpeakerSet=g.profile[g.sessionId()].speaker();
QString t_CountrySet=g.profile[g.sessionId()].countryCode();
if ((t_calib.length()==(CPN_MAX_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) {
QString Byte;
@@ -1296,8 +1435,6 @@ void FrSkyData::clear()
mAhPersistent = 0;
storedMah = 0;
fasOffset = 0;
rssiAlarms[0].clear(2, 45);
rssiAlarms[1].clear(3, 42);
for (int i=0; i<4; i++)
screens[i].clear();
varioSource = 2/*VARIO*/;
@@ -1422,14 +1559,10 @@ void ModelData::clearMixes()
mixData[i].clear();
}
RadioData::RadioData()
{
models.resize(getCurrentFirmware()->getCapability(Models));
}
void ModelData::clear()
{
memset(this, 0, sizeof(ModelData));
modelIndex = -1; // an invalid index, this is managed by the TreeView data model
moduleData[0].channelsCount = 8;
moduleData[1].channelsStart = 0;
moduleData[1].channelsCount = 8;
@@ -1452,15 +1585,18 @@ void ModelData::clear()
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear(i);
}
for (int i=0; i<CPN_MAX_GVARS; i++) {
gvarData[i].clear();
}
clearInputs();
clearMixes();
for (int i=0; i<CPN_MAX_CHNOUT; i++)
limitData[i].clear();
for (int i=0; i<CPN_MAX_STICKS; i++)
expoData[i].clear();
for (int i=0; i<CPN_MAX_CSW; i++)
for (int i=0; i<CPN_MAX_LOGICAL_SWITCHES; i++)
logicalSw[i].clear();
for (int i=0; i<CPN_MAX_CUSTOM_FUNCTIONS; i++)
for (int i=0; i<CPN_MAX_SPECIAL_FUNCTIONS; i++)
customFn[i].clear();
for (int i=0; i<CPN_MAX_CURVES; i++)
curves[i].clear(5);
@@ -1468,6 +1604,7 @@ void ModelData::clear()
timers[i].clear();
swashRingData.clear();
frsky.clear();
rssiAlarms.clear();
for (int i=0; i<CPN_MAX_SENSORS; i++)
sensorData[i].clear();
@@ -1584,8 +1721,8 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
{
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>1024 && i<CPN_MAX_FLIGHT_MODES; i++) {
int nextPhase = idx - 1025;
for (int i=0; idx>GVAR_MAX_VALUE && i<CPN_MAX_FLIGHT_MODES; i++) {
int nextPhase = idx - GVAR_MAX_VALUE - 1;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
idx = flightModeData[phaseIdx].gvars[gvarIdx];
@@ -1654,6 +1791,29 @@ int ModelData::getChannelsMax(bool forceExtendedLimits) const
return 100;
}
bool ModelData::isAvailable(const RawSwitch & swtch) const
{
unsigned index = abs(swtch.index) - 1;
if (swtch.type == SWITCH_TYPE_VIRTUAL) {
return logicalSw[index].func != LS_FN_OFF;
}
else if (swtch.type == SWITCH_TYPE_FLIGHT_MODE) {
return index == 0 || flightModeData[index].swtch.type != SWITCH_TYPE_NONE;
}
else if (swtch.type == SWITCH_TYPE_SENSOR) {
return strlen(sensorData[index].label) > 0;
}
else {
return true;
}
}
float ModelData::getGVarFieldValuePrec(int phaseIdx, int gvarIdx)
{
return getGVarFieldValue(phaseIdx, gvarIdx) * gvarData[gvarIdx].multiplierGet();
}
QList<EEPROMInterface *> eepromInterfaces;
void unregisterEEpromInterfaces()
@@ -1665,10 +1825,6 @@ void unregisterEEpromInterfaces()
OpenTxEepromCleanup();
}
QList<Firmware *> firmwares;
Firmware * default_firmware_variant;
Firmware * current_firmware_variant;
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
{
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
@@ -1709,7 +1865,7 @@ void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long err
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n You should 'save as' to keep the old file as a backup."); }
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n To keep your original file as a backup, please choose File -> Save As specifying a different name."); }
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
@@ -1720,75 +1876,22 @@ void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long err
msgBox.exec();
}
QString getBoardName(Board::Type board)
{
switch (board) {
case Board::BOARD_STOCK:
return "9X";
case Board::BOARD_M128:
return "9X128";
case Board::BOARD_GRUVIN9X:
return "Gruvin9x";
case Board::BOARD_MEGA2560:
return "MEGA2560";
case Board::BOARD_TARANIS_X7:
return "Taranis X7";
case Board::BOARD_TARANIS_X9D:
return "Taranis X9D";
case Board::BOARD_TARANIS_X9DP:
return "Taranis X9D+";
case Board::BOARD_TARANIS_X9E:
return "Taranis X9E";
case Board::BOARD_SKY9X:
return "Sky9x";
case Board::BOARD_9XRPRO:
return "9XR-PRO";
case Board::BOARD_AR9X:
return "AR9X";
case Board::BOARD_HORUS:
return "Horus";
default:
return "Unknown";
}
}
// static
QVector<Firmware *> Firmware::registeredFirmwares;
Firmware * Firmware::defaultVariant = NULL;
Firmware * Firmware::currentVariant = NULL;
const int Firmware::getFlashSize()
// static
Firmware * Firmware::getFirmwareForId(const QString & id)
{
switch (board) {
case Board::BOARD_STOCK:
return FSIZE_STOCK;
case Board::BOARD_M128:
return FSIZE_M128;
case Board::BOARD_MEGA2560:
case Board::BOARD_GRUVIN9X:
return FSIZE_GRUVIN9X;
case Board::BOARD_SKY9X:
return FSIZE_SKY9X;
case Board::BOARD_9XRPRO:
case Board::BOARD_AR9X:
return FSIZE_9XRPRO;
case Board::BOARD_TARANIS_X9D:
case Board::BOARD_TARANIS_X9DP:
case Board::BOARD_TARANIS_X9E:
case Board::BOARD_FLAMENCO:
return FSIZE_TARANIS;
case Board::BOARD_HORUS:
return FSIZE_HORUS;
default:
return 0;
}
}
Firmware * getFirmware(const QString & id)
{
foreach(Firmware * firmware, firmwares) {
foreach(Firmware * firmware, registeredFirmwares) {
Firmware * result = firmware->getFirmwareVariant(id);
if (result) {
return result;
}
}
return default_firmware_variant;
return defaultVariant;
}
void Firmware::addOption(const char *option, QString tooltip, uint32_t variant)
@@ -1833,56 +1936,6 @@ void Firmware::addOptions(Option options[])
this->opts.push_back(opts);
}
SimulatorInterface * getCurrentSimulator()
{
QString firmwareId = getCurrentFirmware()->getId();
SimulatorFactory * factory = getSimulatorFactory(firmwareId);
if (factory)
return factory->create();
else
return NULL;
}
unsigned int getNumSubtypes(MultiModuleRFProtocols type)
{
switch (type) {
case MM_RF_PROTO_HISKY:
case MM_RF_PROTO_SYMAX:
case MM_RF_PROTO_KN:
case MM_RF_PROTO_SLT:
case MM_RF_PROTO_FY326:
case MM_RF_PROTO_BAYANG:
case MM_RF_PROTO_V2X2:
return 2;
case MM_RF_PROTO_Q2X2:
case MM_RF_PROTO_CG023:
return 3;
case MM_RF_PROTO_FRSKY:
case MM_RF_PROTO_DSM2:
case MM_RF_PROTO_MT99XX:
case MM_RF_PROTO_HONTAI:
case MM_RF_PROTO_AFHDS2A:
case MM_RF_PROTO_Q303:
return 4;
case MM_RF_PROTO_FLYSKY:
case MM_RF_PROTO_MJXQ:
case MM_RF_PROTO_YD717:
return 5;
case MM_RF_PROTO_WK_2X01:
return 6;
case MM_RF_PROTO_CX10:
return 8;
default:
return 1;
}
}
void FlightModeData::clear(const int phase)
{
memset(this, 0, sizeof(FlightModeData));
@@ -1895,3 +1948,67 @@ void FlightModeData::clear(const int phase)
}
}
}
QString GVarData::unitToString() const
{
switch (unit) {
case GVAR_UNIT_NUMBER:
return QObject::tr("");
case GVAR_UNIT_PERCENT:
return QObject::tr("%");
default:
return QObject::tr("?"); // highlight unknown value
}
}
QString GVarData::precToString() const
{
switch (prec) {
case GVAR_PREC_MUL10:
return QObject::tr("0._");
case GVAR_PREC_MUL1:
return QObject::tr("0.0");
default:
return QObject::tr("?.?"); // highlight unknown value
}
}
int GVarData::multiplierSet()
{
return (prec == 0 ? 1 : 10);
}
float GVarData::multiplierGet() const
{
return (prec == 0 ? 1 : 0.1);
}
void GVarData::setMin(float val)
{
min = (val * multiplierSet()) - GVAR_MIN_VALUE;
}
void GVarData::setMax(float val)
{
max = GVAR_MAX_VALUE - (val * multiplierSet());
}
int GVarData::getMin() const
{
return GVAR_MIN_VALUE + min;
}
int GVarData::getMax() const
{
return GVAR_MAX_VALUE - max;
}
float GVarData::getMinPrec() const
{
return getMin() * multiplierGet();
}
float GVarData::getMaxPrec() const
{
return getMax() * multiplierGet();
}
+52 -37
View File
@@ -21,6 +21,7 @@
#ifndef _EEPROMINTERFACE_H_
#define _EEPROMINTERFACE_H_
#include "macros.h"
#include "radiodata.h"
#include "../../radio/src/definitions.h"
#include "simulatorinterface.h"
@@ -29,8 +30,6 @@
#include <iostream>
#include <QDebug>
QString RotaryEncoderString(int index);
const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4},
{1, 3, 2, 4},
@@ -51,12 +50,6 @@ enum Capability {
VoicesMaxLength,
MultiLangVoice,
ModelImage,
Pots,
Sliders,
Switches,
FactoryInstalledSwitches,
SwitchesPositions,
NumTrimSwitches,
CustomFunctions,
SafetyChannelCustomFunction,
LogicalSwitches,
@@ -67,7 +60,8 @@ enum Capability {
Outputs,
ChannelsName,
ExtraInputs,
ExtendedTrims,
TrimsRange,
ExtendedTrimsRange,
NumCurves,
NumCurvePoints,
OffsetWeight,
@@ -75,6 +69,8 @@ enum Capability {
SoundMod,
SoundPitch,
MaxVolume,
MaxContrast,
MinContrast,
Haptic,
HasBeeper,
ModelTrainerEnable,
@@ -144,7 +140,6 @@ enum Capability {
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
MixersMonitor,
HasBatMeterRange,
DangerousFunctions,
HasModelCategories
@@ -184,8 +179,6 @@ class EEPROMInterface
};
extern std::list<QString> EEPROMWarnings;
/* EEPROM string conversion functions */
void setEEPROMString(char *dst, const char *src, int size);
void getEEPROMString(char *dst, const char *src, int size);
@@ -193,9 +186,6 @@ void getEEPROMString(char *dst, const char *src, int size);
float ValToTim(int value);
int TimToVal(float value);
QString getSignedStr(int value);
QString getGVarString(int16_t val, bool sign=false);
inline int applyStickMode(int stick, unsigned int mode)
{
if (mode == 0 || mode > 4) {
@@ -203,14 +193,8 @@ inline int applyStickMode(int stick, unsigned int mode)
return stick;
}
const unsigned int stickModes[]= {
1, 2, 3, 4,
1, 3, 2, 4,
4, 2, 3, 1,
4, 3, 2, 1 };
if (stick >= 1 && stick <= 4)
return stickModes[(mode-1)*4 + stick - 1];
return modn12x3[mode-1][stick-1];
else
return stick;
}
@@ -283,7 +267,7 @@ class Firmware {
{
return base ? base : this;
}
virtual Firmware * getFirmwareVariant(const QString & id) { return NULL; }
unsigned int getVariantNumber();
@@ -306,12 +290,12 @@ class Firmware {
{
return board;
}
void setEEpromInterface(EEPROMInterface * eeprom)
{
eepromInterface = eeprom;
}
EEPROMInterface * getEEpromInterface()
{
return eepromInterface;
@@ -337,11 +321,41 @@ class Firmware {
const int getFlashSize();
static Firmware * getFirmwareForId(const QString & id);
static QVector<Firmware *> getRegisteredFirmwares()
{
return registeredFirmwares;
}
static void addRegisteredFirmware(Firmware * fw)
{
registeredFirmwares.append(fw);
}
static Firmware * getDefaultVariant()
{
return defaultVariant;
}
static void setDefaultVariant(Firmware * value)
{
defaultVariant = value;
}
static Firmware * getCurrentVariant()
{
return currentVariant;
}
static void setCurrentVariant(Firmware * value)
{
currentVariant = value;
}
public:
QList<const char *> languages;
QList<const char *> ttslanguages;
QList< QList<Option> > opts;
protected:
QString id;
QString name;
@@ -350,32 +364,28 @@ class Firmware {
Firmware * base;
EEPROMInterface * eepromInterface;
static QVector<Firmware *> registeredFirmwares;
static Firmware * defaultVariant;
static Firmware * currentVariant;
private:
Firmware();
};
extern QList<Firmware *> firmwares;
extern Firmware * default_firmware_variant;
extern Firmware * current_firmware_variant;
Firmware * getFirmware(const QString & id);
inline Firmware * getCurrentFirmware()
{
return current_firmware_variant;
return Firmware::getCurrentVariant();
}
SimulatorInterface * getCurrentSimulator();
inline EEPROMInterface * getCurrentEEpromInterface()
{
return getCurrentFirmware()->getEEpromInterface();
return Firmware::getCurrentVariant()->getEEpromInterface();
}
inline Board::Type getCurrentBoard()
{
return getCurrentFirmware()->getBoard();
return Firmware::getCurrentVariant()->getBoard();
}
inline int divRoundClosest(const int n, const int d)
@@ -383,7 +393,12 @@ inline int divRoundClosest(const int n, const int d)
return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d);
}
#define CHECK_IN_ARRAY(T, index) ((unsigned int)index < (unsigned int)(sizeof(T)/sizeof(T[0])) ? T[(unsigned int)index] : "???")
inline int calcRESXto100(int x)
{
return divRoundClosest(x*100, 1024);
}
#define CHECK_IN_ARRAY(T, index) ((unsigned int)index < DIM(T) ? T[(unsigned int)index] : "???")
extern QList<EEPROMInterface *> eepromInterfaces;
@@ -95,7 +95,6 @@ Er9xGeneral::operator GeneralSettings ()
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
+21 -17
View File
@@ -82,7 +82,9 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
#if 0
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying er9x xml import... ";
std::bitset<NUM_ERRORS> errors;
@@ -94,7 +96,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)er9xGeneral.myVers << " ";
}
for (int i=0; i<getCapability(Models); i++) {
Er9xModelData er9xModel;
@@ -104,7 +106,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
radioData.models[i] = er9xModel;
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -112,36 +114,38 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying er9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize(Board::BOARD_STOCK)) {
std::cout << "wrong size\n";
if (size != Boards::getEEpromSize(Board::BOARD_STOCK)) {
dbg << "wrong size";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_STOCK)) {
std::cout << "wrong file system\n";
dbg << "wrong file system";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Er9xGeneral er9xGeneral;
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
dbg << "no";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)er9xGeneral.myVers << " ";
switch(er9xGeneral.myVers) {
case 3:
std::cout << "(old gruvin9x) ";
dbg << "(old gruvin9x) ";
case 4:
// case 5:
case 6:
@@ -151,20 +155,20 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
case 10:
break;
default:
std::cout << "not er9x\n";
dbg << "not er9x";
errors.set(NOT_ER9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = er9xGeneral;
for (int i=0; i<getCapability(Models); i++) {
Er9xModelData er9xModel;
efile->openRd(FILE_MODEL(i));
@@ -174,10 +178,10 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
else {
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = er9xModel;
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -329,4 +333,4 @@ int Er9xInterface::getCapability(Capability capability)
default:
return 0;
}
}
}
@@ -120,7 +120,6 @@ Ersky9xGeneral::operator GeneralSettings ()
result.trainer = trainer;
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
@@ -116,7 +116,9 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
#if 0
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying ersky9x xml import... ";
std::bitset<NUM_ERRORS> errors;
@@ -128,25 +130,25 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
else {
radioData.generalSettings=ersky9xGeneral;
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
}
for(int i=0; i<getCapability(Models); i++) {
if (ersky9xGeneral.myVers == 10) {
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -154,32 +156,34 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying ersky9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != EESIZE_SKY9X) {
std::cout << "wrong size\n";
if (size != Boards::getEEpromSize(Board::BOARD_SKY9X)) {
dbg << "wrong size";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_SKY9X)) {
std::cout << "wrong file system\n";
dbg << "wrong file system";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Ersky9xGeneral ersky9xGeneral;
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
dbg << "no";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
switch(ersky9xGeneral.myVers) {
case 10:
@@ -187,24 +191,24 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
case 11:
break;
default:
std::cout << "not ersky9x\n";
dbg << "not ersky9x";
errors.set(NOT_ERSKY9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = ersky9xGeneral;
for (int i=0; i<getCapability(Models); 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) {
@@ -222,10 +226,10 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = ersky9xModel;
}
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -382,4 +386,4 @@ int Ersky9xInterface::getCapability(Capability capability)
default:
return 0;
}
}
}
File diff suppressed because it is too large Load Diff
+30 -7
View File
@@ -40,19 +40,30 @@ class OpenTxGeneralData: public TransformedField {
public:
OpenTxGeneralData(GeneralSettings & generalData, Board::Type board, unsigned int version, unsigned int variant=0);
virtual const char * getName() { return internalField.getName(); }
virtual const QString & getName() { return internalField.getName(); }
QStringList errors()
{
return _errors;
}
protected:
virtual void beforeExport();
virtual void afterImport();
virtual void setError(const QString & error)
{
qWarning() << error;
_errors << error;
}
StructField internalField;
GeneralSettings & generalData;
Board::Type board;
unsigned int version;
int inputsCount;
unsigned int chkSum;
// unsigned int potsType[4];
QStringList _errors;
};
class ProtocolsConversionTable: public ConversionTable
@@ -87,9 +98,11 @@ class ProtocolsConversionTable: public ConversionTable
addConversion(PULSES_DSM2, val++);
addConversion(PULSES_DSMX, val++);
}
if (IS_HORUS_OR_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
if (IS_ARM(board)) {
addConversion(PULSES_CROSSFIRE, val++);
addConversion(PULSES_MULTIMODULE, val++);
addConversion(PULSES_PXX_R9M, val++);
addConversion(PULSES_SBUS, val++);
}
}
};
@@ -109,23 +122,33 @@ class OpenTxModelData: public TransformedField {
public:
OpenTxModelData(ModelData & modelData, Board::Type board, unsigned int version, unsigned int variant);
virtual const char * getName() { return internalField.getName(); }
virtual const QString & getName() { return internalField.getName(); }
QStringList errors()
{
return _errors;
}
protected:
virtual void beforeExport();
virtual void afterImport();
virtual void setError(const QString & error)
{
qWarning() << error;
_errors << error;
}
StructField internalField;
ModelData & modelData;
Board::Type board;
unsigned int version;
unsigned int variant;
private:
char name[256];
int subprotocols[CPN_MAX_MODULES+1/*trainer*/];
ProtocolsConversionTable protocolsConversionTable;
ChannelsConversionTable channelsConversionTable;
QStringList _errors;
};
void OpenTxEepromCleanup(void);
+207 -221
View File
@@ -26,11 +26,15 @@
#include <QMessageBox>
#include <QTime>
#include <QUrl>
#include <companion/src/storage/storage.h>
using namespace Board;
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/firmware"
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/nightly/firmware"
const char * const OPENTX_FIRMWARE_DOWNLOAD_URL[] = {
"https://downloads.open-tx.org/2.2/release/firmware",
"https://downloads.open-tx.org/2.2/rc/firmware",
"https://downloads.open-tx.org/2.2/nightlies/firmware"
};
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
@@ -86,36 +90,15 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for ar9x board / 9X";
case BOARD_FLAMENCO:
return "OpenTX for Flamenco experimental";
case BOARD_HORUS:
case BOARD_X12S:
return "OpenTX for FrSky Horus";
case BOARD_X10:
return "OpenTX for FrSky X10";
default:
return "OpenTX for an unknown board";
}
}
uint32_t OpenTxEepromInterface::getFourCC()
{
switch (board) {
case BOARD_HORUS:
return 0x3478746F;
case BOARD_TARANIS_X7:
return 0x3678746F;
case BOARD_TARANIS_X9E:
return 0x3578746F;
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
return 0x3378746F;
case BOARD_SKY9X:
case BOARD_AR9X:
return 0x3278746F;
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return 0x3178746F;
default:
return 0;
}
}
bool OpenTxEepromInterface::loadRadioSettingsFromRLE(GeneralSettings & settings, RleFile * rleFile, uint8_t version)
{
QByteArray data(sizeof(settings), 0); // GeneralSettings should be always bigger than the EEPROM struct
@@ -127,7 +110,7 @@ bool OpenTxEepromInterface::loadRadioSettingsFromRLE(GeneralSettings & settings,
return checkVariant(settings.version, settings.variant);
}
else {
std::cout << " error when loading general settings";
qWarning() << " error when loading general settings";
return false;
}
}
@@ -160,7 +143,7 @@ bool OpenTxEepromInterface::saveToByteArray(const T & src, QByteArray & data, ui
// manager.Dump();
manager.Export(raw);
data.resize(8);
*((uint32_t*)&data.data()[0]) = getFourCC();
*((uint32_t*)&data.data()[0]) = StorageFormat::getFourCC(board);
data[4] = version;
data[5] = 'M';
*((uint16_t*)&data.data()[6]) = raw.size();
@@ -183,12 +166,12 @@ template <class T, class M>
bool OpenTxEepromInterface::loadFromByteArray(T & dest, const QByteArray & data)
{
uint32_t fourcc = *((uint32_t*)&data.data()[0]);
if (getFourCC() != fourcc) {
if (StorageFormat::getFourCC(board) != fourcc) {
if (IS_HORUS(board) && fourcc == 0x3178396F) {
qDebug() << QString().sprintf("%s: Deprecated fourcc used %x vs %x", getName(), fourcc, getFourCC());
qDebug() << QString().sprintf("%s: Deprecated fourcc used %x vs %x", getName(), fourcc, StorageFormat::getFourCC(board));
}
else {
qDebug() << QString().sprintf("%s: Wrong fourcc %x vs %x", getName(), fourcc, getFourCC());
qDebug() << QString().sprintf("%s: Wrong fourcc %x vs %x", getName(), fourcc, StorageFormat::getFourCC(board));
return false;
}
}
@@ -198,36 +181,15 @@ bool OpenTxEepromInterface::loadFromByteArray(T & dest, const QByteArray & data)
return loadFromByteArray<T, M>(dest, raw, version);
}
template<class T>
bool
OpenTxEepromInterface::saveRadioSettings(GeneralSettings &settings, Board::Type board, uint8_t version, uint32_t variant)
{
T open9xSettings(settings, board, version, variant);
// open9xSettings.Dump();
QByteArray eeprom;
open9xSettings.Export(eeprom);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (const uint8_t *) eeprom.constData(), eeprom.size());
return (sz == eeprom.size());
}
template<class T>
bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, uint8_t version, uint32_t variant)
{
T open9xModel(model, board, version, variant);
// open9xModel.Dump();
QByteArray eeprom;
open9xModel.Export(eeprom);
int sz = efile->writeRlc2(FILE_MODEL(index), FILE_TYP_MODEL, (const uint8_t *) eeprom.constData(), eeprom.size());
return (sz == eeprom.size());
}
unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t * eeprom, int size)
{
std::cout << "trying " << getName() << " import...";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying " << getName() << " import...";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize(board)) {
if (size != Boards::getEEpromSize(board)) {
if (size == 4096) {
int notnull = false;
for (int i = 2048; i < 4096; i++) {
@@ -236,7 +198,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
}
}
if (notnull) {
std::cout << " wrong size (" << size << ")\n";
dbg << " wrong size (" << size << ")";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
@@ -247,14 +209,14 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
}
}
else {
std::cout << " wrong size (" << size << "/" << getEEpromSize(board) << ")\n";
dbg << " wrong size (" << size << "/" << Boards::getEEpromSize(board) << ")";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
}
if (!efile->EeFsOpen((uint8_t *) eeprom, size, board)) {
std::cout << " wrong file system\n";
dbg << " wrong file system";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
@@ -263,37 +225,38 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << " no\n";
dbg << " no";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " version " << (unsigned int) version;
dbg << " version " << (unsigned int) version;
EepromLoadErrors version_error = checkVersion(version);
if (version_error == OLD_VERSION) {
errors.set(version_error);
errors.set(HAS_WARNINGS);
ShowEepromWarnings(NULL, QObject::tr("Warning"), errors.to_ulong());
}
else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n";
dbg << " not open9x";
errors.set(version_error);
return errors.to_ulong();
}
if (!loadRadioSettingsFromRLE(radioData.generalSettings, efile, version)) {
std::cout << " ko\n";
dbg << " ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " variant " << radioData.generalSettings.variant;
dbg << " variant " << radioData.generalSettings.variant;
if (getCurrentFirmware()->getCapability(Models) == 0) {
radioData.models.resize(firmware->getCapability(Models));
}
for (int i = 0; i < firmware->getCapability(Models); i++) {
if (!loadModelFromRLE(radioData.models[i], efile, i, version, radioData.generalSettings.variant)) {
std::cout << " ko\n";
if (i < (int)radioData.models.size() && !loadModelFromRLE(radioData.models[i], efile, i, version, radioData.generalSettings.variant)) {
dbg << " ko";
errors.set(UNKNOWN_ERROR);
if (getCurrentFirmware()->getCapability(Models) == 0) {
radioData.models.resize(i);
@@ -301,8 +264,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
return errors.to_ulong();
}
}
std::cout << " ok\n";
dbg << " ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -321,15 +283,36 @@ uint8_t OpenTxEepromInterface::getLastDataVersion(Board::Type board)
}
}
void OpenTxEepromInterface::showErrors(const QString & title, const QStringList & errors)
{
QString msg;
if (errors.empty()) {
msg = QObject::tr("Unknown error");
}
else {
int noErrorsToDisplay = std::min((int)errors.size(), 10);
for (int n = 0; n < noErrorsToDisplay; n++) {
msg += " -" + errors.at(n) + "\n";
}
if (noErrorsToDisplay < errors.size()) {
msg += QObject::tr(" ... plus %1 errors").arg(errors.size() - noErrorsToDisplay) + "\n" + msg;
}
}
QMessageBox::warning(NULL,
QObject::tr("Error"),
title + "\n" + msg);
}
int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, uint8_t version, uint32_t variant)
{
EEPROMWarnings.clear();
// TODO QMessageBox::warning should not be called here
if (version == 0) {
version = getLastDataVersion(board);
}
int size = getEEpromSize(board);
int size = Boards::getEEpromSize(board);
efile->EeFsCreate(eeprom, size, board, version);
@@ -343,36 +326,30 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
variant |= TARANIS_X7_VARIANT;
}
int result = saveRadioSettings<OpenTxGeneralData>((GeneralSettings &)radioData.generalSettings, board, version, variant);
if (!result) {
OpenTxGeneralData generator((GeneralSettings &)radioData.generalSettings, board, version, variant);
// generator.Dump();
QByteArray data;
generator.Export(data);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (const uint8_t *)data.constData(), data.size());
if (sz == 0 || generator.errors().count() > 0) {
showErrors(QObject::tr("Cannot write radio settings"), generator.errors());
return 0;
}
for (int i = 0; i < getCurrentFirmware()->getCapability(Models); i++) {
if (!radioData.models[i].isEmpty()) {
result = saveModel<OpenTxModelData>(i, (ModelData &)radioData.models[i], version, variant);
if (!result) {
if (i < (int)radioData.models.size() && !radioData.models[i].isEmpty()) {
OpenTxModelData generator((ModelData &)radioData.models[i], board, version, variant);
// generator.Dump();
QByteArray data;
generator.Export(data);
int sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (const uint8_t *)data.constData(), data.size());
if (sz == 0 || generator.errors().count() > 0) {
showErrors(QObject::tr("Cannot write model %1").arg(radioData.models[i].name), generator.errors());
return 0;
}
}
}
if (!EEPROMWarnings.empty()) {
QString msg;
int noErrorsToDisplay = std::min((int) EEPROMWarnings.size(), 10);
for (int n = 0; n < noErrorsToDisplay; n++) {
msg += "-" + EEPROMWarnings.front() + "\n";
EEPROMWarnings.pop_front();
}
if (!EEPROMWarnings.empty()) {
msg = QObject::tr("(displaying only first 10 warnings)") + "\n" + msg;
}
EEPROMWarnings.clear();
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("EEPROM saved with these warnings:") + "\n" + msg);
}
return size;
}
@@ -384,8 +361,8 @@ int OpenTxEepromInterface::getSize(const ModelData &model)
if (model.isEmpty())
return 0;
QByteArray tmp(EESIZE_MAX, 0);
efile->EeFsCreate((uint8_t *) tmp.data(), EESIZE_MAX, board, 255/*version max*/);
QByteArray tmp(Boards::getEEpromSize(Board::BOARD_UNKNOWN), 0);
efile->EeFsCreate((uint8_t *) tmp.data(), Boards::getEEpromSize(Board::BOARD_UNKNOWN), board, 255/*version max*/);
OpenTxModelData open9xModel((ModelData &) model, board, 255/*version max*/, getCurrentFirmware()->getVariantNumber());
@@ -403,8 +380,8 @@ int OpenTxEepromInterface::getSize(const GeneralSettings &settings)
if (IS_SKY9X(board))
return 0;
QByteArray tmp(EESIZE_MAX, 0);
efile->EeFsCreate((uint8_t *) tmp.data(), EESIZE_MAX, board, 255);
QByteArray tmp(Boards::getEEpromSize(Board::BOARD_UNKNOWN), 0);
efile->EeFsCreate((uint8_t *) tmp.data(), Boards::getEEpromSize(Board::BOARD_UNKNOWN), board, 255);
OpenTxGeneralData open9xGeneral((GeneralSettings &) settings, board, 255, getCurrentFirmware()->getVariantNumber());
// open9xGeneral.Dump();
@@ -433,7 +410,7 @@ Firmware * OpenTxFirmware::getFirmwareVariant(const QString &id)
}
}
int OpenTxFirmware::getCapability(Capability capability)
int OpenTxFirmware::getCapability(::Capability capability)
{
switch (capability) {
case Models:
@@ -495,7 +472,7 @@ int OpenTxFirmware::getCapability(Capability capability)
case FlightModesName:
return (IS_HORUS_OR_TARANIS(board) ? 10 : 6);
case GvarsName:
return (IS_9X(board) ? 0 : 6);
return (IS_9X(board) ? 0 : 3);
case GvarsInCS:
case HasFAIMode:
return 1;
@@ -517,52 +494,6 @@ int OpenTxFirmware::getCapability(Capability capability)
return 0;
case PermTimers:
return (IS_2560(board) || IS_ARM(board));
case Pots:
if (IS_HORUS(board))
return 3;
else if (IS_TARANIS_X7(board))
return 2;
else if (IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS(board))
return 3;
else
return 3;
case Sliders:
if (IS_HORUS(board))
return 4;
else if (IS_TARANIS_X7(board))
return 0;
else if (IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS(board))
return 2;
else
return 0;
case Switches:
if (IS_TARANIS_X9E(board))
return 18;
else if (IS_TARANIS_X7(board))
return 6;
else if (IS_HORUS_OR_TARANIS(board))
return 8;
else
return 7;
case FactoryInstalledSwitches:
if (IS_TARANIS_X9E(board))
return 8;
else
return getCapability(Switches);
case SwitchesPositions:
if (IS_HORUS_OR_TARANIS(board))
return getCapability(Switches) * 3;
else
return 9;
case NumTrimSwitches:
if (IS_HORUS(board))
return 12;
else
return 8;
case CustomFunctions:
if (IS_ARM(board))
return 64;
@@ -598,7 +529,7 @@ int OpenTxFirmware::getCapability(Capability capability)
case VoicesAsNumbers:
return (IS_ARM(board) ? 0 : 1);
case VoicesMaxLength:
return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : 0);
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : 0);
case MultiLangVoice:
return (IS_ARM(board) ? 1 : 0);
case SoundPitch:
@@ -612,26 +543,38 @@ int OpenTxFirmware::getCapability(Capability capability)
return 0;
case MaxVolume:
return (IS_ARM(board) ? 23 : 7);
case MaxContrast:
if (IS_TARANIS_X7(board))
return 30;
else
return 45;
case MinContrast:
if (IS_TARANIS_X9(board))
return 0;
else
return 10;
case HasSoundMixer:
return (IS_ARM(board) ? 1 : 0);
case ExtraInputs:
return 1;
case ExtendedTrims:
case TrimsRange:
return 125;
case ExtendedTrimsRange:
return 500;
case Simulation:
return 1;
case NumCurves:
return (HAS_LARGE_LCD(board) ? 32 : (IS_ARM(board) ? 16 : 8));
case HasMixerNames:
return (IS_ARM(board) ? (IS_HORUS_OR_TARANIS(board) ? 8 : 6) : false);
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : false);
case HasExpoNames:
return (IS_ARM(board) ? (IS_HORUS_OR_TARANIS(board) ? 8 : 6) : false);
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : false);
case HasNoExpo:
return (IS_HORUS_OR_TARANIS(board) ? false : true);
case ChannelsName:
return (IS_ARM(board) ? (HAS_LARGE_LCD(board) ? 6 : 4) : 0);
case HasCvNames:
return (IS_HORUS_OR_TARANIS(board) ? 1 : 0);
return (IS_ARM(board) ? 1 : 0);
case Telemetry:
if (IS_2560(board) || IS_ARM(board) || id.contains("frsky") || id.contains("telemetrez"))
return TM_HASTELEMETRY | TM_HASOFFSET | TM_HASWSHH;
@@ -718,7 +661,7 @@ int OpenTxFirmware::getCapability(Capability capability)
case GlobalFunctions:
return IS_ARM(board) ? 64 : 0;
case VirtualInputs:
return IS_ARM(board) ? 64 : 0;
return IS_ARM(board) ? 32 : 0;
case InputsLength:
return HAS_LARGE_LCD(board) ? 4 : 3;
case TrainerInputs:
@@ -760,8 +703,6 @@ int OpenTxFirmware::getCapability(Capability capability)
case HasInputDiff:
case HasMixerExpo:
return (IS_HORUS_OR_TARANIS(board) ? true : false);
case MixersMonitor:
return id.contains("mixersmon") ? 1 : 0;
case HasBatMeterRange:
return (IS_HORUS_OR_TARANIS(board) ? true : id.contains("battgraph"));
case DangerousFunctions:
@@ -775,49 +716,71 @@ int OpenTxFirmware::getCapability(Capability capability)
QString OpenTxFirmware::getAnalogInputName(unsigned int index)
{
if (index < 4) {
const QString sticks[] = { QObject::tr("Rud"),
QObject::tr("Ele"),
QObject::tr("Thr"),
QObject::tr("Ail") };
if ((int)index < getBoardCapability(board, Board::Sticks)) {
const QString sticks[] = {
QObject::tr("Rud"),
QObject::tr("Ele"),
QObject::tr("Thr"),
QObject::tr("Ail")
};
return sticks[index];
}
index -= 4;
index -= getBoardCapability(board, Board::Sticks);
if (IS_9X(board) || IS_2560(board) || IS_SKY9X(board)) {
const QString pots[] = { QObject::tr("P1"),
QObject::tr("P2"),
QObject::tr("P3") };
const QString pots[] = {
QObject::tr("P1"),
QObject::tr("P2"),
QObject::tr("P3")
};
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_TARANIS_X9E(board)) {
const QString pots[] = { QObject::tr("F1"),
QObject::tr("F2"),
QObject::tr("F3"),
QObject::tr("F4"),
QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("LS"),
QObject::tr("RS") };
const QString pots[] = {
QObject::tr("F1"),
QObject::tr("F2"),
QObject::tr("F3"),
QObject::tr("F4"),
QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("LS"),
QObject::tr("RS")
};
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_TARANIS(board)) {
const QString pots[] = {QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("S3"),
QObject::tr("LS"),
QObject::tr("RS")};
const QString pots[] = {
QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("S3"),
QObject::tr("LS"),
QObject::tr("RS")
};
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_HORUS(board)) {
const QString pots[] = {QObject::tr("S1"),
QObject::tr("6P"),
QObject::tr("S2"),
QObject::tr("L1"),
QObject::tr("L2"),
QObject::tr("LS"),
QObject::tr("RS")};
else if (IS_HORUS_X12S(board)) {
const QString pots[] = {
QObject::tr("S1"),
QObject::tr("6P"),
QObject::tr("S2"),
QObject::tr("L1"),
QObject::tr("L2"),
QObject::tr("LS"),
QObject::tr("RS"),
QObject::tr("JSx"),
QObject::tr("JSy")
};
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_HORUS_X10(board)) {
const QString pots[] = {
QObject::tr("S1"),
QObject::tr("6P"),
QObject::tr("S2"),
QObject::tr("LS"),
QObject::tr("RS")
};
return CHECK_IN_ARRAY(pots, index);
}
else {
@@ -860,11 +823,13 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_R9M:
//case PULSES_PXX_DJT: // Unavailable for now
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
case PULSES_CROSSFIRE:
case PULSES_SBUS:
return 1;
case PULSES_MULTIMODULE:
return id.contains("multimodule") ? 1 : 0;
@@ -892,10 +857,14 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_R9M:
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
case PULSES_SBUS:
return 1;
case PULSES_MULTIMODULE:
return id.contains("multimodule") ? 1 : 0;
default:
return 0;
}
@@ -999,29 +968,29 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
efile->openRd(i);
int sz = efile->readRlc2(tmp, sizeof(tmp));
if (sz == 849) {
std::cout << " warning: M128 variant not set (but model size seems ok)";
qWarning() << " warning: M128 variant not set (but model size seems ok)";
return true;
}
}
}
std::cout << " wrong variant (" << variant << ")";
qWarning() << " wrong variant (" << variant << ")";
return false;
}
else if (IS_TARANIS_X9E(board)) {
if (variant != TARANIS_X9E_VARIANT) {
std::cout << " wrong variant (" << variant << ")";
qWarning() << " wrong variant (" << variant << ")";
return false;
}
}
else if (IS_TARANIS_X7(board)) {
if (variant != TARANIS_X7_VARIANT) {
std::cout << " wrong variant (" << variant << ")";
qWarning() << " wrong variant (" << variant << ")";
return false;
}
}
else if (IS_TARANIS(board)) {
if (variant != 0) {
std::cout << " wrong variant (" << variant << ")";
qWarning() << " wrong variant (" << variant << ")";
return false;
}
}
@@ -1054,10 +1023,12 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
{
std::bitset<NUM_ERRORS> errors;
std::cout << "trying " << getName() << " backup import...";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying " << getName() << " backup import...";
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
std::cout << " no\n";
dbg << " no\n";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
@@ -1074,13 +1045,13 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
backupBoard = BOARD_GRUVIN9X;
break;
default:
std::cout << " unknown board\n";
dbg << " unknown board";
errors.set(UNKNOWN_BOARD);
return errors.to_ulong();
}
if (backupBoard != board) {
std::cout << " not right board\n";
dbg << " not right board";
errors.set(WRONG_BOARD);
return errors.to_ulong();
}
@@ -1090,7 +1061,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
uint16_t size = ((uint16_t) eeprom[7] << 8) + eeprom[6];
uint16_t variant = ((uint16_t) eeprom[9] << 8) + eeprom[8];
std::cout << " version " << (unsigned int) version << " ";
dbg << " version " << (unsigned int) version << " ";
EepromLoadErrors version_error = checkVersion(version);
if (version_error == OLD_VERSION) {
@@ -1098,42 +1069,38 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
errors.set(HAS_WARNINGS);
}
else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n";
dbg << " not open9x";
errors.set(version_error);
return errors.to_ulong();
}
if (size > esize - 8) {
std::cout << " wrong size\n";
dbg << " wrong size";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (bcktype == 'M') {
if (!loadModelFromBackup(radioData.models[index], &eeprom[8], size, version, variant)) {
std::cout << " ko\n";
dbg << " ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << " backup type not supported\n";
dbg << " backup type not supported";
errors.set(BACKUP_NOT_SUPPORTED);
return errors.to_ulong();
}
std::cout << " ok\n";
dbg << " ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
QString OpenTxFirmware::getFirmwareBaseUrl()
{
#if defined(ALLOW_NIGHTLY_BUILDS)
return (g.useFirmwareNightlyBuilds() ? OPENTX_NIGHT_FIRMWARE_DOWNLOADS : OPENTX_FIRMWARE_DOWNLOADS);
#else
return OPENTX_FIRMWARE_DOWNLOADS;
#endif
return OPENTX_FIRMWARE_DOWNLOAD_URL[g.boundedOpenTxBranch()];
}
QString OpenTxFirmware::getFirmwareUrl()
@@ -1172,25 +1139,25 @@ void addOpenTxCommonOptions(OpenTxFirmware * firmware)
firmware->addOptions(fai_options);
}
void addOpenTxArmOptions(OpenTxFirmware * firmware)
{
firmware->addOption("multimodule", QObject::tr("Support for the DIY-Multiprotocol-TX-Module"));
firmware->addOption("eu", QObject::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
}
void addOpenTxFrskyOptions(OpenTxFirmware * firmware)
{
addOpenTxCommonOptions(firmware);
addOpenTxArmOptions(firmware);
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
firmware->addOption("lua", QObject::tr("Enable Lua custom scripts screen"));
firmware->addOption("luac", QObject::tr("Enable Lua compiler"));
Option usb_options[] = {{"massstorage", QObject::tr("Instead of Joystick emulation, USB connection is Mass Storage (as in the Bootloader)")},
{"cli", QObject::tr("Instead of Joystick emulation, USB connection is Command Line Interface")},
{NULL}};
firmware->addOptions(usb_options);
firmware->addOption("eu", QObject::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
firmware->addOption("multimodule", QObject::tr("Support for the DIY-Multiprotocol-TX-Module"));
}
void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
{
addOpenTxFrskyOptions(firmware);
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
}
@@ -1208,6 +1175,16 @@ void addOpenTxLcdOptions(OpenTxFirmware * firmware)
firmware->addOptions(lcd_options);
}
void addOpenTxVoiceOptions(OpenTxFirmware * firmware)
{
Option voice_options[] = {
{"WTV20", QObject::tr("WTV20 voice module")},
{"JQ6500", QObject::tr("JQ6500 voice module")},
{NULL}
};
firmware->addOptions(voice_options);
}
QList<OpenTxEepromInterface *> opentxEEpromInterfaces;
void registerOpenTxFirmware(OpenTxFirmware * firmware)
@@ -1216,7 +1193,7 @@ void registerOpenTxFirmware(OpenTxFirmware * firmware)
firmware->setEEpromInterface(eepromInterface);
opentxEEpromInterfaces.push_back(eepromInterface);
eepromInterfaces.push_back(eepromInterface);
firmwares.push_back(firmware);
Firmware::addRegisteredFirmware(firmware);
}
void registerOpenTxFirmwares()
@@ -1262,12 +1239,20 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
/* FrSky X7 board */
firmware = new OpenTxFirmware("opentx-x7", QObject::tr("FrSky Taranis X7"), BOARD_TARANIS_X7);
addOpenTxTaranisOptions(firmware);
firmware = new OpenTxFirmware("opentx-x7", QObject::tr("FrSky Taranis X7 / X7S"), BOARD_TARANIS_X7);
// No mixersmon for now
addOpenTxFrskyOptions(firmware);
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
registerOpenTxFirmware(firmware);
/* FrSky X10 board */
firmware = new OpenTxFirmware("opentx-x10", QObject::tr("FrSky Horus X10 / X10S"), BOARD_X10);
addOpenTxFrskyOptions(firmware);
registerOpenTxFirmware(firmware);
/* FrSky Horus board */
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
firmware = new OpenTxFirmware("opentx-x12s", QObject::tr("FrSky Horus X12S"), BOARD_X12S);
addOpenTxFrskyOptions(firmware);
firmware->addOption("pcbdev", QObject::tr("Use ONLY with first DEV pcb version"));
registerOpenTxFirmware(firmware);
@@ -1275,7 +1260,6 @@ void registerOpenTxFirmwares()
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1286,6 +1270,7 @@ void registerOpenTxFirmwares()
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware);
@@ -1423,7 +1408,6 @@ void registerOpenTxFirmwares()
/* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1437,13 +1421,13 @@ void registerOpenTxFirmwares()
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware);
/* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1455,6 +1439,7 @@ void registerOpenTxFirmwares()
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware);
@@ -1497,12 +1482,12 @@ void registerOpenTxFirmwares()
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("sdcard", QObject::tr("Support for SD memory card"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
addOpenTxVoiceOptions(firmware);
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
@@ -1515,15 +1500,16 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware);
default_firmware_variant = getFirmware("opentx-x9d+");
current_firmware_variant = default_firmware_variant;
Firmware::setDefaultVariant(Firmware::getFirmwareForId("opentx-x9d+"));
Firmware::setCurrentVariant(Firmware::getDefaultVariant());
}
void unregisterOpenTxFirmwares()
{
foreach (Firmware * f, firmwares) {
foreach (Firmware * f, Firmware::getRegisteredFirmwares()) {
delete f;
}
unregisterEEpromInterfaces();
}
template <class T, class M>
@@ -67,17 +67,11 @@ class OpenTxEepromInterface : public EEPROMInterface
bool loadRadioSettingsFromRLE(GeneralSettings & settings, RleFile * rleFile, uint8_t version);
bool loadModelFromRLE(ModelData & model, RleFile * rleFile, unsigned int index, uint8_t version, uint32_t variant);
template <class T>
bool saveModel(unsigned int index, ModelData & model, uint8_t version, uint32_t variant);
template <class T>
bool saveRadioSettings(GeneralSettings & settings, Board::Type board, uint8_t version, uint32_t variant);
void showErrors(const QString & title, const QStringList & errors);
uint8_t getLastDataVersion(Board::Type board);
uint32_t getFourCC();
RleFile * efile;
OpenTxFirmware * firmware;
+4 -5
View File
@@ -102,7 +102,7 @@ void FlashEEpromDialog::updateUI()
void FlashEEpromDialog::on_eepromLoad_clicked()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
QString filename = QFileDialog::getOpenFileName(this, tr("Choose Radio Backup file"), g.eepromDir(), EXTERNAL_EEPROM_FILES_FILTER);
if (!filename.isEmpty()) {
eepromFilename = filename;
updateUI();
@@ -127,7 +127,7 @@ bool FlashEEpromDialog::patchCalibration()
{
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum = getCurrentFirmware()->getCapability(Pots);
int potsnum = getBoardCapability(getCurrentBoard(), Board::Pots);
int8_t txVoltageCalibration = (int8_t) g.profile[g.id()].txVoltageCalibration();
int8_t txCurrentCalibration = (int8_t) g.profile[g.id()].txCurrentCalibration();
int8_t PPM_Multiplier = (int8_t) g.profile[g.id()].ppmMultiplier();
@@ -227,10 +227,9 @@ void FlashEEpromDialog::on_burnButton_clicked()
if (patch) {
QString filename = generateProcessUniqueTempFileName("temp.bin");
QFile file(filename);
uint8_t *eeprom = (uint8_t*)malloc(getEEpromSize(getCurrentBoard()));
uint8_t *eeprom = (uint8_t*)malloc(Boards::getEEpromSize(getCurrentBoard()));
int eeprom_size = getCurrentEEpromInterface()->save(eeprom, *radioData, 0, getCurrentFirmware()->getVariantNumber());
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"), tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
if (eeprom_size == 0) {
return;
}
if (!file.open(QIODevice::WriteOnly)) {
+1 -4
View File
@@ -21,12 +21,9 @@
#ifndef _FLASHEEPROMDIALOG_H_
#define _FLASHEEPROMDIALOG_H_
#include <constants.h>
#include <QtWidgets>
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
namespace Ui
{
class FlashEEpromDialog;
+14 -17
View File
@@ -21,25 +21,22 @@
#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) :
const char * const OPENTX_SDCARD_DOWNLOAD_URL[] = {
"https://downloads.open-tx.org/2.2/release/sdcard/",
"https://downloads.open-tx.org/2.2/rc/sdcard/",
"https://downloads.open-tx.org/2.2/nightlies/sdcard/"
};
FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget * parent) :
QDialog(parent),
ui(new Ui::FirmwarePreferencesDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("fwpreferences.png"));
initSettings();
foreach(const char *lang, getCurrentFirmware()->getFirmwareBase()->ttslanguages) {
ui->voiceCombo->addItem(lang);
if (current_firmware_variant->getId().contains(QString("-tts%1").arg(lang)))
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
}
}
FirmwarePreferencesDialog::~FirmwarePreferencesDialog()
@@ -58,26 +55,26 @@ void FirmwarePreferencesDialog::initSettings()
void FirmwarePreferencesDialog::on_checkFWUpdates_clicked()
{
MainWindow * mw = (MainWindow *)this->parent();
MainWindow * mw = qobject_cast<MainWindow *>(this->parent());
mw->checkForFirmwareUpdate();
initSettings();
}
void FirmwarePreferencesDialog::on_fw_dnld_clicked()
{
MainWindow * mw = (MainWindow *)this->parent();
MainWindow * mw = qobject_cast<MainWindow *>(this->parent());
mw->dowloadLastFirmwareUpdate();
initSettings();
}
void FirmwarePreferencesDialog::on_voice_dnld_clicked()
void FirmwarePreferencesDialog::on_sd_dnld_clicked()
{
QString url = "http://voices-21.open-tx.org/";
QString url = OPENTX_SDCARD_DOWNLOAD_URL[g.boundedOpenTxBranch()];
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()));
if (g.boundedOpenTxBranch() != BRANCH_NIGHTLY_UNSTABLE) {
url.append(QString("%1/").arg(firmware));
}
QDesktopServices::openUrl(url);
}
+1 -1
View File
@@ -45,7 +45,7 @@ class FirmwarePreferencesDialog : public QDialog
private slots:
void on_fw_dnld_clicked();
void on_voice_dnld_clicked();
void on_sd_dnld_clicked();
void on_checkFWUpdates_clicked();
};
+59 -86
View File
@@ -26,13 +26,22 @@
<string>Downloads</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item row="24" column="5">
<item row="23" column="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -42,7 +51,7 @@
</property>
</widget>
</item>
<item row="3" column="5">
<item row="3" column="3">
<widget class="QPushButton" name="checkFWUpdates">
<property name="minimumSize">
<size>
@@ -55,75 +64,6 @@
</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>
</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">
@@ -147,20 +87,28 @@ May be different from firmware language</string>
</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>
<item row="5" column="3">
<widget class="QPushButton" name="fw_dnld">
<property name="text">
<string notr="true">FwType</string>
<string>Download firmware</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<item row="22" column="0" colspan="4">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QPushButton" name="sd_dnld">
<property name="text">
<string>Download SD contents</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="lastRevisionLbl">
<property name="text">
<string notr="true">-</string>
@@ -174,13 +122,38 @@ May be different from firmware language</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<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="6" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
<tabstop>checkFWUpdates</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>voice_dnld</tabstop>
<tabstop>sd_dnld</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+3 -2
View File
@@ -23,9 +23,10 @@ foreach(name ${generaledit_NAMES})
set(generaledit_HDRS ${generaledit_HDRS} ${name}.h)
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
endforeach()
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
add_library(generaledit ${generaledit_SRCS})
qt5_use_modules(generaledit Widgets Xml Multimedia)
qt5_use_modules(generaledit Widgets Xml Multimedia)
target_link_libraries(generaledit PRIVATE ${CPN_COMMON_LIB})
+3 -3
View File
@@ -41,10 +41,10 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
QStringList headerLabels;
headerLabels << QObject::tr("Negative span") << QObject::tr("Mid value") << QObject::tr("Positive span");
headerLabels << QObject::tr("Negative span") << QObject::tr("Mid value") << QObject::tr("Positive span");
tableWidget->setHorizontalHeaderLabels(headerLabels);
int rows = CPN_MAX_STICKS + getCurrentFirmware()->getCapability(Pots) + getCurrentFirmware()->getCapability(Sliders);
int rows = CPN_MAX_STICKS + getBoardCapability(getCurrentBoard(), Board::Pots) + getBoardCapability(getCurrentBoard(), Board::Sliders) + getBoardCapability(getCurrentBoard(), Board::MouseAnalogs);
tableWidget->setRowCount(rows);
for(int i = 0; i < rows; ++i) {
@@ -80,7 +80,7 @@ void CalibrationPanel::onCellChanged(int value)
emit modified();
}
}
int CalibrationPanel::getCalibrationValue(int row, int column)
{
switch(column) {
+13 -12
View File
@@ -99,10 +99,11 @@ void GeneralEdit::on_tabWidget_currentChanged(int index)
void GeneralEdit::on_calretrieve_PB_clicked()
{
Board::Type board = getCurrentBoard();
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString calib=g.profile[profile_id].stickPotCalib();
int potsnum=getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders);
int numSwPots=getCurrentFirmware()->getCapability(Switches)+getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders);
int potsnum=getBoardCapability(board, Board::Pots)+getBoardCapability(board, Board::Sliders);
int numSwPots=getBoardCapability(board, Board::Switches)+getBoardCapability(board, Board::Pots)+getBoardCapability(board, Board::Sliders);
if (calib.isEmpty()) {
return;
}
@@ -162,8 +163,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
qba = controlNames.mid(3*i,3).toLatin1();
strcpy(generalSettings.stickName[i], qba.data());
}
for (int i=0; i<(getCurrentFirmware()->getCapability(Switches)); i++) {
Byte=hwtypes.mid(i,1);
for (int i=0; i<getBoardCapability(board, Board::Switches); i++) {
Byte = hwtypes.mid(i, 1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+CPN_MAX_STICKS),3).toLatin1();
if (ok) {
@@ -171,8 +172,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
strcpy(generalSettings.switchName[i], qba.data());
}
}
offset = getCurrentFirmware()->getCapability(Switches);
for (int i=0; i<(getCurrentFirmware()->getCapability(Pots)); i++) {
offset = getBoardCapability(board, Board::Switches);
for (int i=0; i<getBoardCapability(board, Board::Pots); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+CPN_MAX_STICKS+offset),3).toLatin1();
@@ -181,8 +182,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
strcpy(generalSettings.potName[i], qba.data());
}
}
offset += getCurrentFirmware()->getCapability(Pots);
for (int i=0; i<(getCurrentFirmware()->getCapability(Sliders)); i++) {
offset += getBoardCapability(board, Board::Pots);
for (int i=0; i<getBoardCapability(board, Board::Sliders); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+CPN_MAX_STICKS+offset),3).toLatin1();
@@ -245,7 +246,7 @@ void GeneralEdit::on_calstore_PB_clicked()
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString name=g.profile[profile_id].name();
int potsnum=getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders);
int potsnum=getBoardCapability(getCurrentBoard(), Board::Pots)+getBoardCapability(getCurrentBoard(), Board::Sliders);
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
return;
@@ -279,15 +280,15 @@ void GeneralEdit::on_calstore_PB_clicked()
for (int i=0; i<CPN_MAX_STICKS; i++) {
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
}
for (int i=0; i<(getCurrentFirmware()->getCapability(Switches)); i++) {
for (int i=0; i<getBoardCapability(getCurrentBoard(), Board::Switches); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.switchConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.switchName[i], -3));
}
for (int i=0; i<(getCurrentFirmware()->getCapability(Pots)); i++) {
for (int i=0; i<getBoardCapability(getCurrentBoard(), Board::Pots); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.potConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.potName[i], -3));
}
for (int i=0; i<(getCurrentFirmware()->getCapability(Sliders)); i++) {
for (int i=0; i<getBoardCapability(getCurrentBoard(), Board::Sliders); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
}
+1 -1
View File
@@ -17,7 +17,7 @@
</sizepolicy>
</property>
<property name="windowTitle">
<string>General Edit</string>
<string>Radio settings</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
+50 -16
View File
@@ -27,11 +27,10 @@ ui(new Ui::GeneralSetup)
{
ui->setupUi(this);
QLabel * pmsl[] = {ui->ro_label,ui->ro1_label,ui->ro2_label,ui->ro3_label,ui->ro4_label,ui->ro5_label,ui->ro6_label,ui->ro7_label,ui->ro8_label, NULL};
QSlider * tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL};
QLabel *pmsl[] = {ui->ro_label, ui->ro1_label, ui->ro2_label, ui->ro3_label, ui->ro4_label, ui->ro5_label, ui->ro6_label, ui->ro7_label, ui->ro8_label, NULL};
QSlider *tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL};
if (IS_TARANIS(firmware->getBoard())) {
ui->contrastSB->setMinimum(0);
if (firmware->getId().contains("readonly")) {
uint16_t switchstate = generalSettings.switchUnlockStates;
ui->chkSA->setValue(switchstate & 0x3);
@@ -44,27 +43,27 @@ ui(new Ui::GeneralSetup)
switchstate >>= 2;
ui->chkSE->setValue(switchstate & 0x3);
switchstate >>= 2;
ui->chkSF->setValue((switchstate & 0x3)/2);
ui->chkSF->setValue((switchstate & 0x3) / 2);
switchstate >>= 2;
ui->chkSG->setValue(switchstate & 0x3);
switchstate >>= 2;
ui->chkSH->setValue(switchstate & 0x3);
}
else {
for (int i=0; pmsl[i]; i++) {
for (int i = 0; pmsl[i]; i++) {
pmsl[i]->hide();
}
for (int i=0; tpmsld[i]; i++) {
for (int i = 0; tpmsld[i]; i++) {
tpmsld[i]->hide();
}
this->layout()->removeItem(ui->TaranisReadOnlyUnlock);
}
}
else {
for (int i=0; pmsl[i]; i++) {
for (int i = 0; pmsl[i]; i++) {
pmsl[i]->hide();
}
for (int i=0; tpmsld[i]; i++) {
for (int i = 0; tpmsld[i]; i++) {
tpmsld[i]->hide();
}
this->layout()->removeItem(ui->TaranisReadOnlyUnlock);
@@ -112,10 +111,10 @@ ui(new Ui::GeneralSetup)
ui->varioVolume_SL->setValue(generalSettings.varioVolume);
ui->bgVolume_SL->setValue(generalSettings.backgroundVolume);
ui->wavVolume_SL->setValue(generalSettings.wavVolume);
ui->varioP0_SB->setValue(700+(generalSettings.varioPitch*10));
ui->varioP0_SB->setValue(700 + (generalSettings.varioPitch * 10));
updateVarioPitchRange();
ui->varioPMax_SB->setValue(700+(generalSettings.varioPitch*10)+1000+(generalSettings.varioRange*10));
ui->varioR0_SB->setValue(500+(generalSettings.varioRepeat*10));
ui->varioPMax_SB->setValue(700 + (generalSettings.varioPitch * 10) + 1000 + (generalSettings.varioRange * 10));
ui->varioR0_SB->setValue(500 + (generalSettings.varioRepeat * 10));
}
if (!firmware->getCapability(HasFAIMode)) {
@@ -152,11 +151,22 @@ ui(new Ui::GeneralSetup)
ui->adjustRTC->hide();
}
if (IS_STM32(firmware->getBoard())){
ui->usbModeCB->setCurrentIndex(generalSettings.usbMode);
}
else {
ui->usbModeLabel->hide();
ui->usbModeCB->hide();
}
if (!firmware->getCapability(OptrexDisplay)) {
ui->label_displayType->hide();
ui->displayTypeCB->setDisabled(true);
ui->displayTypeCB->hide();
}
else {
ui->displayTypeCB->setCurrentIndex(generalSettings.optrexDisplay);
}
if (!firmware->getCapability(HasVolume)) {
ui->volume_SB->hide();
@@ -197,7 +207,7 @@ ui(new Ui::GeneralSetup)
}
int reCount = firmware->getCapability(RotaryEncoders);
if (reCount==0) {
if (reCount == 0) {
ui->re_label->hide();
ui->re_CB->hide();
}
@@ -205,13 +215,23 @@ ui(new Ui::GeneralSetup)
populateRotEncCB(reCount);
}
ui->contrastSB->setMinimum(firmware->getCapability(MinContrast));
ui->contrastSB->setMaximum(firmware->getCapability(MaxContrast));
ui->contrastSB->setValue(generalSettings.contrast);
ui->battwarningDSB->setValue((double)generalSettings.vBatWarn/10);
ui->backlightautoSB->setValue(generalSettings.backlightDelay*5);
ui->inactimerSB->setValue(generalSettings.inactivityTimer);
ui->memwarnChkB->setChecked(!generalSettings.disableMemoryWarning); //Default is zero=checked
ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning);//Default is zero=checked
ui->memwarnChkB->setChecked(!generalSettings.disableMemoryWarning); // Default is zero=checked
ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning); // Default is zero=checked
if (IS_ARM(firmware->getBoard())) {
ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked
}
else {
ui->rssiPowerOffWarnChkB->hide();
}
if (IS_HORUS(firmware->getBoard())) {
ui->splashScreenChkB->hide();
@@ -325,6 +345,14 @@ void GeneralSetupPanel::on_backlightswCB_currentIndexChanged(int index)
}
}
void GeneralSetupPanel::on_usbModeCB_currentIndexChanged(int index)
{
if (!lock) {
generalSettings.usbMode = ui->usbModeCB->currentIndex();
emit modified();
}
}
void GeneralSetupPanel::on_backlightColor_SL_valueChanged()
{
if (!lock) {
@@ -607,18 +635,24 @@ void GeneralSetupPanel::on_inactimerSB_editingFinished()
emit modified();
}
void GeneralSetupPanel::on_memwarnChkB_stateChanged(int )
void GeneralSetupPanel::on_memwarnChkB_stateChanged(int)
{
generalSettings.disableMemoryWarning = ui->memwarnChkB->isChecked() ? 0 : 1;
emit modified();
}
void GeneralSetupPanel::on_alarmwarnChkB_stateChanged(int )
void GeneralSetupPanel::on_alarmwarnChkB_stateChanged(int)
{
generalSettings.disableAlarmWarning = ui->alarmwarnChkB->isChecked() ? 0 : 1;
emit modified();
}
void GeneralSetupPanel::on_rssiPowerOffWarnChkB_stateChanged(int)
{
generalSettings.disableRssiPoweroffAlarm = ui->rssiPowerOffWarnChkB->isChecked() ? 0 : 1;
emit modified();
}
void GeneralSetupPanel::on_beeperCB_currentIndexChanged(int index)
{
generalSettings.beeperMode = (GeneralSettings::BeeperMode)(index-2);
+2
View File
@@ -40,6 +40,7 @@ class GeneralSetupPanel : public GeneralPanel
void on_splashScreenChkB_stateChanged(int);
void on_splashScreenDuration_currentIndexChanged(int index);
void on_alarmwarnChkB_stateChanged(int);
void on_rssiPowerOffWarnChkB_stateChanged(int);
void on_gpsFormatCB_currentIndexChanged(int index);
void on_displayTypeCB_currentIndexChanged(int index);
void on_BLBright_SB_editingFinished();
@@ -58,6 +59,7 @@ class GeneralSetupPanel : public GeneralPanel
void on_hapticmodeCB_currentIndexChanged(int index);
void on_hapticLengthCB_currentIndexChanged(int index);
void on_backlightswCB_currentIndexChanged(int index);
void on_usbModeCB_currentIndexChanged(int index);
void on_backlightColor_SL_valueChanged();
void on_mavbaud_CB_currentIndexChanged(int index);
void on_voiceLang_CB_currentIndexChanged(int index);
File diff suppressed because it is too large Load Diff
+57 -27
View File
@@ -21,9 +21,10 @@
#include "hardware.h"
#include "ui_hardware.h"
void HardwarePanel::setupSwitchType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos)
{
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Switches)) {
Board::Type board = getCurrentBoard();
if (IS_STM32(board) && index < getBoardCapability(board, Board::Switches)) {
type->addItem(tr("None"), Board::SWITCH_NOT_AVAILABLE);
type->addItem(tr("2 Positions Toggle"), Board::SWITCH_TOGGLE);
type->addItem(tr("2 Positions"), Board::SWITCH_2POS);
@@ -32,6 +33,14 @@ void HardwarePanel::setupSwitchType(int index, QLabel *label, AutoLineEdit *name
}
name->setField(generalSettings.switchName[index], 3, this);
type->setField(generalSettings.switchConfig[index], this);
if (IS_TARANIS_X7(board)) {
if (index == 4) {
label->setText("SF");
}
else if (index == 5) {
label->setText("SH");
}
}
}
else {
label->hide();
@@ -40,9 +49,11 @@ void HardwarePanel::setupSwitchType(int index, QLabel *label, AutoLineEdit *name
}
}
void HardwarePanel::setupPotType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
void HardwarePanel::setupPotType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type)
{
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Pots)) {
Board::Type board = firmware->getBoard();
if (IS_STM32(board) && index < getBoardCapability(board, Board::Pots)) {
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+index).toString());
type->addItem(tr("None"), Board::POT_NONE);
type->addItem(tr("Pot with detent"), Board::POT_WITH_DETENT);
@@ -60,8 +71,10 @@ void HardwarePanel::setupPotType(int index, QLabel *label, AutoLineEdit *name, A
void HardwarePanel::setupSliderType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Sliders)) {
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+firmware->getCapability(Pots)+index).toString());
Board::Type board = firmware->getBoard();
if (IS_STM32(board) && index < getBoardCapability(board, Board::Sliders)) {
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+getBoardCapability(board, Board::Pots)+index).toString());
type->addItem(tr("None"), Board::SLIDER_NONE);
type->addItem(tr("Slider with detent"), Board::SLIDER_WITH_DETENT);
name->setField(generalSettings.sliderName[index], 3, this);
@@ -79,7 +92,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
ui(new Ui::Hardware)
{
ui->setupUi(this);
Board::Type board = firmware->getBoard();
if (IS_STM32(board)) {
@@ -97,6 +110,8 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
ui->thrName->hide();
ui->ailLabel->hide();
ui->ailName->hide();
ui->potsTypeSeparator_1->hide();
ui->potsTypeSeparator_2->hide();
}
setupPotType(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
@@ -128,10 +143,11 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
setupSwitchType(16, ui->sqLabel, ui->sqName, ui->sqType);
setupSwitchType(17, ui->srLabel, ui->srName, ui->srType);
if (IS_HORUS_OR_TARANIS(board) && !IS_TARANIS_X7(board)) {
if (IS_TARANIS(board) && !IS_TARANIS_X7(board)) {
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
}
else {
ui->serialPortMode->setCurrentIndex(0);
ui->serialPortMode->hide();
ui->serialPortLabel->hide();
}
@@ -147,10 +163,9 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
}
else {
ui->bluetoothLabel->hide();
ui->bluetoothEnable->hide();
ui->bluetoothName->hide();
ui->bluetoothWidget->hide();
}
if (IS_HORUS_OR_TARANIS(board)) {
ui->filterEnable->setChecked(!generalSettings.jitterFilter);
}
@@ -175,39 +190,52 @@ void HardwarePanel::on_filterEnable_stateChanged()
void HardwarePanel::on_PPM_MultiplierDSB_editingFinished()
{
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
emit modified();
int val = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
if (generalSettings.PPM_Multiplier != val) {
generalSettings.PPM_Multiplier = val;
emit modified();
}
}
void HardwarePanel::on_PPM1_editingFinished()
{
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
if (generalSettings.trainer.calib[0] != ui->PPM1->value()) {
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
}
}
void HardwarePanel::on_PPM2_editingFinished()
{
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
if (generalSettings.trainer.calib[1] != ui->PPM2->value()) {
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
}
}
void HardwarePanel::on_PPM3_editingFinished()
{
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
if (generalSettings.trainer.calib[2] != ui->PPM3->value()) {
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
}
}
void HardwarePanel::on_PPM4_editingFinished()
{
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
if (generalSettings.trainer.calib[3] != ui->PPM4->value()) {
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
}
}
void HardwarePanel::on_txCurrentHardware_editingFinished()
void HardwarePanel::on_txCurrentCalibration_editingFinished()
{
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
emit modified();
if (generalSettings.txCurrentCalibration != ui->txCurrentCalibration->value()) {
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
emit modified();
}
}
void HardwarePanel::on_bluetoothEnable_stateChanged(int)
@@ -228,10 +256,12 @@ void HardwarePanel::setValues()
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
}
void HardwarePanel::on_txVoltageHardware_editingFinished()
void HardwarePanel::on_txVoltageCalibration_editingFinished()
{
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
emit modified();
if (generalSettings.txVoltageCalibration != ui->txVoltageCalibration->value()*10) {
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
emit modified();
}
}
void HardwarePanel::on_serialPortMode_currentIndexChanged(int index)
+3 -3
View File
@@ -40,14 +40,14 @@ class HardwarePanel : public GeneralPanel
virtual ~HardwarePanel();
private slots:
void on_txVoltageHardware_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_PPM_MultiplierDSB_editingFinished();
void on_txCurrentHardware_editingFinished();
void on_txCurrentCalibration_editingFinished();
void on_txVoltageCalibration_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_filterEnable_stateChanged();
@@ -56,7 +56,7 @@ class HardwarePanel : public GeneralPanel
protected:
void setupPotType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type);
void setupSliderType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type);
void setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos);
void setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos = true);
private:
Ui::Hardware *ui;
+120 -65
View File
@@ -6,14 +6,23 @@
<rect>
<x>0</x>
<y>0</y>
<width>359</width>
<height>1594</height>
<width>470</width>
<height>1095</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" columnstretch="0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item row="29" column="0">
<widget class="QLabel" name="sqLabel">
<property name="text">
@@ -125,19 +134,6 @@
</property>
</widget>
</item>
<item row="12" column="0" colspan="5">
<widget class="Line" name="potsTypeSeparator_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="AutoLineEdit" name="pot2Name">
<property name="maxLength">
@@ -730,32 +726,6 @@
</property>
</widget>
</item>
<item row="31" column="0" colspan="4">
<widget class="Line" name="potsTypeSeparator_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="38" column="0" colspan="4">
<widget class="Line" name="potsTypeSeparator_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="25" column="0">
<widget class="QLabel" name="smLabel">
<property name="text">
@@ -1075,6 +1045,12 @@
</item>
<item row="32" column="0">
<widget class="QLabel" name="bluetoothLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bluetooth</string>
</property>
@@ -1090,24 +1066,6 @@
</property>
</widget>
</item>
<item row="32" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="bluetoothEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="AutoLineEdit" name="bluetoothName">
<property name="maxLength">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="33" column="1">
<widget class="QCheckBox" name="filterEnable">
<property name="text">
@@ -1122,19 +1080,116 @@
</property>
</widget>
</item>
<item row="32" column="1">
<widget class="QWidget" name="bluetoothWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="bluetoothEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="btNameLabel">
<property name="text">
<string>Device Name:</string>
</property>
</widget>
</item>
<item>
<widget class="AutoLineEdit" name="bluetoothName">
<property name="maxLength">
<number>10</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="31" column="0" colspan="3">
<widget class="Line" name="potsTypeSeparator_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="38" column="0" colspan="3">
<widget class="Line" name="ppmSeparator">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<widget class="Line" name="potsTypeSeparator_1">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>AutoLineEdit</class>
<extends>QLineEdit</extends>
<header>autolineedit.h</header>
</customwidget>
<customwidget>
<class>AutoComboBox</class>
<extends>QComboBox</extends>
<header>autocombobox.h</header>
</customwidget>
<customwidget>
<class>AutoLineEdit</class>
<extends>QLineEdit</extends>
<header>autolineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
+217 -375
View File
@@ -25,16 +25,18 @@
#elif defined __GNUC__
#include <unistd.h>
#endif
#if defined(WIN32) && defined(WIN_USE_CONSOLE_STDIO)
#include "windows.h"
#endif
#include "appdata.h"
#include "macros.h"
#include "helpers.h"
#include "modeledit/modeledit.h"
#include "simulatordialog.h"
#include "simulatormainwindow.h"
#include "storage/sdcard.h"
#include <QLabel>
#include <QMessageBox>
using namespace Helpers;
Stopwatch gStopwatch("global");
const QColor colors[CPN_MAX_CURVES] = {
@@ -72,61 +74,11 @@ const QColor colors[CPN_MAX_CURVES] = {
QColor(255,127,0),
};
void populateGvSourceCB(QComboBox *b, int value)
{
QString strings[] = { QObject::tr("---"), QObject::tr("Rud Trim"), QObject::tr("Ele Trim"), QObject::tr("Thr Trim"), QObject::tr("Ail Trim"), QObject::tr("Rot Enc"), QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
b->clear();
for (int i=0; i<= 12; i++) {
b->addItem(strings[i]);
}
b->setCurrentIndex(value);
}
/*
* GVarGroup
*/
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current)
{
b->clear();
b->addItem("----");
bool added = false;
// Convert set into list and sort it alphabetically case insensitive
QStringList list = QStringList::fromSet(set);
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
foreach (QString entry, list) {
b->addItem(entry);
if (entry == current) {
b->setCurrentIndex(b->count()-1);
added = true;
}
}
if (!added && !current.isEmpty()) {
b->addItem(current);
b->setCurrentIndex(b->count()-1);
}
}
void getFileComboBoxValue(QComboBox * b, char * dest, int length)
{
memset(dest, 0, length+1);
if (b->currentText() != "----") {
strncpy(dest, b->currentText().toLatin1(), length);
}
}
void populatePhasesCB(QComboBox *b, int value)
{
for (int i=-getCurrentFirmware()->getCapability(FlightModes); i<=getCurrentFirmware()->getCapability(FlightModes); i++) {
if (i < 0)
b->addItem(QObject::tr("!Flight mode %1").arg(-i-1), i);
else if (i > 0)
b->addItem(QObject::tr("Flight mode %1").arg(i-1), i);
else
b->addItem(QObject::tr("----"), 0);
}
b->setCurrentIndex(value + getCurrentFirmware()->getCapability(FlightModes));
}
GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step, bool allowGvars, ModelPanel * panel):
GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
@@ -135,11 +87,10 @@ GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBo
weightCB(weightCB),
weight(weight),
step(step),
lock(true),
panel(panel)
lock(true)
{
if (allowGvars && getCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(*weightCB, weight, model);
Helpers::populateGVCB(*weightCB, weight, model);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
}
@@ -200,12 +151,15 @@ void GVarGroup::valuesChanged()
weight = sb->value();
else
weight = round(dsb->value()/step);
if (panel)
emit panel->modified();
emit valueChanged();
}
}
/*
* CurveGroup
*/
CurveGroup::CurveGroup(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QComboBox * curveValueCB, QSpinBox * curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags):
QObject(),
curveTypeCB(curveTypeCB),
@@ -247,7 +201,7 @@ void CurveGroup::update()
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
lastType = curve.type;
populateGVCB(*curveValueCB, curve.value, model);
Helpers::populateGVCB(*curveValueCB, curve.value, model);
}
curveValueCB->show();
curveValueSB->hide();
@@ -271,7 +225,7 @@ void CurveGroup::update()
lastType = curve.type;
curveValueCB->clear();
for (int i=0; i<=6/*TODO constant*/; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_FUNC, i).toString());
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_FUNC, i).toString(&model, false));
}
}
curveValueCB->setCurrentIndex(curve.value);
@@ -283,7 +237,7 @@ void CurveGroup::update()
lastType = curve.type;
curveValueCB->clear();
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(&model, false), i);
if (i == curve.value) {
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
}
@@ -364,7 +318,52 @@ void CurveGroup::valuesChanged()
}
}
void populateGvarUseCB(QComboBox *b, unsigned int phase)
/*
* Helpers namespace functions
*/
void Helpers::populateGVCB(QComboBox & b, int value, const ModelData & model)
{
int count = getCurrentFirmware()->getCapability(Gvars);
b.clear();
for (int i=-count; i<=-1; i++) {
int16_t gval = (int16_t)(-10000+i);
b.addItem("-" + RawSource(SOURCE_TYPE_GVAR, abs(i)-1).toString(&model), gval);
}
for (int i=1; i<=count; i++) {
int16_t gval = (int16_t)(10000+i);
b.addItem(RawSource(SOURCE_TYPE_GVAR, i-1).toString(&model), gval);
}
b.setCurrentIndex(b.findData(value));
if (b.currentIndex() == -1)
b.setCurrentIndex(count);
}
// Returns Diff/Expo/Weight/Offset adjustment value as either a percentage or a global variable name.
QString Helpers::getAdjustmentString(int16_t val, const ModelData * model, bool sign)
{
QString ret;
if (val >= -10000 && val <= 10000) {
ret = "%1%";
if (sign && val > 0)
ret.prepend("+");
ret = ret.arg(val);
}
else {
ret = RawSource(SOURCE_TYPE_GVAR, abs(val) - 10001).toString(model);
if (val < 0)
ret.prepend("-");
else if (sign)
ret.prepend("+");
}
return ret;
}
void Helpers::populateGvarUseCB(QComboBox * b, unsigned int phase)
{
b->addItem(QObject::tr("Own value"));
for (int i=0; i<getCurrentFirmware()->getCapability(FlightModes); i++) {
@@ -374,321 +373,143 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase)
}
}
void populateSwitchCB(QComboBox * b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context)
void Helpers::populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current)
{
Board::Type board = getCurrentBoard();
RawSwitch item;
b->clear();
b->addItem("----");
if (context != MixesContext && context != GlobalFunctionsContext) {
// !FMx
if (IS_ARM(board)) {
for (int i=-getCurrentFirmware()->getCapability(FlightModes); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
bool added = false;
// Convert set into list and sort it alphabetically case insensitive
QStringList list = QStringList::fromSet(set);
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
foreach (QString entry, list) {
b->addItem(entry);
if (entry == current) {
b->setCurrentIndex(b->count()-1);
added = true;
}
}
if (context != GlobalFunctionsContext) {
for (int i=-getCurrentFirmware()->getCapability(LogicalSwitches); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
for (int i=-getCurrentFirmware()->getCapability(RotaryEncoders); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=-8; i<0; i++) {
item = RawSwitch(SWITCH_TYPE_TRIM, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=getCurrentFirmware()->getCapability(MultiposPots)-1; i>=0; i--) {
if (generalSettings.potConfig[i] == Board::POT_MULTIPOS_SWITCH) {
for (int j=-getCurrentFirmware()->getCapability(MultiposPotsPositions); j<0; j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i*getCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
for (int i=-getCurrentFirmware()->getCapability(SwitchesPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
if (IS_HORUS_OR_TARANIS(board) && !generalSettings.switchPositionAllowedTaranis(i)) {
continue;
}
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (context == TimersContext) {
for (int i=0; i<5; i++) {
item = RawSwitch(SWITCH_TYPE_TIMER_MODE, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
else {
item = RawSwitch(SWITCH_TYPE_NONE);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=1; i<=getCurrentFirmware()->getCapability(SwitchesPositions); i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
if (IS_HORUS_OR_TARANIS(board) && !generalSettings.switchPositionAllowedTaranis(i)) {
continue;
}
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<getCurrentFirmware()->getCapability(MultiposPots); i++) {
if (generalSettings.potConfig[i] == Board::POT_MULTIPOS_SWITCH) {
for (int j=1; j<=getCurrentFirmware()->getCapability(MultiposPotsPositions); j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i*getCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
for (int i=1; i<=8; i++) {
item = RawSwitch(SWITCH_TYPE_TRIM, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=1; i<=getCurrentFirmware()->getCapability(RotaryEncoders); i++) {
item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (context != GlobalFunctionsContext) {
for (int i=1; i<=getCurrentFirmware()->getCapability(LogicalSwitches); i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
if (context == SpecialFunctionsContext || context == GlobalFunctionsContext) {
// ON
item = RawSwitch(SWITCH_TYPE_ON);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// One
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
// FMx
if (context != MixesContext && context != GlobalFunctionsContext) {
if (IS_ARM(board)) {
for (int i=1; i<=getCurrentFirmware()->getCapability(FlightModes); i++) {
item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
b->setMaxVisibleItems(10);
}
void populateGVCB(QComboBox & b, int value, const ModelData & model)
{
bool selected = false;
b.clear();
int count = getCurrentFirmware()->getCapability(Gvars);
for (int i=-count; i<=-1; i++) {
int16_t gval = (int16_t)(-10000+i);
if (strlen(model.gvars_names[-i-1]) > 0)
b.addItem(QObject::tr("-GV%1 (%2)").arg(-i).arg(model.gvars_names[-i-1]), gval);
else
b.addItem(QObject::tr("-GV%1").arg(-i), gval);
if (value == gval) {
b.setCurrentIndex(b.count()-1);
selected = true;
}
}
for (int i=1; i<=count; i++) {
int16_t gval = (int16_t)(10000+i);
if (strlen(model.gvars_names[i-1]) > 0)
b.addItem(QObject::tr("GV%1 (%2)").arg(i).arg(model.gvars_names[i-1]), gval);
else
b.addItem(QObject::tr("GV%1").arg(i), gval);
if (value == gval) {
b.setCurrentIndex(b.count()-1);
selected = true;
}
}
if (!selected) {
b.setCurrentIndex(count);
if (!added && !current.isEmpty()) {
b->addItem(current);
b->setCurrentIndex(b->count()-1);
}
}
void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags)
void Helpers::getFileComboBoxValue(QComboBox * b, char * dest, int length)
{
Board::Type board = getCurrentBoard();
RawSource item;
memset(dest, 0, length+1);
if (b->currentText() != "----") {
strncpy(dest, b->currentText().toLatin1(), length);
}
}
b->clear();
void Helpers::addRawSourceItems(QStandardItemModel * itemModel, const RawSourceType & type, int count, const GeneralSettings * const generalSettings,
const ModelData * const model, const int start, const QList<int> exclude)
{
for (int i = start; i < start + count; i++) {
if (exclude.contains(i))
continue;
RawSource src = RawSource(type, i);
if (model) {
if (type == SOURCE_TYPE_VIRTUAL_INPUT && !model->isInputValid(i))
continue;
}
if (generalSettings) {
int genAryIdx = 0;
if (type == SOURCE_TYPE_STICK && ((src.isPot(&genAryIdx) && !generalSettings->isPotAvailable(genAryIdx)) || (src.isSlider(&genAryIdx) && !generalSettings->isSliderAvailable(genAryIdx))))
continue;
}
QStandardItem * modelItem = new QStandardItem(src.toString(model, generalSettings));
modelItem->setData(src.toValue(), Qt::UserRole);
itemModel->appendRow(modelItem);
if (type == SOURCE_TYPE_SWITCH && generalSettings && IS_HORUS_OR_TARANIS(getCurrentBoard()) && !generalSettings->switchSourceAllowedTaranis(i)) {
modelItem->setData(0, Qt::UserRole - 1); // trick to disable an item
}
}
}
QStandardItemModel * Helpers::getRawSourceItemModel(const GeneralSettings * const generalSettings, const ModelData * const model, unsigned int flags)
{
QStandardItemModel * itemModel = new QStandardItemModel();
Boards board = Boards(getCurrentBoard());
Firmware * fw = getCurrentFirmware();
if (flags & POPULATE_NONE) {
item = RawSource(SOURCE_TYPE_NONE);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
addRawSourceItems(itemModel, SOURCE_TYPE_NONE, 1, generalSettings, model);
}
if (flags & POPULATE_SCRIPT_OUTPUTS) {
for (int i=0; i<getCurrentFirmware()->getCapability(LuaScripts); i++) {
for (int j=0; j<getCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
item = RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i < getCurrentFirmware()->getCapability(LuaScripts); i++) {
addRawSourceItems(itemModel, SOURCE_TYPE_LUA_OUTPUT, fw->getCapability(LuaOutputsPerScript), generalSettings, model, i * 16);
}
}
if (model && (flags & POPULATE_VIRTUAL_INPUTS)) {
int virtualInputs = getCurrentFirmware()->getCapability(VirtualInputs);
for (int i=0; i<virtualInputs; i++) {
if (model->isInputValid(i)) {
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
addRawSourceItems(itemModel, SOURCE_TYPE_VIRTUAL_INPUT, fw->getCapability(VirtualInputs), generalSettings, model);
}
if (flags & POPULATE_SOURCES) {
for (int i=0; i<CPN_MAX_STICKS+getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders); i++) {
item = RawSource(SOURCE_TYPE_STICK, i);
// skip unavailable pots and sliders
if (item.isPot() && !generalSettings.isPotAvailable(i-CPN_MAX_STICKS)) continue;
if (item.isSlider() && !generalSettings.isSliderAvailable(i-CPN_MAX_STICKS-getCurrentFirmware()->getCapability(Pots))) continue;
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<getCurrentFirmware()->getCapability(RotaryEncoders); i++) {
item = RawSource(SOURCE_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
int totalSources = CPN_MAX_STICKS + board.getCapability(Board::Pots) + board.getCapability(Board::Sliders) + board.getCapability(Board::MouseAnalogs);
addRawSourceItems(itemModel, SOURCE_TYPE_STICK, totalSources, generalSettings, model);
addRawSourceItems(itemModel, SOURCE_TYPE_ROTARY_ENCODER, fw->getCapability(RotaryEncoders), generalSettings, model);
}
if (flags & POPULATE_TRIMS) {
for (int i=0; i<4; i++) {
item = RawSource(SOURCE_TYPE_TRIM, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
addRawSourceItems(itemModel, SOURCE_TYPE_TRIM, board.getCapability(Board::NumTrims), generalSettings, model);
}
if (flags & POPULATE_SOURCES) {
item = RawSource(SOURCE_TYPE_MAX);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
addRawSourceItems(itemModel, SOURCE_TYPE_MAX, 1, generalSettings, model);
}
if (flags & POPULATE_SWITCHES) {
for (int i=0; i<getCurrentFirmware()->getCapability(Switches); i++) {
item = RawSource(SOURCE_TYPE_SWITCH, i);
b->addItem(item.toString(model), item.toValue());
if (IS_HORUS_OR_TARANIS(board) && !generalSettings.switchSourceAllowedTaranis(i)) {
QModelIndex index = b->model()->index(b->count()-1, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<getCurrentFirmware()->getCapability(LogicalSwitches); i++) {
item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
addRawSourceItems(itemModel, SOURCE_TYPE_SWITCH, board.getCapability(Board::Switches), generalSettings, model);
addRawSourceItems(itemModel, SOURCE_TYPE_CUSTOM_SWITCH, fw->getCapability(LogicalSwitches), generalSettings, model);
}
if (flags & POPULATE_SOURCES) {
for (int i=0; i<CPN_MAX_CYC; i++) {
item = RawSource(SOURCE_TYPE_CYC, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<getCurrentFirmware()->getCapability(TrainerInputs); i++) {
item = RawSource(SOURCE_TYPE_PPM, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<getCurrentFirmware()->getCapability(Outputs); i++) {
item = RawSource(SOURCE_TYPE_CH, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
addRawSourceItems(itemModel, SOURCE_TYPE_CYC, CPN_MAX_CYC, generalSettings, model);
addRawSourceItems(itemModel, SOURCE_TYPE_PPM, fw->getCapability(TrainerInputs), generalSettings, model);
addRawSourceItems(itemModel, SOURCE_TYPE_CH, fw->getCapability(Outputs), generalSettings, model);
}
if (flags & POPULATE_TELEMETRY) {
if (IS_ARM(getCurrentBoard())) {
for (int i=0; i<5; ++i) {
item = RawSource(SOURCE_TYPE_SPECIAL, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<CPN_MAX_SENSORS; ++i) {
if (model && model->sensorData[i].isAvailable()) { //this conditon must be false if we populate Global Functions where model = 0
for (int j=0; j<3; ++j) {
item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i+j);
b->addItem(item.toString(model), item.toValue());
// qDebug() << item.toString(model) << source.toString(model);
if (item == source) b->setCurrentIndex(b->count()-1);
}
if (IS_ARM(board.getBoardType())) {
addRawSourceItems(itemModel, SOURCE_TYPE_SPECIAL, 5, generalSettings, model);
if (model) {
QList<int> exclude;
for (int i=0; i < CPN_MAX_SENSORS * 3; ++i) {
//this conditon must be false if we populate Global Functions where model = 0
if (!model->sensorData[div(i, 3).quot].isAvailable())
exclude << i;
}
if (exclude.size() < CPN_MAX_SENSORS * 3)
addRawSourceItems(itemModel, SOURCE_TYPE_TELEMETRY, CPN_MAX_SENSORS * 3, generalSettings, model, 0, exclude);
}
}
else {
for (int i=0; i<(flags & POPULATE_TELEMETRYEXT ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_COUNT); i++) {
if (i==TELEMETRY_SOURCE_TX_TIME && !getCurrentFirmware()->getCapability(RtcTime))
continue;
if (i==TELEMETRY_SOURCE_SWR && !getCurrentFirmware()->getCapability(SportTelemetry))
continue;
if (i==TELEMETRY_SOURCE_TIMER3 && !IS_ARM(board))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
QList<int> exclude;
if (!fw->getCapability(RtcTime))
exclude << TELEMETRY_SOURCE_TX_TIME;
if (!fw->getCapability(SportTelemetry))
exclude << TELEMETRY_SOURCE_SWR;
if (!IS_ARM(board.getBoardType()))
exclude << TELEMETRY_SOURCE_TIMER3;
int count = ((flags & POPULATE_TELEMETRYEXT) ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_COUNT);
addRawSourceItems(itemModel, SOURCE_TYPE_TELEMETRY, count, generalSettings, model, 0, exclude);
}
}
if (flags & POPULATE_GVARS) {
for (int i=0; i<getCurrentFirmware()->getCapability(Gvars); i++) {
item = RawSource(SOURCE_TYPE_GVAR, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
addRawSourceItems(itemModel, SOURCE_TYPE_GVAR, fw->getCapability(Gvars), generalSettings, model);
}
b->setMaxVisibleItems(10);
return itemModel;
}
QString image2qstring(QImage image)
@@ -813,35 +634,44 @@ CompanionIcon::CompanionIcon(const QString &baseimage)
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
{
SimulatorInterface * simulator = getCurrentSimulator();
if (simulator) {
RadioData * simuData = new RadioData(radioData);
unsigned int flags = 0;
QString fwId = SimulatorLoader::findSimulatorByFirmwareName(getCurrentFirmware()->getId());
if (fwId.isEmpty()) {
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("Simulator for this firmware is not yet available"));
return;
}
if (modelIdx >= 0) {
flags |= SIMULATOR_FLAGS_NOTX;
simuData->setCurrentModel(modelIdx);
}
RadioData * simuData = new RadioData(radioData);
unsigned int flags = 0;
SimulatorDialog * dialog = new SimulatorDialog(parent, simulator, flags);
if (IS_HORUS(getCurrentBoard()) && !dialog->useTempDataPath(true)) {
QMessageBox::critical(NULL, QObject::tr("Data Load Error"), QObject::tr("Error: Could not create temporary directory in '%1'").arg(QDir::tempPath()));
delete dialog;
delete simuData;
return;
}
dialog->setRadioData(simuData);
qDebug() << __FILE__ << __LINE__ << "Starting" << getCurrentFirmware()->getName() << "simulation with SD path" << dialog->getSdPath() << "and models/settings path" << dialog->getDataPath();
dialog->start();
dialog->exec();
delete dialog;
// TODO Horus tmp directory is deleted on simulator close OR we could use it to get back data from the simulation
delete simuData; // TODO same with simuData, could read it back and update the file data
if (modelIdx >= 0) {
flags |= SIMULATOR_FLAGS_NOTX;
simuData->setCurrentModel(modelIdx);
}
SimulatorMainWindow * dialog = new SimulatorMainWindow(parent, fwId, flags);
dialog->setWindowModality(Qt::ApplicationModal);
dialog->setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(dialog, &SimulatorMainWindow::destroyed, [simuData] (void) {
// TODO simuData and Horus tmp directory is deleted on simulator close OR we could use it to get back data from the simulation
delete simuData;
});
QString resultMsg;
if (dialog->getExitStatus(&resultMsg)) {
if (resultMsg.isEmpty())
resultMsg = QObject::tr("Uknown error during Simulator startup.");
QMessageBox::critical(NULL, QObject::tr("Simulator Error"), resultMsg);
dialog->deleteLater();
}
else if (dialog->setRadioData(simuData)) {
dialog->show();
}
else {
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("Simulator for this firmware is not yet available"));
QMessageBox::critical(NULL, QObject::tr("Data Load Error"), QObject::tr("Error occurred while starting simulator."));
dialog->deleteLater();
}
}
@@ -851,8 +681,8 @@ QPixmap makePixMap(const QImage & image)
QImage result = image.scaled(firmware->getCapability(LcdWidth), firmware->getCapability(LcdHeight));
if (firmware->getCapability(LcdDepth) == 4) {
result = result.convertToFormat(QImage::Format_RGB32);
for (int i = 0; i < image.width(); ++i) {
for (int j = 0; j < image.height(); ++j) {
for (int i = 0; i < result.width(); ++i) {
for (int j = 0; j < result.height(); ++j) {
QRgb col = result.pixel(i, j);
int gray = qGray(col);
result.setPixel(i, j, qRgb(gray, gray, gray));
@@ -866,13 +696,23 @@ QPixmap makePixMap(const QImage & image)
return QPixmap::fromImage(result);
}
int version2index(const QString & version)
{
int result = 999;
QStringList parts = version.split("N");
if (parts.size() > 1)
result = parts[1].toInt(); // nightly build
parts = parts[0].split('.');
QStringList parts;
QString mainVersion = version;
if (version.contains("RC")) {
parts = version.split("RC");
result = parts[1].toInt() + 900; // RC0 = 900; RC1=901,..
mainVersion = parts[0];
}
else if (version.contains("N")) {
parts = version.split("N");
result = parts[1].toInt(); // nightly build up to 899
mainVersion = parts[0];
}
parts = mainVersion.split('.');
if (parts.size() > 2)
result += 1000 * parts[2].toInt();
if (parts.size() > 1)
@@ -882,8 +722,10 @@ int version2index(const QString & version)
return result;
}
QString index2version(int index)
const QString index2version(int index)
{
QString result;
QString templt("%1.%2.%3");
if (index >= 19900000) {
int nightly = index % 1000;
index /= 1000;
@@ -891,22 +733,22 @@ QString index2version(int index)
index /= 100;
int minor = index % 100;
int major = index / 100;
QString result = QString("%1.%2.%3").arg(major).arg(minor).arg(revision);
if (nightly > 0 && nightly < 999) {
result += QString("N%1").arg(nightly);
result = templt.arg(major).arg(minor).arg(revision);
if (nightly > 0 && nightly < 900) {
result += "N" + QString::number(nightly);
}
else if (nightly >= 900 && nightly < 1000) {
result += "RC" + QString::number(nightly-900);
}
return result;
}
else if (index >= 19900) {
int revision = index % 100;
index /= 100;
int minor = index % 100;
int major = index / 100;
return QString("%1.%2.%3").arg(major).arg(minor).arg(revision);
}
else {
return QString();
result = templt.arg(major).arg(minor).arg(revision);
}
return result;
}
bool qunlink(const QString & fileName)
+32 -54
View File
@@ -22,7 +22,6 @@
#define _HELPERS_H_
#include "eeprominterface.h"
#include "modeledit/modeledit.h"
#include <QCheckBox>
#include <QSpinBox>
#include <QTableWidget>
@@ -30,6 +29,7 @@
#include <QDebug>
#include <QTime>
#include <QElapsedTimer>
#include <QStandardItemModel>
extern const QColor colors[CPN_MAX_CURVES];
@@ -52,11 +52,6 @@ extern const QColor colors[CPN_MAX_CURVES];
#define TRIM_MODE_NONE 0x1F // 0b11111
void populateGvSourceCB(QComboBox *b, int value);
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current);
void getFileComboBoxValue(QComboBox * b, char * dest, int length);
void populateRotEncCB(QComboBox *b, int value, int renumber);
QString getTheme();
class CompanionIcon: public QIcon {
@@ -69,7 +64,10 @@ class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true, ModelPanel * panel=NULL);
GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
signals:
void valueChanged();
protected slots:
void gvarCBChanged(int);
@@ -84,7 +82,6 @@ class GVarGroup: public QObject {
int & weight;
double step;
bool lock;
ModelPanel * panel;
};
#define HIDE_DIFF 0x01
@@ -116,19 +113,6 @@ class CurveGroup : public QObject {
int lastType;
};
enum SwitchContext
{
LogicalSwitchesContext,
SpecialFunctionsContext,
GlobalFunctionsContext,
TimersContext,
MixesContext
};
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context);
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
#define POPULATE_NONE (1<<0)
#define POPULATE_SOURCES (1<<1)
@@ -143,8 +127,22 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
#define GVARS_VARIANT 0x0001
#define FRSKY_VARIANT 0x0002
void populateGVCB(QComboBox & b, int value, const ModelData & model);
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
namespace Helpers
{
void addRawSourceItems(QStandardItemModel * itemModel, const RawSourceType & type, int count, const GeneralSettings * const generalSettings = NULL,
const ModelData * const model = NULL, const int start = 0, const QList<int> exclude = QList<int>());
QStandardItemModel * getRawSourceItemModel(const GeneralSettings * const generalSettings = NULL, const ModelData * const model = NULL, unsigned int flags = 0);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
void populateGVCB(QComboBox & b, int value, const ModelData & model);
QString getAdjustmentString(int16_t val, const ModelData * model = NULL, bool sign = false);
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current);
void getFileComboBoxValue(QComboBox * b, char * dest, int length);
} // namespace Helpers
// TODO : move to Helpers namespace
QString image2qstring(QImage image);
int findmult(float value, float base);
@@ -157,38 +155,18 @@ QString getFrSkySrc(int index);
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx);
template <class T>
QVector<T> findWidgets(QObject * object, const QString & name)
{
QVector<T> result;
QRegExp rx(name.arg("([0-9]+)"));
QList<T> children = object->findChildren<T>();
foreach(T child, children) {
int pos = rx.indexIn(child->objectName());
if (pos >= 0) {
QStringList list = rx.capturedTexts();
int index = list[1].toInt();
if (result.size() <= index) {
result.resize(index+1);
}
result[index] = child;
}
}
return result;
}
// Format a pixmap to fit on the current firmware
QPixmap makePixMap(const QImage & image);
int version2index(const QString & version);
QString index2version(int index);
const QString index2version(int index);
class QTimeS : public QTime
{
public:
QTimeS(int s) { int h = s/3600; s %= 3600; int m = s/60; s %=60; setHMS(h, m, s); };
QTimeS(const QTime & q) : QTime(q) {};
int seconds() const { return hour()*3600 + minute()*60 + second(); };
QTimeS(int s) { int h = s/3600; s %= 3600; int m = s/60; s %=60; setHMS(h, m, s); }
QTimeS(const QTime & q) : QTime(q) {}
int seconds() const { return hour()*3600 + minute()*60 + second(); }
};
bool qunlink(const QString & fileName);
@@ -205,7 +183,7 @@ bool caseInsensitiveLessThan(const QString &s1, const QString &s2);
class GpsCoord
{
public:
GpsCoord(): latitude(0), longitude(0) {};
GpsCoord(): latitude(0), longitude(0) {}
double latitude; // Precede South latitudes and West longitudes with a minus sign. Latitudes range from -90 to 90.
double longitude; // Longitudes range from -180 to 180.
};
@@ -213,7 +191,7 @@ public:
class GpsGlitchFilter
{
public:
GpsGlitchFilter() : lastValid(false), glitchCount(0) {};
GpsGlitchFilter() : lastValid(false), glitchCount(0) {}
bool isGlitch(GpsCoord coord);
private:
@@ -226,7 +204,7 @@ private:
class GpsLatLonFilter
{
public:
GpsLatLonFilter() {};
GpsLatLonFilter() {}
bool isValid(GpsCoord coord);
private:
@@ -249,13 +227,13 @@ public:
void resizeColumnsToContents();
void setColumnWidth(int col, int width);
void pushRowsUp(int row);
void pushRowsUp(int row);
private:
#if defined(TABLE_LAYOUT)
QTableWidget * tableWidget;
QTableWidget * tableWidget;
#else
QGridLayout * gridWidget;
QGridLayout * gridWidget;
#endif
};
@@ -267,7 +245,7 @@ public:
name(name), total(0) {
timer.start();
};
~Stopwatch() {};
~Stopwatch() {}
void restart() {
total = 0;
+1 -1
View File
@@ -1 +1 @@
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON1 ICON DISCARDABLE "icon.ico"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

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