Compare commits

...

694 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
Bertrand Songis d0d7135db4 Merge pull request #3068 from opentx/projectkk2glider/lua_split_files
Projectkk2glider/lua split files
2015-11-15 19:44:48 +01:00
Bertrand Songis 1ce0b71c5c Merge pull request #3073 from opentx/projectkk2glider/issue_3071
Fixes #3071: wrong telemetry unit and precision was used for V2 in lo…
2015-11-15 19:41:45 +01:00
Damjan Adamic 109faf8989 Fixes #3071: wrong telemetry unit and precision was used for V2 in logical switches (radios with ARM CPU other than Taranis) 2015-11-15 17:58:10 +01:00
Damjan Adamic 754b875d81 Re #3054: Lua byte-code of every loaded script is dumped to a file if LUA_COMPILER=YES is defined (only for simu target. Original code author (dsbeach) 2015-11-15 16:32:12 +01:00
Damjan Adamic 2572ed0eba Removed unnecessary FILINFO 2015-11-15 16:20:32 +01:00
Damjan Adamic feac6d000f Companion build fixed (stamp duplication removed) 2015-11-15 13:19:26 +01:00
Damjan Adamic 4a60c8aa6e Lua exports moved to lua dir 2015-11-15 12:12:24 +01:00
Damjan Adamic d54f25ccba Lua api and interface lua_api.cpp moved to lua dir and split into several files 2015-11-15 12:05:53 +01:00
Bertrand Songis 2f03e2c4ad Update DONATIONS.txt 2015-11-15 10:03:54 +01:00
Damjan Adamic c92d88b664 Lua documentation update 2015-11-15 09:50:53 +01:00
Bertrand Songis b666892da4 Merge pull request #3065 from opentx/projectkk2glider/autogen_lua_docs_2
Projectkk2glider/autogen lua docs 2
2015-11-14 18:47:18 +01:00
Bertrand Songis 52809b51b9 Update DONATIONS.txt 2015-11-14 17:20:11 +01:00
Damjan Adamic 1a399a649d Typos 2015-11-13 20:00:46 +01:00
Damjan Adamic 0f246d2f39 More docs 2015-11-13 19:48:32 +01:00
Damjan Adamic e5ef862729 Docs added 2015-11-13 18:50:43 +01:00
Damjan Adamic e6546af9b1 Fixes #2947: luaGetVersion() upgraded to also return the radio type.
Start of Lua API documentation that can be parsed with a custom script that generates gitbook documentation
2015-11-13 18:50:43 +01:00
Andre Bernet feb98816ec Hide switch field for FM0 2015-11-13 19:37:27 +04:00
Andre Bernet 71411fcb62 LR12 protocol actually doesn't support remote failsafe configuration 2015-11-13 19:26:34 +04:00
Damjan Adamic d5824f5719 Re #3043: Air speed unit typo corrected in parser 2015-11-13 00:19:08 +01:00
Bertrand Songis f875aec72b Update DONATIONS.txt 2015-11-12 19:29:25 +01:00
Bertrand Songis 1b7e62a1f0 Merge pull request #3060 from opentx/projectkk2glider/issue_3059_speed_conversions
Fixes #3059: added unit conversions from km/h
2015-11-12 18:53:02 +01:00
Damjan Adamic ef5746de11 Re #3043: added Air speed parser 2015-11-12 18:47:32 +01:00
Damjan Adamic 454a664d01 Re #3059: table lookup used for unit conversion, saved some 50 bytes of FLASH 2015-11-12 14:53:00 +01:00
Damjan Adamic 58edcc3af8 Fixes #3059: added unit conversions from km/h 2015-11-12 13:55:24 +01:00
Bertrand Songis 09846ca917 Update DONATIONS.txt 2015-11-11 21:43:12 +01:00
Bertrand Songis 2b2f34af29 Release note for 2.1.6 updated 2015-11-11 10:42:20 +01:00
Bertrand Songis a06d405a2c Update DONATIONS.txt 2015-11-11 10:26:55 +01:00
Bertrand Songis 429490eb86 Switch to 2.1.6 2015-11-11 10:24:58 +01:00
Bertrand Songis c73a8bac25 [Taranis X9E] Problem of impossible shutdown on some radios 2015-11-11 10:23:53 +01:00
Damjan Adamic f854442c79 Fixes #3047:
* negative altitude on top bar was displayed wrong (same bug affected vertical speed)
* add ability to select an altitude sensor with ft unit for top bar
* display actual sensor unit for top bar altitude
2015-11-10 18:01:42 +01: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
Andre Bernet a1d44d4d9f Telemetry custom screen changes didn't emit modified signal (Fix #3029) 2015-11-07 21:14:48 +01:00
Andre Bernet cc2fcce559 Hide D8/LR12 in companion when eu firmware option is selected 2015-11-07 08:35:47 +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
Bertrand Songis a4869cdb8a Update releasenotes.txt 2015-11-05 19:01:08 +01:00
Bertrand Songis 333d7f1ac1 Update releasenotes.txt 2015-11-05 19:00:40 +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
martin 380f435cf2 CZ translations 2015-11-04 23:19:50 +01:00
Andre Bernet 5805c0904a French translations 2015-11-04 21:27:56 +01:00
Damjan Adamic cd2be28aab Typo in release notes 2015-11-04 19:23:54 +01:00
Damjan Adamic d038a0379b Release notes updated, release set to 2015-11-04 2015-11-04 19:14:51 +01:00
David S. Beach 40e5657387 Fixes #3024 2015-11-03 08:16:46 -05:00
Bertrand Songis aa24bd72ff Merge pull request #3022 from opentx/kilrah/protocol_fixes
Kilrah/protocol fixes
2015-11-02 00:42:39 +01:00
Andre Bernet a11884522a Missing else 2015-11-01 14:16:27 +04:00
Andre Bernet 58216ec8b0 Add channel names on companion failsafe sliders (fix #3021), remove redundant stuff 2015-11-01 14:06:49 +04:00
Andre Bernet 1641db873d Had forgotten to add the shift in channel names on failsafe setup page 2015-11-01 14:03:19 +04:00
Andre Bernet b1ec421b02 Disable trainer/battery compartment if UART mode not appropriate (#
2994)
2015-11-01 13:00:36 +04:00
Andre Bernet 5119448170 Companion support for Taranis internal PPM, remove disabled DJT choice for stock board 2015-11-01 12:26:15 +04:00
Andre Bernet 0d6d309362 Move available protocol list from EEPROMinterface to Firmware class 2015-11-01 12:22:36 +04:00
Damjan Adamic b56e107e25 Release notes updated 2015-10-31 20:22:14 +01:00
Bertrand Songis 473ddcb56d Update DONATIONS.txt 2015-10-31 18:49:57 +01:00
Bertrand Songis 484583106c Merge pull request #3011 from opentx/projectkk2glider/lua_io_issues
Projectkk2glider/lua io issues
2015-10-31 18:48:53 +01:00
Bertrand Songis 7138c7c0e4 Merge pull request #3019 from opentx/jtaylor2/issue_3012
Remove __CYGWIN__ from Issue 3012 Windows pathing fix because Cygwin
2015-10-31 18:48:25 +01:00
jtaylor2 dcebac87b9 Remove __CYGWIN__ from Issue 3012 Windows pathing fix because Cygwin
uses posix pathing and not Windows pathing.
2015-10-31 10:22:11 -04:00
Andre Bernet 8b419770e2 Harmonise module default channel count 2015-10-31 11:25:35 +04:00
Andre Bernet 3d29b8e7e5 Missing default for internal module type (Fix #3017) 2015-10-31 11:24:05 +04:00
Andre Bernet 22c429a1a7 Also search for simulators in companion.exe path on Windows (Fix #3012) 2015-10-31 10:17:43 +04:00
Damjan Adamic 3b4a6fb49b Fixes #3016: Changing the trainer port setting did not set the model modified flag 2015-10-30 22:01:19 +01:00
Damjan Adamic 3dc7e66ba7 Small fix in cli: main stack size reported wrong 2015-10-30 18:20:05 +01:00
Bertrand Songis fbc2def259 Update DONATIONS.txt 2015-10-30 14:59:45 +01:00
Andre Bernet 08ff104d26 Correct failsafe mapping (fix #2975) 2015-10-30 13:08:26 +04:00
Bertrand Songis b65fa29e1d Update DONATIONS.txt 2015-10-29 18:03:23 +01:00
Bertrand Songis b3073e104b Update DONATIONS.txt 2015-10-28 18:21:57 +01:00
Andre Bernet 22b17c64ff Semantics 2015-10-28 20:04:06 +04:00
Damjan Adamic 2e068044c6 Fixes #3003: Lua io.write() did not support numbers 2015-10-27 23:59:18 +01:00
Damjan Adamic d3e2a00cd2 Re #3001: f_open() did not support append mode (in simulator only) 2015-10-27 23:59:18 +01:00
Damjan Adamic 2feb5ac894 Fixes #3001: Lua io.open() could not create new files 2015-10-27 23:59:18 +01:00
Bertrand Songis 6f30718745 Update DONATIONS.txt 2015-10-27 18:44:53 +01: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
Bertrand Songis 16e7dbbb94 [Taranis X9E] Trainer cable always considered as plugged 2015-10-26 19:47:57 +01:00
Bertrand Songis 942148fc5c Another attempt to fix #2722 2015-10-26 19:20:53 +01:00
Bertrand Songis 088f4d5e3f [Taranis] The trainer icon will be shown only if valid PPM is received 2015-10-26 19:19:49 +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 756441bc50 [9XR-PRO] Battgraph reduced (seemed not 100% when battery full) 2015-10-26 07:21:36 +01:00
Bertrand Songis 7c0767144f [9XR-PRO] Bug when searching EEPROM Fat 2015-10-25 23:25:18 +01:00
Bertrand Songis 95040234b3 Another attempt to fix #2722 2015-10-25 21:57:25 +01:00
Bertrand Songis d5e2cac813 Columns resized (some dynamically, some statically) 2015-10-25 21:48:52 +01:00
Andre Bernet 01226b612a No PPM options are available if trainer mode is master (fix #2994) 2015-10-25 23:32:21 +04:00
Bertrand Songis 47ea418d5b Fix for #2722. Needs tests. 2015-10-25 12:36:46 +01:00
Bertrand Songis 2aa2b41f3a Fixes #2989 2015-10-25 11:49:29 +01:00
Bertrand Songis 85a5554922 [Taranis] Scrollbar wrong position sometimes in Model Setup 2015-10-25 11:09:08 +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
dsbeach 6cbe780d57 Adding include for dirent.h for MSVC builds 2015-10-24 15:57:30 -04:00
Damjan Adamic cd4d6afff8 findTrueFileName() memory leak fixed 2015-10-24 20:33:14 +02:00
Damjan Adamic 2a54bee20b Simulators and firmwares unregistered when application ends (fixes memory leaks) 2015-10-24 20:10:17 +02:00
Damjan Adamic ee4ea18a3e Re #2987: read_file_system_list() return value memory leak fixed 2015-10-24 19:53:41 +02:00
Damjan Adamic d38cf06b07 File stripping disabled to improve user trace-backs 2015-10-24 19:09:29 +02:00
Damjan Adamic 54891af0d2 Move to 2.1.5 (we are skipping 2.1.4 to differentiate from the FrSky's 2.1.4) 2015-10-24 18:59:45 +02:00
Damjan Adamic 022bd2d3da Re #1915: "Start Logs" changed to "SD Logs" (again) 2015-10-24 10:26:18 +02:00
Bertrand Songis dd88490d00 Update DONATIONS.txt 2015-10-22 23:10:10 +02:00
JivaroFAD 018a022c35 M2560 PPM_IN correction + bootloader source 2015-10-21 17:47:13 +02:00
JivaroFAD 1668507114 Cosmetics after pull #2828 2015-10-21 13:48:15 +02:00
Bertrand Songis 580dc6d2de Merge pull request #2983 from opentx/driver33/PL_TR
Translation up to date
2015-10-21 07:14:25 +02:00
Bertrand Songis ebe4ed19c5 Update DONATIONS.txt 2015-10-21 07:12:15 +02:00
Franck Aguerre bc08d95576 Merge pull request #2828 from tmrttmrt/tmrttmrt/Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow
Tmrttmrt/fixes#2750  mega2560 st7920 mixer freq too slow
2015-10-20 23:22:35 +02:00
driver33 319b8695d5 Translation up to date 2015-10-20 16:54:27 +02:00
Bertrand Songis 768b255d7d Update DONATIONS.txt 2015-10-19 19:36:32 +02:00
Bertrand Songis aa88651e0a [9XR-PRO] Missing delay in LCD initialization. Will it fix #2852?
I need confirmation from a 9XR-PRO user. I had the bug one time
yesterday but I cannot reproduce ...
2015-10-19 19:35:37 +02:00
Bertrand Songis 9463f49ba1 Fixes #2797 - Model Restore broken on Sky9X / 9XR-PRO
It seems I am not allowed to write the 4bytes header separately. It's
overwritten by 4 zeroes at the next write.
2015-10-19 07:56:10 +02:00
Bertrand Songis cee3559aac Merge pull request #2979 from opentx/projectkk2glider/telemetryItems_protection
Out of bounds protection for telemetryItems[] array access and some c…
2015-10-18 18:00:43 +02:00
Damjan Adamic 082ba0893d Out of bounds protection for telemetryItems[] array access and some code refactoring for telemetry value precision 2015-10-18 12:06:25 +02:00
Damjan Adamic 4ef9913f76 Re #2956: Voltage symbol changed to upper case (ported from 2.0) 2015-10-18 09:46:08 +02:00
Bertrand Songis 21a67b82d4 Update DONATIONS.txt 2015-10-15 20:28:17 +02:00
Bertrand Songis 701082f012 [S.Port] New IDs for FrSky Powerbox 2015-10-14 20:52:29 +02:00
Andre Bernet dad1a06344 Remove redundant init (done in pwrInit()) 2015-10-14 10:30:52 +04:00
Bertrand Songis 8976afe3bc VC++ compilation fix 2015-10-14 07:13:29 +02:00
Bertrand Songis e326cb8515 Update DONATIONS.txt 2015-10-13 19:41:07 +02:00
Damjan Adamic dc4a434076 Release notes updated 2015-10-13 19:22:53 +02:00
Bertrand Songis 9ae7aea7bb Fixes #2837 2015-10-13 15:46:37 +02:00
Bertrand Songis dcbc20f1c0 Fixes #2876 2015-10-13 15:14:21 +02:00
Bertrand Songis 1acd23bf8c Fixes #2942 - Needs more tests
This bug was introduced when fixing #2787, I would like to be sure I
don't reintroduce a bug there now...
2015-10-13 15:04:59 +02:00
Bertrand Songis f98bf5e678 Update DONATIONS.txt 2015-10-13 12:04:05 +02:00
Bertrand Songis 60eca69bfe Fixes #2961 2015-10-12 23:29:52 +02:00
Bertrand Songis 7297669c4b Fixes #2951 2015-10-12 23:17:18 +02:00
Bertrand Songis ad63f7e7f7 Cosmetics 2015-10-12 23:02:53 +02:00
Bertrand Songis da8c0297c4 [CLI] Function "print time" added 2015-10-12 23:02:13 +02:00
Damjan Adamic cd16b4da0e Compilation fix for X9E 2015-10-12 22:52:57 +02:00
Damjan Adamic 94efa965da pass[] data type optimization 2015-10-12 22:30:21 +02:00
Damjan Adamic cb5bb83067 Fixes #2945: fixed bad alignment of modulePulsesData 2015-10-12 22:21:45 +02:00
Bertrand Songis 98abd4ec08 Merge pull request #2955 from ptsneves/master
Corrected ambiguity in ZSTR_TEMP referring to both TEMP1_ID and TEMP2…
2015-10-12 19:16:06 +02:00
Bertrand Songis 1cc3fedaf2 Update DONATIONS.txt 2015-10-12 19:14:53 +02:00
Executive 2f378d83d6 Corrected ambiguity in ZSTR_TEMP referring to both TEMP1_ID and TEMP2_ID. 2015-10-12 14:13:43 +01:00
Bertrand Songis 22f4f18071 Merge pull request #2965 from opentx/driver33/PL_TR
Up to date translation
2015-10-12 07:31:57 +02:00
driver33 268fc43fbd Up to date translation 2015-10-12 00:08:45 +02:00
Bertrand Songis 637d20a66d Compilation fix 2015-10-11 23:25:58 +02:00
Bertrand Songis 48a11f63ea [Taranis] DEBUG=YES without CLI=YES didn't compile 2015-10-11 22:39:38 +02:00
Bertrand Songis 30f5b1b275 Fixes #2913 2015-10-11 12:50:10 +02:00
Bertrand Songis e8680c32b0 Merge pull request #2957 from opentx/projectkk2glider/issue_2936_sh_sf_two_pos
Fixes #2936: 3POS type removed from SH and SF switches (hw only suppo…
2015-10-11 00:19:33 +02:00
Damjan Adamic 21760a3960 Fixes #2936: 3POS type removed from SH and SF switches (hw only supports 2POS type) 2015-10-10 16:38:04 +02:00
Damjan Adamic a30ddb7437 Fixes #2934: shortened screen-shot file name (screen-2013-01-01-123540.bmp), also affects EEPROM backup which uses same time-stamp generation function. 2015-10-10 12:48:49 +02:00
Bertrand Songis f4dc2caedf Update DONATIONS.txt 2015-10-10 07:46:42 +02:00
Bertrand Songis 0d9f011a4e Update DONATIONS.txt 2015-10-08 19:50:12 +02:00
Bertrand Songis 03ff929ef7 Update DONATIONS.txt 2015-10-07 18:55:51 +02:00
Bertrand Songis 3849121098 Update DONATIONS.txt 2015-10-06 23:42:37 +02:00
Bertrand Songis 66f473b8b6 Update DONATIONS.txt 2015-10-05 19:12:00 +02:00
Bertrand Songis 6af4d09345 Update DONATIONS.txt 2015-10-05 07:09:02 +02:00
Bertrand Songis e3dee13cb3 Update DONATIONS.txt 2015-10-03 12:20:52 +02:00
Bertrand Songis 7a01f04f49 Update DONATIONS.txt 2015-10-02 07:06:26 +02:00
Bertrand Songis b46fd48de6 Update DONATIONS.txt 2015-10-02 07:06:10 +02:00
Bertrand Songis d7d38cd076 Update DONATIONS.txt 2015-10-01 19:45:24 +02:00
Tomaz Mertelj 8e0adbe602 Merge branch 'master' of https://github.com/tmrttmrt/opentx into tmrttmrt/Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow 2015-09-30 22:09:16 +02:00
tmertelj 11753450ae Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow 2015-09-30 21:28:30 +02:00
Bertrand Songis bb1d368c03 Merge pull request #2933 from hrenz/patch-11
Patch 11 for 9XR-Pro with XJT-Modul and Telemetrie some Strings changed
2015-09-27 11:12:42 +02:00
hrenz 3231c0506f update for 9XR-Pro and some strings changed 2015-09-27 09:47:28 +02:00
hrenz 1b74d5a061 update only for X9R-pro somen strings changed 2015-09-27 08:01:32 +02:00
Bertrand Songis 7ec4f508ee Merge pull request #2930 from opentx/bsongis/issue1914_by_dsbeach
Bsongis/issue1914 by dsbeach
2015-09-26 10:07:51 +02:00
Bertrand Songis 60f2535212 Fixes #1914 2015-09-26 09:00:36 +02:00
Bertrand Songis 3f6e1d0b3a Lua error display function reused 2015-09-26 09:00:36 +02:00
David S. Beach e57361f7e1 2.1.x implementation of displayLuaScriptError() 2015-09-26 09:00:36 +02:00
Bertrand Songis 436b5003d9 Update README.md 2015-09-26 08:16:39 +02:00
Bertrand Songis 1dfa03d77d Update README.md 2015-09-26 08:14:24 +02:00
Markus Sattler 1d6adcc25a Fixes #2870 2015-09-26 07:59:04 +02:00
Bertrand Songis b48946b3aa Revert "Unused string removed"
This reverts commit b50c452500.
2015-09-25 17:02:22 +02:00
Bertrand Songis b50c452500 Unused string removed 2015-09-25 16:48:03 +02:00
Bertrand Songis e55466894c Merge pull request #2929 from opentx/projectkk2glider/issue_2925_lcd_line_fixes
Fixes #2925: added coordinate check in lcd_line()
2015-09-25 16:36:43 +02:00
Damjan Adamic a38e9f6d3a Fixes #2925: added coordinate check in lcd_line() 2015-09-25 13:13:21 +02:00
Andre Bernet de4a5c586d Navigation bug (should fix #2924) 2015-09-25 11:56:33 +02:00
Andre Bernet 455f9bfde2 Some defaults missing when changing telemetry formula, update propagation issues (fix #2928) 2015-09-25 10:47:46 +02:00
Bertrand Songis 9f25c7a0b6 Cosmetics 2015-09-25 07:22:34 +02:00
Bertrand Songis 02dbe6bcac Fixes #1905 2015-09-25 07:22:21 +02:00
Bertrand Songis 6fe12ba625 Cosmetics 2015-09-24 18:31:30 +02:00
Bertrand Songis cd794e986a Merge pull request #2926 from opentx/driver33/PL_TR
1. Translation up to date. 2. Fixes in sound grammar file - time values
2015-09-24 07:09:03 +02:00
driver33 3aba306de9 1. Translation up to date. 2. Fixes in sound grammar file - time values 2015-09-23 23:50:35 +02:00
Bertrand Songis 412d8131f7 Merge pull request #2922 from opentx/projectkk2glider/issue_2912_fr_tts_missing_sounds
Fixes #2912: added missing "midtrim" and "endtrim" to FR
2015-09-23 19:27:26 +02:00
Bertrand Songis daac7e6bf2 Merge pull request #2923 from opentx/projectkk2glider/issue_2920_translations_fixes
Projectkk2glider/issue 2920 translations fixes
2015-09-23 19:26:45 +02:00
Bertrand Songis b7bf6c5be7 Update DONATIONS.txt 2015-09-23 19:01:14 +02:00
Damjan Adamic cc28219760 Re #2912: translated trim strings 2015-09-23 15:21:16 +02:00
Damjan Adamic 5d9f168003 Re #2920: dropped obsolete translations 2015-09-23 15:13:10 +02:00
Damjan Adamic d1dbe6efce Re #2920: translations updated 2015-09-23 15:07:36 +02:00
Damjan Adamic 22a50041e3 Fixes #2920: typo in "Slow" 2015-09-23 15:07:20 +02:00
Damjan Adamic ea74e31841 Fixes #2912: added missing "midtrim" and "endtrim" to FR 2015-09-23 14:47:13 +02:00
Bertrand Songis cdc66a7d01 Wrong constant used in trainer driver (actually it is the same value) 2015-09-23 07:20:54 +02:00
Bertrand Songis a5f94e17eb Update DONATIONS.txt 2015-09-23 07:05:18 +02:00
Bertrand Songis be84af5f84 Merge pull request #2911 from opentx/bsongis/issue2753_missing_functions_in_companion
Fixes #2753 - Missing functions in Companion
2015-09-22 22:29:42 +02:00
Bertrand Songis 02b72befdb Update DONATIONS.txt 2015-09-22 07:05:48 +02:00
Bertrand Songis 5f343b4a6e Update DONATIONS.txt 2015-09-21 20:47:18 +02:00
Bertrand Songis 7f8211ada5 Fixes #2753 - Missing functions in Companion 2015-09-21 07:17:56 +02:00
Bertrand Songis a3584e56f4 Merge pull request #2910 from opentx/projectkk2glider/issue_2908_frsky_d_refactoring
Projectkk2glider/issue 2908 frsky d refactoring
2015-09-20 20:38:18 +02:00
Damjan Adamic 106702342d Re #2908: Companion build fixed 2015-09-20 19:13:54 +02:00
Damjan Adamic 701af4984b Re #2908: compiler warnings treated as errors (use build option WARNINGS_AS_ERRORS=YES), enabled in commit tests for several platforms (where it passes) 2015-09-20 13:38:35 +02:00
Damjan Adamic bfc01f9504 Re #2908: frsky_d.cpp split into ARM and nonARM files, ARM Frsky alarms code removed completely 2015-09-20 13:08:41 +02:00
Bertrand Songis 18ffe9f503 Merge pull request #2909 from opentx/projectkk2glider/issue_2905_mavlink_broken
Fixes #2950: Mavlink build option was not working
2015-09-20 12:02:35 +02:00
Damjan Adamic 407289e1d1 Fixes #2950: Mavlink build option was not working 2015-09-20 11:47:21 +02:00
Bertrand Songis 6bffe4aa80 Merge pull request #2897 from opentx/driver33/PL_TR
Keeping translation clean and up to date
2015-09-20 11:41:11 +02:00
Bertrand Songis 1aa5143677 Merge pull request #2899 from opentx/bsongis/issue2880_ppm_center_for_dsm2
Fixes #2880 - PPM_CENTER should be ok now with DSM2 pulses
2015-09-20 11:40:35 +02:00
Bertrand Songis 0f6bee2273 Merge pull request #2907 from opentx/bsongis/commit_tests_moved_to_travis
Commit tests moved to Travis
2015-09-20 10:33:02 +02:00
Bertrand Songis 71aa066b99 Commit tests moved to Travis 2015-09-20 10:08:56 +02:00
Damjan Adamic 96a2e18833 Release notes updated 2015-09-19 21:38:37 +02:00
Bertrand Songis d63ac41b6a Merge pull request #2901 from opentx/projectkk2glider/issue_2896_curves_without_files
Fixes #2896: draw curves without using temporary disk files
2015-09-19 20:41:56 +02:00
Damjan Adamic 365d2b6c58 Fixes #2896: draw curves without using temporary disk files 2015-09-19 18:19:08 +02:00
Bertrand Songis 6389f977bc Fixes #2880 - PPM_CENTER should be ok now with DSM2 pulses 2015-09-19 10:44:55 +02:00
Bertrand Songis 7134f38ad5 Update DONATIONS.txt 2015-09-18 23:47:04 +02:00
driver33 aab8fc8a96 Keeping translation clean and up to date 2015-09-18 14:59:40 +02:00
Bertrand Songis 0c39ed3488 Next VC++ errors fixed 2015-09-18 07:15:45 +02:00
Bertrand Songis a142a74c36 Next VC++ errors fixed 2015-09-17 22:50:12 +02:00
Bertrand Songis 9f8a1d5f97 Try to fix VC++ errors 2015-09-17 22:37:53 +02:00
Bertrand Songis e65c131c75 Fixes #2843 2015-09-17 18:23:18 +02:00
Bertrand Songis 552e730065 Update DONATIONS.txt 2015-09-17 18:06:06 +02:00
Bertrand Songis dbc0d764e1 Merge pull request #2887 from opentx/bsongis/issue2850_top_lcd_timer_configuration
Fixes #2850
2015-09-17 07:32:08 +02:00
Bertrand Songis 5cebe43306 Merge pull request #2890 from opentx/griebd/refactoring_between_eeprom_and_gui_2778
New interface between eeprominterface and gui.
2015-09-17 07:13:03 +02:00
Grieb 646cc937ac Fixes #2778. 2015-09-16 22:29:34 -03:00
Grieb 6d52039266 Refactoring to have messages in Companion when opening eeprom. 2015-09-16 22:29:28 -03:00
Bertrand Songis 14967b6a94 Update DONATIONS.txt 2015-09-16 21:59:39 +02:00
Bertrand Songis b9ce8df5b6 Fixes #2850 2015-09-16 21:47:47 +02:00
Bertrand Songis cae807499b Jenkins compilation fix 2015-09-16 20:45:16 +02:00
Bertrand Songis df0c0808b0 Warnings removed 2015-09-16 20:44:08 +02:00
Bertrand Songis 064c58d858 Gtests false positive
SYSTEM_RESET function added to avoid this kind of error
2015-09-16 20:35:37 +02:00
Bertrand Songis 9af87b228c Fixes #2855 again. Now with a non regression test ;) 2015-09-16 19:24:39 +02:00
Bertrand Songis 9eae49eed3 Merge pull request #2886 from opentx/driver33/polish_translation
Translation fixes
2015-09-16 19:13:13 +02:00
driver33 92310fff5f Translation fixes 2015-09-16 18:58:55 +02:00
Bertrand Songis 3d7c71d3ce Update DONATIONS.txt 2015-09-16 18:44:19 +02:00
Bertrand Songis cd0f24fd8c Update README.md 2015-09-16 18:41:56 +02:00
Bertrand Songis c1c3289b02 Integration with Travis 2015-09-16 18:38:24 +02:00
Bertrand Songis b13b3467af Merge pull request #2883 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-09-15 20:13:57 +02:00
The Gitter Badger 0569d5b880 Add Gitter badge 2015-09-15 18:05:54 +00:00
Bertrand Songis 80bf502b11 Fixes #2736 2015-09-15 07:07:37 +02:00
Bertrand Songis fbb5adcebb Fixes #2875 2015-09-14 21:35:02 +02:00
Bertrand Songis 3aac623a4b Update DONATIONS.txt 2015-09-14 20:14:28 +02:00
Bertrand Songis 10f5bd211b Fixes compilation in 'next' 2015-09-14 20:12:22 +02:00
Bertrand Songis 3387395932 Fixes #2855 2015-09-14 06:40:35 +02:00
Bertrand Songis c269b2ceff Merge pull request #2865 from hrenz/patch-10
update German openTx for V2.1.4  at 12.09.2015
2015-09-12 09:00:14 +02:00
hrenz 20c6edd58e update German openTx for V2.1.4 at 12.09.2015
only some strings changed for
X9D X9E 9XR-pro
2015-09-12 08:12:44 +02:00
Bertrand Songis 4854ffa683 Fixes #2855 2015-09-11 16:45:00 +02:00
Bertrand Songis 0baad9e393 Update DONATIONS.txt 2015-09-10 23:52:41 +02:00
Bertrand Songis 3ddcd3050e --version argument in companion 2015-09-09 17:45:40 +02:00
Bertrand Songis ed86c5e16c Move to 2.1.4 2015-09-09 17:45:40 +02:00
Bertrand Songis 2030bf7599 Update DONATIONS.txt 2015-09-09 15:25:40 +02:00
Bertrand Songis 4571ed2438 Fixes #2855 - Logical Switches now
Test needed please!
2015-09-09 15:20:43 +02:00
Andre Bernet b46bb9b5cf Companion translations 2015-09-09 11:07:37 +02:00
Bertrand Songis 2d4db9604a Translations problem in print model functions 2015-09-09 11:02:45 +02:00
Andre Bernet b65d716029 Release notes updated 2015-09-09 10:51:39 +02:00
Bertrand Songis 259a42bfdc Fixes #2855 2015-09-09 09:33:25 +02:00
Bertrand Songis 562c879751 Jenkins commit tests now stored in the repo 2015-09-09 09:03:33 +02:00
Bertrand Songis 746dbe22b8 Inversion between TIMER_MIN and TIMER_MAX!!! 2015-09-08 20:34:10 +02:00
Bertrand Songis 2a49e98a80 Update DONATIONS.txt 2015-09-08 20:15:04 +02:00
Bertrand Songis 20ee2318cd Fixes #2851 2015-09-08 20:13:17 +02:00
Bertrand Songis 21ac2eca88 Should fix #2848 - Worst case fixes a warning. 2015-09-08 19:29:11 +02:00
Bertrand Songis afdff355de Switch to 2.1.3 2015-09-08 19:22:16 +02:00
Bertrand Songis 3f14a25852 Warning removed 2015-09-08 19:19:38 +02:00
Bertrand Songis abc48390ca Fixes #2847 2015-09-08 19:09:16 +02:00
Andre Bernet 8dd5ebf053 Release notes updated Added note about throttle source 2015-09-08 10:03:06 +02:00
Bertrand Songis 65c9ae6bfd Merge pull request #2846 from opentx/MicheleVilla/FW_IT_Translations
Update it.h.txt
2015-09-07 22:29:12 +02:00
Andre Bernet 5188645313 Remove duplicate option 2015-09-07 22:28:29 +02:00
Michele 2260cde321 Update it.h.txt 2015-09-07 22:20:24 +02:00
Andre Bernet f76f7a6ad4 Companion translations 2015-09-07 22:11:07 +02:00
Andre Bernet 33c694f5a3 Release notes updated 2015-09-07 22:06:51 +02:00
Bertrand Songis a8890b11e0 [Companion] CLI option added 2015-09-07 21:54:07 +02:00
Bertrand Songis c8525b311f Fixes #2844 2015-09-07 21:46:12 +02:00
Bertrand Songis 99d3afbe1a Warning removed 2015-09-07 21:46:12 +02:00
Andre Bernet 1f1a88a06c Release notes updated 2015-09-07 21:06:29 +02:00
Andre Bernet bf6b5cc389 Release notes updated 2015-09-07 20:56:41 +02:00
Bertrand Songis 9967aab3dd Update DONATIONS.txt 2015-09-06 23:02:53 +02:00
mhotar 2fef5f3e78 CZ translation 2015-09-06 22:46:10 +02:00
Bertrand Songis d3edecb133 Merge pull request #2842 from opentx/driver33/PL_TR
Fixes in traslations
2015-09-06 21:04:52 +02:00
driver33 6ecf4ec6a0 Fixes in traslations 2015-09-06 20:58:07 +02:00
mhotar 57bc32edf5 Logo added to the lib 2015-09-06 20:56:23 +02:00
mhotar 5beeb208be CZ translation 2015-09-06 20:33:05 +02:00
Andre Bernet 2bf3f80364 Merge pull request #2834 from opentx/jtaylor2/issue_-2762
Telemetry simulator improvements (fix #2762)
2015-09-06 19:42:03 +02:00
Andre Bernet 3c0ed1350a Remove obsolete code 2015-09-06 19:34:56 +02:00
Bertrand Songis 2625e05953 Merge pull request #2841 from opentx/kilrah/ar9x
Support for AR9X board
2015-09-06 19:27:18 +02:00
Andre Bernet 461d994dea Cosmetics 2015-09-06 18:15:37 +02:00
Andre Bernet c2ee6d2eaf Disable volume/rtc options for now, not implemented yet 2015-09-06 16:51:02 +02:00
Bertrand Songis ebad326256 [9X] Model not stored on EEPROM upon creation
When TEMPLATES option disabled...
2015-09-06 16:39:16 +02:00
Bertrand Songis 3dc47f39ea Update DONATIONS.txt 2015-09-06 16:27:43 +02:00
Bertrand Songis aaacfb0888 [9XR-PRO] Navigation problem in Modelsel screen 2015-09-06 16:26:52 +02:00
Andre Bernet 45d22c83d4 AR9X simu added 2015-09-06 16:03:08 +02:00
Andre Bernet 45801a89ea Merge branch 'master' into kilrah/ar9x 2015-09-06 14:47:26 +02:00
Bertrand Songis 1a1f175ac1 Bars display problem on 9XR-PRO 2015-09-06 13:41:25 +02:00
Bertrand Songis 922ff5622f Merge pull request #2840 from opentx/driver33/polish_translation_2.1.x
Translation fixes for new features in 2.1.2
2015-09-06 13:25:54 +02:00
driver33 b4a8caba1c Translation fixes for new features in 2.1.2 2015-09-06 12:57:47 +02:00
Andre Bernet bab02ce9f7 French translations 2015-09-06 12:54:54 +02:00
Andre Bernet 3a09fb3777 NL translations (fix #2839) 2015-09-06 12:45:26 +02:00
Andre Bernet 7caa7f8144 French translations 2015-09-06 12:31:19 +02:00
Andre Bernet 1d9e2b7ad0 Merge remote-tracking branch 'origin/bsongis/refactoring_putsSwitches' 2015-09-06 12:16:58 +02:00
Andre Bernet 2a3e690373 Merge branch 'issue2780' 2015-09-06 12:14:42 +02:00
Andre Bernet 3f48f28079 Merge remote-tracking branch 'origin/bsongis/issue2418_better_fix' 2015-09-06 12:09:48 +02:00
Bertrand Songis 9083b1f35c Fixes #2805 2015-09-06 12:00:58 +02:00
Bertrand Songis a18ff7b502 Fixes #2800 2015-09-06 12:00:30 +02:00
Andre Bernet 0460b892d8 Companion translations updated for translators without build environment 2015-09-06 11:44:59 +02:00
Andre Bernet 4b9fcdaf9f Merge pull request #2832 from opentx/bsongis/#2810_reject_new_sensors
Fixes #2810 - Reject new sensor option
Fixes #2730 - Delete all sensors
2015-09-06 11:25:32 +02:00
Andre Bernet 91bd3f0cdb Delete all sensors (fix #2730) 2015-09-06 11:24:10 +02:00
Andre Bernet c96f8aef36 Translations weren't updated 2015-09-06 10:50:05 +02:00
Bertrand Songis bd48c4770b #2635 - Missing strings 2015-09-05 22:08:03 +02:00
Bertrand Songis 0a616cee36 Merge pull request #2751 from opentx/bsongis/issue2635_timer_haptic_countdown
Fixes #2635 - Not tested yet
2015-09-05 20:33:54 +02:00
Bertrand Songis b8923b1411 Merge pull request #2831 from opentx/bsongis/arm_tasks_refactoring
Bsongis/arm tasks refactoring
2015-09-05 20:29:20 +02:00
Bertrand Songis 57e26f4b5e Automatic tests fix 2015-09-05 14:34:34 +02:00
Bertrand Songis ffd49691f5 #2810 - Other possibility (no EEPROM change, discover button added) 2015-09-05 13:36:58 +02:00
Bertrand Songis f956563444 Merge pull request #2829 from tmrttmrt/tmrtmrt/Fixes#2825_MEGA_2560_audio_output_not_working
tmrtmrt/Fixes#2825_MEGA_2560_audio_output_not_working
2015-09-05 11:53:50 +02:00
Bertrand Songis b54123f8a3 Fixes #2810 - Reject new sensor option 2015-09-05 11:44:26 +02:00
Bertrand Songis 976c01051d Compilation fix 2015-09-05 11:37:09 +02:00
Bertrand Songis d14931f77f [ARM] Tasks stack class created
New taskinfo command added to the CLI. CLI stack size increased as it
was too short for the ls command (the CLI did hang!)
2015-09-05 11:10:18 +02:00
Bertrand Songis 2a2650376c Cosmetics 2015-09-04 18:23:54 +02:00
Bertrand Songis 17302fb6e0 [Companion] Current calibration masked on Taranis 2015-09-04 18:21:47 +02:00
jtaylor2 54cc9e0545 Cosmetic, fix line indent. 2015-09-04 06:18:46 -04:00
Bertrand Songis ff2c2d41ad Update DONATIONS.txt 2015-09-04 06:35:30 +02:00
jtaylor2 db6a68e8ed Remove printf left over from testing and correct spacing. 2015-09-03 19:03:34 -04:00
jtaylor2 967ac584a4 Add ability to set sensor instance to telemetry simulator so that it can send data to existing sensors (D sensors with instance 25).
Add default sensor values to RSSI, SWR, A1, A2, RXBat so that
alarms set with LS/SF don't constantly alarm.
2015-09-03 18:02:51 -04:00
Bertrand Songis 50b080cf61 Update DONATIONS.txt 2015-09-03 22:05:12 +02:00
Tomaz Mertelj a975d40ceb tmrtmrt/Fixes#2825_MEGA_2560_audio_output_not_working 2015-09-03 20:50:38 +02:00
David S. Beach e1b1342655 using pre-allocated table space via lua_createtable() for GPS, DATETIME, and CELLS 2015-09-03 14:41:18 -04:00
Tomaz Mertelj 8a6ba0eb8e Merge branch 'master' of https://github.com/tmrttmrt/opentx into tmrttmrt/Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow 2015-09-03 20:36:00 +02:00
tmertelj 87df5766f0 tmrttmrt/Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow 2015-09-03 20:32:23 +02:00
Damjan Adamic 4acebc3186 Fixes #2815: some languages were not completelly disabled and caused Companion crash 2015-09-03 12:50:35 +02:00
Damjan Adamic bd206cbbd2 Readme updated 2015-09-03 12:23:35 +02:00
Bertrand Songis c846cc582a Missing bits on 9XRPRO 2015-09-02 21:57:29 +02:00
Bertrand Songis be7b4e5064 Warning removed 2015-09-02 21:05:24 +02:00
David S. Beach 61b701f930 uncommented call to isAvailable() that was used for testing 2015-09-02 14:09:50 -04:00
David S. Beach 8b83911017 Added getValue() support for UNIT_DATETIME and UNIT_CELLS 2015-09-02 13:52:25 -04:00
Bertrand Songis 2274e6395d Issue #2806 fix start 2015-09-02 19:32:41 +02:00
Bertrand Songis f7c9da6826 Fixes #2809 2015-09-02 18:12:38 +02:00
mhotar bf6c6ac0c4 CZ translations 2015-09-01 21:18:41 +02:00
Bertrand Songis 405d83b539 Compilation fix 2015-09-01 19:38:48 +02:00
Bertrand Songis 362e7c67db Cosmetics 2015-09-01 19:35:30 +02:00
Bertrand Songis 29e2ce7bd1 Fixes #2754 2015-09-01 19:24:46 +02:00
Bertrand Songis a985d021b6 Fixes #2754 2015-09-01 18:55:44 +02:00
Bertrand Songis c907c20705 Compilation fix for Visual Studio 2015-09-01 07:29:07 +02:00
Bertrand Songis 5b4d9cd7d7 Missing #ifdef 2015-08-31 23:24:59 +02:00
Bertrand Songis 6ae59ab67c Update DONATIONS.txt 2015-08-31 21:54:07 +02:00
Bertrand Songis 6374f52585 Fixes #2418 2015-08-31 21:37:41 +02:00
Bertrand Songis 398d32821e Refactoring putsSwitches
Will simplify things when we have 64 logical switches ...
2015-08-31 20:48:32 +02:00
Damjan Adamic 771206e1b2 Merge pull request #2696 from opentx/bsongis/issue2595_cli
Fixes #2595 and #2598: USB serial port and CLI added
2015-08-31 11:06:04 +02:00
Damjan Adamic c47a43e5ce Re #2595: buffer full check got stuck (volatile was missing) 2015-08-31 10:47:28 +02:00
Damjan Adamic 62edfbb651 Merge pull request #2814 from opentx/driver33/PL_TR
Fix Polish gramar error on thousands
2015-08-30 22:04:33 +02:00
driver33 b17f697f69 Sound gramar fixes 2015-08-30 21:56:02 +02:00
driver33 8b00509cb2 Sound gramar fixes 2015-08-30 21:49:06 +02:00
Damjan Adamic ac9e9665dc Merge pull request #2813 from opentx/projectkk2glider/issue_2808_multiplex_format
Fixes #2808: Mixes multiplex representation now the same as on the radio
2015-08-30 21:39:05 +02:00
Damjan Adamic 89bb1226ac Fixes #2808: Mixes multiplex representation now the same as on the radio 2015-08-30 21:35:53 +02:00
Damjan Adamic 94cc359c9f Release notes fixed 2015-08-30 21:10:04 +02:00
Damjan Adamic 8999839538 Fixes #2807: Telemetry sensor names were not displayed 2015-08-30 21:09:35 +02:00
Damjan Adamic 09b2cd7b46 Release notes updated 2015-08-30 20:49:24 +02:00
Damjan Adamic 4b1bd9bfd5 Utility to convert issue numbers into changelog strings 2015-08-30 20:49:03 +02:00
Bertrand Songis 468b5520bd Update DONATIONS.txt 2015-08-30 19:52:08 +02:00
Damjan Adamic c0dee366c0 Merge pull request #2773 from dsbeach/issue2758
Fixes #2758: added Lua support for Latitude and Longitude
2015-08-30 17:15:55 +02:00
Damjan Adamic c767ed7159 Fixes #2811: Anomaly in Dutch Translation 2015-08-30 16:01:18 +02:00
Bertrand Songis 10e72cc214 Compilation fix 2015-08-29 09:49:27 +02:00
Bertrand Songis 7e6e709031 Merge pull request #2802 from opentx/driver33/PL_TR
fixes
2015-08-29 09:44:05 +02:00
driver33 a2514545f4 fixes 2015-08-29 00:14:00 +02:00
Bertrand Songis 57e8fc1cb1 Update DONATIONS.txt 2015-08-28 21:41:47 +02:00
Bertrand Songis 6d0d0f9b0b Merge pull request #2801 from opentx/projectkk2glider/issue_2790_power_loop
Fixes #2790: power on/off lop if big VCC capcitor was used
2015-08-28 21:34:47 +02:00
Andre Bernet 88aea7f780 Fix #2738 2015-08-28 19:25:48 +02:00
Damjan Adamic e4f7fd910c Fixes #2790: power on/off lop if big VCC capcitor was used 2015-08-28 18:07:24 +02:00
Andre Bernet 7befb457f2 Improve mixer screen layout (fix #2785) 2015-08-28 15:58:53 +02:00
Andre Bernet c22784d5a4 Fix #2796 2015-08-28 15:35:59 +02:00
Bertrand Songis 404cab2548 Bootloader compilation fix 2015-08-28 14:58:44 +02:00
Bertrand Songis ef56bf3cb4 New type swsrc_t introduced 2015-08-28 14:47:07 +02:00
Andre Bernet 3920cc6919 Fix #2794
French translations
2015-08-28 12:49:40 +02:00
Damjan Adamic 5a049857f5 Fixes #2798: Dutch translations fixed 2015-08-28 10:23:04 +02:00
Bertrand Songis 97a9c91baf Cosmetics 2015-08-28 09:53:33 +02:00
Bertrand Songis 55b5acb62e Constants renamed 2015-08-28 09:19:02 +02:00
Andre Bernet 34f7c3a463 Fix #2787 2015-08-27 23:00:02 +02:00
Andre Bernet 3002c0a478 Cosmetics 2015-08-27 22:12:54 +02:00
Andre Bernet 433983e2ca Should solve #2787, but doesn't... 2015-08-27 21:05:41 +02:00
Bertrand Songis 0a33883d49 Companion compilation fix 2015-08-27 14:42:35 +02:00
Bertrand Songis 5d7f55fa97 Remark from projectkk2glider taken into account
Serial2 connection and USB CDC output now waits there is some free space
before adding anything to the buffer
2015-08-27 14:38:47 +02:00
Bertrand Songis acad63f838 Update DONATIONS.txt 2015-08-27 13:54:54 +02:00
Andre Bernet ed2ae75c8a Fix #2774 (out of bounds access to trim array when the source of an input is not a stick) 2015-08-27 12:01:01 +02:00
Bertrand Songis dbca85c0e8 3DR removed from the blacklist
I received some excuses, and a small 1000€ donation which I shared with
Mike
2015-08-27 11:03:07 +02:00
Bertrand Songis 78a55507cd Update DONATIONS.txt 2015-08-27 10:36:23 +02:00
Bertrand Songis c3e16dac92 Fix for ARM boards without Haptic (Taranis non plus) 2015-08-27 10:34:01 +02:00
Bertrand Songis 6412361680 Merge pull request #2771 from opentx/driver33/PL_TR
Sound gramar fixes
2015-08-26 19:29:37 +02:00
Bertrand Songis 3b3fe4d946 Merge pull request #2772 from opentx/projectkk2glider/issue_2681_watchdog_fix
Projectkk2glider/issue 2681 watchdog fix
2015-08-26 19:28:12 +02:00
Bertrand Songis d1d8a32cff Update DONATIONS.txt 2015-08-26 19:19:09 +02:00
David S. Beach 8739bd8ad9 fix for issue 2758 lua support for latitude and longitude' 2015-08-25 15:48:08 -04:00
Damjan Adamic 77d3eae4d6 Re #2681 and #2626: Power off refactoring, the 9XE RTC reset prevention code now active 2015-08-25 20:36:51 +02:00
Damjan Adamic e83b7c3a69 Fixes #2681: the PWR pin was not turned on correctly in _bootStart(). Watchdog reset now works on 9XE, the Bootloader exit also works.
Trim switch pull up not enabled for 9XE in _bootStart().
Added watchdog test option in DEBUG screen (long press MENU key), use WATCHDOG_TEST=YES compile option to enable it.
2015-08-25 20:35:07 +02:00
Kjell Kernen f4e55f9d45 Merge branch 'master' of https://github.com/opentx/opentx 2015-08-25 20:21:57 +02:00
Kjell Kernen 8bde8ca7b4 Swedish Companion translation 2015-08-25 20:20:35 +02:00
driver33 d00b9eb8ec Sound gramar fixes 2015-08-25 19:26:37 +02:00
Andre Bernet 2f5682e25a Typo, removed dead code 2015-08-25 16:57:00 +02:00
Andre Bernet 0d6907c76c Preliminary ar9x board support 2015-08-25 16:20:08 +02:00
Andre Bernet 710ed9c5d1 PXX wasn't enabled on sky9x 2015-08-25 16:18:20 +02:00
Andre Bernet c53ba92139 Sky9x platform fixes 2015-08-25 16:16:45 +02:00
Bertrand Songis 5e2fe112b0 Merge pull request #2729 from opentx/projectkk2glider/issue_2728_edge_bug
Fixes #2728: edge switch could trigger right after the logicalSwitche…
2015-08-25 10:00:36 +02:00
Bertrand Songis 001c400f47 Merge branch 'master' into projectkk2glider/issue_2728_edge_bug
# Conflicts:
#	radio/releasenotes.txt
2015-08-25 09:59:24 +02:00
Bertrand Songis 983a4da111 Merge pull request #2760 from opentx/driver33/PL_TR
Companioen pl translation fixes
2015-08-25 09:53:58 +02:00
driver33 d42a29570c Companioen pl translation fixes 2015-08-24 20:36:26 +02:00
Bertrand Songis c2e35ddd9c Update DONATIONS.txt 2015-08-24 18:22:06 +02:00
Damjan Adamic 0f91d66b49 Merge pull request #2752 from opentx/bsongis/comparedialog_printdialog_refactoring
PrintDialog / CompareDialog refactoring. Fixes #2737 and #2576. I also completes some of the tasks in #1063.
2015-08-23 22:31:39 +02:00
Damjan Adamic 6ac811076e Fixes #2576: display receiver number in model print/compare 2015-08-23 22:17:27 +02:00
Damjan Adamic 2530caa16e Flight mode representation reverted back (additional fix), unneeded condition removed 2015-08-23 21:56:51 +02:00
Damjan Adamic a1a50041dd Flight mode representation reverted back 2015-08-23 21:03:48 +02:00
Damjan Adamic 65bdd25173 Various fixes: modelPrinter free, mixer crash, trims display, channel names, monospace font 2015-08-23 16:00:37 +02:00
Bertrand Songis 096b3c98a4 Update DONATIONS.txt 2015-08-23 15:55:46 +02:00
Bertrand Songis fbd7fa4464 Update DONATIONS.txt 2015-08-23 15:41:00 +02:00
Damjan Adamic 0c7e545b42 Cosmetics 2015-08-23 15:33:09 +02:00
Bertrand Songis ed05174fc8 PrintDialog / CompareDialog refactoring 2015-08-23 09:54:15 +02:00
Bertrand Songis a8db4c4fa5 Fixes #2635 - Not tested yet 2015-08-23 09:21:45 +02:00
Damjan Adamic ab1ce7515c Removal of unneeded LUA_EXPORT_TELEMETRY() macro 2015-08-22 20:52:08 +02:00
Damjan Adamic 34090a1d3e Fix: former Lua telemetry fields were not exported correctly (tx-voltage, clock and timers1-3) 2015-08-22 20:44:11 +02:00
Damjan Adamic 60c925a721 Fixes #2733: Minor tweaks to Dutch Translation 2015-08-21 20:55:26 +02:00
Damjan Adamic 36d5f42b66 Merge pull request #2727 from opentx/MicheleVilla/FW_IT_Translations
Update it.h.txt
2015-08-21 20:36:06 +02:00
Damjan Adamic 3075ad857e Fixes #2734: fixed endless loop in model compare (varable i was used both in outer and inner for loops) 2015-08-19 22:23:37 +02:00
Damjan Adamic 4056287d3d Re #2728: Release notes updated 2015-08-18 20:12:54 +02:00
Damjan Adamic 537d7e089f Fixes #2728: edge switch could trigger right after the logicalSwitchesReset() was called 2015-08-18 20:03:54 +02:00
Damjan Adamic b10276bb34 Added missing keys initialization for simu 2015-08-18 19:54:25 +02:00
Damjan Adamic e685528fd3 Re #2623: fixed f_getcwd() on Windows 2015-08-18 17:31:49 +02:00
Michele 7498ab9957 Update it.h.txt 2015-08-17 21:11:16 +02:00
Bertrand Songis 9f19deb1e2 Update DONATIONS.txt 2015-08-17 13:57:39 +02:00
Bertrand Songis 616741888e Merge pull request #2701 from opentx/projectkk2glider/issue_2671_battery_bars
Re #2671: fixes difference between top and main LCD TX battery bars, …
2015-08-17 13:56:14 +02:00
Damjan Adamic 5b4f0a0bbb Re #2671: fixes difference between top and main LCD TX battery bars, code made more readable with macros 2015-08-17 13:55:41 +02:00
Bertrand Songis 00a5437dde Merge pull request #2721 from opentx/MicheleVilla/FW_IT_Translations
Update it.h.txt
2015-08-17 13:52:03 +02:00
Bertrand Songis 379d432365 Merge pull request #2691 from opentx/projectkk2glider/issue_2623_sd_manager_fixes
Fixes #2623: several fixes:
2015-08-17 13:51:35 +02:00
Damjan Adamic 744c560255 Fixes #2623: macro for node type introduced, cosmetics 2015-08-17 13:40:28 +02:00
Damjan Adamic 28b9a70e6b Fixes #2623: several fixes:
Disable menu for [..],
Refresh file list after delete,
Copy destination can be a directory,
Prevent copy/paste into the same directory,
Enabled renaming of directories and files without extension,
Removed delete menu option for directories,
Several simulator filesystem functions improved
2015-08-17 13:40:27 +02:00
Bertrand Songis f5f1a052ca Fixes #2580 2015-08-17 13:37:26 +02:00
Michele e8f28cc681 Update it.h.txt
update Italian translation
2015-08-16 13:30:34 +02:00
Damjan Adamic 23c985ffd6 Fixes #2719: Dutch translations by fraternl 2015-08-16 11:10:07 +02:00
Damjan Adamic 3dc781c89c Re #2714: more Italian translations fixed (changes ported from en.h.txt) 2015-08-16 11:03:10 +02:00
Damjan Adamic 4d7f456be5 Re #2714: Italian translations fixed 2015-08-16 10:25:32 +02:00
Damjan Adamic 154572e547 Separate context menu for "General Settings", cosmetics 2015-08-16 09:28:43 +02:00
Damjan Adamic 3469fa5c93 Release notes updated 2015-08-16 09:04:34 +02:00
Damjan Adamic dcce01fa9c Merge pull request #2712 from opentx/griebd/model_wizard_issue_2711
Griebd/model wizard issue 2711
2015-08-16 09:02:13 +02:00
Grieb 56bc0d817f Fix #2091 2015-08-15 11:14:37 -03:00
Grieb 71706d5e93 Cosmetcs. (editor save removes trailing spaces) 2015-08-15 11:13:57 -03:00
Damjan Adamic b8c51c9bf0 Release notes updated 2015-08-15 14:03:40 +02:00
Damjan Adamic e68b421de3 Release notes updated 2015-08-15 14:00:39 +02:00
Damjan Adamic 32ca88dbf8 Release notes updated 2015-08-15 13:16:56 +02:00
Damjan Adamic 4d83dd2c24 Fixes #2684: Lua model scripts outputs not working in a simulator 2015-08-15 12:59:35 +02:00
Damjan Adamic 330a91441a Compilation fixes for Bin Allocator 2015-08-15 12:39:27 +02:00
Bertrand Songis affda2d8fe Update DONATIONS.txt 2015-08-15 11:23:43 +02:00
Bertrand Songis e7f3c280f0 Update DONATIONS.txt 2015-08-15 11:06:14 +02:00
Bertrand Songis 89c27cfcca Fixes #2704 2015-08-14 11:45:09 +02:00
Bertrand Songis 9303361d6b Fixes #2702 2015-08-13 18:14:54 +02:00
Bertrand Songis 82c8246c25 Merge pull request #2703 from opentx/MicheleVilla/Fix_FW_IT_Translations
Some Fix for it.h.txt
2015-08-13 13:26:43 +02:00
Bertrand Songis c0f2dddfa1 Create DONATIONS.txt 2015-08-13 13:25:11 +02:00
Michele db8ee18b5d Update it.h.txt 2015-08-13 10:12:05 +02:00
Bertrand Songis e3c9ecd26e Merge pull request #2698 from opentx/driver33/PL_TR
companion translation fix
2015-08-12 10:24:28 +02:00
driver33 5df19e1c3d companion translation fix 2015-08-12 10:18:38 +02:00
Bertrand Songis 3384ad2235 Update DONATIONS.txt 2015-08-12 07:36:19 +02:00
Damjan Adamic d693ccd4f0 Top part of the 9XE startup graphics was not shown, lcdRefreshWait() was in wrong place 2015-08-11 23:33:41 +02:00
Bertrand Songis 47547e2397 Merge pull request #2697 from opentx/projectkk2glider/issue_2671_lcd_fixes
Projectkk2glider/issue 2671 lcd fixes
2015-08-11 22:49:34 +02:00
Bertrand Songis 51f46d9a69 Compilation fix 2015-08-11 22:26:43 +02:00
Damjan Adamic 04a8570d48 Re #2671: added TX battery blinking on batter warning, fixed display problem when battery voltage lower than batlow value. 2015-08-11 22:22:18 +02:00
Damjan Adamic 806c343b80 Re #2671: voltage symbol changed to upper case in putsVolts(). 2015-08-11 22:18:35 +02:00
Bertrand Songis 17cb8f9459 Cli fixes 2015-08-11 22:06:30 +02:00
Bertrand Songis 1fdecd1ad4 Gtests false positive error 2015-08-11 19:15:12 +02:00
Bertrand Songis 900b53f165 Fixes #2693 2015-08-11 19:00:01 +02:00
Bertrand Songis 6356fbb2f4 Comments from projectkk2glider addressed 2015-08-11 18:15:43 +02:00
Bertrand Songis 979ece9208 Update DONATIONS.txt 2015-08-11 18:07:13 +02:00
Bertrand Songis a1df80a7f7 Ignore list updated 2015-08-11 06:58:27 +02:00
Bertrand Songis a5bb41a31b Cosmetics 2015-08-11 06:56:02 +02:00
Bertrand Songis 9b527b1810 First compilation fixes, thanks to Jenkins first comments 2015-08-10 23:00:45 +02:00
bertrand 2b312fdbb4 Fixes #2595 - Cli added
Based on projectkk2glider work, with a lot of bugs I am sure. Still not
tested, this is why I preferred working on my own branch. I push it now
so that Jenkins do the first tests and you can review if I am on the
right track. 

I am really wondering if a merge with the Lua api would be possible /
nice, what do you think?
2015-08-10 22:52:26 +02:00
Andre Bernet 2d9c130839 Merge pull request #2687 from opentx/bsongis/osx
Mac libraries now loaded correctly (Fixes #2678)
2015-08-10 11:03:13 +02:00
Bertrand Songis a569c67371 Fixes #2678 2015-08-10 01:08:56 +02:00
Bertrand Songis ada0f3d8b4 Merge pull request #2686 from opentx/projectkk2glider/issue_2685_d-type_altitude_fix
Fixes #2685: D-type altitude fixes (negative values, hi/lo precision …
2015-08-09 22:48:25 +02:00
Damjan Adamic 192f5a1bd7 Fixes #2685: D-type altitude fixes (negative values, hi/lo precision vario) 2015-08-09 22:21:46 +02:00
Damjan Adamic 70d77fd851 Re #2598: removed bad include 2015-08-09 16:02:35 +02:00
Damjan Adamic f7a8715657 Fixes #2598: added USB serial port (with echo example), use USB=SERIAL to enable. If DEBUG=YES then debug output also goes to the USB serial port 2015-08-09 15:41:24 +02:00
Damjan Adamic 5d8c86923b Re #2607: gtest for hi precision VFAS added 2015-08-08 18:17:09 +02:00
Damjan Adamic a6e53bd419 Cosmetics 2015-08-08 17:46:22 +02:00
Andre Bernet 08756af9f5 Don't import install dir settings from old versions (fix #2645) 2015-08-08 11:21:48 +02:00
Bertrand Songis 447df60823 Revert "[9XR-PRO] HiFi audio now :)"
This reverts commit 3d792ea4df.
2015-08-08 11:11:53 +02:00
Bertrand Songis 3d792ea4df [9XR-PRO] HiFi audio now :) 2015-08-08 10:58:52 +02:00
Bertrand Songis 26a38913a8 Fixes #2668 2015-08-08 10:06:52 +02:00
Bertrand Songis 238335dec6 Compilation error on VC++ 2015-08-08 09:32:31 +02:00
Bertrand Songis 1efbde7d46 Fixes #2660 2015-08-08 00:41:50 +02:00
Bertrand Songis 1e92313dcd 2.1.2 start ... 2015-08-08 00:38:18 +02:00
Bertrand Songis e174255ddb Indentation 2015-08-08 00:20:30 +02:00
Bertrand Songis 4b0841b17d _NOCCM renamed to __DMA (which is 32bits aligned on Sky9x/9XR-PRO) 2015-08-08 00:16:51 +02:00
Bertrand Songis e136905e75 Better fix for #2665 2015-08-08 00:12:39 +02:00
Bertrand Songis 7c0d9c7009 Revert "Fixes #2665"
This reverts commit c251865538.
2015-08-08 00:11:46 +02:00
Bertrand Songis c251865538 Fixes #2665 2015-08-07 18:48:23 +02:00
Bertrand Songis e079148249 Typo in release notes 2015-08-07 15:31:20 +02:00
Bertrand Songis fab861e8bd Update DONATIONS.txt 2015-08-07 15:15:12 +02:00
476 changed files with 45805 additions and 60100 deletions
+1
View File
@@ -6,3 +6,4 @@ radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.inc
+14
View File
@@ -0,0 +1,14 @@
language: cpp
before_install:
- sudo apt-get remove cmake cmake-data --yes
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo apt-get update
install:
- sudo apt-get install -y lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
script:
- radio/util/commit-tests.sh
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
-3
View File
@@ -1,3 +0,0 @@
<a href="http://3drobotics.com">3D Robotics</a>
They sell the Iris+ with a modified version of OpenTX which doesn't fullfil the GPL requirements.
No donations, no thanks, we are just free staff for them...
+105 -10
View File
@@ -7,6 +7,8 @@
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
<a href="http://litepilots.com">LitePilots</a>
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
<a href="http://3drobotics.com">3D Robotics</a>
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
Mario Sette
Felice Baratto
@@ -24,7 +26,6 @@ Chris Guy
Adrien Gravouille
Thomas Black
Marc Lucht
Michel Baily
Zdenek Trojanek
Martin Hotar
Stefan Grundevik
@@ -47,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)
@@ -111,7 +110,6 @@ Erhard Werner
Stig Jøran Moen
Keith Hertzog
Christophe Dauvergne
Michel Baily
Tauno Rautakorpi
Sven Assmus
Paul Dittman
@@ -148,7 +146,6 @@ Mike Matheny
Martin Sniedze
Fernando Rimoldi
Sidney Fisher
Bruce Anderson
John Rodgers
Ed Pare
Thomas Kilduff
@@ -400,7 +397,6 @@ Colin Rycroft
Emanuel Stassar
Michael Gregory
Robert Russell
Gordon Stahl
Felix Kaiser
Joshua Bardwell
Davd Goodall
@@ -416,7 +412,6 @@ Andrea Montefusco
Paul Luby
Donald L Webster
Kenneth Frehafer
Peter McHenry
Matthias Hase
Markus Wolf
Andrew Fazio
@@ -587,7 +582,6 @@ Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Michel Baily
Donald Burke
Ronald Donker
Fredie Singh
@@ -598,7 +592,6 @@ Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Gordon Stahl
Christian Grandjean
Roger Bergevin
NorthSide
@@ -789,4 +782,106 @@ Marek Kopyto
Marco Lange
Gary Nix
Jack Oliphant
John Lever
Adolphe Montefiore
Steven De Weerdt
Håkan Berggen
Ayelet Egosi
Jean-Frederic Gaudreault
Jim Wagner
Lee Scott
Roger Keatley
Sherman Lovell
Hugh Caldwell
JB Fisher Company
Michels Bernhard
Pietro Rossin
Carsten Wache
Brock White
Steven Poretz
David Huelster
Gordon Stahl (monthly)
John Mathison
Richard Duczmal
Gregory Barron
Marcel Fischer
Klas Mälman
Viljo Liukku
Eric Smith
Sven Assmus
Luke Mole
NorthSide
Hannes Mössler
James Kaufman
Ravi Gupta
Lexington S Morley
Ralph Segar
Frédéric Devillard
Cory Theurer
Valentinos Zachariou
Garrett Paquette
Heung Jin Choi
Kerry Cochrell
Doug Miller
Andrzej Weydmann
Chair-man.nl
Eric Beier
Jay Warren
Marian Matej
Alastair Smith
Timothy Senecal
Dietmar Drees
Bruce Jones
Adil Busaidy
Herman Hofman
Jean Paul Michel
Peter McHenry
Julien lecoquierre
Jean-Marie Clay
Robert Nicoll
Dan Nixon
Ewald Moehring
Giovanni Carnesecchi
Paul Dumsday
Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
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
+5 -1
View File
@@ -1,5 +1,9 @@
##OpenTX 2.1 Branch
The ongoing development is not done in this branch. It is performed in the branch called next.
[![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.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.
+85 -1
View File
@@ -1,3 +1,87 @@
<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>
<ul>
<li>Telemetry custom screen changes didn't emit modified signal (<a href=https://github.com/opentx/opentx/issues/3029>#3029</a>)</li>
<li>Hide D8/LR12 when eu firmware option is selected</li>
</ul>
<h2>Version 2.1.5 / 2015-11-05</h2>
Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrSky's release of OpenTX 2.1.4
<ul>
<li>Fixed: changing any setting on the telemetry panel does not set the file as being modified (<a href=https://github.com/opentx/opentx/issues/2875>#2875</a>)</li>
<li>Print model fix for "Play value.... not on startup" (<a href=https://github.com/opentx/opentx/issues/2736>#2736</a>)</li>
<li>Top LCD Timer could not be selected for X9E (<a href=https://github.com/opentx/opentx/issues/2850>#2850</a>)</li>
<li>More informative error/info messages when openin eepe files (<a href=https://github.com/opentx/opentx/issues/2778>#2778</a>)</li>
<li>Print model fix for curves (<a href=https://github.com/opentx/opentx/issues/2896>#2896</a>)</li>
<li>Added missing special functions (bind, range check, set failsafe) (<a href=https://github.com/opentx/opentx/issues/2753>#2753</a>)</li>
<li>Some defaults missing when changing telemetry formula, update propagation issues (<a href=https://github.com/opentx/opentx/issues/2928>#2928</a>)</li>
<li>Fixed wrong import of Logical switches from OpenTX 2.0.x version (<a href=https://github.com/opentx/opentx/issues/2942>#2942</a>)</li>
<li>Fixed a problem with updates path on Windows (<a href=https://github.com/opentx/opentx/issues/2876>#2876</a>)</li>
<li>Edge representation unified (changed from "no release" to "instant") (<a href=https://github.com/opentx/opentx/issues/2837>#2837</a>)</li>
<li>Added channel names on failsafe sliders (<a href=https://github.com/opentx/opentx/issues/3021>#3021</a>)</li>
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
<li>Various texts and translations corrections</li>
<li>Various small bug-fixes: <a href=https://github.com/opentx/opentx/issues/2994>#2994</a>,
<a href=https://github.com/opentx/opentx/issues/3016>#3016</a>,
<a href=https://github.com/opentx/opentx/issues/3012>#3012</a>
</li>
</ul>
<h2>Version 2.1.3 / 2015-09-09</h2>
<ul>
<li>Fix missing translations in inputs/mixes tabs, print and compare dialogs (<a href=https://github.com/opentx/opentx/issues/2847>#2847</a>)</li>
</ul>
<h2>Version 2.1.2 / 2015-09-07</h2>
<ul>
<li>Fixed: Lua model scripts outputs not working in a simulator (<a href=https://github.com/opentx/opentx/issues/2684>#2684</a>)</li>
<li>Fixed a problem of Companion 2.1 trying to install into 2.0 path.
The effect will only be visible for the users that did not install any of the previous 2.1.x versions.
(<a href=https://github.com/opentx/opentx/issues/2645>#2645</a>)</li>
<li>Added missing SDL libraries to MAC package (<a href=https://github.com/opentx/opentx/issues/2678>#2678</a>)</li>
<li>Added used channels check/warning in Wizard (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
<li>Model Print and Model Compare improvements and fixes (<a href=https://github.com/opentx/opentx/issues/2734>#2734</a>, <a href=https://github.com/opentx/opentx/issues/2737>#2737</a>, <a href=https://github.com/opentx/opentx/issues/2576>#2576</a>)</li>
<li>Negative telemetry offset value was reset when writing back to radio (<a href=https://github.com/opentx/opentx/issues/2738>#2738</a>)</li>
<li>Telemetry sensor names were not displayed (<a href=https://github.com/opentx/opentx/issues/2807>#2807</a>)</li>
<li>Mixes multiplex representation now the same as on the radio (<a href=https://github.com/opentx/opentx/issues/2808>#2808</a>)</li>
<li>Fixed language-related startup crash on Mac (<a href=https://github.com/opentx/opentx/issues/2815>#2815</a>)</li>
<li>Fixed issues with conversion from 2.0 (<a href=https://github.com/opentx/opentx/issues/2809>#2809</a>, <a href=https://github.com/opentx/opentx/issues/2800>#2800</a>)</li>
<li>Fixed Throttle source export issue on X9E (<a href=https://github.com/opentx/opentx/issues/2844>#2844</a>)</li>
<li>Added support for the AR9X replacement board (prototype) for the Turnigy 9X radio, info <a href=http://www.rcgroups.com/forums/showthread.php?t=2479552>here</a></li>
</ul>
<h2>Version 2.1.1 / 2015-08-06</h2>
<ul>
<li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li>
@@ -16,7 +100,7 @@
<li>Writing model settings to 9XR-PRO did not work (<a href=https://github.com/opentx/opentx/issues/2402>#2402</a>, <a href=https://github.com/opentx/opentx/issues/2517>#2517</a>)</li>
<li>Model Print and Model Compare improvements</li>
<li>Fixed Companion OSX version (<a href=https://github.com/opentx/opentx/issues/2549>#2549</a>)</li>
<li>Firmware nightly builds are now downloadable from nightly builds of Companion (<a href=https://github.com/opentx/opentx/issues/2526>#2526</a>,<a href=https://github.com/opentx/opentx/issues/2634>#2634</a>)</li>
<li>Firmware nightly builds are now downloadable from nightly builds of Companion (<a href=https://github.com/opentx/opentx/issues/2526>#2526</a>, <a href=https://github.com/opentx/opentx/issues/2634>#2634</a>)</li>
<li>Fixed telemetry item lists (<a href=https://github.com/opentx/opentx/issues/2541>#2541</a>)</li>
<li>Fixed missing pots P1..P3 for 9X (<a href=https://github.com/opentx/opentx/issues/2543>#2543</a>)</li>
<li>Fixed "Invalid model and settings" error message when writing models and settings to the radio (<a href=https://github.com/opentx/opentx/issues/2544>#2544</a>)</li>
+35 -11
View File
@@ -2,13 +2,13 @@ PROJECT( companion )
SET(C9X_VERSION_MAJOR "2")
SET(C9X_VERSION_MINOR "1")
SET(C9X_VERSION_REVISION "1")
SET(C9X_VERSION_REVISION "7")
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
MESSAGE(STATUS OpenTX Companion ${C9X_VERSION})
MESSAGE(STATUS "OpenTX Companion ${C9X_VERSION}")
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -33,6 +33,12 @@ IF(DEBUG_IMPORT)
MESSAGE( STATUS "EEPROM import debugging enabled" )
ENDIF(DEBUG_IMPORT)
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 )
@@ -62,7 +68,7 @@ ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
ENDIF()
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
@@ -85,6 +91,8 @@ 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
@@ -93,6 +101,7 @@ ADD_CUSTOM_COMMAND(
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 )
@@ -102,6 +111,11 @@ ELSE( )
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})
@@ -112,6 +126,7 @@ include_directories(
${PROJECT_SOURCE_DIR}/shared
${SIMU_SRC_DIRECTORY}
${XSD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/qxtcommandoptions
)
add_subdirectory(shared)
@@ -120,6 +135,7 @@ add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(firmwares/opentx/simulator)
add_subdirectory(qcustomplot)
add_subdirectory(qxtcommandoptions)
set(common_SRCS
eeprominterface.cpp
@@ -158,6 +174,7 @@ set(companion_SRCS
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
burnconfigdialog.cpp
multimodelprinter.cpp
comparedialog.cpp
contributorsdialog.cpp
releasenotesdialog.cpp
@@ -176,7 +193,7 @@ set(companion_SRCS
fusesdialog.cpp
logsdialog.cpp
downloaddialog.cpp
splashlibrary.cpp
splashlibrarydialog.cpp
mainwindow.cpp
companion.cpp
radionotfound.cpp
@@ -196,7 +213,7 @@ set(companion_MOC_HDRS
releasenotesdialog.h
releasenotesfirmwaredialog.h
customizesplashdialog.h
splashlibrary.h
splashlibrarydialog.h
splashlabel.h
progresswidget.h
progressdialog.h
@@ -212,6 +229,8 @@ set(companion_MOC_HDRS
radionotfound.h
helpers.h
wizarddialog.h
modelprinter.h
multimodelprinter.h
)
set(companion_UIS
@@ -226,7 +245,7 @@ set(companion_UIS
printdialog.ui
htmldialog.ui
customizesplashdialog.ui
splashlibrary.ui
splashlibrarydialog.ui
progresswidget.ui
progressdialog.ui
flashfirmwaredialog.ui
@@ -270,7 +289,6 @@ NOW(TIME)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @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)
@@ -333,7 +351,7 @@ else()
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
endif()
target_link_libraries(${SIMULATOR_NAME} simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${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 ####################
@@ -412,6 +430,7 @@ IF( APPLE )
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}
@@ -430,7 +449,7 @@ ADD_CUSTOM_TARGET( stamp
IF( LUPDATE_FOUND )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -ts ${companion_TS}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
ELSE()
ADD_CUSTOM_TARGET( translations
@@ -441,7 +460,11 @@ ENDIF()
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)
SET( CPACK_STRIP_FILES TRUE )
# The file stripping is deliberately disabled, with the stripped file we get
# very poor trace-backs from the users when they report Companion crash
SET( CPACK_STRIP_FILES FALSE )
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
@@ -462,6 +485,7 @@ else(DPKG_PROGRAM)
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
endif(DPKG_PROGRAM)
INCLUDE(CPack)
+19 -13
View File
@@ -312,10 +312,10 @@ QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
int Profile::currentCalib() const { return _currentCalib; }
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
int Profile::vBatCalib() const { return _vBatCalib; }
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
int Profile::vBatWarn() const { return _vBatWarn; }
int Profile::vBatMin() const { return _vBatMin; }
int Profile::vBatMax() const { return _vBatMax; }
@@ -342,10 +342,10 @@ 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::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"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));}
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
@@ -378,10 +378,10 @@ Profile& Profile::operator=(const Profile& rhs)
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
currentCalib ( rhs.currentCalib() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
vBatCalib ( rhs.vBatCalib() );
txVoltageCalibration ( rhs.txVoltageCalibration() );
vBatWarn ( rhs.vBatWarn() );
vBatMin ( rhs.vBatMin() );
vBatMax ( rhs.vBatMax() );
@@ -424,10 +424,10 @@ void Profile::initFwVariables()
_timeStamp = "";
_trainerCalib = "";
_currentCalib = 0;
_txCurrentCalibration = 0;
_gsStickMode = 0;
_ppmMultiplier = 0;
_vBatCalib = 0;
_txVoltageCalibration = 0;
_vBatWarn = 0;
_vBatMin = 0;
_vBatMax = 0;
@@ -483,10 +483,10 @@ 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( _currentCalib, "currentCalib" ,0 ,"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));
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _txVoltageCalibration, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
@@ -613,7 +613,10 @@ AppData::AppData()
QStringList keys = settings20.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
settings.setValue(*i, settings20.value(*i));
if (settings20.value(*i) != QString("") && settings20.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings20.value(*i));
}
}
//Reload profiles
@@ -629,7 +632,10 @@ AppData::AppData()
QStringList keys = pre2016settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
settings.setValue(*i, pre2016settings.value(*i));
if (pre2016settings.value(*i) != QString("") && pre2016settings.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, pre2016settings.value(*i));
}
}
//Reload profiles
@@ -731,7 +737,7 @@ AppData::AppData()
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
getset( _enableBackup, "backupEnable" ,false );
getset( _enableBackup, "enableBackup" ,false );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
+6 -6
View File
@@ -125,10 +125,10 @@ class Profile: protected CompStoreObj
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
int _currentCalib;
int _txCurrentCalibration;
int _gsStickMode;
int _ppmMultiplier;
int _vBatCalib;
int _txVoltageCalibration;
int _vBatWarn;
int _vBatMin;
int _vBatMax;
@@ -156,10 +156,10 @@ class Profile: protected CompStoreObj
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
int currentCalib() const;
int txCurrentCalibration() const;
int gsStickMode() const;
int ppmMultiplier() const;
int vBatCalib() const;
int txVoltageCalibration() const;
int vBatWarn() const;
int vBatMin() const;
int vBatMax() const;
@@ -186,10 +186,10 @@ class Profile: protected CompStoreObj
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void currentCalib (const int);
void txCurrentCalibration (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
void vBatCalib (const int);
void txVoltageCalibration (const int);
void vBatWarn (const int);
void vBatMin (const int);
void vBatMax (const int);
+28 -35
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>686</width>
<height>619</height>
<height>713</height>
</rect>
</property>
<property name="sizePolicy">
@@ -233,7 +233,7 @@ May be different from firmware language</string>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
@@ -627,7 +627,7 @@ Mode 4:
<item row="10" column="2" colspan="2">
<widget class="QPushButton" name="sdPathButton">
<property name="text">
<string>Open Folder</string>
<string>Select Folder</string>
</property>
</widget>
</item>
@@ -637,7 +637,7 @@ Mode 4:
<string>The profile specific folder, if set, will override general Backup folder</string>
</property>
<property name="text">
<string>Open Folder</string>
<string>Select Folder</string>
</property>
</widget>
</item>
@@ -854,7 +854,7 @@ Mode 4:
<item row="12" column="2" colspan="2">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
<string>Select Folder</string>
</property>
</widget>
</item>
@@ -874,14 +874,14 @@ Mode 4:
<item row="0" column="2" colspan="2">
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Find Executable</string>
<string>Select Executable</string>
</property>
</widget>
</item>
<item row="16" column="2" colspan="2">
<widget class="QPushButton" name="libraryPathButton">
<property name="text">
<string>Open Folder</string>
<string>Select Folder</string>
</property>
</widget>
</item>
@@ -912,7 +912,17 @@ Mode 4:
<string>Simulator Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="5" column="4">
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
@@ -974,7 +984,7 @@ Mode 4:
</property>
</spacer>
</item>
<item row="1" column="1" colspan="4">
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="snapshotClipboardCKB">
<property name="text">
<string>Only capture to clipboard</string>
@@ -989,32 +999,9 @@ Mode 4:
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="snapshotPathButton">
<property name="text">
<string>Open Folder</string>
<string>Select Folder</string>
</property>
<property name="flat">
<bool>false</bool>
@@ -1055,9 +1042,15 @@ Mode 4:
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<width>0</width>
<height>0</height>
</size>
</property>
@@ -1066,7 +1059,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="simuSW">
<property name="text">
<string>Remember simulator switch values</string>
+10 -1
View File
@@ -53,6 +53,7 @@
#undef main
#endif
#include "mainwindow.h"
#include "version.h"
#include "eeprominterface.h"
#include "appdata.h"
@@ -87,6 +88,13 @@ int main(int argc, char *argv[])
app.setOrganizationDomain("open-tx.org");
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
QStringList strl = QApplication::arguments();
if (strl.contains("--version")) {
printf("%s\n", C9X_VERSION);
fflush(stdout);
exit(0);
}
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
@@ -148,7 +156,8 @@ int main(int argc, char *argv[])
delete splash;
delete mainWin;
unregisterFirmwares();
unregisterSimulators();
unregisterOpenTxFirmwares();
unregisterEEpromInterfaces();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
+2 -1
View File
@@ -4,7 +4,6 @@
<file>icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../../BLACKLIST.txt</file>
<file>../releasenotes.txt</file>
<file>images/9xdb.png</file>
<file>images/9xdl.png</file>
@@ -101,6 +100,8 @@
<file>images/library/00018.png</file>
<file>images/library/00019.png</file>
<file>images/library/00020.png</file>
<file>images/library/00021.png</file>
<file>images/library/00022.png</file>
<file>images/library/00050.png</file>
<file>images/library/00051.png</file>
<file>images/library/00052.png</file>
File diff suppressed because it is too large Load Diff
+14 -68
View File
@@ -1,11 +1,9 @@
#ifndef COMPAREDIALOG_H
#define COMPAREDIALOG_H
#ifndef _COMPAREDIALOG_H
#define _COMPAREDIALOG_H
#include <QDialog>
#include <QtGui>
#include <QDir>
#include "eeprominterface.h"
#include "modelprinter.h"
#include <QLabel>
#include "multimodelprinter.h"
namespace Ui {
class CompareDialog;
@@ -13,84 +11,32 @@ namespace Ui {
class CompareDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
CompareDialog(QWidget *parent, Firmware * firmware);
~CompareDialog();
Firmware * firmware;
protected:
GeneralSettings * settings;
ModelData g_model1;
ModelData g_model2;
MultiModelPrinter multimodelprinter;
ModelData model1;
ModelData model2;
bool model1Valid;
bool model2Valid;
private:
void closeEvent(QCloseEvent *event);
Ui::CompareDialog *ui;
template<class T> QString getColor1(T val1, T val2) {
if (val1!=val2)
return "green";
else
return "grey";
}
template<class T> QString getColor2(T val1, T val2) {
if (val1!=val2)
return "red";
else
return "grey";
}
QString getColor1(char * val1, char * val2) {
if (strcmp(val1,val2)!=0)
return "green";
else
return "grey";
}
QString getColor2(char * val1, char * val2) {
if (strcmp(val1,val2)!=0)
return "red";
else
return "grey";
}
bool ChannelHasExpo(ExpoData * expoArray, uint8_t destCh);
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
bool handleDroppedModel(const QMimeData * mimeData, ModelData * model, QLabel * label);
void applyDiffFont(QString & v1, QString & v2, const QString & font = "", bool eqGrey = false);
void diffAndAssembleTableLines(QStringList & i1, QStringList & i2, QString & o1, QString & o2);
Ui::CompareDialog * ui;
QTextEdit * te;
QString curvefile1;
QString curvefile2;
QDir *qd;
ModelPrinter modelPrinter1;
ModelPrinter modelPrinter2;
GeneralSettings dummySettings;
private slots:
protected slots:
void on_printButton_clicked();
void on_printFileButton_clicked();
protected:
protected:
void closeEvent(QCloseEvent * event);
bool handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label);
void dropEvent(QDropEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void printDiff();
void printSetup();
void printPhases();
void printLimits();
void printInputs();
void printMixers();
void printCurves();
void printGvars();
void printLogicalSwitches();
void printSafetySwitches();
void printCustomFunctions();
void printFrSky();
};
#endif // COMPAREDIALOG_H
#endif // _COMPAREDIALOG_H
+1
View File
@@ -8,6 +8,7 @@ enum BoardEnum {
BOARD_GRUVIN9X,
BOARD_SKY9X,
BOARD_9XRPRO,
BOARD_AR9X,
BOARD_TARANIS,
BOARD_TARANIS_PLUS,
BOARD_TARANIS_X9E
+3
View File
@@ -63,12 +63,15 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
" <tr><td class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
"</table>");
#if 0
QFile blacklist(":/BLACKLIST.txt");
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
}
#endif
str.append("</body></html>");
ui->textEditor->setHtml(str);
ui->textEditor->scroll(0, 0);
Executable → Regular
+4 -1
View File
@@ -26,8 +26,11 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
sourceFile.close();
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
if (!loadEEprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size) || !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(NO_ERROR)
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
return false;
}
QFile destinationFile(destinationEEprom);
if (!destinationFile.open(QIODevice::WriteOnly))
Executable → Regular
View File
+2 -2
View File
@@ -3,8 +3,8 @@
#include "flashfirmwaredialog.h"
#include "appdata.h"
#include "helpers.h"
#include "splashlibrary.h"
#include "firmwareinterface.h"
#include "splashlibrarydialog.h"
//*** Side Class ***
@@ -233,7 +233,7 @@ void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicke
void customizeSplashDialog::libraryButton_clicked( Side side )
{
QString fileName;
splashLibrary *ld = new splashLibrary(this,&fileName);
SplashLibraryDialog *ld = new SplashLibraryDialog(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, UNDEFINED ))
+212 -45
View File
@@ -481,7 +481,7 @@ QString RawSource::toString(const ModelData * model) const
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("----");
}
@@ -528,7 +528,7 @@ QString RawSource::toString(const ModelData * model) const
return CHECK_IN_ARRAY(telemetry, index);
}
case SOURCE_TYPE_GVAR:
return QObject::tr("GV%1").arg(index+1);
return QObject::tr("GV%1").arg(index+1);
default:
return QObject::tr("----");
}
@@ -536,15 +536,15 @@ QString RawSource::toString(const ModelData * model) const
bool RawSource::isPot() const
{
return (type == SOURCE_TYPE_STICK &&
index >= NUM_STICKS &&
return (type == SOURCE_TYPE_STICK &&
index >= NUM_STICKS &&
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots));
}
bool RawSource::isSlider() const
{
return (type == SOURCE_TYPE_STICK &&
index >= NUM_STICKS+GetCurrentFirmware()->getCapability(Pots) &&
return (type == SOURCE_TYPE_STICK &&
index >= NUM_STICKS+GetCurrentFirmware()->getCapability(Pots) &&
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders));
}
@@ -797,7 +797,7 @@ QString CustomFunctionData::funcToString() const
else if (func == FuncPlayScript)
return QObject::tr("Play Script");
else if (func == FuncLogs)
return QObject::tr("Start Logs");
return QObject::tr("SD Logs");
else if (func == FuncVolume)
return QObject::tr("Volume");
else if (func == FuncBacklight)
@@ -810,12 +810,24 @@ QString CustomFunctionData::funcToString() const
return QObject::tr("Background Music Pause");
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast)
return QObject::tr("Adjust GV%1").arg(func-FuncAdjustGV1+1);
else if (func == FuncSetFailsafeInternalModule)
return QObject::tr("SetFailsafe Int. Module");
else if (func == FuncSetFailsafeExternalModule)
return QObject::tr("SetFailsafe Ext. Module");
else if (func == FuncRangeCheckInternalModule)
return QObject::tr("RangeCheck Int. Module");
else if (func == FuncRangeCheckExternalModule)
return QObject::tr("RangeCheck Ext. Module");
else if (func == FuncBindInternalModule)
return QObject::tr("Bind Int. Module");
else if (func == FuncBindExternalModule)
return QObject::tr("Bind Ext. Module");
else {
return QString("???"); // Highlight unknown functions with output of question marks.(BTW should not happen that we do not know what a function is)
}
}
void CustomFunctionData::populateResetParams(ModelData * model, QComboBox * b, unsigned int value = 0)
void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox * b, unsigned int value = 0)
{
int val = 0;
Firmware * firmware = GetCurrentFirmware();
@@ -858,12 +870,12 @@ void CustomFunctionData::populatePlaySoundParams(QStringList & qs)
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
}
void CustomFunctionData::populateHapticParams(QStringList & qs)
void CustomFunctionData::populateHapticParams(QStringList & qs)
{
qs << "0" << "1" << "2" << "3";
}
QString CustomFunctionData::paramToString(ModelData * model) const
QString CustomFunctionData::paramToString(const ModelData * model) const
{
QStringList qs;
if (func <= FuncInstantTrim) {
@@ -892,12 +904,12 @@ QString CustomFunctionData::paramToString(ModelData * model) const
int pos = cb.findData(param);
if (pos >= 0)
return cb.itemText(pos);
else
else
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
RawSource item(param);
return item.toString();
return item.toString(model);
}
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
@@ -924,12 +936,15 @@ QString CustomFunctionData::paramToString(ModelData * model) const
QString CustomFunctionData::repeatToString() const
{
if (repeatParam==0) {
if (repeatParam == -1) {
return QObject::tr("played once, not during startup");
}
else if (repeatParam == 0) {
return "";
}
else {
unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 1 : 10;
return QObject::tr("repeat") + QString("(%1").arg(step*repeatParam) + QObject::tr("s") + ")";
return QObject::tr("repeat(%1s)").arg(step*repeatParam);
}
}
@@ -948,17 +963,43 @@ QString CustomFunctionData::enabledToString() const
return "";
}
QString LimitData::minToString()
CurveData::CurveData()
{
clear(5);
}
void CurveData::clear(int count)
{
memset(this, 0, sizeof(CurveData));
this->count = count;
}
bool CurveData::isEmpty() const
{
for (int i=0; i<count; i++) {
if (points[i].y != 0) {
return false;
}
}
return true;
}
QString LimitData::minToString() const
{
return QString::number((qreal)min/10);
}
QString LimitData::maxToString()
QString LimitData::maxToString() const
{
return QString::number((qreal)max/10);
}
QString LimitData::offsetToString()
QString LimitData::revertToString() const
{
return revert ? QObject::tr("INV") : QObject::tr("NOR");
}
QString LimitData::offsetToString() const
{
return QString::number((qreal)offset/10, 'f', 1);
}
@@ -1057,8 +1098,8 @@ GeneralSettings::GeneralSettings()
}
else {
QString t_trainercalib=g.profile[g.id()].trainerCalib();
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib();
int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib();
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.id()].txVoltageCalibration();
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.id()].txCurrentCalibration();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
@@ -1092,8 +1133,8 @@ GeneralSettings::GeneralSettings()
if (ok)
trainer.calib[i]=byte16;
}
currentCalib=t_currentCalib;
vBatCalib=t_vBatCalib;
txCurrentCalibration=t_txCurrentCalibration;
txVoltageCalibration=t_txVoltageCalibration;
vBatWarn=t_vBatWarn;
PPM_Multiplier=t_PPM_Multiplier;
stickMode = t_stickMode;
@@ -1262,6 +1303,52 @@ bool ModelData::isInputValid(const unsigned int idx) const
return false;
}
bool ModelData::hasExpos(uint8_t inputIdx) const
{
for (int i=0; i<C9X_MAX_EXPOS; i++) {
const ExpoData & expo = expoData[i];
if (expo.chn==inputIdx && expo.mode!=0) {
return true;
}
}
return false;
}
bool ModelData::hasMixes(uint8_t channelIdx) const
{
channelIdx += 1;
for (int i=0; i<C9X_MAX_MIXERS; i++) {
if (mixData[i].destCh == channelIdx) {
return true;
}
}
return false;
}
QVector<const ExpoData *> ModelData::expos(int input) const
{
QVector<const ExpoData *> result;
for (int i=0; i<C9X_MAX_EXPOS; i++) {
const ExpoData * ed = &expoData[i];
if ((int)ed->chn==input && ed->mode!=0) {
result << ed;
}
}
return result;
}
QVector<const MixData *> ModelData::mixes(int channel) const
{
QVector<const MixData *> result;
for (int i=0; i<C9X_MAX_MIXERS; i++) {
const MixData * md = &mixData[i];
if ((int)md->destCh == channel+1) {
result << md;
}
}
return result;
}
void ModelData::removeInput(const int idx)
{
unsigned int chn = expoData[idx].chn;
@@ -1311,12 +1398,16 @@ void ModelData::clear()
moduleData[2].ppmDelay = 300;
int board = GetEepromInterface()->getBoard();
if (IS_TARANIS(board)) {
moduleData[0].protocol=PXX_XJT_X16;
moduleData[1].protocol=OFF;
moduleData[0].protocol = PULSES_PXX_XJT_X16;
moduleData[1].protocol = PULSES_OFF;
}
else if (IS_SKY9X(board)) {
moduleData[0].protocol = PULSES_PPM;
moduleData[1].protocol = PULSES_PPM;
}
else {
moduleData[0].protocol=PPM;
moduleData[1].protocol=OFF;
moduleData[0].protocol = PULSES_PPM;
moduleData[1].protocol = PULSES_OFF;
}
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear();
@@ -1341,7 +1432,7 @@ void ModelData::clear()
sensorData[i].clear();
}
bool ModelData::isempty()
bool ModelData::isEmpty() const
{
return !used;
}
@@ -1529,7 +1620,7 @@ void registerEEpromInterfaces()
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_9XRPRO));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_X9E));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
@@ -1543,7 +1634,7 @@ void unregisterEEpromInterfaces()
foreach(EEPROMInterface * intf, eepromInterfaces) {
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
delete intf;
}
}
OpenTxEepromCleanup();
}
@@ -1551,42 +1642,116 @@ QList<Firmware *> firmwares;
Firmware * default_firmware_variant;
Firmware * current_firmware_variant;
void unregisterFirmwares()
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
{
foreach (Firmware * f, firmwares) {
delete f;
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList errorsList;
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Possible causes for this:");
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a newer version of OpenTX"); }
if (errors.test(NOT_OPENTX)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from OpenTX"); }
if (errors.test(NOT_TH9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Th9X"); }
if (errors.test(NOT_GRUVIN9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Gruvin9X"); }
if (errors.test(NOT_ERSKY9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from ErSky9X"); }
if (errors.test(NOT_ER9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Er9X"); }
if (errors.test(WRONG_SIZE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom size is invalid"); }
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom file system is invalid"); }
if (errors.test(UNKNOWN_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a unknown board"); }
if (errors.test(WRONG_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from the wrong board"); }
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom backup not supported"); }
if (errors.test(UNKNOWN_ERROR)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Something that couldn't be guessed, sorry"); }
if (errors.test(HAS_WARNINGS)) {
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Warning:");
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
}
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(mainMessage);
msgBox.setInformativeText(errorsList.join("\n"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
bool loadEEprom(RadioData &radioData, const uint8_t *eeprom, const int size)
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
{
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->load(radioData, eeprom, size))
return true;
}
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n You should 'save as' to keep the old file as a backup."); }
return false;
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(QT_TRANSLATE_NOOP("EepromInterface", "Warnings!"));
msgBox.setInformativeText(warningsList.join("\n"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
bool loadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->loadBackup(radioData, eeprom, size, index))
return true;
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
errors |= result;
}
}
return false;
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int index)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
errors |= result;
}
}
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
bool loadEEpromXml(RadioData &radioData, QDomDocument &doc)
unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
{
std::bitset<NUM_ERRORS> errors;
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->loadxml(radioData, doc))
return true;
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
if (result.test(NO_ERROR)) {
return result.to_ulong();
}
else {
errors |= result;
}
}
return false;
if (errors.none()) {
errors.set(UNKNOWN_ERROR);
}
return errors.to_ulong();
}
QString getBoardName(BoardEnum board)
@@ -1608,6 +1773,8 @@ QString getBoardName(BoardEnum board)
return "Sky9x";
case BOARD_9XRPRO:
return "9XR-PRO";
case BOARD_AR9X:
return "AR9X";
default:
return "Unknown";
}
+117 -65
View File
@@ -24,6 +24,7 @@
#include <QtXml>
#include <QComboBox>
#include <iostream>
#include <bitset>
#include "constants.h"
#include "simulatorinterface.h"
@@ -40,7 +41,7 @@ QString getBoardName(BoardEnum board);
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
#define IS_STOCK(board) (board==BOARD_STOCK)
#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560)
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO)
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO || board==BOARD_AR9X)
#define IS_9XRPRO(board) (board==BOARD_9XRPRO)
#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)
@@ -183,19 +184,6 @@ extern const char downArrow[];
class ModelData;
class GeneralSettings;
enum ThrottleSource {
THROTTLE_SOURCE_THR,
THROTTLE_SOURCE_P1,
THROTTLE_SOURCE_P2,
THROTTLE_SOURCE_P3,
THROTTLE_SOURCE_S1 = THROTTLE_SOURCE_P1,
THROTTLE_SOURCE_S2,
THROTTLE_SOURCE_S3,
THROTTLE_SOURCE_LS,
THROTTLE_SOURCE_RS,
THROTTLE_SOURCE_FIRST_CHANNEL,
};
enum TelemetrySource {
TELEMETRY_SOURCE_TX_BATT,
TELEMETRY_SOURCE_TX_TIME,
@@ -445,7 +433,7 @@ class ExpoData {
unsigned int mode;
unsigned int chn;
RawSwitch swtch;
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
int weight;
int offset;
CurveReference curve;
@@ -468,14 +456,14 @@ class CurveData {
CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM
};
CurveData() { clear(5); }
CurveData();
void clear(int count);
bool isEmpty() const;
CurveType type;
bool smooth;
int count;
CurvePoint points[C9X_MAX_POINTS];
char name[6+1];
void clear(int count) { memset(this, 0, sizeof(CurveData)); this->count = count; }
};
class LimitData {
@@ -489,9 +477,10 @@ class LimitData {
bool symetrical;
char name[6+1];
CurveReference curve;
QString minToString();
QString maxToString();
QString offsetToString();
QString minToString() const;
QString maxToString() const;
QString offsetToString() const;
QString revertToString() const;
void clear();
};
@@ -519,7 +508,7 @@ class MixData {
bool noExpo;
MltpxValue mltpx; // multiplex method 0=+ 1=* 2=replace
unsigned int mixWarn; // mixer warning
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
int sOffset;
char name[MIXDATA_NAME_LEN+1];
@@ -609,6 +598,12 @@ enum AssignFunc {
FuncBackgroundMusicPause,
FuncAdjustGV1,
FuncAdjustGVLast = FuncAdjustGV1+C9X_MAX_GVARS-1,
FuncSetFailsafeInternalModule,
FuncSetFailsafeExternalModule,
FuncRangeCheckInternalModule,
FuncRangeCheckExternalModule,
FuncBindInternalModule,
FuncBindExternalModule,
FuncCount,
FuncReserve = -1
};
@@ -625,11 +620,11 @@ class CustomFunctionData { // Function Switches data
int repeatParam;
void clear();
QString funcToString() const;
QString paramToString(ModelData * model) const;
QString paramToString(const ModelData * model) const;
QString repeatToString() const;
QString enabledToString() const;
static void populateResetParams(ModelData * model, QComboBox * b, unsigned int value);
static void populateResetParams(const ModelData * model, QComboBox * b, unsigned int value);
static void populatePlaySoundParams(QStringList & qs);
static void populateHapticParams(QStringList & qs);
@@ -760,6 +755,22 @@ enum TelemetryCurrentSources {
TELEMETRY_CURRENT_SOURCE_FAS
};
enum UartModes {
UART_MODE_NONE,
UART_MODE_TELEMETRY_MIRROR,
UART_MODE_TELEMETRY,
UART_MODE_SBUS_TRAINER,
UART_MODE_DEBUG
};
enum TrainerMode {
TRAINER_MODE_MASTER_TRAINER_JACK,
TRAINER_MODE_SLAVE,
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
TRAINER_MODE_MASTER_BATTERY_COMPARTMENT,
};
class FrSkyData {
public:
FrSkyData() { clear(); }
@@ -797,6 +808,12 @@ class MavlinkData {
class TimerData {
public:
enum CountDownMode {
COUNTDOWN_SILENT,
COUNTDOWN_BEEPS,
COUNTDOWN_VOICE,
COUNTDOWN_HAPTIC
};
TimerData() { clear(); }
RawSwitch mode;
char name[TIMER_NAME_LEN+1];
@@ -808,31 +825,32 @@ class TimerData {
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
};
enum Protocol {
OFF,
PPM,
SILV_A,
SILV_B,
SILV_C,
CTP1009,
LP45,
DSM2,
DSMX,
PPM16,
PPMSIM,
PXX_XJT_X16,
PXX_XJT_D8,
PXX_XJT_LR12,
PXX_DJT,
PROTO_LAST
enum PulsesProtocol {
PULSES_OFF,
PULSES_PPM,
PULSES_SILV_A,
PULSES_SILV_B,
PULSES_SILV_C,
PULSES_CTP1009,
PULSES_LP45,
PULSES_DSM2,
PULSES_DSMX,
PULSES_PPM16,
PULSES_PPMSIM,
PULSES_PXX_XJT_X16,
PULSES_PXX_XJT_D8,
PULSES_PXX_XJT_LR12,
PULSES_PXX_DJT,
PULSES_CROSSFIRE,
PULSES_PROTOCOL_LAST
};
enum TrainerProtocol {
MASTER_JACK,
SLAVE_JACK,
MASTER_SBUS_MODULE,
MASTER_CPPM_MODULE,
MASTER_SBUS_BATT_COMPARTMENT
TRAINER_MASTER_JACK,
TRAINER_SLAVE_JACK,
TRAINER_MASTER_SBUS_MODULE,
TRAINER_MASTER_CPPM_MODULE,
TRAINER_MASTER_SBUS_BATT_COMPARTMENT
};
class ModuleData {
@@ -847,10 +865,10 @@ class ModuleData {
int failsafeChannels[C9X_NUM_CHNOUT];
int ppmDelay;
bool ppmPulsePol; // false = positive
bool ppmOutputType; // false = open drain, true = push pull
bool ppmOutputType; // false = open drain, true = push pull
int ppmFrameLength;
void clear() { memset(this, 0, sizeof(ModuleData)); }
QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); }
QString polarityToString() const { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter
};
#define C9X_MAX_SCRIPTS 7
@@ -992,6 +1010,11 @@ class ModelData {
void removeInput(const int idx);
bool isInputValid(const unsigned int idx) const;
bool hasExpos(uint8_t inputIdx) const;
bool hasMixes(uint8_t output) const;
QVector<const ExpoData *> expos(int input) const;
QVector<const MixData *> mixes(int channel) const;
bool used;
char name[12+1];
@@ -1042,8 +1065,10 @@ class ModelData {
SensorData sensorData[C9X_MAX_SENSORS];
unsigned int toplcdTimer;
void clear();
bool isempty();
bool isEmpty() const;
void setDefaultInputs(const GeneralSettings & settings);
void setDefaultMixes(const GeneralSettings & settings);
void setDefaultValues(unsigned int id, const GeneralSettings & settings);
@@ -1127,7 +1152,8 @@ class GeneralSettings {
unsigned int currModel; // 0..15
unsigned int contrast;
unsigned int vBatWarn;
int vBatCalib;
int txVoltageCalibration;
int txCurrentCalibration;
int vBatMin;
int vBatMax;
int backlightMode;
@@ -1175,7 +1201,6 @@ class GeneralSettings {
int speakerVolume;
unsigned int backlightBright;
int switchesDelay;
int currentCalib;
int temperatureCalib;
int temperatureWarn;
unsigned int mAhWarn;
@@ -1276,7 +1301,6 @@ enum Capability {
HasExpoNames,
HasNoExpo,
HasMixerNames,
HasChNames,
HasCvNames,
HasPxxCountry,
HasPPMStart,
@@ -1306,7 +1330,7 @@ enum Capability {
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HasCurrentCalibration,
HastxCurrentCalibration,
HasVolume,
HasBrightness,
PerModelTimers,
@@ -1318,6 +1342,7 @@ enum Capability {
LCDWidth,
GetThrSwitch,
HasDisplayText,
HasTopLcd,
GlobalFunctions,
VirtualInputs,
TrainerInputs,
@@ -1337,7 +1362,8 @@ enum Capability {
HasInputDiff,
HasMixerExpo,
MixersMonitor,
HasBatMeterRange
HasBatMeterRange,
DangerousFunctions,
};
class SimulatorInterface;
@@ -1354,19 +1380,17 @@ class EEPROMInterface
inline BoardEnum getBoard() { return board; }
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
virtual unsigned long load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
virtual unsigned long loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc) = 0;
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
virtual int getSize(ModelData &) = 0;
virtual int getSize(const ModelData &) = 0;
virtual int getSize(GeneralSettings &) = 0;
virtual int isAvailable(Protocol proto, int port=0) = 0;
virtual int getSize(const GeneralSettings &) = 0;
virtual const int getEEpromSize() = 0;
@@ -1479,11 +1503,37 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
void registerEEpromInterfaces();
void unregisterEEpromInterfaces();
void registerOpenTxFirmwares();
void unregisterFirmwares();
void unregisterOpenTxFirmwares();
bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
bool loadEEprom(RadioData &radioData, const uint8_t *eeprom, int size);
bool loadEEpromXml(RadioData &radioData, QDomDocument &doc);
enum EepromLoadErrors {
NO_ERROR,
UNKNOWN_ERROR,
UNSUPPORTED_NEWER_VERSION,
WRONG_SIZE,
WRONG_FILE_SYSTEM,
NOT_OPENTX,
NOT_TH9X,
NOT_GRUVIN9X,
NOT_ERSKY9X,
NOT_ER9X,
UNKNOWN_BOARD,
WRONG_BOARD,
BACKUP_NOT_SUPPORTED,
HAS_WARNINGS,
OLD_VERSION,
WARNING_WRONG_FIRMWARE,
NUM_ERRORS
};
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc);
struct Option {
const char * name;
@@ -1577,6 +1627,8 @@ class Firmware {
virtual bool isTelemetrySourceAvailable(int source) = 0;
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
public:
QList<const char *> languages;
QList<const char *> ttslanguages;
+5 -9
View File
@@ -122,20 +122,16 @@ PACK(struct EepromFileHeader
bool RleFile::searchFat()
{
int bestFatIndex = -1;
eepromFatHeader = NULL;
uint32_t bestFatIndex = 0;
for (int i=0; i<EEPROM_ZONE_SIZE/EEPROM_FAT_SIZE; i++) {
EepromHeader * header = (EepromHeader *)(eeprom+i*EEPROM_FAT_SIZE);
if (header->mark == EEPROM_MARK && (int)header->index >= bestFatIndex) {
bestFatIndex = i;
eepromFatHeader = header;
bestFatIndex = header->index;
}
}
if (bestFatIndex >= 0) {
eepromFatHeader = (EepromHeader *)(eeprom+bestFatIndex*EEPROM_FAT_SIZE);;
return true;
}
else {
return false;
}
return (eepromFatHeader != NULL);
}
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
View File
View File
+5 -5
View File
@@ -70,7 +70,7 @@ Er9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.txVoltageCalibration = txVoltageCalibration;
result.trainer = trainer;
result.blightinv=blightinv;
result.stickScroll=stickScroll;
@@ -361,16 +361,16 @@ t_Er9xModelData::operator ModelData ()
c9x.timers[0].val = tmrVal;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
+1 -1
View File
@@ -61,7 +61,7 @@ PACK(typedef struct t_Er9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t txVoltageCalibration;
int8_t lightSw;
Er9xTrainerData trainer;
uint8_t view;
+34 -19
View File
@@ -89,14 +89,17 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Er9xGeneral er9xGeneral;
memset(&er9xGeneral,0,sizeof(er9xGeneral));
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -111,21 +114,26 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -133,7 +141,8 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
@@ -151,13 +160,16 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
break;
default:
std::cout << "not er9x\n";
return false;
errors.set(NOT_ER9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = er9xGeneral;
@@ -174,12 +186,15 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -190,23 +205,23 @@ int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
return 0;
}
int Er9xInterface::getSize(ModelData &model)
int Er9xInterface::getSize(const ModelData &model)
{
return 0;
}
int Er9xInterface::getSize(GeneralSettings &settings)
int Er9xInterface::getSize(const GeneralSettings &settings)
{
return 0;
}
int Er9xInterface::isAvailable(Protocol prot, int port)
int Er9xInterface::isAvailable(PulsesProtocol prot, int port)
{
switch (prot) {
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
case PULSES_PPM:
case PULSES_DSM2:
case PULSES_PXX_DJT:
case PULSES_PPM16:
return 1;
default:
return 0;
+16 -16
View File
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -29,24 +29,24 @@ class Er9xInterface : public EEPROMInterface
virtual ~Er9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int getSize(const ModelData &);
virtual int isAvailable(Protocol proto, int port=0);
virtual int getSize(const GeneralSettings &settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
@@ -54,17 +54,17 @@ class Er9xInterface : public EEPROMInterface
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
};
@@ -54,8 +54,14 @@ class Er9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Er9xInterface * er9xInterface;
@@ -82,7 +82,7 @@ Ersky9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.txVoltageCalibration = txVoltageCalibration;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -135,7 +135,7 @@ Ersky9xGeneral::operator GeneralSettings ()
result.switchWarningStates = switchWarningStates;
result.speakerVolume = volume;
result.backlightBright = bright ;
result.currentCalib = current_calib;
result.txCurrentCalibration = current_calib;
return result;
}
@@ -493,16 +493,16 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
@@ -608,16 +608,16 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
@@ -69,7 +69,7 @@ PACK(typedef struct t_Ersky9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t txVoltageCalibration;
int8_t lightSw;
Ersky9xTrainerData trainer;
uint8_t view;
@@ -15,7 +15,6 @@
*/
#include <iostream>
#include <QMessageBox>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "simulator/ersky9xsimulator.h"
@@ -120,14 +119,17 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Ersky9xGeneral ersky9xGeneral;
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
else {
radioData.generalSettings=ersky9xGeneral;
@@ -137,32 +139,39 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
if (ersky9xGeneral.myVers == 10) {
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != EESIZE_SKY9X) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -170,7 +179,8 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
@@ -182,12 +192,14 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
break;
default:
std::cout << "not ersky9x\n";
return false;
errors.set(NOT_ERSKY9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = ersky9xGeneral;
@@ -218,12 +230,15 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -234,23 +249,23 @@ int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varia
return 0;
}
int Ersky9xInterface::getSize(ModelData &model)
int Ersky9xInterface::getSize(const ModelData & model)
{
return 0;
}
int Ersky9xInterface::getSize(GeneralSettings &settings)
int Ersky9xInterface::getSize(const GeneralSettings & settings)
{
return 0;
}
int Ersky9xInterface::isAvailable(Protocol prot, int port)
int Ersky9xInterface::isAvailable(PulsesProtocol prot, int port)
{
switch (prot) {
case PPM:
case DSM2:
case PXX_DJT:
case PPM16:
case PULSES_PPM:
case PULSES_DSM2:
case PULSES_PXX_DJT:
case PULSES_PPM16:
return 1;
default:
return 0;
@@ -34,19 +34,19 @@ class Ersky9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(const ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int getSize(const GeneralSettings & settings);
virtual int isAvailable(Protocol proto, int port=0);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
@@ -54,8 +54,14 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Ersky9xInterface * ersky9xInterface;
@@ -70,7 +70,7 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.txVoltageCalibration = txVoltageCalibration;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -127,7 +127,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.txVoltageCalibration = txVoltageCalibration;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -170,12 +170,12 @@ t_Gruvin9xExpoData::operator ExpoData ()
c9x.chn = chn;
c9x.swtch = gruvin9xToSwitch(swtch);
if (negPhase) {
c9x.phases= 1 << (phase -1);
c9x.flightModes= 1 << (phase -1);
} else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
} else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.weight = weight;
if (expo) {
@@ -423,25 +423,25 @@ t_Gruvin9xModelData_v102::operator ModelData ()
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -493,25 +493,25 @@ t_Gruvin9xModelData_v103::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -563,25 +563,25 @@ t_Gruvin9xModelData_v105::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -653,25 +653,25 @@ t_Gruvin9xModelData_v106::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = SILV_A;
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = SILV_B;
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = SILV_C;
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = CTP1009;
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -69,7 +69,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v103 {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t txVoltageCalibration;
int8_t lightSw;
Gruvin9xTrainerData_v103 trainer;
uint8_t view; //index of subview in main scrren
@@ -106,7 +106,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t txVoltageCalibration;
int8_t lightSw;
Gruvin9xTrainerData_v104 trainer;
uint8_t view; //index of subview in main scrren
@@ -93,24 +93,30 @@ bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
return false;
}
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import... ";
std::bitset<NUM_ERRORS> errors;
if (size != this->getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -118,14 +124,16 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
if (version == 0) {
efile->openRd(FILE_GENERAL);
if (efile->readRlc1(&version, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
@@ -145,25 +153,33 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
break;
default:
std::cout << "not gruvin9x\n";
return false;
errors.set(NOT_GRUVIN9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (version == 5) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
return false;
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else if (version < 104) {
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
return false;
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else if (version <= 106) {
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
return false;
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
for (int i=0; i<getMaxModels(); i++) {
@@ -185,17 +201,21 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
}
else {
std::cout << "ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -206,25 +226,25 @@ int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t vari
return 0;
}
int Gruvin9xInterface::getSize(ModelData &model)
int Gruvin9xInterface::getSize(const ModelData & model)
{
return 0;
}
int Gruvin9xInterface::getSize(GeneralSettings &settings)
int Gruvin9xInterface::getSize(const GeneralSettings & settings)
{
return 0;
}
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
int Gruvin9xInterface::isAvailable(PulsesProtocol proto, int port)
{
switch (proto) {
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
case DSM2:
case PULSES_PPM:
case PULSES_SILV_A:
case PULSES_SILV_B:
case PULSES_SILV_C:
case PULSES_CTP1009:
case PULSES_DSM2:
return 1;
default:
return 0;
@@ -1,6 +1,6 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
@@ -30,24 +30,25 @@ class Gruvin9xInterface : public EEPROMInterface
virtual ~Gruvin9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(GeneralSettings &settings);
virtual int getSize(const ModelData &);
virtual int isAvailable(Protocol proto, int port=0);
virtual int getSize(const GeneralSettings & settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
@@ -87,14 +87,14 @@ t_Open9xGruvin9xMixData_v207::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -155,14 +155,14 @@ t_Open9xGruvin9xMixData_v209::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -222,7 +222,7 @@ t_Open9xGruvin9xMixData_v211::operator MixData ()
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.phases = phases;
c9x.flightModes = phases;
c9x.sOffset = sOffset;
}
return c9x;
@@ -440,16 +440,16 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -514,19 +514,19 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -596,19 +596,19 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -679,19 +679,19 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -766,19 +766,19 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -160,12 +160,12 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
}
c9x.swtch = open9xArmToSwitch(swtch);
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
} else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
} else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.weight = weight;
return c9x;
@@ -190,14 +190,14 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
}
c9x.swtch = open9xArmToSwitch(swtch);
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.weight = weight;
getEEPROMZString(c9x.name, name, sizeof(name));
@@ -213,7 +213,7 @@ t_Open9xArmExpoData_v212::operator ExpoData ()
// TODO c9x.curveMode=curveMode;
// c9x.curveParam=curveParam;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.phases= phases;
c9x.flightModes= phases;
c9x.weight = weight;
getEEPROMZString(c9x.name, name, sizeof(name));
return c9x;
@@ -292,14 +292,14 @@ t_Open9xArmMixData_v208::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -358,14 +358,14 @@ t_Open9xArmMixData_v209::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -424,14 +424,14 @@ t_Open9xArmMixData_v210::operator MixData ()
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
c9x.flightModes= 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
c9x.flightModes=0;
}
else {
c9x.phases=511;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes=511;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
@@ -493,7 +493,7 @@ t_Open9xArmMixData_v212::operator MixData ()
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.phases = phases;
c9x.flightModes = phases;
c9x.sOffset = sOffset;
getEEPROMZString(c9x.name, name, sizeof(name));
}
@@ -716,19 +716,19 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -799,19 +799,19 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -883,19 +883,19 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -967,19 +967,19 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1054,19 +1054,19 @@ t_Open9xArmModelData_v212::operator ModelData ()
}
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -88,7 +88,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
ExpoData c9x;
c9x.mode = mode;
c9x.chn = chn;
if (expo!=0 && curve!=0) {
if (expo != 0 && curve != 0) {
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
}
else {
@@ -101,14 +101,14 @@ t_Open9xExpoData_v201::operator ExpoData ()
}
c9x.swtch = open9xStockToSwitch(swtch);
if (negPhase) {
c9x.phases= 1 << (phase -1);
c9x.flightModes = 1 << (phase -1);
}
else if (phase==0) {
c9x.phases=0;
else if (phase == 0) {
c9x.flightModes = 0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes = 63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.weight = weight;
return c9x;
@@ -121,7 +121,7 @@ t_Open9xExpoData_v211::operator ExpoData ()
c9x.chn = chn;
// TODO c9x.curve
c9x.swtch = open9xStockToSwitch(swtch);
c9x.phases = phases;
c9x.flightModes = phases;
c9x.weight = weight;
return c9x;
}
@@ -129,8 +129,8 @@ t_Open9xExpoData_v211::operator ExpoData ()
t_Open9xLimitData_v201::operator LimitData ()
{
LimitData c9x;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.min = 10 * (min - 100);
c9x.max = 10 * (max + 100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -139,12 +139,12 @@ t_Open9xLimitData_v201::operator LimitData ()
t_Open9xLimitData_v211::operator LimitData ()
{
LimitData c9x;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.min = 10 * (min - 100);
c9x.max = 10 * (max + 100);
c9x.revert = revert;
c9x.offset = offset;
c9x.symetrical=symetrical;
c9x.ppmCenter=ppmCenter;
c9x.symetrical = symetrical;
c9x.ppmCenter = ppmCenter;
return c9x;
}
@@ -197,13 +197,13 @@ t_Open9xMixData_v201::operator MixData ()
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
} else if (phase==0) {
c9x.phases=0;
if (phase < 0) {
c9x.flightModes = 1 << (-phase -1);
} else if (phase == 0) {
c9x.flightModes = 0;
} else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes = 63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
return c9x;
@@ -258,13 +258,13 @@ t_Open9xMixData_v203::operator MixData ()
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
} else if (phase==0) {
c9x.phases=0;
if (phase < 0) {
c9x.flightModes = 1 << (-phase -1);
} else if (phase == 0) {
c9x.flightModes = 0;
} else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes = 63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
return c9x;
@@ -319,15 +319,15 @@ t_Open9xMixData_v205::operator MixData ()
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
if (phase < 0) {
c9x.flightModes = 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
else if (phase == 0) {
c9x.flightModes = 0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes = 63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -339,7 +339,7 @@ t_Open9xMixData_v209::operator MixData ()
MixData c9x;
if (srcRaw) {
c9x.destCh = destCh+1;
c9x.destCh = destCh + 1;
c9x.swtch = open9xStockToSwitch(swtch);
if (srcRaw == 0) {
@@ -386,15 +386,15 @@ t_Open9xMixData_v209::operator MixData ()
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
if (phase<0) {
c9x.phases= 1 << (-phase -1);
if (phase < 0) {
c9x.flightModes = 1 << (-phase -1);
}
else if (phase==0) {
c9x.phases=0;
else if (phase ==0 ) {
c9x.flightModes = 0;
}
else {
c9x.phases=63;
c9x.phases &= ~(1 << (phase -1));
c9x.flightModes = 63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.sOffset = sOffset;
}
@@ -406,7 +406,7 @@ t_Open9xMixData_v211::operator MixData ()
MixData c9x;
if (srcRaw) {
c9x.destCh = destCh+1;
c9x.destCh = destCh + 1;
c9x.swtch = open9xStockToSwitch(swtch);
if (srcRaw == 0) {
@@ -453,7 +453,7 @@ t_Open9xMixData_v211::operator MixData ()
c9x.noExpo = noExpo;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.phases = phases;
c9x.flightModes = phases;
c9x.sOffset = sOffset;
}
return c9x;
@@ -603,8 +603,8 @@ t_Open9xCustomFunctionData_v203::operator CustomFunctionData ()
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
c9x.enabled = param & 0x01;
c9x.param = (param>>1) << 1;
c9x.func = (AssignFunc)(func);
} else {
c9x.param = param;
@@ -730,7 +730,7 @@ t_Open9xTimerData_v202::operator TimerData ()
FrSkyRSSIAlarm t_Open9xFrSkyRSSIAlarm::get(int index)
{
FrSkyRSSIAlarm c9x;
c9x.level = (2+index+level) % 4;
c9x.level = (2 + index + level) % 4;
c9x.value = value + 50;
return c9x;
}
@@ -840,7 +840,7 @@ t_Open9xFrSkyData_v204::operator FrSkyData ()
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
c9x.usrProto = usrProto;
c9x.blades = blades+2;
c9x.blades = blades + 2;
c9x.screens[0].type = 1;
for (int i=0; i<4; i++)
c9x.screens[0].body.bars[i] = bars[i];
@@ -853,7 +853,7 @@ t_Open9xFrSkyData_v205::operator FrSkyData ()
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
c9x.usrProto = usrProto;
c9x.blades = blades+2;
c9x.blades = blades + 2;
c9x.screens[0].type = 1;
for (int i=0; i<4; i++)
c9x.screens[0].body.bars[i] = bars[i];
@@ -869,7 +869,7 @@ t_Open9xFrSkyData_v208::operator FrSkyData ()
c9x.channels[1] = channels[1];
c9x.usrProto = usrProto;
c9x.voltsSource = voltsSource;
c9x.blades = blades+2;
c9x.blades = blades + 2;
c9x.currentSource=currentSource;
c9x.screens[0].type = 1;
for (int i=0; i<4; i++)
@@ -886,7 +886,7 @@ t_Open9xFrSkyData_v210::operator FrSkyData ()
c9x.channels[1] = channels[1];
c9x.usrProto = usrProto;
c9x.voltsSource = voltsSource;
c9x.blades = blades+2;
c9x.blades = blades + 2;
c9x.currentSource=currentSource;
int lines_screen_index = 0;
@@ -917,16 +917,16 @@ t_Open9xModelData_v201::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -991,16 +991,16 @@ t_Open9xModelData_v202::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1067,16 +1067,16 @@ t_Open9xModelData_v203::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1141,16 +1141,16 @@ t_Open9xModelData_v204::operator ModelData ()
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1217,19 +1217,19 @@ t_Open9xModelData_v205::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 4:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1295,19 +1295,19 @@ t_Open9xModelData_v208::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1381,19 +1381,19 @@ t_Open9xModelData_v209::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1468,19 +1468,19 @@ t_Open9xModelData_v210::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
@@ -1556,19 +1556,19 @@ t_Open9xModelData_v211::operator ModelData ()
c9x.timers[i] = timers[i];
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PPM16;
c9x.moduleData[0].protocol = PULSES_PPM16;
break;
case 2:
c9x.moduleData[0].protocol = PPMSIM;
c9x.moduleData[0].protocol = PULSES_PPMSIM;
break;
case 3:
c9x.moduleData[0].protocol = PXX_DJT;
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 4:
c9x.moduleData[0].protocol = DSM2;
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
default:
c9x.moduleData[0].protocol = PPM;
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
+122 -108
View File
@@ -12,7 +12,7 @@
#define HAS_PERSISTENT_TIMERS(board) (IS_ARM(board) || IS_2560(board))
#define HAS_LARGE_LCD(board) IS_TARANIS(board)
#define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256)
#define MAX_POTS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 3) : 3)
#define MAX_POTS(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : (version >= 216 ? 3 : 2)) : 3)
#define MAX_SLIDERS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 2) : 0)
#define MAX_SWITCHES(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 18 : 8) : 7)
#define MAX_SWITCHES_POSITION(board, version) (IS_TARANIS_X9E(board) ? 18*3 : (IS_TARANIS(board) ? 8*3 : 9))
@@ -80,7 +80,7 @@ class SwitchesConversionTable: public ConversionTable {
}
if (IS_TARANIS(board) && version >= 216) {
for (int i=1; i<=MAX_POTS(board)*6; i++) {
for (int i=1; i<=MAX_POTS(board, version)*6; i++) {
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++);
}
@@ -212,8 +212,9 @@ class SourcesConversionTable: public ConversionTable {
}
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++)
for (int i=0; i<32; i++) {
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
}
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
@@ -221,16 +222,18 @@ class SourcesConversionTable: public ConversionTable {
}
}
for (int i=0; i<NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board); i++) {
for (int i=0; i<NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
addConversion(RawSource(SOURCE_TYPE_STICK, i), val++);
}
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++)
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++) {
addConversion(RawSource(SOURCE_TYPE_ROTARY_ENCODER, 0), val++);
}
if (!afterrelease21March2013) {
for (int i=0; i<NUM_STICKS; i++)
for (int i=0; i<NUM_STICKS; i++) {
addConversion(RawSource(SOURCE_TYPE_TRIM, i), val++);
}
}
addConversion(RawSource(SOURCE_TYPE_MAX), val++);
@@ -266,15 +269,18 @@ class SourcesConversionTable: public ConversionTable {
}
if (!afterrelease21March2013) {
for (int i=0; i<3; i++)
for (int i=0; i<3; i++) {
addConversion(RawSource(SOURCE_TYPE_CYC, i), val++);
}
}
for (int i=0; i<NUM_PPM_INPUTS(board, version); i++)
for (int i=0; i<NUM_PPM_INPUTS(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_PPM, i), val++);
}
for (int i=0; i<MAX_CHANNELS(board, version); i++)
for (int i=0; i<MAX_CHANNELS(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_CH, i), val++);
}
if (!(flags & FLAG_NOTELEMETRY)) {
if (IS_ARM(board) && version >= 217) {
@@ -290,33 +296,34 @@ 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++)
for (int i=0; i<MAX_GVARS(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_GVAR, i), val++);
}
}
}
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++);
}
}
}
@@ -380,38 +387,12 @@ void OpenTxEepromCleanup(void)
SwitchesConversionTable::Cleanup();
}
ThrottleSourceConversionTable::ThrottleSourceConversionTable(BoardEnum board, unsigned int version)
{
int val=0;
addConversion(THROTTLE_SOURCE_THR, val++);
if (IS_TARANIS(board)) {
addConversion(THROTTLE_SOURCE_S1, val++);
addConversion(THROTTLE_SOURCE_S2, val++);
if (version >= 216)
addConversion(THROTTLE_SOURCE_S3, val++);
addConversion(THROTTLE_SOURCE_LS, val++);
addConversion(THROTTLE_SOURCE_RS, val++);
}
else {
addConversion(THROTTLE_SOURCE_P1, val++);
addConversion(THROTTLE_SOURCE_P2, val++);
addConversion(THROTTLE_SOURCE_P3, val++);
}
for (int i=0; i<MAX_CHANNELS(board, version); i++) {
addConversion(THROTTLE_SOURCE_FIRST_CHANNEL+i, val++);
}
}
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), "Switch",
"Switch "+ sw.toString()+" cannot be exported on this board!"),
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)
{
@@ -943,7 +924,7 @@ class MixField: public TransformedField {
{
if (IS_TARANIS(board) && version >= 217) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<9>(mix.phases));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
internalField.Append(new UnsignedField<4>(mix.mixWarn));
@@ -961,7 +942,7 @@ class MixField: public TransformedField {
else if (IS_ARM(board) && version >= 217) {
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new UnsignedField<3>(mix.mixWarn));
internalField.Append(new UnsignedField<9>(mix.phases));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new BoolField<1>(mix.noExpo));
internalField.Append(new SignedField<3>(mix.carryTrim));
@@ -979,7 +960,7 @@ class MixField: public TransformedField {
}
else if (IS_TARANIS(board) && version == 216) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new UnsignedField<16>(mix.flightModes));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
internalField.Append(new SpareBitsField<5>());
@@ -1000,7 +981,7 @@ class MixField: public TransformedField {
else if (IS_ARM(board) && version == 216) {
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new UnsignedField<3>(mix.mixWarn));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new UnsignedField<16>(mix.flightModes));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new BoolField<1>(mix.noExpo));
internalField.Append(new SignedField<3>(mix.carryTrim));
@@ -1019,7 +1000,7 @@ class MixField: public TransformedField {
}
else if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new UnsignedField<16>(mix.flightModes));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new BoolField<1>(mix.noExpo));
internalField.Append(new SignedField<3>(mix.carryTrim));
@@ -1064,7 +1045,7 @@ class MixField: public TransformedField {
internalField.Append(new SourceField<8>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
internalField.Append(new SignedField<8>(_weight));
internalField.Append(new SwitchField<8>(mix.swtch, board, version));
internalField.Append(new UnsignedField<8>(mix.phases));
internalField.Append(new UnsignedField<8>(mix.flightModes));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new SignedField<3>(mix.carryTrim));
internalField.Append(new UnsignedField<2>(mix.mixWarn));
@@ -1085,7 +1066,7 @@ class MixField: public TransformedField {
internalField.Append(new SignedField<8>(_weight));
internalField.Append(new SwitchField<6>(mix.swtch, board, version));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new UnsignedField<5>(mix.phases));
internalField.Append(new UnsignedField<5>(mix.flightModes));
internalField.Append(new SignedField<3>(mix.carryTrim));
internalField.Append(new SourceField<6>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
internalField.Append(new UnsignedField<2>(mix.mixWarn));
@@ -1214,7 +1195,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new UnsignedField<16>(expo.phases));
internalField.Append(new UnsignedField<16>(expo.flightModes));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
@@ -1226,7 +1207,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new UnsignedField<3>(expo.chn, "Channel"));
internalField.Append(new BoolField<2>(_curveMode));
internalField.Append(new UnsignedField<9>(expo.phases, "Phases"));
internalField.Append(new UnsignedField<9>(expo.flightModes, "Phases"));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new ZCharField<6>(expo.name));
@@ -1237,7 +1218,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<16>(expo.scale, "Scale"));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new UnsignedField<16>(expo.phases));
internalField.Append(new UnsignedField<16>(expo.flightModes));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
@@ -1251,7 +1232,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<4>(expo.chn, "Channel"));
internalField.Append(new BoolField<2>(_curveMode));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new UnsignedField<16>(expo.phases, "Phases"));
internalField.Append(new UnsignedField<16>(expo.flightModes, "Phases"));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new ZCharField<6>(expo.name));
internalField.Append(new SignedField<8>(_curveParam));
@@ -1260,7 +1241,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<8>(expo.mode, "Mode"));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new UnsignedField<16>(expo.phases, "Phases"));
internalField.Append(new UnsignedField<16>(expo.flightModes, "Phases"));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new BoolField<8>(_curveMode));
if (HAS_LARGE_LCD(board)) {
@@ -1277,7 +1258,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<2>(expo.chn));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new SpareBitsField<3>());
internalField.Append(new UnsignedField<8>(expo.phases));
internalField.Append(new UnsignedField<8>(expo.flightModes));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new SignedField<8>(_weight));
internalField.Append(new SignedField<8>(_curveParam));
@@ -1286,7 +1267,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<2>(expo.mode));
internalField.Append(new SwitchField<6>(expo.swtch, board, version));
internalField.Append(new UnsignedField<2>(expo.chn));
internalField.Append(new UnsignedField<5>(expo.phases));
internalField.Append(new UnsignedField<5>(expo.flightModes));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new SignedField<8>(_weight));
internalField.Append(new SignedField<8>(_curveParam));
@@ -1702,12 +1683,6 @@ class LogicalSwitchField: public TransformedField {
internalField.Append(new SignedField<16>(v3));
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
}
else if (IS_ARM(board) && version >= 216) {
internalField.Append(new SignedField<8>(v1));
internalField.Append(new SignedField<16>(v2));
internalField.Append(new SignedField<16>(v3));
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
}
else if (IS_ARM(board) && version >= 215) {
internalField.Append(new SignedField<16>(v1));
internalField.Append(new SignedField<16>(v2));
@@ -1746,6 +1721,7 @@ class LogicalSwitchField: public TransformedField {
{
delete andswitchesConversionTable;
}
virtual void beforeExport()
{
if (csw.func == LS_FN_TIMER) {
@@ -1787,8 +1763,14 @@ class LogicalSwitchField: public TransformedField {
switchesConversionTable->importValue(v2, csw.val2);
}
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
if (IS_ARM(board)) {
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
sourcesConversionTable->importValue((uint32_t)v2, csw.val2);
}
else {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
}
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
@@ -1801,7 +1783,12 @@ class LogicalSwitchField: public TransformedField {
}
}
else if (csw.func != LS_FN_OFF) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
if (IS_ARM(board) && version >= 217) {
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
}
else {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
}
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
@@ -1930,9 +1917,12 @@ class CustomFunctionsConversionTable: public ConversionTable {
val++;
if (IS_ARM(board)) {
addConversion(FuncVolume, val++);
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncSetFailsafeInternalModule, val);
addConversion(FuncSetFailsafeExternalModule, val++);
addConversion(FuncRangeCheckInternalModule, val);
addConversion(FuncRangeCheckExternalModule, val++);
addConversion(FuncBindInternalModule, val);
addConversion(FuncBindExternalModule, val++);
}
addConversion(FuncPlaySound, val++);
addConversion(FuncPlayPrompt, val++);
@@ -2091,6 +2081,21 @@ class ArmCustomFunctionField: public TransformedField {
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
}
}
else if (fn.func >= FuncSetFailsafeInternalModule && fn.func <= FuncSetFailsafeExternalModule) {
if (version >= 216) {
*((uint16_t *)_param) = fn.func - FuncSetFailsafeInternalModule;
}
}
else if (fn.func >= FuncRangeCheckInternalModule && fn.func <= FuncRangeCheckExternalModule) {
if (version >= 216) {
*((uint16_t *)_param) = fn.func - FuncRangeCheckInternalModule;
}
}
else if (fn.func >= FuncBindInternalModule && fn.func <= FuncBindExternalModule) {
if (version >= 216) {
*((uint16_t *)_param) = fn.func - FuncBindInternalModule;
}
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(_param, fn.paramarm, sizeof(_param));
}
@@ -2206,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);
}
@@ -2809,7 +2815,8 @@ class SensorField: public TransformedField {
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
_id = sensor.id;
_instance = sensor.instance;
_param = (sensor.ratio) + ((unsigned int)sensor.offset << 16);
_ratio = sensor.ratio;
_offset = sensor.offset;
}
else {
_id = sensor.persistentValue;
@@ -2820,7 +2827,7 @@ class SensorField: public TransformedField {
_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);
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
_param = (sensor.amps);
}
}
@@ -2830,8 +2837,8 @@ class SensorField: public TransformedField {
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
sensor.id = _id;
sensor.instance = _instance;
sensor.ratio = _param & 0xFFFF;
sensor.offset = (_param >> 16) & 0xFFFF;
sensor.ratio = _ratio;
sensor.offset = _offset;
}
else {
sensor.persistentValue = _id;
@@ -2843,7 +2850,7 @@ class SensorField: public TransformedField {
sensor.sources[i] = _sources[i];
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
(sensor.gps = _sources[0], sensor.alt = _sources[1]);
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
sensor.amps = _sources[0];
}
eepromImportDebug() << QString("imported %1").arg(internalField.getName());
@@ -2857,6 +2864,10 @@ class SensorField: public TransformedField {
union {
unsigned int _param;
uint8_t _sources[4];
struct {
uint16_t _ratio;
int16_t _offset;
};
};
};
@@ -2870,8 +2881,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
board(board),
version(version),
variant(variant),
protocolsConversionTable(board),
throttleSourceConversionTable(board, version)
protocolsConversionTable(board)
{
sprintf(name, "Model %s", modelData.name);
@@ -3006,7 +3016,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
}
internalField.Append(new ConversionField< UnsignedField<8> >(modelData.thrTraceSrc, &throttleSourceConversionTable, "Throttle Source"));
internalField.Append(new UnsignedField<8>(modelData.thrTraceSrc, "Throttle Source"));
if (!afterrelease21March2013) {
internalField.Append(new UnsignedField<8>(modelData.moduleData[0].modelId));
@@ -3148,7 +3158,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board) && version >= 217) {
for (int i=0; i<8; i++) {
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
else
internalField.Append(new SpareBitsField<1>());
@@ -3156,7 +3166,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
else if (IS_ARM(board) && version >= 216) {
for (int i=0; i<6; i++) {
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
else
internalField.Append(new SpareBitsField<1>());
@@ -3165,7 +3175,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
if (IS_ARM(board) && version >= 216) {
for (int i=0; i < MAX_POTS(board)+MAX_SLIDERS(board); i++) {
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
}
}
@@ -3184,6 +3194,10 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new SensorField(modelData.sensorData[i], board, version));
}
}
if (IS_TARANIS_X9E(board)) {
internalField.Append(new UnsignedField<8>(modelData.toplcdTimer));
}
}
void OpenTxModelData::beforeExport()
@@ -3191,10 +3205,10 @@ void OpenTxModelData::beforeExport()
// qDebug() << QString("before export model") << modelData.name;
for (int module=0; module<3; module++) {
if (modelData.moduleData[module].protocol >= PXX_XJT_X16 && modelData.moduleData[module].protocol <= PXX_XJT_LR12)
subprotocols[module] = modelData.moduleData[module].protocol - PXX_XJT_X16;
else if (modelData.moduleData[module].protocol >= LP45 && modelData.moduleData[module].protocol <= DSMX)
subprotocols[module] = modelData.moduleData[module].protocol - LP45;
if (modelData.moduleData[module].protocol >= PULSES_PXX_XJT_X16 && modelData.moduleData[module].protocol <= PULSES_PXX_XJT_LR12)
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_PXX_XJT_X16;
else if (modelData.moduleData[module].protocol >= PULSES_LP45 && modelData.moduleData[module].protocol <= PULSES_DSMX)
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_LP45;
else
subprotocols[module] = (module==0 ? -1 : 0);
}
@@ -3208,7 +3222,7 @@ void OpenTxModelData::afterImport()
for (unsigned int i=0; i<NUM_STICKS; i++) {
for (int j=0; j<64; j++) {
ExpoData * expo = &modelData.expoData[j];
if (expo->mode == INPUT_MODE_BOTH && expo->chn == i && expo->phases == 0 && expo->swtch.type == SWITCH_TYPE_NONE)
if (expo->mode == INPUT_MODE_BOTH && expo->chn == i && expo->flightModes == 0 && expo->swtch.type == SWITCH_TYPE_NONE)
break;
if (expo->mode == 0 || expo->chn > i) {
ExpoData * newExpo = modelData.insertInput(j);
@@ -3224,15 +3238,15 @@ void OpenTxModelData::afterImport()
}
for (int module=0; module<3; module++) {
if (modelData.moduleData[module].protocol == PXX_XJT_X16 || modelData.moduleData[module].protocol == LP45) {
if (modelData.moduleData[module].protocol == PULSES_PXX_XJT_X16 || modelData.moduleData[module].protocol == PULSES_LP45) {
if (subprotocols[module] >= 0)
modelData.moduleData[module].protocol += subprotocols[module];
else
modelData.moduleData[module].protocol = OFF;
modelData.moduleData[module].protocol = PULSES_OFF;
}
}
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != OFF) {
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != PULSES_OFF) {
modelData.moduleData[1].modelId = modelData.moduleData[0].modelId;
}
}
@@ -3243,7 +3257,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
generalData(generalData),
board(board),
version(version),
inputsCount(NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board))
inputsCount(NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board))
{
eepromImportDebug() << QString("OpenTxGeneralData::OpenTxGeneralData(board: %1, version:%2, variant:%3)").arg(board).arg(version).arg(variant);
@@ -3280,7 +3294,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<8>(generalData.currModel));
internalField.Append(new UnsignedField<8>(generalData.contrast));
internalField.Append(new UnsignedField<8>(generalData.vBatWarn));
internalField.Append(new SignedField<8>(generalData.vBatCalib));
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
internalField.Append(new SignedField<8>(generalData.backlightMode));
for (int i=0; i<NUM_STICKS; i++)
@@ -3364,7 +3378,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
internalField.Append(new SignedField<8>(generalData.currentCalib));
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
@@ -3407,7 +3421,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<8>(generalData.hw_uartMode));
}
for (int i=0; i<4; i++) {
if (i < MAX_POTS(board))
if (i < MAX_POTS(board, version))
internalField.Append(new UnsignedField<2>(generalData.potConfig[i]));
else
internalField.Append(new SpareBitsField<2>());
@@ -3439,7 +3453,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
for (int i=0; i<NUM_STICKS; ++i) {
internalField.Append(new ZCharField<3>(generalData.stickName[i]));
}
for (int i=0; i<MAX_POTS(board); ++i) {
for (int i=0; i<MAX_POTS(board, version); ++i) {
internalField.Append(new ZCharField<3>(generalData.potName[i]));
}
for (int i=0; i<MAX_SLIDERS(board); ++i) {
+17 -21
View File
@@ -56,40 +56,37 @@ class ProtocolsConversionTable: public ConversionTable
{
int val = 0;
if (IS_ARM(board)) {
addConversion(OFF, val++);
addConversion(PULSES_OFF, val++);
}
addConversion(PPM, val++);
addConversion(PULSES_PPM, val++);
if (!IS_ARM(board)) {
addConversion(PPM16, val++);
addConversion(PPMSIM, val++);
addConversion(PULSES_PPM16, val++);
addConversion(PULSES_PPMSIM, val++);
}
if (IS_ARM(board)) {
addConversion(PXX_XJT_X16, val);
addConversion(PXX_XJT_D8, val);
addConversion(PXX_XJT_LR12, val++);
addConversion(PULSES_PXX_XJT_X16, val);
addConversion(PULSES_PXX_XJT_D8, val);
addConversion(PULSES_PXX_XJT_LR12, val++);
}
else {
addConversion(PXX_DJT, val++);
addConversion(PULSES_PXX_DJT, val++);
}
if (IS_ARM(board)) {
addConversion(LP45, val);
addConversion(DSM2, val);
addConversion(DSMX, val++);
addConversion(PULSES_LP45, val);
addConversion(PULSES_DSM2, val);
addConversion(PULSES_DSMX, val++);
}
else {
addConversion(LP45, val++);
addConversion(DSM2, val++);
addConversion(DSMX, val++);
addConversion(PULSES_LP45, val++);
addConversion(PULSES_DSM2, val++);
addConversion(PULSES_DSMX, val++);
}
if (IS_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
}
}
};
class ThrottleSourceConversionTable: public ConversionTable {
public:
ThrottleSourceConversionTable(BoardEnum board, unsigned int version);
};
class ChannelsConversionTable: public ConversionTable
{
public:
@@ -121,7 +118,6 @@ class OpenTxModelData: public TransformedField {
char name[256];
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
ProtocolsConversionTable protocolsConversionTable;
ThrottleSourceConversionTable throttleSourceConversionTable;
ChannelsConversionTable channelsConversionTable;
};
@@ -73,6 +73,8 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for Sky9x board / 9X";
case BOARD_9XRPRO:
return "OpenTX for 9XR-PRO";
case BOARD_AR9X:
return "OpenTX for ar9x board / 9X";
default:
return "OpenTX for an unknown board";
}
@@ -91,6 +93,7 @@ const int OpenTxEepromInterface::getEEpromSize()
case BOARD_SKY9X:
return EESIZE_SKY9X;
case BOARD_9XRPRO:
case BOARD_AR9X:
return EESIZE_9XRPRO;
case BOARD_TARANIS:
case BOARD_TARANIS_PLUS:
@@ -304,15 +307,19 @@ bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, unsi
return (sz == eeprom.size());
}
bool OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import...";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
if (size==4096) {
int notnull=false;
@@ -323,21 +330,25 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
}
if (notnull) {
std::cout << " wrong size (" << size << ")\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
else {
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
errors.set(HAS_WARNINGS);
errors.set(WARNING_WRONG_FIRMWARE);
size=2048;
}
} else {
std::cout << " wrong size (" << size << "/" << getEEpromSize() << ")\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
std::cout << " wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -345,30 +356,39 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << " no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " version " << (unsigned int)version;
if (!checkVersion(version)) {
EepromLoadErrors version_error = checkVersion(version);
if (version_error == OLD_VERSION) {
errors.set(version_error);
errors.set(HAS_WARNINGS);
} else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n";
return false;
errors.set(version_error);
return errors.to_ulong();
}
if (!loadGeneral<OpenTxGeneralData>(radioData.generalSettings, version)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << " variant " << radioData.generalSettings.variant;
for (int i=0; i<getMaxModels(); i++) {
if (!loadModel(version, radioData.models[i], NULL, i, radioData.generalSettings.variant, radioData.generalSettings.stickMode+1)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << " ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -381,6 +401,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
version = 217;
break;
@@ -414,7 +435,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
if (!radioData.models[i].isEmpty()) {
result = saveModel<OpenTxModelData>(i, radioData.models[i], version, variant);
if (!result) {
return 0;
@@ -441,18 +462,18 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
return size;
}
int OpenTxEepromInterface::getSize(ModelData &model)
int OpenTxEepromInterface::getSize(const ModelData & model)
{
if (IS_SKY9X(board))
return 0;
if (model.isempty())
if (model.isEmpty())
return 0;
QByteArray tmp(EESIZE_MAX, 0);
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255/*version max*/);
OpenTxModelData open9xModel(model, board, 255/*version max*/, GetCurrentFirmware()->getVariantNumber());
OpenTxModelData open9xModel((ModelData &)model, board, 255/*version max*/, GetCurrentFirmware()->getVariantNumber());
QByteArray eeprom;
open9xModel.Export(eeprom);
@@ -463,7 +484,7 @@ int OpenTxEepromInterface::getSize(ModelData &model)
return efile->size(0);
}
int OpenTxEepromInterface::getSize(GeneralSettings &settings)
int OpenTxEepromInterface::getSize(const GeneralSettings & settings)
{
if (IS_SKY9X(board))
return 0;
@@ -471,7 +492,7 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
QByteArray tmp(EESIZE_MAX, 0);
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255);
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmware()->getVariantNumber());
OpenTxGeneralData open9xGeneral((GeneralSettings &)settings, board, 255, GetCurrentFirmware()->getVariantNumber());
// open9xGeneral.Dump();
QByteArray eeprom;
@@ -557,8 +578,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
return (IS_TARANIS(board) ? 10 : 6);
case GvarsName:
return (IS_9X(board) ? 0 : 6);
case HasChNames:
return (IS_TARANIS(board) ? 1 : 0);
case GvarsInCS:
case HasFAIMode:
return 1;
@@ -570,7 +589,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
case OffsetWeight:
return (IS_ARM(board) ? 500 : 245);
case Timers:
return (IS_ARM(board) ? 3 : 2);
return ((IS_ARM(board) && id.contains("timer3")) ? 3 : 2);
case TimersName:
return (IS_TARANIS(board) ? 8 : (IS_ARM(board) ? 3 : 0));
case PermTimers:
@@ -649,7 +668,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
case Haptic:
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || id.contains("haptic"));
case ModelTrainerEnable:
if (IS_ARM(board))
if (IS_TARANIS(board))
return 1;
else
return 0;
@@ -707,10 +726,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
case HasFailsafe:
return (IS_ARM(board) ? 32 : 0);
case NumModules:
return (IS_ARM(board) && !IS_9XRPRO(board)) ? 2 : 1;
return (IS_ARM(board) ? 2 : 1);
case HasPPMStart:
return (IS_ARM(board) ? true : false);
case HasCurrentCalibration:
case HastxCurrentCalibration:
return (IS_SKY9X(board) ? true : false);
case HasVolume:
return (IS_ARM(board) ? true : false);
@@ -732,6 +751,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
return (IS_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR) ;
case HasDisplayText:
return IS_ARM(board) ? 1 : 0;
case HasTopLcd:
return IS_TARANIS_X9E(board) ? 1 : 0;
case GlobalFunctions:
return IS_ARM(board) ? 64 : 0;
case VirtualInputs:
@@ -776,7 +797,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
case MixersMonitor:
return id.contains("mixersmon") ? 1 : 0;
case HasBatMeterRange:
return (IS_TARANIS(board) ? true : false);
return (IS_TARANIS(board) ? true : id.contains("battgraph"));
case DangerousFunctions:
return id.contains("danger") ? 1 : 0;
default:
return 0;
}
@@ -793,32 +816,36 @@ bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
return true;
}
int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
{
if (IS_TARANIS(board)) {
switch (port) {
case 0:
switch (proto) {
case OFF:
case PXX_XJT_X16:
case PXX_XJT_D8:
case PXX_XJT_LR12:
case PULSES_OFF:
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_LR12:
return 1;
case PULSES_PXX_XJT_D8:
return id.contains("eu") ? 0 : 1;
case PULSES_PPM:
return id.contains("internalppm") ? 1 : 0;
default:
return 0;
}
break;
case 1:
switch (proto) {
case OFF:
case PPM:
case PXX_XJT_X16:
case PXX_XJT_D8:
case PXX_XJT_LR12:
//case PXX_DJT: // Unavailable for now
case LP45:
case DSM2:
case DSMX:
case PULSES_OFF:
case PULSES_PPM:
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
//case PULSES_PXX_DJT: // Unavailable for now
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
case PULSES_CROSSFIRE:
return 1;
default:
return 0;
@@ -826,7 +853,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
break;
case -1:
switch (proto) {
case PPM:
case PULSES_PPM:
return 1;
default:
return 0;
@@ -840,13 +867,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
switch (port) {
case 0:
switch (proto) {
case PPM:
// case PXX_XJT_X16:
// case PXX_XJT_D8:
// case PXX_XJT_LR12:
case LP45:
case DSM2:
case DSMX:
case PULSES_PPM:
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
return 1;
default:
return 0;
@@ -854,7 +881,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
break;
case 1:
switch (proto) {
case PPM:
case PULSES_PPM:
return 1;
default:
return 0;
@@ -866,13 +893,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
}
else {
switch (proto) {
case PPM:
case DSMX:
case LP45:
case DSM2:
case PXX_DJT:
case PPM16:
case PPMSIM:
case PULSES_PPM:
case PULSES_DSMX:
case PULSES_LP45:
case PULSES_DSM2:
// case PULSES_PXX_DJT: // Unavailable for now
case PULSES_PPM16:
case PULSES_PPMSIM:
return 1;
default:
return 0;
@@ -885,73 +912,60 @@ size_t getSizeA(T (&)[SIZE]) {
return SIZE;
}
bool OpenTxEepromInterface::checkVersion(unsigned int version)
EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
{
switch(version) {
case 201:
// first version
break;
case 202:
// channel order is now always RUD - ELE - THR - AIL
// changes in timers
// ppmFrameLength added
// thrTraceSrc added
break;
case 203:
// mixers changed (for the trims use for change the offset of a mix)
// telemetry offset raised to -127 +127
// function switches now have a param on 4 bits
break;
case 204:
// telemetry changes (bars)
break;
case 205:
// mixer changes (differential, negative curves)...
break;
// case 206:
case 207:
// V4: Rotary Encoders position in FlightModes
break;
case 208:
// Trim value in 16bits
// FrSky A1/A2 offset on 12bits
// ARM: More Mixers / Expos / CSW / FSW / CHNOUT
break;
case 209:
// Add TrmR, TrmE, TrmT, TrmA as Mix sources
// Trims are now OFF / ON / Rud / Ele / Thr / Ail
break;
case 210:
// Add names in Mixes / Expos
// Add a new telemetry screen
// Add support for Play Track <filename>
break;
case 211:
// Curves big change
break;
case 212:
// Big changes in mixers / limitse
break;
case 213:
// GVARS / Variants introduction
break;
case 214:
// Massive EEPROM change!
break;
case 215:
// M128 revert because too much RAM used!
break;
case 216:
// A lot of things (first github release)
return OLD_VERSION;
break;
case 217:
// 3 logical switches removed on M128 / gruvin9x boards
break;
default:
return false;
return NOT_OPENTX;
}
return true;
return NO_ERROR;
}
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
@@ -987,13 +1001,16 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
return true;
}
bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
std::bitset<NUM_ERRORS> errors;
std::cout << "trying " << getName() << " backup import...";
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
std::cout << " no\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
BoardEnum backupBoard = (BoardEnum)-1;
@@ -1009,12 +1026,14 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
break;
default:
std::cout << " unknown board\n";
return false;
errors.set(UNKNOWN_BOARD);
return errors.to_ulong();
}
if (backupBoard != board) {
std::cout << " not right board\n";
return false;
errors.set(WRONG_BOARD);
return errors.to_ulong();
}
uint8_t version = eeprom[4];
@@ -1024,29 +1043,38 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
std::cout << " version " << (unsigned int)version << " ";
if (!checkVersion(version)) {
EepromLoadErrors version_error = checkVersion(version);
if (version_error == OLD_VERSION) {
errors.set(version_error);
errors.set(HAS_WARNINGS);
} else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n";
return false;
errors.set(version_error);
return errors.to_ulong();
}
if (size > esize-8) {
std::cout << " wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (bcktype=='M') {
if (!loadModel(version, radioData.models[index], &eeprom[8], size, variant)) {
std::cout << " ko\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << " backup type not supported\n";
return false;
errors.set(BACKUP_NOT_SUPPORTED);
return errors.to_ulong();
}
std::cout << " ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
QString OpenTxFirmware::getFirmwareBaseUrl()
@@ -1069,6 +1097,7 @@ QString OpenTxFirmware::getFirmwareUrl()
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:
@@ -1111,7 +1140,8 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
firmware->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
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 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"));
@@ -1329,6 +1359,7 @@ void registerOpenTxFirmwares()
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"));
@@ -1340,6 +1371,29 @@ void registerOpenTxFirmwares()
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"));
@@ -1349,6 +1403,7 @@ void registerOpenTxFirmwares()
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"));
@@ -1383,3 +1438,9 @@ void registerOpenTxFirmwares()
current_firmware_variant = default_firmware_variant;
}
void unregisterOpenTxFirmwares()
{
foreach (Firmware * f, firmwares) {
delete f;
}
}
@@ -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
@@ -33,25 +33,23 @@ class OpenTxEepromInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(const ModelData &);
virtual int getSize(const GeneralSettings &);
virtual int getSize(GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
protected:
const char * getName();
bool checkVersion(unsigned int version);
EepromLoadErrors checkVersion(unsigned int version);
bool checkVariant(unsigned int version, unsigned int variant);
@@ -112,7 +110,7 @@ class OpenTxFirmware: public Firmware {
}
virtual Firmware * getFirmwareVariant(const QString & id);
virtual QString getStampUrl();
virtual QString getReleaseNotesUrl();
@@ -122,7 +120,9 @@ class OpenTxFirmware: public Firmware {
virtual int getCapability(const Capability);
virtual bool isTelemetrySourceAvailable(int source);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
QString getFirmwareBaseUrl();
@@ -130,5 +130,6 @@ class OpenTxFirmware: public Firmware {
};
void registerOpenTxFirmwares();
void unregisterOpenTxFirmwares();
#endif
@@ -20,10 +20,18 @@ add_custom_target(commondeps
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
add_custom_target(lua_exports
make PCB=TARANIS lua_exports.inc
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
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
@@ -43,6 +51,11 @@ include_directories(
${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)
@@ -75,6 +88,7 @@ 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})
@@ -87,9 +101,10 @@ 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-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
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
@@ -100,6 +115,7 @@ set(OPENTX_LIBRARIES
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
@@ -149,6 +165,11 @@ target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_
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})
@@ -15,7 +15,6 @@
*/
#include "opentxsimulator.h"
#include <QDebug>
#include <stdio.h>
#include <exception>
#include <map>
@@ -41,14 +40,15 @@
#define GRAPHICS
#define CURVES
#if defined(PCBTARANIS)
#define RTCLOCK
#define XCURVES
#define VIRTUALINPUTS
#define LUA
#define LUA_MODEL_SCRIPTS
#define RTCLOCK
#define XCURVES
#define VIRTUALINPUTS
#define LUA
#define LUA_MODEL_SCRIPTS
#define LUAINPUTS
#else
#define BUZZER
#define TEMPLATES
#define BUZZER
#define TEMPLATES
#endif
#define BOLD_FONT
#define HAPTIC
@@ -61,17 +61,17 @@
#endif
#if defined(PCBSKY9X) && !defined(REVX)
#define ROTARY_ENCODERS 1
#define ROTARY_ENCODERS 1
#elif defined(PCBGRUVIN9X)
#define ROTARY_ENCODERS 2
#define ROTARY_ENCODERS 2
#endif
#if defined(CPUARM)
#define FRSKY_SPORT
#define FRSKY_SPORT
#endif
#if defined (PCBTARANIS)
#define MIXERS_MONITOR
#define MIXERS_MONITOR
#endif
#undef min
@@ -90,6 +90,7 @@ namespace NAMESPACE {
#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"
@@ -232,7 +233,7 @@ namespace NAMESPACE {
#include "radio/src/targets/taranis/pulses_driver.cpp"
#include "radio/src/targets/taranis/rtc_driver.cpp"
#include "radio/src/targets/taranis/trainer_driver.cpp"
#include "radio/src/targets/taranis/uart3_driver.cpp"
#include "radio/src/targets/taranis/serial2_driver.cpp"
#elif defined(PCBSKY9X)
#include "radio/src/targets/sky9x/board_sky9x.cpp"
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
@@ -243,7 +244,7 @@ namespace NAMESPACE {
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
#include "radio/src/targets/sky9x/coproc_driver.cpp"
#include "radio/src/targets/sky9x/haptic_driver.cpp"
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
#include "radio/src/targets/sky9x/serial2_driver.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#elif defined(PCBGRUVIN9X)
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
@@ -259,7 +260,11 @@ namespace NAMESPACE {
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.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)
@@ -277,7 +282,10 @@ namespace NAMESPACE {
#endif
#if defined(LUA)
#include "radio/src/lua_api.cpp"
#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"
@@ -308,6 +316,7 @@ namespace NAMESPACE {
#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];
@@ -488,6 +497,44 @@ void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
#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
@@ -35,6 +35,10 @@
#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
@@ -118,9 +122,16 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual uint8_t getSensorInstance(uint16_t id);
virtual uint16_t getSensorRatio(uint16_t id);
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
virtual void setLuaStateReloadPermanentScripts();
};
}
@@ -1,4 +0,0 @@
// Automatically generated file (CMake) - do not edit
#define DATE_STR "@DATE@"
#define TIME_STR "@TIME@"
#define VERS_STR "@C9X_VERSION@"
+1 -1
View File
@@ -62,7 +62,7 @@ Th9xGeneral::operator GeneralSettings ()
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.vBatCalib = vBatCalib;
result.txVoltageCalibration = txVoltageCalibration;
// result.lightSw = th9xToSwitch(lightSw);
result.trainer = trainer;
result.view = view;
+1 -1
View File
@@ -64,7 +64,7 @@ PACK(typedef struct t_Th9xGeneral {
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t vBatCalib;
int8_t txVoltageCalibration;
int8_t lightSw;
Th9xTrainerData trainer;
uint8_t adcFilt:2;
+31 -19
View File
@@ -57,23 +57,29 @@ const int Th9xInterface::getMaxModels()
return 16;
}
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
unsigned long Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying th9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
return false;
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
@@ -81,7 +87,8 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
std::cout << "no\n";
return false;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
@@ -91,14 +98,16 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
break;
default:
std::cout << "not th9x\n";
return false;
errors.set(NOT_TH9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if (len != sizeof(Th9xGeneral)) {
std::cout << "not th9x\n";
return false;
errors.set(NOT_TH9X);
return errors.to_ulong();
}
radioData.generalSettings = th9xGeneral;
@@ -114,12 +123,15 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
}
std::cout << "ok\n";
return true;
errors.set(NO_ERROR);
return errors.to_ulong();
}
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
return false;
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
@@ -130,24 +142,24 @@ int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
return 0;
}
int Th9xInterface::getSize(ModelData &model)
int Th9xInterface::getSize(const ModelData & model)
{
return 0;
}
int Th9xInterface::getSize(GeneralSettings &settings)
int Th9xInterface::getSize(const GeneralSettings & settings)
{
return 0;
}
int Th9xInterface::isAvailable(Protocol proto, int port)
int Th9xInterface::isAvailable(PulsesProtocol proto, int port)
{
switch (proto) {
case PPM:
case SILV_A:
case SILV_B:
case SILV_C:
case CTP1009:
case PULSES_PPM:
case PULSES_SILV_A:
case PULSES_SILV_B:
case PULSES_SILV_C:
case PULSES_CTP1009:
return 1;
default:
return 0;
+6 -6
View File
@@ -34,19 +34,19 @@ class Th9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(ModelData &);
virtual int getSize(const ModelData &);
virtual int getSize(GeneralSettings &);
virtual int getSize(const GeneralSettings &);
virtual int isAvailable(Protocol proto, int port=0);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
+11 -9
View File
@@ -2,13 +2,13 @@
#include "ui_flasheepromdialog.h"
#include "eeprominterface.h"
#include "helpers.h"
#include "splashlibrary.h"
#include "firmwareinterface.h"
#include "hexinterface.h"
#include "appdata.h"
#include "progressdialog.h"
#include "radiointerface.h"
#include "converteeprom.h"
#include "splashlibrarydialog.h"
FlashEEpromDialog::FlashEEpromDialog(QWidget *parent, const QString &filename):
QDialog(parent),
@@ -104,7 +104,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
QByteArray eeprom(EESIZE_MAX, 0);
int fileType = getFileType(filename);
#if 0
if (fileType==FILE_TYPE_XML) {
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -125,7 +125,8 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
bool xmlOK = doc.setContent(&file);
if (xmlOK) {
RadioData * radioData = new RadioData();
if (!loadEEpromXml(*radioData, doc)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
if (!errors.test(NO_ERROR)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
}
else {
@@ -160,7 +161,8 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
}
RadioData * radioData = new RadioData();
if (eeprom_size == 0 || !loadEEprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size)) {
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
}
else {
@@ -175,8 +177,8 @@ bool FlashEEpromDialog::patchCalibration()
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
int8_t txVoltageCalibration=(int8_t) g.profile[g.id()].txVoltageCalibration();
int8_t txCurrentCalibration=(int8_t) g.profile[g.id()].txCurrentCalibration();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
@@ -204,8 +206,8 @@ bool FlashEEpromDialog::patchCalibration()
radioData->generalSettings.trainer.calib[i] = byte16;
}
}
radioData->generalSettings.currentCalib = currentCalib;
radioData->generalSettings.vBatCalib = vBatCalib;
radioData->generalSettings.txCurrentCalibration = txCurrentCalibration;
radioData->generalSettings.txVoltageCalibration = txVoltageCalibration;
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
return true;
}
@@ -303,7 +305,7 @@ void FlashEEpromDialog::on_burnButton_clicked()
backupPath = g.profile[g.id()].pBackupDir();
if (backupPath.isEmpty()) {
backupPath=g.backupDir();
}
}
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
}
else if (ui->checkFirmwareCompatibility->isChecked()) {
View File
+1 -1
View File
@@ -110,7 +110,7 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Saves a dated copy of your eeprom to the backup folder you specified in the Companion settings before writing the current model to the radio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Backup before Write</string>
+2 -2
View File
@@ -9,8 +9,8 @@
#include "hexinterface.h"
#include "progressdialog.h"
#include "radiointerface.h"
#include "splashlibrary.h"
#include "progresswidget.h"
#include "splashlibrarydialog.h"
#if defined WIN32 || !defined __GNUC__
#include <windows.h>
@@ -185,7 +185,7 @@ void FlashFirmwareDialog::on_useExternalSplash_clicked()
void FlashFirmwareDialog::on_useLibrarySplash_clicked()
{
QString fileName;
splashLibrary *ld = new splashLibrary(this, &fileName);
SplashLibraryDialog *ld = new SplashLibraryDialog(this, &fileName);
ld->exec();
if (!fileName.isEmpty()) {
QImage image(fileName);
View File
View File
+3 -1
View File
@@ -4,13 +4,15 @@ set(generaledit_NAMES
generaledit
generalsetup
trainer
calibration
hardware
)
set(generaledit_SRCS
calibration.cpp
)
set(generaledit_HDRS
calibration.h
)
set(generaledit_UIS
+74 -408
View File
@@ -1,424 +1,90 @@
#include <QVBoxLayout>
#include <QHeaderView>
#include <QSpinBox>
#include "calibration.h"
#include "ui_calibration.h"
void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard())) {
if (IS_TARANIS_X9E(firmware->getBoard())) {
enabled = true;
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
}
else if (index < 8) {
enabled = true;
}
}
if (enabled) {
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
name->setField(generalSettings.switchName[index], 3, this);
type->setField(generalSettings.switchConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void CalibrationPanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
enabled = true;
}
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
enabled = true;
}
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
enabled = true;
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::POT_NONE);
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
name->setField(generalSettings.potName[index], 3, this);
type->setField(generalSettings.potConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void CalibrationPanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
type->setEnabled(false);
enabled = true;
}
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
enabled = true;
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
name->setField(generalSettings.sliderName[index], 3, this);
type->setField(generalSettings.sliderConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
ui(new Ui::Calibration)
GeneralPanel(parent, generalSettings, firmware)
{
ui->setupUi(this);
if (!firmware->getCapability(MultiposPots)) {
ui->potsTypeSeparator->hide();
tableWidget = new QTableWidget();
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(tableWidget);
layout->setContentsMargins(0, 0, 0, 0);
this->setLayout(layout);
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
tableWidget->setColumnCount(3);
tableWidget->setShowGrid(false);
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
QStringList headerLabels;
headerLabels << QObject::tr("Negative span") << QObject::tr("Mid value") << QObject::tr("Positive span");
tableWidget->setHorizontalHeaderLabels(headerLabels);
int rows = NUM_STICKS + GetCurrentFirmware()->getCapability(Pots) + GetCurrentFirmware()->getCapability(Sliders);
tableWidget->setRowCount(rows);
for(int i = 0; i < rows; ++i) {
QTableWidgetItem *newItem = new QTableWidgetItem(AnalogString(i));
newItem->setTextAlignment(Qt::AlignLeft);
tableWidget->setVerticalHeaderItem(i, newItem);
for(int j = 0; j < 3; ++j) {
QSpinBox * newItem = new QSpinBox();
newItem->setMinimum(-9999);
newItem->setMaximum(9999);
newItem->setSingleStep(1);
newItem->setValue(getCalibrationValue(i, j));
newItem->setProperty("row", i);
newItem->setProperty("column", j);
tableWidget->setCellWidget(i, j, newItem);
connect(newItem, SIGNAL(valueChanged(int)), this, SLOT(onCellChanged(int)));
}
}
if (IS_TARANIS(firmware->getBoard())) {
ui->rudName->setField(generalSettings.stickName[0], 3, this);
ui->eleName->setField(generalSettings.stickName[1], 3, this);
ui->thrName->setField(generalSettings.stickName[2], 3, this);
ui->ailName->setField(generalSettings.stickName[3], 3, this);
}
else {
ui->rudLabel->hide();
ui->rudName->hide();
ui->eleLabel->hide();
ui->eleName->hide();
ui->thrLabel->hide();
ui->thrName->hide();
ui->ailLabel->hide();
ui->ailName->hide();
}
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType);
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType);
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
int potsCount = GetCurrentFirmware()->getCapability(Pots);
if (potsCount == 3) {
ui->ana8Neg->hide();
ui->ana8Mid->hide();
ui->ana8Pos->hide();
}
if (IS_TARANIS(firmware->getBoard())) {
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
}
else {
ui->serialPortMode->hide();
ui->serialPortLabel->hide();
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
}
else {
ui->bluetoothLabel->hide();
ui->bluetoothEnable->hide();
ui->bluetoothName->hide();
}
disableMouseScrolling();
setValues();
}
CalibrationPanel::~CalibrationPanel()
void CalibrationPanel::onCellChanged(int value)
{
delete ui;
}
QSpinBox * sb = qobject_cast<QSpinBox*>(sender());
int row = sb->property("row").toInt();
int column = sb->property("column").toInt();
/*void CalibrationPanel::update()
if (value != getCalibrationValue(row, column)) {
setCalibrationValue(row,column, value);
qDebug() << "CalibrationPanel::onCellChanged" << row << column << "to" << value;
emit modified();
}
}
int CalibrationPanel::getCalibrationValue(int row, int column)
{
switch(column) {
case 0:
return generalSettings.calibSpanNeg[row];
case 1:
return generalSettings.calibMid[row];
case 2:
return generalSettings.calibSpanPos[row];
}
return 0;
}
*/
void CalibrationPanel::on_PPM_MultiplierDSB_editingFinished()
void CalibrationPanel::setCalibrationValue(int row, int column, int value)
{
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
emit modified();
}
void CalibrationPanel::on_PPM1_editingFinished()
{
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
}
void CalibrationPanel::on_PPM2_editingFinished()
{
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
}
void CalibrationPanel::on_PPM3_editingFinished()
{
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
}
void CalibrationPanel::on_PPM4_editingFinished()
{
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
}
void CalibrationPanel::on_CurrentCalib_SB_editingFinished()
{
generalSettings.currentCalib = ui->CurrentCalib_SB->value();
emit modified();
}
void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
{
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
emit modified();
}
void CalibrationPanel::setValues()
{
ui->battCalibDSB->setValue((double)generalSettings.vBatCalib/10);
ui->CurrentCalib_SB->setValue((double)generalSettings.currentCalib);
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
ui->ana3Neg->setValue(generalSettings.calibSpanNeg[2]);
ui->ana4Neg->setValue(generalSettings.calibSpanNeg[3]);
ui->ana5Neg->setValue(generalSettings.calibSpanNeg[4]);
ui->ana6Neg->setValue(generalSettings.calibSpanNeg[5]);
ui->ana7Neg->setValue(generalSettings.calibSpanNeg[6]);
ui->ana8Neg->setValue(generalSettings.calibSpanNeg[7]);
ui->ana1Mid->setValue(generalSettings.calibMid[0]);
ui->ana2Mid->setValue(generalSettings.calibMid[1]);
ui->ana3Mid->setValue(generalSettings.calibMid[2]);
ui->ana4Mid->setValue(generalSettings.calibMid[3]);
ui->ana5Mid->setValue(generalSettings.calibMid[4]);
ui->ana6Mid->setValue(generalSettings.calibMid[5]);
ui->ana7Mid->setValue(generalSettings.calibMid[6]);
ui->ana8Mid->setValue(generalSettings.calibMid[7]);
ui->ana1Pos->setValue(generalSettings.calibSpanPos[0]);
ui->ana2Pos->setValue(generalSettings.calibSpanPos[1]);
ui->ana3Pos->setValue(generalSettings.calibSpanPos[2]);
ui->ana4Pos->setValue(generalSettings.calibSpanPos[3]);
ui->ana5Pos->setValue(generalSettings.calibSpanPos[4]);
ui->ana6Pos->setValue(generalSettings.calibSpanPos[5]);
ui->ana7Pos->setValue(generalSettings.calibSpanPos[6]);
ui->ana8Pos->setValue(generalSettings.calibSpanPos[7]);
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
}
void CalibrationPanel::on_battCalibDSB_editingFinished()
{
generalSettings.vBatCalib = ui->battCalibDSB->value()*10;
emit modified();
}
void CalibrationPanel::on_ana1Neg_editingFinished()
{
generalSettings.calibSpanNeg[0] = ui->ana1Neg->value();
emit modified();
}
void CalibrationPanel::on_ana2Neg_editingFinished()
{
generalSettings.calibSpanNeg[1] = ui->ana2Neg->value();
emit modified();
}
void CalibrationPanel::on_ana3Neg_editingFinished()
{
generalSettings.calibSpanNeg[2] = ui->ana3Neg->value();
emit modified();
}
void CalibrationPanel::on_ana4Neg_editingFinished()
{
generalSettings.calibSpanNeg[3] = ui->ana4Neg->value();
emit modified();
}
void CalibrationPanel::on_ana5Neg_editingFinished()
{
generalSettings.calibSpanNeg[4] = ui->ana5Neg->value();
emit modified();
}
void CalibrationPanel::on_ana6Neg_editingFinished()
{
generalSettings.calibSpanNeg[5] = ui->ana6Neg->value();
emit modified();
}
void CalibrationPanel::on_ana7Neg_editingFinished()
{
generalSettings.calibSpanNeg[6] = ui->ana7Neg->value();
emit modified();
}
void CalibrationPanel::on_ana8Neg_editingFinished()
{
generalSettings.calibSpanNeg[7] = ui->ana8Neg->value();
emit modified();
}
void CalibrationPanel::on_ana1Mid_editingFinished()
{
generalSettings.calibMid[0] = ui->ana1Mid->value();
emit modified();
}
void CalibrationPanel::on_ana2Mid_editingFinished()
{
generalSettings.calibMid[1] = ui->ana2Mid->value();
emit modified();
}
void CalibrationPanel::on_ana3Mid_editingFinished()
{
generalSettings.calibMid[2] = ui->ana3Mid->value();
emit modified();
}
void CalibrationPanel::on_ana4Mid_editingFinished()
{
generalSettings.calibMid[3] = ui->ana4Mid->value();
emit modified();
}
void CalibrationPanel::on_ana5Mid_editingFinished()
{
generalSettings.calibMid[4] = ui->ana5Mid->value();
emit modified();
}
void CalibrationPanel::on_ana6Mid_editingFinished()
{
generalSettings.calibMid[5] = ui->ana6Mid->value();
emit modified();
}
void CalibrationPanel::on_ana7Mid_editingFinished()
{
generalSettings.calibMid[6] = ui->ana7Mid->value();
emit modified();
}
void CalibrationPanel::on_ana8Mid_editingFinished()
{
generalSettings.calibMid[7] = ui->ana8Mid->value();
emit modified();
}
void CalibrationPanel::on_ana1Pos_editingFinished()
{
generalSettings.calibSpanPos[0] = ui->ana1Pos->value();
emit modified();
}
void CalibrationPanel::on_ana2Pos_editingFinished()
{
generalSettings.calibSpanPos[1] = ui->ana2Pos->value();
emit modified();
}
void CalibrationPanel::on_ana3Pos_editingFinished()
{
generalSettings.calibSpanPos[2] = ui->ana3Pos->value();
emit modified();
}
void CalibrationPanel::on_ana4Pos_editingFinished()
{
generalSettings.calibSpanPos[3] = ui->ana4Pos->value();
emit modified();
}
void CalibrationPanel::on_ana5Pos_editingFinished()
{
generalSettings.calibSpanPos[4] = ui->ana5Pos->value();
emit modified();
}
void CalibrationPanel::on_ana6Pos_editingFinished()
{
generalSettings.calibSpanPos[5] = ui->ana6Pos->value();
emit modified();
}
void CalibrationPanel::on_ana7Pos_editingFinished()
{
generalSettings.calibSpanPos[6] = ui->ana7Pos->value();
emit modified();
}
void CalibrationPanel::on_ana8Pos_editingFinished()
{
generalSettings.calibSpanPos[7] = ui->ana8Pos->value();
emit modified();
}
void CalibrationPanel::on_serialPortMode_currentIndexChanged(int index)
{
generalSettings.hw_uartMode = index;
emit modified();
switch(column) {
case 0:
generalSettings.calibSpanNeg[row] = value;
break;
case 1:
generalSettings.calibMid[row] = value;
break;
case 2:
generalSettings.calibSpanPos[row] = value;
break;
}
}
+6 -47
View File
@@ -1,6 +1,7 @@
#ifndef CALIBRATION_H
#define CALIBRATION_H
#include <QTableWidget>
#include "generaledit.h"
namespace Ui {
@@ -17,58 +18,16 @@ class CalibrationPanel : public GeneralPanel
public:
CalibrationPanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
virtual ~CalibrationPanel();
// virtual void update();
virtual ~CalibrationPanel() {};
private slots:
void on_battCalibDSB_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_PPM_MultiplierDSB_editingFinished();
void on_CurrentCalib_SB_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_ana1Neg_editingFinished();
void on_ana2Neg_editingFinished();
void on_ana3Neg_editingFinished();
void on_ana4Neg_editingFinished();
void on_ana5Neg_editingFinished();
void on_ana6Neg_editingFinished();
void on_ana7Neg_editingFinished();
void on_ana8Neg_editingFinished();
void on_ana1Mid_editingFinished();
void on_ana2Mid_editingFinished();
void on_ana3Mid_editingFinished();
void on_ana4Mid_editingFinished();
void on_ana5Mid_editingFinished();
void on_ana6Mid_editingFinished();
void on_ana7Mid_editingFinished();
void on_ana8Mid_editingFinished();
void on_ana1Pos_editingFinished();
void on_ana2Pos_editingFinished();
void on_ana3Pos_editingFinished();
void on_ana4Pos_editingFinished();
void on_ana5Pos_editingFinished();
void on_ana6Pos_editingFinished();
void on_ana7Pos_editingFinished();
void on_ana8Pos_editingFinished();
void on_serialPortMode_currentIndexChanged(int index);
protected:
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void onCellChanged(int value);
private:
Ui::Calibration *ui;
QTableWidget * tableWidget;
void setValues();
int getCalibrationValue(int row, int column);
void setCalibrationValue(int row, int column, int value);
};
#endif // CALIBRATION_H
+9 -7
View File
@@ -8,6 +8,7 @@
#include "generalsetup.h"
#include "trainer.h"
#include "calibration.h"
#include "hardware.h"
#include "../modeledit/customfunctions.h"
#include "verticalscrollarea.h"
@@ -42,7 +43,8 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
}
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Hardware / Calibration"));
addTab(new HardwarePanel(this, generalSettings, firmware), tr("Hardware"));
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
ui->tabWidget->setCurrentIndex( g.generalEditTab() );
}
@@ -88,8 +90,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
}
else {
QString trainercalib = g.profile[profile_id].trainerCalib();
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
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();
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
@@ -123,8 +125,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
if (ok)
generalSettings.trainer.calib[i]=byte16;
}
generalSettings.currentCalib=currentCalib;
generalSettings.vBatCalib=vBatCalib;
generalSettings.txCurrentCalibration=txCurrentCalibration;
generalSettings.txVoltageCalibration=txVoltageCalibration;
generalSettings.vBatWarn=vBatWarn;
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
@@ -225,8 +227,8 @@ 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 );
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
+241
View File
@@ -0,0 +1,241 @@
#include "hardware.h"
#include "ui_hardware.h"
void HardwarePanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard())) {
if (IS_TARANIS_X9E(firmware->getBoard())) {
enabled = true;
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
}
else if (index < 8) {
enabled = true;
}
}
if (enabled) {
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
if (threePos) type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
name->setField(generalSettings.switchName[index], 3, this);
type->setField(generalSettings.switchConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void HardwarePanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
enabled = true;
}
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
enabled = true;
}
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
enabled = true;
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::POT_NONE);
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
name->setField(generalSettings.potName[index], 3, this);
type->setField(generalSettings.potConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void HardwarePanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
type->setEnabled(false);
enabled = true;
}
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
enabled = true;
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
name->setField(generalSettings.sliderName[index], 3, this);
type->setField(generalSettings.sliderConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
ui(new Ui::Hardware)
{
ui->setupUi(this);
if (IS_TARANIS(firmware->getBoard())) {
ui->rudName->setField(generalSettings.stickName[0], 3, this);
ui->eleName->setField(generalSettings.stickName[1], 3, this);
ui->thrName->setField(generalSettings.stickName[2], 3, this);
ui->ailName->setField(generalSettings.stickName[3], 3, this);
}
else {
ui->rudLabel->hide();
ui->rudName->hide();
ui->eleLabel->hide();
ui->eleName->hide();
ui->thrLabel->hide();
ui->thrName->hide();
ui->ailLabel->hide();
ui->ailName->hide();
}
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
if (IS_TARANIS(firmware->getBoard())) {
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
}
else {
ui->serialPortMode->hide();
ui->serialPortLabel->hide();
}
if (!IS_SKY9X(firmware->getBoard())) {
ui->txCurrentCalibration->hide();
ui->txCurrentCalibrationLabel->hide();
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
}
else {
ui->bluetoothLabel->hide();
ui->bluetoothEnable->hide();
ui->bluetoothName->hide();
}
disableMouseScrolling();
setValues();
}
HardwarePanel::~HardwarePanel()
{
delete ui;
}
void HardwarePanel::on_PPM_MultiplierDSB_editingFinished()
{
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
emit modified();
}
void HardwarePanel::on_PPM1_editingFinished()
{
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
}
void HardwarePanel::on_PPM2_editingFinished()
{
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
}
void HardwarePanel::on_PPM3_editingFinished()
{
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
}
void HardwarePanel::on_PPM4_editingFinished()
{
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
}
void HardwarePanel::on_txCurrentHardware_editingFinished()
{
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
emit modified();
}
void HardwarePanel::on_bluetoothEnable_stateChanged(int)
{
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
emit modified();
}
void HardwarePanel::setValues()
{
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
}
void HardwarePanel::on_txVoltageHardware_editingFinished()
{
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
emit modified();
}
void HardwarePanel::on_serialPortMode_currentIndexChanged(int index)
{
generalSettings.hw_uartMode = index;
emit modified();
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef HARDWARE_H
#define HARDWARE_H
#include "generaledit.h"
namespace Ui {
class Hardware;
}
class QLabel;
class AutoLineEdit;
class AutoComboBox;
class HardwarePanel : public GeneralPanel
{
Q_OBJECT
public:
HardwarePanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
virtual ~HardwarePanel();
private slots:
void on_txVoltageHardware_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_PPM_MultiplierDSB_editingFinished();
void on_txCurrentHardware_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_serialPortMode_currentIndexChanged(int index);
protected:
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos);
private:
Ui::Hardware *ui;
void setValues();
};
#endif // HARDWARE_H
File diff suppressed because it is too large Load Diff
+93 -134
View File
@@ -12,6 +12,8 @@
#include "simulatorinterface.h"
#include "firmwareinterface.h"
Stopwatch gStopwatch("global");
const QColor colors[C9X_MAX_CURVES] = {
QColor(0,0,127),
QColor(0,127,0),
@@ -47,24 +49,6 @@ const QColor colors[C9X_MAX_CURVES] = {
QColor(255,127,0),
};
QString getPhaseName(int val, const char * phasename)
{
if (!val) return "---";
if (!phasename) {
return QString(val < 0 ? "!" : "") + QObject::tr("FM%1").arg(abs(val) - 1);
}
else {
QString phaseName;
phaseName.append(phasename);
if (phaseName.isEmpty()) {
return QString(val < 0 ? "!" : "") + QObject::tr("FM%1").arg(abs(val) - 1);
}
else {
return QString(val < 0 ? "!" : "") + phaseName;
}
}
}
void populateGvSourceCB(QComboBox *b, int value)
{
QString strings[] = { QObject::tr("---"), QObject::tr("Rud Trim"), QObject::tr("Ele Trim"), QObject::tr("Thr Trim"), QObject::tr("Ail Trim"), QObject::tr("Rot Enc"), QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
@@ -106,20 +90,6 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
}
}
QString getProtocolStr(const int proto)
{
static const char *strings[] = { "OFF",
"PPM",
"Silverlit A", "Silverlit B", "Silverlit C",
"CTP1009",
"LP45", "DSM2", "DSMX",
"PPM16", "PPMsim",
"FrSky XJT - D16", "FrSky XJT - D8", "FrSky XJT - LR12", "FrSky DJT",
};
return CHECK_IN_ARRAY(strings, proto);
}
void populatePhasesCB(QComboBox *b, int value)
{
for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<=GetCurrentFirmware()->getCapability(FlightModes); i++) {
@@ -205,7 +175,7 @@ void GVarGroup::valuesChanged()
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
weight = round(dsb->value()/step);
}
}
@@ -772,106 +742,6 @@ QString getFrSkySrc(int index)
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString();
}
QString getTrimInc(ModelData * g_model)
{
switch (g_model->trimInc) {
case -2:
return QObject::tr("Exponential");
case -1:
return QObject::tr("Extra Fine");
case 0:
return QObject::tr("Fine");
case 1:
return QObject::tr("Medium");
case 2:
return QObject::tr("Coarse");
default:
return QObject::tr("Unknown");
}
}
QString getTimerStr(TimerData & timer)
{
QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0'));
result += QString(", ") + timer.mode.toString();
if (timer.persistent)
result += QObject::tr(", Persistent");
if (timer.minuteBeep)
result += QObject::tr(", MinuteBeep");
if (timer.countdownBeep == 1)
result += QObject::tr(", CountDown(Beeps)");
else if (timer.countdownBeep == 2)
result += QObject::tr(", CountDown(Voice)");
return result;
}
QString getProtocol(ModuleData & module)
{
QString str = getProtocolStr(module.protocol);
if (module.protocol == PPM)
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
else
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
return str;
}
QString getTrainerMode(const int trainermode, ModuleData & module)
{
QString result;
switch (trainermode) {
case 1:
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
break;
case 2:
result=QObject::tr("Master/SBUS Module");
break;
case 3:
result=QObject::tr("Master/CPPM Module");
break;
case 4:
result=QObject::tr("Master/SBUS in battery compartment");
break;
default:
result=QObject::tr("Master/Jack");
}
return result;
}
QString getCenterBeepStr(ModelData * g_model)
{
QStringList strl;
if (g_model->beepANACenter & 0x01)
strl << QObject::tr("Rudder");
if (g_model->beepANACenter & 0x02)
strl << QObject::tr("Elevator");
if (g_model->beepANACenter & 0x04)
strl << QObject::tr("Throttle");
if (g_model->beepANACenter & 0x08)
strl << QObject::tr("Aileron");
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
if (g_model->beepANACenter & 0x10)
strl << "S1";
if (g_model->beepANACenter & 0x20)
strl << "S2";
if (g_model->beepANACenter & 0x40)
strl << "S3";
if (g_model->beepANACenter & 0x80)
strl << "LS";
if (g_model->beepANACenter & 0x100)
strl << "RS";
}
else {
if (g_model->beepANACenter & 0x10)
strl << "P1";
if (g_model->beepANACenter & 0x20)
strl << "P2";
if (g_model->beepANACenter & 0x40)
strl << "P3";
}
return strl.join(", ");
}
QString getTheme()
{
int theme_set = g.theme();
@@ -1018,7 +888,7 @@ int qunlink(const QString & fileName)
return unlink(ba.constData());
}
QString generateProcessUniqueTempFileName(const QString &fileName)
QString generateProcessUniqueTempFileName(const QString & fileName)
{
QString sanitizedFileName = fileName;
sanitizedFileName.remove('/');
@@ -1127,3 +997,92 @@ QStringList extractLatLon(const QString & position)
}
return result;
}
TableLayout::TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels)
{
#if defined(TABLE_LAYOUT)
tableWidget = new QTableWidget(parent);
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(tableWidget);
layout->setContentsMargins(0, 0, 0, 0);
parent->setLayout(layout);
tableWidget->setRowCount(rowCount);
tableWidget->setColumnCount(headerLabels.size());
tableWidget->setShowGrid(false);
tableWidget->verticalHeader()->setVisible(false);
tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
tableWidget->setHorizontalHeaderLabels(headerLabels);
#else
gridWidget = new QGridLayout(parent);
int col = 0;
foreach(QString text, headerLabels) {
QLabel *label = new QLabel();
label->setFrameShape(QFrame::Panel);
label->setFrameShadow(QFrame::Raised);
label->setMidLineWidth(0);
label->setAlignment(Qt::AlignCenter);
label->setMargin(5);
label->setText(text);
// if (!minimize)
// label->setMinimumWidth(100);
gridWidget->addWidget(label, 0, col++);
}
#endif
}
void TableLayout::addWidget(int row, int column, QWidget * widget)
{
#if defined(TABLE_LAYOUT)
QHBoxLayout * layout = new QHBoxLayout(tableWidget);
layout->addWidget(widget);
addLayout(row, column, layout);
#else
gridWidget->addWidget(widget, row + 1, column);
#endif
}
void TableLayout::addLayout(int row, int column, QLayout * layout)
{
#if defined(TABLE_LAYOUT)
layout->setContentsMargins(1, 3, 1, 3);
QWidget * containerWidget = new QWidget(tableWidget);
containerWidget->setLayout(layout);
tableWidget->setCellWidget(row, column, containerWidget);
#else
gridWidget->addLayout(layout, row + 1, column);
#endif
}
void TableLayout::resizeColumnsToContents()
{
#if defined(TABLE_LAYOUT)
tableWidget->resizeColumnsToContents();
#else
#endif
}
void TableLayout::setColumnWidth(int col, int width)
{
#if defined(TABLE_LAYOUT)
tableWidget->setColumnWidth(col, width);
#else
#endif
}
void TableLayout::pushRowsUp(int row)
{
#if defined(TABLE_LAYOUT)
#else
// Push the rows up
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
gridWidget->addItem(spacer, row, 0);
#endif
// Push rows upward
// addDoubleSpring(gridLayout, 5, num_fsw+1);
}
+59 -8
View File
@@ -2,6 +2,9 @@
#define HELPERS_H
#include <QtGui>
#include <QTableWidget>
#include <QGridLayout>
#include <QDebug>
#include "eeprominterface.h"
extern const QColor colors[C9X_MAX_CURVES];
@@ -100,7 +103,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
QString getProtocolStr(const int proto);
#define POPULATE_NONE (1<<0)
#define POPULATE_SOURCES (1<<1)
@@ -118,16 +120,9 @@ QString getProtocolStr(const int proto);
// 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 getPhaseName(int val, const char * phasename=NULL);
QString image2qstring(QImage image);
int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModuleData & module);
QString getTrainerMode(const int trainermode, ModuleData & module);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */
QString getFrSkyAlarmType(int alarm);
QString getFrSkyUnits(int units);
@@ -209,4 +204,60 @@ private:
double toDecimalCoordinate(const QString & value);
QStringList extractLatLon(const QString & position);
class TableLayout
{
public:
TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels);
// ~TableLayout() ;
void addWidget(int row, int column, QWidget * widget);
void addLayout(int row, int column, QLayout * layout);
void resizeColumnsToContents();
void setColumnWidth(int col, int width);
void pushRowsUp(int row);
private:
#if defined(TABLE_LAYOUT)
QTableWidget * tableWidget;
#else
QGridLayout * gridWidget;
#endif
};
class Stopwatch
{
public:
Stopwatch(const QString & name) :
name(name), total(0) {
timer.start();
};
~Stopwatch() {};
void restart() {
total = 0;
timer.restart();
};
void report() {
qint64 elapsed = timer.restart();
total += elapsed;
qDebug() << name << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
};
void report(const QString & text) {
qint64 elapsed = timer.restart();
total += elapsed;
qDebug() << name << text << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
};
private:
QString name;
QElapsedTimer timer;
qint64 total;
};
extern Stopwatch gStopwatch;
#endif // HELPERS_H
Executable → Regular
View File
Executable → Regular
View File
+1
View File
@@ -0,0 +1 @@
*/*.directory
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File
View File
View File
+2 -2
View File
@@ -344,7 +344,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QToolButton" name="splashLibraryButton">
<widget class="QToolButton" name="SplashLibraryDialogButton">
<property name="text">
<string>...</string>
</property>
@@ -455,7 +455,7 @@
<tabstop>splashincludeCB</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>splashLibraryButton</tabstop>
<tabstop>SplashLibraryDialogButton</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>InvertPixels</tabstop>
<tabstop>buttonBox</tabstop>
+70 -67
View File
@@ -115,12 +115,12 @@ MainWindow::MainWindow():
this->setIconSize(QSize(32, 32));
QNetworkProxyFactory::setUseSystemConfiguration(true);
setAcceptDrops(true);
// give time to the splash to disappear and main window to open before starting updates
int updateDelay = 1000;
bool showSplash = g.showSplash();
if (showSplash) {
updateDelay += (SPLASH_TIME*1000);
updateDelay += (SPLASH_TIME*1000);
}
QTimer::singleShot(updateDelay, this, SLOT(doAutoUpdates()));
QTimer::singleShot(updateDelay, this, SLOT(displayWarnings()));
@@ -158,13 +158,13 @@ MainWindow::MainWindow():
child->show();
}
else {
child->show();
child->show();
child->print(model,printfilename);
child->close();
}
}
}
}
}
if (printing) {
QTimer::singleShot(0, this, SLOT(autoClose()));
}
@@ -185,7 +185,7 @@ void MainWindow::displayWarnings()
}
}
else if (warnId==0) {
g.warningId(WARNING_ID);
g.warningId(WARNING_ID);
}
}
@@ -292,17 +292,14 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
int c9xver = version2index(c9xversion);
if (c9xver < vnum) {
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
"Would you like to download it?").arg(version) ,
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
#if defined __APPLE__
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(COMPANION_INSTALLER).arg(version));
#else
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(COMPANION_INSTALLER).arg(version), tr("Executable (*.exe)"));
#endif
QDir dir(g.updatesDir());
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), dir.absoluteFilePath(QString(COMPANION_INSTALLER).arg(version)), tr("Executable (*.exe)"));
if (!fileName.isEmpty()) {
g.updatesDir(QFileInfo(fileName).dir().absolutePath());
downloadDialog * dd = new downloadDialog(this, QString("%1/%2").arg(getCompanionUpdateBaseUrl()).arg(QString(COMPANION_INSTALLER).arg(version)), fileName);
@@ -313,7 +310,7 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
}
#else
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available, please check the OpenTX website!"));
#endif
#endif
}
else {
if (downloadDialog_forWait && checkForUpdatesState==0) {
@@ -539,19 +536,19 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
void MainWindow::setLanguage(const QString & langString)
{
{
g.locale(langString);
QMessageBox::information(this, tr("Companion"), tr("The selected language will be used the next time you start Companion."));
}
void MainWindow::setTheme(int index)
{
{
g.theme(index);
QMessageBox::information(this, tr("Companion"), tr("The new theme will be loaded the next time you start Companion."));
}
void MainWindow::setIconThemeSize(int index)
{
{
g.iconSize(index);
QMessageBox::information(this, tr("Companion"), tr("The icon size will be used the next time you start Companion."));
}
@@ -667,41 +664,47 @@ void MainWindow::contributors()
void MainWindow::sdsync()
{
QString sdPath = g.profile[g.id()].sdPath();
if (sdPath.isEmpty()) {
QMessageBox::warning(this, QObject::tr("Synchronization error"), QObject::tr("No SD directory configured!"));
return;
}
QString massstoragePath = findMassstoragePath("SOUNDS");
if (massstoragePath.isEmpty()) {
QMessageBox::warning(this, QObject::tr("Synchronization error"), QObject::tr("No Radio connected!"));
return;
}
massstoragePath += "/..";
massstoragePath = massstoragePath.left(massstoragePath.length() - 7);
ProgressDialog progressDialog(this, tr("Synchronize SD"), CompanionIcon("sdsync.png"));
SyncProcess syncProcess(massstoragePath, g.profile[g.id()].sdPath(), progressDialog.progress());
syncProcess.run();
progressDialog.exec();
if (!syncProcess.run()) {
progressDialog.exec();
}
}
void MainWindow::changelog()
{
ReleaseNotesDialog * dialog = new ReleaseNotesDialog(this);
dialog->exec();
ReleaseNotesDialog * dialog = new ReleaseNotesDialog(this);
dialog->exec();
}
void MainWindow::fwchangelog()
{
Firmware *currfirm = GetCurrentFirmware();
QString rn=currfirm->getReleaseNotesUrl();
if (rn.isEmpty()) {
QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations."));
}
else {
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
dialog->exec();
}
Firmware * firmware = GetCurrentFirmware();
QString url = firmware->getReleaseNotesUrl();
if (url.isEmpty()) {
QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations."));
}
else {
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, url);
dialog->exec();
}
}
void MainWindow::customizeSplash()
{
customizeSplashDialog *cd = new customizeSplashDialog(this);
cd->exec();
{
customizeSplashDialog * dialog = new customizeSplashDialog(this);
dialog->exec();
}
void MainWindow::cut()
@@ -757,7 +760,7 @@ void MainWindow::readEeprom()
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_ARM(eepromInterface->getBoard()))
if (IS_ARM(eepromInterface->getBoard()))
tempFile = generateProcessUniqueTempFileName("temp.bin");
else
tempFile += generateProcessUniqueTempFileName("temp.hex");
@@ -914,7 +917,7 @@ void MainWindow::updateMenus()
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
writeEepromAct->setEnabled(hasMdiChild);
separatorAct->setVisible(hasMdiChild);
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
cutAct->setEnabled(hasSelection);
copyAct->setEnabled(hasSelection);
@@ -956,7 +959,7 @@ QAction * MainWindow::addAct(const QString & icon, const QString & sName, const
QAction * newAction = new QAction( this );
if (!icon.isEmpty())
newAction->setIcon(CompanionIcon(icon));
if (!sName.isEmpty())
if (!sName.isEmpty())
newAction->setText(sName);
if (!lName.isEmpty())
newAction->setStatusTip(lName);
@@ -977,7 +980,7 @@ QAction * MainWindow::addAct(QActionGroup *aGroup, const QString & sName, const
{
QAction *action = addAct("", sName, lName, QKeySequence::UnknownKey, slot);
action->setCheckable(true);
aGroup->addAction(action);
aGroup->addAction(action);
return action;
}
@@ -1011,7 +1014,7 @@ void MainWindow::createActions()
cutAct = addAct("cut.png", tr("Cut Model"), tr("Cut current model to the clipboard"), QKeySequence::Cut, SLOT(cut()));
copyAct = addAct("copy.png", tr("Copy Model"), tr("Copy current model to the clipboard"), QKeySequence::Copy, SLOT(copy()));
pasteAct = addAct("paste.png", tr("Paste Model"), tr("Paste model from clipboard"), QKeySequence::Paste, SLOT(paste()));
QActionGroup *themeAlignGroup = new QActionGroup(this);
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classic companion9x icon theme"), SLOT(setClassicTheme()));
yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme()));
@@ -1066,7 +1069,7 @@ void MainWindow::createActions()
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
sdsyncAct = addAct("sdsync.png", tr("Synchronize SD"), tr("SD card synchronization"), SLOT(sdsync()));
compareAct->setEnabled(false);
simulateAct->setEnabled(false);
printAct->setEnabled(false);
@@ -1112,8 +1115,8 @@ void MainWindow::createMenus()
languageMenu->addAction(germanLangAct);
languageMenu->addAction(finnishLangAct);
languageMenu->addAction(frenchLangAct);
// languageMenu->addAction(hebrewLangAct);
languageMenu->addAction(italianLangAct);
// languageMenu->addAction(hebrewLangAct);
languageMenu->addAction(polishLangAct);
// languageMenu->addAction(portugueseLangAct);
languageMenu->addAction(spanishLangAct);
@@ -1150,7 +1153,7 @@ void MainWindow::createMenus()
burnMenu->addSeparator();
burnMenu->addSeparator();
EEPROMInterface *eepromInterface = GetEepromInterface();
if (!IS_ARM(eepromInterface->getBoard())) {
if (!IS_ARM(eepromInterface->getBoard())) {
burnMenu->addAction(burnFusesAct);
burnMenu->addAction(burnListAct);
}
@@ -1167,7 +1170,7 @@ void MainWindow::createMenus()
helpMenu->addSeparator();
helpMenu->addAction(contributorsAct);
}
QMenu *MainWindow::createRecentFileMenu()
{
QMenu *recentFileMenu = new QMenu(this);
@@ -1208,7 +1211,7 @@ void MainWindow::createToolBars()
break;
default:
size=QSize(24,24);
break;
break;
}
fileToolBar = addToolBar(tr("File"));
fileToolBar->setIconSize(size);
@@ -1254,7 +1257,7 @@ void MainWindow::createToolBars()
editToolBar->addAction(cutAct);
editToolBar->addAction(copyAct);
editToolBar->addAction(pasteAct);
burnToolBar = new QToolBar(tr("Write"));
addToolBar( Qt::LeftToolBarArea, burnToolBar );
burnToolBar->setIconSize(size);
@@ -1311,7 +1314,7 @@ void MainWindow::setActiveSubWindow(QWidget *window)
void MainWindow::updateRecentFileActions()
{
int i, numRecentFiles;
// Hide all document slots
for ( i=0 ; i < g.historySize(); i++)
recentFileActs[i]->setVisible(false);
@@ -1319,7 +1322,7 @@ void MainWindow::updateRecentFileActions()
// Fill slots with content and unhide them
QStringList files = g.recentFiles();
numRecentFiles = qMin(files.size(), g.historySize());
for ( i = 0; i < numRecentFiles; i++) {
QString text = strippedName(files[i]);
if (!text.trimmed().isEmpty())
@@ -1346,34 +1349,34 @@ void MainWindow::updateLanguageActions()
{
QString langId = g.locale();
if (langId=="")
if (langId=="")
sysLangAct->setChecked(true);
else if (langId=="cs_CZ")
else if (langId=="cs_CZ")
czechLangAct->setChecked(true);
else if (langId=="de_DE")
else if (langId=="de_DE")
germanLangAct->setChecked(true);
else if (langId=="en")
else if (langId=="en")
englishLangAct->setChecked(true);
else if (langId=="fi_FI")
else if (langId=="fi_FI")
finnishLangAct->setChecked(true);
else if (langId=="fr_FR")
else if (langId=="fr_FR")
frenchLangAct->setChecked(true);
else if (langId=="it_IT")
else if (langId=="it_IT")
italianLangAct->setChecked(true);
else if (langId=="he_IL")
hebrewLangAct->setChecked(true);
else if (langId=="pl_PL")
// else if (langId=="he_IL")
// hebrewLangAct->setChecked(true);
else if (langId=="pl_PL")
polishLangAct->setChecked(true);
else if (langId=="pt_PT")
portugueseLangAct->setChecked(true);
else if (langId=="ru_RU")
russianLangAct->setChecked(true);
// else if (langId=="pt_PT")
// portugueseLangAct->setChecked(true);
else if (langId=="es_ES")
spanishLangAct->setChecked(true);
else if (langId=="sv_SE")
else if (langId=="sv_SE")
swedishLangAct->setChecked(true);
else if (langId=="nl_NL")
dutchLangAct->setChecked(true);
// else if (langId=="ru_RU")
// russianLangAct->setChecked(true);
// else if (langId=="nl_NL")
// dutchLangAct->setChecked(true);
}
void MainWindow::updateIconThemeActions()
@@ -1390,9 +1393,9 @@ void MainWindow::updateIconThemeActions()
void MainWindow::updateProfilesActions()
{
for (int i=0; i<MAX_PROFILES; i++)
for (int i=0; i<MAX_PROFILES; i++)
{
if (g.profile[i].existsOnDisk())
if (g.profile[i].existsOnDisk())
{
QString text = tr("%2").arg(g.profile[i].name());
profileActs[i]->setText(text);
@@ -1400,8 +1403,8 @@ void MainWindow::updateProfilesActions()
profileActs[i]->setVisible(true);
if (i == g.id())
profileActs[i]->setChecked(true);
}
else
}
else
{
profileActs[i]->setVisible(false);
}
@@ -1415,7 +1418,7 @@ void MainWindow::createProfile()
;
if (i==MAX_PROFILES) //Failed to find free slot
return;
// Copy current profile to new and give it a new name
g.profile[i] = g.profile[g.id()];
g.profile[i].name(tr("New Radio"));
+8 -6
View File
@@ -262,20 +262,22 @@ class MainWindow : public QMainWindow
QAction *normalIconAct;
QAction *bigIconAct;
QAction *hugeIconAct;
QAction *sysLangAct;
QAction *englishLangAct;
QAction *czechLangAct;
QAction *germanLangAct;
QAction *frenchLangAct;
QAction *englishLangAct;
QAction *finnishLangAct;
QAction *frenchLangAct;
QAction *italianLangAct;
QAction *hebrewLangAct;
// QAction *hebrewLangAct;
QAction *polishLangAct;
// QAction *portugueseLangAct;
QAction *spanishLangAct;
QAction *portugueseLangAct;
QAction *swedishLangAct;
QAction *russianLangAct;
QAction *dutchLangAct;
// QAction *russianLangAct;
// QAction *dutchLangAct;
QAction *openDocURLAct;
};
+129 -107
View File
@@ -81,7 +81,7 @@ MdiChild::MdiChild():
}
}
MdiChild::~MdiChild()
MdiChild::~MdiChild()
{
delete ui;
}
@@ -155,7 +155,7 @@ void MdiChild::on_SimulateTxButton_clicked()
void MdiChild::checkAndInitModel(int row)
{
ModelData &model = radioData.models[row - 1];
if (model.isempty()) {
if (model.isEmpty()) {
model.setDefaultValues(row - 1, radioData.generalSettings);
setModified();
}
@@ -170,26 +170,31 @@ void MdiChild::generalEdit()
void MdiChild::modelEdit()
{
int row = ui->modelsList->currentRow();
int row = getCurrentRow();
if (row == 0){
generalEdit();
}
}
else {
QApplication::setOverrideCursor(Qt::WaitCursor);
checkAndInitModel( row );
ModelData &model = radioData.models[row - 1];
gStopwatch.restart();
gStopwatch.report("ModelEdit creation");
ModelEdit *t = new ModelEdit(this, radioData, (row - 1), GetCurrentFirmware()/*firmware*/);
gStopwatch.report("ModelEdit created");
t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name);
connect(t, SIGNAL(modified()), this, SLOT(setModified()));
gStopwatch.report("STARTING MODEL EDIT");
t->show();
QApplication::restoreOverrideCursor();
gStopwatch.report("ModelEdit shown");
}
}
void MdiChild::wizardEdit()
{
int row = ui->modelsList->currentRow();
int row = getCurrentRow();
if (row > 0) {
checkAndInitModel(row);
WizardDialog * wizard = new WizardDialog(radioData.generalSettings, row, this);
@@ -203,13 +208,13 @@ void MdiChild::wizardEdit()
void MdiChild::openEditWindow()
{
int row = ui->modelsList->currentRow();
int row = getCurrentRow();
if (row == 0){
generalEdit();
}
else{
ModelData &model = radioData.models[row - 1];
if (model.isempty() && g.useWizard()) {
if (model.isEmpty() && g.useWizard()) {
wizardEdit();
}
else {
@@ -251,7 +256,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
XmlInterface(inputStream).load(radioData);
}
else
#endif
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
QMessageBox::critical(this, tr("Error"),
@@ -260,18 +265,19 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
.arg(file.errorString()));
return false;
}
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
bool xmlOK = doc.setContent(&file);
if(xmlOK) {
if (loadEEpromXml(radioData, doc)){
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
if (errors.test(NO_ERROR)) {
ui->modelsList->refreshList();
if(resetCurrentFile) setCurrentFile(fileName);
return true;
}
}
file.reset();
QTextStream inputStream(&file);
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
@@ -294,12 +300,14 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
file.close();
if (!loadEEprom(radioData, (uint8_t *)eeprom.data(), eeprom_size)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid EEPROM File %1")
.arg(fileName));
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName), errors.to_ulong());
return false;
}
if (errors.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errors.to_ulong());
}
ui->modelsList->refreshList();
if(resetCurrentFile) setCurrentFile(fileName);
@@ -330,11 +338,18 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
return false;
}
if (!loadEEprom(radioData, eeprom, eeprom_size) && !::loadBackup(radioData, eeprom, eeprom_size, 0)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid binary EEPROM File %1")
.arg(fileName));
return false;
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
if (!errorsEeprom.test(NO_ERROR)) {
std::bitset<NUM_ERRORS> errorsBackup((unsigned long long)LoadBackup(radioData, eeprom, eeprom_size, 0));
if (!errorsBackup.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid binary EEPROM File %1").arg(fileName), (errorsEeprom | errorsBackup).to_ulong());
return false;
}
if (errorsBackup.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsBackup.to_ulong());
}
} else if (errorsEeprom.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
}
ui->modelsList->refreshList();
@@ -367,7 +382,7 @@ bool MdiChild::saveAs(bool isNew)
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
#else
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(BIN_FILES_FILTER));
#endif
#endif
}
else {
QFileInfo fi(curFile);
@@ -375,45 +390,45 @@ bool MdiChild::saveAs(bool isNew)
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
#else
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(EEPROM_FILES_FILTER));
#endif
#endif
}
if (fileName.isEmpty())
return false;
g.eepromDir( QFileInfo(fileName).dir().absolutePath() );
if (isNew)
return saveFile(fileName);
else
else
return saveFile(fileName,true);
}
bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
{
QString myFile;
myFile = fileName;
if (IS_SKY9X(GetEepromInterface()->getBoard())) {
myFile.replace(".eepe", ".bin");
}
QFile file(myFile);
QString myFile;
myFile = fileName;
if (IS_SKY9X(GetEepromInterface()->getBoard())) {
myFile.replace(".eepe", ".bin");
}
QFile file(myFile);
int fileType = getFileType(myFile);
int fileType = getFileType(myFile);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = 0;
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
int eeprom_size = 0;
if (fileType != FILE_TYPE_XML) {
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber(), 0/*last version*/);
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
return false;
}
}
if (!file.open(fileType == FILE_TYPE_BIN ? QIODevice::WriteOnly : (QIODevice::WriteOnly | QIODevice::Text))) {
if (fileType != FILE_TYPE_XML) {
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber(), 0/*last version*/);
if (!eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
return false;
}
}
QTextStream outputStream(&file);
if (!file.open(fileType == FILE_TYPE_BIN ? QIODevice::WriteOnly : (QIODevice::WriteOnly | QIODevice::Text))) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
return false;
}
QTextStream outputStream(&file);
#if 0
if (fileType==FILE_TYPE_XML) {
@@ -425,34 +440,34 @@ bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
}
else
#endif
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { // write hex
if (fileType==FILE_TYPE_EEPE)
outputStream << EEPE_EEPROM_FILE_HEADER << "\n";
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { // write hex
if (fileType==FILE_TYPE_EEPE)
outputStream << EEPE_EEPROM_FILE_HEADER << "\n";
if (!HexInterface(outputStream).save(eeprom, eeprom_size)) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
file.close();
return false;
}
}
else if (fileType==FILE_TYPE_BIN) // write binary
{
long result = file.write((char*)eeprom, eeprom_size);
if(result!=eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(myFile).arg(file.errorString()));
if (!HexInterface(outputStream).save(eeprom, eeprom_size)) {
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
file.close();
return false;
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(myFile).arg("Unknown format"));
}
else if (fileType==FILE_TYPE_BIN) // write binary
{
long result = file.write((char*)eeprom, eeprom_size);
if(result!=eeprom_size) {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(myFile).arg(file.errorString()));
return false;
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(myFile).arg("Unknown format"));
return false;
}
free(eeprom); // TODO free in all cases ...
file.close();
if(setCurrent) setCurrentFile(myFile);
free(eeprom); // TODO free in all cases ...
file.close();
if(setCurrent) setCurrentFile(myFile);
return true;
return true;
}
QString MdiChild::userFriendlyCurrentFile()
@@ -505,7 +520,7 @@ void MdiChild::setCurrentFile(const QString &fileName)
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
g.recentFiles( files );
}
@@ -529,8 +544,8 @@ void MdiChild::writeEeprom() // write to Tx
void MdiChild::simulate()
{
if (ui->modelsList->currentRow() >= 1) {
startSimulation(this, radioData, ui->modelsList->currentRow()-1);
if (getCurrentRow() > 0) {
startSimulation(this, radioData, getCurrentRow()-1);
}
}
@@ -539,12 +554,12 @@ void MdiChild::print(int model, QString filename)
PrintDialog * pd = NULL;
if (model>=0 && !filename.isEmpty()) {
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[model], filename);
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, radioData.generalSettings, radioData.models[model], filename);
}
else if (ui->modelsList->currentRow() > 0) {
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
else if (getCurrentRow() > 0) {
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, radioData.generalSettings, radioData.models[getCurrentRow()-1]);
}
if (pd) {
pd->setAttribute(Qt::WA_DeleteOnClose, true);
pd->show();
@@ -561,49 +576,56 @@ void MdiChild::setEEpromAvail(int eavail)
EEPromAvail=eavail;
}
int MdiChild::getCurrentRow() const
{
return ui->modelsList->currentRow();
}
bool MdiChild::loadBackup()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open backup Models and Settings file"), g.eepromDir(),tr(EEPROM_FILES_FILTER));
if (fileName.isEmpty())
return false;
QFile file(fileName);
QString fileName = QFileDialog::getOpenFileName(this, tr("Open backup Models and Settings file"), g.eepromDir(),tr(EEPROM_FILES_FILTER));
if (fileName.isEmpty())
return false;
QFile file(fileName);
if (!file.exists()) {
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
if (!file.exists()) {
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
return false;
}
if(getCurrentRow() < 1) return false;
int index = getCurrentRow() - 1;
int eeprom_size = file.size();
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
QMessageBox::critical(this, tr("Error"),
tr("Error opening file %1:\n%2.")
.arg(fileName)
.arg(file.errorString()));
return false;
}
QByteArray eeprom(eeprom_size, 0);
long result = file.read((char*)eeprom.data(), eeprom_size);
file.close();
if (result != eeprom_size) {
QMessageBox::critical(this, tr("Error"),
tr("Error reading file %1:\n%2.")
.arg(fileName)
.arg(file.errorString()));
return false;
}
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
if (!errorsEeprom.test(NO_ERROR)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
return false;
}
if(ui->modelsList->currentRow()<1) return false;
int index=ui->modelsList->currentRow()-1;
int eeprom_size = file.size();
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
QMessageBox::critical(this, tr("Error"),
tr("Error opening file %1:\n%2.")
.arg(fileName)
.arg(file.errorString()));
return false;
}
QByteArray eeprom(eeprom_size, 0);
long result = file.read((char*)eeprom.data(), eeprom_size);
file.close();
if (result != eeprom_size) {
QMessageBox::critical(this, tr("Error"),
tr("Error reading file %1:\n%2.")
.arg(fileName)
.arg(file.errorString()));
return false;
if (errorsEeprom.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
}
if (!::loadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index)) {
QMessageBox::critical(this, tr("Error"),
tr("Invalid binary backup File %1")
.arg(fileName));
return false;
}
ui->modelsList->refreshList();
ui->modelsList->refreshList();
return true;
return true;
}
+1
View File
@@ -77,6 +77,7 @@ class MdiChild : public QWidget
void viableModelSelected(bool viable);
void eepromInterfaceChanged();
void setEEpromAvail(int eavail);
int getCurrentRow() const;
signals:
void copyAvailable(bool val);
+36 -32
View File
@@ -7,7 +7,7 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
LimitsGroup::LimitsGroup(Firmware * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt):
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt):
firmware(firmware),
spinbox(new QDoubleSpinBox()),
value(value),
@@ -39,14 +39,17 @@ LimitsGroup::LimitsGroup(Firmware * firmware, QGridLayout *gridLayout, int row,
}
spinbox->setSingleStep(displayStep*internalStep);
spinbox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
QHBoxLayout * horizontalLayout = new QHBoxLayout();
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
gv->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
horizontalLayout->addWidget(gv);
QComboBox * cb = new QComboBox();
cb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
horizontalLayout->addWidget(cb);
horizontalLayout->addWidget(spinbox);
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
tableLayout->addLayout(row, col, horizontalLayout);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
}
@@ -74,55 +77,55 @@ void LimitsGroup::updateMinMax(int max)
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
ModelPanel(parent, model, generalSettings, firmware)
{
QGridLayout * gridLayout = new QGridLayout(this);
bool minimize = false;
Stopwatch s1("Channels");
int col = 1;
if (firmware->getCapability(ChannelsName)) {
minimize=true;
addLabel(gridLayout, tr("Name"), col++);
int channelNameMaxLen = firmware->getCapability(ChannelsName);
QStringList headerLabels;
headerLabels << "#";
if (channelNameMaxLen > 0) {
headerLabels << tr("Name");
}
addLabel(gridLayout, tr("Subtrim"), col++, minimize);
addLabel(gridLayout, tr("Min"), col++, minimize);
addLabel(gridLayout, tr("Max"), col++, minimize);
addLabel(gridLayout, tr("Direction"), col++, minimize);
headerLabels << tr("Subtrim") << tr("Min") << tr("Max") << tr("Direction");
if (IS_TARANIS(GetEepromInterface()->getBoard()))
addLabel(gridLayout, tr("Curve"), col++, minimize);
headerLabels << tr("Curve");
if (firmware->getCapability(PPMCenter))
addLabel(gridLayout, tr("PPM Center"), col++, minimize);
headerLabels << tr("PPM Center");
if (firmware->getCapability(SYMLimits))
addLabel(gridLayout, tr("Linear Subtrim"), col++, true);
headerLabels << tr("Linear Subtrim");
TableLayout * tableLayout = new TableLayout(this, firmware->getCapability(LogicalSwitches), headerLabels);
s1.report("header");
for (int i=0; i<firmware->getCapability(Outputs); i++) {
col = 0;
int col = 0;
// Channel label
QLabel *label = new QLabel(this);
label->setText(tr("Channel %1").arg(i+1));
label->setText(tr("CH%1").arg(i+1));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
gridLayout->addWidget(label, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, label);
// Channel name
int nameLen = firmware->getCapability(ChannelsName);
if (nameLen > 0) {
if (channelNameMaxLen > 0) {
QLineEdit * name = new QLineEdit(this);
name->setProperty("index", i);
name->setMaxLength(nameLen);
name->setMaxLength(channelNameMaxLen);
QRegExp rx(CHAR_FOR_NAMES_REGEX);
name->setValidator(new QRegExpValidator(rx, this));
name->setText(model.limitData[i].name);
connect(name, SIGNAL(editingFinished()), this, SLOT(nameEdited()));
gridLayout->addWidget(name, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, name);
}
// Channel offset
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].offset, -1000, 1000, 0);
// Channel min
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
// Channel max
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
@@ -130,7 +133,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
invCB->setProperty("index", i);
invCB->setCurrentIndex((model.limitData[i].revert) ? 1 : 0);
connect(invCB, SIGNAL(currentIndexChanged(int)), this, SLOT(invEdited()));
gridLayout->addWidget(invCB, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, invCB);
// Curve
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
@@ -142,7 +145,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
}
curveCB->setCurrentIndex(model.limitData[i].curve.value+numcurves);
connect(curveCB, SIGNAL(currentIndexChanged(int)), this, SLOT(curveEdited()));
gridLayout->addWidget(curveCB, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, curveCB);
}
// PPM center
@@ -157,7 +160,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
center->setValue(1500);
center->setValue(model.limitData[i].ppmCenter + 1500);
connect(center, SIGNAL(editingFinished()), this, SLOT(ppmcenterEdited()));
gridLayout->addWidget(center, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, center);
}
// Symetrical limits
@@ -166,14 +169,15 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
symlimits->setProperty("index", i);
symlimits->setChecked(model.limitData[i].symetrical);
connect(symlimits, SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited()));
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
tableLayout->addWidget(i, col++, symlimits);
}
}
// Push the rows up
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
s1.report("add elements");
disableMouseScrolling();
tableLayout->resizeColumnsToContents();
tableLayout->pushRowsUp(firmware->getCapability(Outputs)+1);
s1.report("end");
}
Channels::~Channels()
+2 -1
View File
@@ -1,6 +1,7 @@
#ifndef CHANNELS_H
#define CHANNELS_H
#include "helpers.h"
#include "modeledit.h"
#include <QSpinBox>
@@ -9,7 +10,7 @@ class GVarGroup;
class LimitsGroup
{
public:
LimitsGroup(Firmware * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt);
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt);
~LimitsGroup();
void updateMinMax(int max);
+44 -29
View File
@@ -43,8 +43,7 @@ void RepeatComboBox::update()
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, GeneralSettings & generalSettings, Firmware * firmware):
GenericPanel(parent, model, generalSettings, firmware),
functions(model ? model->customFn : generalSettings.customFn),
initialized(false)
functions(model ? model->customFn : generalSettings.customFn)
#if defined(PHONON)
,
phononCurrent(-1),
@@ -52,14 +51,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
clickOutput(NULL)
#endif
{
QGridLayout * gridLayout = new QGridLayout(this);
addLabel(gridLayout, tr("Switch"), 1);
addLabel(gridLayout, tr("Action"), 2);
addLabel(gridLayout, tr("Parameters"), 3);
addLabel(gridLayout, tr("Enable"), 4, true );
addEmptyLabel(gridLayout, 5 );
Stopwatch s1("CustomFunctionsPanel - populate");
lock = true;
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
@@ -75,6 +67,8 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
}
}
s1.report("get tracks");
if (IS_TARANIS(firmware->getBoard())) {
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
@@ -86,9 +80,14 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
}
}
}
s1.report("get scripts");
CompanionIcon playIcon("play.png");
QStringList headerLabels;
headerLabels << "#" << tr("Switch") << tr("Action") << tr("Parameters") << tr("Enable");
TableLayout * tableLayout = new TableLayout(this, num_fsw, headerLabels);
for (int i=0; i<num_fsw; i++) {
// The label
QLabel * label = new QLabel(this);
@@ -101,28 +100,35 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
label->setText(tr("GF%1").arg(i+1));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(fsw_customContextMenuRequested(QPoint)));
gridLayout->addWidget(label, i+1, 0);
tableLayout->addWidget(i, 0, label);
// s1.report("label");
// The switch
fswtchSwtch[i] = new QComboBox(this);
fswtchSwtch[i]->setProperty("index", i);
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
fswtchSwtch[i]->setMaxVisibleItems(10);
connect(fswtchSwtch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
gridLayout->addWidget(fswtchSwtch[i], i+1, 1);
tableLayout->addWidget(i, 1, fswtchSwtch[i]);
// s1.report("switch");
// The function
fswtchFunc[i] = new QComboBox(this);
fswtchFunc[i]->setProperty("index", i);
populateFuncCB(fswtchFunc[i], functions[i].func);
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
gridLayout->addWidget(fswtchFunc[i], i+1, 2);
tableLayout->addWidget(i, 2, fswtchFunc[i]);
// s1.report("func");
// The parameters
QHBoxLayout *paramLayout = new QHBoxLayout();
gridLayout->addLayout(paramLayout, i+1, 3);
QHBoxLayout * paramLayout = new QHBoxLayout();
tableLayout->addLayout(i, 3, paramLayout);
fswtchGVmode[i] = new QComboBox(this);
fswtchGVmode[i]->setProperty("index", i);
populateGVmodeCB(fswtchGVmode[i], functions[i].adjustMode);
fswtchGVmode[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
connect(fswtchGVmode[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
paramLayout->addWidget(fswtchGVmode[i]);
@@ -149,12 +155,15 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
fswtchParamT[i] = new QComboBox(this);
fswtchParamT[i]->setProperty("index", i);
populateFuncParamCB(fswtchParamT[i], functions[i].func, functions[i].param, functions[i].adjustMode);
paramLayout->addWidget(fswtchParamT[i]);
fswtchParamT[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
connect(fswtchParamT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
fswtchParamArmT[i] = new QComboBox(this);
fswtchParamArmT[i]->setProperty("index", i);
fswtchParamArmT[i]->setEditable(true);
fswtchParamArmT[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
paramLayout->addWidget(fswtchParamArmT[i]);
connect(fswtchParamArmT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
@@ -171,14 +180,15 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
#ifdef PHONON
playBT[i] = new QPushButton(this);
playBT[i]->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
playBT[i]->setProperty("index", i);
playBT[i]->setIcon(playIcon);
paramLayout->addWidget(playBT[i]);
connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic()));
#endif
QHBoxLayout *repeatLayout = new QHBoxLayout();
gridLayout->addLayout(repeatLayout, i+1, 4);
QHBoxLayout * repeatLayout = new QHBoxLayout();
tableLayout->addLayout(i, 4, repeatLayout);
fswtchRepeat[i] = new RepeatComboBox(this, functions[i].repeatParam);
repeatLayout->addWidget(fswtchRepeat[i], i+1);
connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified()));
@@ -186,17 +196,24 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
fswtchEnable[i] = new QCheckBox(this);
fswtchEnable[i]->setProperty("index", i);
fswtchEnable[i]->setText(tr("ON"));
fswtchEnable[i]->setFixedWidth( 80 );
fswtchEnable[i]->setFixedWidth(200);
repeatLayout->addWidget(fswtchEnable[i], i+1);
connect(fswtchEnable[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
}
// Push rows upward
addDoubleSpring(gridLayout, 5, num_fsw+1);
s1.report("add items");
disableMouseScrolling();
s1.report("disableMouseScrolling");
lock = false;
update();
s1.report("update");
tableLayout->resizeColumnsToContents();
s1.report("resizeColumnsToContents");
tableLayout->setColumnWidth(3, 300);
tableLayout->pushRowsUp(num_fsw+1);
s1.report("end");
}
CustomFunctionsPanel::~CustomFunctionsPanel()
@@ -383,13 +400,16 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
}
else if (func>=FuncSetTimer1 && func<=FuncSetTimer2) {
else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) {
if (modified) cfn.param = QTimeS(fswtchParamTime[i]->time()).seconds();
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
fswtchParamTime[i]->setTime(QTimeS(cfn.param));
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (func>=FuncSetFailsafeInternalModule && func<=FuncBindExternalModule) {
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
}
else if (func==FuncVolume) {
if (modified) cfn.param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
@@ -516,15 +536,8 @@ void CustomFunctionsPanel::update()
lock = true;
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
for (int i=0; i<num_fsw; i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
populateFuncCB(fswtchFunc[i], functions[i].func);
populateGVmodeCB(fswtchGVmode[i], functions[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], functions[i].func, functions[i].param, functions[i].adjustMode);
}
refreshCustomFunction(i);
}
initialized = true;
lock = false;
}
@@ -604,6 +617,8 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
((i==FuncSetTimer3) && firmware->getCapability(Timers) < 3) ||
((i>=FuncRangeCheckInternalModule && i<=FuncBindExternalModule) && (!model || !firmware->getCapability(DangerousFunctions))) ||
((i>=FuncAdjustGV1 && i<=FuncAdjustGVLast) && !firmware->getCapability(Gvars))
) {
// skipped
@@ -66,7 +66,6 @@ class CustomFunctionsPanel : public GenericPanel
void populateGVmodeCB(QComboBox *b, unsigned int value);
void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode=0);
bool initialized;
QSet<QString> tracksSet;
QSet<QString> scriptsSet;
int phononCurrent;
+65 -63
View File
@@ -11,7 +11,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
firmware(firmware),
ed(expoData),
inputName(inputName),
modelPrinter(firmware, &generalSettings, &model)
modelPrinter(firmware, generalSettings, model)
{
ui->setupUi(this);
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
@@ -33,7 +33,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve,
firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
@@ -47,14 +48,14 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
}
}
else {
int mask=1;
for (int i=0; i<9 ; i++) {
if ((ed->phases & mask)==0) {
int mask = 1;
for (int i=0; i<9; i++) {
if ((ed->flightModes & mask) == 0) {
cb_fp[i]->setChecked(true);
}
mask <<= 1;
}
for (int i=firmware->getCapability(FlightModes); i<9;i++) {
for (int i=firmware->getCapability(FlightModes); i<9; i++) {
lb_fp[i]->hide();
cb_fp[i]->hide();
}
@@ -62,7 +63,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
if (firmware->getCapability(VirtualInputs)) {
ui->inputName->setMaxLength(4);
populateSourceCB(ui->sourceCB, ed->srcRaw, generalSettings, &model, POPULATE_NONE | POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
populateSourceCB(ui->sourceCB, ed->srcRaw, generalSettings, &model, POPULATE_NONE | POPULATE_SOURCES |
POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
ui->sourceCB->removeItem(0);
ui->inputName->setValidator(new QRegExpValidator(rx, this));
ui->inputName->setText(inputName);
@@ -76,10 +78,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->trimCB->hide();
}
ui->trimCB->addItem(tr("Rud"), 1);
ui->trimCB->addItem(tr("Ele"), 2);
ui->trimCB->addItem(tr("Thr"), 3);
ui->trimCB->addItem(tr("Ail"), 4);
for(int i=0; i < NUM_STICKS; i++) {
ui->trimCB->addItem(AnalogString(i), i+1);
}
ui->trimCB->setCurrentIndex(1 - ed->carryTrim);
int expolength = firmware->getCapability(HasExpoNames);
@@ -139,67 +140,68 @@ void ExpoDialog::updateScale()
void ExpoDialog::valuesChanged()
{
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
RawSource srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
if (ed->srcRaw != srcRaw) {
ed->srcRaw = srcRaw;
updateScale();
RawSource srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
if (ed->srcRaw != srcRaw) {
ed->srcRaw = srcRaw;
updateScale();
}
RawSourceRange range = srcRaw.getRange(&model, generalSettings);
ed->scale = round(float(ui->scale->value()) / range.step);
ed->carryTrim = 1 - ui->trimCB->currentIndex();
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
ed->mode = ui->sideCB->currentIndex() + 1;
strcpy(ed->name, ui->lineName->text().toAscii().data());
if (firmware->getCapability(VirtualInputs)) {
inputName = ui->inputName->text();
}
ed->flightModes = 0;
for (int i=8; i>=0 ; i--) {
if (!cb_fp[i]->checkState()) {
ed->flightModes++;
}
RawSourceRange range = srcRaw.getRange(&model, generalSettings);
ed->scale = round(float(ui->scale->value()) / range.step);
ed->carryTrim = 1 - ui->trimCB->currentIndex();
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
ed->mode = ui->sideCB->currentIndex() + 1;
strcpy(ed->name, ui->lineName->text().toAscii().data());
if (firmware->getCapability(VirtualInputs))
inputName = ui->inputName->text();
ed->phases=0;
for (int i=8; i>=0 ; i--) {
if (!cb_fp[i]->checkState()) {
ed->phases+=1;
ed->flightModes <<= 1;
}
ed->flightModes >>= 1;
if (firmware->getCapability(FlightModes)) {
int zeros = 0;
int ones = 0;
int phtemp = ed->flightModes;
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
if (phtemp & 1) {
ones++;
}
ed->phases<<=1;
else {
zeros++;
}
phtemp >>= 1;
}
ed->phases>>=1;
if (firmware->getCapability(FlightModes)) {
int zeros=0;
int ones=0;
int phtemp=ed->phases;
if (zeros == 1) {
phtemp=ed->flightModes;
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
if ((phtemp & 1) == 0) {
break;
}
phtemp >>= 1;
}
}
else if (ones == 1) {
phtemp = ed->flightModes;
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
if (phtemp & 1) {
ones++;
}
else {
zeros++;
}
phtemp >>=1;
}
if (zeros==1) {
phtemp=ed->phases;
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
if ((phtemp & 1)==0) {
break;
}
phtemp >>=1;
}
}
else if (ones==1) {
phtemp=ed->phases;
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
if (phtemp & 1) {
break;
}
phtemp >>=1;
break;
}
phtemp >>= 1;
}
}
else {
ed->phases=0;
}
}
else {
ed->flightModes = 0;
}
}
void ExpoDialog::shrink()
+1 -1
View File
@@ -52,7 +52,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelName">
<property name="text">
<string>Name</string>
</property>
+31 -1
View File
@@ -15,6 +15,9 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
{
ui->setupUi(this);
ui->labelName->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->labelName, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(name_customContextMenuRequested(const QPoint &)));
int modesCount = firmware->getCapability(FlightModes);
// Phase name
@@ -56,7 +59,11 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
}
// The trims
QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure
QString labels[NUM_STICKS];
for(int i=0; i < NUM_STICKS; i++) {
labels[i] = AnalogString(i);
}
trimsLabel << ui->trim1Label << ui->trim2Label << ui->trim3Label << ui->trim4Label;
trimsUse << ui->trim1Use << ui->trim2Use << ui->trim3Use << ui->trim4Use;
@@ -422,6 +429,29 @@ void FlightModePanel::phaseTrimSlider_valueChanged()
}
}
void FlightModePanel::name_customContextMenuRequested(const QPoint & pos)
{
QLabel *label = (QLabel *)sender();
QPoint globalPos = label->mapToGlobal(pos);
QMenu contextMenu;
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Clear"),this,SLOT(fmClear()),tr("Clear"));
contextMenu.exec(globalPos);
}
void FlightModePanel::fmClear()
{
int res = QMessageBox::question(this, "Companion", tr("Clear all current Flight Mode properties?"), QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::Yes) {
phase.clear();
for(int i=0; i < 4; ++i) {
model->setTrimValue(phaseIdx, i, 0);
}
update();
emit modified();
emit nameModified();
}
}
/**********************************************************/
FlightModesPanel::FlightModesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
+2
View File
@@ -41,6 +41,8 @@ class FlightModePanel : public ModelPanel
void phaseGVPopupToggled(bool checked);
void phaseREValue_editingFinished();
void phaseREUse_currentIndexChanged(int index);
void name_customContextMenuRequested(const QPoint & pos);
void fmClear();
private:
Ui::FlightMode *ui;
+6 -6
View File
@@ -6,7 +6,7 @@
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
ModelPanel(parent, model, generalSettings, firmware),
expoInserted(false),
modelPrinter(firmware, &generalSettings, &model)
modelPrinter(firmware, generalSettings, model)
{
inputsCount = firmware->getCapability(VirtualInputs);
if (inputsCount == 0)
@@ -140,14 +140,14 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
if (new_ch) *new_ch = 1;
}
else {
ExpoData *md = &model->expoData[dest];
ExpoData & input = model->expoData[dest];
if ((dest == 0) || (model->expoData[dest-1].chn != md->chn)) {
if ((dest == 0) || (model->expoData[dest-1].chn != input.chn)) {
if (new_ch) *new_ch = 1;
if (firmware->getCapability(VirtualInputs))
str += QString("%1").arg(modelPrinter.printInputName(md->chn), -10, ' ');
str += QString("%1").arg(modelPrinter.printInputName(input.chn), -10, ' ');
else
str = modelPrinter.printInputName(md->chn);
str = modelPrinter.printInputName(input.chn);
}
else {
if (firmware->getCapability(VirtualInputs))
@@ -156,7 +156,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
str = " ";
}
str.replace(" ", "&nbsp;");
str += modelPrinter.printInputLine(md);
str += modelPrinter.printInputLine(input);
}
return str;
}
+26 -22
View File
@@ -11,19 +11,18 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
ModelPanel(parent, model, generalSettings, firmware),
selectedSwitch(0)
{
Stopwatch s1("LogicalSwitchesPanel");
int channelsMax = model.getChannelsMax(true);
QGridLayout * gridLayout = new QGridLayout(this);
int col = 1;
addLabel(gridLayout, tr("Function"), col++);
addLabel(gridLayout, tr("V1"), col++);
addLabel(gridLayout, tr("V2"), col++);
addLabel(gridLayout, tr("AND Switch"), col++);
QStringList headerLabels;
headerLabels << "#" << tr("Function") << tr("V1") << tr("V2") << tr("AND Switch");
if (firmware->getCapability(LogicalSwitchesExt)) {
addLabel(gridLayout, tr("Duration"), col++);
addLabel(gridLayout, tr("Delay"), col++);
headerLabels << tr("Duration") << tr("Delay");
}
TableLayout * tableLayout = new TableLayout(this, firmware->getCapability(LogicalSwitches), headerLabels);
s1.report("header");
lock = true;
for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
@@ -35,19 +34,20 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
label->setMouseTracking(true);
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(csw_customContextMenuRequested(QPoint)));
gridLayout->addWidget(label, i+1, 0);
tableLayout->addWidget(i, 0, label);
// The function
csw[i] = new QComboBox(this);
csw[i]->setProperty("index", i);
connect(csw[i], SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
gridLayout->addWidget(csw[i], i+1, 1);
tableLayout->addWidget(i, 1, csw[i]);
// V1
QHBoxLayout *v1Layout = new QHBoxLayout();
cswitchSource1[i] = new QComboBox(this);
cswitchSource1[i]->setProperty("index",i);
connect(cswitchSource1[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v1Edited(int)));
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
v1Layout->addWidget(cswitchSource1[i]);
cswitchSource1[i]->setVisible(false);
cswitchValue[i] = new QDoubleSpinBox(this);
cswitchValue[i]->setMaximum(channelsMax);
@@ -56,8 +56,9 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchValue[i]->setDecimals(0);
cswitchValue[i]->setProperty("index", i);
connect(cswitchValue[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
gridLayout->addWidget(cswitchValue[i], i+1, 2);
v1Layout->addWidget(cswitchValue[i]);
cswitchValue[i]->setVisible(false);
tableLayout->addLayout(i, 2, v1Layout);
// V2
QHBoxLayout *v2Layout = new QHBoxLayout();
@@ -90,13 +91,13 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
connect(cswitchTOffset[i],SIGNAL(editingFinished()),this,SLOT(edited()));
v2Layout->addWidget(cswitchTOffset[i]);
cswitchTOffset[i]->setVisible(false);
gridLayout->addLayout(v2Layout, i+1, 3);
tableLayout->addLayout(i, 3, v2Layout);
// AND
cswitchAnd[i] = new QComboBox(this);
cswitchAnd[i]->setProperty("index", i);
connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int)));
gridLayout->addWidget(cswitchAnd[i], i+1, 4);
tableLayout->addWidget(i, 4, cswitchAnd[i]);
if (firmware->getCapability(LogicalSwitchesExt)) {
// Duration
@@ -108,7 +109,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchDuration[i]->setAccelerated(true);
cswitchDuration[i]->setDecimals(1);
connect(cswitchDuration[i], SIGNAL(valueChanged(double)), this, SLOT(durationEdited(double)));
gridLayout->addWidget(cswitchDuration[i], i+1, 5);
tableLayout->addWidget(i, 5, cswitchDuration[i]);
// Delay
cswitchDelay[i] = new QDoubleSpinBox(this);
@@ -119,15 +120,18 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchDelay[i]->setAccelerated(true);
cswitchDelay[i]->setDecimals(1);
connect(cswitchDelay[i], SIGNAL(valueChanged(double)), this, SLOT(delayEdited(double)));
gridLayout->addWidget(cswitchDelay[i], i+1, 6);
tableLayout->addWidget(i, 6, cswitchDelay[i]);
}
}
// Push rows upward
addVSpring(gridLayout,0,firmware->getCapability(LogicalSwitches)+1);
s1.report("added elements");
disableMouseScrolling();
lock = false;
update();
tableLayout->resizeColumnsToContents();
tableLayout->pushRowsUp(firmware->getCapability(LogicalSwitches)+1);
s1.report("end");
}
LogicalSwitchesPanel::~LogicalSwitchesPanel()
@@ -240,7 +244,7 @@ void LogicalSwitchesPanel::edited()
updateTimerParam(cswitchOffset[i], model->logicalSw[i].val2, 0.1);
break;
case LS_FAMILY_EDGE:
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (sender() == cswitchOffset[i]) {
model->logicalSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model->logicalSw[i].val2, 0.0);
@@ -339,7 +343,7 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
populateSwitchCB(cswitchSource1[i], RawSwitch(model->logicalSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model->logicalSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model->logicalSw[i].val2+model->logicalSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (model->logicalSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
}
+19 -21
View File
@@ -19,16 +19,18 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
this->setWindowTitle(tr("DEST -> CH%1").arg(md->destCh));
populateSourceCB(ui->sourceCB, md->srcRaw, generalSettings, &model, POPULATE_NONE | POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
populateSourceCB(ui->sourceCB, md->srcRaw, generalSettings, &model, POPULATE_NONE | POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS |
POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->sourceCB->removeItem(0);
int limit = firmware->getCapability(OffsetWeight);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB,
md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
ui->MixDR_CB->setChecked(md->noExpo==0);
ui->MixDR_CB->setChecked(md->noExpo == 0);
if (!firmware->getCapability(HasNoExpo)) {
ui->MixDR_CB->hide();
@@ -36,10 +38,9 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
}
if (!firmware->getCapability(VirtualInputs)) {
ui->trimCB->addItem(tr("Rud"));
ui->trimCB->addItem(tr("Ele"));
ui->trimCB->addItem(tr("Thr"));
ui->trimCB->addItem(tr("Ail"));
for(int i=0; i < NUM_STICKS; i++) {
ui->trimCB->addItem(AnalogString(i));
}
}
ui->trimCB->setCurrentIndex(1 - md->carryTrim);
@@ -63,14 +64,14 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
}
}
else {
int mask=1;
int mask = 1;
for (int i=0; i<9 ; i++) {
if ((md->phases & mask)==0) {
if ((md->flightModes & mask) == 0) {
cb_fp[i]->setChecked(true);
}
mask <<= 1;
}
for (int i=firmware->getCapability(FlightModes); i<9;i++) {
for (int i=firmware->getCapability(FlightModes); i<9; i++) {
lb_fp[i]->hide();
cb_fp[i]->hide();
}
@@ -149,29 +150,26 @@ void MixerDialog::valuesChanged()
ui->label_MixDR->setEnabled(drVisible);
}
md->carryTrim = -(ui->trimCB->currentIndex()-1);
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
md->mixWarn = ui->warningCB->currentIndex();
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
int scale=firmware->getCapability(SlowScale);
int scale = firmware->getCapability(SlowScale);
md->delayDown = round(ui->delayDownSB->value()*scale);
md->delayUp = round(ui->delayUpSB->value()*scale);
md->speedDown = round(ui->slowDownSB->value()*scale);
md->speedUp = round(ui->slowUpSB->value()*scale);
int i=0;
for (i=0; i<ui->mixerName->text().toAscii().length(); i++) {
md->name[i]=ui->mixerName->text().toAscii().at(i);
}
md->name[i]=0;
md->phases=0;
strcpy(md->name, ui->mixerName->text().toAscii());
md->flightModes = 0;
for (int i=8; i>=0 ; i--) {
if (!cb_fp[i]->checkState()) {
md->phases+=1;
md->flightModes++;
}
md->phases<<=1;
md->flightModes <<= 1;
}
md->phases>>=1;
md->flightModes >>= 1;
lock = false;
}
+223 -220
View File
@@ -7,7 +7,7 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ModelPanel(parent, model, generalSettings, firmware),
mixInserted(false),
highlightedSource(0),
modelPrinter(firmware, &generalSettings, &model)
modelPrinter(firmware, generalSettings, model)
{
QGridLayout * mixesLayout = new QGridLayout(this);
@@ -48,19 +48,17 @@ void MixesPanel::update()
{
// curDest -> destination channel
// i -> mixer number
QByteArray qba;
MixerlistWidget->clear();
firstLine = true;
unsigned int curDest = 0;
int i;
unsigned int outputs = firmware->getCapability(Outputs);
for (i=0; i<firmware->getCapability(Mixes); i++) {
MixData *md = &model->mixData[i];
// qDebug() << "md->destCh: " << md->destCh;
if (md->destCh==0 || md->destCh>outputs) continue;
for (int i=0; i<firmware->getCapability(Mixes); i++) {
MixData & mix = model->mixData[i];
// qDebug() << "mix.destCh: " << mix.destCh;
if (mix.destCh == 0 || mix.destCh>outputs) continue;
QString str = "";
while (curDest < md->destCh-1) {
while (curDest < mix.destCh-1) {
curDest++;
AddMixerLine(-curDest);
}
@@ -123,24 +121,24 @@ bool MixesPanel::AddMixerLine(int dest)
QString MixesPanel::getMixerText(int dest, bool * new_ch)
{
QString str;
if (new_ch) *new_ch = 0;
bool newChannel = false;
if (dest < 0) {
str = modelPrinter.printMixerName(-dest);
//highlight channel if needed
if (-dest == (int)highlightedSource) {
str = "<b>" + str + "</b>";
}
if (new_ch) *new_ch = 1;
newChannel = true;
}
else {
MixData *md = &model->mixData[dest];
//md->destCh from 1 to 32
str = modelPrinter.printMixerName(md->destCh);
MixData & mix = model->mixData[dest];
//mix->destCh from 1 to 32
str = modelPrinter.printMixerName(mix.destCh);
if ((dest == 0) || (model->mixData[dest-1].destCh != md->destCh)) {
if (new_ch) *new_ch = 1;
if ((dest == 0) || (model->mixData[dest-1].destCh != mix.destCh)) {
newChannel = true;
//highlight channel if needed
if (md->destCh == highlightedSource) {
if (mix.destCh == highlightedSource) {
str = "<b>" + str + "</b>";
}
}
@@ -148,153 +146,155 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
str.fill(' ');
}
str += modelPrinter.printMixerLine(md, highlightedSource);
str += modelPrinter.printMixerLine(mix, !newChannel, highlightedSource);
}
if (new_ch) *new_ch = newChannel;
return str.replace(" ", "&nbsp;");
}
bool MixesPanel::gm_insertMix(int idx)
{
if (idx<0 || idx>=firmware->getCapability(Mixes) || model->mixData[firmware->getCapability(Mixes)-1].destCh > 0) {
QMessageBox::information(this, "companion", tr("Not enough available mixers!"));
return false;
}
if (idx < 0 || idx >= firmware->getCapability(Mixes) || model->mixData[firmware->getCapability(Mixes)-1].destCh > 0) {
QMessageBox::information(this, "companion", tr("Not enough available mixers!"));
return false;
}
int i = model->mixData[idx].destCh;
memmove(&model->mixData[idx+1],&model->mixData[idx],
(firmware->getCapability(Mixes)-(idx+1))*sizeof(MixData) );
memset(&model->mixData[idx],0,sizeof(MixData));
model->mixData[idx].srcRaw = RawSource(SOURCE_TYPE_NONE);
model->mixData[idx].destCh = i;
model->mixData[idx].weight = 100;
return true;
int i = model->mixData[idx].destCh;
memmove(&model->mixData[idx+1], &model->mixData[idx],
(firmware->getCapability(Mixes)-(idx+1)) * sizeof(MixData) );
memset(&model->mixData[idx], 0, sizeof(MixData));
model->mixData[idx].srcRaw = RawSource(SOURCE_TYPE_NONE);
model->mixData[idx].destCh = i;
model->mixData[idx].weight = 100;
return true;
}
void MixesPanel::gm_deleteMix(int index)
{
memmove(&model->mixData[index],&model->mixData[index+1],
(firmware->getCapability(Mixes)-(index+1))*sizeof(MixData));
memset(&model->mixData[firmware->getCapability(Mixes)-1],0,sizeof(MixData));
memmove(&model->mixData[index], &model->mixData[index+1],
(firmware->getCapability(Mixes)-(index+1)) * sizeof(MixData));
memset(&model->mixData[firmware->getCapability(Mixes)-1], 0, sizeof(MixData));
}
void MixesPanel::gm_openMix(int index)
{
if(index<0 || index>=firmware->getCapability(Mixes)) return;
if(index < 0 || index>=firmware->getCapability(Mixes)) return;
MixData mixd(model->mixData[index]);
MixData mixd(model->mixData[index]);
emit modified();
update();
MixerDialog *g = new MixerDialog(this, *model, &mixd, generalSettings, firmware);
if(g->exec()) {
model->mixData[index] = mixd;
emit modified();
update();
MixerDialog *g = new MixerDialog(this, *model, &mixd, generalSettings, firmware);
if(g->exec()) {
model->mixData[index] = mixd;
emit modified();
update();
} else {
if (mixInserted) {
gm_deleteMix(index);
}
mixInserted=false;
emit modified();
update();
}
else {
if (mixInserted) {
gm_deleteMix(index);
}
mixInserted = false;
emit modified();
update();
}
}
int MixesPanel::getMixerIndex(unsigned int dch)
{
int i = 0;
while ((model->mixData[i].destCh<=dch) && (model->mixData[i].destCh) && (i<firmware->getCapability(Mixes))) i++;
if(i==firmware->getCapability(Mixes)) return -1;
return i;
int i = 0;
while ((model->mixData[i].destCh <= dch) && (model->mixData[i].destCh) && (i < firmware->getCapability(Mixes))) i++;
if (i == firmware->getCapability(Mixes)) return -1;
return i;
}
void MixesPanel::mixerlistWidget_doubleClicked(QModelIndex index)
{
int idx= MixerlistWidget->item(index.row())->data(Qt::UserRole).toByteArray().at(0);
if (idx<0) {
int i = -idx;
idx = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(idx))
return;
model->mixData[idx].destCh = i;
mixInserted=true;
} else {
mixInserted=false;
}
gm_openMix(idx);
int idx = MixerlistWidget->item(index.row())->data(Qt::UserRole).toByteArray().at(0);
if (idx<0) {
int i = -idx;
idx = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(idx)) return;
model->mixData[idx].destCh = i;
mixInserted = true;
}
else {
mixInserted = false;
}
gm_openMix(idx);
}
void MixesPanel::mixersDeleteList(QList<int> list)
{
qSort(list.begin(), list.end());
qSort(list.begin(), list.end());
int iDec = 0;
foreach(int idx, list) {
gm_deleteMix(idx-iDec);
iDec++;
}
int iDec = 0;
foreach(int idx, list) {
gm_deleteMix(idx - iDec);
iDec++;
}
}
QList<int> MixesPanel::createMixListFromSelected()
{
QList<int> list;
foreach(QListWidgetItem *item, MixerlistWidget->selectedItems()) {
int idx= item->data(Qt::UserRole).toByteArray().at(0);
if(idx>=0 && idx<firmware->getCapability(Mixes)) list << idx;
}
return list;
QList<int> list;
foreach(QListWidgetItem *item, MixerlistWidget->selectedItems()) {
int idx= item->data(Qt::UserRole).toByteArray().at(0);
if(idx >= 0 && idx<firmware->getCapability(Mixes)) list << idx;
}
return list;
}
// TODO duplicated code
void MixesPanel::setSelectedByMixList(QList<int> list)
{
for(int i=0; i<MixerlistWidget->count(); i++) {
int t = MixerlistWidget->item(i)->data(Qt::UserRole).toByteArray().at(0);
if(list.contains(t))
MixerlistWidget->item(i)->setSelected(true);
for(int i=0; i<MixerlistWidget->count(); i++) {
int t = MixerlistWidget->item(i)->data(Qt::UserRole).toByteArray().at(0);
if(list.contains(t)) {
MixerlistWidget->item(i)->setSelected(true);
}
}
}
void MixesPanel::mixersDelete(bool ask)
{
QList<int> list = createMixListFromSelected();
if(list.isEmpty()) return;
QList<int> list = createMixListFromSelected();
if(list.isEmpty()) return;
QMessageBox::StandardButton ret = QMessageBox::No;
QMessageBox::StandardButton ret = QMessageBox::No;
if(ask)
ret = QMessageBox::warning(this, "companion",
tr("Delete Selected Mixes?"),
QMessageBox::Yes | QMessageBox::No);
if(ask) {
ret = QMessageBox::warning(this, "companion",
tr("Delete Selected Mixes?"),
QMessageBox::Yes | QMessageBox::No);
}
if ((ret == QMessageBox::Yes) || (!ask)) {
mixersDeleteList(list);
emit modified();
update();
}
if ((ret == QMessageBox::Yes) || (!ask)) {
mixersDeleteList(list);
emit modified();
update();
}
}
void MixesPanel::mixersCut()
{
mixersCopy();
mixersDelete(false);
mixersCopy();
mixersDelete(false);
}
void MixesPanel::mixersCopy()
{
QList<int> list = createMixListFromSelected();
QList<int> list = createMixListFromSelected();
QByteArray mxData;
foreach(int idx, list) {
mxData.append((char*)&model->mixData[idx], sizeof(MixData));
}
QByteArray mxData;
foreach(int idx, list) {
mxData.append((char*)&model->mixData[idx],sizeof(MixData));
}
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-companion-mix", mxData);
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-companion-mix", mxData);
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
}
void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
@@ -303,10 +303,11 @@ void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
int idx; // mixer index
int dch;
if(destIdx<0) {
if (destIdx < 0) {
dch = -destIdx;
idx = getMixerIndex(dch) - 1; //get mixer index to insert
} else {
}
else {
idx = destIdx;
dch = model->mixData[idx].destCh;
}
@@ -314,14 +315,13 @@ void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
QByteArray mxData = mimeData->data("application/x-companion-mix");
int i = 0;
while(i<mxData.size()) {
while (i < mxData.size()) {
idx++;
if(idx==firmware->getCapability(Mixes)) break;
if (idx == firmware->getCapability(Mixes)) break;
if (!gm_insertMix(idx)) break;
if (!gm_insertMix(idx))
break;
MixData *md = &model->mixData[idx];
memcpy(md,mxData.mid(i,sizeof(MixData)).constData(),sizeof(MixData));
MixData * md = &model->mixData[idx];
memcpy(md, mxData.mid(i, sizeof(MixData)).constData(), sizeof(MixData));
md->destCh = dch;
i += sizeof(MixData);
}
@@ -334,34 +334,35 @@ void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
void MixesPanel::mixersPaste()
{
const QClipboard *clipboard = QApplication::clipboard();
const QMimeData *mimeData = clipboard->mimeData();
QListWidgetItem *item = MixerlistWidget->currentItem();
if (item)
pasteMixerMimeData(mimeData, item->data(Qt::UserRole).toByteArray().at(0));
const QClipboard *clipboard = QApplication::clipboard();
const QMimeData *mimeData = clipboard->mimeData();
QListWidgetItem *item = MixerlistWidget->currentItem();
if (item) {
pasteMixerMimeData(mimeData, item->data(Qt::UserRole).toByteArray().at(0));
}
}
void MixesPanel::mixersDuplicate()
{
mixersCopy();
mixersPaste();
mixersCopy();
mixersPaste();
}
void MixesPanel::mixerOpen()
{
int idx = MixerlistWidget->currentItem()->data(Qt::UserRole).toByteArray().at(0);
if(idx<0) {
int i = -idx;
idx = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(idx))
return;
model->mixData[idx].destCh = i;
mixInserted=true;
} else {
mixInserted=false;
}
int idx = MixerlistWidget->currentItem()->data(Qt::UserRole).toByteArray().at(0);
if(idx < 0) {
int i = -idx;
idx = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(idx)) return;
model->mixData[idx].destCh = i;
mixInserted = true;
}
else {
mixInserted = false;
}
gm_openMix(idx);
gm_openMix(idx);
}
void MixesPanel::mixerHighlight()
@@ -384,135 +385,137 @@ void MixesPanel::mixerHighlight()
void MixesPanel::mixerAdd()
{
if (!MixerlistWidget->currentItem())
return;
int index = MixerlistWidget->currentItem()->data(Qt::UserRole).toByteArray().at(0);
if (!MixerlistWidget->currentItem()) return;
if(index<0) { // if empty then return relavent index
int i = -index;
index = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(index))
return;
model->mixData[index].destCh = i;
mixInserted=true;
} else {
index++;
if (!gm_insertMix(index))
return;
model->mixData[index].destCh = model->mixData[index-1].destCh;
mixInserted=true;
}
gm_openMix(index);
int index = MixerlistWidget->currentItem()->data(Qt::UserRole).toByteArray().at(0);
if(index < 0) { // if empty then return relavent index
int i = -index;
index = getMixerIndex(i); //get mixer index to insert
if (!gm_insertMix(index)) return;
model->mixData[index].destCh = i;
mixInserted = true;
}
else {
index++;
if (!gm_insertMix(index)) return;
model->mixData[index].destCh = model->mixData[index-1].destCh;
mixInserted = true;
}
gm_openMix(index);
}
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
{
QPoint globalPos = MixerlistWidget->mapToGlobal(pos);
QPoint globalPos = MixerlistWidget->mapToGlobal(pos);
const QClipboard *clipboard = QApplication::clipboard();
const QMimeData *mimeData = clipboard->mimeData();
bool hasData = mimeData->hasFormat("application/x-companion-mix");
const QClipboard *clipboard = QApplication::clipboard();
const QMimeData *mimeData = clipboard->mimeData();
bool hasData = mimeData->hasFormat("application/x-companion-mix");
QMenu contextMenu;
contextMenu.addAction(CompanionIcon("add.png"), tr("&Add"),this,SLOT(mixerAdd()),tr("Ctrl+A"));
contextMenu.addAction(CompanionIcon("edit.png"), tr("&Edit"),this,SLOT(mixerOpen()),tr("Enter"));
contextMenu.addAction(CompanionIcon("fuses.png"), tr("&Toggle highlight"),this,SLOT(mixerHighlight()),tr("Ctrl+T"));
contextMenu.addSeparator();
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(mixersDelete()),tr("Delete"));
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"),this,SLOT(mixersCopy()),tr("Ctrl+C"));
contextMenu.addAction(CompanionIcon("cut.png"), tr("C&ut"),this,SLOT(mixersCut()),tr("Ctrl+X"));
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"),this,SLOT(mixersPaste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.addAction(CompanionIcon("duplicate.png"), tr("Du&plicate"),this,SLOT(mixersDuplicate()),tr("Ctrl+U"));
contextMenu.addSeparator();
contextMenu.addAction(CompanionIcon("moveup.png"), tr("Move Up"),this,SLOT(moveMixUp()),tr("Ctrl+Up"));
contextMenu.addAction(CompanionIcon("movedown.png"), tr("Move Down"),this,SLOT(moveMixDown()),tr("Ctrl+Down"));
QMenu contextMenu;
contextMenu.addAction(CompanionIcon("add.png"), tr("&Add"), this, SLOT(mixerAdd()), tr("Ctrl+A"));
contextMenu.addAction(CompanionIcon("edit.png"), tr("&Edit"), this, SLOT(mixerOpen()), tr("Enter"));
contextMenu.addAction(CompanionIcon("fuses.png"), tr("&Toggle highlight"), this, SLOT(mixerHighlight()), tr("Ctrl+T"));
contextMenu.addSeparator();
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"), this, SLOT(mixersDelete()), tr("Delete"));
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"), this, SLOT(mixersCopy()), tr("Ctrl+C"));
contextMenu.addAction(CompanionIcon("cut.png"), tr("C&ut"), this, SLOT(mixersCut()), tr("Ctrl+X"));
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"), this, SLOT(mixersPaste()), tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.addAction(CompanionIcon("duplicate.png"), tr("Du&plicate"), this, SLOT(mixersDuplicate()), tr("Ctrl+U"));
contextMenu.addSeparator();
contextMenu.addAction(CompanionIcon("moveup.png"), tr("Move Up"), this, SLOT(moveMixUp()), tr("Ctrl+Up"));
contextMenu.addAction(CompanionIcon("movedown.png"), tr("Move Down"), this, SLOT(moveMixDown()), tr("Ctrl+Down"));
contextMenu.exec(globalPos);
contextMenu.exec(globalPos);
}
void MixesPanel::mimeMixerDropped(int index, const QMimeData *data, Qt::DropAction /*action*/)
{
int idx= MixerlistWidget->item(index > 0 ? index-1 : 0)->data(Qt::UserRole).toByteArray().at(0);
//qDebug() << "MixesPanel::mimeMixerDropped()" << index << data;
pasteMixerMimeData(data, idx);
int idx= MixerlistWidget->item(index > 0 ? index-1 : 0)->data(Qt::UserRole).toByteArray().at(0);
//qDebug() << "MixesPanel::mimeMixerDropped()" << index << data;
pasteMixerMimeData(data, idx);
}
void MixesPanel::mixesEdited()
{
emit modified();
emit modified();
}
void MixesPanel::mixerlistWidget_KeyPress(QKeyEvent *event)
{
if(event->matches(QKeySequence::SelectAll)) mixerAdd(); //Ctrl A
if(event->matches(QKeySequence::Delete)) mixersDelete();
if(event->matches(QKeySequence::Copy)) mixersCopy();
if(event->matches(QKeySequence::Cut)) mixersCut();
if(event->matches(QKeySequence::Paste)) mixersPaste();
if(event->matches(QKeySequence::Underline)) mixersDuplicate();
if(event->matches(QKeySequence::AddTab)) mixerHighlight();
if(event->matches(QKeySequence::SelectAll)) mixerAdd(); //Ctrl A
if(event->matches(QKeySequence::Delete)) mixersDelete();
if(event->matches(QKeySequence::Copy)) mixersCopy();
if(event->matches(QKeySequence::Cut)) mixersCut();
if(event->matches(QKeySequence::Paste)) mixersPaste();
if(event->matches(QKeySequence::Underline)) mixersDuplicate();
if(event->matches(QKeySequence::AddTab)) mixerHighlight();
if(event->key()==Qt::Key_Return || event->key()==Qt::Key_Enter) mixerOpen();
if(event->matches(QKeySequence::MoveToNextLine))
MixerlistWidget->setCurrentRow(MixerlistWidget->currentRow()+1);
if(event->matches(QKeySequence::MoveToPreviousLine))
MixerlistWidget->setCurrentRow(MixerlistWidget->currentRow()-1);
if(event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) mixerOpen();
if(event->matches(QKeySequence::MoveToNextLine)) {
MixerlistWidget->setCurrentRow(MixerlistWidget->currentRow()+1);
}
if(event->matches(QKeySequence::MoveToPreviousLine)) {
MixerlistWidget->setCurrentRow(MixerlistWidget->currentRow()-1);
}
}
int MixesPanel::gm_moveMix(int idx, bool dir) //true=inc=down false=dec=up
{
if(idx>firmware->getCapability(Mixes) || (idx==firmware->getCapability(Mixes) && dir)) return idx;
if(idx > firmware->getCapability(Mixes) || (idx == firmware->getCapability(Mixes) && dir)) return idx;
MixData &src=model->mixData[idx];
MixData &src=model->mixData[idx];
if (idx==0 && !dir) {
//special case: topmost mixer moving up
if (src.destCh > 1) src.destCh--;
return idx;
}
if (idx == 0 && !dir) {
//special case: topmost mixer moving up
if (src.destCh > 1) src.destCh--;
return idx;
}
int tdx = dir ? idx+1 : idx-1;
MixData &tgt=model->mixData[tdx];
int tdx = dir ? idx+1 : idx-1;
MixData & tgt = model->mixData[tdx];
unsigned int outputs = firmware->getCapability(Outputs);
if((src.destCh==0) || (src.destCh>outputs) || (tgt.destCh>outputs)) return idx;
unsigned int outputs = firmware->getCapability(Outputs);
if(src.destCh == 0 || src.destCh > outputs || tgt.destCh > outputs) return idx;
if (tgt.destCh!=src.destCh) {
if ((dir) && (src.destCh<outputs)) src.destCh++;
if ((!dir) && (src.destCh>0)) src.destCh--;
return idx;
}
if (tgt.destCh != src.destCh) {
if (dir && src.destCh < outputs) src.destCh++;
if (!dir && src.destCh > 0) src.destCh--;
return idx;
}
//flip between idx and tgt
MixData temp;
memcpy(&temp,&src,sizeof(MixData));
memcpy(&src,&tgt,sizeof(MixData));
memcpy(&tgt,&temp,sizeof(MixData));
return tdx;
//flip between idx and tgt
MixData temp;
memcpy(&temp, &src, sizeof(MixData));
memcpy(&src, &tgt, sizeof(MixData));
memcpy(&tgt, &temp, sizeof(MixData));
return tdx;
}
void MixesPanel::moveMixUp()
{
QList<int> list = createMixListFromSelected();
QList<int> highlightList;
foreach(int idx, list) {
highlightList << gm_moveMix(idx, false);
}
emit modified();
update();
setSelectedByMixList(highlightList);
QList<int> list = createMixListFromSelected();
QList<int> highlightList;
foreach(int idx, list) {
highlightList << gm_moveMix(idx, false);
}
emit modified();
update();
setSelectedByMixList(highlightList);
}
void MixesPanel::moveMixDown()
{
QList<int> list = createMixListFromSelected();
QList<int> highlightList;
foreach(int idx, list) {
highlightList << gm_moveMix(idx, true);
}
emit modified();
update();
setSelectedByMixList(highlightList);
QList<int> list = createMixListFromSelected();
QList<int> highlightList;
foreach(int idx, list) {
highlightList << gm_moveMix(idx, true);
}
emit modified();
update();
setSelectedByMixList(highlightList);
}
void MixesPanel::clearMixes()
+10
View File
@@ -23,6 +23,9 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
generalSettings(radioData.generalSettings),
firmware(firmware)
{
Stopwatch s1("ModelEdit");
gStopwatch.report("ModelEdit start constructor");
ui->setupUi(this);
setWindowIcon(CompanionIcon("edit.png"));
restoreGeometry(g.modelEditGeo());
@@ -33,16 +36,23 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli"));
addTab(new FlightModesPanel(this, model, generalSettings, firmware), tr("Flight Modes"));
addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs"));
s1.report("inputs");
addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes"));
s1.report("Mixes");
Channels * chnPanel = new Channels(this, model, generalSettings, firmware);
addTab(chnPanel, tr("Outputs"));
s1.report("Outputs");
addTab(new Curves(this, model, generalSettings, firmware), tr("Curves"));
addTab(new LogicalSwitchesPanel(this, model, generalSettings, firmware), tr("Logical Switches"));
s1.report("LS");
addTab(new CustomFunctionsPanel(this, &model, generalSettings, firmware), tr("Special Functions"));
s1.report("CF");
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY)
addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
s1.report("end");
gStopwatch.report("ModelEdit end constructor");
}
ModelEdit::~ModelEdit()
+81 -43
View File
@@ -4,8 +4,9 @@
#include "ui_setup_module.h"
#include "helpers.h"
#include "appdata.h"
#include "modelprinter.h"
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget *prevFocus):
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget * prevFocus):
ModelPanel(parent, model, generalSettings, firmware),
timer(timer),
ui(new Ui::Timer)
@@ -35,10 +36,11 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
}
ui->countdownBeep->setField(timer.countdownBeep, this);
ui->countdownBeep->addItem(tr("Silent"), 0);
ui->countdownBeep->addItem(tr("Beeps"), 1);
ui->countdownBeep->addItem(tr("Silent"), TimerData::COUNTDOWN_SILENT);
ui->countdownBeep->addItem(tr("Beeps"), TimerData::COUNTDOWN_BEEPS);
if (IS_ARM(board) || IS_2560(board)) {
ui->countdownBeep->addItem(tr("Voice"), 2);
ui->countdownBeep->addItem(tr("Voice"), TimerData::COUNTDOWN_VOICE);
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
}
ui->persistent->setField(timer.persistent, this);
@@ -135,6 +137,9 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
QString label;
if (moduleIdx < 0) {
label = tr("Trainer Port");
if (generalSettings.hw_uartMode != UART_MODE_SBUS_TRAINER) {
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, 0, Qt::UserRole - 1);
}
ui->trainerMode->setCurrentIndex(model.trainerMode);
if (!IS_TARANIS(firmware->getBoard())) {
ui->label_trainerMode->hide();
@@ -165,9 +170,9 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
ui->label_module->setText(label);
// The protocols available on this board
for (int i=0; i<PROTO_LAST; i++) {
if (GetEepromInterface()->isAvailable((Protocol)i, moduleIdx)) {
ui->protocol->addItem(getProtocolStr(i), (QVariant)i);
for (int i=0; i<PULSES_PROTOCOL_LAST; i++) {
if (firmware->isAvailable((PulsesProtocol)i, moduleIdx)) {
ui->protocol->addItem(ModelPrinter::printModuleProtocol(i), (QVariant)i);
if (i == module.protocol) ui->protocol->setCurrentIndex(ui->protocol->count()-1);
}
}
@@ -188,12 +193,12 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
spinbox->setDecimals(1);
label->setProperty("index", i);
spinbox->setProperty("index", i);
failsafeSpins << spinbox;
ui->failsafesLayout->addWidget(label, 3*(i/8), i%8, Qt::AlignHCenter);
ui->failsafesLayout->addWidget(combo, 1+3*(i/8), i%8, Qt::AlignHCenter);
ui->failsafesLayout->addWidget(spinbox, 2+3*(i/8), i%8, Qt::AlignHCenter);
failsafeGroups[i].combo = combo;
failsafeGroups[i].spinbox = spinbox;
failsafeGroups[i].label = label;
updateFailsafe(i);
connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(onFailsafeComboIndexChanged(int)));
connect(spinbox, SIGNAL(valueChanged(double)), this, SLOT(onFailsafeSpinChanged(double)));
@@ -221,50 +226,48 @@ ModulePanel::~ModulePanel()
void ModulePanel::update()
{
unsigned int mask = 0;
Protocol protocol = (Protocol)module.protocol;
PulsesProtocol protocol = (PulsesProtocol)module.protocol;
unsigned int max_rx_num = 63;
if (moduleIdx >= 0) {
mask |= MASK_PROTOCOL;
switch (protocol) {
case PXX_XJT_X16:
case PXX_XJT_D8:
case PXX_XJT_LR12:
case PXX_DJT:
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_DJT:
mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
if ((protocol==PXX_XJT_X16) || (protocol==PXX_XJT_LR12)) mask |= MASK_FAILSAFES | MASK_RX_NUMBER;
if (protocol==PULSES_PXX_XJT_X16) mask |= MASK_FAILSAFES | MASK_RX_NUMBER;
if (protocol==PULSES_PXX_XJT_LR12) mask |= MASK_RX_NUMBER;
break;
case LP45:
case DSM2:
case DSMX:
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
module.channelsCount = 6;
max_rx_num = 20;
break;
case PPM:
case PULSES_CROSSFIRE:
mask |= MASK_CHANNELS_RANGE;
module.channelsCount = 16;
break;
case PULSES_PPM:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
if (IS_9XRPRO(firmware->getBoard())) {
mask |= MASK_OPEN_DRAIN;
}
break;
case OFF:
case PULSES_OFF:
default:
break;
}
}
else if (IS_TARANIS(firmware->getBoard())) {
switch(model->trainerMode) {
case MASTER_JACK:
break;
case SLAVE_JACK:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
break;
default:
mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
break;
if (model->trainerMode == TRAINER_SLAVE_JACK) {
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
}
}
else if (model->trainerMode != MASTER_JACK) {
else if (model->trainerMode != TRAINER_MASTER_JACK) {
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
}
@@ -304,6 +307,17 @@ void ModulePanel::update()
ui->failsafeMode->setVisible(mask & MASK_FAILSAFES);
ui->failsafeMode->setCurrentIndex(module.failsafeMode);
ui->failsafesFrame->setEnabled(module.failsafeMode == FAILSAFE_CUSTOM);
if (firmware->getCapability(ChannelsName) > 0) {
for(int i=0; i<maxChannels;i++) {
QString name = QString(model->limitData[i+module.channelsStart].name).trimmed();
if (!name.isEmpty()) {
failsafeGroups[i].label->setText(name);
}
else {
failsafeGroups[i].label->setText(QString::number(i+1));
}
}
}
}
else {
mask = 0;
@@ -311,6 +325,11 @@ void ModulePanel::update()
ui->failsafesLayoutLabel->setVisible(mask & MASK_FAILSAFES);
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
if (mask & MASK_CHANNELS_RANGE) {
ui->channelsStart->setMaximum(32 - ui->channelsCount->value());
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value()));
}
}
void ModulePanel::on_trainerMode_currentIndexChanged(int index)
@@ -514,6 +533,19 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
}
}
if (firmware->getCapability(HasTopLcd)) {
ui->toplcdTimer->setField(model.toplcdTimer, this);
for (int i=0; i<C9X_MAX_TIMERS; i++) {
if (i<firmware->getCapability(Timers)) {
ui->toplcdTimer->addItem(tr("Timer %1").arg(i+1), i);
}
}
}
else {
ui->toplcdTimerLabel->hide();
ui->toplcdTimer->hide();
}
if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide();
}
@@ -641,6 +673,7 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
connect(modules[C9X_NUM_MODULES], SIGNAL(modified()), this, SLOT(onChildModified()));
}
disableMouseScrolling();
@@ -687,7 +720,7 @@ void SetupPanel::on_trimIncrement_currentIndexChanged(int index)
void SetupPanel::on_throttleSource_currentIndexChanged(int index)
{
if (!lock) {
model->thrTraceSrc = ui->throttleSource->itemData(index).toInt();
model->thrTraceSrc = index;
emit modified();
}
}
@@ -733,34 +766,39 @@ void SetupPanel::on_image_currentIndexChanged(int index)
void SetupPanel::populateThrottleSourceCB()
{
const QString sources9x[] = { QObject::tr("THR"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
const QString sourcesTaranis[] = { QObject::tr("THR"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
const QString pots9x[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
const QString potsTaranis[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
const QString potsTaranisX9E[] = { QObject::tr("F1"), QObject::tr("F2"), QObject::tr("F3"), QObject::tr("F4"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS")};
unsigned int i;
lock = true;
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (i=0; i<6; i++) {
ui->throttleSource->addItem(sourcesTaranis[i], i);
ui->throttleSource->addItem(QObject::tr("THR"));
if (IS_TARANIS_X9E(GetEepromInterface()->getBoard())) {
for (i=0; i<8; i++) {
ui->throttleSource->addItem(potsTaranisX9E[i], i);
}
}
else if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (i=0; i<5; i++) {
ui->throttleSource->addItem(potsTaranis[i], i);
}
}
else {
for (i=0; i<4; i++) {
ui->throttleSource->addItem(sources9x[i], i);
for (i=0; i<3; i++) {
ui->throttleSource->addItem(pots9x[i], i);
}
}
if (model->thrTraceSrc < i)
ui->throttleSource->setCurrentIndex(model->thrTraceSrc);
int channels = (IS_ARM(GetEepromInterface()->getBoard()) ? 32 : 16);
for (int i=0; i<channels; i++) {
ui->throttleSource->addItem(QObject::tr("CH%1").arg(i+1, 2, 10, QChar('0')), THROTTLE_SOURCE_FIRST_CHANNEL+i);
if (model->thrTraceSrc == unsigned(THROTTLE_SOURCE_FIRST_CHANNEL+i))
ui->throttleSource->setCurrentIndex(ui->throttleSource->count()-1);
ui->throttleSource->addItem(ModelPrinter::printChannelName(i));
}
ui->throttleSource->setCurrentIndex(model->thrTraceSrc);
lock = false;
}
+1 -1
View File
@@ -45,6 +45,7 @@ class ModulePanel : public ModelPanel
struct ChannelFailsafeWidgetsGroup {
QComboBox * combo;
QDoubleSpinBox * spinbox;
QLabel * label;
};
Q_OBJECT
@@ -75,7 +76,6 @@ class ModulePanel : public ModelPanel
ModuleData & module;
int moduleIdx;
Ui::Module *ui;
QVector<QDoubleSpinBox *> failsafeSpins;
ChannelFailsafeWidgetsGroup failsafeGroups[maxChannels];
};
+318 -292
View File
@@ -16,22 +16,6 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label_timer3">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Timer 3</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_timer1">
<property name="font">
@@ -48,8 +32,8 @@
</property>
</widget>
</item>
<item row="2" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
<widget class="QLabel" name="label_timer2">
<item row="4" column="0">
<widget class="QLabel" name="toplcdTimerLabel">
<property name="font">
<font>
<weight>50</weight>
@@ -57,14 +41,307 @@
</font>
</property>
<property name="text">
<string>Timer 2</string>
<string>Top LCD Timer</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxLength">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="modelImage_label">
<property name="text">
<string>Model Image</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="imagePreview">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>32</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="image"/>
</item>
<item>
<spacer name="horizontalSpacer_26">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
<widget class="QLabel" name="swwarn_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Warnings</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Switch Warnings</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="switchesStartupLayout" rowstretch="0" columnstretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="label_potWarning">
<property name="text">
<string>Pot Warnings</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="potWarningLayout">
<item row="0" column="0" alignment="Qt::AlignTop">
<widget class="QComboBox" name="potWarningMode">
<item>
<property name="text">
<string>OFF</string>
</property>
</item>
<item>
<property name="text">
<string>Manual</string>
</property>
</item>
<item>
<property name="text">
<string>Auto</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Model</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QGridLayout" name="centerBeepLayout"/>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="9" column="0" colspan="2">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Center beep</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="1">
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QCheckBox" name="extendedTrims">
@@ -224,7 +501,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</item>
</layout>
</item>
<item row="5" column="0">
<item row="6" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item alignment="Qt::AlignRight">
<widget class="QLabel" name="label_ttrace">
@@ -276,42 +553,15 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</item>
</layout>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QGridLayout" name="centerBeepLayout"/>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="8" column="0" colspan="2">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_12">
<item row="2" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
<widget class="QLabel" name="label_timer2">
<property name="font">
<font>
<weight>50</weight>
@@ -319,261 +569,37 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</font>
</property>
<property name="text">
<string>Center beep</string>
<string>Timer 2</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="3" column="0">
<widget class="QLabel" name="label_timer3_2">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Timer 3</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxLength">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="modelImage_label">
<property name="text">
<string>Model Image</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="imagePreview">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>32</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="image"/>
</item>
<item>
<spacer name="horizontalSpacer_26">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
<widget class="QLabel" name="swwarn_label">
<item row="4" column="1">
<widget class="AutoComboBox" name="toplcdTimer">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Warnings</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Switch Warnings</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="switchesStartupLayout" rowstretch="0" columnstretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="label_potWarning">
<property name="text">
<string>Pot Warnings</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="potWarningLayout">
<item row="0" column="0" alignment="Qt::AlignTop">
<widget class="QComboBox" name="potWarningMode">
<item>
<property name="text">
<string>OFF</string>
</property>
</item>
<item>
<property name="text">
<string>Manual</string>
</property>
</item>
<item>
<property name="text">
<string>Auto</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Model</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
+4 -4
View File
@@ -67,12 +67,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_69" rowstretch="0,0,0,0,0,0,0,0,0" columnstretch="0,0,0,0,0,0,0">
<property name="verticalSpacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="2" column="3" alignment="Qt::AlignLeft">
<widget class="QSpinBox" name="channelsStart">
<property name="maximumSize">
@@ -353,7 +353,7 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>4</number>
</property>
<property name="maximum">
<number>16</number>
+37 -28
View File
@@ -29,20 +29,10 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, Mod
update();
ui->UnitCB->setCurrentIndex(analog.type);
if (!IS_TARANIS(firmware->getBoard())) {
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
ui->alarm2GreaterCB->setCurrentIndex(analog.alarms[1].greater);
}
else {
ui->alarm1LevelCB->hide();
ui->alarm2LevelCB->hide();
ui->alarm1GreaterCB->hide();
ui->alarm2GreaterCB->hide();
ui->alarm1Label->setText(tr("Low Alarm"));
ui->alarm2Label->setText(tr("Critical Alarm"));
}
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
ui->alarm2GreaterCB->setCurrentIndex(analog.alarms[1].greater);
if (!(firmware->getCapability(Telemetry) & TM_HASOFFSET)) {
ui->CalibSB->hide();
@@ -543,6 +533,7 @@ void TelemetrySensorPanel::update()
bool cellsFieldsDisplayed = false;
bool consFieldsDisplayed = false;
bool ratioFieldsDisplayed = false;
bool totalizeFieldsDisplayed = false;
bool sources12FieldsDisplayed = false;
bool sources34FieldsDisplayed = false;
@@ -566,6 +557,7 @@ void TelemetrySensorPanel::update()
consFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION);
sources12FieldsDisplayed = (sensor.formula <= SensorData::TELEM_FORMULA_MULTIPLY);
sources34FieldsDisplayed = (sensor.formula < SensorData::TELEM_FORMULA_MULTIPLY);
totalizeFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE);
updateSourcesComboBox(ui->source1, true);
updateSourcesComboBox(ui->source2, true);
updateSourcesComboBox(ui->source3, true);
@@ -588,14 +580,18 @@ void TelemetrySensorPanel::update()
if (sensor.unit == SensorData::UNIT_RPMS) {
ui->offset->setDecimals(0);
ui->offset->setSingleStep(1);
ui->ratio->setDecimals(0);
ui->ratio->setSingleStep(1);
ui->autoOffset->hide();
ui->ratio->setMinimum(1);
ui->offset->setMinimum(1);
}
else {
ui->offset->setDecimals(sensor.prec);
ui->offset->setSingleStep(pow(0.1, (int)sensor.prec));
ui->ratio->setDecimals(1);
ui->ratio->setSingleStep(0.1);
}
}
@@ -605,15 +601,15 @@ void TelemetrySensorPanel::update()
ui->offsetLabel->setVisible(ratioFieldsDisplayed && sensor.unit != SensorData::UNIT_RPMS);
ui->multiplierLabel->setVisible(sensor.unit == SensorData::UNIT_RPMS);
ui->offset->setVisible(ratioFieldsDisplayed);
ui->precLabel->setVisible(isConfigurable);
ui->precLabel->setVisible(isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT);
ui->prec->setVisible(isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT);
ui->unit->setVisible((sensor.type == SensorData::TELEM_TYPE_CALCULATED && (sensor.formula == SensorData::TELEM_FORMULA_DIST)) || isConfigurable);
ui->gpsSensorLabel->setVisible(gpsFieldsDisplayed);
ui->gpsSensor->setVisible(gpsFieldsDisplayed);
ui->altSensorLabel->setVisible(gpsFieldsDisplayed);
ui->altSensor->setVisible(gpsFieldsDisplayed);
ui->ampsSensorLabel->setVisible(consFieldsDisplayed);
ui->ampsSensor->setVisible(consFieldsDisplayed);
ui->ampsSensorLabel->setVisible(consFieldsDisplayed || totalizeFieldsDisplayed);
ui->ampsSensor->setVisible(consFieldsDisplayed || totalizeFieldsDisplayed);
ui->cellsSensorLabel->setVisible(cellsFieldsDisplayed);
ui->cellsSensor->setVisible(cellsFieldsDisplayed);
ui->cellsIndex->setVisible(cellsFieldsDisplayed);
@@ -653,7 +649,7 @@ void TelemetrySensorPanel::on_name_editingFinished()
{
if (!lock) {
strcpy(sensor.label, ui->name->text().toAscii());
emit nameModified();
emit dataModified();
emit modified();
}
}
@@ -675,7 +671,15 @@ void TelemetrySensorPanel::on_formula_currentIndexChanged(int index)
sensor.prec = 2;
sensor.unit = SensorData::UNIT_VOLTS;
}
update();
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION) {
sensor.prec = 0;
sensor.unit = SensorData::UNIT_MAH;
}
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST) {
sensor.prec = 0;
sensor.unit = SensorData::UNIT_METERS;
}
emit dataModified();
emit modified();
}
}
@@ -684,6 +688,9 @@ void TelemetrySensorPanel::on_unit_currentIndexChanged(int index)
{
if (!lock) {
sensor.unit = index;
if (sensor.unit == SensorData::UNIT_FAHRENHEIT) {
sensor.prec = 0;
}
update();
emit modified();
}
@@ -693,7 +700,7 @@ void TelemetrySensorPanel::on_prec_valueChanged()
{
if (!lock) {
sensor.prec = ui->prec->value();
update();
emit dataModified();
emit modified();
}
}
@@ -717,7 +724,8 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
TelemetrySensorPanel * panel = new TelemetrySensorPanel(this, model.sensorData[i], model, generalSettings, firmware);
ui->sensorsLayout->addWidget(panel);
sensorPanels[i] = panel;
connect(panel, SIGNAL(nameModified()), this, SLOT(update()));
connect(panel, SIGNAL(dataModified()), this, SLOT(update()));
connect(panel, SIGNAL(modified()), this, SLOT(onModified()));
}
}
else {
@@ -727,14 +735,14 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1], model, generalSettings, firmware);
ui->A2Layout->addWidget(analogs[1]);
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
connect(analogs[1], SIGNAL(modified()), this, SLOT(onModified()));
}
if (IS_TARANIS(firmware->getBoard())) {
ui->voltsSource->setField(model.frsky.voltsSource);
ui->altitudeSource->setField(model.frsky.altitudeSource);
ui->varioSource->setField(model.frsky.varioSource);
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent);
ui->voltsSource->setField(model.frsky.voltsSource, this);
ui->altitudeSource->setField(model.frsky.altitudeSource, this);
ui->varioSource->setField(model.frsky.varioSource, this);
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent, this);
}
else {
ui->topbarGB->hide();
@@ -744,6 +752,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i], generalSettings, firmware);
ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
telemetryCustomScreens[i] = tab;
connect(tab, SIGNAL(modified()), this, SLOT(onModified()));
}
disableMouseScrolling();
@@ -759,7 +768,7 @@ TelemetryPanel::~TelemetryPanel()
void TelemetryPanel::update()
{
if (IS_TARANIS(firmware->getBoard())) {
if (model->moduleData[0].protocol == OFF && model->moduleData[1].protocol == PPM) {
if (model->moduleData[0].protocol == PULSES_OFF && model->moduleData[1].protocol == PULSES_PPM) {
ui->telemetryProtocol->setEnabled(true);
}
else {
@@ -945,7 +954,7 @@ void TelemetryPanel::on_telemetryProtocol_currentIndexChanged(int index)
}
}
void TelemetryPanel::onAnalogModified()
void TelemetryPanel::onModified()
{
emit modified();
}
+2 -2
View File
@@ -89,7 +89,7 @@ class TelemetrySensorPanel: public ModelPanel
void update();
signals:
void nameModified();
void dataModified();
protected slots:
void on_name_editingFinished();
@@ -118,7 +118,7 @@ class TelemetryPanel : public ModelPanel
private slots:
void on_telemetryProtocol_currentIndexChanged(int index);
void onAnalogModified();
void onModified();
void on_frskyProtoCB_currentIndexChanged(int index);
void on_bladesCount_editingFinished();
void on_rssiAlarm1CB_currentIndexChanged(int index);

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