Compare commits

..

237 Commits

Author SHA1 Message Date
Arne Schwabe eefbf6cc21 Copy strings for multimode support from en.h.txt to other languages 2016-03-27 22:46:53 +02:00
Arne Schwabe 0c0d0ded91 Add FY326 protocol 2016-03-27 22:45:24 +02:00
Arne Schwabe cbaae312c9 Implement DSM2/DSMX frame format options 2016-03-27 22:45:21 +02:00
Arne Schwabe b7a4f6632f Implement autobind and low power setting and specifying a custom protocol for the multi module
Specifying a custom prtocol is useful if OpenTX firmware is older than the multi module firmware
and the protocol in question is not yet in the protocol list of the OpenTX firmware.
2016-03-27 22:31:56 +02:00
Arne Schwabe 49c25df507 Multi module support for Taranis
Reuse some of the DSM2 routines to avoid code duplication.

This first version only implements the protocol on the Taranis. (and not

Telemetry code is currently untested and will not work (Polarity mismatch). The main protocols to use telemetry are FrSky protocols and not a high priority on the Taranis.

Patch v3: Fix myeeprom.h, include option value in menu.
Patch v4: Fix identing, name substructs of modeldata
2016-03-27 22:20:41 +02:00
Bertrand Songis 82b82f34fe Update DONATIONS.txt 2016-01-04 22:52:22 +01:00
Damjan Adamic d40a6e52f0 Small fix for nightly-21/release-firmware.sh (ported from next branch) 2016-01-04 22:39:13 +01:00
Bertrand Songis 5d753527f7 Merge pull request #3201 from opentx/projectkk2glider/new_build_scripts
Projectkk2glider/new build scripts
2016-01-04 22:22:59 +01:00
mhotar 21594aa84c CZ translation-minor update 2016-01-04 19:36:04 +01:00
Damjan Adamic 6243b19a8c More changes 2016-01-04 19:09:34 +01:00
Damjan Adamic 7bef0eedbb Revision fetched after the repository update.
Removed unused files.
Unification of nightly and release scripts
Code cosmetics
2016-01-04 19:02:02 +01:00
Bertrand Songis c7874d3d79 Update DONATIONS.txt 2016-01-04 06:38:44 +01:00
Bertrand Songis 6cdec34a3c Update DONATIONS.txt 2016-01-03 22:00:44 +01:00
Bertrand Songis 64aa1f7d9e Release notes updated 2016-01-03 21:57:45 +01:00
Bertrand Songis 74055055af Update DONATIONS.txt 2016-01-03 21:46:18 +01:00
Bertrand Songis 043f35f1d6 Fixes #3103 2016-01-03 21:37:43 +01:00
Damjan Adamic a277d456d9 Release notes updated 2016-01-03 19:38:14 +01:00
Bertrand Songis 60b714ace3 Fixes #3177 2016-01-03 19:31:47 +01:00
Damjan Adamic 083867ea7b Release notes updated 2016-01-03 18:59:29 +01:00
Bertrand Songis e366389c01 Fixes #2917 2016-01-03 18:15:41 +01:00
Damjan Adamic 8fc733a3c6 Version moved to 2.1.7 2016-01-03 17:46:21 +01:00
Damjan Adamic b41031d64d Release notes updated 2016-01-03 17:45:59 +01:00
Damjan Adamic 285731aaf3 Jenkins scripts latest state from the server 2016-01-03 16:57:38 +01:00
Bertrand Songis cfdd572c8f Update DONATIONS.txt 2016-01-03 16:28:57 +01:00
Bertrand Songis d8583906e1 Merge pull request #3186 from opentx/projectkk2glider/issue_3130_rpm_problem_fedora
Fixes #3130: remove /lib paths from RPM
2016-01-03 15:19:43 +01:00
Bertrand Songis 2eba031009 Update DONATIONS.txt 2016-01-03 09:00:38 +01:00
Bertrand Songis 30a3e6db92 Merge pull request #3175 from opentx/projectkk2glider/issue_2974_calibration_gui
Fixes #2974: Hardware/Calibration tab split int two tabs:
2016-01-02 23:17:02 +01:00
Bertrand Songis bb87e907c2 Update DONATIONS.txt 2016-01-02 22:36:22 +01:00
Bertrand Songis 3cffa328d1 Update DONATIONS.txt 2016-01-02 21:37:59 +01:00
Bertrand Songis e9c4735049 Update DONATIONS.txt 2015-12-31 08:40:51 +01:00
Bertrand Songis ed85532e34 Update DONATIONS.txt 2015-12-30 21:29:05 +01:00
Damjan Adamic ad20b96364 Fixes #3130: remove /lib paths from RPM 2015-12-30 20:00:34 +01:00
Damjan Adamic b8cf1ff9a8 Fixed: OpenTX Bootloader bin2lbm conversion error (last partial chunk was missing) 2015-12-28 21:43:50 +01:00
Bertrand Songis 7a91db3d05 Update DONATIONS.txt 2015-12-27 20:57:48 +01:00
Bertrand Songis 7f9299f9e7 Merge pull request #3174 from opentx/dsbeach/issue3141-fx-key-to-reload-scripts
Dsbeach/issue3141 fx key to reload scripts
2015-12-27 10:32:23 +01:00
Damjan Adamic 4c113b6518 Fixes #3040: Application Setting 'Enable automatic backup before writing firmware' was not saved 2015-12-26 20:58:08 +01:00
Damjan Adamic 12e15650e8 Fixes #3146: fixed Fahrenheit temperature conversion error (if PREC was not 0) 2015-12-26 19:39:55 +01:00
Damjan Adamic 1bbe578c71 Fixes #2974: Hardware/Calibration tab split int two tabs: Calibration (using table widget, all calibration values shown) and Hardware 2015-12-26 19:20:13 +01:00
dsbeach f6463b64b3 Fixes #3141 - Fx key to reload scripts
Added PF7 - reload Lua scripts
2015-12-26 11:34:16 -05:00
dsbeach f6808c9adf Fixes #3141 - Fx key to reload scripts
Added PF7 - reload Lua scripts
2015-12-26 11:33:50 -05:00
Damjan Adamic 6017fa7892 Fixes #3121: Companion telemetry sensors Ratio and Offset value increment/decrement ignores precision 2015-12-26 15:05:44 +01:00
projectkk2glider 1494b3db98 Re #3156: VC++ compilation fix 2015-12-26 14:36:42 +01:00
Damjan Adamic a9b3b40352 Fixes #3156: Outputs Subtrim, Min and Max values rounding problem fixed 2015-12-26 13:09:05 +01:00
Damjan Adamic 10d29e93b5 Fixes #3117: Telemetry sensor Ratio parameter rounding problem fixed 2015-12-26 12:38:40 +01:00
Bertrand Songis e2c7f16703 [Taranis] It was impossible to select the [Range Check] button on LR12 in EU mode 2015-12-25 11:43:16 +01:00
Bertrand Songis f6e4a47428 Update DONATIONS.txt 2015-12-22 06:35:05 +01:00
Bertrand Songis c0b2b18654 Update DONATIONS.txt 2015-12-21 06:33:51 +01:00
Damjan Adamic 2e324f7815 Changed line endings to Unix style 2015-12-19 19:35:16 +01:00
Damjan Adamic 414779f35c Re #3160: fixed Windows compilation, help/warnings shown in a message box (they were not visible on Windows) 2015-12-19 19:18:51 +01:00
Bertrand Songis 6364c71ed9 Merge pull request #3163 from opentx/projectkk2glider/issue_3160_simulator_commandline
Projectkk2glider/issue 3160 simulator commandline
2015-12-18 22:25:33 +01:00
Damjan Adamic 93e7619144 Re #3160: better help 2015-12-18 20:39:45 +01:00
Damjan Adamic 0bfcd8450e Fixes #3160: command line options support added to standalone simulator (radio type and eeprom file) 2015-12-18 20:33:49 +01:00
Bertrand Songis d4c0271826 Fixes #3150 2015-12-16 07:13:01 +01:00
Bertrand Songis 583943c207 Update DONATIONS.txt 2015-12-16 07:02:56 +01:00
Bertrand Songis 5e4a585a01 Merge pull request #3148 from opentx/dsbeach/issue3147-telem-sim-aspd-as-knots
Changes to send ASpd as knots
2015-12-14 22:27:40 +01:00
Bertrand Songis 73a82afff1 Merge pull request #3152 from opentx/driver33/pl_tr
PL Translation fixes
2015-12-14 22:25:58 +01:00
driver33 b929000beb PL Translation fixes 2015-12-14 22:05:14 +01:00
Damjan Adamic 1286b7e19c Re #3127 and #2921: getFlightMode() can now return specified flight mode data 2015-12-14 20:39:21 +01:00
Bertrand Songis df909159df Update DONATIONS.txt 2015-12-14 18:32:18 +01:00
David S. Beach 50aa3f7a2f Changes to send ASpd as knots 2015-12-14 11:39:52 -05:00
Andre Bernet a3e7154467 Ignore list updated 2015-12-14 10:17:24 +04:00
Bertrand Songis 05c6d8e9c1 VC++ link error 2015-12-14 07:14:10 +01:00
Bertrand Songis 5e4cd75469 Merge pull request #2946 from flacjacket/python2-3
Python 2/3 compatibility (and PEP 8)
2015-12-13 21:11:25 +01:00
Bertrand Songis 4c6063abb6 Merge pull request #2970 from opentx/bsongis/sport_powerbox
[S.PORT] Powerbox fields added
2015-12-13 21:10:00 +01:00
Bertrand Songis 44f961f2f4 Horus bitmaps removed 2015-12-13 21:08:01 +01:00
Bertrand Songis 2449a0dedb [Powerbox] 0xOB20 field added. Radio translations 2015-12-13 21:04:59 +01:00
Bertrand Songis 857efbc7c5 [Powerbox sensor] First tests done. It remains the 0x0B20 to add 2015-12-13 21:04:59 +01:00
Bertrand Songis 0a0eb942f1 [S.PORT] Powerbox fields added 2015-12-13 21:04:58 +01:00
Damjan Adamic 304b55b8bf Fixes #3061: some wizard lines were not visible anymore (warn users in changelog to copy new wizard to their SD cards) 2015-12-13 20:50:08 +01:00
Damjan Adamic 57e3d1afa5 Fixes #3043: unit for Air speed sensor set to knots 2015-12-13 20:38:04 +01:00
Damjan Adamic 6b8675f486 Inputs were not exported as Lua fields 2015-12-13 19:24:41 +01:00
Bertrand Songis a8c794f4cf Merge pull request #3139 from mikeller/invert_serial_rx
Invert serial rx
2015-12-13 18:46:55 +01:00
Bertrand Songis 98bb86ef5b Merge pull request #3143 from opentx/dsbeach/issue2919-telemetry-sensors-simulator
Dsbeach/issue2919 telemetry sensors simulator
2015-12-13 18:43:48 +01:00
David S. Beach c38173d55e Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-13 11:41:20 -05:00
David S. Beach 8d4bfe48a8 Minor issues discovered during port to next 2015-12-13 11:40:40 -05:00
mikeller 4418b6d334 Changed inversion to a separate option. 2015-12-13 21:19:51 +13:00
Bertrand Songis 3b1ecb21c1 Merge pull request #3124 from opentx/dsbeach/issue2919-telemetry-sensors-simulator
Dsbeach/issue2919 telemetry sensors simulator
2015-12-12 20:56:56 +01:00
Bertrand Songis c581535ceb Again 16 channels for Crossfire.
I hope they won't change their mind again
2015-12-12 20:55:53 +01:00
David S. Beach 18f5c7476a Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-12 10:57:06 -05:00
Bertrand Songis 89339c3d81 Crossfire support added to Companion 2015-12-12 14:45:00 +01:00
Bertrand Songis a2e0ce8304 Ignore list updated 2015-12-12 13:53:13 +01:00
Bertrand Songis 86bc97dc4c Crossfire protocol now accepts 12 channels instead of 16 2015-12-12 13:51:17 +01:00
Bertrand Songis 7592b3d78a Ignore list updated 2015-12-12 13:48:27 +01:00
mikeller 00a44257be Merge branch 'invert_serial_rx' of https://github.com/mikeller/opentx into invert_serial_rx 2015-12-12 23:33:09 +13:00
Michael Keller 12d9c20e0e Reverted Makefile changes, some fixes to FrSky D (inverted) handling. 2015-12-12 23:20:59 +13:00
mikeller bee2d56ac3 Added support for FrSky D with inverted signal for 9XR pro. 2015-12-12 23:20:59 +13:00
Michael Keller 68b0a63952 Reverted Makefile changes, some fixes to FrSky D (inverted) handling. 2015-12-11 12:11:16 +13:00
Bertrand Songis 702562e324 Crossfire has 16 channels (fixed) 2015-12-10 21:01:11 +01:00
Bertrand Songis 7a49d30c7c Crossfire has 16 channels (fixed) 2015-12-10 20:41:22 +01:00
David S. Beach ece3a34faa Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-10 09:31:49 -05:00
mikeller 01a51ade7c Added support for FrSky D with inverted signal for 9XR pro. 2015-12-11 02:39:13 +13:00
mikeller 3610b87912 Reverted changes intended for branch. 2015-12-11 01:08:54 +13:00
Bertrand Songis 9085529a20 Update DONATIONS.txt 2015-12-09 22:11:23 +01:00
Andre Bernet ee4bc74c62 Support language-specific chars in notes 2015-12-09 12:00:00 +04:00
mikeller 50b4453461 Changed Makefile to 9XR pro config. 2015-12-09 18:14:51 +13:00
David S. Beach dc89fd2b91 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-08 15:17:24 -05:00
dsbeach e56d8c931c Modified dialog layout for linux (forced 8pt fonts)
Added log file timestamp to replay log status info

Fixed crash when logfile format changed mid-day
2015-12-08 15:16:48 -05:00
Andre Bernet 2a10dcc4b5 AR9X firmware flashing fallback was wrong 2015-12-08 11:25:18 +04:00
Sean Vig a28bf112e8 Use with open(...) as ...: context managers
Instead of manually opening and closes file objects, use the context
manager that will properly handle opening and closing files for us, even
in the event of some error
2015-12-07 08:51:09 -06:00
Sean Vig c310a43e1c PEP8 and break up radio/util/tts.py
Break up tts.py so that each language configuration of system and custom
sounds is done in a separate file, also fixing PEP8 problems with
tts.py, mostly whitespace related
2015-12-07 08:51:09 -06:00
Sean Vig d1be972872 PEP8 radio/util/translate.py
Remove unused imports, fix whitespace, fix undefined variable
2015-12-07 08:51:09 -06:00
Sean Vig 03dda8f77e PEP8 radio/util/taranisicons.py
Remove unused imports, fix whitespace, fix indentation
2015-12-07 08:51:09 -06:00
Sean Vig 4e065d0849 PEP8 radio/util/sportparse.py
Remove unused import, fix whitespace, indentation, and comments
2015-12-07 08:51:09 -06:00
Sean Vig 7e57ed4c89 PEP8 radio/util/sinus.py
Fix whitespace
2015-12-07 08:51:09 -06:00
Sean Vig d254b8d3f6 PEP8 radio/util/parse.py
Fix whitespace and indentation
2015-12-07 08:51:09 -06:00
Sean Vig 6868a6a91a PEP8 radio/util/luaexport.py
Fix indentation
2015-12-07 08:51:08 -06:00
Sean Vig 77d6049ea7 PEP8 radio/util/include-guard.py
Split imports, fix whitespace
2015-12-07 08:51:08 -06:00
Sean Vig 6bd93619c3 PEP8 radio/util/img2lbm.py
Fix whitespace
2015-12-07 08:51:08 -06:00
Sean Vig 8a493e4cfb PEP8 radio/util/font2png.py
Fix whitespace and indentations, remove semicolons
2015-12-07 08:51:08 -06:00
Sean Vig f957fa8a62 PEP8 radio/util/fat12.py
Fix indentation and whitespace
2015-12-07 08:51:08 -06:00
Sean Vig dac95f34ad PEP8 radio/util/dsm2.py
Fix indentation and whitespace
2015-12-07 08:51:08 -06:00
Sean Vig efbf0c7016 PEP8 radio/util/copyright.py
Remove unused imports, fix whitespace, fix comments
2015-12-07 08:51:08 -06:00
Sean Vig 0fdcfa5536 PEP8 radio/util/codecs.py
Fix white space
2015-12-07 08:51:08 -06:00
Sean Vig 1a1160f4d2 PEP8 radio/util/capitalize.py
Split imports, fix indentation
2015-12-07 08:51:08 -06:00
Sean Vig c70cdc53ed PEP8 radio/util/bin2lbm.py
Fix indentation
2015-12-07 08:51:08 -06:00
Sean Vig b83786d1ac PEP8 radio/util/addtr.py
Split imports, fix indentation
2015-12-07 08:51:08 -06:00
Sean Vig ec10caaca4 PEP8 radio/util/add-issue-links.py
Remove unused imports, fix indentation
2015-12-07 08:51:07 -06:00
Sean Vig d4ff720bad Remove radio/utils/compile.py
See https://github.com/opentx/opentx/pull/2946#issuecomment-145599720
2015-12-07 08:51:07 -06:00
Sean Vig ee6cd81069 Update Makefile to allow Python 3
We no longer must enforce Python 2, so let Python 3 be run if that is
the system Python
2015-12-07 08:51:04 -06:00
Sean Vig fdfe7a1737 Use Python 2/3 compatible scripts
Almost entirely fixing print statements, but also a couple importing
changes, wrapped in try/excepts, and one case where dict.keys() not
being a list would be a problem.

Also reverts e41139a397

The real fix for #1907
2015-12-07 08:50:27 -06:00
Bertrand Songis e40f936ba1 Merge pull request #3131 from opentx/projectkk2glider/issue_3096_table_layout_optonal
Projectkk2glider/issue 3096 table layout optonal
2015-12-06 22:26:02 +01:00
Bertrand Songis c1e5139e9c Merge pull request #3127 from opentx/projectkk2glider/issue_2921_lua_flight_mode
Fixes #2921: Lua getFlightMode() function added
2015-12-06 22:21:41 +01:00
Damjan Adamic 6de2575539 More layout changes (1366 ms with table layout) 2015-12-06 20:44:03 +01:00
Damjan Adamic c7093a8a7d Resize policy back (586 ms with grid layout, 1347 ms with table layout) 2015-12-06 20:44:02 +01:00
Damjan Adamic eb34c5989e timing code (796 ms with grid layout, 1394 ms with table layout) 2015-12-06 20:44:02 +01:00
Bertrand Songis 4ae719488d Update DONATIONS.txt 2015-12-06 19:52:50 +01:00
Damjan Adamic fc82ffd1d7 TableWidget only used if -D TABLE_LAYOUT=yes compile option is defined 2015-12-06 19:41:11 +01:00
David S. Beach 99cbff143d Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-06 12:56:12 -05:00
dsbeach 0ee86e0c41 Added ratio option for RxBt and finally came up with a reasonable Qt dialog for both Windows and Linux (I hope!). 2015-12-06 12:55:43 -05:00
Damjan Adamic 606c9534fc Jenkins build scripts for nightly-22 removed from master (they are in next branch) 2015-12-06 11:33:08 +01:00
Damjan Adamic 206e30f7fd Typo in Lua docs 2015-12-06 09:28:19 +01:00
Damjan Adamic f00442a1f8 Release notes updated 2015-12-06 09:24:54 +01:00
David S. Beach 4d07ac54d0 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-05 17:11:25 -05:00
David S. Beach 0b0b8939a3 Addressed some compiler warnings
Added replay log mappings for Ax(V) column headers

Adjusted dialog layout for KDE (still requires 8pt font)
2015-12-05 17:10:59 -05:00
Damjan Adamic 42a62b27d0 Fixes #2921: Lua getFlightMode() function added 2015-12-05 17:29:41 +01:00
Damjan Adamic b1bd638d5d Support simultaneous generation of lua_xports_taranis.inc and lua_exports_taranis_x9e.inc 2015-12-05 17:09:22 +01:00
Damjan Adamic 28b466c5a4 Build script changes ported from nightly-21 to release-21. Lua documentation updated to the new lua_fields files. 2015-12-05 11:15:30 +01:00
Damjan Adamic 1c3d9321df Windows lua exports compilation fix 2015-12-05 10:44:23 +01:00
David S. Beach a09357e866 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-04 15:15:57 -05:00
dsbeach 2a70eafb02 Added support for A1 and A2 ratio
Fixed issue with attempting to scroll before log file was loaded

Fixed issue with stop button showing depressed during play
2015-12-04 15:15:05 -05:00
Bertrand Songis 39a220f2f5 Merge pull request #3125 from opentx/projectkk2glider/makefile_fixes_for_lua_exports
Fixes to make files for lua exports
2015-12-04 08:29:45 +01:00
Damjan Adamic 567e1602fc Fixes to make files for lua exports 2015-12-03 23:29:44 +01:00
Damjan Adamic 2174c0b6bc Cleanup 2015-12-03 21:13:21 +01:00
Damjan Adamic aa4e136b1e Lua exports fix for release-21 2015-12-03 21:13:21 +01:00
Damjan Adamic 72652e4220 Fixes #2247: Initial state of Jenkins build scripts 2015-12-03 21:13:21 +01:00
dsbeach 35ccff88e2 Renamed dialog fields to match 2.1 default telemetry field names.
Added support for all likely metric and imperial log formats.

Feature complete (hopefully) - time for serious testing.
2015-12-03 14:32:33 -05:00
David S. Beach f70c09e656 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-12-02 14:29:56 -05:00
dsbeach e7cd70c2f4 All input widgets updated as appropriate
Added labels for input units
2015-12-02 14:29:23 -05:00
Damjan Adamic 3c4324adc5 Compilation fix 2015-11-30 19:38:29 +01:00
Damjan Adamic 13ddbf3ae9 Lua documentation update 2015-11-30 18:42:18 +01:00
Damjan Adamic 5d7cc79db8 Lua exports fixes:
* X9E fields were missing
 * inputs were missing
 * renamed X9E center sliders, which name collided with logical switches
2015-11-30 18:41:31 +01:00
David S. Beach 1e14fbf498 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-11-29 12:14:56 -05:00
David S. Beach a17416b67a Converted A1 - A4 to spinboxes with log replay support. 2015-11-29 12:14:23 -05:00
Bertrand Songis 638f48e58a Update DONATIONS.txt 2015-11-29 11:23:40 +01:00
Bertrand Songis 08a88f00b9 Update DONATIONS.txt 2015-11-28 22:47:17 +01:00
Bertrand Songis ce3d5dbac5 [Taranis] LR12 is now EU compatible 2015-11-28 21:28:53 +01:00
David S. Beach 26bf88c65b Fixed compiler error 'extra qualification' 2015-11-28 13:58:13 -05:00
David S. Beach 23672a391d Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-11-28 13:20:25 -05:00
David S. Beach fb5f36c5f8 Fixed compiler warning
Refactored log file column mapping to (hopefully) support localization
2015-11-28 13:19:52 -05:00
Bertrand Songis f04385d718 VC++ compilation fix 2015-11-28 13:19:50 -05:00
Bertrand Songis 332785a65d VC++ compilation fix 2015-11-28 13:19:49 -05:00
Bertrand Songis 12f25a6854 VC++ compilation fix 2015-11-28 11:22:09 +01:00
Bertrand Songis 35dafd96be VC++ compilation fix 2015-11-28 09:52:32 +01:00
David S. Beach 7b4676f6ac Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-11-27 16:26:12 -05:00
David S. Beach c79a695eeb Add play() functionality to log playback. 2015-11-27 16:25:24 -05:00
Bertrand Songis 584eea47d5 Merge pull request #3114 from opentx/bsongis/issue2894_crossfire_output_on_sport_pin
#2894 - Crossfire (inverted serial) sent on S.PORT pin in the module bay
2015-11-27 21:39:01 +01:00
Bertrand Songis 7e2a50e990 Update DONATIONS.txt 2015-11-27 17:31:21 +01:00
Damjan Adamic b5db38bacb Re #3087: menuHandlerFunc renamed 2015-11-26 20:58:17 +01:00
Bertrand Songis 89a9eb44a6 Merge pull request #3106 from flaviommedeiros/master
Avoid conditional directives that split up parts of statements.
2015-11-26 18:37:09 +01:00
dsbeach 33765dd033 Initial implementation of log file processing. 2015-11-26 12:23:24 -05:00
David S. Beach 6ba194581d Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-11-26 12:20:38 -05:00
Andre Bernet b9aca7b4c4 Swedish TTS fixes by HakanBastedt 2015-11-26 13:06:47 +04:00
Flavio Medeiros b37c0522c3 Adding a whitespace to better follow the project's guidelines. 2015-11-25 19:06:34 -03:00
Flavio Medeiros 1e7edd072a Removing unnecessary new lines as suggested by @bsongis. 2015-11-25 17:55:09 -03:00
Flavio Medeiros 8c45305b47 More conditional directives that split up parts of statements. 2015-11-25 16:53:48 -03:00
Flavio Medeiros 9f80411fa7 Avoid conditional directives that break statements. 2015-11-25 16:16:09 -03:00
Bertrand Songis 21ed4236fa Update Makefile
The windows server waits for this exact string!
2015-11-25 19:41:57 +01:00
Damjan Adamic d0736b75ce Re #3087: macro used for setting popupMenuFlags 2015-11-25 18:38:11 +01:00
Bertrand Songis d0197ce0bc Merge pull request #3097 from opentx/projectkk2glider/lua_additions
Projectkk2glider/lua additions
2015-11-24 22:25:09 +01:00
Bertrand Songis d464420a1a Merge pull request #3087 from opentx/projectkk2glider/issue_2469_lua_keys
Fixes #2469: Allow usage of PLUS, MINUS, MENU and ENT keys in telemet…
2015-11-24 22:24:05 +01:00
dsbeach 1a172ce103 Changed default telemetry ID to zero
Changed logic for gps telemetry items
2015-11-24 16:10:59 -05:00
David S. Beach c924cc9713 Merge remote-tracking branch 'upstream/master' into dsbeach/issue2919-telemetry-sensors-simulator 2015-11-24 12:43:03 -05:00
David S. Beach 8f3c264c4e telemetry simulator enhancements 2015-11-24 11:42:10 -05:00
Damjan Adamic 4d0bd14ad0 Git commit ID added to stamp 2015-11-24 17:20:10 +01:00
Damjan Adamic 69594ba38b Fixes #2921: getValue() now also returns pilot position 2015-11-23 22:47:18 +01:00
Damjan Adamic 779749aafe Re #3095: added lstrlib.c missing file to Companion 2015-11-23 22:40:08 +01:00
Damjan Adamic 25ef680bf1 Fixes #3062: Close any Lua open files when radio powers off 2015-11-23 21:20:12 +01:00
Damjan Adamic 1659d8ba78 Fixes #3095: Lua string library added (only 6k bytes of flash used) 2015-11-23 21:20:12 +01:00
Damjan Adamic 7ef790d3ef Re #3095: luaGetVersion() also returns version as numbers 2015-11-23 21:20:12 +01:00
David S. Beach 92c02daae0 Modified simulator dialog to query loaded model for used telemetry sensor ids.
NOTE: All sensor id will get default value of 32 if the telemetry sensor dialog is shown before model is fully initialized in the simulator.
2015-11-23 14:39:15 -05:00
Damjan Adamic 94d8b8b0e8 s_warning_info_len renamed 2015-11-23 19:13:42 +01:00
Damjan Adamic 763192d26c s_warning_info_flags renamed 2015-11-23 19:12:24 +01:00
Damjan Adamic a28bc4c70f and renamed to popupMenuFlags 2015-11-23 18:44:34 +01:00
Damjan Adamic f4c13097c1 s_menu_flags back on nonARM platforms 2015-11-23 18:37:17 +01:00
Bertrand Songis 731faa82ad Merge pull request #3091 from opentx/projectkk2glider/issue_2861_header_always_visible
Use new TableLayout for Logical switches, Outputs and Special functions
2015-11-22 21:55:40 +01:00
Damjan Adamic 0236307d8a A FAT12 dump script that got left behing in some old master branch (was used in #1793) 2015-11-22 16:35:48 +01:00
Damjan Adamic b0d3ae2605 Re #3026: add Clear to the flight mode (context menu on the Name label) 2015-11-22 12:37:19 +01:00
Damjan Adamic 446788ae9c Re #2861: Outputs converted to TableLayout 2015-11-22 10:49:37 +01:00
Damjan Adamic 20d36cdfb0 s_noHi renamed 2015-11-21 19:21:17 +01:00
Damjan Adamic 9ae4222a28 s_pgOfs renamed 2015-11-21 19:21:17 +01:00
Damjan Adamic ce90ee2702 Re #3087: code refactoring to allow Lua telemetry scripts to use keys MENU, UP, DOWN, ENT(short) and EXIT(short) 2015-11-21 12:39:46 +01:00
Damjan Adamic b375ba5ac1 Warning menu renaming 2015-11-21 12:39:46 +01:00
Damjan Adamic cf0d489fc4 Main menu renaming 2015-11-21 12:39:46 +01:00
Damjan Adamic 9796eab94d BSS removed on Taranis 2015-11-21 12:39:46 +01:00
Damjan Adamic c3c1d0eb69 Popup menu renaming and refactoring 2015-11-21 12:39:46 +01:00
Damjan Adamic 289d54a3bd Re #2469: EXIT also filtered from the main menu code when in Lua telemetry screen, EXIT LONG added as an exit from the telemetry screen 2015-11-21 12:39:46 +01:00
Damjan Adamic 3186a5d99e Fixes #2469: Allow usage of PLUS, MINUS, MENU and ENT keys in telemetry scripts 2015-11-21 12:39:45 +01:00
Damjan Adamic 682fa5dcf1 Lua documentation update 2015-11-20 20:44:01 +01:00
Bertrand Songis f337655e8d Update DONATIONS.txt 2015-11-20 18:56:33 +01:00
Damjan Adamic b5164a723d Merge pull request #3025 from dsbeach/issue3024
Issue #3024 - Companion 2.1 (windows) - Lua 'execute' fails in non-root directory
2015-11-19 17:55:25 +01:00
Damjan Adamic 6d9f8db165 Merge pull request #3079 from opentx/dsbeach/simu-compile-lua
Modifications to luaCompileAndSave() now <name>.lua.src is the Lua source and compiled code is saved in <name>.lua
2015-11-19 17:47:14 +01:00
Damjan Adamic 70b82622bd Re #3053: clean translations/*.h (original author griebd) 2015-11-19 15:42:54 +01:00
Damjan Adamic 40e9c3714e Merge pull request #3036 from opentx/MicheleVilla/FW_Italian_translation
Update it.h.txt
2015-11-19 15:35:18 +01:00
Bertrand Songis 3c89f7930a Update DONATIONS.txt 2015-11-19 07:11:01 +01:00
Bertrand Songis 03c035ac1b Update DONATIONS.txt 2015-11-17 20:07:41 +01:00
Bertrand Songis ee6deca13a Merge pull request #3077 from indavis/master
Update flasheepromdialog.ui
2015-11-17 07:11:04 +01:00
Damjan Adamic 904c90803c Lua documentation update 2015-11-16 22:45:48 +01:00
indavis 29f7d670f0 Update flasheepromdialog.ui
Put in the markup to make it wrap and look like the other tooltips.
2015-11-16 14:46:29 -06:00
Damjan Adamic 51d0b667f2 Lua documentation update 2015-11-16 19:52:31 +01:00
David S. Beach 27fad56b03 Merge branch 'issue3024' into dsbeach/working 2015-11-16 13:16:58 -05:00
David S. Beach e1e3f26031 Merge branch 'issue2469-Lua-killEvents-not-working' into dsbeach/working 2015-11-16 11:28:07 -05:00
David S. Beach a34f98667f Merge branch 'simu-compile-lua' into dsbeach/working 2015-11-16 11:27:23 -05:00
dsbeach 7790e87619 Modifications to luaCompileAndSave() - as scripts are loaded it will check for existing file <file>.lua.src and compile it to <file>.lua if found. 2015-11-16 11:24:42 -05:00
Damjan Adamic 89f1bf5db7 Better makefile recipe for lua_exports.inc target 2015-11-16 10:21:14 +01:00
Damjan Adamic 10fe9df322 Fixed lua_exports.inc target 2015-11-16 07:19:14 +01:00
indavis 9d27e1d78d Update flasheepromdialog.ui
Corrected the tool tip for the backupBeforeWrite checkbox. It incorrectly had the text from Check Firmware Compatibility.
2015-11-15 23:15:20 -06:00
dsbeach 806bd1da53 Added logic in perMain() to suppress killed events. Fixes #2469 2015-11-10 10:07:17 -05:00
Michele 9e5f400627 Update it.h.txt 2015-11-08 08:29:44 +01:00
Bertrand Songis f7044a20ec #2894 - Crossfire (inverted serial) sent on S.PORT pin in the module bay
16 channels sent every 2.5ms now @ 200KBauds with CRC
2015-11-06 19:32:29 +01:00
David S. Beach a14e8a524f fixes #3024 - one line affected and a few parenthsis for clarity 2015-11-05 09:47:01 -05:00
David S. Beach 40e5657387 Fixes #3024 2015-11-03 08:16:46 -05:00
Damjan Adamic 80af8fe001 Re #2861: Logical switches converted to TableLayout 2015-10-26 21:38:06 +01:00
Damjan Adamic 2b2d6ed9db Re #2861: layout code moved to new class TableLayout 2015-10-26 21:35:41 +01:00
Damjan Adamic d882dc1071 Re #2861: table widget background transparent 2015-10-26 19:15:32 +01:00
Damjan Adamic 4ea4e38ccb Re #2861: reduced padding around controls, removed padding around table widget 2015-10-26 19:04:13 +01:00
Bertrand Songis d5e2cac813 Columns resized (some dynamically, some statically) 2015-10-25 21:48:52 +01:00
Damjan Adamic 4b91f5937d Re #2861: using QTableWidget in order to have the header line always visible 2015-10-25 09:56:49 +01:00
1202 changed files with 56799 additions and 144593 deletions
+1 -5
View File
@@ -1,4 +1,3 @@
/.idea/
/.*project
/.settings
/.autotools
@@ -7,7 +6,4 @@ radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.stamp
radio/src/lua/lua_fields_*.txt
radio/src/lua/lua_exports_*.txt
build*/
*.inc
+8 -21
View File
@@ -1,27 +1,14 @@
sudo: required
dist: trusty
language: python
virtualenv:
system_site_packages: true
python:
- 3.4
language: cpp
before_install:
- sudo add-apt-repository ppa:ubuntu-sdk-team/ppa --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
- sudo apt-get update -qq
- sudo apt-get remove cmake cmake-data --yes
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo apt-get update
install:
- sudo apt-get --yes --force-yes install qtbase5-dev qtmultimedia5-dev qttools5-dev qttools5-dev-tools python3-pyqt5 curl gcc-arm-none-eabi libfox-1.6-dev libgtest-dev
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/gcc-avr_1%253a4.8-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpfr4_3.1.2-1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/avr-libc_1%253a1.8.0-4.1_all.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/binutils-avr_2.23.1-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpc3_1.0.1-1ubuntu1_amd64.deb
- sudo dpkg --install gcc-avr_1%3a4.8-2.1_amd64.deb avr-libc_1%3a1.8.0-4.1_all.deb libmpfr4_3.1.2-1_amd64.deb binutils-avr_2.23.1-2.1_amd64.deb libmpc3_1.0.1-1ubuntu1_amd64.deb
- sudo apt-get install -y lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
script:
- ./tools/commit-tests.sh .
- radio/util/commit-tests.sh
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
-57
View File
@@ -1,57 +0,0 @@
project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "2")
set(VERSION_REVISION "0")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
message(STATUS "OpenTX ${VERSION}")
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0023 OLD)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
endif()
set(CMAKE_CXX_STANDARD 11)
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND)
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
else()
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif()
message(STATUS "Looking for FOX ")
find_package(Fox)
if ((NOT FOX_FOUND) AND (NOT WIN32))
message("Libfox not found, simu target will not be available")
endif()
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
add_subdirectory(${RADIO_SRC_DIRECTORY})
if(Qt5Widgets_FOUND)
add_subdirectory(${COMPANION_SRC_DIRECTORY})
endif()
-1
View File
@@ -17,4 +17,3 @@ Karl Szmutny
Michal Hlavinka
Pat Mackenzie
Michael Byrne
Christophe Brision (Ingwie)
+38 -3
View File
@@ -48,11 +48,9 @@ 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)
@@ -148,7 +146,6 @@ Mike Matheny
Martin Sniedze
Fernando Rimoldi
Sidney Fisher
Bruce Anderson
John Rodgers
Ed Pare
Thomas Kilduff
@@ -850,3 +847,41 @@ Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
John Curran
Gerald Thiel
Jürg Bingisser
George Emer
Jerzy Manarczyk
Gerard Braakhuis
Nicolas Leblond
Burt Pickard-Richardson
Jiri Petrzelka
RK Custom Homes
David Semeria
Philip Lewis
William Kim
Dean Berg
Tim Spurr
Clifton Hipsher
Mike Frizell
Oliver Jacob
Pawel Stepien
Thomas Kilduff
Barry Fox
Anatoly Bakalenko
Bruce Anderson
Jeremy Cowgar
Edward Hauser
Stuart Brown
Anton Glock
Roger Ritchie
George Carnie
Philippe Stofleth
Tim Dzugan
Illia Izotov
Richard Miles (monthly)
Attila Kapolnai
Gilles Dando
Denis Roussille
Olivier Anken
Michel Motte
+4 -4
View File
@@ -1,9 +1,9 @@
##OpenTX 2.2 Branch
##OpenTX 2.1 Branch
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=next)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://opentx.rocket.chat](https://camo.githubusercontent.com/3d659054abd6ce21c0e47cf3b83a51bda69ca282/68747470733a2f2f64656d6f2e726f636b65742e636861742f696d616765732f6a6f696e2d636861742e737667)](https://opentx.rocket.chat)
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=master)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://gitter.im/opentx/opentx](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Donate using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
The ongoing development on 2.2.x is done in this branch.
The ongoing development on 2.1.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.
-24
View File
@@ -1,24 +0,0 @@
macro(add_bitmaps_target targetname filter width format)
set(bitmaps_files)
file(GLOB bitmaps ${filter})
foreach(bitmap ${bitmaps})
get_filename_component(target ${bitmap} NAME_WE)
set(target ${target}.lbm)
add_custom_command(
OUTPUT ${target}
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
DEPENDS ${bitmap}
)
list(APPEND bitmaps_files ${target})
endforeach()
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
endmacro(add_bitmaps_target)
macro(add_truetype_font_target radio name font size bold)
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
add_custom_target(ttf_${radio}_${name}
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set(ttf_${radio}_fonts_targets ${ttf_${radio}_fonts_targets} ttf_${radio}_${name})
endmacro(add_truetype_font_target)
-63
View File
@@ -1,63 +0,0 @@
# Imported from the DeskVox project (LPGL 2.1)
include(FindPackageHandleStandardArgs)
set(hints
$ENV{LIB_BASE_PATH}/fox
)
set(paths
/usr
/usr/local
)
find_path(FOX_INCLUDE_DIR
NAMES
fx.h
HINTS
${hints}
PATHS
${paths}
PATH_SUFFIXES
include
include/fox
include/fox-1.6
)
find_library(FOX_LIBRARY
NAMES
FOX-1.6
fox-1.6
HINTS
${hints}
PATHS
${paths}
PATH_SUFFIXES
lib64
lib
)
find_library(FOX_LIBRARY_DEBUG
NAMES
FOXD-1.6
foxd-1.6
HINTS
${hints}
PATHS
${paths}
PATH_SUFFIXES
lib64
lib
)
if(FOX_LIBRARY_DEBUG)
set(FOX_LIBRARIES optimized ${FOX_LIBRARY} debug ${FOX_LIBRARY_DEBUG})
else()
set(FOX_LIBRARIES ${FOX_LIBRARY})
endif()
find_package_handle_standard_args(FOX
DEFAULT_MSG
FOX_INCLUDE_DIR
FOX_LIBRARY
)
-39
View File
@@ -1,39 +0,0 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "date not implemented")
set(${RESULT} 00.00.0000)
endif(WIN32)
endmacro(today)
macro(now RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "time not implemented")
set(${RESULT} 00:00:00)
endif(WIN32)
endmacro(now)
macro(git_id RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "Git ID implemented")
set(${RESULT} 0)
endif(WIN32)
endmacro(git_id)
+24 -1
View File
@@ -1,5 +1,28 @@
<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>
+295 -223
View File
@@ -1,74 +1,139 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(COMPANION_NAME "companion")
set(SIMULATOR_NAME "simulator")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
PROJECT( companion )
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
if(ALLOW_NIGHTLY_BUILDS)
add_definitions(-DALLOW_NIGHTLY_BUILDS)
endif(ALLOW_NIGHTLY_BUILDS)
SET(C9X_VERSION_MAJOR "2")
SET(C9X_VERSION_MINOR "1")
SET(C9X_VERSION_REVISION "7")
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
option(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
if(DEBUG_IMPORT)
add_definitions(-DDEBUG_MODEL_IMPORT)
message(STATUS "EEPROM import debugging enabled")
endif(DEBUG_IMPORT)
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
MESSAGE(STATUS "OpenTX Companion ${C9X_VERSION}")
option(TABLE_LAYOUT "Use QTableWidget for grid layouts") # Disabled by default
if(TABLE_LAYOUT)
add_definitions(-DTABLE_LAYOUT)
message(STATUS "Using QTableWidget")
endif(TABLE_LAYOUT)
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
add_definitions(-DSIMU_AUDIO)
add_definitions(-DJOYSTICKS)
endif()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
message(STATUS "Looking for QT lupdate ")
find_package(Lupdate)
if(LUPDATE_FOUND)
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
else()
message("QT lupdate not found!")
endif()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(C9X_NAME_SUFFIX ${C9X_VERSION_MAJOR}${C9X_VERSION_MINOR})
SET(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
SET(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
SET( SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX} )
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(COMPANION_NAME "companion")
SET(SIMULATOR_NAME "simulator")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-DQXT_STATIC)
OPTION(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
IF(ALLOW_NIGHTLY_BUILDS)
ADD_DEFINITIONS(-DALLOW_NIGHTLY_BUILDS)
ENDIF(ALLOW_NIGHTLY_BUILDS)
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /LD")
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
link_directories(C:/Programs/pthreads/Pre-built.2/lib/)
set(PTHREAD_LIBRARY pthreadVC2.lib)
else()
set(PTHREAD_LIBRARY pthread)
add_definitions(-Wall)
link_directories(/usr/local/lib)
endif()
OPTION(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
IF(DEBUG_IMPORT)
ADD_DEFINITIONS( -DDEBUG_MODEL_IMPORT)
MESSAGE( STATUS "EEPROM import debugging enabled" )
ENDIF(DEBUG_IMPORT)
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
OPTION(TABLE_LAYOUT "Use QTableWidget for grid layouts") # Disabled by default
IF(TABLE_LAYOUT)
ADD_DEFINITIONS( -DTABLE_LAYOUT)
MESSAGE( STATUS "Using QTableWidget" )
ENDIF(TABLE_LAYOUT)
MESSAGE( STATUS "Looking for XercesC " )
FIND_PACKAGE(XercesC)
IF ( XERCESC_FOUND )
INCLUDE_DIRECTORIES( ${XERCESC_INCLUDE_DIR} )
SET(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
ELSE()
MESSAGE( FATAL_ERROR "XercesC not found! Please set XercesC path ..." )
ENDIF()
MESSAGE( STATUS "Looking for Xsd " )
FIND_PACKAGE(Xsd)
IF ( XSD_FOUND )
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
ELSE()
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
ENDIF()
MESSAGE( STATUS "Looking for SDL " )
FIND_PACKAGE(Sdl)
IF ( SDL_FOUND )
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS( -DJOYSTICKS )
ADD_DEFINITIONS( -DSIMU_AUDIO )
ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
ENDIF()
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
MESSAGE( STATUS "Looking for PHONON " )
FIND_PACKAGE(Phonon)
IF ( PHONON_FOUND )
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
ADD_DEFINITIONS( -DPHONON )
ELSE()
MESSAGE( "PHONON not found!" )
ENDIF()
MESSAGE( STATUS "Looking for QT lupdate " )
FIND_PACKAGE(Lupdate)
if( LUPDATE_FOUND )
MESSAGE( "QT lupdate: " ${LUPDATE_EXECUTABLE} )
ELSE()
MESSAGE( "QT lupdate not found!" )
ENDIF()
ADD_DEFINITIONS(-DQXT_STATIC)
ADD_CUSTOM_COMMAND(
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
)
IF( MSVC )
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
set(INTTYPES_INCLUDE_OPTION -IC:/Programs/msinttypes)
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
LINK_DIRECTORIES( C:/Programs/pthreads/Pre-built.2/lib/ )
SET( PTHREAD_LIBRARY pthreadVC2.lib )
ELSE( )
SET( PTHREAD_LIBRARY pthread )
ADD_DEFINITIONS( -Wall )
LINK_DIRECTORIES( /usr/local/lib )
ENDIF( )
IF( MSVC )
MESSAGE( STATUS "Adding include C:/Programs/dirent/include for dirent.h" )
INCLUDE_DIRECTORIES( C:/programs/dirent/include )
ENDIF( )
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${COMPANION_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/shared
${PROJECT_SOURCE_DIR}/../..
${PROJECT_SOURCE_DIR}/shared
${SIMU_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
${XSD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/qxtcommandoptions
)
add_subdirectory(shared)
add_subdirectory(modeledit)
add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(firmwares/opentx/simulator)
add_subdirectory(qcustomplot)
add_subdirectory(qxtcommandoptions)
@@ -89,12 +154,11 @@ set(common_SRCS
firmwares/opentx/opentxinterface.cpp
file.cpp
appdata.cpp
)
)
qt5_wrap_cpp(common_SRCS)
qt4_wrap_cpp(common_SRCS)
add_library(common ${common_SRCS})
qt5_use_modules(common Core Xml Widgets)
set(companion_SRCS
hexinterface.cpp
@@ -135,7 +199,7 @@ set(companion_SRCS
radionotfound.cpp
wizarddata.cpp
wizarddialog.cpp
)
)
set(companion_MOC_HDRS
apppreferencesdialog.h
@@ -167,7 +231,7 @@ set(companion_MOC_HDRS
wizarddialog.h
modelprinter.h
multimodelprinter.h
)
)
set(companion_UIS
mdichild.ui
@@ -187,52 +251,79 @@ set(companion_UIS
flashfirmwaredialog.ui
flasheepromdialog.ui
radionotfound.ui
)
)
set(companion_RESOURCES
set(companion_RCS
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
)
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 00.00.0000)
ENDIF (WIN32)
ENDMACRO (TODAY)
if(WIN32)
set(companion_SRCS ${companion_SRCS} icon.rc)
if(NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif()
endif()
MACRO (NOW RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "time not implemented")
SET(${RESULT} 00:00:00)
ENDIF (WIN32)
ENDMACRO (NOW)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})
TODAY(DATE)
NOW(TIME)
set(LANGUAGES he pl pt ru de fr es it sv cs fi nl)
foreach(language ${LANGUAGES})
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
endforeach(language)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
qt5_wrap_ui(companion_SRCS ${companion_UIS})
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
qt5_add_translation(companion_QM ${companion_TS})
qt5_add_resources(companion_RCC ${companion_RESOURCES})
add_custom_target(gen_qrc DEPENDS ${companion_RCC})
IF( WIN32 )
SET( companion_SRCS ${companion_SRCS} icon.rc )
IF ( NOT MSVC )
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
ENDIF( )
ENDIF( )
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
if(APPLE)
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
else()
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
endif()
SET( LANGUAGES he pl pt ru de fr es it sv cs fi nl)
FOREACH( language ${LANGUAGES} )
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
ENDFOREACH( language )
add_dependencies(${COMPANION_NAME} gen_qrc)
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
set( companion_SRCS ${companion_SRCS} )
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE( ${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
# OS X compiler no longer automatically includes /Library/Frameworks in search path
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
ELSE( )
ADD_EXECUTABLE( ${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ENDIF( )
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
############# Standalone simu ###############
@@ -240,180 +331,161 @@ set(simu_SRCS
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
)
)
set(simu_MOC_HDRS
modeledit/node.h
)
)
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
set( simu_SRCS ${simu_SRCS} )
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
if(WIN32)
set(simu_SRCS ${simu_SRCS} icon.rc)
endif()
if(APPLE)
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
else()
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
endif()
add_dependencies(${SIMULATOR_NAME} gen_qrc)
# TODO not the same link command than companion?
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
target_link_libraries(${SIMULATOR_NAME} simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
############# Packaging ####################
message(STATUS ${CMAKE_BINARY_DIR} ${CMAKE_INSTALL_PREFIX}/bin)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${CMAKE_BINARY_DIR}/ DESTINATION ${SIMULATOR_LIB_PATH} USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "libopentx-*.so"
PATTERN "CMakeFiles" EXCLUDE
PATTERN "_CPack_Packages" EXCLUDE
PATTERN "companion" EXCLUDE
PATTERN "radio" EXCLUDE
)
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")
install(FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
else()
install(FILES images/linuxicons/16x16/companion.png DESTINATION share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
endif()
# 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)
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
endif()
if(WIN32)
if(MSVC)
set(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
else()
set(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
endif()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg )
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
# Linux specific code
SET(OperatingSystem "Linux")
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR} )
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
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)
IF( WIN32 )
IF( MSVC )
SET(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
SET(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
ELSE( )
SET(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
SET(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
ENDIF( )
find_program(NSIS_EXE makensis.exe PATHS
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/simulator.nsi @ONLY)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/companion.nsi
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/companion.nsi
COMMENT "Companion Windows NSIS Installer")
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion-windows.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/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}/simulator-install.exe
COMMAND "${NSIS_EXE}" ARGS simulator.nsi
DEPENDS simulator opentx-simulators ${PROJECT_BINARY_DIR}/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
SOURCES ${PROJECT_BINARY_DIR}/companion/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
)
endif()
ADD_CUSTOM_TARGET( installer
DEPENDS ${PROJECT_BINARY_DIR}/companion-windows.exe
DEPENDS ${PROJECT_BINARY_DIR}/simulator-windows.exe
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/simulator.nsi
)
ENDIF( )
if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(WORK_DIR ${CMAKE_BINARY_DIR}/Debug)
else()
set(WORK_DIR ${PROJECT_BINARY_DIR})
endif()
IF( APPLE )
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
IF( CMAKE_GENERATOR STREQUAL Xcode )
SET( WORK_DIR ${CMAKE_BINARY_DIR}/Debug )
ELSE( )
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
ENDIF()
add_custom_target(addframeworks
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${COMPANION_NAME})
ADD_CUSTOM_TARGET( addframeworks
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync -r ${XSD_INCLUDE_DIR}/.. companion.app/Contents/Frameworks/
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${COMPANION_NAME} )
add_custom_target(makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks opentx-simulators-bundle)
endif()
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks opentx-simulators-bundle)
ENDIF( )
if(LUPDATE_FOUND)
add_custom_target(translations
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
IF( LUPDATE_FOUND )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
add_custom_target(translations
)
ELSE()
ADD_CUSTOM_TARGET( translations
COMMAND echo "Sorry, QT lupdate was not found."
)
endif()
)
ENDIF()
set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
SET(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
# The file stripping is deliberately disabled, with the stripped file we get
# The file stripping is deliberately disabled, with the stripped file we get
# very poor trace-backs from the users when they report Companion crash
set(CPACK_STRIP_FILES FALSE)
SET( CPACK_STRIP_FILES FALSE )
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
set(CPACK_GENERATOR "DEB")
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
set(CPACK_DEBIAN_PACKAGE_VERSION ${VERSION})
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
SET(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
else(DPKG_PROGRAM)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
endif(DPKG_PROGRAM)
include(CPack)
INCLUDE(CPack)
+2 -36
View File
@@ -312,8 +312,6 @@ QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
QString Profile::controlTypes() const { return _controlTypes; }
QString Profile::controlNames() const { return _controlNames; }
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
@@ -344,8 +342,6 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
@@ -382,8 +378,6 @@ Profile& Profile::operator=(const Profile& rhs)
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
controlTypes ( rhs.controlTypes() );
controlNames ( rhs.controlNames() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
@@ -429,8 +423,6 @@ void Profile::initFwVariables()
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_controlTypes = "";
_controlNames = "";
_txCurrentCalibration = 0;
_gsStickMode = 0;
@@ -491,8 +483,6 @@ void Profile::flush()
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
@@ -605,10 +595,6 @@ void AppData::warningId (const int x) { store(x, _warningId,
// Constructor
AppData::AppData()
{
}
void AppData::init()
{
//Initialize the profiles
for (int i=0; i<MAX_PROFILES; i++)
@@ -618,28 +604,8 @@ void AppData::init()
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
// Copy existing 2.0.16 settings if present
QSettings settings(COMPANY, PRODUCT);
// Copy existing 2.1 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings21("OpenTX", "Companion 2.1");
QStringList keys = settings21.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings21.value(*i) != QString("") && settings21.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings21.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Copy existing 2.0 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings20("OpenTX", "Companion 2.0");
@@ -740,7 +706,7 @@ void AppData::init()
// Load and store all variables. Use default values if setting values are missing
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"220" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _tempString, "settings_version" ,"210" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
+1 -8
View File
@@ -25,7 +25,7 @@
#include <QSettings>
#define COMPANY "OpenTX"
#define PRODUCT "Companion 2.2"
#define PRODUCT "Companion 2.1"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
@@ -125,8 +125,6 @@ class Profile: protected CompStoreObj
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
QString _controlTypes;
QString _controlNames;
int _txCurrentCalibration;
int _gsStickMode;
int _ppmMultiplier;
@@ -158,8 +156,6 @@ class Profile: protected CompStoreObj
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
QString controlTypes() const;
QString controlNames() const;
int txCurrentCalibration() const;
int gsStickMode() const;
int ppmMultiplier() const;
@@ -190,8 +186,6 @@ class Profile: protected CompStoreObj
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void controlTypes (const QString);
void controlNames (const QString);
void txCurrentCalibration (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
@@ -384,7 +378,6 @@ class AppData: protected CompStoreObj
// Constructor
AppData();
void init();
};
extern AppData g;
+3 -3
View File
@@ -21,7 +21,7 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
getSettings();
populateProgrammers();
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_STM32(eepromInterface->getBoard())) {
if (IS_TARANIS(eepromInterface->getBoard())) {
setWindowTitle(tr("DFU-UTIL Configuration"));
ui->avrArgs->hide();
ui->avrdude_location->hide();
@@ -310,7 +310,7 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
{
EEPROMInterface *eepromInterface = GetEepromInterface();
if (checked) {
if (IS_STM32(eepromInterface->getBoard())) {
if (IS_TARANIS(eepromInterface->getBoard())) {
ui->label_dfu2->show();
ui->dfuArgs->show();
}
@@ -327,7 +327,7 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
}
}
else {
if (IS_STM32(eepromInterface->getBoard())) {
if (IS_TARANIS(eepromInterface->getBoard())) {
ui->label_dfu2->hide();
ui->dfuArgs->hide();
}
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef BURNCONFIGDIALOG_H_
#define BURNCONFIGDIALOG_H_
#include <QtWidgets>
#include <QDialog>
#include <QtGui>
#define MEM_TYPE_EEPROM 1
#define MEM_TYPE_FLASH 2
@@ -4,25 +4,25 @@
# SDL_FOUND, if false, do not try to link to SDL
# SDL_INCLUDE_DIR, where to find SDL.h
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
@@ -46,14 +46,14 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/opt/csw/include
/opt/csw/include
/opt/include/SDL
/opt/include
C:/Programs/SDL/include
)
# I'm not sure if I should do a special casing for Apple. It is
# I'm not sure if I should do a special casing for Apple. It is
# unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?),
# But if they do ([Next|Open|GNU]Step?),
# do they want the -framework option also?
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
@@ -83,7 +83,7 @@ IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
FIND_LIBRARY(SDL_LIBRARY_TEMP
FIND_LIBRARY(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -93,13 +93,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib/x86
C:/Programs/SDL/lib
)
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -109,12 +109,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib
)
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
@@ -135,14 +136,14 @@ IF(SDL_LIBRARY_TEMP)
ENDIF(SDLMAIN_LIBRARY)
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# with the CACHE STRING. Maybe somebody else knows how to fix this.
# The problem is mainly cosmetic, and not a functional issue.
IF(APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if Find the threads package
# and try using this line, so I'm just skipping it entirely for OS X.
@@ -150,10 +151,15 @@ IF(SDL_LIBRARY_TEMP)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
+6 -6
View File
@@ -82,18 +82,15 @@ class MyProxyStyle : public QProxyStyle
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(companion);
QApplication app(argc, argv);
app.setApplicationName("OpenTX Companion");
app.setOrganizationName("OpenTX");
app.setOrganizationDomain("open-tx.org");
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
g.init();
QStringList strl = QApplication::arguments();
if (strl.contains("--version")) {
printf("%s\n", VERSION);
printf("%s\n", C9X_VERSION);
fflush(stdout);
exit(0);
}
@@ -109,7 +106,7 @@ int main(int argc, char *argv[])
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
@@ -134,7 +131,10 @@ int main(int argc, char *argv[])
}
QString splashScreen;
splashScreen = ":/images/splash.png";
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splash-taranis.png";
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splash-9xrpro.png";
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splash-9xr.png";
else splashScreen = ":/images/splash-9x.png";
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
+1 -1
View File
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Companion @VERSION@
Name=Companion @C9X_VERSION@
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=@COMPANION_NAME@
+50 -62
View File
@@ -1,76 +1,64 @@
<!DOCTYPE RCC><RCC version="1.0">
<RCC>
<qresource prefix="/">
<file>images/customize.png</file>
<file>icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../releasenotes.txt</file>
<file>images/simulator/Horus/middle.png</file>
<file>images/simulator/Horus/left.png</file>
<file>images/simulator/Horus/right.png</file>
<file>images/simulator/Horus/top.png</file>
<file>images/simulator/Horus/bottom.png</file>
<file>images/simulator/Horus/led.png</file>
<file>images/simulator/Horus/border-right.png</file>
<file>images/simulator/Horus/left_btn1.png</file>
<file>images/simulator/Horus/left_btn2.png</file>
<file>images/simulator/Horus/left_scrnsht.png</file>
<file>images/simulator/Horus/right_btnU.png</file>
<file>images/simulator/Horus/right_btnL.png</file>
<file>images/simulator/Horus/right_btnD.png</file>
<file>images/simulator/Horus/right_btnR.png</file>
<file>images/simulator/Horus/right_ent.png</file>
<file>images/simulator/9X/9xdb.png</file>
<file>images/simulator/9X/9xdl.png</file>
<file>images/simulator/9X/9xdr.png</file>
<file>images/simulator/9X/9xdt.png</file>
<file>images/simulator/9X/9xdb-bl.png</file>
<file>images/simulator/9X/9xdl-bl.png</file>
<file>images/simulator/9X/9xdr-bl.png</file>
<file>images/simulator/9X/9xdt-bl.png</file>
<file>images/simulator/9X/9xdb-gr.png</file>
<file>images/simulator/9X/9xdl-gr.png</file>
<file>images/simulator/9X/9xdr-gr.png</file>
<file>images/simulator/9X/9xdt-gr.png</file>
<file>images/simulator/9X/9xdb-or.png</file>
<file>images/simulator/9X/9xdl-or.png</file>
<file>images/simulator/9X/9xdr-or.png</file>
<file>images/simulator/9X/9xdt-or.png</file>
<file>images/simulator/9X/9xdb-yl.png</file>
<file>images/simulator/9X/9xdl-yl.png</file>
<file>images/simulator/9X/9xdr-yl.png</file>
<file>images/simulator/9X/9xdt-yl.png</file>
<file>images/simulator/9X/9xdb-rd.png</file>
<file>images/simulator/9X/9xdl-rd.png</file>
<file>images/simulator/9X/9xdr-rd.png</file>
<file>images/simulator/9X/9xdt-rd.png</file>
<file>images/simulator/9X/9xmenu.png</file>
<file>images/simulator/9X/9xmenumenu.png</file>
<file>images/simulator/9X/9xmenuexit.png</file>
<file>images/simulator/9X/9xcurs.png</file>
<file>images/simulator/9X/9xcursup.png</file>
<file>images/simulator/9X/9xcursplus.png</file>
<file>images/simulator/9X/9xcursmin.png</file>
<file>images/simulator/9X/9xcursdown.png</file>
<file>images/simulator/9X/9xcursphoto.png</file>
<file>images/9xdb.png</file>
<file>images/9xdl.png</file>
<file>images/9xdr.png</file>
<file>images/9xdt.png</file>
<file>images/9xdb-bl.png</file>
<file>images/9xdl-bl.png</file>
<file>images/9xdr-bl.png</file>
<file>images/9xdt-bl.png</file>
<file>images/9xdb-gr.png</file>
<file>images/9xdl-gr.png</file>
<file>images/9xdr-gr.png</file>
<file>images/9xdt-gr.png</file>
<file>images/9xdb-or.png</file>
<file>images/9xdl-or.png</file>
<file>images/9xdr-or.png</file>
<file>images/9xdt-or.png</file>
<file>images/9xdb-yl.png</file>
<file>images/9xdl-yl.png</file>
<file>images/9xdr-yl.png</file>
<file>images/9xdt-yl.png</file>
<file>images/9xdb-rd.png</file>
<file>images/9xdl-rd.png</file>
<file>images/9xdr-rd.png</file>
<file>images/9xdt-rd.png</file>
<file>images/9xmenu.png</file>
<file>images/9xmenumenu.png</file>
<file>images/9xmenuexit.png</file>
<file>images/9xcurs.png</file>
<file>images/9xcursup.png</file>
<file>images/9xcursplus.png</file>
<file>images/9xcursmin.png</file>
<file>images/9xcursdown.png</file>
<file>images/9xcursphoto.png</file>
<file>images/screenshot.png</file>
<file>images/splash.png</file>
<file>images/splash-9x.png</file>
<file>images/splash-9xrpro.png</file>
<file>images/splash-9xr.png</file>
<file>images/splash-taranis.png</file>
<file>images/companion-title.png</file>
<file>images/maps.png</file>
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/simulator/Taranis/x9b0.png</file>
<file>images/simulator/Taranis/x9l0.png</file>
<file>images/simulator/Taranis/x9l1.png</file>
<file>images/simulator/Taranis/x9l2.png</file>
<file>images/simulator/Taranis/x9l3.png</file>
<file>images/simulator/Taranis/x9l4.png</file>
<file>images/simulator/Taranis/x9r0.png</file>
<file>images/simulator/Taranis/x9r1.png</file>
<file>images/simulator/Taranis/x9r2.png</file>
<file>images/simulator/Taranis/x9r3.png</file>
<file>images/simulator/Taranis/x9s0.png</file>
<file>images/simulator/Taranis/x9t0.png</file>
<file>images/x9b0.png</file>
<file>images/x9l0.png</file>
<file>images/x9l1.png</file>
<file>images/x9l2.png</file>
<file>images/x9l3.png</file>
<file>images/x9l4.png</file>
<file>images/x9r0.png</file>
<file>images/x9r1.png</file>
<file>images/x9r2.png</file>
<file>images/x9r3.png</file>
<file>images/x9s0.png</file>
<file>images/x9t0.png</file>
<file>images/taranison.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef _COMPAREDIALOG_H
#define _COMPAREDIALOG_H
#include <QtWidgets>
#include <QDialog>
#include <QLabel>
#include "multimodelprinter.h"
namespace Ui {
+2 -4
View File
@@ -11,9 +11,7 @@ enum BoardEnum {
BOARD_AR9X,
BOARD_TARANIS,
BOARD_TARANIS_PLUS,
BOARD_TARANIS_X9E,
BOARD_FLAMENCO,
BOARD_HORUS
BOARD_TARANIS_X9E
};
#define C9X_MAX_MODELS 60
@@ -27,7 +25,7 @@ enum BoardEnum {
#define C9X_MAX_GVARS 9
#define C9X_MAX_ENCODERS 2
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 64 // number of custom switches
#define C9X_NUM_CSW 32 // number of custom switches
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
#define C9X_NUM_MODULES 2
#define NUM_STICKS 4
+1 -1
View File
@@ -3,7 +3,7 @@
#include "helpers.h"
ContributorsDialog::ContributorsDialog(QWidget * parent):
QDialog(parent),
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::HtmlDialog)
{
ui->setupUi(this);
+1 -1
View File
@@ -27,7 +27,7 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(ALL_OK)
if (!errors.test(NO_ERROR)
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
return false;
}
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef CUSTOMIZESPLASHDIALOG_H
#define CUSTOMIZESPLASHDIALOG_H
#include <QtWidgets>
#include <QtGui>
#include <QDialog>
#include "firmwareinterface.h"
namespace Ui
+2
View File
@@ -1,5 +1,7 @@
#include "downloaddialog.h"
#include "ui_downloaddialog.h"
#include <QMessageBox>
#include <QtGui>
#include <QTime>
#include "helpers.h"
+2 -1
View File
@@ -1,12 +1,13 @@
#ifndef DOWNLOADDIALOG_H
#define DOWNLOADDIALOG_H
#include <QtWidgets>
#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QFile>
namespace Ui {
class downloadDialog;
}
+30 -84
View File
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <list>
#include <float.h>
#include <QtWidgets>
#include "eeprominterface.h"
#include "firmwares/er9x/er9xinterface.h"
#include "firmwares/th9x/th9xinterface.h"
@@ -476,6 +475,13 @@ QString RawSource::toString(const ModelData * model) const
QObject::tr("ACC"), QObject::tr("GPS Time"),
};
static const QString logicalSwitches[] = {
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
QObject::tr("L31"), QObject::tr("L32")
};
if (index<0) {
return QObject::tr("----");
}
@@ -502,7 +508,7 @@ QString RawSource::toString(const ModelData * model) const
case SOURCE_TYPE_SWITCH:
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index));
case SOURCE_TYPE_CUSTOM_SWITCH:
return QObject::tr("L%1").arg(index+1);
return logicalSwitches[index];
case SOURCE_TYPE_CYC:
return QObject::tr("CYC%1").arg(index+1);
case SOURCE_TYPE_PPM:
@@ -584,6 +590,13 @@ QString RawSwitch::toString() const
SwitchUp('R'), QString::fromUtf8("SR-"), SwitchDn('R'),
};
static const QString logicalSwitches[] = {
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
QObject::tr("L31"), QObject::tr("L32")
};
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")
};
@@ -621,7 +634,7 @@ QString RawSwitch::toString() const
else
return CHECK_IN_ARRAY(switches9X, index-1);
case SWITCH_TYPE_VIRTUAL:
return QObject::tr("L%1").arg(index);
return CHECK_IN_ARRAY(logicalSwitches, index-1);
case SWITCH_TYPE_MULTIPOS_POT:
return CHECK_IN_ARRAY(multiposPots, index-1);
case SWITCH_TYPE_TRIM:
@@ -1170,9 +1183,9 @@ GeneralSettings::GeneralSettings()
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
if (ok)
imperial=byte8u;
QString chars = t_CountrySet.mid(4, 2);
ttsLanguage[0] = chars[0].toLatin1();
ttsLanguage[1] = chars[1].toLatin1();
QString chars=t_CountrySet.mid(4,2);
ttsLanguage[0]=chars[0].toAscii();
ttsLanguage[1]=chars[1].toAscii();
}
}
}
@@ -1380,9 +1393,9 @@ void ModelData::clear()
moduleData[0].channelsCount = 8;
moduleData[1].channelsStart = 0;
moduleData[1].channelsCount = 8;
moduleData[0].ppm.delay = 300;
moduleData[1].ppm.delay = 300;
moduleData[2].ppm.delay = 300;
moduleData[0].ppmDelay = 300;
moduleData[1].ppmDelay = 300;
moduleData[2].ppmDelay = 300;
int board = GetEepromInterface()->getBoard();
if (IS_TARANIS(board)) {
moduleData[0].protocol = PULSES_PXX_XJT_X16;
@@ -1397,7 +1410,7 @@ void ModelData::clear()
moduleData[1].protocol = PULSES_OFF;
}
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear(i);
flightModeData[i].clear();
}
clearInputs();
clearMixes();
@@ -1510,7 +1523,9 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
}
else {
phaseIdx = phase.trimRef[trimIdx];
if (phase.trimMode[trimIdx] != 0)
if (phase.trimMode[trimIdx] == 0)
result = 0;
else
result += phase.trim[trimIdx];
}
}
@@ -1523,7 +1538,7 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
}
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
{
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
@@ -1684,7 +1699,7 @@ unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
if (result.test(ALL_OK)) {
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
@@ -1704,7 +1719,7 @@ unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
if (result.test(ALL_OK)) {
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
@@ -1725,7 +1740,7 @@ unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
if (result.test(ALL_OK)) {
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
@@ -1765,33 +1780,6 @@ QString getBoardName(BoardEnum board)
}
}
const int Firmware::getFlashSize()
{
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:
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
case BOARD_FLAMENCO:
return FSIZE_TARANIS;
case BOARD_HORUS:
return FSIZE_HORUS;
default:
return 0;
}
}
Firmware * GetFirmware(QString id)
{
foreach(Firmware * firmware, firmwares) {
@@ -1855,45 +1843,3 @@ SimulatorInterface *GetCurrentFirmwareSimulator()
else
return NULL;
}
unsigned int getNumSubtypes(MultiModuleRFProtocols type) {
switch (type) {
case MM_RF_PROTO_HISKY:
case MM_RF_PROTO_DSM2:
case MM_RF_PROTO_SYMAX:
case MM_RF_PROTO_KN:
return 2;
case MM_RF_PROTO_FRSKY:
case MM_RF_PROTO_CG023:
case MM_RF_PROTO_MT99XX:
return 3;
case MM_RF_PROTO_FLYSKY:
case MM_RF_PROTO_MJXQ:
return 4;
case MM_RF_PROTO_YD717:
return 5;
case MM_RF_PROTO_CX10:
case MM_RF_PROTO_CUSTOM:
return 8;
default:
return 1;
}
}
void FlightModeData::clear(const int phase)
{
memset(this, 0, sizeof(FlightModeData));
if (phase != 0) {
for (int idx=0; idx<C9X_MAX_GVARS; idx++) {
gvars[idx] = 1025;
}
for (int idx=0; idx<C9X_MAX_ENCODERS; idx++) {
rotaryEncoders[idx] = 1025;
}
}
}
+32 -86
View File
@@ -21,12 +21,11 @@
#include <QString>
#include <QStringList>
#include <QList>
#include <QtXml> // This should be removed from here, and remove Xml dependency from all libs which don't need it.
#include <QtXml>
#include <QComboBox>
#include <iostream>
#include <bitset>
#include "constants.h"
#include "../../radio/src/definitions.h"
#include "simulatorinterface.h"
#define EESIZE_STOCK 2048
@@ -37,15 +36,6 @@
#define EESIZE_9XRPRO (128*4096)
#define EESIZE_MAX EESIZE_9XRPRO
#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
QString getBoardName(BoardEnum board);
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
@@ -56,10 +46,7 @@ QString getBoardName(BoardEnum board);
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
#define IS_TARANIS_X9E(board) (board==BOARD_TARANIS_X9E)
#define IS_HORUS(board) (board==BOARD_HORUS)
#define IS_FLAMENCO(board) (board==BOARD_FLAMENCO)
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
#define IS_ARM(board) (IS_TARANIS(board) || IS_SKY9X(board))
const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4},
@@ -145,11 +132,7 @@ enum FailsafeModes {
#define TRIM_RV_UP 5
#define TRIM_RH_L 6
#define TRIM_RH_R 7
#define TRIM_T5_DN 8
#define TRIM_T5_UP 9
#define TRIM_T6_DN 10
#define TRIM_T6_UP 11
#define TRIM_NONE 12
#define TRIM_NONE 8
// Beep center bits
#define BC_BIT_RUD (0x01)
@@ -163,6 +146,23 @@ enum FailsafeModes {
#define BC_BIT_REA (0x80)
#define BC_BIT_REB (0x100)
// TODO remove this enum!
enum EnumKeys {
KEY_MENU,
KEY_EXIT,
#if defined(PCBTARANIS)
KEY_ENTER,
KEY_PAGE,
KEY_PLUS,
KEY_MINUS,
#else
KEY_DOWN,
KEY_UP,
KEY_RIGHT,
KEY_LEFT,
#endif
};
#define CHAR_FOR_NAMES " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."
#define CHAR_FOR_NAMES_REGEX "[ A-Za-z0-9_.-,]*"
@@ -632,7 +632,7 @@ class CustomFunctionData { // Function Switches data
class FlightModeData {
public:
FlightModeData() { clear(0); }
FlightModeData() { clear(); }
int trimMode[NUM_STICKS];
int trimRef[NUM_STICKS];
int trim[NUM_STICKS];
@@ -640,9 +640,9 @@ class FlightModeData {
char name[10+1];
unsigned int fadeIn;
unsigned int fadeOut;
int rotaryEncoders[C9X_MAX_ENCODERS];
int rotaryEncoders[2];
int gvars[C9X_MAX_GVARS];
void clear(const int phase);
void clear() { memset(this, 0, sizeof(FlightModeData)); }
};
class SwashRingData { // Swash Ring data
@@ -842,38 +842,9 @@ enum PulsesProtocol {
PULSES_PXX_XJT_LR12,
PULSES_PXX_DJT,
PULSES_CROSSFIRE,
PULSES_MULTIMODULE,
PULSES_PROTOCOL_LAST
};
enum MultiModuleRFProtocols {
MM_RF_PROTO_FLYSKY=0,
MM_RF_PROTO_FIRST=MM_RF_PROTO_FLYSKY,
MM_RF_PROTO_HUBSAN,
MM_RF_PROTO_FRSKY,
MM_RF_PROTO_HISKY,
MM_RF_PROTO_V2X2,
MM_RF_PROTO_DSM2,
MM_RF_PROTO_DEVO,
MM_RF_PROTO_YD717,
MM_RF_PROTO_KN,
MM_RF_PROTO_SYMAX,
MM_RF_PROTO_SLT,
MM_RF_PROTO_CX10,
MM_RF_PROTO_CG023,
MM_RF_PROTO_BAYANG,
MM_RF_PROTO_ESky,
MM_RF_PROTO_MT99XX,
MM_RF_PROTO_MJXQ,
MM_RF_PROTO_SHENQI,
MM_RF_PROTO_FY326,
MM_RF_PROTO_SFHSS,
MM_RF_PROTO_CUSTOM,
MM_RF_PROTO_LAST= MM_RF_PROTO_CUSTOM
};
unsigned int getNumSubtypes(MultiModuleRFProtocols type);
enum TrainerProtocol {
TRAINER_MASTER_JACK,
TRAINER_SLAVE_JACK,
@@ -887,39 +858,17 @@ class ModuleData {
ModuleData() { clear(); }
unsigned int modelId;
int protocol;
unsigned int subType;
bool invertedSerial;
int subprotocol;
unsigned int channelsStart;
int channelsCount; // 0=8 channels
unsigned int failsafeMode;
int failsafeChannels[C9X_NUM_CHNOUT];
// By pure coincidence the struct are unions with the same datatype in Companion
// and the firmware itself. If this changes the multi struct needs it own logic in the eeprom interface
union {
struct {
int delay;
bool pulsePol; // false = positive
bool outputType; // false = open drain, true = push pull
int frameLength;
} ppm;
struct {
int rfProtocol;
bool autoBindMode;
bool lowPowerMode;
int optionValue;
} multi;
};
// Currently the Eeprom read/write code does not work with unions
// define a hack for the multi rf Protocol to get the real numbers here
// (reverse the int => ms logic of the ppm delay)
int getMultiRfProtocol () { return (multi.rfProtocol - 300) / 50; }
void setMultiRfProtocol (int val) { multi.rfProtocol = 300 + 50 * val; }
int ppmDelay;
bool ppmPulsePol; // false = positive
bool ppmOutputType; // false = open drain, true = push pull
int ppmFrameLength;
void clear() { memset(this, 0, sizeof(ModuleData)); }
QString polarityToString() const { return ppm.pulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter
QString polarityToString() const { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter
};
#define C9X_MAX_SCRIPTS 7
@@ -1128,7 +1077,7 @@ class ModelData {
void setTrimValue(int phaseIdx, int trimIdx, int value);
bool isGVarLinked(int phaseIdx, int gvarIdx);
int getGVarFieldValue(int phaseIdx, int gvarIdx);
int getGVarValue(int phaseIdx, int gvarIdx);
ModelData removeGlobalVars();
@@ -1557,7 +1506,8 @@ void registerOpenTxFirmwares();
void unregisterOpenTxFirmwares();
enum EepromLoadErrors {
ALL_OK,
NO_ERROR,
UNKNOWN_ERROR,
UNSUPPORTED_NEWER_VERSION,
WRONG_SIZE,
@@ -1675,13 +1625,9 @@ class Firmware {
virtual int getCapability(const Capability) = 0;
virtual QTime getMaxTimerStart() = 0;
virtual bool isTelemetrySourceAvailable(int source) = 0;
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
const int getFlashSize();
public:
QList<const char *> languages;
+7 -34
View File
@@ -36,6 +36,7 @@ eepromFatHeader(NULL)
#define EEPROM_BLOCK_SIZE (4*1024)
#define EEPROM_MARK 0x84697771 /* thanks ;) */
#define EEPROM_ZONE_SIZE (8*1024)
#define EEPROM_BUFFER_SIZE 256
#define EEPROM_FAT_SIZE 128
#define EEPROM_MAX_ZONES (EEPROM_SIZE / EEPROM_ZONE_SIZE)
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
@@ -125,7 +126,7 @@ bool RleFile::searchFat()
uint32_t bestFatIndex = 0;
for (int i=0; i<EEPROM_ZONE_SIZE/EEPROM_FAT_SIZE; i++) {
EepromHeader * header = (EepromHeader *)(eeprom+i*EEPROM_FAT_SIZE);
if (header->mark == EEPROM_MARK && header->index >= bestFatIndex) {
if (header->mark == EEPROM_MARK && (int)header->index >= bestFatIndex) {
eepromFatHeader = header;
bestFatIndex = header->index;
}
@@ -236,9 +237,6 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
unsigned int RleFile::EeFsGetFree()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = 0;
unsigned int i;
if (IS_ARM(board))
@@ -258,9 +256,6 @@ unsigned int RleFile::EeFsGetFree()
*/
void RleFile::EeFsFree(unsigned int blk)
{
if (IS_HORUS(board))
return;
unsigned int i = blk;
while (EeFsGetLink(i)) i = EeFsGetLink(i);
if (IS_ARM(board)) {
@@ -278,8 +273,6 @@ void RleFile::EeFsFree(unsigned int blk)
*/
unsigned int RleFile::EeFsAlloc()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
if (IS_ARM(board))
@@ -293,18 +286,12 @@ unsigned int RleFile::EeFsAlloc()
unsigned int RleFile::size(unsigned int id)
{
if (IS_HORUS(board))
return 0;
else
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
}
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_HORUS(board)) {
return 1;
}
else if (IS_SKY9X(board)) {
if (IS_SKY9X(board)) {
if (eepromFatHeader) {
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
if (eepromFatHeader->files[i_fileId].exists) {
@@ -338,9 +325,6 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
len -= m_pos;
if (i_len > len) i_len = len;
@@ -361,9 +345,6 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
if (IS_HORUS(board))
return 0;
memset(buf, 0, i_len);
if (IS_SKY9X(board)) {
@@ -436,11 +417,9 @@ unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersi
dst.resize(0);
for( ; 1; ) {
if (zeroes > 0) {
for (int i = 0; i < zeroes; i++)
dst.append((char) 0);
zeroes = 0;
}
for (int i=0; i<zeroes; i++)
dst.append((char)0);
zeroes = 0;
if (len == 0)
return dst.size();
@@ -547,9 +526,6 @@ void RleFile::closeTrunc()
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
create(i_fileId, typ);
bool state0 = true;
uint8_t cnt = 0;
@@ -596,9 +572,6 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
*/
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
if (IS_SKY9X(board)) {
openRd(i_fileId);
if (eepromFatHeader) {
+9 -17
View File
@@ -44,7 +44,7 @@ int getFileType(const QString &fullFileName)
}
FirmwareInterface::FirmwareInterface(const QString &filename):
flash(FSIZE_MAX, 0),
flash(MAX_FSIZE, 0),
flashSize(0),
versionId(0),
eepromVersion(0),
@@ -59,11 +59,11 @@ FirmwareInterface::FirmwareInterface(const QString &filename):
QFile file(filename);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
QTextStream inputStream(&file);
flashSize = HexInterface(inputStream).load((uint8_t *)flash.data(), FSIZE_MAX);
flashSize = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
file.close();
if (flashSize == 0) {
file.open(QIODevice::ReadOnly);
flashSize = file.read((char *)flash.data(), FSIZE_MAX);
flashSize = file.read((char *)flash.data(), MAX_FSIZE);
}
}
}
@@ -130,12 +130,10 @@ QString FirmwareInterface::seekLabel(const QString & label)
QString FirmwareInterface::getFlavour() const
{
if (flavour == "opentx-taranis-x9e")
return "opentx-x9e";
else if (flavour == "opentx-x9dp" || flavour == "opentx-taranis-plus")
return "opentx-x9d+";
else if (flavour == "opentx-taranis")
return "opentx-x9d";
if (flavour == "opentx-x9dp")
return "opentx-taranis-plus";
else if (flavour == "opentx-x9d")
return "opentx-taranis";
else
return flavour;
}
@@ -342,18 +340,14 @@ bool FirmwareInterface::isValid()
unsigned int FirmwareInterface::save(QString fileName)
{
uint8_t *binflash = (uint8_t*)malloc(FSIZE_MAX);
if (binflash == NULL) {
return -1;
}
memcpy(binflash, flash.constData(), flashSize);
uint8_t binflash[MAX_FSIZE];
memcpy(&binflash, flash.constData(), flashSize);
QFile file(fileName);
int fileType = getFileType(fileName);
if (fileType == FILE_TYPE_HEX) {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { //reading HEX TEXT file
free(binflash);
return -1;
}
QTextStream outputStream(&file);
@@ -362,7 +356,6 @@ unsigned int FirmwareInterface::save(QString fileName)
}
else {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { //reading HEX TEXT file
free(binflash);
return -1;
}
file.write((char*)binflash, flashSize);
@@ -370,6 +363,5 @@ unsigned int FirmwareInterface::save(QString fileName)
file.close();
free(binflash);
return flashSize;
}
+1
View File
@@ -19,6 +19,7 @@
#include <QImage>
#include <QByteArray>
#define MAX_FSIZE (512*1024)
#define SPLASH_WIDTH (128)
#define SPLASH_HEIGHT (64)
#define SPLASHX9D_WIDTH (212)
+3 -3
View File
@@ -373,17 +373,17 @@ t_Er9xModelData::operator ModelData ()
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppm.frameLength=ppmFrameLength;
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
@@ -114,7 +114,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -186,7 +186,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -261,7 +261,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
return gd;
}
@@ -271,7 +271,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
return md;
}
@@ -289,7 +289,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tgen, data, sizeof(Er9xGeneral));
break;
@@ -326,7 +326,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tmod, data, sizeof(Er9xModelData));
break;
@@ -19,14 +19,13 @@
#define SIMU
#define SIMU_EXCEPTIONS
#define TELEMETRY_FRSKY
#define FRSKY
#define PHASES
#undef min
#undef max
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#include <exception>
@@ -48,7 +47,7 @@ namespace Er9x {
uint8_t pxxFlag = 0;
int16_t g_anas[7];
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
uint16_t anaIn(uint8_t chan)
{
@@ -152,7 +151,7 @@ void simuSetKey(uint8_t key, bool state)
}
}
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
}
@@ -173,7 +172,8 @@ bool Er9xSimulator::timer10ms()
uint8_t * Er9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
@@ -54,7 +54,7 @@ class Er9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
@@ -505,17 +505,17 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppm.frameLength=ppmFrameLength;
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
@@ -620,17 +620,17 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppm.frameLength=ppmFrameLength;
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.swashRingData.elevatorWeight = swashInvertELE ? -100 : 100;
c9x.swashRingData.aileronWeight = swashInvertAIL ? -100 : 100;
@@ -152,7 +152,7 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -230,7 +230,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -305,7 +305,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
return gd;
}
@@ -315,7 +315,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
return md;
}
@@ -333,7 +333,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
break;
@@ -373,7 +373,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
const char * data = ba.data();
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
break;
@@ -22,7 +22,7 @@
#define PCBSKY9X
#define PCBSKY
#define STAMP
#define TELEMETRY_FRSKY
#define FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define TEMPLATES
@@ -31,9 +31,8 @@
#define AUDIO
#define REVB
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#define NUM_POTS 3
#define SWSRC_SW1 DSW_SW1
#undef min
#undef max
@@ -59,7 +58,7 @@ namespace Ersky9x {
#include "../ersky9x/sound.cpp"
#include "../ersky9x/diskio.cpp"
#define isBacklightEnabled() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
//uint8_t pxxFlag = 0;
int16_t g_anas[7];
@@ -195,7 +194,8 @@ bool Ersky9xSimulator::timer10ms()
uint8_t * Ersky9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
@@ -54,7 +54,7 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
@@ -447,9 +447,9 @@ t_Gruvin9xModelData_v102::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.flightModeData[i] = flightModeData[i];
@@ -517,9 +517,9 @@ t_Gruvin9xModelData_v103::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.flightModeData[i] = flightModeData[i];
@@ -587,9 +587,9 @@ t_Gruvin9xModelData_v105::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
@@ -677,9 +677,9 @@ t_Gruvin9xModelData_v106::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
@@ -207,7 +207,7 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -455,9 +455,9 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -499,7 +499,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -533,9 +533,9 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -578,7 +578,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.frsky.varioSource = varioSource;
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -615,9 +615,9 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -661,7 +661,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -698,9 +698,9 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -744,7 +744,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -785,9 +785,9 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -831,7 +831,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -735,9 +735,9 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
@@ -780,7 +780,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.frsky.varioSource = varioSource;
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -818,9 +818,9 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
@@ -864,7 +864,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -902,9 +902,9 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
@@ -948,7 +948,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -986,9 +986,9 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
@@ -1032,7 +1032,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
@@ -1073,9 +1073,9 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<9; i++) {
@@ -1119,7 +1119,7 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -932,9 +932,9 @@ t_Open9xModelData_v201::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1006,9 +1006,9 @@ t_Open9xModelData_v202::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter,
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1052,7 +1052,7 @@ t_Open9xModelData_v202::operator ModelData ()
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -1082,9 +1082,9 @@ t_Open9xModelData_v203::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1126,7 +1126,7 @@ t_Open9xModelData_v203::operator ModelData ()
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -1156,9 +1156,9 @@ t_Open9xModelData_v204::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1202,7 +1202,7 @@ t_Open9xModelData_v204::operator ModelData ()
c9x.frsky = frsky;
c9x.frsky.rssiAlarms[0] = frskyRssiAlarms[0].get(0);
c9x.frsky.rssiAlarms[1] = frskyRssiAlarms[1].get(1);
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
return c9x;
@@ -1235,9 +1235,9 @@ t_Open9xModelData_v205::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1279,7 +1279,7 @@ t_Open9xModelData_v205::operator ModelData ()
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0]. modelId = modelId;
c9x.frsky.screens[1].type = 0;
@@ -1314,9 +1314,9 @@ t_Open9xModelData_v208::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1362,7 +1362,7 @@ t_Open9xModelData_v208::operator ModelData ()
c9x.frsky.varioCenterMax = varioSpeedUpMin;
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
c9x.frsky.screens[1].type = 0;
@@ -1400,9 +1400,9 @@ t_Open9xModelData_v209::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1449,7 +1449,7 @@ t_Open9xModelData_v209::operator ModelData ()
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
c9x.frsky.screens[1].type = 0;
@@ -1487,9 +1487,9 @@ t_Open9xModelData_v210::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1536,7 +1536,7 @@ t_Open9xModelData_v210::operator ModelData ()
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
@@ -1575,9 +1575,9 @@ t_Open9xModelData_v211::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.disableThrottleWarning=disableThrottleWarning;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.moduleData[0].ppmPulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<5; i++) {
@@ -1624,7 +1624,7 @@ t_Open9xModelData_v211::operator ModelData ()
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppm.frameLength = ppmFrameLength;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.moduleData[0].modelId = modelId;
+125 -224
View File
@@ -22,13 +22,12 @@
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
#define MAX_LOGICAL_SWITCHES(board, version) (IS_ARM(board) ? (version >= 218 ? 64 : 32) : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : 8)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
#define MAX_TELEMETRY_SENSORS(board, version) (32)
#define MAX_SENSORS(board, version) (32)
#define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8)
#define ROTENC_COUNT(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 218) ? 0 : 1) : (IS_2560(board) ? 2 : 0))
#define IS_AFTER_RELEASE_21_MARCH_2013(board, version) (version >= 214 || (!IS_ARM(board) && version >= 213))
#define IS_AFTER_RELEASE_23_MARCH_2013(board, version) (version >= 214 || (board==BOARD_STOCK && version >= 213))
@@ -101,7 +100,7 @@ class SwitchesConversionTable: public ConversionTable {
}
}
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -126,7 +125,7 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -183,7 +182,7 @@ class SwitchesConversionTable: public ConversionTable {
internalCache.push_back(element);
return element.table;
}
static void Cleanup()
static void Cleanup()
{
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
Cache element = *it;
@@ -264,7 +263,7 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
}
}
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++) {
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
}
}
@@ -297,7 +296,7 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
}
}
else {
else {
if (afterrelease21March2013) {
if ((board != BOARD_STOCK && (board!=BOARD_M128 || version<215)) || (variant & GVARS_VARIANT)) {
for (int i=0; i<MAX_GVARS(board, version); i++) {
@@ -306,25 +305,25 @@ class SourcesConversionTable: public ConversionTable {
}
}
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
if (version < 216) {
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPEED || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
if (IS_ARM(board)) {
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 0), val++); // BATT
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 1), val++); // TIME
val += 5;
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 2), val++); // Timer1
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 3), val++); // Timer2
}
else {
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
if (version < 216) {
if (i == TELEMETRY_SOURCE_TX_TIME || i == TELEMETRY_SOURCE_SWR || i == TELEMETRY_SOURCE_A3 ||
i == TELEMETRY_SOURCE_A4 || i == TELEMETRY_SOURCE_ASPEED || i == TELEMETRY_SOURCE_DTE ||
i == TELEMETRY_SOURCE_CELL_MIN || i == TELEMETRY_SOURCE_CELLS_MIN || i == TELEMETRY_SOURCE_VFAS_MIN)
continue;
}
if (i == TELEMETRY_SOURCE_TX_TIME || i == TELEMETRY_SOURCE_SWR || i == TELEMETRY_SOURCE_A3 ||
i == TELEMETRY_SOURCE_A4 || i == TELEMETRY_SOURCE_A3_MIN || i == TELEMETRY_SOURCE_A4_MIN)
continue;
}
if (!IS_ARM(board)) {
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_A3_MIN || i==TELEMETRY_SOURCE_A4_MIN)
continue;
}
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
if (version >= 216 && IS_ARM(board)) {
if (i==TELEMETRY_SOURCE_RSSI_RX)
val += 1;
if (i==TELEMETRY_SOURCE_TX_TIME)
val += 5;
if (i==TELEMETRY_SOURCE_DTE)
val += 5;
if (i==TELEMETRY_SOURCE_POWER_MAX)
val += 5;
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
}
}
}
@@ -370,7 +369,7 @@ class SourcesConversionTable: public ConversionTable {
internalCache.push_back(element);
return element.table;
}
static void Cleanup()
static void Cleanup()
{
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
Cache element = *it;
@@ -384,7 +383,7 @@ std::list<SourcesConversionTable::Cache> SourcesConversionTable::internalCache;
void OpenTxEepromCleanup(void)
{
SourcesConversionTable::Cleanup();
SourcesConversionTable::Cleanup();
SwitchesConversionTable::Cleanup();
}
@@ -392,8 +391,8 @@ template <int N>
class SwitchField: public ConversionField< SignedField<N> > {
public:
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
QObject::tr("Switch ").toLatin1()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toLatin1()),
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toAscii(),
QObject::tr("Switch ").toAscii()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toAscii()),
sw(sw),
_switch(0)
{
@@ -408,14 +407,14 @@ class SwitchField: public ConversionField< SignedField<N> > {
_switch = sw.toValue();
ConversionField< SignedField<N> >::beforeExport();
}
virtual void afterImport()
{
ConversionField< SignedField<N> >::afterImport();
ConversionField< SignedField<N> >::afterImport();
sw = RawSwitch(_switch);
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< SignedField<N> >::internalField.getName()).arg(sw.toString());
}
}
protected:
RawSwitch & sw;
int _switch;
@@ -553,7 +552,7 @@ template <int N>
class SourceField: public ConversionField< UnsignedField<N> > {
public:
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())),
source(source),
_source(0)
@@ -569,13 +568,13 @@ class SourceField: public ConversionField< UnsignedField<N> > {
_source = source.toValue();
ConversionField< UnsignedField<N> >::beforeExport();
}
virtual void afterImport()
{
ConversionField< UnsignedField<N> >::afterImport();
ConversionField< UnsignedField<N> >::afterImport();
source = RawSource(_source);
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< UnsignedField<N> >::internalField.getName()).arg(source.toString());
}
}
protected:
RawSource & source;
@@ -742,14 +741,6 @@ class CurveReferenceField: public TransformedField {
int _curve_value;
};
static int exportHeliInversionWeight(int source) {
return (source < 0) ? 1 : 0;
}
static int importHeliInversionWeight(int source) {
return source ? -100: 100;
}
class HeliField: public StructField {
public:
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
@@ -765,15 +756,22 @@ class HeliField: public StructField {
Append(new SignedField<8>(heli.elevatorWeight));
}
else {
Append(new ConversionField< SignedField<1> >(heli.elevatorWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new ConversionField< SignedField<1> >(heli.aileronWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new ConversionField< SignedField<1> >(heli.collectiveWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new BoolField<1>(invertELE));
Append(new BoolField<1>(invertAIL));
Append(new BoolField<1>(invertCOL));
Append(new UnsignedField<5>(heli.type));
Append(new SourceField<8>(heli.collectiveSource, board, version, variant));
//, FLAG_NOSWITCHES)); Fix shift in collective
Append(new UnsignedField<8>(heli.value));
}
}
// TODO before + after
protected:
bool invertELE;
bool invertAIL;
bool invertCOL;
};
class FlightModeField: public TransformedField {
@@ -785,7 +783,7 @@ class FlightModeField: public TransformedField {
index(index),
board(board),
version(version),
rotencCount(ROTENC_COUNT(board, version))
rotencCount(IS_ARM(board) ? 1 : (IS_2560(board) ? 2 : 0))
{
if (board == BOARD_STOCK || (board==BOARD_M128 && version>=215)) {
// On stock we use 10bits per trim
@@ -805,21 +803,13 @@ class FlightModeField: public TransformedField {
internalField.Append(new SignedField<16>(trimBase[i]));
}
}
if (IS_ARM(board) && version >= 218) {
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
internalField.Append(new SwitchField<9>(phase.swtch, board, version));
internalField.Append(new SpareBitsField<7>());
}
else {
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
}
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
if (IS_ARM(board) && version >= 214) {
internalField.Append(new UnsignedField<8>(phase.fadeIn));
internalField.Append(new UnsignedField<8>(phase.fadeOut));
@@ -932,25 +922,7 @@ class MixField: public TransformedField {
version(version),
model(model)
{
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new SignedField<11>(_weight));
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new SourceField<10>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
internalField.Append(new UnsignedField<2>(mix.mixWarn));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new SignedField<14>(_offset));
internalField.Append(new SwitchField<9>(mix.swtch, board, version));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new CurveReferenceField(mix.curve, board, version));
internalField.Append(new UnsignedField<8>(mix.delayUp));
internalField.Append(new UnsignedField<8>(mix.delayDown));
internalField.Append(new UnsignedField<8>(mix.speedUp));
internalField.Append(new UnsignedField<8>(mix.speedDown));
internalField.Append(new ZCharField<8>(mix.name));
}
else if (IS_TARANIS(board) && version >= 217) {
if (IS_TARANIS(board) && version >= 217) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
@@ -1218,21 +1190,7 @@ class InputField: public TransformedField {
board(board),
version(version)
{
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<5>(expo.chn, "Channel"));
internalField.Append(new SwitchField<9>(expo.swtch, board, version));
internalField.Append(new UnsignedField<9>(expo.flightModes));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
}
else if (IS_TARANIS(board) && version >= 217) {
if (IS_TARANIS(board) && version >= 217) {
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
@@ -1466,13 +1424,7 @@ class CurvesField: public TransformedField {
maxPoints(IS_ARM(board) ? 512 : 112-8)
{
for (int i=0; i<maxCurves; i++) {
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new UnsignedField<1>((unsigned int &)curves[i].type));
internalField.Append(new BoolField<1>(curves[i].smooth));
internalField.Append(new ConversionField< SignedField<6> >(curves[i].count, -5));
internalField.Append(new ZCharField<3>(curves[i].name));
}
else if (IS_TARANIS(board) && version >= 216) {
if (IS_TARANIS(board) && version >= 216) {
internalField.Append(new UnsignedField<3>((unsigned int &)curves[i].type));
internalField.Append(new BoolField<1>(curves[i].smooth));
internalField.Append(new SpareBitsField<4>());
@@ -1629,7 +1581,7 @@ class AndSwitchesConversionTable: public ConversionTable {
{
int val=0;
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
if (IS_TARANIS(board)) {
for (int i=1; i<=MAX_SWITCHES_POSITION(board, version); i++) {
int s = switchIndex(i, board, version);
@@ -1643,7 +1595,7 @@ class AndSwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -1654,7 +1606,7 @@ class AndSwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -1719,16 +1671,7 @@ class LogicalSwitchField: public TransformedField {
v2(0),
v3(0)
{
if (IS_ARM(board) && version >= 218) {
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
internalField.Append(new SignedField<10>(v1));
internalField.Append(new SignedField<10>(v3));
internalField.Append(new ConversionField< SignedField<9> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
internalField.Append(new SpareBitsField<1>()); // TODO extra switch mode
internalField.Append(new SpareBitsField<2>());
internalField.Append(new SignedField<16>(v2));
}
else if (IS_ARM(board) && version >= 217) {
if (IS_ARM(board) && version >= 217) {
internalField.Append(new ConversionField< UnsignedField<6> >(csw.func, &functionsConversionTable, "Function"));
internalField.Append(new SignedField<10>(v1));
internalField.Append(new SignedField<16>(v2));
@@ -1763,7 +1706,7 @@ class LogicalSwitchField: public TransformedField {
int scale = (version >= 216 ? 0 : 5);
internalField.Append(new ConversionField< UnsignedField<8> >(csw.delay, 0, scale));
internalField.Append(new ConversionField< UnsignedField<8> >(csw.duration, 0, scale));
if (version >= 214 && version <= 217) {
if (version >= 214) {
internalField.Append(new ConversionField< SignedField<8> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
}
}
@@ -1774,7 +1717,7 @@ class LogicalSwitchField: public TransformedField {
}
}
~LogicalSwitchField()
~LogicalSwitchField()
{
delete andswitchesConversionTable;
}
@@ -2086,14 +2029,8 @@ class ArmCustomFunctionField: public TransformedField {
{
memset(_param, 0, sizeof(_param));
if (version >= 218) {
internalField.Append(new SwitchField<9>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<7> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
}
else {
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
}
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
if (IS_TARANIS(board) && version >= 216)
internalField.Append(new CharField<8>(_param, false));
@@ -2120,7 +2057,7 @@ class ArmCustomFunctionField: public TransformedField {
if (fn.swtch.type != SWITCH_TYPE_NONE) {
_func = fn.func;
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
_active = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5));
else
_active = (fn.enabled ? 1 : 0);
@@ -2216,7 +2153,7 @@ class ArmCustomFunctionField: public TransformedField {
{
fn.func = (AssignFunc)_func;
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
fn.repeatParam = (version >= 216 ? _active : (_active*5));
else
fn.enabled = (_active & 0x01);
@@ -2233,7 +2170,7 @@ class ArmCustomFunctionField: public TransformedField {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int16_t)(uint16_t)value;
fn.param = (int8_t)value;
}
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
fn.func = AssignFunc(fn.func + index);
@@ -2274,8 +2211,9 @@ class ArmCustomFunctionField: public TransformedField {
}
}
else if (fn.func == FuncPlayValue) {
if (version >= 213)
if (version >= 213) {
sourcesConversionTable->importValue(value, (int &)fn.param);
}
else
SourcesConversionTable::getInstance(board, version, variant, FLAG_NONONE|FLAG_NOSWITCHES)->importValue(value, (int &)fn.param);
}
@@ -2536,7 +2474,7 @@ class FrskyScreenField: public DataField {
else
numbers.Append(new SpareBitsField<4*8>());
}
if (IS_TARANIS(board) && version >= 217) {
script.Append(new CharField<8>(screen.body.script.filename));
script.Append(new SpareBitsField<16*8>());
@@ -2885,7 +2823,7 @@ class SensorField: public TransformedField {
_instance = sensor.formula;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
_param = (sensor.source) + (sensor.index << 8);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
_param = (sensor.gps) + (sensor.alt << 8);
@@ -2907,7 +2845,7 @@ class SensorField: public TransformedField {
sensor.formula = _instance;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
(sensor.source = _sources[0], sensor.index = _sources[1]);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
for (int i=0; i<4; ++i)
sensor.sources[i] = _sources[i];
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
@@ -2968,21 +2906,8 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
for (int i=0; i<MAX_TIMERS(board, version); i++) {
if (IS_ARM(board) && version >= 218) {
internalField.Append(new SwitchField<9>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<23>(modelData.timers[i].val));
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<3>());
if (IS_TARANIS(board))
internalField.Append(new ZCharField<8>(modelData.timers[i].name));
else
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
}
else if (IS_ARM(board) && version >= 217) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
if (IS_ARM(board) && version >= 217) {
internalField.Append(new UnsignedField<24>(modelData.timers[i].val));
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
@@ -2995,7 +2920,6 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
}
else if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
@@ -3004,7 +2928,6 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
else if (afterrelease21March2013) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<12>(modelData.timers[i].val));
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
@@ -3018,7 +2941,6 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
}
else {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
@@ -3056,14 +2978,14 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216))
internalField.Append(new BoolField<1>(modelData.displayChecklist));
else
internalField.Append(new BoolField<1>(modelData.moduleData[0].ppm.pulsePol));
internalField.Append(new BoolField<1>(modelData.moduleData[0].ppmPulsePol));
internalField.Append(new BoolField<1>(modelData.extendedLimits));
internalField.Append(new BoolField<1>(modelData.extendedTrims));
internalField.Append(new BoolField<1>(modelData.throttleReversed));
if (!IS_ARM(board) || version < 216) {
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].ppm.delay, exportPpmDelay, importPpmDelay));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].ppmDelay, exportPpmDelay, importPpmDelay));
}
if (IS_ARM(board) || IS_2560(board))
@@ -3078,7 +3000,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
for (int i=0; i<MAX_EXPOS(board, version); i++)
internalField.Append(new InputField(modelData.expoData[i], board, version));
internalField.Append(new CurvesField(modelData.curves, board, version));
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++)
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
internalField.Append(new LogicalSwitchField(modelData.logicalSw[i], board, version, variant, &modelData));
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
if (IS_ARM(board))
@@ -3087,12 +3009,11 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new AvrCustomFunctionField(modelData.customFn[i], board, version, variant));
}
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++) {
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
internalField.Append(new FlightModeField(modelData.flightModeData[i], i, board, version));
}
if (!IS_ARM(board) || version < 216) {
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppm.frameLength));
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
}
internalField.Append(new UnsignedField<8>(modelData.thrTraceSrc, "Throttle Source"));
@@ -3171,38 +3092,36 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board) && version >= 215) {
for (int module=0; module<modulesCount; module++) {
if (version >= 217) {
internalField.Append(new ConversionField<SignedField<4> >(modelData.moduleData[module].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new ConversionField< SignedField<4> >(modelData.moduleData[module].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new SignedField<4>(subprotocols[module]));
}
else {
internalField.Append(new SignedField<8>(subprotocols[module]));
}
internalField.Append(new UnsignedField<8>(modelData.moduleData[module].channelsStart));
internalField.Append(new ConversionField<SignedField<8> >(modelData.moduleData[module].channelsCount, -8));
if (version >= 217) {
internalField.Append(new UnsignedField<4>(modelData.moduleData[module].failsafeMode));
internalField.Append(new UnsignedField<3>(modelData.moduleData[module].subType));
internalField.Append(new BoolField<1>(modelData.moduleData[module].invertedSerial));
} else
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[module].channelsCount, -8));
if (version >= 217)
internalField.Append(new UnsignedField<8>(modelData.moduleData[module].failsafeMode));
else
internalField.Append(new ConversionField< UnsignedField<8> >(modelData.moduleData[module].failsafeMode, -1));
for (int i=0; i<32; i++) {
internalField.Append(new SignedField<16>(modelData.moduleData[module].failsafeChannels[i]));
}
if (version >= 217) {
internalField.Append(new ConversionField< SignedField<6> >(modelData.moduleData[module].ppm.delay, exportPpmDelay, importPpmDelay));
internalField.Append(new BoolField<1>(modelData.moduleData[module].ppm.pulsePol));
internalField.Append(new BoolField<1>(modelData.moduleData[module].ppm.outputType));
internalField.Append(new SignedField<8>(modelData.moduleData[module].ppm.frameLength));
internalField.Append(new ConversionField< SignedField<6> >(modelData.moduleData[module].ppmDelay, exportPpmDelay, importPpmDelay));
internalField.Append(new BoolField<1>(modelData.moduleData[module].ppmPulsePol));
internalField.Append(new BoolField<1>(modelData.moduleData[module].ppmOutputType));
internalField.Append(new SignedField<8>(modelData.moduleData[module].ppmFrameLength));
}
else {
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[module].ppm.delay, exportPpmDelay, importPpmDelay));
internalField.Append(new SignedField<8>(modelData.moduleData[module].ppm.frameLength));
internalField.Append(new BoolField<8>(modelData.moduleData[module].ppm.pulsePol));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[module].ppmDelay, exportPpmDelay, importPpmDelay));
internalField.Append(new SignedField<8>(modelData.moduleData[module].ppmFrameLength));
internalField.Append(new BoolField<8>(modelData.moduleData[module].ppmPulsePol));
}
}
}
if (IS_TARANIS(board) && version < 218) {
if (IS_TARANIS(board)) {
for (int i=0; i<MAX_CURVES(board, version); i++) {
internalField.Append(new ZCharField<6>(modelData.curves[i].name));
}
@@ -3230,13 +3149,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
}
}
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++) {
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
}
}
if (IS_ARM(board) && version >= 217) {
for (int i=0; i<8; i++) {
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
@@ -3258,7 +3177,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board) && version >= 216) {
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
}
}
}
if (IS_ARM(board) && version == 216) {
@@ -3271,7 +3190,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
if (IS_ARM(board) && version >= 217) {
for (int i=0; i<MAX_TELEMETRY_SENSORS(board, version); ++i) {
for (int i=0; i<MAX_SENSORS(board, version); ++i) {
internalField.Append(new SensorField(modelData.sensorData[i], board, version));
}
}
@@ -3378,9 +3297,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
internalField.Append(new SignedField<8>(generalData.backlightMode));
for (int i=0; i<NUM_STICKS; i++) {
for (int i=0; i<NUM_STICKS; i++)
internalField.Append(new SignedField<16>(generalData.trainer.calib[i]));
}
for (int i=0; i<NUM_STICKS; i++) {
internalField.Append(new UnsignedField<6>(generalData.trainer.mix[i].src));
internalField.Append(new UnsignedField<2>(generalData.trainer.mix[i].mode));
@@ -3389,7 +3307,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<8>(generalData.view, 0, MAX_VIEWS(board)-1));
internalField.Append(new SpareBitsField<2>()); // TODO buzzerMode?
internalField.Append(new SpareBitsField<2>());
internalField.Append(new BoolField<1>(generalData.fai));
internalField.Append(new SignedField<2>((int &)generalData.beeperMode));
internalField.Append(new BoolField<1>(generalData.flashBeep));
@@ -3406,18 +3324,13 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
}
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
if (IS_9X(board)) {
if (version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
}
else {
internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
if (IS_9X(board) && version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
}
else {
internalField.Append(new SpareBitsField<3>());
internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
if (version >= 216 && IS_TARANIS(board))
internalField.Append(new SignedField<3>(generalData.splashDuration));
@@ -3430,19 +3343,20 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (IS_ARM(board))
internalField.Append(new SignedField<8>(generalData.switchesDelay));
else
internalField.Append(new SpareBitsField<8>()); // TODO blOffBright + blOnBright
internalField.Append(new SpareBitsField<8>());
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
internalField.Append(new SignedField<8>(generalData.hapticLength));
if (version < 216 || (version < 218 && !IS_9X(board)) || (!IS_9X(board) && !IS_TARANIS(board))) {
if (version < 216 || !IS_9X(board)) {
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
}
if (version >= 216 && !IS_TARANIS(board)) {
internalField.Append(new UnsignedField<8>(generalData.stickReverse));
internalField.Append(new UnsignedField<4>(generalData.stickReverse));
internalField.Append(new SpareBitsField<4>());
}
internalField.Append(new SignedField<3>(generalData.beeperLength));
@@ -3464,46 +3378,33 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
if (version < 218) internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
if (version >= 213) {
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
if (version < 218) internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
if (version < 218) internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
}
if (version >= 214) {
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
internalField.Append(new UnsignedField<8>(generalData.countryCode));
internalField.Append(new UnsignedField<8>(generalData.imperial));
}
if (version >= 215) {
internalField.Append(new CharField<2>(generalData.ttsLanguage));
if (version < 218) {
internalField.Append(new SignedField<8>(generalData.beepVolume));
internalField.Append(new SignedField<8>(generalData.wavVolume));
internalField.Append(new SignedField<8>(generalData.varioVolume));
}
else {
internalField.Append(new SignedField<4>(generalData.beepVolume));
internalField.Append(new SignedField<4>(generalData.wavVolume));
internalField.Append(new SignedField<4>(generalData.varioVolume));
internalField.Append(new SignedField<4>(generalData.backgroundVolume));
}
internalField.Append(new SignedField<8>(generalData.beepVolume));
internalField.Append(new SignedField<8>(generalData.wavVolume));
internalField.Append(new SignedField<8>(generalData.varioVolume));
if (version >= 216) {
internalField.Append(new SignedField<8>(generalData.varioPitch));
internalField.Append(new SignedField<8>(generalData.varioRange));
internalField.Append(new SignedField<8>(generalData.varioRepeat));
}
if (version < 218) internalField.Append(new SignedField<8>(generalData.backgroundVolume));
}
if (version >= 218) {
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
}
internalField.Append(new SignedField<8>(generalData.backgroundVolume));
}
if (IS_TARANIS(board) && version >= 216) {
if (version >= 217) {
@@ -3529,11 +3430,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
}
if (IS_TARANIS_X9E(board))
internalField.Append(new SpareBitsField<64>()); // switchUnlockStates
internalField.Append(new SpareBitsField<64>());
else if (IS_TARANIS(board))
internalField.Append(new SpareBitsField<16>()); // switchUnlockStates
if (version == 217) {
internalField.Append(new SpareBitsField<16>());
if (version >= 217) {
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
}
@@ -83,7 +83,6 @@ class ProtocolsConversionTable: public ConversionTable
}
if (IS_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
addConversion(PULSES_MULTIMODULE, val++);
}
}
};
+152 -182
View File
@@ -23,8 +23,8 @@
#include "file.h"
#include "appdata.h"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/firmware"
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/nightly/firmware"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/nightly/firmware"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
@@ -75,10 +75,6 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for 9XR-PRO";
case BOARD_AR9X:
return "OpenTX for ar9x board / 9X";
case BOARD_FLAMENCO:
return "OpenTX for Flamenco experimental";
case BOARD_HORUS:
return "OpenTX for FrSky Horus";
default:
return "OpenTX for an unknown board";
}
@@ -102,8 +98,6 @@ const int OpenTxEepromInterface::getEEpromSize()
case BOARD_TARANIS:
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
case BOARD_FLAMENCO:
case BOARD_HORUS:
return EESIZE_TARANIS;
default:
return 0;
@@ -393,7 +387,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
}
}
std::cout << " ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -409,9 +403,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
case BOARD_FLAMENCO:
case BOARD_HORUS:
version = 218;
version = 217;
break;
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
@@ -644,7 +636,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
return id.contains("nooverridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 64;
return 32;
else
return 12;
case CustomAndSwitches:
@@ -813,16 +805,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
}
}
QTime OpenTxFirmware::getMaxTimerStart()
{
if (IS_TARANIS(board) || IS_HORUS(board))
return QTime(23, 59, 59);
else if (IS_ARM(board))
return QTime(8, 59, 59);
else
return QTime(0, 59, 59);
}
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
{
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
@@ -865,8 +847,6 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_DSMX:
case PULSES_CROSSFIRE:
return 1;
case PULSES_MULTIMODULE:
return id.contains("multimodule") ? 1 : 0;
default:
return 0;
}
@@ -976,16 +956,16 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
// M128 revert because too much RAM used!
case 216:
// A lot of things (first github release)
return OLD_VERSION;
break;
case 217:
// 3 logical switches removed on M128 / gruvin9x boards
return OLD_VERSION;
case 218:
break;
default:
return NOT_OPENTX;
}
return ALL_OK;
return NO_ERROR;
}
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
@@ -1093,7 +1073,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
}
std::cout << " ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
@@ -1109,12 +1089,25 @@ QString OpenTxFirmware::getFirmwareBaseUrl()
QString OpenTxFirmware::getFirmwareUrl()
{
QString url = getFirmwareBaseUrl();
QByteArray data = QUrl::toPercentEncoding(id);
if (IS_ARM(board))
url.append(QString("/getfw.php?fw=%1.bin").arg((QString)data));
else
url.append(QString("/getfw.php?fw=%1.hex").arg((QString)data));
switch (board) {
case BOARD_STOCK:
case BOARD_M128:
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
break;
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
case BOARD_TARANIS:
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
break;
default:
url.clear();
break;
}
return url;
}
@@ -1135,6 +1128,7 @@ QString OpenTxFirmware::getStampUrl()
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
{
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
firmware->addOption("nooverridech", QObject::tr("No OverrideCH functions available"));
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE (no telemetry) at field") }, { "faimode", QObject::tr("FAI MODE (no telemetry) always enabled") }, { NULL } };
firmware->addOptions(fai_options);
@@ -1149,10 +1143,8 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
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("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
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("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use in the EU on radios sold after Jan 1st, 2015"));
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
firmware->addOption("multimodule", QObject::tr("Support for the DIY-Multiprotocol-TX-Module"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
}
void addOpenTxLcdOptions(OpenTxFirmware * firmware)
@@ -1162,7 +1154,6 @@ void addOpenTxLcdOptions(OpenTxFirmware * firmware)
{ "ST7565R", QObject::tr("ST7565R LCD or compatible") },
{ "ERC12864FSF", QObject::tr("ERC12864FSF LCD") },
{ "ST7920", QObject::tr("ST7920 LCD") },
{ "KS108", QObject::tr("KS108 LCD") },
{ NULL }
};
firmware->addOptions(lcd_options);
@@ -1177,124 +1168,8 @@ void registerOpenTxFirmwares()
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-x9d+", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-x9d", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-x9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Horus board */
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
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"));
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("multimodule", QObject::tr("Support for the DIY-Multiprotocol-TX-Module"));
addOpenTxCommonOptions(firmware);
firmware->addOption("pcbdev", QObject::tr("Use ONLY with first DEV pcb version"));
firmwares.push_back(firmware);
/* 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("nocurves", QObject::tr("Disable curves menus"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
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"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
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("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
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("potscroll", QObject::tr("Pots use in menus navigation"));
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("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
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("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
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("potscroll", QObject::tr("Pots use in menus navigation"));
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("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9x board */
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK);
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK);
firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1326,12 +1201,11 @@ void registerOpenTxFirmwares()
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9x board with M128 chip */
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128);
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128);
firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1357,58 +1231,72 @@ void registerOpenTxFirmwares()
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 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"));
/* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
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("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
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"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(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"));
/* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
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("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
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"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Gruvin9x board */
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X);
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X);
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"));
@@ -1429,12 +1317,11 @@ void registerOpenTxFirmwares()
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* MEGA2560 board */
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560);
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560);
addOpenTxLcdOptions(firmware);
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
firmware->addOptions(ext_options);
@@ -1445,8 +1332,8 @@ void registerOpenTxFirmwares()
firmware->addOption("nofp", QObject::tr("No flight modes"));
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("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("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);
@@ -1460,11 +1347,94 @@ void registerOpenTxFirmwares()
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
default_firmware_variant = GetFirmware("opentx-x9d+");
/* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), 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("nocurves", QObject::tr("Disable curves menus"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("ar9x board / 9X"), 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("nocurves", QObject::tr("Disable curves menus"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("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("nocurves", QObject::tr("Disable curves menus"));
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("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
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("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
current_firmware_variant = default_firmware_variant;
}
@@ -118,8 +118,6 @@ class OpenTxFirmware: public Firmware {
virtual QString getFirmwareUrl();
virtual int getCapability(const Capability);
virtual QTime getMaxTimerStart();
virtual bool isTelemetrySourceAvailable(int source);
@@ -0,0 +1,211 @@
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
add_custom_target(about_lbm_9x
make lbm PCB=9X
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_target(about_lbm_taranis
make lbm PCB=TARANIS
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_target(commondeps
make stamp_header tra
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
macro(add_lua_export_target target)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${INTTYPES_INCLUDE_OPTION} myeeprom.h | grep LEXP > lua_exports_${target}.txt
COMMAND python ../util/luaexport.py ${C9X_VERSION} lua_exports_${target}.txt lua/lua_exports_${target}.inc lua_fields_${target}.txt
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_target(lua_export_${target} DEPENDS ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc)
endmacro(add_lua_export_target)
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
set(OPENTX_SRC_FILES
opentxsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/firmwares/opentx
${RADIO_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}/fonts/std
${RADIO_SRC_DIRECTORY}/lua/src
${RADIO_SRC_DIRECTORY}/thirdparty
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs/option
${RADIO_SRC_DIRECTORY}/thirdparty/CoOS
${RADIO_SRC_DIRECTORY}/thirdparty/Lua/src
)
if(APPLE)
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_SHARED_LINKER_FLAGS -F/Library/Frameworks)
endif(APPLE)
if(DEFINED TRANSLATIONS)
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
endif()
set(COMMON_DEFINITIONS
${COMMON_DEFINITIONS}
SUFFIX="${SUFFIX}"
HELI
GVARS
FLIGHT_MODES
PPM_CENTER_ADJUSTABLE
PPM_LIMITS_SYMETRICAL
OVERRIDE_CHANNEL_FUNCTION
FAI_CHOICE
)
set(COMMON_LIBRARIES
${QT_LIBRARIES}
${PTHREAD_LIBRARY}
${SDL_LIBRARY}
)
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-ar9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis)
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis)
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis_x9e)
set(OPENTX_LIBRARIES
opentx-9x${SUFFIX}-simulator
opentx-9xr${SUFFIX}-simulator
opentx-9x128${SUFFIX}-simulator
opentx-9xr128${SUFFIX}-simulator
opentx-gruvin9x${SUFFIX}-simulator
opentx-mega2560${SUFFIX}-simulator
opentx-sky9x${SUFFIX}-simulator
opentx-9xrpro${SUFFIX}-simulator
opentx-ar9x${SUFFIX}-simulator
opentx-taranis${SUFFIX}-simulator
opentx-taranisplus${SUFFIX}-simulator
opentx-taranisx9e${SUFFIX}-simulator
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# 9X with ATmega64
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR with ATmega64
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9X with ATmega128
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR with ATmega128
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Gruvin9x
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Mega2560
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560)
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Sky9x
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR-PRO
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# AR9X
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis standard
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis Plus
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis X9E
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
add_custom_target(opentx-simulators
DEPENDS ${OPENTX_LIBRARIES}
)
if(APPLE)
set(SIMULATOR_BUNDLES)
foreach(_file ${OPENTX_LIBRARIES})
set(SIMULATOR_BUNDLE "${_file}-bundle")
add_custom_target(${SIMULATOR_BUNDLE}
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND pwd
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
DEPENDS ${_file}
)
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
endforeach()
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
endif(APPLE)
@@ -0,0 +1,581 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "opentxsimulator.h"
#include <stdio.h>
#include <exception>
#include <map>
#include <string>
#define COMPANION
#define SIMU
#define SIMU_EXCEPTIONS
#define GUI
#define SPLASH
#define FRSKY
#define FRSKY_HUB
#define GPS
#define VARIO
#define GAUGES
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#if defined(PCBTARANIS)
#define RTCLOCK
#define XCURVES
#define VIRTUALINPUTS
#define LUA
#define LUA_MODEL_SCRIPTS
#define LUAINPUTS
#else
#define BUZZER
#define TEMPLATES
#endif
#define BOLD_FONT
#define HAPTIC
#define THRTRACE
#if defined(CPUARM)
#define TIMERS 3
#else
#define TIMERS 2
#endif
#if defined(PCBSKY9X) && !defined(REVX)
#define ROTARY_ENCODERS 1
#elif defined(PCBGRUVIN9X)
#define ROTARY_ENCODERS 2
#endif
#if defined(CPUARM)
#define FRSKY_SPORT
#endif
#if defined (PCBTARANIS)
#define MIXERS_MONITOR
#endif
#undef min
#undef max
namespace NAMESPACE {
#if defined(CPUARM)
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/main_arm.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
#include "radio/src/tasks_arm.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/telemetry/telemetry.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/sbus.cpp"
#include "radio/src/crc16.cpp"
#else
#include "radio/src/main_avr.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#endif
#include "radio/src/eeprom_common.cpp"
#if defined(EEPROM_RLC)
#include "radio/src/eeprom_rlc.cpp"
#else
#include "radio/src/eeprom_raw.cpp"
#endif
#if defined(PCBTARANIS) || defined(PCBSKY9X)
#include "radio/src/eeprom_conversions.cpp"
#endif
#include "radio/src/opentx.cpp"
#include "radio/src/debug.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#if defined(SDCARD)
#include "radio/src/sdcard.cpp"
#endif
#include "radio/src/timers.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/trainer_input.cpp"
#if defined(PCBTARANIS)
#include "radio/src/bmp.cpp"
#include "radio/src/gui/Taranis/fonts.cpp"
#include "radio/src/gui/Taranis/widgets.cpp"
#include "radio/src/gui/Taranis/navigation.cpp"
#include "radio/src/gui/Taranis/popups.cpp"
#include "radio/src/gui/Taranis/helpers.cpp"
#include "radio/src/gui/Taranis/menus.cpp"
#include "radio/src/gui/Taranis/menu_model.cpp"
#include "radio/src/gui/Taranis/menu_model_select.cpp"
#include "radio/src/gui/Taranis/menu_model_setup.cpp"
#include "radio/src/gui/Taranis/menu_model_heli.cpp"
#include "radio/src/gui/Taranis/menu_model_flightmodes.cpp"
#include "radio/src/gui/Taranis/menu_model_inputs_mixes.cpp"
#include "radio/src/gui/Taranis/menu_model_curves.cpp"
#include "radio/src/gui/Taranis/menu_model_logical_switches.cpp"
#include "radio/src/gui/Taranis/menu_model_custom_functions.cpp"
#include "radio/src/gui/Taranis/menu_model_custom_scripts.cpp"
#include "radio/src/gui/Taranis/menu_model_gvars.cpp"
#include "radio/src/gui/Taranis/menu_model_limits.cpp"
#include "radio/src/gui/Taranis/menu_model_telemetry.cpp"
#include "radio/src/gui/Taranis/menu_general.cpp"
#include "radio/src/gui/Taranis/menu_general_setup.cpp"
#include "radio/src/gui/Taranis/menu_general_sdmanager.cpp"
#include "radio/src/gui/Taranis/menu_general_trainer.cpp"
#include "radio/src/gui/Taranis/menu_general_version.cpp"
#include "radio/src/gui/Taranis/menu_general_diagkeys.cpp"
#include "radio/src/gui/Taranis/menu_general_diaganas.cpp"
#include "radio/src/gui/Taranis/menu_general_hardware.cpp"
#include "radio/src/gui/Taranis/menu_general_calib.cpp"
#include "radio/src/gui/Taranis/view_main.cpp"
#include "radio/src/gui/Taranis/view_statistics.cpp"
#include "radio/src/gui/Taranis/view_channels.cpp"
#include "radio/src/gui/Taranis/view_telemetry.cpp"
#include "radio/src/gui/Taranis/view_text.cpp"
#include "radio/src/gui/Taranis/view_about.cpp"
#include "radio/src/gui/Taranis/lcd.cpp"
#include "radio/src/gui/Taranis/splash.cpp"
#else
#include "radio/src/gui/9X/fonts.cpp"
#include "radio/src/gui/9X/widgets.cpp"
#include "radio/src/gui/9X/navigation.cpp"
#include "radio/src/gui/9X/popups.cpp"
#include "radio/src/gui/9X/helpers.cpp"
#include "radio/src/gui/9X/menus.cpp"
#include "radio/src/gui/9X/menu_model.cpp"
#include "radio/src/gui/9X/menu_model_select.cpp"
#include "radio/src/gui/9X/menu_model_setup.cpp"
#include "radio/src/gui/9X/menu_model_heli.cpp"
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
#include "radio/src/gui/9X/menu_model_curves.cpp"
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
#include "radio/src/gui/9X/menu_model_limits.cpp"
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
#include "radio/src/gui/9X/menu_model_templates.cpp"
#include "radio/src/gui/9X/menu_general.cpp"
#include "radio/src/gui/9X/menu_general_setup.cpp"
#if defined(SDCARD)
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
#include "radio/src/gui/9X/view_text.cpp"
#endif
#include "radio/src/gui/9X/menu_general_trainer.cpp"
#include "radio/src/gui/9X/menu_general_version.cpp"
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
#if defined(CPUARM)
#include "radio/src/gui/9X/menu_general_hardware.cpp"
#endif
#include "radio/src/gui/9X/menu_general_calib.cpp"
#include "radio/src/gui/9X/view_main.cpp"
#include "radio/src/gui/9X/view_statistics.cpp"
#include "radio/src/gui/9X/view_telemetry.cpp"
#if !defined(CPUM64)
#include "radio/src/gui/9X/view_about.cpp"
#endif
#include "radio/src/gui/9X/lcd.cpp"
#include "radio/src/gui/9X/splash.cpp"
#endif
#if !defined(VIRTUALINPUTS)
#include "radio/src/templates.cpp"
#endif
#if defined(SDCARD)
#include "radio/src/logs.cpp"
#endif
#if defined(RTCLOCK)
#include "radio/src/rtc.cpp"
#endif
#if defined(BUZZER)
#include "radio/src/buzzer.cpp"
#endif
#if defined(PCBTARANIS)
#include "radio/src/targets/taranis/board_taranis.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
#include "radio/src/targets/taranis/audio_driver.cpp"
#include "radio/src/targets/taranis/telemetry_driver.cpp"
#include "radio/src/targets/taranis/haptic_driver.cpp"
#if defined(REV9E)
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
#endif
#include "radio/src/targets/taranis/pulses_driver.cpp"
#include "radio/src/targets/taranis/rtc_driver.cpp"
#include "radio/src/targets/taranis/trainer_driver.cpp"
#include "radio/src/targets/taranis/serial2_driver.cpp"
#elif defined(PCBSKY9X)
#include "radio/src/targets/sky9x/board_sky9x.cpp"
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
#include "radio/src/targets/sky9x/pwr_driver.cpp"
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/targets/sky9x/audio_driver.cpp"
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
#include "radio/src/targets/sky9x/coproc_driver.cpp"
#include "radio/src/targets/sky9x/haptic_driver.cpp"
#include "radio/src/targets/sky9x/serial2_driver.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#elif defined(PCBGRUVIN9X)
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
#include "radio/src/targets/gruvin9x/somo14d.cpp"
#elif defined(PCBMEGA2560)
#include "radio/src/targets/mega2560/board_mega2560.cpp"
#else
#include "radio/src/targets/stock/board_stock.cpp"
#endif
#include "radio/src/keys.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/telemetry/frsky.cpp"
#if defined(CPUARM)
#include "radio/src/telemetry/frsky_d_arm.cpp"
#else
#include "radio/src/telemetry/frsky_d.cpp"
#endif
#include "radio/src/translations/tts_en.cpp"
#if defined(CPUARM)
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_hu.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_nl.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_sk.cpp"
#endif
#if defined(LUA)
#include "radio/src/lua/interface.cpp"
#include "radio/src/lua/api_general.cpp"
#include "radio/src/lua/api_lcd.cpp"
#include "radio/src/lua/api_model.cpp"
#include "radio/src/thirdparty/Lua/src/lapi.c"
#include "radio/src/thirdparty/Lua/src/lcode.c"
#include "radio/src/thirdparty/Lua/src/lctype.c"
#include "radio/src/thirdparty/Lua/src/ldebug.c"
#include "radio/src/thirdparty/Lua/src/ldo.c"
#include "radio/src/thirdparty/Lua/src/ldump.c"
#include "radio/src/thirdparty/Lua/src/lfunc.c"
#include "radio/src/thirdparty/Lua/src/lgc.c"
#include "radio/src/thirdparty/Lua/src/llex.c"
#include "radio/src/thirdparty/Lua/src/lmem.c"
#include "radio/src/thirdparty/Lua/src/lobject.c"
#include "radio/src/thirdparty/Lua/src/lopcodes.c"
#include "radio/src/thirdparty/Lua/src/lparser.c"
#include "radio/src/thirdparty/Lua/src/lstate.c"
#include "radio/src/thirdparty/Lua/src/lstring.c"
#include "radio/src/thirdparty/Lua/src/ltable.c"
#include "radio/src/thirdparty/Lua/src/lrotable.c"
#include "radio/src/thirdparty/Lua/src/ltm.c"
#include "radio/src/thirdparty/Lua/src/lundump.c"
#include "radio/src/thirdparty/Lua/src/lvm.c"
#include "radio/src/thirdparty/Lua/src/lzio.c"
#include "radio/src/thirdparty/Lua/src/lbaselib.c"
#include "radio/src/thirdparty/Lua/src/linit.c"
#include "radio/src/thirdparty/Lua/src/lmathlib.c"
#include "radio/src/thirdparty/Lua/src/lbitlib.c"
#include "radio/src/thirdparty/Lua/src/loadlib.c"
#include "radio/src/thirdparty/Lua/src/lauxlib.c"
#include "radio/src/thirdparty/Lua/src/ltablib.c"
#include "radio/src/thirdparty/Lua/src/lcorolib.c"
#include "radio/src/thirdparty/Lua/src/liolib.c"
#include "radio/src/thirdparty/Lua/src/lstrlib.c"
#endif
int16_t g_anas[NUM_STICKS+NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
#if defined(PCBTARANIS)
void resetTrims()
{
TRIMS_GPIO_REG_RVD |= TRIMS_GPIO_PIN_RVD;
TRIMS_GPIO_REG_RVU |= TRIMS_GPIO_PIN_RVU;
TRIMS_GPIO_REG_RHL |= TRIMS_GPIO_PIN_RHL;
TRIMS_GPIO_REG_RHR |= TRIMS_GPIO_PIN_RHR;
TRIMS_GPIO_REG_LVD |= TRIMS_GPIO_PIN_LVD;
TRIMS_GPIO_REG_LVU |= TRIMS_GPIO_PIN_LVU;
TRIMS_GPIO_REG_LHL |= TRIMS_GPIO_PIN_LHL;
TRIMS_GPIO_REG_LHR |= TRIMS_GPIO_PIN_LHR;
}
#endif
void delay_01us(::uint16_t nb)
{
}
OpenTxSimulator::OpenTxSimulator()
{
}
void OpenTxSimulator::setSdPath(const QString &sdPath)
{
#if defined(SDCARD)
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
#endif
}
void OpenTxSimulator::setVolumeGain(int value)
{
volumeGain = value;
}
bool OpenTxSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
::uint8_t * OpenTxSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
start((const char *)0, tests);
}
void OpenTxSimulator::start(const char * filename, bool tests)
{
#if defined(PCBSKY9X) && !defined(REVX)
g_rotenc[0] = 0;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] = 0;
g_rotenc[1] = 0;
#endif
StartEepromThread(filename);
StartAudioThread(volumeGain);
StartMainThread(tests);
}
void OpenTxSimulator::stop()
{
StopMainThread();
#if defined(CPUARM)
StopAudioThread();
#endif
StopEepromThread();
}
void OpenTxSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
#if defined(PCBSKY9X)
outputs.beep = g_beepCnt;
g_beepCnt = 0;
#endif
}
void OpenTxSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::setTrim(unsigned int idx, int value)
{
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxSimulator::getTrims(Trims & trims)
{
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
::uint8_t idx = NAMESPACE::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpenTxSimulator::wheelEvent(int steps)
{
#if defined(REV9E)
if (steps == 255)
x9de_rotenc -= 2;
else
x9de_rotenc += 2;
#elif defined(PCBSKY9X) && !defined(REVX)
g_rotenc[0] += steps*4;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] += steps;
#endif
}
unsigned int OpenTxSimulator::getPhase()
{
return getFlightMode();
}
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * OpenTxSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
{
#if defined(FRSKY_SPORT)
processSportPacket(data);
#endif
}
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
{
#if defined(FRSKY_SPORT)
for (int i = 0; i<MAX_SENSORS; i++) {
if (isTelemetryFieldAvailable(i)) {
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
if (sensor->id == id) {
return sensor->instance;
}
}
}
#endif
return 0;
}
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
{
#if defined(FRSKY_SPORT)
for (int i = 0; i<MAX_SENSORS; i++) {
if (isTelemetryFieldAvailable(i)) {
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
if (sensor->id == id) {
return sensor->custom.ratio;
}
}
}
#endif
return 0;
}
void OpenTxSimulator::setLuaStateReloadPermanentScripts()
{
#if defined(LUA)
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
#endif
}
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
{
traceCallback = callback;
}
class OpenTxSimulatorFactory: public SimulatorFactory
{
public:
OpenTxSimulatorFactory()
{
}
virtual SimulatorInterface *create()
{
return new OpenTxSimulator();
}
virtual QString name()
{
return QString("opentx-" FLAVOUR SUFFIX);
}
virtual BoardEnum type()
{
#if defined(PCBTARANIS)
return BOARD_TARANIS;
#else
return BOARD_STOCK;
#endif
}
};
}
extern "C" DLLEXPORT SimulatorFactory *registerSimu()
{
return new NAMESPACE::OpenTxSimulatorFactory();
}
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -14,17 +14,71 @@
*
*/
#ifndef _OPENTX_SIMULATOR_H_
#define _OPENTX_SIMULATOR_H_
#ifndef opentx_taranis_simulator_h
#define opentx_taranis_simulator_h
#include "simulatorinterface.h"
#if defined(PCBTARANIS) && defined(REV9E)
#define FLAVOUR "taranisx9e"
#define NAMESPACE TaranisX9E
#define EEPROM_VARIANT 0x8000
#elif defined(PCBTARANIS) && defined(REVPLUS)
#define FLAVOUR "taranisplus"
#define NAMESPACE TaranisPlus
#define EEPROM_VARIANT 0
#elif defined(PCBTARANIS)
#define FLAVOUR "taranis"
#define NAMESPACE Taranis
#define EEPROM_VARIANT 0
#elif defined(PCBSKY9X) && defined(REVX)
#define FLAVOUR "9xrpro"
#define NAMESPACE Sky9xPro
#define EEPROM_VARIANT 0
#elif defined(PCBSKY9X) && defined(AR9X)
#define FLAVOUR "ar9x"
#define NAMESPACE Ar9x
#define EEPROM_VARIANT 0
#elif defined(PCBSKY9X)
#define FLAVOUR "sky9x"
#define NAMESPACE Sky9X
#define EEPROM_VARIANT 0
#elif defined(PCBGRUVIN9X)
#define FLAVOUR "gruvin9x"
#define NAMESPACE Gruvin9X
#define EEPROM_VARIANT 0
#elif defined(PCBMEGA2560)
#define FLAVOUR "mega2560"
#define NAMESPACE Mega2560
#define EEPROM_VARIANT 0
#elif defined(PCB9XR) && defined(CPUM128)
#define FLAVOUR "9xr128"
#define NAMESPACE M128XR
#define EEPROM_VARIANT 0x8003
#elif defined(PCB9X) && defined(CPUM128)
#define FLAVOUR "9x128"
#define NAMESPACE M128
#define EEPROM_VARIANT 0x8003
#elif defined(PCB9XR) && defined(CPUM64)
#define FLAVOUR "9xr"
#define NAMESPACE M64XR
#define EEPROM_VARIANT 0x0003
#elif defined(PCB9X) && defined(CPUM64)
#define FLAVOUR "9x"
#define NAMESPACE M64
#define EEPROM_VARIANT 0x0003
#else
#error "Unknown board"
#endif
#if defined __GNUC__
#define DLLEXPORT
#else
#define DLLEXPORT __declspec(dllexport)
#endif
namespace NAMESPACE {
class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
private:
@@ -68,7 +122,7 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0);
virtual uint8_t getSensorInstance(uint16_t id);
virtual uint16_t getSensorRatio(uint16_t id);
@@ -77,6 +131,9 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
virtual void installTraceHook(void (*callback)(const char *));
virtual void setLuaStateReloadPermanentScripts();
};
#endif // _OPENTX_SIMULATOR_H_
}
#endif
@@ -24,10 +24,9 @@
#undef min
#undef max
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define NUM_CSW 12
#define SWSRC_SW1 10
#define NUM_POTS 3
#define NUM_CSW 12
#define SWSRC_SW1 10
#include <exception>
#include <algorithm>
@@ -157,7 +156,7 @@ void simuSetKey(uint8_t key, bool state)
}
}
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
}
@@ -176,7 +175,8 @@ bool Th9xSimulator::timer10ms()
uint8_t * Th9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
+1 -1
View File
@@ -273,7 +273,7 @@ t_Th9xModelData::operator ModelData ()
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.customFn[0].func = FuncTrims2Offsets;
if (trimSw) {
c9x.customFn[0].swtch = trimSw;
@@ -123,7 +123,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(ALL_OK);
errors.set(NO_ERROR);
return errors.to_ulong();
}
+2 -2
View File
@@ -126,7 +126,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
if (xmlOK) {
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
if (!errors.test(ALL_OK)) {
if (!errors.test(NO_ERROR)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
}
else {
@@ -162,7 +162,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
}
else {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef FLASHEEPROMDIALOG_H_
#define FLASHEEPROMDIALOG_H_
#include <QtWidgets>
#include <QDialog>
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
+2 -2
View File
@@ -37,7 +37,7 @@ fwName(g.profile[g.id()].fwName())
ui->useProfileSplash->setDisabled(true);
}
if (IS_STM32(GetEepromInterface()->getBoard())) {
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
// No backup on Taranis ... could be done if in massstorage
ui->backupEEprom->hide();
ui->backupEEprom->setCheckState(Qt::Unchecked);
@@ -124,7 +124,7 @@ void FlashFirmwareDialog::on_firmwareLoad_clicked()
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) {
fwName = fileName;
if (!fwName.isEmpty() && !fwName.endsWith(".dfu") && !FirmwareInterface(fwName).isValid()) {
if (!fwName.isEmpty() && !FirmwareInterface(fwName).isValid()) {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fwName));
}
updateUI();
+3 -3
View File
@@ -1,17 +1,17 @@
#ifndef FLASH_FIRMWARE_DIALOG_H
#define FLASH_FIRMWARE_DIALOG_H
#include <QtWidgets>
#include <QtGui>
#include <QDialog>
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include "xmlinterface.h"
#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 EEPROM files (*.eepe);;"
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex *.dfu);;" BIN_FILES_FILTER HEX_FILES_FILTER DFU_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
+3 -4
View File
@@ -24,8 +24,7 @@ foreach(name ${generaledit_NAMES})
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
endforeach()
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
add_library(generaledit ${generaledit_SRCS})
qt5_use_modules(generaledit Widgets Xml Multimedia)
add_library(generaledit ${generaledit_SRCS})
+1 -1
View File
@@ -14,7 +14,7 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
layout->setContentsMargins(0, 0, 0, 0);
this->setLayout(layout);
tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
tableWidget->setColumnCount(3);
tableWidget->setShowGrid(false);
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
+41 -87
View File
@@ -1,3 +1,6 @@
#include <QDateTime>
#include <QtGui>
#include <QScrollArea>
#include "generaledit.h"
#include "ui_generaledit.h"
#include "helpers.h"
@@ -81,15 +84,12 @@ void GeneralEdit::on_calretrieve_PB_clicked()
{
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=GetCurrentFirmware()->getCapability(Pots);
if (calib.isEmpty()) {
return;
}
else {
QString trainercalib = g.profile[profile_id].trainerCalib();
QString hwtypes = g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
@@ -108,18 +108,22 @@ void GeneralEdit::on_calretrieve_PB_clicked()
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
Byte=calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok) generalSettings.calibMid[i]=byte16;
if (ok)
generalSettings.calibMid[i]=byte16;
Byte=calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok) generalSettings.calibSpanNeg[i]=byte16;
if (ok)
generalSettings.calibSpanNeg[i]=byte16;
Byte=calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok) generalSettings.calibSpanPos[i]=byte16;
if (ok)
generalSettings.calibSpanPos[i]=byte16;
}
for (int i=0; i<4; i++) {
Byte=trainercalib.mid(i*4,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok) generalSettings.trainer.calib[i]=byte16;
if (ok)
generalSettings.trainer.calib[i]=byte16;
}
generalSettings.txCurrentCalibration=txCurrentCalibration;
generalSettings.txVoltageCalibration=txVoltageCalibration;
@@ -132,48 +136,6 @@ void GeneralEdit::on_calretrieve_PB_clicked()
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
}
if (hwtypes.length()==numSwPots) {
QString Byte;
int16_t byte16;
QByteArray qba;
int16_t offset;
bool ok;
for (int i=0; i<NUM_STICKS; i++) {
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);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS),3).toLatin1();
if (ok) {
generalSettings.switchConfig[i]=byte16;
strcpy(generalSettings.switchName[i], qba.data());
}
}
offset = GetCurrentFirmware()->getCapability(Switches);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
if (ok) {
generalSettings.potConfig[i]=byte16;
strcpy(generalSettings.potName[i], qba.data());
}
}
offset += GetCurrentFirmware()->getCapability(Pots);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
if (ok) {
generalSettings.sliderConfig[i]=byte16;
strcpy(generalSettings.sliderName[i], qba.data());
}
}
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
}
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
generalSettings.stickMode=GSStickMode;
uint8_t byte8u;
@@ -181,35 +143,48 @@ void GeneralEdit::on_calretrieve_PB_clicked()
QString chars;
bool ok;
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
if (ok) generalSettings.optrexDisplay=(byte8==1 ? true : false);
if (ok)
generalSettings.optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok) generalSettings.contrast=byte8u;
if (ok)
generalSettings.contrast=byte8u;
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok) generalSettings.backlightBright=byte8u;
if (ok)
generalSettings.backlightBright=byte8u;
byte8=(int8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok) generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
if (ok)
generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
if (ok) generalSettings.beeperLength=byte8;
if (ok)
generalSettings.beeperLength=byte8;
byte8=(int8_t)HapticSet.mid(0,2).toUInt(&ok,16);
if (ok) generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
if (ok)
generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
byte8=(int8_t)HapticSet.mid(2,2).toInt(&ok,16);
if (ok) generalSettings.hapticStrength=byte8;
if (ok)
generalSettings.hapticStrength=byte8;
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
if (ok) generalSettings.hapticLength=byte8;
if (ok)
generalSettings.hapticLength=byte8;
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok) generalSettings.speakerMode=byte8u;
if (ok)
generalSettings.speakerMode=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok) generalSettings.speakerPitch=byte8u;
if (ok)
generalSettings.speakerPitch=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok) generalSettings.speakerVolume=byte8u;
if (ok)
generalSettings.speakerVolume=byte8u;
if (CountrySet.length()==6) {
byte8u=(uint8_t)CountrySet.mid(0,2).toUInt(&ok,16);
if (ok) generalSettings.countryCode=byte8u;
if (ok)
generalSettings.countryCode=byte8u;
byte8u=(uint8_t)CountrySet.mid(2,2).toUInt(&ok,16);
if (ok) generalSettings.imperial=byte8u;
if (ok)
generalSettings.imperial=byte8u;
chars=CountrySet.mid(4,2);
generalSettings.ttsLanguage[0]=chars[0].toLatin1();
generalSettings.ttsLanguage[1]=chars[1].toLatin1();
generalSettings.ttsLanguage[0]=chars[0].toAscii();
generalSettings.ttsLanguage[1]=chars[1].toAscii();
}
}
else {
@@ -225,15 +200,13 @@ 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=GetCurrentFirmware()->getCapability(Pots);
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
return;
}
else {
QString calib=g.profile[profile_id].stickPotCalib();
QString hwtypes=g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
if (!(calib.isEmpty())) {
int ret = QMessageBox::question(this, "Companion",
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
@@ -254,25 +227,6 @@ void GeneralEdit::on_calstore_PB_clicked()
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
}
g.profile[profile_id].trainerCalib( calib );
hwtypes.clear();
controlNames.clear();
for (int i=0; i<NUM_STICKS; i++) {
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(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++) {
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++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
}
g.profile[profile_id].controlTypes( hwtypes );
g.profile[profile_id].controlNames( controlNames );
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef GENERALEDIT_H
#define GENERALEDIT_H
#include <QtWidgets>
#include <QDialog>
#include "eeprominterface.h"
#include "genericpanel.h"
+4 -3
View File
@@ -1,5 +1,6 @@
#include "generalsetup.h"
#include "ui_generalsetup.h"
#include <QMessageBox>
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
@@ -274,8 +275,8 @@ void GeneralSetupPanel::populateBacklightCB()
void GeneralSetupPanel::populateVoiceLangCB()
{
QComboBox * b = ui->voiceLang_CB;
QString strings[] = { QObject::tr("English"), QObject::tr("Dutch"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), QObject::tr("Hungarian"), NULL};
QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", "hu", NULL};
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
b->clear();
for (int i=0; strings[i]!=NULL; i++) {
@@ -315,7 +316,7 @@ void GeneralSetupPanel::on_voiceLang_CB_currentIndexChanged(int index)
if (!lock) {
QString code = ui->voiceLang_CB->itemData(index).toString();
for (int i=0; i<2; i++) {
generalSettings.ttsLanguage[i] = code.at(i).toLatin1();
generalSettings.ttsLanguage[i] = code.at(i).toAscii();
}
generalSettings.ttsLanguage[2] = '\0';
emit modified();
+1 -1
View File
@@ -658,7 +658,7 @@
<item>
<widget class="QCheckBox" name="adjustRTC">
<property name="toolTip">
<string>Automatically adjust the radio's clock if a GPS is connected to telemetry.</string>
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
+16 -30
View File
@@ -86,7 +86,7 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
{
memset(dest, 0, length+1);
if (b->currentText() != "----") {
strncpy(dest, b->currentText().toLatin1(), length);
strncpy(dest, b->currentText().toAscii(), length);
}
}
@@ -103,7 +103,7 @@ void populatePhasesCB(QComboBox *b, int value)
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):
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
@@ -115,7 +115,7 @@ GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBo
lock(true)
{
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(*weightCB, weight, model);
populateGVCB(weightCB, weight);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
}
@@ -179,14 +179,13 @@ void GVarGroup::valuesChanged()
}
}
CurveGroup::CurveGroup(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QComboBox * curveValueCB, QSpinBox * curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags):
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
QObject(),
curveTypeCB(curveTypeCB),
curveGVarCB(curveGVarCB),
curveValueCB(curveValueCB),
curveValueSB(curveValueSB),
curve(curve),
model(model),
flags(flags),
lock(false),
lastType(-1)
@@ -220,7 +219,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);
populateGVCB(curveValueCB, curve.value);
}
curveValueCB->show();
curveValueSB->hide();
@@ -277,7 +276,6 @@ void CurveGroup::gvarCBChanged(int state)
if (!lock) {
if (state) {
curve.value = 10000+1; // TODO constant in EEpromInterface ...
lastType = -1; // quickfix for issue #3518: force refresh of curveValueCB at next update() to set current index to GV1
}
else {
curve.value = 0; // TODO could be better
@@ -480,39 +478,33 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
b->setMaxVisibleItems(10);
}
void populateGVCB(QComboBox & b, int value, const ModelData & model)
void populateGVCB(QComboBox *b, int value)
{
bool selected = false;
b.clear();
b->clear();
int count = GetCurrentFirmware()->getCapability(Gvars);
for (int i=-count; i<=-1; i++) {
int pgvars = GetCurrentFirmware()->getCapability(Gvars);
for (int i=-pgvars; 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);
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
if (value == gval) {
b.setCurrentIndex(b.count()-1);
b->setCurrentIndex(b->count()-1);
selected = true;
}
}
for (int i=1; i<=count; i++) {
for (int i=1; i<=pgvars; 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);
b->addItem(QObject::tr("GV%1").arg(i), gval);
if (value == gval) {
b.setCurrentIndex(b.count()-1);
b->setCurrentIndex(b->count()-1);
selected = true;
}
}
if (!selected) {
b.setCurrentIndex(count);
b->setCurrentIndex(pgvars);
}
}
@@ -798,13 +790,7 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
}
BoardEnum board = GetCurrentFirmware()->getBoard();
SimulatorDialog * sd;
if (board == BOARD_HORUS) {
sd = new SimulatorDialogHorus(parent, si, flags);
}
else if (board == BOARD_FLAMENCO) {
sd = new SimulatorDialogFlamenco(parent, si, flags);
}
else if (IS_TARANIS(board)) {
if (IS_TARANIS(board)) {
for (int i=0; i<GetCurrentFirmware()->getCapability(Pots); i++) {
if (radioData.generalSettings.isPotAvailable(i)) {
flags |= (SIMULATOR_FLAGS_S1 << i);
+5 -6
View File
@@ -1,8 +1,7 @@
#ifndef HELPERS_H
#define HELPERS_H
#include <QCheckBox>
#include <QSpinBox>
#include <QtGui>
#include <QTableWidget>
#include <QGridLayout>
#include <QDebug>
@@ -46,7 +45,7 @@ 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);
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -72,7 +71,7 @@ class CurveGroup : public QObject {
Q_OBJECT
public:
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags=0);
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
void update();
protected slots:
@@ -86,7 +85,6 @@ class CurveGroup : public QObject {
QComboBox *curveValueCB;
QSpinBox *curveValueSB;
CurveReference & curve;
const ModelData & model;
unsigned int flags;
bool lock;
int lastType;
@@ -119,7 +117,8 @@ 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 populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
void populateGVCB(QComboBox *b, int value);
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
QString image2qstring(QImage image);
int findmult(float value, float base);

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

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