Compare commits

...

3377 Commits

Author SHA1 Message Date
janek f54870f051 Revert sync at 1000Hz, it is too CPU taxing: #474 2025-05-04 12:09:31 +02:00
janek 329650ad77 cleanup, naming 2025-04-19 18:35:24 +02:00
janek b6a7584509 cleanup 2025-04-19 10:40:02 +02:00
janek 96c3350bbb i2c can have lower GPIO speed 2025-04-13 18:36:41 +02:00
janek 790e049572 Larger USB serial debug output buffer for DEBUG builds 2025-04-10 21:55:57 +02:00
janek 94ab2711d6 Reduce TELEMETRY_OUTPUT_BUFFER_SIZE until needed 2025-04-10 21:51:24 +02:00
janek 43034b5005 Fix and simplify version condition 2025-04-10 21:50:03 +02:00
janek 17aca630ed fixed ext module power circuit image @marco-garcia 2025-04-07 14:40:35 +02:00
janek d22d831a99 move CRS clock init 2025-04-05 17:57:31 +02:00
janek 6cff24d37a updated ext module power circuit image by @marco-garcia 2025-03-27 10:12:43 +01:00
janek 4b8935b039 repo cleanup 2025-03-16 08:38:35 +01:00
Janek e8b26e0613 Update README.md, added license badge 2025-03-16 08:31:54 +01:00
Janek 78501ead38 Update README.md, add gitpod badge 2025-03-16 08:27:57 +01:00
Wilhelm d019ce803b Add gitpod/docker configuration to repo (#469)
* added gitpod/docker
2025-03-16 08:23:58 +01:00
janek 713e06bf6c cleanup, proper name 2025-03-14 22:43:58 +01:00
janek 318141863a Treat 2POS switches as 2 pos (backport) 2025-03-14 21:18:09 +01:00
janek eba65dc5d9 some definitions fixes 2025-03-14 21:15:27 +01:00
janek cee82b9e8b Added ext module power circuit image by @marco-garcia 2025-03-13 18:56:43 +01:00
janek 4a236a2903 version bump 2025-03-09 09:26:12 +01:00
Janek de5ff97919 Update README.md
Increased number of models from 16 to 20.
2025-02-20 22:42:44 +01:00
Janek 187d886648 Increased max models to 20, (#466)
Increased max models to 20,
removed free size counter,
removed legacy eeprom type check
2025-02-20 22:42:00 +01:00
Janek 51ea45dfac Save RAM: Allocate eeFs only for MAX_MODELS (#462)
* allocate eeFs only for MAX_MODELS,
* keep old EEProm alignment
2025-02-18 18:46:51 +01:00
Janek e7edba29f3 Update README.md 2025-02-17 20:40:20 +01:00
janek 31cc42e46a cleanup 2025-02-13 11:37:38 +01:00
janek 713f689996 cleanup 2025-02-02 11:26:31 +01:00
janek 0a893a91c7 added Copy/Paste support to SF and LS. 2025-02-02 10:16:07 +01:00
Janek 51291f0bf1 Fixed issue where returning from popup was blocking UP/DOWN navigation, (#460)
* fixed issue where returning from popup was blocking UP/DOWN navigation,
* added shortcut to go directly to edit mode for empty LS,
* removed POT navigation code,
* more cleanup
2025-02-02 10:11:17 +01:00
janek 95b69c2a0e updated hardware infographics image 2025-01-25 16:12:52 +01:00
janek 41b0e6c17c updated hardware infographics image 2025-01-24 10:45:43 +01:00
janek 0d2f54c2d6 move battery range settings to Radio Hardware tab (EdgeTX/edgetx#5803) 2025-01-23 21:03:36 +01:00
Janek f48d357492 Update channel monitor to reduce size (#454)
* Update channel monitor to reduce size
2025-01-23 17:31:38 +01:00
janek 367700ab81 Removed PPM_UNIT from remaining places 2025-01-23 12:15:46 +01:00
janek 4706422da2 Removed PPM_UNIT from remaining places 2025-01-23 12:12:28 +01:00
Janek 235cf4f7ad Convert PPM_UNIT build option to runtime radio setting (edgetx/edgetx#3993) (#457)
* Convert PPM_UNIT build option to runtime radio setting (edgetx/edgetx#3993)
* DRY to save some space
2025-01-23 11:56:25 +01:00
janek d51977eb68 simplify dfplayer volume setup 2025-01-22 15:16:41 +01:00
janek c9534df0ba Adjust radio setup to match EdgeTX options alignment,
added new gui function overloads
2025-01-22 15:16:41 +01:00
janek b7040cebbe enable 3.75M and 5.25M baudrates 2025-01-22 14:24:04 +01:00
janek f0fcd8ef09 Change "Save all" to "Save settings",
cleanup
2025-01-21 19:47:12 +01:00
janek 8baf62a3f7 version bump to 2.0.0 2025-01-20 22:17:19 +01:00
janek 4a9e891b25 ELRS: increase buffer to support more complex/dual-band devices 2025-01-20 22:15:52 +01:00
janek a919688895 updated trainer PPM timer disabling capture interrupt flag order to match PPM out,
removed comment
2025-01-20 12:37:15 +01:00
janek 5466309bff disable not used condition 2025-01-20 12:37:15 +01:00
janek cf0921b49f merge pulses_arm.h and pulses.h 2025-01-20 12:37:15 +01:00
janek fd7039dd11 cleanup EXTMODULE_TIMER_IRQHandler 2025-01-20 12:37:15 +01:00
janek 3ad862b97c enable PPM timer for in/out mode and disable accordingly, 2025-01-20 12:37:15 +01:00
janek 0ec4be28ef enable PPM timer for in/out mode and disable accordingly, 2025-01-20 12:37:15 +01:00
janek e99e8b4d13 fixed issue with calling afhds2a SPI before setup (blank screen issue),
fixed watchdog issue where isModuleSynchronous was defined wrong,
remove DisablePPMOut,
2025-01-20 12:37:15 +01:00
janek 8e9dd6066e update afhds2a, internal and external module logic,
removed old functions,
removed ahfds2aEnabled flag,
removed pulses_driver.cpp
2025-01-20 12:37:15 +01:00
janek 32418dbe8f remove disable_afhds2a in favor of direct intmoduleStop use 2025-01-20 12:37:15 +01:00
janek b98022f066 Initial pulses refactor commit 2025-01-20 12:37:15 +01:00
janek b7f07b8ba2 Popups fix 2025-01-15 18:34:26 +01:00
janek 77a032effa Merge remote-tracking branch 'origin/master' 2025-01-14 19:26:54 +01:00
Janek efa63ec80d Fix for ELRS 4 arming mode (#453)
* remove not used fixUpModel
* DE arming translation fix
* Fix for ELRS4 arming mode.
Closes #451
2025-01-14 13:55:00 +01:00
janek d02ddfd2c1 DE translation fix 2025-01-03 14:44:15 +01:00
janek 8ffacf0437 remove not used fixUpModel 2025-01-03 14:44:05 +01:00
janek 7bff6c5c10 Simplify ELRS version check 2024-12-28 10:41:42 +01:00
janek 524532e84b elrs update for parameter definitions over 255 bytes 2024-12-24 00:18:56 +01:00
Janek 09d4500482 Popups followup (#450)
* Popups refactoring follow up
2024-12-23 19:47:23 +01:00
janek 0a597df51b buzzer allow higher freq, cleanup 2024-12-23 19:44:53 +01:00
janek 34954190b6 elrs fix for text selection over 255 characters 2024-12-23 19:41:48 +01:00
janek 15b50b0de3 Enable USB_SERIAL for all translations 2024-12-19 18:31:43 +01:00
Janek 3a633cec7f Popups refactor (#449)
* Popups refactor
* Add title to USB modes popup
* cleanup
2024-12-19 18:25:00 +01:00
janek bb3c68b1b4 buzzer, remove not needed ARR register value limit 2024-12-19 11:37:49 +01:00
Janek 41791f34e2 buzzer driver improvements, fix vario, cleanup (#448) 2024-12-19 11:19:39 +01:00
Janek a6430ddb24 Update config.yml
Update docker image to latest to use gcc 14.2
2024-12-17 10:24:14 +01:00
janek 9cacfb0df2 cleanup 2024-12-16 22:15:14 +01:00
Janek 91e8418631 int module init, file renames (#447)
* use proper internal module timer alias from hal.h,
* rename *_arm to generic file names,
* added APB2 SYSCFG define to hal.h, removed from intmoduleAfhds2aStart,
* cleanup of dead code
2024-12-16 20:22:49 +01:00
Janek 3eab877f54 AFHDS2A Fixes (#445)
* fixed custom failsafe channels setup missing for channels > 8,
* fixed checkModelIdUnique on invalid menu line,
* default model internal module off,
* refactored findNextUnusedModelId (opentx#7259)
* remove undocumented long press OK to auto assign next free model ID, reeanable unique ID warn
2024-12-12 13:20:02 +01:00
Janek bec94560d7 Remove not used translations from firmware (#443)
* removed not used translations
* remove DATETIME translation
* exclude VKEYS for non MENU_DIAG_ANAS_KEYS builds
* exclude SLIDERTYPES when NUM_SLIDERS == 0
2024-12-12 13:08:26 +01:00
janek c861ac899e exclude External Module bind 2024-12-11 17:28:55 +01:00
janek 97d9f1c19d enable SBUS_TRAINER back for official builds 2024-12-11 13:22:31 +01:00
janek 70a24b992d rename stream to channel 2024-12-11 12:53:14 +01:00
Janek b6b24dcf94 Update telemetry.cpp
cleanup
2024-12-11 00:50:36 +01:00
janek 14888fdc3a simplify 2024-12-10 21:07:27 +01:00
janek 7f2a5cafd3 Disable IDLE interrupt for telemetry,
cleanup buzzer init,
2024-12-10 21:05:47 +01:00
janek c935e0b5cf cleanup 2024-12-09 22:47:14 +01:00
janek 9bd0397f83 optimize loop iterator type 2024-12-09 22:19:40 +01:00
janek 68195be6d9 crossfireTelemetryPush allow up to full 64 bytes 2024-12-09 12:49:10 +01:00
janek d0bf6310e3 added CMake CROSSFIRE definition 2024-12-08 18:12:57 +01:00
janek b434750207 Merge remote-tracking branch 'origin/master' 2024-12-08 17:54:52 +01:00
janek 5627957dbd update common build options 2024-12-08 17:54:40 +01:00
Janek f7e573fff9 RAM & Flash savings (#444)
* RAM savings: split moduleData structs,
* cleanup not used protocols,
* Flash savings, pxx cleanup
2024-12-08 17:49:57 +01:00
janek 17d3cc2801 add warning 2024-12-08 17:45:48 +01:00
janek 9660f70308 Enable USB Serial for EN on DFPlayer build 2024-12-08 16:12:27 +01:00
Janek 559b2af2e8 Add CRSF Full duplex mode (#442)
* Add CRSF Full duplex mode
* Removed CRSF_UNINVERTED
* correct GPIO AF for RX
2024-12-07 13:56:10 +01:00
janek 24c8653790 cleanup, remove not used telemetryInit modes 2024-12-05 11:26:06 +01:00
janek d976bb0dec do not use EEPROM_VARIANT on PCBI6X 2024-12-05 00:23:58 +01:00
janek 0fde774398 cleanup 2024-12-04 12:52:30 +01:00
janek 60baf50708 Rename Sticks to Axis 2024-12-03 17:35:49 +01:00
janek 0ef6cc2ca8 cleanup 2024-12-03 10:03:34 +01:00
janek 2e1c8dc366 cleanup 2024-12-03 09:52:41 +01:00
janek ef1d6d0b32 Add space to SD edit name (#8405) 2024-12-03 09:50:11 +01:00
janek 33f08f01a4 Move Contrast after Backlight items in Radio Setup 2024-12-03 09:45:11 +01:00
janek 8a0e6f5005 Minor types change to match current OpenTX/EdgeTX 2024-12-03 09:44:24 +01:00
janek 2b4a6ace18 Merge TelemetryProtocols define 2024-12-03 09:42:54 +01:00
janek d97ed48069 Adjust joystick mixer period rate to match usb update rate, added afhds2a period define 2024-11-30 16:24:26 +01:00
janek 76c6c4a7ff typo fix 2024-11-30 11:54:12 +01:00
janek ed930033de Further SKY9X remove 2024-11-30 11:52:34 +01:00
janek 65f2929525 Merge remote-tracking branch 'origin/master' 2024-11-30 11:41:08 +01:00
janek 6a5ec7b803 Further SKY9X remove 2024-11-30 11:40:56 +01:00
Janek ec4da489b3 Added native USB connection detection (#441) 2024-11-30 11:32:32 +01:00
Janek d49cc03892 Update README.md 2024-11-30 00:11:33 +01:00
janek 9eae3f02aa Merge remote-tracking branch 'origin/master' 2024-11-29 23:24:24 +01:00
janek 16e665e05f inav lite typo + size optimization 2024-11-29 23:24:15 +01:00
Janek 900fb616df Update README.md 2024-11-29 10:58:21 +01:00
janek 9af695ed0e FI translation fix 2024-11-28 11:29:44 +01:00
janek a933cc9299 Remove SKY9X target, remove drawFieldLabel 2024-11-24 22:02:18 +01:00
janek 40628f5dca Merge remote-tracking branch 'origin/master' 2024-11-24 21:29:04 +01:00
janek 6c76ebe5ec skip modes when SBUS_TRAINER not defined 2024-11-24 21:28:57 +01:00
Janek a2a9a00774 Elrs optional arming in module setup (#440)
* ELRS optional arming method
2024-11-24 21:27:38 +01:00
janek 4eb8f7310e minor definition fix 2024-11-24 13:58:51 +01:00
Janek 5d1e179e03 Update README.md 2024-11-23 12:14:28 +01:00
Janek 80a2ae5b7d Update README.md 2024-11-23 12:12:25 +01:00
Janek 05a8dc9983 Update README.md 2024-11-23 12:09:58 +01:00
Janek bb47d974f7 Update README.md 2024-11-23 12:08:35 +01:00
Janek 350c18b68e Update README.md 2024-11-23 12:04:13 +01:00
Janek c812a8140a Update README.md 2024-11-23 11:54:25 +01:00
Janek a1d4c9b1cb Update README.md 2024-11-23 11:35:37 +01:00
Janek 1c3a7397bc Update README.md 2024-11-23 10:06:10 +01:00
Janek 0c3ee642cd README.md updated buttons description 2024-11-23 09:58:10 +01:00
Janek 068265a7c1 README.md reorder positions 2024-11-23 09:46:25 +01:00
janek 8daccf079a fix 2024-11-21 13:45:43 +01:00
janek d57a77b103 removed SET Screen function on switches limited i6X 2024-11-21 13:33:42 +01:00
janek d1cb47dd30 enable USB_SERIAL for all HELI builds 2024-11-21 11:30:58 +01:00
janek 7fce538ac1 remove PCBI6X_ prefix from build options 2024-11-21 11:24:37 +01:00
Janek 6752c3c1f6 USB Serial modes (#436)
* USB Serial mode
* USB vid, pid
* shorten USB strings
* single USB mode define, as in EdgeTX
* added CRSF and AFHDS2A USB Telem mirror,
* Reduce CDC_IN_FRAME_INTERVAL since we have smaller buffer and this matches EdgeTX
* fix GCC warnings
2024-11-21 11:11:40 +01:00
Janek baa5ed36f3 added SBUS_TRAINER define to make it build time option (#439)
* added SBUS_TRAINER define to make it build time option
* exclude more, exclude trainer connect/disconnect sounds, make it build time option
2024-11-21 10:56:17 +01:00
Janek 6a5e87c40b Update README.md 2024-11-19 23:13:25 +01:00
Janek ec6d70f198 Update README.md 2024-11-18 17:27:40 +01:00
janek 7994ec402f Revert "remove eeprom version from version screen"
This reverts commit f5180b01df.
2024-11-15 19:30:25 +01:00
janek f5180b01df remove eeprom version from version screen 2024-11-15 19:29:55 +01:00
janek e931b4f212 Combine flags enabling to reduce size 2024-11-14 14:30:04 +01:00
janek 088bdfff11 Reduce DEBUG build size 2024-11-14 14:29:13 +01:00
janek 641ac61119 Match EdgeTX priorities 2024-11-13 00:55:10 +01:00
janek 680a3e3b54 Match Horus driver behaviour. 2024-11-12 20:53:54 +01:00
janek 177a00f1c4 Rewrite DMA init to reduce code size 2024-11-12 14:01:22 +01:00
janek d82393c9cb Remove firmware.txt contents from USB MSD to reduce size 2024-11-12 11:35:15 +01:00
janek 45d3abd883 Fn rename 2024-11-11 02:05:36 +01:00
janek 6aac5b6555 Enable syncing at 1000 Hz 2024-11-11 01:06:01 +01:00
janek d519064f6e size optimization 2024-11-10 16:00:58 +01:00
Janek 13db3d3ef9 Enable Telemetry RX DMA + IDLE interrupt (#437)
* Enabled DMA accelerated telemetry RX
* Additional baud rates in comments
* Cleanup
2024-11-10 15:52:49 +01:00
Janek 315e585353 Update README.md 2024-11-03 14:21:53 +01:00
Janek efabd68aee Update README.md 2024-11-03 14:18:26 +01:00
Janek dd67c8f56c Update README.md 2024-11-03 14:16:19 +01:00
Janek c4347e3e8d Update README.md 2024-11-02 11:50:49 +01:00
Janek 57c8905177 CRSF optional STRING and FLOAT support (#435)
* Add FLOAT support
* increase buffer to accommodate for Param size
* added CRSF_EXTENDED_TYPES guard for STRING and FLOAT support
2024-11-01 20:08:35 +01:00
janek 663e857f54 Readjusted DFPlayer volume levels 2024-11-01 16:56:19 +01:00
janek 39272da5d0 Bump version 2024-11-01 13:46:52 +01:00
janek c698bb0e1e Fixed an issue where DFPlayer was not working in Radio Setup menu and volume was not saved. 2024-11-01 13:40:02 +01:00
janek 3551a8cdbe increase space for option just in case 2024-11-01 13:10:15 +01:00
janek e75fd9b657 optimize for size 2024-11-01 12:44:22 +01:00
janek 4b7a8b03a4 revert 2024-10-31 16:04:07 +01:00
janek e8d6d2a720 optimized for size 2024-10-31 13:43:18 +01:00
janek 529b3e6ed9 simplify condition 2024-10-31 12:56:31 +01:00
janek a7b6614d81 OK button label 2024-10-31 10:49:31 +01:00
janek 36aecef4cf cleanup 2024-10-31 02:07:47 +01:00
janek 7d901ad7a0 Refactored telemetry mirror mode select 2024-10-30 12:59:08 +01:00
janek 3a7312f85d Translations update 2024-10-30 12:09:39 +01:00
janek 023e96b79e Set Screen translations update 2024-10-29 14:01:42 +01:00
janek f14b715b79 DE translation fixes 2024-10-29 13:57:10 +01:00
janek e1e8177aa9 Update CircleCI config 2024-10-29 13:12:39 +01:00
Janek b1c9798365 Fixed popup menus regression (#434) 2024-10-29 12:49:14 +01:00
janek 90f968e2f5 fix(telemetry): wrong scaling after changing unit to rpm (Edgetx/edgetx#4875) 2024-10-23 15:19:18 +02:00
Janek b047c748f2 PCBI6X_USB_MSD exposed as build time option (#432) 2024-10-23 13:26:10 +02:00
janek 98c73ea7bb use paramStringDisplay for INFO 2024-10-22 17:50:17 +02:00
janek e482d3dc03 use paramStringDisplay for INFO 2024-10-22 17:49:24 +02:00
Janek 84d80625f4 ELRS menu: (do not) use maxlen for STRING (#427)
* fix s_editMode state
2024-10-22 17:22:25 +02:00
janek cf3f78e27d More stable batt voltage readings 2024-10-22 11:51:24 +02:00
janek 368d77b446 ELRS menu: increase buffers, fixed initial paramData pointer 2024-10-21 16:43:26 +02:00
janek a025433a3c PL translations 2024-10-21 11:03:38 +02:00
janek 12948100b2 ELRS menu: use s_editMode directly 2024-10-21 02:39:24 +02:00
janek c268229a16 ELRS menu: reuse checkIncDec 2024-10-21 01:51:33 +02:00
janek 9686955ac0 PL translations 2024-10-21 00:55:38 +02:00
janek 6306a89b38 AFHDS2A use local txPacket,
remove global packet pointers,
cleanup
2024-10-21 00:25:51 +02:00
Janek ab51eaa00c AFHDS2A ppm center adjustment (#426)
* AFHDS2A ppm center adjustment
2024-10-20 23:18:01 +02:00
janek d74f533eca By default do not inject AFHDS2A RSSI at ch 17 2024-10-20 19:10:54 +02:00
Janek 3ff3020ba9 ELRS menu: additional data types support (#420)
* support for INT8,UINT16,INT16, STRING
* optimizations for code size
2024-10-20 18:52:05 +02:00
janek 3dffcf7e55 simplify 2024-10-17 00:03:42 +02:00
janek 859b002c49 cosmetics 2024-10-16 23:56:54 +02:00
janek 7c5d6f5a02 elrs cleanup 2024-10-16 14:42:18 +02:00
janek fd5c4711cd elrs cleanup 2024-10-16 14:40:51 +02:00
janek faef96eeaa elrs minor refactor 2024-10-16 14:38:13 +02:00
janek 614c202824 cleanup 2024-10-15 09:53:49 +02:00
janek 8b21998ed4 get back some not used RAM 2024-10-14 22:41:18 +02:00
janek 5cccfe1b68 clean up 2024-10-14 21:14:31 +02:00
janek dfa722036f alignment 2024-10-14 20:07:51 +02:00
janek 2efe7d62f3 elrs fixed popup issue 2024-10-14 17:52:09 +02:00
janek 18c6f98d31 elrs fixes 2024-10-14 16:30:05 +02:00
janek a533acf529 Remove index column from Radio tools 2024-10-12 14:38:51 +02:00
janek e778aec12f Merge remote-tracking branch 'origin/master' 2024-10-12 14:02:10 +02:00
janek ad918726a3 ELRS menu: nicer packet stats alignment, fix paramId reset 2024-10-12 14:01:46 +02:00
janek 68db045da1 ELRS menu: nicer packet stats alignment, fix paramId reset 2024-10-12 14:00:58 +02:00
janek eb118683e8 Unify buttons handling, cleanup 2024-10-12 12:02:53 +02:00
janek 0bcc458ec2 fixed switch midpos delay handling,
allow settings all switches as true 3pos,
cleanup
2024-10-12 00:21:27 +02:00
janek 21dc245974 fixed switch midpos delay handling,
allow settings all switches as true 3pos
2024-10-12 00:20:46 +02:00
janek 30d6006110 cleanup 2024-10-11 15:43:02 +02:00
janek dd919defa6 revert optimized lcdPutPattern 2024-10-11 15:40:08 +02:00
janek 60dca26963 memory layout fix, use board's startup code 2024-10-11 01:26:19 +02:00
janek dd06512823 statistics: removed additional margin 2024-10-10 21:50:05 +02:00
janek 690445c9c0 Optimized lcdPutPattern,
deduplicated draw time code
2024-10-10 21:44:49 +02:00
janek c4c3390465 Cleanup hal.h defines 2024-10-10 18:13:32 +02:00
janek f75ce7bf52 bum version 2024-10-07 15:27:35 +02:00
janek 1b7daf89ba ppmInput -> trainerInput 2024-10-07 12:30:24 +02:00
Janek 3041b1ee04 ELRS menu: optimizations (#425)
* removed tiny_string dependency,
* replaced goodBadPkt and elrsFlags with linkstat,
* do not reset linkstat.flags on device change,
* update CMAKE size comment
2024-10-07 10:48:57 +02:00
Janek edebfb9306 Add 'Set Screen' special function (port edgetx#5589) (#423)
* Add 'Set Screen' special function (port edgetx#5589)
* add to translations, PL translation
* silence warning
2024-10-06 17:46:29 +02:00
Janek f26283d836 Merge pull request #424 from OpenI6X/usb-joystick-fix
Usb joystick fix (cherry picked @dim13 change)
2024-10-05 09:21:24 +02:00
janek 6536089586 ELRS menu: minor refactor 2024-10-05 09:15:48 +02:00
janek 7d54485e60 ELRS menu: minor refactor 2024-10-04 20:29:46 +02:00
janek bc37064a8d Cleanup old USB Joystick hacks 2024-10-04 00:18:35 +02:00
Dimitri Sokolyuk 52bd029303 Fix USB HID joystick detection
(cherry picked from commit 390c6490dc5ee9cc32c12bc60f370eba3259da93)
2024-10-04 00:13:51 +02:00
janek 68e39fd029 ELRS menu: do not highlight unit 2024-10-02 01:01:51 +02:00
janek 31a30bf683 cleanup 2024-10-01 19:09:27 +02:00
janek 29849b0c48 Restore trainer back/lost sounds 2024-10-01 17:05:31 +02:00
janek b82bf9d940 ELRS menu: unit display fix 2024-09-30 17:57:35 +02:00
janek 2e1435f22a ELRS menu: renamed field to param,
removed unneeded condition,
added common unitDisplay,
cleanup
2024-09-30 10:20:24 +02:00
janek ba6e108f03 Adjust popups to match EdgeTX look. 2024-09-30 10:13:41 +02:00
janek 3a1c59e6d6 Merge remote-tracking branch 'origin/master' 2024-09-25 15:13:35 +02:00
janek c7831e4ebc minor ELRS menu fixes 2024-09-25 15:13:23 +02:00
Wilhelm 10675c4048 added compiletime option EXTPWR_INVERT to invert the polarity of PC13 to drive directly a p-channel mosfet (#422) 2024-09-25 14:31:49 +02:00
janek babaeb0bb0 remove/reduce some debug logs 2024-09-24 17:38:45 +02:00
janek ea611b46c7 remove/reduce some debug logs 2024-09-24 17:38:36 +02:00
janek a328f218cc Reduced PRINTF_BUFFER_SIZE for DEBUG builds,
FLYSKY_GIMBAL have the same aux serial buffer as other builds,
compilation warning fix
2024-09-23 09:24:13 +02:00
Janek 08ed0191cb Create fake RSSI from TRSS when former not present (#413)
* Create fake RSSI from TRSS when former not present.
* guarded by build time option FAKE_RSSI
2024-09-21 14:31:24 +02:00
Janek 49b7497750 ELRS optimizing RAM allocation (#419)
* increased fieldData buffer size by overlapping it with general data buffer
* increased max devices count,
* renamed some functions,
* do not store popup msg if popup is not shown,
* skip field on first chunk if wrong folder,
* reduced FieldProps size,
2024-09-20 21:05:20 +02:00
Janek a4a2ee5cb6 Backport: Fix #7601 - Wrong Flight Mode Index when exiting from Gvar Menu (128x64 display) (#7601) (#411)
GVars menu issue, (Backport: Fix opentx#7601)
2024-09-16 10:23:18 +02:00
Janek 8b31041cdc Update README.md - added languages to comparison table 2024-09-15 13:13:52 +02:00
janek 0db1af3a90 Fixed AUX Serial init 2024-07-30 19:09:10 +02:00
janek f43cba34c9 buzzer driver minor refactor 2024-07-27 15:52:06 +02:00
janek 0bd2c23fda Fix PL translations for DFPLAYER builds 2024-07-27 15:50:50 +02:00
janek ba7c9a768c Match EdgeTX default channel unit precision 2024-06-08 17:24:17 +02:00
janek 52f2616736 Make USB_GPIO_PIN_VBUS optional 2024-06-08 17:22:49 +02:00
janek 4315f93a5e Fixed Special Functions description in DFPLAYER builds for CZ and DE translations
New sticks translation for EN
Closes: #396
2024-06-08 17:06:15 +02:00
janek 60b2cb981e Fixed radio setup menu in non DFPLAYER builds
Closes: #391
2024-06-08 16:47:32 +02:00
Asparuh Nestorov 56ad701183 INAV Light fix - telemetry type 7 (#397)
* INAV fix mode 7
2024-05-12 08:55:10 +02:00
Janek 4d11bba9ad Update README.md 2023-12-29 09:37:05 +01:00
janek 3939780d4f License + readme update 2023-12-28 12:06:02 +01:00
janek ebefeb7afb Bump patch version 2023-12-28 11:40:25 +01:00
janek c5e76d3f6d Draw analogs as decimal value 2023-12-27 20:59:38 +01:00
janek febd1fc49c Fixed issue with unable to set Play Sound sound type. 2023-12-27 09:29:48 +01:00
janek 2b196c3938 Corrected mixer scheduler priority for STM32F0 2023-12-25 12:04:04 +01:00
janek 4ed536a8c6 Free up some more RAM 2023-12-25 10:43:25 +01:00
janek cbfa4fc81b Merge remote-tracking branch 'origin/master' 2023-12-23 18:54:22 +01:00
janek d7308a27a1 adjusted dfplayer volume levels, clean up 2023-12-23 18:54:13 +01:00
Janek 60321620e9 Update README.md 2023-12-22 17:38:28 +01:00
janek 72cfcd4b95 Merge remote-tracking branch 'origin/master' 2023-12-21 21:19:46 +01:00
janek 464d0c4340 removed fm-5 sound 2023-12-21 21:19:38 +01:00
Janek 6ed15b39b4 Update README.md 2023-12-21 20:43:24 +01:00
Janek 8c1052dc88 Update README.md 2023-12-21 20:42:23 +01:00
Janek 57cf1119b9 Update README.md 2023-12-17 09:02:43 +01:00
janek 2379fc4c53 removed telemetryErrors counter 2023-12-16 08:01:36 +01:00
janek 151db8fa49 removed telemetryErrors counter 2023-12-15 22:28:01 +01:00
janek 3a962fb165 Fixed stack end 2023-12-11 19:04:54 +01:00
janek b9961e711e Fix for possible reset on value over 100 2023-12-10 12:11:29 +01:00
janek a13f6f8316 Update startup code 2023-12-09 20:08:22 +01:00
janek e0acedb9a2 Clenaup CircleCI config 2023-12-09 20:05:10 +01:00
janek 473e1ce669 Bump version number 2023-12-09 20:04:47 +01:00
janek 22a953218d Elrs: Add some more space for data 2023-12-09 20:04:25 +01:00
janek ab10aec41c updated readme 2023-12-09 10:42:18 +01:00
janek afe8eb68bd updated readme 2023-12-09 10:31:34 +01:00
Janek 7874bc1a28 Defer AFHDS2A telemetry handling from ISR to task (#384)
* Defer AFHDS2A telemetry handing from ISR to task
* pass buffer by reference
2023-12-08 21:57:11 +01:00
janek 0a09e0686d update translations 2023-12-08 21:52:51 +01:00
janek 77ae8165e2 Remove not existing FM sounds 2023-12-08 19:32:41 +01:00
janek 7ca6373851 Update translations 2023-12-08 19:31:39 +01:00
Janek f1d600cfe3 Optionaly uninvert CRSF pin. (#383)
* Optionaly uninvert CRSF pin.
* Internal pull up for uninvert CRSF pin.
* Add build flag to CMakeLists.txt
2023-12-08 16:10:39 +01:00
janek c28396f145 Update translations 2023-12-05 18:34:20 +01:00
janek a2c0b76dc0 Update translations 2023-12-05 18:33:52 +01:00
janek 34eb0042d8 Reduce gimbal jitter 2023-12-03 15:58:02 +01:00
Janek adfead46c5 Separate lat long sensors merged to single GPS sensor (Port EdgeTX#4080) (#374)
* Separate lat long sensors merged to single GPS sensor (Port EdgeTX#4080)
* Reverted previous solution
* Missing removed sensor definition
2023-12-03 14:01:15 +01:00
janek 5cc5df9a40 Readjusted dfplayer volumes, fixed MH2024K init 2023-11-19 19:21:17 +01:00
janek 12eabec625 Revert fixed external module power on startup to do not break PPM Out 2023-11-18 15:35:15 +01:00
janek 034ae1f4fa Third col offscrn when bars and timer (EdgeTX port) 2023-11-17 17:37:25 +01:00
janek f5662368f3 enable INAV Lite Radar for all languages 2023-11-17 07:41:40 +01:00
Janek bb1ef6b959 DFPlayer voice support (#377)
* Use standard Fifo for buzzer
* Added DFPlayer driver,
integrated with buzzer driver,
* enabled Play Value and Play Track special functions,
* split AUX2 into AUX3 and AUX4 Serial
* 2 pots on i6X,
* fixed definitions after AUX split
* renamed buzzerEvent to audioEvent
* aux4 init potential fix
* Added volume adjustment, removed delays for now.
* fixed play track + interval,
* fixed boot sounds and sounds order,
* unify delays timer init,
* Fixed volume levels
* Do not skip frequent sounds
* Fixed welcome sound order,
* Added filenames for Play Track
* Readjusted volume levels
* Do not play "zero" by default,
* added support for 9 custom tracks
* buid fix
2023-11-16 16:40:34 +01:00
Janek 2ff8343d23 Unified backlight driver (#380)
* Unified backlight driver

* Unified CircleCI config

* Proper build flags

* Fixed std backlight
2023-11-14 19:43:43 +01:00
janek 458aa445dd update to GCC 13.2, optimize RAM usage, cosmetics 2023-11-12 18:11:35 +01:00
janek 106ef955e4 debug screen reset fix 2023-11-01 18:30:58 +01:00
janek 334a52d8fc Merge two debug screens into one 2023-11-01 18:17:23 +01:00
janek 07d8112e22 Polish translations fixes 2023-11-01 17:15:16 +01:00
janek 23b973e3a5 LCD driver optimization (twice as fast?), ADC driver cleanup 2023-11-01 17:09:32 +01:00
janek e33b334a4d Match EdgeTX naming, cleanup 2023-10-25 17:06:13 +02:00
janek 82b5209ee9 Remove not used definitions, updated comments 2023-10-23 16:00:01 +02:00
janek 6f980ce98c Minor elrs refactor 2023-10-23 15:57:07 +02:00
janek 0e3b97135e fixed external module power on startup, probably breaks ppm out on startup (broken somewhere else) 2023-10-23 15:55:10 +02:00
janek feabfa8fbb Merge remote-tracking branch 'origin/master' 2023-10-19 11:51:53 +02:00
janek 4627f83996 minor elrs buffer change 2023-10-19 11:51:34 +02:00
Rafael Olguin 304eedf856 Since hardware optimisations, a low buffer for the (#379)
32 byte buffer for flysky gimbal
2023-10-16 08:23:33 +02:00
Janek 49f5da2d28 Merge pull request #378 from rafolg/master
Delay for FSgimbal throttle check
2023-10-15 13:46:43 +02:00
Rafael Olguin f2bf93a1d2 Delay for successful throttle check of FSgimbal 2023-10-15 20:34:00 +10:00
janek 78773476a0 build fix 2023-10-14 15:02:29 +02:00
Rafael Olguin 508101d481 Working Flysky Hall Gimbal implementation (#376)
* Flysky Gimbal implementation for the FS-i6X, this
this is possible thanks to the work of Janek, by
enabling the idle callback function for UART4

* Some changes done as requested by Janek
Outstanding requests:
 - Write adc values directly to the DMA variable, this is
   currently not possible as disabling channels 0-3 in
   adcInit() messes with the order of the switches, pots
   and sticks

* Hardware CRC16 1021 implemented and working well

* Direct write of adcValues is now completed
* Serial idle callback is now inside a void function
flysky_gimbal_init which is called in board.cpp
2023-10-14 13:10:57 +02:00
janek 4a9aa62d5a minor fixes 2023-10-14 11:09:51 +02:00
Janek 2abe68bb72 AUX2 Serial driver with idle callback (#368)
* Added AUX2 Serial definitions, cleanup
* enable IDLE flag interrupt callback
* added DFPLAYER guard for AUX2
* adjust serial buffers by build type
2023-10-05 17:03:58 +02:00
Janek 64ddd7d4e1 AFHDS2A telemetry and other fixes (#373)
* use exact method names, timing and interface as Multiprotocol

* added spi error flags handling

* added CRC checking for A7105

* removed AFHDS2A sensor ID guard due to CRC checking

* cleanup

* CRCF check on Bind result

* Validate RX address
2023-10-02 16:27:51 +02:00
janek adca844879 Inav screen orientation fix, thx @FRPProject 2023-09-28 16:44:48 +02:00
janek 6d32c44539 Minor refactor, size optimization 2023-09-28 16:42:15 +02:00
janek 2f106e6497 Merge remote-tracking branch 'origin/master' 2023-09-22 17:10:01 +02:00
janek 9e05244ef6 compilation warnings fixes, cleanup 2023-09-22 17:09:16 +02:00
Janek 227b0ca02a Update README.md 2023-08-17 23:13:13 +02:00
janek 4dba99481e Elrs: proper buffers sizes 2023-07-25 23:45:57 +02:00
janek 68f70c8054 INAV Lite: North Up fix 2023-07-25 23:44:27 +02:00
janek e4b3ca1f6a Build cleanup 2023-07-25 17:13:20 +02:00
janek c38b4c9b2d FIx warning 2023-07-24 17:01:26 +02:00
janek 670d5dee05 INAV Lite: North Up fix,
changed home icon
2023-07-24 16:54:29 +02:00
janek 195aab5635 INAV Lite: Reuse telemetry header,
fixed telemetry header Timer 1 display,
revert INVERS support for drawValueWithUnit,
small refactor,
2023-07-24 16:16:18 +02:00
Janek e264d4d9c7 Update README.md
Some ExpressLRS clarifications
2023-07-24 14:05:50 +02:00
janek 2ad10f29b0 updated readme.md 2023-07-20 17:14:36 +02:00
Janek 78ceda4511 INAV Lite changes & fixes (#359)
* Do not drop AFHDS2A_ID_GPS_STATUS high byte if not zero
* INAV Lite: report true rssi, fixed afhds2a alt, galt, curr, sats display,
Switched to 4 byte sensors (ibus_telemetry_type=7/8/135/136) for simplicity
* fixed display of GAlt unit
* fixed yaw
* added Vertical speed indicator
* remove debug display
* alt position fix
* Set home position on fix. emit sound.
* Show sats also on standard telemetry screens.
* hide HDOP
* reverted decode sats instead of fix
* cleanup
2023-07-20 16:22:03 +02:00
janek a11fc238f7 bump version 2023-07-08 12:12:52 +02:00
janek 8657d738db cleanup 2023-07-08 11:53:32 +02:00
janek b8fd920b47 Default baudrate is 400k 2023-07-08 09:09:00 +02:00
janek fdce008662 Restore third build 2023-06-19 10:21:59 +02:00
janek fd13f124d6 Restore third build 2023-06-19 10:19:29 +02:00
janek 09724157a4 rename ELRSV3 to ELRS,
guard against reset on non supported filed type,
small optimization
2023-06-15 16:40:30 +02:00
janek a5a80b1106 elrs cleanup 2023-06-13 16:02:20 +02:00
janek ed6f3f1327 size optimization 2023-06-13 16:01:31 +02:00
Janek 313cb11a87 Change output value calculation to 'round away from 0' instead 'floor'. (#358)
Change output value calculation to 'round away from 0' instead 'floor'.
Port of https://github.com/EdgeTX/edgetx/pull/3292
2023-06-01 13:31:44 +02:00
janek 9798668b63 pipeline fix 2023-06-01 13:29:08 +02:00
janek 6c390e5a7d A7105 proper buf size 2023-05-30 17:15:41 +02:00
janek c53ec0c3b5 Size optimization 2023-05-30 17:15:08 +02:00
janek c639f11011 Change "RSSI" label to "RQly" for both AFHDS2A and Crossfire. 2023-05-30 16:39:10 +02:00
janek 2df74c181e Change "RSSI" label to "RQly" for both AFHDS2A and Crossfire. 2023-05-30 16:37:45 +02:00
janek 82268a3e64 cleanup, adde comments 2023-05-29 10:19:17 +02:00
janek ff2d27b1b0 elrsv3: missing buffer increase change 2023-05-26 15:51:05 +02:00
Janek 3539f83991 Fixed AFHDS2A telemetry GPS lat/lon display. (#354)
Fixed AFHDS2A telemetry GPS lat/lon display.
2023-05-26 15:36:19 +02:00
janek 0b1fb163d2 minor exclude related to sdcard logs 2023-05-26 14:57:56 +02:00
janek 6e5bf4cd34 elrsv3: defines instead of magic numbers, little buffer increase 2023-05-26 14:55:21 +02:00
janek dfb5d7ba92 updated docker image 2023-05-26 14:36:13 +02:00
janek e273c921d2 Reduce RAM usage on non elrsv3 builds to fix DEBUG builds 2023-05-18 10:41:07 +02:00
janek 72548da279 INAV Lite: possibility to disable CRSF/AFHDS2A telemetry support,
CmakeLists update comment and cleanup
2023-05-15 21:30:00 +02:00
janek 994c8f7fc3 INAV Lite: disable unfinished home heading reset, always North up 2023-05-15 21:19:26 +02:00
janek 7dd6418ed0 INAV Lite: unify current draw display, cleanup 2023-05-15 20:40:13 +02:00
janek f9988352a2 pipeline fix 2023-05-14 20:01:50 +02:00
janek a7053bd993 reduce number of builds 2023-05-14 20:00:10 +02:00
Janek bb9ebd0473 An attempt to implement custom INAV radar screen (#346)
* An attempt to port INAV radar screen.
* removed splash to make it fit in the flash.
* reenable afhds2a sensor values. fixed galt screen position
* proper scale for altitude
* Fixed speed scaling
* display speed with one digit fraction
* Fixed rssi reading and sats icon position
* Fixed mode display for AFHDS2A
* Throttle display to 10fps
* Display HDOP, RX batt, cell voltage, updated layout,
* allow inversion of unit
* draw distance for CRSF and AFHDS2A
* use dist or "420" for CRSF dist
* keep data between sessions
* allow display as telemetry screen
* always enable radio tools, add INAV lite as build time option
2023-05-14 19:53:19 +02:00
janek cbb6368d48 space optimization 2023-05-14 18:44:27 +02:00
janek 92f76f73b2 draw sensor ID column for debug 2023-05-14 17:39:33 +02:00
janek 54921372b1 free up some RAM 2023-05-14 17:38:17 +02:00
janek 1c4971fef7 code size optimization, 2023-05-14 17:27:52 +02:00
janek 585c7b8dc1 ExpressLRS: code size optimization, increased buffers 2023-05-12 18:18:22 +02:00
janek 6babc010b4 ExpressLRS - don't show warning error code 2023-05-01 17:36:46 +02:00
janek aa6f9d89aa Space optimization - exclude logs flag 2023-04-25 16:11:12 +02:00
janek 73292995c8 Translations: changed channel order label, removed not present timer countdown modes 2023-04-22 17:13:31 +02:00
janek 404953ddfd Blink unexpected reboot asterisk 2023-04-22 17:11:25 +02:00
janek dade98c82f Remove memcpy from AFHDS2A telemetry 2023-04-22 17:10:44 +02:00
janek d28c8fc011 Further space optimization in power management. 2023-04-22 16:44:02 +02:00
janek 70561a159e Fix CRSF GPS heading precision.
Port of https://github.com/EdgeTX/edgetx/pull/3177
2023-04-22 11:50:39 +02:00
janek 579985087b Remove not used sleep screen to save space. 2023-04-20 09:24:34 +02:00
janek 375f0186f1 Small refactor for size optimization 2023-04-16 17:00:07 +02:00
janek 43705a0f3c reverted set default baudrate on reset. 2023-04-16 16:23:50 +02:00
janek 6bc0db45e3 Remove aux serial delay 2023-04-16 16:18:50 +02:00
Janek d3744477b3 ExpressLRS confg tool improvements (#352)
* Refactored memory model to be more flexible and to support upcoming ExpressLRS version.
* Fixed save bug present on master
* removed shortening functions
2023-04-16 14:36:40 +02:00
janek 2b593e2956 minor elrs adjustment 2023-03-12 10:12:05 +01:00
janek cd85f46740 Restore OpenTX behaviour to force calibration on reset instead of providing defaults. 2023-03-12 10:01:30 +01:00
janek f2d1eb2308 skip setting default voice language 2023-03-12 09:33:33 +01:00
janek d4046d68e6 Revert sync at 1000Hz 2023-03-12 09:06:46 +01:00
janek af7274f78d ExpressLRS tool:
refactored to skip parent property,
safe copy strings,
optimized for size,
shorten "AUX" to "A" in values,
readjusted buffers for future options
2023-01-31 20:40:15 +01:00
janek 0af5d26bb1 Merge remote-tracking branch 'origin/master' 2023-01-28 14:16:28 +01:00
janek 30498c7c44 Cleanup of not supported features 2023-01-28 14:16:21 +01:00
Janek 837a2e7ea3 Update README.md 2023-01-28 12:55:48 +01:00
Janek bddca0c7dd Update README.md
Added telemetry mirror for AFHDS2A
2023-01-27 17:59:45 +01:00
janek 7afedd8f05 Report AFHDS2A_ID_S84 to AFHDS2A_ID_S8a sensors,
but skip truly unknown ones
2023-01-27 17:53:56 +01:00
Janek d71d6dac4e AFHDS2A telemetry mirror (#166)
* AFHDS2A telemetry mirror
* Mimic Multiprotocol module telemetry data format
* copy telemetry data to separate buffer
* increase telemetry mirror serial speed
* fixed telem sensor labels
2023-01-27 17:18:37 +01:00
janek b84ac75beb cosmetics 2023-01-27 16:25:02 +01:00
janek f4344e7a98 Increase special functions to 18 2023-01-27 16:24:06 +01:00
janek 40de080eeb Default to 400k baudrate to improve UX 2023-01-27 13:40:20 +01:00
Janek 58efa39ac5 Update README.md
updated credits
2023-01-09 15:08:36 +01:00
Janek 8114825294 Restore heartbeat workaround (#336) 2023-01-08 08:51:04 +01:00
janek 4c6c419503 Added banner, updated infographics with switches and reorganized 2023-01-07 16:57:12 +01:00
janek 7aa093f6f7 Added banner, updated infographics with switches and reorganized 2023-01-07 16:44:15 +01:00
janek dd304c9b0e Added banner, updated infographics with switches and reorganized 2023-01-07 16:42:26 +01:00
janek 5661c58ae4 Increase telemetry slots to 30,
report all ibus sensors
2022-12-25 17:57:00 +01:00
Janek 51a5d8c625 Increased special functions count and telemetry slots (#328)
* Increased special functions count and telemetry slots
2022-12-25 11:39:28 +01:00
Janek d5aab13de0 Reuse telemetryRxBuffer for native AFHDS2A support (#329) 2022-12-25 11:31:28 +01:00
janek bb1c8276a2 RAM saving 2022-12-24 15:56:39 +01:00
Janek 6d8f29378b better setupPulses guard (#327)
* Hearbeat bootloop fix
2022-12-23 14:15:28 +01:00
janek 8b57b3fdc0 minor cleanup 2022-12-22 21:56:33 +01:00
janek 2dee6452e1 minor cleanup 2022-12-22 19:08:47 +01:00
Janek d4a7e1baf1 Update README.md
Added note on powering from 2S acu
2022-12-22 11:52:44 +01:00
Janek 58221d9f55 ExpressLRS configurator improvements (#317)
- reload folder on change to refresh possible changes in Switch Mode and RX PWM mapping,
- use single continuous buffer to do not waste RAM + readjusted buffers, 
- remove not used "reloadFolder" functionality,
2022-12-11 14:56:21 +01:00
janek 20819991f4 Allow sync at 1000Hz 2022-12-08 18:16:17 +01:00
janek 7426c69239 ExpressLRS configurator:
-store max value instead of recomputing,
- refresh data in exact lua timing,
- removed guard
2022-12-08 18:15:53 +01:00
janek 307465a6ec Bump version 2022-12-03 19:30:05 +01:00
janek 6492d02d77 Reverted mixer scheduler min refresh rate change 2022-12-03 19:15:55 +01:00
janek efa8706042 Enable splash for english translation 2022-12-03 18:32:47 +01:00
janek f061d49f60 Disable trainer lost/back sounds 2022-12-03 18:29:56 +01:00
janek dd0e3aea0d ExpressLRS, throttle fields loading to better match Lua behaviour 2022-12-03 18:29:28 +01:00
Janek 55accee9c1 CRSF port of https://github.com/EdgeTX/edgetx/pull/1533 (#315)
restored standard Tlm RX error counter,
allow sync at 1000Hz
2022-12-03 10:47:28 +01:00
janek 33eb2ed832 Expose example Hello world tool as build time option 2022-11-30 20:18:40 +01:00
janek 31dbb62927 Fix for ExpressLRS error display,
added example Hello world tool,
new splash,
minor refactor
2022-11-30 20:12:09 +01:00
Janek 6a37008076 Port of https://github.com/EdgeTX/edgetx/pull/2538 (#314)
* Fix for invalid custom source name alignment, port of EdgeTX/edgetx#2538
* Minor refactor
2022-11-29 11:12:57 +01:00
Janek 26db4812c1 Update README.md 2022-11-28 13:43:49 +01:00
Janek cd3dd658eb Update README.md 2022-11-27 11:42:31 +01:00
Janek ede5a6bcb5 Update README.md 2022-11-27 11:41:12 +01:00
janek ef20534c0f Updated readme for new USB Connect method and contributors. 2022-11-26 18:31:53 +01:00
janek 763d373e68 define improvements 2022-11-26 12:07:54 +01:00
janek 6aa2bb8168 restore standard OpenTX heartbeat check 2022-11-26 11:52:20 +01:00
Janek b106639258 Added USB Connect to main menu popup (#313)
* Added USB Connect to main menu popup

* reorder
2022-11-26 09:57:34 +01:00
Janek 13b82503e0 Removed elrs workaround for missing last 2 bytes (#310) 2022-11-24 21:12:01 +01:00
Janek 7bd7ed17a5 Cleaned some debug logs and added comments (#312) 2022-11-24 19:59:44 +01:00
Janek f415076c77 Fixed PPM Out (#311)
* Fixed PPM Out
2022-11-24 19:53:18 +01:00
Janek f51c578845 Removed channels monitor shortcuts due to key conflicts (#309) 2022-11-21 21:19:28 +01:00
Janek 03dcdaf38c Move cScriptRunning to GlobalData, (#308)
ExpressLRS configurator minor fixes,
cleanup
2022-11-20 12:01:13 +01:00
Janek f6350fea01 Update README.md 2022-11-20 11:45:33 +01:00
janek f2c6fbffa0 Readme updates 2022-11-20 11:44:09 +01:00
janek 6834e7387f Quiet some warnings, AFHDS2A_LQI_CH is now build time option 2022-11-16 09:28:23 +01:00
janek 57a270e5fb PL translations update 2022-11-15 20:38:16 +01:00
janek 5985c1762a Enable USB Mass storage mode for elrsv3 build,
do not compile elrsV3.cpp when not needed,
cleanup
2022-11-15 20:27:12 +01:00
Janek 787f3e5850 ExpressLRS improvements (#305)
- adjusted buffers,
- load folder items faster,
- added workaround for missing packet last 2 bytes,
- keep focus only on value, like in original lua,
- use unions for correct naming of popup and command fields,
- removed popup guards and added volatile instead,
2022-11-15 20:25:38 +01:00
Janek 57fd7a8a20 removed rssi poweroff alarm, (#304) 2022-11-15 20:03:21 +01:00
Janek 71f823d9c8 fixed A7105 sleep mode (#300) 2022-11-14 18:57:47 +01:00
Janek 7df416da03 Compatibility with GCC 12.2 + LTO (#303)
* Compatibility with GCC 12.2 + LTO

* use prepared docker image for all builds
2022-11-14 16:59:40 +01:00
Janek c942195d36 menu improvements cosmetics backport (#302) 2022-11-14 10:27:19 +01:00
Janek 699727cbc9 Fixed hardware menus definition, (#301)
* Fixed hardware menus definition,
fixed radio setup menu focus,
enabled DELETE action for special functions menu,
Unified Receiver row name to be always "Receiver" instead of "RxNum",
fixed splash screen delay option,
enabled channels monitor shortcut for model input edit and mixer edit by long press BIND button

* menu improvements backport (Fixes #7036)
2022-11-14 10:20:42 +01:00
janek 324dae967a Cleanup 2022-11-14 08:54:39 +01:00
Janek 21b6f96b28 Compilation fixes for newer gcc versions, (#297)
fixed double USBD_StrDesc declaration,
2022-11-06 17:52:49 +01:00
janek 68bdb9e6ae Bump version 2022-11-04 19:03:18 +01:00
janek 2de6b43e1a increased elrs buffer last time... 2022-11-04 18:18:52 +01:00
janek 1a1ec3164f fixed failsafe warning,
fixed elrs buffer size
2022-11-04 09:22:59 +01:00
janek 7c1864b382 Added fw comparison table to readme. 2022-11-03 20:54:52 +01:00
Janek 046364ea35 Refactored ModuleData (#296)
refactored ModuleData for for size and generated code size,
don't validate AFHDS2A servoFreq twice,
store AFHDS2A servoFreq in union,
reenabled PT translation builds,
fix HAS_RF_PROTOCOL_FAILSAFE implementation
2022-11-03 20:41:48 +01:00
janek d7a6a1bc17 Readme update 2022-11-02 20:53:01 +01:00
Janek 19b0fe60fd ExpressLRS configurator final touch (#295)
* Added ExpressLRS configurator guards preventing radio reset,
* adjusted buffers to free up some RAM.
2022-11-02 20:39:24 +01:00
janek cdb7ca08d7 build fix 2022-11-02 06:30:26 +01:00
janek 65e81f6820 Disabled PT translation due to size restrictions.
Remove asterisk icon for elrsv3 build for CZ language due to size restrictions.
2022-11-01 21:48:00 +01:00
janek f1f135f61f Compilation fixes for CZ 2022-11-01 21:37:05 +01:00
Janek 69ad4f6eaf Use RxNum for AFHDS2A receiver identification (#293)
* Use RxNum for AFHDS2A receiver identification
* Compilation fixes
* better data alignment,
* remove storing backlightColor for i6X,
* bump eeprom version,
* added RadioData and ModelData checks
* cosmetics
* subType should be able to store all modes
2022-11-01 21:30:58 +01:00
janek 4775d87b7c Use correct label for CRSF receiver id 2022-11-01 13:56:07 +01:00
janek beb198fb2e Build fix for PT translation 2022-11-01 13:33:38 +01:00
Janek a568454a55 CRSF RxNum handling (#294)
* CRSF RxNum handling backport,
refactor

* compilation fix, flash space optimization

* cosmetics

* Show RxNum in menu
2022-11-01 13:05:54 +01:00
janek 3a95e7debe Reverted not working USB fix,
Backported minor naming refactors
2022-10-31 17:15:15 +01:00
janek f730b23d7c ExpressLRS:
- removed unnecessary guards to save flash,
- preparation for other integer types support,
- cleanup
2022-10-30 19:51:24 +01:00
Janek baa4d28d22 ExpressLRS configurator fixes: (#292)
* UINT8 save, load and display were ignored,
* UINT8 min, max, unit offset was wrong,
* Other devices and back button IDs could overwrite actual field ID,
2022-10-30 12:59:41 +01:00
Janek 194d351972 ExpressLRS configurator refactor, UINT8 and units support (#291)
refactored to optimizer RAM usage,
added units support,
added CRSF_UINT8 support,
fixed bug where value of hidden field was stored,
display whole values: Packet Rate sensitivity is now visible,
2022-10-29 15:53:39 +02:00
Janek 587c99302c Always display output channel name on mix screen (backport #8076) (#290) 2022-10-25 15:46:13 +02:00
Janek a0ff01edbb Backports: (#287)
- Remove module choice from special function set failsafe (backport #8156)
- Fix mixer overflow (backport #7747)
- Bars inverse (backport #7709)
- Fix scale and telemetry fields (backport #7704)
Cosmetics
2022-10-25 09:50:44 +02:00
Janek 69afe82e7e Fixed USB DFU mode on DEBUG builds (#285) 2022-10-14 12:56:06 +02:00
Janek 157b92d79f Update README.md 2022-10-12 12:17:26 +02:00
Janek 8480c30462 Update README.md 2022-10-12 12:10:20 +02:00
Janek 0c38727322 Added failsafe warning for AFHDS2A (#284) 2022-10-08 20:41:19 +02:00
janek 02cd8c9e08 Update readme with table of contents and backlight mod 2022-09-26 09:15:46 +02:00
Janek 10dfed5d10 Restore warning hand icon to match OpenTX/EdgeTX look (#281) 2022-09-22 15:46:56 +02:00
Janek 46a2dd61f8 EdgeTX port: Optionally support CRSF_VARIO in BARO_ALT telemetry (#280) 2022-09-21 13:09:00 +02:00
janek ad780c30ec Version bump 2022-09-12 12:52:17 +02:00
Janek ff7d71e753 Skip proper wait ti save some flash space. (#279) 2022-09-12 12:51:16 +02:00
Janek 8066d5ca45 Put "Save All" as first option to reduce required button pushes to force save configuration to eeprom. (#278) 2022-09-12 12:46:34 +02:00
Janek bcbb36bc8a ExpressLRS: (#277)
- readjusted buffers to match ExpressLRS 3.0 needs,
- removed strings in brackets to save RAM,
- renamed elrsv2 to elrsv3
2022-09-12 12:43:26 +02:00
Janek 29aa4534aa Update README.md
Renamed ELRSV2 references to ELRSV3 to clear up that this is working with ExpressLRS 3.0 also.
2022-08-29 22:38:06 +02:00
janek ad2e2dd8e7 fixed translation regression 2022-06-02 20:56:45 +02:00
janek 244fd86e10 bump version 2022-05-30 21:38:11 +02:00
janek d8c4c36b37 Fixed back EN translation 2022-05-30 21:26:59 +02:00
Janek 793fd3de76 ELRSV2 ability to exclude other devices support (#259) 2022-05-24 23:41:04 +02:00
Janek da3cfa0563 Exclude sensor logs option. (#258)
Optimize i2c routine for size.
Reduce serial tx wait loop.
Better defines.
2022-05-24 23:27:00 +02:00
janek d8e1b25dcf Merge remote-tracking branch 'origin/master' 2022-05-24 23:26:11 +02:00
janek 0937701490 minor translations cleanup and size reduce 2022-05-24 23:26:03 +02:00
Janek 44f33a0f3a Update README.md 2022-05-19 22:18:23 +02:00
Janek 233b909196 Update README.md 2022-05-19 22:17:45 +02:00
Janek d9a262ac79 Update README.md 2022-05-19 09:32:31 +02:00
janek 73807dd683 remove other unused translations 2022-05-17 23:44:17 +02:00
Janek 1894ce9471 Translations fixes and optimizations (#255)
* Translations fixes and optimizations
2022-05-17 23:30:50 +02:00
Janek ca39bd2804 Fixed bulk eeprom read. (#254)
Added proper eeprom write wait
2022-05-17 18:37:48 +02:00
Janek 66f4c7d570 Update README.md 2022-05-17 15:37:22 +02:00
janek c41367cedf Readme: Added note on USB connection.
Cropped hardware connections image.
2022-05-16 23:04:24 +02:00
Janek 223017680f Enable basic special function menu (#251)
* Enable basic special function menu
* Disable unsupported volume function
* Fixed defines
* Skip unsupported volume fn
2022-05-16 15:07:54 +02:00
Janek 9b0fd2792a Enable backlight mod builds on pipeline (#250)
* Additional build targets for backlight mod
* Updated readme.md
* unified build option name
2022-05-13 09:48:13 +02:00
janek 3d4648c6f6 Updated hardware connections infographic 2022-05-12 07:18:51 +02:00
janek d82962fdc3 Merge remote-tracking branch 'origin/master' 2022-05-12 07:10:03 +02:00
janek bda5bbbcbb Updated hardware connections infographic 2022-05-12 07:09:57 +02:00
Janek fbdd1b0a5d Update README.md 2022-05-12 06:43:58 +02:00
Janek d3c7804f77 Update README.md 2022-05-11 15:48:00 +02:00
janek ad9865b982 Default to screen backlight ON (backport) 2022-05-10 20:47:39 +02:00
janek d0776ec945 Merge remote-tracking branch 'origin/master' 2022-05-10 07:59:55 +02:00
janek 0c5d4f55a7 Enable backlight dimming on pipeline builds 2022-05-10 07:59:47 +02:00
Janek c72c18cd7d Update README.md 2022-05-09 20:43:24 +02:00
Janek 7178884f1c Adjustable backlight level (#249)
* Dimmable backlight
* uses TIM3 CH4 PWM mode
* renamed backlightOn to resetBacklightTimeout (backport)
* updated readme
* EXT module power is moved from `PC9` to `PC13`
* Fix initial 100% blink
* renamed define
* Brightness adjust from backlight function (backport)
* Fixed dim light event with backlight off
* Defines improvement
2022-05-09 20:11:26 +02:00
janek ad660c51d1 Merge remote-tracking branch 'origin/master' 2022-05-09 15:18:01 +02:00
janek bc61c9d65b Added PCBI6X_USB_VBUS build option 2022-05-09 15:17:50 +02:00
Janek 51f0059769 Update README.md 2022-05-07 21:41:19 +02:00
janek 520760c292 Back to PREC0 2022-05-06 12:36:14 +02:00
janek 363888d2b4 Bump version 2022-05-06 12:25:25 +02:00
janek 1a1c75ec2d Reorder mixer actions to match OpenTX 2022-05-06 12:25:12 +02:00
janek 87a862c8e4 Missing refactor for model notes 2022-05-05 00:22:36 +02:00
janek ec062b81c6 Small fix. 2022-05-04 19:12:17 +02:00
janek 2dcf1dad8d Do not pollute global namespace with elrsv2 definitions. 2022-05-04 19:11:41 +02:00
janek defb98b444 Skip board off routines for i6X 2022-05-04 17:48:20 +02:00
janek aab19bafcf Move timer metods to stm32 common timers_driver.c (backport) 2022-05-04 15:30:11 +02:00
Janek a9b6fa9530 Update README.md
Replaced graceful shutdown with "Save all" option.
2022-05-04 12:07:22 +02:00
Janek 69b2a5bd74 Replaced gracefull shutdown with "save all" menu option (#247)
* Replaced gracefull shutdown with "save all" menu option
* watchdogSuspend just in case
* cleanup
* pwrOff exclude on SWITCH mode
2022-05-04 12:01:53 +02:00
janek d1cda7c5bc Merge remote-tracking branch 'origin/master' 2022-05-03 11:43:58 +02:00
janek 68f3f9009a Fix adjustable SBUS refresh rate (backport) 2022-05-03 11:43:49 +02:00
Janek daef3fbae8 Update README.md 2022-05-02 12:39:52 +02:00
janek 92667b8524 Increase AUX Serial tx fifo size.
Reduce CFG_MAX_USER_TASKS again.
2022-05-02 12:32:17 +02:00
Janek dbdb3306bc Trainer followup to #242 (#244)
* removed not supported Slave/Jack option
* different trainer lost/back sound
* cleanup
2022-04-29 18:43:39 +02:00
Janek 1f4160f063 Update README.md 2022-04-29 14:15:48 +02:00
janek 002cac465e Merge remote-tracking branch 'origin/master' 2022-04-29 13:51:24 +02:00
janek cbadc37bae model outputs rename 2022-04-29 13:51:12 +02:00
Janek 7599c493f9 Update README.md
Added hardware pins description
2022-04-29 13:31:14 +02:00
janek f308a16fe3 Removed parallelism to CircleCI 2022-04-29 10:56:43 +02:00
janek 2c65d47f59 Added parallelism to CircleCI 2022-04-29 10:47:03 +02:00
janek 5f45ac411c Disabled Sonar fix 2022-04-29 10:21:01 +02:00
janek ac8e5d452f Disabled Sonar 2022-04-29 10:19:42 +02:00
Janek 550c1d7ded Fixes #6439 Second back needed after popup in model outputs (backport) (#245) 2022-04-29 10:13:31 +02:00
Janek 140d699456 Update README.md 2022-04-27 19:06:02 +02:00
janek 76d7ebb0c6 Translation fix 2022-04-27 16:15:36 +02:00
janek 11663ae817 Translation fix 2022-04-27 16:03:27 +02:00
janek d3550ebbbd Translation fix 2022-04-27 15:55:26 +02:00
janek eb390b339a Translation fix 2022-04-27 15:47:47 +02:00
Janek 955cb7f851 Missing translations (#243)
* Missing translations
2022-04-27 15:39:51 +02:00
Janek 194bc1d10a Update README.md
Added SBUS Trainer to readme
2022-04-27 13:07:16 +02:00
Janek 50db772fe1 Serial port SBUS Trainer (#242)
* SBUS Trainer
* Fixed rx fifo again,
* Always invert UART RX because only SBUS for now,
* HAL libs don't care about mask
* Better workaround for CNDTR reading
* Move trainer functions to trainer.c (backport)
* Enable 16 channels trainer
* Enable trainer lost and back sounds
* Do not process sbus input when not enabled,
* Added translations
2022-04-27 11:43:19 +02:00
Janek 6d8816a601 Update README.md 2022-04-26 19:28:37 +02:00
Janek 0d10b809e5 Update README.md 2022-04-26 19:24:52 +02:00
janek e8b7a87d69 PT translation fix + cleanup 2022-04-25 17:42:23 +02:00
janek 22563fdccf Cleanup unused vars from AFHDS2A 2022-04-25 16:12:56 +02:00
janek f8c0fe2ee6 Disable POT1 navigation 2022-04-24 20:43:28 +02:00
Janek 5f054d963a Do not enable serial rx interrupt, (#241)
Fixed occasional reboots on serial fifo full,
2022-04-24 20:23:46 +02:00
janek 79089010cf auxSerialRxFifo is enough, enable DMA for SBUS Trainer 2022-04-24 11:15:45 +02:00
janek c0036b876e * added sbus guard 2022-04-24 11:05:08 +02:00
janek dc969e7715 * added trainer sbus support to serial driver
* fixed some compilation warnings
2022-04-24 11:01:01 +02:00
janek e5c09d404a * Reverted allowing switches 2/3POS change,
* Skip pots saving to save flash,
* Fixed PWR_BUTTON SWITCH option
2022-04-24 00:55:24 +02:00
janek f580933670 explicitly pass PPM_UNIT 2022-04-23 20:25:09 +02:00
janek 49f7f280e8 auxSerialStop for DMA RX,
better guard
2022-04-23 19:55:08 +02:00
Janek a94373779f AUX Serial RX DMA fifo (#240)
* Aux serial RX fifo DMA works
* reverted to keep serial driver RX DMA working but define guarded
2022-04-23 18:48:16 +02:00
Janek e76a2a0855 Aux serial improvements (#239)
* enable tx fifo
* restored common stm32 aux serial driver
* always receive serial data (backport)
* disabled aux receive for now (no use)
2022-04-22 12:51:55 +02:00
Janek b50687e766 Translation fixes (#238)
* pt translation,
* minor i6X opimizations
2022-04-20 08:37:00 +02:00
janek 8c9936ff88 Save 104 bytes 2022-04-19 22:04:34 +02:00
janek 7d8f2e6870 use docker instead of machine 2022-04-19 10:42:57 +02:00
Janek 7144c4080d Update README.md 2022-04-18 19:13:55 +02:00
Janek b718b8f066 Skip attempt to build companion (#237)
* skip attempt to build companion,
* improvements for polish translation
* images naming
2022-04-18 10:46:56 +02:00
Janek 003e7cb5eb Update README.md 2022-04-17 15:18:29 +02:00
Janek a94fca57f7 Translations (#236)
* Fixed pl and es translations
* updated cz and ds translations
2022-04-17 15:07:27 +02:00
janek d8abc4f56c Merge remote-tracking branch 'origin/master' 2022-04-16 23:46:19 +02:00
janek 3909a30de0 cleanup 2022-04-16 23:46:10 +02:00
Janek 454da140c8 Update README.md 2022-04-16 23:32:58 +02:00
Janek 519795d4d0 split builds between feature sets (#235) 2022-04-16 23:32:03 +02:00
Janek d7ef1d79bb Update README.md 2022-04-16 23:02:52 +02:00
Janek 78ca8f06f5 Standard build script + multilingual builds (#234)
* Standard build script
* built multiple versions at once
* build all languages only on master
* cleanup
2022-04-16 22:54:50 +02:00
janek 23f99ded22 elrsv2 allow up to 8 devices,
fix minor code smells
2022-04-15 08:52:04 +02:00
Janek 1873e2d74a Configured Sonar (#233)
* Configured Sonar
* typo
* just to trigger build
* updated projectKey
* updated config
* added I6X commit-tests,
* separated sonar job
* disable companion
* add compiler
* changed image
* try to reload path, added pillow
2022-04-15 08:01:05 +02:00
Janek 95a8c5b3e5 Crossfire: add barometer altitude sensor (#232) 2022-04-14 22:31:13 +02:00
Janek 2c37760dfe Move crossfire stuff to crossfire.h (#230)
Removed duplicated defs
2022-04-10 18:51:31 +02:00
Janek 1427b07e82 Set switch warnings on long press OK. (#229)
Set switch warnings on long press OK.
Allow to set any switch to 3POS.
2022-04-09 14:28:30 +02:00
Janek 1721f6bbd6 Crossfire baudrate was ignored! (#228)
Crossfire baudrate was ignored
ELRSv2 proper flag placement,
Reversed baudrate order to make it more intuitive,
2022-04-08 22:54:31 +02:00
janek 88e2c98b5e ELRSv2 use drawChar for char 2022-04-08 14:25:41 +02:00
Janek f1d84e62ca ELRSv2 fixed bug where armed state would hog cpu, (#227)
allow longer device names
2022-04-08 14:11:17 +02:00
Janek b1dd38a730 Readme updates for new version (#192)
* Readme updates for new version
* protocols
* Shutdown clarification.
* 16 channels
* telemetry sensors count
* added save icon explaination
* added nightlies info
* added Mode 1 info.
2022-04-07 11:25:29 +02:00
janek 50068accf4 bump version 2022-04-07 11:21:38 +02:00
janek fec8404f2a simplification 2022-04-07 09:56:30 +02:00
janek a867c66960 possibility to jump to the last model page from the first one. 2022-04-07 09:54:08 +02:00
janek 10df817334 increase lcd reset delay to the same as on other boards 2022-04-06 10:51:46 +02:00
janek 554bf8e7ed fix chan/mix monitor toggle after going back from elrs menu,
possible fix for other devices sometimes not fully populated,
cleanup,
2022-04-06 10:46:06 +02:00
Janek 437fce00cb Bump eeprom version due to changes in struct and telemetry sensors count. (#212) 2022-04-05 12:35:04 +02:00
janek 980a718f02 Fixed save icon overlaps reset icon 2022-04-05 11:55:28 +02:00
Janek 720849363a elrsv2 Other devices support (#218)
* Show Other Devices
* list devices
* select device
* Ignore unsupported fields,
* cleanup
* static
* do not trim before full packet is received,
* fields index reading on edit fix
2022-04-05 11:53:47 +02:00
janek 6d3d6d370b idle task is also a task,
do not create audioMutex for PCBI6X,
back to RTOS_WAIT_MS for i2c
2022-04-04 18:35:06 +02:00
Janek bcfde29ca2 i2c final adjustments, (#223)
aux serial gpio speed,
cleanup
2022-04-04 16:14:59 +02:00
Janek 9cd7fd4355 Fix for eeprom (#222) 2022-04-03 19:21:30 +02:00
janek 9e6b96826b do not fail on missing git_tag.txt 2022-04-03 10:32:19 +02:00
janek 359be8240e lcd reduced reset delay is back 2022-04-03 10:32:02 +02:00
janek 5d48391bd9 restored lcd delay 2022-04-03 08:50:51 +02:00
janek d5b9e3f564 git ignore git_tag.txt,
renamed define
2022-04-02 20:24:50 +02:00
Janek 2d2537a379 Missing git commit sha fix (#221)
* Missing git commit sha fix

* remove new line

* remove new line v2

* added commit sha to all builds
2022-04-02 17:48:35 +02:00
janek ccc2599c11 Cleanup
Init backlight only once
2022-04-02 15:24:29 +02:00
janek e266d1cf3f non negative splash 2022-04-01 12:00:57 +02:00
janek 3e4e396ef8 LCD wait is too long 2022-04-01 11:59:07 +02:00
Janek 6b27d7140b Watchdog (#220)
* Restored original heartbeat (pulses) related watchdog reset.
* Fixed watchdogSuspend was ignored.
* Changed heartbeat condition.
2022-03-31 20:53:29 +02:00
Janek 6524524cd6 reduced usb reboots count? (#219)
* reduced usb reboots count?
2022-03-30 21:21:27 +02:00
janek 38259e2b8e Cleanup 2022-03-29 18:39:06 +02:00
janek 533d587df6 Use same I2C config values as erfly6 2022-03-29 18:38:09 +02:00
Janek 70659d1bbd Completely removes the macro MOVE_CURSOR_FROM_HERE() which was for AVR (backport #6880) (#217) 2022-03-24 19:05:01 +01:00
Janek dceea44867 eeprom i2c driver rework (#208)
* ported i2c driver from Taranis
* no paging in read mode - as in eeprom spec
* ACK polling instead of hardcoded wait
* wait for internal block write broken, replaced by hard delay
* removed libopencm3 i2c libs
* gpio speed should be higher
* timeout error handling,
* do not use additional RAM for writes,
2022-03-24 18:32:30 +01:00
Janek 5675b3278e add eeprom write indicator (#216) 2022-03-24 18:14:28 +01:00
janek e80214c318 define fixes 2022-03-23 19:21:02 +01:00
Janek 3f316abb6c elrsv2 sync with elrsv2.lua (#215) 2022-03-21 19:49:28 +01:00
Janek a2ff7a19d1 CRSF ppm center handling (backport #7870) (#214) 2022-03-21 17:58:47 +01:00
Janek 7f6b307404 set storageDirty for changed jitter filter and serial mode (#211)
set storageDirty for added telemetry sensor (backport #8887)
2022-03-20 19:01:05 +01:00
Janek bbb1266cc3 Flash space and RAM optimizations (#210) 2022-03-19 01:00:01 +01:00
janek 73be86d09b Tuned elrsV2 buffers again.
Leave "A" instead of completely removing "AUX".
Disable info fields trim.
2022-03-15 18:24:56 +01:00
Janek 66c2eb22d5 Fine-tuned elrsV2 buffers. (#207)
Enabled commit sha on version row.
2022-03-14 21:39:31 +01:00
Janek 2471fb3d25 Prevent reboot on entering info fields. (#205)
Trim info field instead of cmd.
2022-03-12 21:28:46 +01:00
Janek af50c720d1 Properly align data (#203)
Reduce polling interval
2022-03-11 14:11:30 +01:00
Janek 8639796258 USB description size fix (again) (#202)
USB device name update
Small flash saving
2022-03-10 21:22:07 +01:00
Janek 1e8bde309b Do not reserve heap - like on other targets. (#201) 2022-03-10 18:19:28 +01:00
Janek fb428984c7 Trim INFO message name (#200) 2022-03-10 08:12:58 +01:00
Janek 65afc5aeb2 AFHDS2A 16 channel modes menu (#196)
* AFHDS2A 16 channel modes menu

* dynamic channel count

* cosmetics
2022-03-09 11:48:48 +01:00
janek dded11c6a8 Don't init LCD twice. 2022-03-08 22:55:04 +01:00
Janek 5586485708 Fixed navigation and edit issue (backport) (#198)
Closes #146
2022-03-08 21:35:30 +01:00
Janek 0bda125e51 Display flight modes like on Taranis (#197) 2022-03-08 20:31:54 +01:00
Wilhelm b71fd642e4 SBus16/IBus16 (#173)
* first try for sbus16

* next try on sbus16/ibus16

* cosmetics

* improved full ibus18 code

* reverted to use MAX_OUTPUT_CHANNELS=16 even for AFHDS2A_CHANNELS>16
2022-03-08 14:19:42 +01:00
Janek e4b406f3f2 Move Factory reset to radio hardware menu (#195)
Smaller font for radio version
2022-03-08 13:07:25 +01:00
Janek a13ad9f98e minor backports: (#194)
- throttle warn,
- ext module power bug,
- statistics screen font,
- NULL -> nullptr
2022-03-08 10:06:32 +01:00
Janek d246865130 Reduced ELRSV2 size by another 48 bytes (#191) 2022-03-06 12:05:03 +01:00
janek 87181c9fff too long telemetry warning + minor backports 2022-03-05 23:49:21 +01:00
Janek 6301acecd0 Menus order and minor backport (#190) 2022-03-05 23:03:47 +01:00
Janek 7997b97fc0 Menu refactor + batt calibration fix (#188)
Menu refactor
- redone battery voltage measurement
- moved calibation to hardware page
- moved diag analogs and keys to hardware page (disabled)
2022-03-05 20:13:58 +01:00
Janek e9e4f4cec4 Fixed an issue where moving right in model menu will skip second tab (#189) 2022-03-05 16:59:46 +01:00
janek 603172faba labels fix 2022-03-05 09:22:43 +01:00
Janek 0616ee16d5 Navigate back on long press BIND button. (#187)
Navigate back on long press BIND button.
Disable POT2 navigation.
2022-03-04 21:33:01 +01:00
Janek 60ef33b13c Fixed CZ translations (#186) 2022-03-04 18:32:09 +01:00
Janek 8b17eb6922 Default to percent display (#179) 2022-03-01 18:29:15 +01:00
Janek 91b4cd800c ExpressLRS V3.0 Support (#140)
* Reduced elrsv2 size.
* Don't store hidden field names.
* Skip hidden field support.
* don't leave line for field without a name
* reuse fieldData buffer for commandMessage,
* backport warning timeout reset on flags change
* Trim only command names
* new lcd_Warn backport
* reduce chunks buffer usage
* Load only current folder into buffers.
* Rearrange buffers to reduce RAM usage.
* increased fieldData buffer
* Replaced sprintf with custom implementation.
* Skip unsupported field type.
2022-03-01 17:38:04 +01:00
Janek 546145bdf7 unify telemetry sensors at 26 for all builds to keep the same eeprom version (#175) 2022-02-27 11:35:08 +01:00
Janek e290b6bc37 reduce flash usage (#174) 2022-02-27 11:32:39 +01:00
Janek 8c1b3cf7c1 Make injecting LQI optional at any channel in board CMAkeLists.txt (#172) 2022-02-26 12:53:07 +01:00
janek 0eff5958be Merge remote-tracking branch 'origin/master' 2022-02-20 21:20:04 +01:00
Janek efc15cd855 Update README.md 2022-02-20 21:19:44 +01:00
janek e7bc2b24f5 hardware connections image 2022-02-20 21:19:26 +01:00
Janek 216775051b Update README.md
Added hardware connections infographics
2022-02-20 18:38:15 +01:00
janek fa6a2d8375 hardware connections image 2022-02-20 18:34:03 +01:00
Janek ce57cd0a08 Fixed switch warning menu (#164)
Fixed switch warning display
Removed preflight checklist
2022-02-19 08:44:45 +01:00
Janek 308b4c5dc2 Decrease mixer period for USB Joystick mode, increase report rate #8721 (#163) 2022-02-17 17:14:34 +01:00
Janek 4af5b51024 Fixes 5602 Special Functions Inc/Dec Gvar (2.3) #6442 backport (#162) 2022-02-17 16:08:21 +01:00
Janek a225c681ef Move adcRead() to mixer scheduler IRQ to reduce sample jitter #8480 backport (#161) 2022-02-17 16:07:59 +01:00
Janek 6c865775c1 CircleCI requires to upgrade image. (#156) 2022-02-16 19:40:55 +01:00
Janek 3d3859122a Fix chan/mixer view switching #7518 backport (#159) 2022-02-16 19:40:37 +01:00
Janek 0a2c00e92a Battery warning can go down to 3.5V for users with 1S + step-up but with direct batt voltage to adc (#160) 2022-02-16 19:40:17 +01:00
Janek cd110f2bc7 USB fix (#153)
* Increase usb desc to proper size (fuuu...)
Don't enable backlight twice on boot

* init usb before eeprom

* init usb before eeprom
2022-02-15 14:27:45 +01:00
janek b0ff5ac281 updated aux serial mode names 2022-02-04 22:59:54 +01:00
Janek 573564dba5 Merge pull request #149 from OpenI6X/janek/aux-serial-telemetry-mirror
small init fix, removed inversion
2022-02-04 19:20:19 +01:00
janek 5c15d8c0f6 small init fix, removed inversion 2022-02-04 19:19:27 +01:00
Janek 61d3304888 Merge pull request #148 from OpenI6X/janek/aux-serial-telemetry-mirror
Aux serial S-Port mirror
2022-02-04 19:10:57 +01:00
janek 584dfebe08 small init fix, removed inversion 2022-02-04 19:08:16 +01:00
janek 8c02feabf9 aux serial crossfire telemetry inversion 2022-02-02 21:57:35 +01:00
janek c245116abc crossfire telemetry mirror backport 2022-02-02 10:55:08 +01:00
janek eb547df41a Aux serial S-Port mirror
Aux serial backports
2022-02-01 21:10:53 +01:00
Janek 8d92bc2eb4 Update README.md 2022-01-31 20:54:27 +01:00
Janek 11f6ac1750 Merge pull request #147 from OpenI6X/janek/eeprom-write-delay
Eeprom use default 2s delay
2022-01-31 19:31:57 +01:00
janek d0cb395307 Eeprom use default 2s delay 2022-01-31 19:13:02 +01:00
Janek 0b39f768e1 Merge pull request #144 from OpenI6X/janek/cosmetics-backport-6512
Cosmetics_(#6512) (saves flash)
2022-01-31 18:44:58 +01:00
Janek 91b2771f04 Merge pull request #143 from OpenI6X/janek/ram-saved-backport
128_bytes_RAM_saved (backport)
2022-01-29 09:18:07 +01:00
janek 174dd0411f Cosmetics_(#6512) (saves flash) 2022-01-29 09:17:31 +01:00
janek b09dfc3ae8 128_bytes_RAM_saved (backport) 2022-01-28 17:30:31 +01:00
Janek 62fa9bf88a Merge pull request #137 from OpenI6X/janek/write-delay
Reduce eeprom write delay to 3s
2022-01-22 11:30:20 +01:00
janek 9533fb2031 Reduce eeprom write delay to 3s
Minor backports
2022-01-22 11:28:12 +01:00
Janek 9911be0aba Merge pull request #136 from OpenI6X/janek/gauges-cleaner-look
Do not display too many horizontals (backport #7854)
2022-01-19 12:34:33 +01:00
ajjjjjjjj 3c1de930f4 Do not display too many horintals (backport #7854) 2022-01-19 12:33:26 +01:00
Janek f311667271 Merge pull request #135 from OpenI6X/janek/version-bump
Version bump
2022-01-18 20:33:15 +01:00
ajjjjjjjj 1667d67b65 Version bump 2022-01-18 20:31:38 +01:00
Janek 388116a73e Merge pull request #134 from OpenI6X/janek/version-bump
Version bump
2022-01-18 20:31:12 +01:00
ajjjjjjjj 46d4f67080 Version bump 2022-01-18 20:06:53 +01:00
Janek f353f661e5 Merge pull request #133 from OpenI6X/janek/sticks-view
Only 2 pots so display sticks like on Taranis
2022-01-18 19:32:31 +01:00
ajjjjjjjj 57522773f1 Only 2 pots so display sticks like on taranis 2022-01-18 19:31:36 +01:00
Janek 0e6ba30aa8 Merge pull request #132 from OpenI6X/janek/channels-mixers-monitor
Full screen channels & mixers monitor
2022-01-18 18:11:09 +01:00
Janek 5fdca53e83 Merge pull request #127 from OpenI6X/jnek/key-driver-fix
Switch state was invalid for edge values.
2022-01-18 18:10:33 +01:00
ajjjjjjjj b1b8951df2 ELRSV2 should cleanup after itself otherwise reusableBuffer data maybe broken 2022-01-18 18:08:03 +01:00
ajjjjjjjj 634f6ec6b8 duplicated entry 2022-01-18 12:26:10 +01:00
ajjjjjjjj ba3c530889 Full screen channels & mixers monitor (backport)
Timers display fixes (backport)
Disabled MENU_DIAGKEYS for elrsv2 build
2022-01-18 12:23:36 +01:00
ajjjjjjjj b18f1f5de0 New str definition fix 2022-01-18 12:22:00 +01:00
ajjjjjjjj 39d5901abd Preparation for custom popups (backport) 2022-01-18 12:21:42 +01:00
Janek 586b3b8fb6 Merge pull request #128 from tmcadam/fixed_afhds2a_subtype_selection
modified conditionals for afhds2a subtype selection
2022-01-16 12:59:28 +01:00
Tom McAdam c3096c22bc modified conditionals for afhds2a subtype selection 2022-01-16 21:34:42 +10:00
Janek 9371aca098 Merge pull request #126 from OpenI6X/janek/ext-module-power-down
Power down external module on soft shutdown.
2022-01-16 10:16:53 +01:00
ajjjjjjjj d1b0c3674d Switch state was invalid for edge values.
Code refactor.
2022-01-15 21:59:25 +01:00
ajjjjjjjj f3ead55347 Switch state was invalid for edge values.
Code refactor.
2022-01-15 20:10:53 +01:00
ajjjjjjjj bb26df472d Power down external module on soft shutdown. 2022-01-15 19:31:12 +01:00
Janek 3e15ec9dcd Merge pull request #123 from OpenI6X/janek/trims-read-fix
Fixed trims reading in functions
2022-01-14 20:31:48 +01:00
ajjjjjjjj b68bb52971 Fixed trims reading in functions 2022-01-14 20:30:37 +01:00
Janek 84d4443f18 Update README.md 2022-01-13 18:00:51 +01:00
Janek 3ef02803d4 Merge pull request #122 from OpenI6X/janek/play-tone-repeat
Added repeat implementation for play tone.
2022-01-13 17:57:00 +01:00
ajjjjjjjj c7029ca136 Added repeat implementation for play tone. 2022-01-13 17:37:04 +01:00
Janek efa36713fa Merge pull request #118 from OpenI6X/janek/diagkeys-and-cleanup
Enable menu_diagkeys back, there is enough space at this  point.
2022-01-09 11:57:23 +01:00
ajjjjjjjj b9e9ee394d Enable menu_diagkeys back, there is enough space at this point.
General and USB cleanup.
2022-01-08 12:07:36 +01:00
Janek b5377a16bc Merge pull request #117 from OpenI6X/janek/pwr-trigger-btn
Power key trigger should be time related
2022-01-08 10:29:25 +01:00
ajjjjjjjj 176015d5b3 Power key trigger should be time related
closes #103
2022-01-07 21:42:23 +01:00
ajjjjjjjj 59c06d0f23 Power key trigger should be time related
closes #103
2022-01-07 21:37:57 +01:00
Janek 4550b16512 Update README.md 2022-01-07 10:47:03 +01:00
Janek bf8d42b3f5 Update README.md
Added Rakish Rc YT channel.
2022-01-06 16:16:42 +01:00
Janek 7700b280d9 Update README.md 2022-01-06 13:59:56 +01:00
Janek bfc40c406c Update README.md 2022-01-06 13:55:58 +01:00
ajjjjjjjj 9df252490e separated lua api port from main code 2022-01-06 11:58:39 +01:00
Janek 244d6c041e Merge pull request #116 from OpenI6X/janek/backport-7160-and-others
backport #7160 and logical switch fix backport
2022-01-06 09:50:39 +01:00
ajjjjjjjj 3a345eb5c2 backport #7160 and logical switch fix backport
popup naming backport
2022-01-06 09:50:03 +01:00
Janek 14bf19bd78 Merge pull request #114 from OpenI6X/janek/aetr
Default to AETR
2022-01-06 02:14:54 +01:00
Janek cad8df9a6a Merge pull request #115 from OpenI6X/janek-usb-cdc
USB CDC improvements (still broken)
2022-01-06 01:51:54 +01:00
ajjjjjjjj 777e75af23 backport #7160 and logical switch fix backport
popup naming backport
2022-01-06 01:49:19 +01:00
ajjjjjjjj 6d2780065f Default to AETR 2022-01-06 01:46:52 +01:00
ajjjjjjjj 3b0c363c11 USB CDC improvements (still broken) 2022-01-06 01:43:22 +01:00
Janek aa03c7de44 Merge pull request #113 from OpenI6X/janek/flash-space
Flash space & key gpio config
2022-01-05 16:56:17 +01:00
Janek 15da9219f7 Merge pull request #112 from OpenI6X/janek/backport-7444
Backport: Radio tools related fixes (#7444)
2022-01-05 14:54:53 +01:00
ajjjjjjjj 4a38181a70 Flash space optimization 2022-01-05 14:53:29 +01:00
ajjjjjjjj 4f8b6dc2ad Flash space optimization
Minor keys config fix
2022-01-05 14:36:01 +01:00
ajjjjjjjj def148df15 Backport: Radio tools related fixes (#7444) 2022-01-05 14:34:05 +01:00
Janek 14f45cbe12 Merge pull request #111 from OpenI6X/janek/eeprom-219
EEPROM version bump to force factory reset
2022-01-04 20:13:51 +01:00
ajjjjjjjj 48d753809d Eeprom version bump to force factory reset 2022-01-04 19:45:52 +01:00
Janek f7e264001e Merge pull request #110 from OpenI6X/janek/elrsv2-next-reboot-fix
Fixed next elrsv2 reboot issue
2022-01-04 18:29:41 +01:00
Janek 4328367155 Merge pull request #109 from OpenI6X/janek/cleanup
General cleanup and flash size optimization.
2022-01-04 18:29:31 +01:00
ajjjjjjjj d609a52ca2 General cleanup and flash size optimization. 2022-01-04 18:26:19 +01:00
ajjjjjjjj 49ca6f737d Fixed next elrsv2 reboot issue 2022-01-04 18:22:22 +01:00
Janek 21bdc20906 Merge pull request #105 from OpenI6X/janek/model-powered-power-off
Remove model still powered popup for PCBI6X. Fixes soft shutdown issue.
2022-01-04 08:49:17 +01:00
ajjjjjjjj ad9b4ca68a Remove model still powered popup for PCBI6X 2022-01-03 14:56:39 +01:00
ajjjjjjjj 0b7962c6e4 bump version 2022-01-03 13:01:06 +01:00
ajjjjjjjj 2d6c37c622 Updated build names and bump version 2022-01-03 12:55:53 +01:00
ajjjjjjjj aee793fb4d Fixed vario unpleasant buzz
Simplified CMakeLists rule
Remove gvars from build names
26 telemetry slots for elrsv2 build
2022-01-03 12:46:42 +01:00
Janek 304f765e58 Merge pull request #101 from OpenI6X/janek/gvars-elrsv2
Added GVARS to ELRSV2 build (now fits!)
2021-12-30 08:19:37 +01:00
Janek a295625e58 Merge pull request #100 from OpenI6X/janek/translations-de
Updated DE translations and EN translations cleanup
2021-12-30 08:17:32 +01:00
Janek 7c0fa35317 Merge pull request #102 from OpenI6X/janek/nicer-size-report
Even nicer size report
2021-12-29 22:19:11 +01:00
ajjjjjjjj 3d9e38c8c8 Even nicer size report 2021-12-29 22:17:50 +01:00
ajjjjjjjj b786fa86b2 Removed unused XXLSIZE font
Added GVARS to ELRSV2 build (now fits!)
Optimized ELRSV2 for size once again.
Make ELRSV2 idle update as fas as other menus
Hide Storage mode in options when not available
Removed frsky splash
2021-12-29 22:14:59 +01:00
ajjjjjjjj a3c7c142cf Updated DE translations and EN translations cleanup 2021-12-29 21:51:53 +01:00
Janek 347dc02c18 Update README.md 2021-12-29 21:25:42 +01:00
Janek 72b14cbef6 Update README.md 2021-12-29 19:20:44 +01:00
Janek ebee8ea729 Update README.md 2021-12-29 19:19:51 +01:00
Janek e51da758ea Update README.md 2021-12-29 19:14:04 +01:00
Janek c855760b38 Update README.md 2021-12-29 19:13:06 +01:00
Janek a982ffb7a7 Update README.md 2021-12-29 19:07:33 +01:00
Janek 5dc00608dc Update README.md 2021-12-29 19:02:21 +01:00
Janek 89353eda6a Update README.md
badges
2021-12-29 19:01:36 +01:00
Janek 456ec40959 Update README.md 2021-12-28 22:15:04 +01:00
Janek ad1194671a Merge pull request #99 from OpenI6X/janek/logical-switch-fix
Fixed clear action
2021-12-28 20:23:00 +01:00
ajjjjjjjj 594f9facbe Removed logical switches clipboard actions
Fixed clear action
2021-12-28 20:21:26 +01:00
Janek 89be9a6ff8 Merge pull request #98 from OpenI6X/janek/ext-module-pwr
Fixed external module power on PC9
2021-12-28 20:09:56 +01:00
ajjjjjjjj 5e1499e8d0 Fixed external module power on PC9 2021-12-28 20:04:00 +01:00
Janek b4138515d2 Merge pull request #96 from OpenI6X/janek/ci-improvements
CI build only on master
2021-12-26 19:43:13 +01:00
Janek 66cb7791a0 Merge pull request #97 from OpenI6X/janek/nice-size-report
Nice size report
2021-12-26 19:42:37 +01:00
ajjjjjjjj 52d8654ad2 Nice size report 2021-12-26 19:41:03 +01:00
ajjjjjjjj c0e50bc767 CI build only on master
single point of version entry
2021-12-26 19:12:45 +01:00
ajjjjjjjj 15ccf61ae7 CI improvements 2021-12-26 19:08:28 +01:00
ajjjjjjjj 3fab9104c3 CI build only on master
single point of version entry
2021-12-26 19:02:57 +01:00
Janek a7e611b054 Merge pull request #93 from OpenI6X/janek/circleci-bump-version
bump version on CI
2021-12-26 13:26:35 +01:00
ajjjjjjjj 4fe1c16b91 bump version on CI 2021-12-26 13:23:39 +01:00
Janek 82f949ee48 Merge pull request #92 from OpenI6X/janek/elrsv2-reboot-fix
ExpressLRS V2 popup reboot fix
2021-12-26 13:15:03 +01:00
ajjjjjjjj 083ae4127b Fixed ExpressLRS V2 popup reboot issue + code density optimizations
Use board name as boot debug name
Version 1.1.1
2021-12-26 13:07:56 +01:00
Janek ded430d4a1 Merge pull request #88 from OpenI6X/janek/eeprom-100k
EEPROM back to 100k
2021-12-22 21:20:59 +01:00
ajjjjjjjj ac519245bb - EEPROM back to 100k
- reverted task count 3 -> 2
2021-12-22 21:18:17 +01:00
Janek eb81636337 Merge pull request #87 from OpenI6X/janek/i6x-elrs
Correct name + ELRSV2 screen update rate
2021-12-22 20:45:40 +01:00
Janek c0d64ace98 Merge pull request #86 from OpenI6X/janek/blank-screen-fix
Blank screen fix
2021-12-22 20:45:21 +01:00
ajjjjjjjj 82f787e889 - Use correct name according to FlySky website - i6X instead of I6X.
- Faster update ELRSV2 screen when idle.
2021-12-22 20:38:03 +01:00
ajjjjjjjj 3a67e84c41 Blank screen fix 2021-12-22 20:35:52 +01:00
Janek 706daf27ad Merge pull request #81 from OpenI6X/janek/1.1
OpenI6X 1.1 - to make it short
2021-12-19 16:02:46 +01:00
ajjjjjjjj cd954a4316 Fixed custom func regression 2021-12-19 15:48:08 +01:00
ajjjjjjjj 9a19975fec Fixed many reboot issues.
Fixed mixer scheduler regression.
Fixed and optimized lcd driver.
Reduced RTOS task max count.
Increased telemetry slots count.
ExpressLRS V2.0 - better mimic ELRSV2.lua, fixed minor issues.
Updated button and USB modes labels.
Reduced FLASH and RAM usage.
Renamed PCBI^ to PCBI6X to reduce confussion.
Use OpenI6X branding and valid version.
Code cleanup.
2021-12-19 15:34:12 +01:00
Janek 0c59088b2f Update README.md 2021-12-16 06:58:52 +01:00
Janek 808bb43149 Update README.md 2021-12-16 06:54:04 +01:00
Janek 10e89bcb21 Update README.md 2021-12-14 14:21:30 +01:00
Mariano Dupont 11a01b7910 Disabled GVAR on ELRSv2 version as it doesn't fit 2021-12-14 09:30:59 -03:00
Mariano Dupont 1bb564eadf Removed GVARS flag override 2021-12-14 09:26:07 -03:00
Mariano Dupont b0b0117185 Merge branch 'master' of github.com:marianomd/opentx 2021-12-14 08:17:29 -03:00
Mariano Dupont 30b418fd5d Added GVARS to elrsv2 version 2021-12-14 08:17:16 -03:00
Mariano Dupont 1625d58d00 Update README.md 2021-12-13 21:26:09 -03:00
Mariano Dupont 1368f19f23 Update README.md 2021-12-13 21:25:31 -03:00
Mariano Dupont 09e3a81479 Making a backup with stm32cubeprogrammer 2021-12-13 21:16:58 -03:00
Mariano Dupont 9889681c93 smaller jpg 2021-12-13 20:59:25 -03:00
Mariano Dupont 3702f67c9f Merge branch 'master' of github.com:marianomd/opentx 2021-12-13 20:54:45 -03:00
Mariano Dupont 32ea418841 DFU pinout 2021-12-13 20:54:31 -03:00
Janek e7678f0dff Merge pull request #79 from OpenI6X/janek/mega-baud-lower
Removed 3.75M Mega baud rate, improved OK label
2021-12-13 21:48:22 +01:00
Janek 74050d1f9a Update README.md 2021-12-13 21:41:46 +01:00
Janek 1b9d302f9c Update README.md 2021-12-13 21:40:21 +01:00
ajjjjjjjj 423cef3384 Removed 3.75M Mega baud rate, improved label 2021-12-13 21:32:12 +01:00
Mariano Dupont f1657bf059 Update README.md 2021-12-13 17:19:35 -03:00
Mariano Dupont 8635906ec2 Merge pull request #78 from OpenI6X/2.3_M0
Back to 16 channels. Main view channels paging fixed.
2021-12-13 17:15:18 -03:00
Mariano Dupont 1675fa1b96 Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-12-13 17:12:49 -03:00
Mariano Dupont ac7210c92d Back to 16 channels. Main view channels paging fixed. 2021-12-13 17:12:29 -03:00
Mariano Dupont fecb71a50c Merge pull request #77 from OpenI6X/ppm-in
Implements PPM IN. Fixes PPM protocol selection after using CRSF.
2021-12-13 17:04:41 -03:00
Mariano Dupont 1e40235bc4 Merge remote-tracking branch 'origin/2.3_M0' into ppm-in 2021-12-13 17:03:50 -03:00
Janek 556595fa84 Merge pull request #75 from OpenI6X/circleci-project-setup
Circleci project setup
2021-12-13 20:49:11 +01:00
Mariano Dupont 156a90302a Merge remote-tracking branch 'origin/2.3_M0' into ppm-in 2021-12-13 15:06:37 -03:00
Mariano Dupont d7a1f59cdb PPM in working. PPM - CRSF switching fixed 2021-12-13 15:05:36 -03:00
Janek 842c8b417b Merge pull request #76 from OpenI6X/janek/elrsv2-stability
ExpressELRS V2 stability fixes
2021-12-13 17:54:40 +01:00
ajjjjjjjj 567f312c5f Stability fixes, play nice with USB mass storage. 2021-12-13 17:42:21 +01:00
ajjjjjjjj a6da50aa1c Stability fixes, play nice with USB mass storage. 2021-12-13 14:54:07 +01:00
Mariano Dupont 35bebc9bbd wip 2021-12-13 00:40:30 -03:00
Mariano Dupont cfd5a8bb64 Merge remote-tracking branch 'origin/2.3_M0' into ppm-in 2021-12-12 19:15:05 -03:00
Mariano Dupont 8443a05152 wip 2021-12-12 19:11:34 -03:00
Mariano Dupont 419929f5a6 wip 2021-12-12 18:08:03 -03:00
ajjjjjjjj 511e34a025 CircleCI multiple pipelines attempt 2021-12-12 14:25:05 +01:00
ajjjjjjjj 35fda853ae CircleCI multiple pipelines attempt 2021-12-12 14:18:32 +01:00
ajjjjjjjj 03a8b68011 CircleCI multiple pipelines attempt 2021-12-12 14:13:02 +01:00
ajjjjjjjj 1715725d3e CircleCI multiple pipelines attempt 2021-12-12 14:11:49 +01:00
ajjjjjjjj 273cc54189 CircleCI multiple pipelines attempt 2021-12-12 14:05:16 +01:00
ajjjjjjjj d01288a73d CircleCI multiple pipelines attempt 2021-12-12 13:59:38 +01:00
ajjjjjjjj aac4957fc4 CircleCI multiple pipelines attempt 2021-12-12 13:56:41 +01:00
ajjjjjjjj 9214909d36 CircleCI multiple pipelines attempt 2021-12-12 13:53:52 +01:00
ajjjjjjjj 642a453fbf CircleCI multiple pipelines attempt 2021-12-12 13:51:13 +01:00
ajjjjjjjj 8ee824e02d CircleCI multiple pipelines attempt 2021-12-12 13:47:56 +01:00
ajjjjjjjj 0263691084 CircleCI multiple pipelines attempt 2021-12-12 13:45:20 +01:00
ajjjjjjjj 1ed1225123 CircleCI multiple pipelines attempt 2021-12-12 13:43:00 +01:00
ajjjjjjjj d36b177d20 CircleCI multiple pipelines attempt 2021-12-12 13:36:55 +01:00
ajjjjjjjj e009b88261 CircleCI multiple pipelines attempt 2021-12-12 13:32:32 +01:00
ajjjjjjjj 6e33f777bb CircleCI multiple pipelines attempt 2021-12-12 13:28:15 +01:00
ajjjjjjjj 7b371203ae CircleCI multiple pipelines attempt 2021-12-12 13:20:20 +01:00
ajjjjjjjj 7297bc8c21 CircleCI multiple pipelines attempt 2021-12-12 13:15:28 +01:00
ajjjjjjjj 572d585571 CircleCI multiple pipelines attempt 2021-12-12 13:10:01 +01:00
ajjjjjjjj 6f54bb3142 CircleCI multiple pipelines attempt 2021-12-12 13:05:45 +01:00
ajjjjjjjj 4df2f462e6 CircleCI multiple pipelines attempt 2021-12-12 13:02:47 +01:00
ajjjjjjjj 893b31e9ea CircleCI multiple pipelines attempt 2021-12-12 12:58:18 +01:00
ajjjjjjjj 726c33bbd6 CircleCI multiple pipelines attempt 2021-12-12 12:52:50 +01:00
ajjjjjjjj 7ab6edd608 CircleCI multiple pipelines attempt 2021-12-12 12:52:09 +01:00
ajjjjjjjj c921404082 CircleCI multiple pipelines attempt 2021-12-12 12:49:36 +01:00
ajjjjjjjj 5d9c549776 CircleCI multiple pipelines attempt 2021-12-12 12:47:55 +01:00
ajjjjjjjj 3711ac7376 CircleCI multiple pipelines attempt 2021-12-12 12:38:56 +01:00
ajjjjjjjj 8861f9169b CircleCI multiple pipelines attempt 2021-12-12 12:34:59 +01:00
ajjjjjjjj 1c69edf85e CircleCI multiple pipelines attempt 2021-12-12 12:32:02 +01:00
ajjjjjjjj 77b652ca53 CircleCI multiple pipelines attempt 2021-12-12 12:31:01 +01:00
ajjjjjjjj 7268d0036b CircleCI multiple pipelines attempt 2021-12-12 12:28:27 +01:00
ajjjjjjjj 5feae54108 CircleCI multiple pipelines attempt 2021-12-12 12:22:28 +01:00
ajjjjjjjj ad602d8316 CircleCI multiple pipelines attempt 2021-12-12 11:50:16 +01:00
ajjjjjjjj e61776f642 CircleCI multiple pipelines attempt 2021-12-12 11:44:15 +01:00
ajjjjjjjj 4a101b6d28 CircleCI multiple pipelines attempt 2021-12-12 11:41:11 +01:00
ajjjjjjjj 9d1f1b1048 CircleCI multiple pipelines attempt 2021-12-12 11:36:59 +01:00
ajjjjjjjj 2b9630f869 CircleCI multiple pipelines attempt 2021-12-12 11:24:47 +01:00
ajjjjjjjj 1fcb0d524b CircleCI multiple pipelines attempt 2021-12-12 11:18:35 +01:00
ajjjjjjjj d29e48f9dd CircleCI multiple pipelines attempt 2021-12-12 11:15:32 +01:00
ajjjjjjjj 3cfcde5e53 CircleCI multiple pipelines attempt 2021-12-12 11:06:42 +01:00
ajjjjjjjj d0de86c8e4 CircleCI multiple pipelines attempt 2021-12-12 11:01:20 +01:00
ajjjjjjjj afb2d86560 CircleCI multiple pipelines attempt 2021-12-12 10:53:54 +01:00
ajjjjjjjj d1bed1f9dc CircleCI multiple pipelines attempt 2021-12-12 10:23:32 +01:00
ajjjjjjjj 0865041adb CircleCI multiple pipelines attempt 2021-12-12 10:21:17 +01:00
ajjjjjjjj 0dcba3c680 CircleCI multiple pipelines attempt 2021-12-12 10:04:47 +01:00
ajjjjjjjj 2e3025a07c CircleCI multiple pipelines attempt 2021-12-12 10:01:27 +01:00
ajjjjjjjj 20e1d81386 CircleCI multiple pipelines attempt 2021-12-12 09:56:05 +01:00
ajjjjjjjj e1b3711d88 CircleCI multiple pipelines attempt 2021-12-12 09:55:51 +01:00
ajjjjjjjj 7b38157c6e Merge branch 'circleci-project-setup' of https://github.com/OpenI6X/opentx into circleci-project-setup
 Conflicts:
	.circleci/config.yml
2021-12-12 09:52:06 +01:00
ajjjjjjjj 2528e51d29 CircleCI multiple pipelines attempt 2021-12-12 09:50:45 +01:00
Mariano Dupont abdf507c2e Updated config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont cb712ef60d Updated config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont b3fd84e6c2 Updated config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont 6e99ccb07d Updated config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont 6ebd36b1aa Add .circleci/config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont d95a22c873 Add .circleci/config.yml 2021-12-12 09:47:00 +01:00
Mariano Dupont 7f10734457 Add .circleci/config.yml 2021-12-12 09:47:00 +01:00
Janek 89786a000c Merge pull request #74 from OpenI6X/janek/backport-renames-avr-cleanup
Backported refactored names and AVR legacies.
2021-12-12 09:38:20 +01:00
Janek cb9a8c12ed Merge pull request #73 from OpenI6X/janek/button-names
Use FS-i6X button names
2021-12-12 09:37:26 +01:00
Mariano Dupont 3c7931665b Reverted backlight not turning on when moving sticks or switches 2021-12-11 20:38:21 -03:00
ajjjjjjjj 7a7e4a0e93 Backported refactored names and AVR legacies.
Minor ELRSV2 improvement
2021-12-11 22:55:45 +01:00
Mariano Dupont dfa00cfa2b PPM IN wip 2021-12-11 15:45:47 -03:00
ajjjjjjjj 9689a35819 Use FS-i6X button names 2021-12-11 18:05:13 +01:00
ajjjjjjjj 7942f48e75 Use FS-i6X button names 2021-12-11 18:00:19 +01:00
Janek 3ad2328bac Merge pull request #72 from OpenI6X/janek/elrsv2-port
ExpressLRS v2.0 lua menu port.
2021-12-11 17:06:58 +01:00
Janek 7d1f7f23df Merge pull request #71 from OpenI6X/janek/modules-off
Default modules to off backport
2021-12-11 17:06:46 +01:00
Janek a5a803a83f Merge pull request #70 from OpenI6X/janek/baudrate-option-refactor
Baudrate option refactor
2021-12-11 17:06:32 +01:00
Janek 6422d4ed88 Merge pull request #69 from OpenI6X/janek/gvars-display-fix
Display 9 GVARS instead of 10
2021-12-11 17:06:11 +01:00
Janek f3fcd9ddef Merge pull request #68 from OpenI6X/janek/mode-option-accessible
Mode option accessible
2021-12-11 17:06:00 +01:00
Janek b47101666a Merge pull request #67 from OpenI6X/janek/buzzer-cleanup
Buzzer cleanup
2021-12-11 17:05:51 +01:00
Janek 683aaa74cd Merge pull request #66 from OpenI6X/janek/version-page
Fixed version screen layout, no longer broken long press - backport
2021-12-11 17:05:42 +01:00
Janek 85317d52a1 Merge pull request #65 from OpenI6X/janek/eeprom-speed
EEPROM i2c @ 400k
2021-12-11 17:05:20 +01:00
ajjjjjjjj 6b1aef2c7f Backported TOOLS menu.
Backported and customized Gauge widget.
Backported text centering feature.
Added custom CRSF hooks for scripts.
Removed ExpressLRS menu references from core.
Removed previous ExpressLRS menu implementation.
Ported ELRSV2.lua.
Telemetry sensors max at 22 for ELRSV2 builds.
Diagnostic keys screen is now define guarded and removed by default.
Diagnostic analogs screen is now define guarded and removed by default.
2021-12-11 11:11:25 +01:00
ajjjjjjjj 5bda82614c Defaut modules to OFF backport (but do not works for AFHDS) 2021-12-11 11:01:06 +01:00
ajjjjjjjj 6c3527a268 Baudrate option refactor, hide USB CDC in debug, remove hand icon, minor backports 2021-12-11 10:57:15 +01:00
ajjjjjjjj 8d9b3c8cd8 Display 9 GVARS instead of 10 2021-12-11 10:52:04 +01:00
ajjjjjjjj ab1443ce54 Fixed access to setup mode option 2021-12-11 10:31:07 +01:00
ajjjjjjjj a5cfc60e4a Fixed access to setup mode option 2021-12-11 10:28:41 +01:00
ajjjjjjjj 61577db82b Buzzer cleanup to save flash 2021-12-11 10:25:34 +01:00
ajjjjjjjj 09cfec8ed0 Fixed layout, no longer broken long press 2021-12-11 10:22:27 +01:00
ajjjjjjjj a1d703a7dd EEPROM i2c @ 400k 2021-12-11 10:12:45 +01:00
Mariano Dupont c3632b1a89 Updated config.yml 2021-11-24 22:32:07 -03:00
Mariano Dupont 50072ad337 Updated config.yml 2021-11-24 22:05:18 -03:00
Mariano Dupont ebffde6170 Updated config.yml 2021-11-24 22:02:16 -03:00
Mariano Dupont b5d98a03fe Updated config.yml 2021-11-24 21:25:41 -03:00
Mariano Dupont 3cff737064 Add .circleci/config.yml 2021-11-24 21:08:40 -03:00
Mariano Dupont f53a9860c6 Add .circleci/config.yml 2021-11-24 21:06:22 -03:00
Mariano Dupont e8e7a194ca Add .circleci/config.yml 2021-11-24 20:39:01 -03:00
ajjjjjjjj cebb6cf0b0 Merge pull request #57 from OpenI6X/janek/dfu-bootloader
System DFU Bootloader
2021-11-14 14:47:15 +01:00
ajjjjjjjj 75c5588a76 - Start system DFU Bootloader using trims,
- removed few bytes from crc
2021-11-14 13:31:20 +01:00
Mariano Dupont 96f7db2387 Merge pull request #50 from OpenI6X/janek/splash
Added splash image for release builds
2021-11-12 20:55:02 -03:00
ajjjjjjjj 6df7d74e2b Merge pull request #54 from OpenI6X/janek/backlight-maintance
Don't pass fake backlight values (save flash)
2021-11-13 00:34:42 +01:00
ajjjjjjjj 4cadada18a Don't pass fake backlight values (save flash) 2021-11-13 00:29:23 +01:00
ajjjjjjjj 8df70aab80 Update README.md 2021-11-12 22:56:14 +01:00
Janek 2b74737351 Added splash image for release builds 2021-11-12 21:34:17 +01:00
ajjjjjjjj 47fad215d6 Merge pull request #49 from ajjjjjjjj/janek/beep-on-warn
Beep on warning
2021-11-12 11:16:18 +01:00
Janek 64464f186d Beep on warning 2021-11-12 11:15:31 +01:00
ajjjjjjjj 0b01a6a664 Update README.md 2021-11-12 00:33:59 +01:00
ajjjjjjjj 2f1c75268f Update README.md 2021-11-11 23:25:31 +01:00
Mariano Dupont b0158b3a1e Ignore unknown IBUS sensors. 2021-11-11 18:24:59 -03:00
Mariano Dupont b619806d6d Merge pull request #48 from ajjjjjjjj/janek/hardware-crc
Hardware CRC implementation
2021-11-11 18:10:56 -03:00
Janek f6b2f374c4 Hardware CRC implementation.
- 16 times faster than lookup table,
- almost 200b less of flash space occupied
2021-11-11 21:06:33 +01:00
Mariano Dupont 34c40569bd Merge pull request #46 from ajjjjjjjj/janek/crossfire-baudrates
Format baud rates to make it easier to read
2021-11-10 13:37:06 -03:00
Janek 86178e5788 increased write delay 2021-11-10 17:35:28 +01:00
Mariano Dupont 0eb9b1149d Merge pull request #47 from ajjjjjjjj/janek/pot-navigation
Solve POT editing values outside limits.
2021-11-10 13:15:17 -03:00
Janek b7be159a3b Solve POT editing values outside limits.
It's not perfect but at least don't mess up values.
2021-11-10 14:17:43 +01:00
Janek 43c0820686 Format baud rates to make it easier to read 2021-11-10 11:46:19 +01:00
Janek a0bd47e39f Format baud rates to make it easier to read 2021-11-10 11:01:51 +01:00
Janek 63b0b477eb Format baud rates to make it easier to read 2021-11-10 09:29:07 +01:00
ajjjjjjjj 7571d806ad Update README.md 2021-11-09 22:39:46 +01:00
ajjjjjjjj 6e39214f3b Update README.md 2021-11-09 22:39:02 +01:00
Mariano Dupont f4741c88c5 Merge pull request #45 from ajjjjjjjj/janek/crossfire-baudrates
Added faster baud rates.
2021-11-09 18:38:55 -03:00
Janek 768f0e0520 Added faster baudrates, works fine on mine DIY Slimmer 2.4.
Inspired by https://github.com/EdgeTX/edgetx/pull/640
2021-11-09 22:20:46 +01:00
Mariano Dupont 71b1d21656 Further removed AFHDS3 unused code 2021-11-09 10:48:25 -03:00
Mariano Dupont 4fcb545ae6 Bumped telemetry slots to 28. Removed AFHDS3 telemetry ID's. 2021-11-09 10:20:46 -03:00
Mariano Dupont a26f484cb4 AFHDS2A extended telemetry support. 2021-11-08 16:46:07 -03:00
Mariano Dupont 5b4a2f57b9 Merge pull request #43 from ajjjjjjjj/janek/vario-improvements
Implemented vario volume and proper sound priority handling
2021-11-08 13:18:06 -03:00
Mariano Dupont b51b68de45 Merge pull request #42 from ajjjjjjjj/janek/ext-module-power
External module power switch on PC9
2021-11-08 13:17:25 -03:00
ajjjjjjjj 61c1455557 Update README.md 2021-11-07 18:41:33 +01:00
Janek f3c34ae5bc hide volume implementation 2021-11-07 18:34:19 +01:00
Janek 030c798d5c Implemented vario volume and proper sound priority handling 2021-11-07 16:33:12 +01:00
Janek dbaa273b6b Implemented vario volume and proper sound priority handling 2021-11-07 15:29:22 +01:00
Janek 16cf07b91f Init external module power pin 2021-11-07 12:24:06 +01:00
Janek 5b5751dea4 Inline "one liners" to save call overhead and flash space. 2021-11-06 17:24:09 +01:00
Janek 56522adddb External module power switch on PC9 2021-11-06 15:10:18 +01:00
ajjjjjjjj 25753334fc Merge pull request #41 from ajjjjjjjj/janek/usb-msd-fix2
USB MSD - don't zero memory twice
2021-11-05 23:10:34 +01:00
Janek 4369ed5e7a - don't zero memory twice 2021-11-05 23:09:27 +01:00
Mariano Dupont 4e97a3f1ef Merge pull request #40 from ajjjjjjjj/janek/usb-msd-fix
USB MSD improvements
2021-11-05 18:34:16 -03:00
Janek 8ffe4bbbc5 - USB MSD bug fix
- better adjusted for PCBI6
- 100 bytes less
2021-11-05 20:52:33 +01:00
Janek 078a642e1f - USB MSD bug fix
- better adjusted for PCBI6
- 100 bytes less
2021-11-05 19:48:36 +01:00
Mariano Dupont dd1d07cf03 Update README.md 2021-11-05 11:44:04 -03:00
Mariano Dupont 04c7e9c93e Merge pull request #39 from marianomd/crsfshot
CRSFshot (mixer sync) enabled
2021-11-05 11:43:20 -03:00
Mariano Dupont a0bbadba06 Fixed 25Hz mixer sync 2021-11-05 11:31:52 -03:00
Mariano Dupont 124b2b16ec CRSFshot (mixer sync) enabled. Working ok in all rates except 25Hz. 2021-11-04 23:25:45 -03:00
Mariano Dupont 7b60100d18 Merge pull request #38 from ajjjjjjjj/janek/usart-deinit
This is backport from EdgeTX and other OpenTX targets.
2021-11-04 18:40:22 -03:00
Janek ea23f27f43 This is backport from EdgeTX and other OpenTX targets. 2021-11-04 22:07:44 +01:00
Mariano Dupont 080521625e Update README.md 2021-11-04 17:04:40 -03:00
Mariano Dupont 362a2b51ca Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-11-04 10:31:33 -03:00
Mariano Dupont 06056db521 Removed duplicate definition 2021-11-04 10:31:06 -03:00
Mariano Dupont 5d9fae0bc8 Merge pull request #37 from ajjjjjjjj/janek/elrs-fix
ExpressLRS reboot fix
2021-11-04 10:24:57 -03:00
Mariano Dupont 6227d8f19e Merge pull request #36 from ajjjjjjjj/feature/cleanup
Renamed SDCard to Storag(e) to reduce confusion.
2021-11-04 10:24:28 -03:00
Janek 182aea5ef6 Fix for John's errors 2021-11-04 10:38:09 +01:00
Janek 04abf6780c Reset issue fixed on DIY Slimmer TX 2.4 2021-11-04 10:03:35 +01:00
Janek 78c750445f Reset issue fixed on DIY Slimmer TX 2.4 2021-11-04 09:49:19 +01:00
Janek 9e0ee49a73 Seems like less likely to reboot on cold start with deinit.
Shaved almost 100 bytes from elrs script.
Realigned telemetry errors value.
2021-11-03 23:47:40 +01:00
Janek 470617b957 Without this change on DIY Slimmer 2.4 TX i have reboots every 5-30 seconds. With this change I was able to stay online for over 2 hours. 2021-11-03 16:21:24 +01:00
Janek 93db93ccee Renamed SDCard to Storag(e) to reduce confusion.
Minor cleanup
2021-11-03 16:18:09 +01:00
Mariano Dupont a3d00a585d Merge pull request #35 from marianomd/elrs_menu
ExpressLRS v1.x config menu. Still missing: binding mode and web server.
2021-11-02 09:18:13 -03:00
Mariano Dupont b4d7d81bf5 Update README.md 2021-10-31 23:52:04 -03:00
Mariano Dupont 293b497909 Show ELRS version info 2021-10-31 23:17:44 -03:00
Mariano Dupont 28945301c5 ExpressLRS menu working. Still missing: show commitSHA, Enable binding mode, Enable web server. 2021-10-31 19:28:28 -03:00
Mariano Dupont 67ab6689b1 Merge pull request #34 from ajjjjjjjj/janek/pin-configuation
Chaged USB Vbus pin mode
2021-10-29 20:42:48 -03:00
Janek 30086f9ce2 After reading this one looks like more suitable. 2021-10-29 20:20:50 +02:00
Mariano Dupont 2df77e9b82 Merge pull request #33 from ajjjjjjjj/janek/usb
backported #8195
2021-10-28 21:41:35 -03:00
Janek 4475e7c074 backported #8195 2021-10-28 23:45:51 +02:00
ajjjjjjjj 9878630ad3 Merge pull request #32 from ajjjjjjjj/janek/vario
Audio vario improvement
2021-10-28 22:57:27 +02:00
Janek 3a6e18e72c Audio vario improvement 2021-10-28 22:54:55 +02:00
Janek 3292b80269 Audio vario improvement 2021-10-28 22:53:40 +02:00
Mariano Dupont be4ad6ef3d Merge pull request #31 from ajjjjjjjj/janek/sound-handling2
Improved concurrent sounds handling
2021-10-28 09:38:26 -03:00
Janek d0c34e1ca5 Improved concurrent sounds handling 2021-10-28 14:01:39 +02:00
ajjjjjjjj cda10cc2c4 Merge branch 'marianomd:2.3_M0' into 2.3_M0 2021-10-28 13:57:05 +02:00
ajjjjjjjj 34e8e95df4 Update README.md 2021-10-27 21:13:13 +02:00
ajjjjjjjj dce714556e Update README.md 2021-10-27 19:04:55 +02:00
Mariano Dupont ffb4c5d2e0 Update README.md 2021-10-27 09:23:50 -03:00
Mariano Dupont 863c4559dd Merge pull request #29 from ajjjjjjjj/janek/usb-msd-and-detect
Enabled USB MSD Mode
2021-10-27 08:53:28 -03:00
Janek 47357e074a USB Detect is now Auto/Once
USB Detect is not stored and defaults to Auto
Decreased MENU_STACK_SIZE by ~10%
Enabled USB MSD Mode
2021-10-27 13:06:04 +02:00
Janek 84be5a77d8 USB Detect is now Auto/Once
USB Detect is not stored and defaults to Auto
Decreased MENU_STACK_SIZE by ~10%
Enabled USB MSD Mode
2021-10-27 13:05:07 +02:00
ajjjjjjjj df2fba6206 Merge branch 'marianomd:2.3_M0' into 2.3_M0 2021-10-26 22:39:01 +02:00
Mariano Dupont 0340c23cb8 Merge pull request #28 from ajjjjjjjj/janek/usb-msd-switch
added PCBI6_USB_MSD switch when there will be more RAM
2021-10-26 15:54:03 -03:00
Janek 501b97098a added PCBI6_USB_MSD switch when there will be more RAM,
fix I2C_RCC_APB1Periph used twice
2021-10-26 20:23:11 +02:00
Janek 72e0ce885f I2C_RCC_APB1Periph used twice 2021-10-26 20:04:18 +02:00
Mariano Dupont aae495062c Merge pull request #27 from ajjjjjjjj/janek/joystick2
Improved joystick mapping workaround.
2021-10-25 17:59:05 -03:00
Janek 99c3fc1054 Improved joystick mapping workaround. 2021-10-25 21:44:13 +02:00
Mariano Dupont b1c9fe13a8 Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-10-25 16:12:43 -03:00
Mariano Dupont effd281be1 Max sensors lowered to 24 2021-10-25 16:12:28 -03:00
Mariano Dupont 578b26d4d3 Update README.md 2021-10-25 11:51:58 -03:00
Mariano Dupont ae0baa3d3c Merge pull request #26 from ajjjjjjjj/feature/joystick-fix
Joystick fixed
2021-10-24 09:21:38 -03:00
Janek f42d952020 Joystick fixed 2021-10-24 13:27:19 +02:00
Janek 5f0bcf0835 Joystick fixed 2021-10-24 13:17:45 +02:00
Mariano Dupont 71e368d8f0 Merge pull request #25 from ajjjjjjjj/janek/usb-enable
"USB Detect" general menu
2021-10-23 13:26:08 -03:00
Janek b2aa871a0d - added "USB Detect" to general menu with Auotp/On option - auto is USB_Vbus at PA15, On is force on
- restore warning "hand" icon on release builds
2021-10-23 18:19:55 +02:00
Mariano Dupont 0b27b371d7 Merge pull request #24 from ajjjjjjjj/feature/vario
PLAY_BACKGROUND support
2021-10-21 14:00:39 -03:00
Janek 144f71303d - initial PLAY_BACKGROUND support 2021-10-21 18:52:47 +02:00
Mariano Dupont f6259800d0 Merge pull request #23 from ajjjjjjjj/feature/ram-opt
RAM optimizations and disabled USB MSD
2021-10-21 08:50:56 -03:00
Janek 84c0382226 - skip on trimms flood 2021-10-21 12:23:57 +02:00
Janek 3a82c6dedb - skip on trimms flood 2021-10-21 12:21:57 +02:00
Janek b85d22ecb8 - skip on trimms flood 2021-10-21 11:58:37 +02:00
Janek a3071a966e - skip on trimms flood 2021-10-21 11:52:43 +02:00
Janek 2065aea794 - skip on trimms flood 2021-10-21 11:49:33 +02:00
Janek 73826cdbbf - disabled USB MSD,
- reduced overall RAM usage,
- reduced buzzer RAM usage,
- buzzer sounds can be now interleaved!
2021-10-21 11:36:57 +02:00
Mariano Dupont 7c0680bc9a Merge pull request #22 from ajjjjjjjj/feature/bootloader-boot-usb
Bootloader (but disabled) and USB support
2021-10-20 16:10:20 -03:00
Janek 138a224675 - VBUS sense at PA15 2021-10-20 19:57:27 +02:00
Janek da3dc260bf - fix DEBUG builds with enabled USB 2021-10-20 19:33:26 +02:00
Janek b28a906a42 - USB improvements,
- reenabled FIRMWARE.TXT file
2021-10-20 15:20:51 +02:00
Janek f4dd914139 - save USB flash space 2021-10-17 13:43:39 +02:00
Janek 37b465570b - save fat table flash space 2021-10-17 13:32:09 +02:00
Janek 8f3d576ffa - save USB msd fat table flash space 2021-10-17 12:55:13 +02:00
Janek dc55df76cf - backup FIRMWARE.BIN is valid 2021-10-16 23:40:10 +02:00
Janek 816b783225 - removed USB_SERIAL_MODE reduced size by ~200B 2021-10-16 22:10:45 +02:00
Janek e4e8de72e4 - removed About view 2021-10-16 20:44:48 +02:00
Janek a09bfc136f - removed firmware.txt to fit under 16kb 2021-10-16 19:56:39 +02:00
Janek 8064fd1d43 - fixed reading EEPROM.BIN
- refactored i2cInit to better match otx codestyle
- restoring backup works,
- added IFdefs to disable firmware.txt (broken)
2021-10-16 19:33:08 +02:00
Janek 9681b80ffc works:
- bootloader boots main fw,
- main fw properly exposes version,
- USB registers as mass storage with fat FS and reports 3 files,

broken:
- input/output error when accessing files,
2021-10-16 15:27:24 +02:00
Mariano Dupont c7077989a8 Fixed broken telemetry sensors. 2021-10-14 01:03:28 -03:00
Mariano Dupont 5f9c792cd3 Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-10-13 19:44:12 -03:00
Mariano Dupont 2b83eaac4a Increased telemetry sensors to 24. Increase max contrast to 63. Default value a little darker. Fixed typo. 2021-10-13 19:43:23 -03:00
Mariano Dupont fe8674ef6b Update README.md 2021-10-12 20:06:34 -03:00
Mariano Dupont 50414472b9 Update README.md 2021-10-12 20:06:08 -03:00
Mariano Dupont df5b5aea39 Merge pull request #21 from ajjjjjjjj/feature/countdown-voice
Remove "Voice" from countdown options
2021-10-12 17:19:35 -03:00
Janek 9cf815ebd6 Remove "Voice" from countdown options 2021-10-12 20:26:49 +02:00
Mariano Dupont be091818a6 Merge pull request #20 from ajjjjjjjj/feature/timer-countdown
Timer countdown start missing
2021-10-12 14:12:23 -03:00
Janek 2012225307 Timer countdown start missing in 128 (fix #8252)
Upstream #8247 and #8533
Minor cleanup
2021-10-12 16:00:23 +02:00
Mariano Dupont dca30b1830 Merge pull request #19 from ajjjjjjjj/feature/bootloader
Bootloader
2021-10-11 17:38:15 -03:00
Janek dcf3101b17 Bootloader
- commented usbStart() because of freeze,
- fixed menu,
- finding version works if pointed at bootloader addr,
- booting image from another address probably needs some work: https://community.st.com/s/question/0D53W00000trgpiSAA/how-to-boot-to-random-address-without-vecttaboffset-stm32f072

Backlight:
- improved init
2021-10-11 21:56:18 +02:00
Mariano Dupont 2598946891 Merge pull request #18 from ajjjjjjjj/janek/rebranded
Rebranded to OpenI6X ;)
2021-10-07 17:19:49 -03:00
Janek 3a2e1e5ea2 Rebranded to OpenI6X ;) 2021-10-07 22:08:25 +02:00
Mariano Dupont e95ac4639f Merge pull request #17 from ajjjjjjjj/janek/removed-icons-and-text
Recovered ~1.3KB of FLASH space
2021-10-07 16:36:04 -03:00
Janek cd7bd6e99c Recovered ~1.3KB of FLASH space:
- removed about icon and simplified text in about screen,
- removed asterisk icon in popup screens, replaced with "x",
2021-10-07 21:15:50 +02:00
Mariano Dupont ec8f2dba30 No more crashes with CRSF. Now counting real telemetry errors. 2021-10-07 11:06:30 -03:00
Mariano Dupont 6c1fa1953e Added key combination for I6X 2021-10-07 08:05:00 -03:00
Mariano Dupont ac927e63f0 Removed bootloader unnecessary dependencies 2021-10-06 21:14:00 -03:00
Mariano Dupont e9311cde2d Tried to enable CLI but there's not enough RAM nor FLASH. 2021-10-06 20:11:00 -03:00
Mariano Dupont 11b6a8eab9 Merge pull request #16 from ajjjjjjjj/janek/cmakefile-sections-size
Show section sizes after compilation.
2021-10-06 17:53:55 -03:00
Mariano Dupont 1bd2178753 Merge pull request #15 from ajjjjjjjj/feature/buzzer-s2ep9
Buzzer
2021-10-06 17:53:25 -03:00
Mariano Dupont 61b241c1b6 Merge pull request #14 from ajjjjjjjj/feature/flavour-name
Valid build flavour in about page.
2021-10-06 17:51:47 -03:00
Janek b54c232e75 Show section sizes after compilation.
RAM = bss + data
2021-10-06 22:51:35 +02:00
Mariano Dupont 3274e5818c Merge pull request #13 from ajjjjjjjj/feature/ram-savings
Backported Bsongis/ram saving #6685
2021-10-06 17:49:36 -03:00
Janek c17d27fff5 Buzzer
Restored "stock" siren pitch.
Fixed volume once again.
2021-10-06 21:18:47 +02:00
Janek 7b400b7cb8 Valid build flavour in about page. 2021-10-06 21:08:58 +02:00
Janek e722f2accb Backported Bsongis/ram saving #6685
In our case this reclaims 584 bytes of RAM, leaving us with total of 1112 bytes free at the moment.
The most of it is change to MIXER_STACK_SIZE. My basic tests showed no issue so far.
2021-10-06 21:06:03 +02:00
Mariano Dupont d59490c309 Bootloader 2021-10-06 10:56:12 -03:00
Mariano Dupont b5b66f903f Merge pull request #12 from marianomd/crossfire
CRSF support. ExpressLRS (including telemetry) working at 400k bauds.
2021-10-05 00:48:50 -03:00
Mariano Dupont d31275a873 CRSF working. ExpressLRS working. 2021-10-05 00:44:10 -03:00
Mariano Dupont 7aa965eb9c Crossfire support. Random crashes at 115200 baudrate. Continuous crashes at 400000. 2021-10-04 16:38:44 -03:00
Mariano Dupont bd7795d5be Cleanup 2021-10-02 20:26:35 -03:00
Mariano Dupont 6baabd445b EEPROM delay_ms instead of RTOS_WAIT_MS as corruption happens. 2021-10-02 09:30:40 -03:00
Mariano Dupont 033fd635c6 Fixed mixer scheduler 2021-10-01 19:15:50 -03:00
Mariano Dupont c064fa3472 Merge pull request #11 from ajjjjjjjj/feature/coos-fix2
Fixed CoOS Tick for STM32
2021-10-01 17:08:43 -03:00
Janek fb614956bc Fixed CoOS Tick for STM32 2021-10-01 21:08:56 +02:00
Mariano Dupont 71b53f3455 Merge pull request #10 from ajjjjjjjj/feature/coos-tick
Fixed CoOS Tick for STM32
2021-10-01 15:23:16 -03:00
Janek cb393ca5e2 Fixed CoOS Tick for STM32 2021-10-01 20:20:14 +02:00
Mariano Dupont 8ef5ceac41 Update README.md 2021-09-29 22:41:39 -03:00
Mariano Dupont 5764e73a84 Update README.md 2021-09-29 22:34:30 -03:00
Mariano Dupont 23a395c231 Update README.md 2021-09-29 22:33:37 -03:00
Mariano Dupont b748811487 Update README.md 2021-09-29 22:21:44 -03:00
Mariano Dupont 9642c2f6eb Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-09-29 22:18:37 -03:00
Mariano Dupont 1d5e21e577 Internal module can be turned on and off correctly. 2021-09-29 22:18:22 -03:00
Mariano Dupont b400a21c62 Update README.md 2021-09-29 21:18:28 -03:00
Mariano Dupont 9dc49741e6 Merge branch '2.3_M0' of github.com:marianomd/opentx into 2.3_M0 2021-09-29 21:17:06 -03:00
Mariano Dupont bde2cb3630 External module (PPM) can be turned on and off correctly. 2021-09-29 21:16:47 -03:00
Mariano Dupont 6477fa6d8f Merge pull request #9 from ajjjjjjjj/feature/remove-sleep-logo
Sleep logo replaced with "Z Z Z", removes almost 0.5KB
2021-09-29 12:58:54 -03:00
Janek bd553dc9ed Sleep logo replaced with "Z Z Z", removes almost 0.5KB 2021-09-29 17:57:13 +02:00
Mariano Dupont 3c933fbb1c Update README.md 2021-09-29 12:09:45 -03:00
Mariano Dupont 9ed18d443f fix PPM timing 2021-09-29 11:58:26 -03:00
Mariano Dupont d4dcca8fcc Merge pull request #6 from marianomd/ppmout_wip
PPM out wip
2021-09-29 11:41:30 -03:00
Mariano Dupont 0b78fb627e PPM out working 2021-09-29 11:40:48 -03:00
Mariano Dupont 9ebd422aa2 Merge pull request #8 from ajjjjjjjj/feature/menu-final-touch
Menu hopefully done.
2021-09-28 20:33:30 -03:00
Janek 8c21f88ac0 - Removed [SD Logs] 2021-09-28 19:42:32 +02:00
Janek dc06b9f6bc - Removed unused functions from special function. In effect shaved off around 200 bytes. I have left [SD Logs] for now.
- Special function "Beep" is now "Play tone"
- fixed div / 3
2021-09-28 18:31:48 +02:00
Mariano Dupont e9072f6b76 Merge pull request #7 from ajjjjjjjj/feateure/main-menu
Removed blanks from Radio setup and optimized playTone routine.
2021-09-27 09:58:23 -03:00
Janek 74669077d4 Removed blanks from Radio setup.
Removed division from playTone routine.
2021-09-27 11:28:46 +02:00
Mariano Dupont 895213c01e PPM out: Fix pulses data 2021-09-26 14:17:58 -03:00
Mariano Dupont 18fa309d92 PPM out wip 2021-09-26 10:44:42 -03:00
Mariano Dupont 82035de603 Merge pull request #5 from ajjjjjjjj/feature/custom-telemetry-sounds
Fixed inactivity alarm, added custom telemetry sounds, improved settings
2021-09-26 10:41:44 -03:00
Janek 2bba3bfe71 Removed unused options from main menu, added pitch and length options 2021-09-26 15:25:37 +02:00
Janek 0bbc64d382 Changed tone 2021-09-26 13:43:31 +02:00
Janek 194d226903 Added board switch to do not break upstream 2021-09-26 09:32:12 +02:00
Janek 3583857225 Added custom telemetry sounds.
Fixed inactivity alarm.
2021-09-26 09:20:39 +02:00
Mariano Dupont 2a3e8a69d8 Update README.md 2021-09-25 20:07:58 -03:00
Mariano Dupont 09cc92fbea Merge pull request #4 from ajjjjjjjj/feature/alarms
Fixed battery and telemetry alarms.
2021-09-25 19:49:14 -03:00
Mariano Dupont 0b19e19ce7 Merge pull request #3 from ajjjjjjjj/feature/buzzer-tune
Buzzer improvements
2021-09-25 19:49:01 -03:00
Janek 16dea9fd3e Fixed battery and telemetry alarms. 2021-09-26 00:12:17 +02:00
Janek 7409b8621b Fine tuned volume steps.
Rearanged and remove traces to take less cycles.
Fixed queueing logic.
2021-09-25 23:23:11 +02:00
Mariano Dupont 0f5dad4dd5 Merge pull request #2 from ajjjjjjjj/feature/buzzer-tones
Playing tones implementation for buzzer driver
2021-09-25 15:58:36 -03:00
Janek 3561c2541a Added support for PLAY_NOW flag, prevents sound lags 2021-09-25 20:17:21 +02:00
Janek 9a5d12edab typo 2021-09-25 20:02:17 +02:00
Janek 9e35258da1 Fixed missing clock enable for GPIOA on release builds 2021-09-25 19:50:24 +02:00
Janek bdf6af5ae4 Playing tones implementation for buzzer driver 2021-09-25 18:42:58 +02:00
Mariano Dupont 4057179aa5 Update README.md 2021-09-23 16:55:29 -03:00
Mariano Dupont 9e39e461cc Update README.md 2021-09-23 16:55:01 -03:00
Mariano Dupont 927ea7538f Update README.md 2021-09-23 16:53:13 -03:00
Mariano Dupont ddfd11cdf3 Update README.md 2021-09-23 16:48:11 -03:00
Mariano Dupont 555f68c2e7 Merge pull request #1 from ajjjjjjjj/feature/buzzer
Added buzzer support using TIMER1
2021-09-23 14:17:26 -03:00
Janek 09adccaa1a cleanup 2021-09-23 18:49:56 +02:00
Janek bbc5d2d202 Added buzzer support using TIMER6 2021-09-23 18:32:53 +02:00
Mariano Dupont 2e9e366dbb Update README.md 2021-09-10 01:43:32 -03:00
Mariano Dupont 80e29f4c49 Update README.md 2021-09-09 12:48:22 -03:00
Mariano Dupont c5ef8bbb23 Backported mixer scheduler 2021-09-09 12:34:27 -03:00
Mariano Dupont 16384b5d83 Long press EXIT to shutdown gracefully. (Saves timers state) 2021-08-10 01:59:50 -03:00
Mariano Dupont 45d4007131 Update README.md 2021-08-08 18:25:04 -03:00
Mariano Dupont 7b957f5cf3 RSSI on channel 14 fixed. Selection of protocol subtype. Servo frequency setting. Fixed telemetry type setting. 2021-08-08 18:10:18 -03:00
Mariano Dupont 21d8cf97ba Corrected timers multiplier, timers were counting at half the speed. 2021-08-04 21:46:06 -03:00
Mariano Dupont 6707ba4599 Passed first test flight. Corrected main view channel output count, which caused a crash when scrolling to the nonexistent channels. 2021-08-04 17:46:50 -03:00
Mariano Dupont bed30d333a Telemetry 2021-08-03 10:04:33 -03:00
Mariano Dupont b0f26b4717 README 2021-08-02 14:03:17 -03:00
Mariano Dupont 52f14b35d9 st-link pinout 2021-08-02 14:01:41 -03:00
Mariano Dupont cc077a9088 README 2021-08-02 13:47:28 -03:00
Mariano Dupont d0192ab2be README 2021-08-02 13:44:26 -03:00
Mariano Dupont c6bf211ee4 README 2021-08-02 13:43:31 -03:00
Mariano Dupont 7aa17844d4 README 2021-08-02 13:42:25 -03:00
Mariano Dupont 69b5a51646 Failsafe working. Removed BIND as SHIFT. Keys mapping added to README. 2021-08-02 13:39:03 -03:00
Mariano Dupont a2c98d2fbb Internal module config in model setup. RF working. Binding working. Range check working. Channels transmitting. 2021-07-28 21:47:14 -03:00
Mariano Dupont fa8097cbf2 LCD contrast setting 2021-06-19 18:10:40 -03:00
Mariano Dupont 7c97574595 Trims working correctly 2021-06-18 13:06:06 -03:00
Mariano Dupont 32e22372f9 Update README.md 2021-06-17 14:21:15 -03:00
Mariano Dupont 040ff45116 Update README.md 2021-06-17 12:49:31 -03:00
Mariano Dupont 9c6f2d7fa1 * Set good calibration defaults on factory reset, taken from erfly6. * Restored BIND as SHIFT. SHIFT+UP for LEFT, SHIT+DN for RIGHT. Trims freed. * Fixed radio and model settings garbled text and crashes. 2021-06-17 12:20:31 -03:00
Mariano Dupont c27889358e Merge branch '2.3_M0' of https://github.com/marianomd/opentx into 2.3_M0 2021-06-16 23:59:34 -03:00
Mariano Dupont 7f96884927 Warning now dissapears when moving switches 2021-06-16 23:59:20 -03:00
Mariano Dupont 8d7b42a966 Update README.md 2021-06-16 11:15:20 -03:00
Mariano Dupont 0f1f091931 Update README.md 2021-06-16 06:38:15 -03:00
Mariano Dupont a234f60ff5 Updated README 2021-06-15 21:46:11 -03:00
Mariano Dupont 98a6aaa2ba Updated README 2021-06-15 20:56:12 -03:00
Mariano Dupont 3d7d7e51fb Switches working. Removed graceful shutdown as it seems it's not needed, trim freed up. MENU key moved to ENTER key again, hold for model config. Bind button freed. 2021-06-15 20:30:38 -03:00
Mariano Dupont 45c303c81a README updated 2021-06-14 20:29:10 -03:00
Mariano Dupont a8c4cfded2 Merge branch '2.3_M0' of https://github.com/marianomd/opentx into 2.3_M0 2021-06-14 20:25:43 -03:00
Mariano Dupont f62f367e0a EEPROM compression enabled. No more EEPROM errors. 2021-06-14 20:25:25 -03:00
Mariano Dupont 084162b4f3 Update README.md 2021-06-14 11:41:58 -03:00
Mariano Dupont eccb7f6424 Update README.md 2021-06-14 10:14:22 -03:00
Mariano Dupont 7d49d0035b * Graceful shutdown with right horizontal trim up 2021-06-14 10:13:02 -03:00
Mariano Dupont 2b1909f441 Update README.md 2021-06-13 17:24:30 -03:00
Mariano Dupont 7725731c54 README 2021-06-13 17:11:15 -03:00
Mariano Dupont 479df8b469 * ADC readings enabled
* Mixer enabled
* Enable WDT reset every 100ms (countdown was broken)
* Fix sticks inverted
* Fix battery voltage calculation
* Fix crash in calibration checksum 
* Bind key as MENU
2021-06-13 16:58:30 -03:00
Mariano Dupont 79aa45a7fa Disabled watchdog, to avoid resets in the meantime. Turn on backlight on keypress 2021-06-12 14:20:20 -03:00
Mariano Dupont 6ee22ab229 EEPROM implementation progress 2021-06-12 13:07:47 -03:00
Mariano Dupont ebac6de662 Merge branch '2.3_M0' of https://github.com/marianomd/opentx into 2.3_M0 2021-06-12 12:46:02 -03:00
Mariano Dupont 2780a4b2fe several failed alternatives to write eeprom 2021-06-10 20:50:40 -03:00
Mariano Dupont e7cf168eef Update README.md 2021-06-09 21:39:23 -03:00
Mariano Dupont 8b2ac12d42 Added USART1 on PA9/PA10 for debugging purposes. Added ADC processing (untested). Added i2c code (not working yet) 2021-06-09 21:21:04 -03:00
Mariano Dupont f8dac21700 Added USART1 on PA9/PA10 for debugging purposes. Added ADC processing (untested). Added i2c code (not working yet) 2021-06-09 21:19:27 -03:00
Jakub 29a552f870 Buzzer methods moved to buzzer.h. 2019-02-25 20:32:45 +01:00
Jakub 6f45c82c55 Merge remote-tracking branch 'remotes/origin/M0' into m0_2.3 2019-02-24 17:08:51 +01:00
Bertrand Songis 627c0282c9 Update CREDITS.txt 2019-02-22 19:25:01 +01:00
Bertrand Songis 5e7722b766 Update CREDITS.txt 2019-02-20 20:51:39 +01:00
3djc 5780a8fd78 Add telem1-32 and lua mixer outputs to LUA 2019-02-18 09:19:58 +01:00
Bertrand Songis 26692b457b Update CREDITS.txt 2019-02-12 20:07:43 +01:00
Bertrand Songis 2ff56febb8 Update CREDITS.txt 2019-02-11 00:14:06 +01:00
Bertrand Songis 0b3d9a7c16 Merge pull request #6311 from mzambrini/2.3
Corrected grammatical errors
2019-01-25 21:31:47 +01:00
Bertrand Songis f813b9923d Update CREDITS.txt 2019-01-25 13:03:12 +01:00
Bertrand Songis d3e839c8d0 Update CREDITS.txt 2019-01-25 11:37:33 +01:00
Massimiliano Zambrini a030f215dd Corrected grammatical errors 2019-01-24 10:48:17 +01:00
3djc 6a15e5373f Merge pull request #6308 from mzambrini/2.3
Enhanced Italian language sounds
2019-01-22 11:34:01 +01:00
Massimiliano Zambrini 490243eb11 enhanced Italian language sounds 2019-01-22 10:35:13 +01:00
Kilrah 00e28d3c0e flexr9m was missing from compile scripts for sky9x (fix #6305) 2019-01-20 19:56:45 +04:00
Bertrand Songis cf6f0f6f0b Update CREDITS.txt 2019-01-17 22:00:40 +01:00
Bertrand Songis 75ed73412d Update CREDITS.txt 2019-01-16 12:42:47 +01:00
Bertrand Songis 677df3c18e Update CREDITS.txt 2019-01-13 21:28:51 +01:00
Bertrand Songis 25761039f6 Update CREDITS.txt 2019-01-13 21:28:22 +01:00
Bertrand Songis 23e2c50300 Update CREDITS.txt 2019-01-09 17:44:15 +01:00
Bertrand Songis 31f1c7761f Update CREDITS.txt 2019-01-09 16:02:57 +01:00
3djc 415544d012 Fix Horus wiazrd when 'no motor' is choosen (continued) 2019-01-08 17:04:47 +01:00
3djc fd7f839342 Fix Horus wiazrd when 'no motor' is choosen 2019-01-08 16:36:18 +01:00
3djc d363f957f5 Fix SBEC sensor scale 2019-01-08 08:09:46 +01:00
3djc 7f7a694799 SBEC telem support 2019-01-08 08:09:30 +01:00
Neil Horne e67cb385be Add file name to model edit window title (#6288) 2019-01-07 09:33:56 +01:00
Bertrand Songis f858fa2234 Update CREDITS.txt 2019-01-06 11:05:07 +01:00
Bryan Mayland 0d7a486630 Display FlySky VOLTS values as signed integers (#6252)
Standard AFHDS2A protocol transmits all values as 2 raw bytes
and a stock FS-i6 transmitter shows voltage type values properly
as signed. This change interprets all UNIT_VOLTS FlySky telemetry
items as being signed 16-bit values so their display matches the
values displayed on stock FS-i6 and FS-i6X receivers.

Signed-off-by: Bryan Mayland <bmayland@capnbry.net>
2019-01-06 11:02:10 +01:00
MRC3742 350acc3cc3 Multi protocol updates to MPM version 1.2.1.16 (#6249) 2019-01-06 10:59:40 +01:00
Kilrah 3407f91aa0 Use website for release notes 2019-01-06 10:29:55 +01:00
Kilrah 1a96655173 R9M 1W setting is Auto up to 1W 2019-01-06 10:28:24 +01:00
Kilrah d35a8bdea3 R9M 1W setting is Auto up to 1W 2019-01-06 10:19:49 +01:00
Bertrand Songis 419da20ca4 Update CREDITS.txt 2019-01-05 20:58:01 +01:00
Bertrand Songis cad0d48456 Update CREDITS.txt 2018-12-24 00:25:23 +01:00
Bertrand Songis fb4160e8e8 Update CREDITS.txt 2018-12-23 11:47:49 +01:00
3djc e1d056486f Fix wrong default channels in D8 (thx @Kilrah) 2018-12-22 11:08:16 +01:00
Bertrand Songis 32a7b50318 Update CREDITS.txt 2018-12-22 10:11:34 +01:00
Bertrand Songis c7896aeecf Update CREDITS.txt 2018-12-20 19:39:17 +01:00
3djc 74b9446a30 Fix backlight not turning off on radio with physical on/off switch
This fixes #6270
2018-12-20 09:22:47 +01:00
Bertrand Songis c3cb7b78fe Update CREDITS.txt 2018-12-18 18:59:11 +01:00
Bertrand Songis b50a152dd5 Update CREDITS.txt 2018-12-17 21:31:39 +01:00
3djc edec4149cf Fix alignement 2018-12-16 14:55:20 +01:00
Bertrand Songis 2f4863241b Update CREDITS.txt 2018-12-16 09:21:50 +01:00
Bertrand Songis 03835558fc Update CREDITS.txt 2018-12-15 15:24:17 +01:00
Bertrand Songis 2ed1b6cf7c Update CREDITS.txt 2018-12-15 12:08:03 +01:00
Bertrand Songis 1d28f31916 Update CREDITS.txt 2018-12-13 19:41:36 +01:00
Kilrah 19898e3e0a Fix DIY_FIRST_ID 2018-12-13 11:25:40 +01:00
Bertrand Songis 3ecf8448f0 Update CREDITS.txt 2018-12-11 22:40:04 +01:00
Bertrand Songis ac80681b77 Update CREDITS.txt 2018-12-08 13:40:35 +01:00
Bertrand Songis 45ebb29de4 Update CREDITS.txt 2018-12-07 08:17:05 +01:00
Bertrand Songis 874356694c Update CREDITS.txt 2018-12-02 16:40:35 +01:00
Bertrand Songis 609a2a7d02 Remove unused variable 2018-11-28 16:50:47 +01:00
Bertrand Songis 8c336d52fa Update CREDITS.txt 2018-11-28 08:35:01 +01:00
Bertrand Songis ef94cf1dc1 Update CREDITS.txt 2018-11-16 07:51:57 +08:00
Bertrand Songis 861bb78be5 Update CREDITS.txt 2018-11-11 15:08:38 +01:00
Bertrand Songis 48070764e0 Update CREDITS.txt 2018-11-10 10:03:32 +01:00
Bertrand Songis c8676783d1 Update CREDITS.txt 2018-11-10 09:10:30 +01:00
3djc 5233fc85b8 Fix pxx1 2018-11-05 16:22:56 +01:00
Bertrand Songis 543021a300 Merge pull request #6213 from opentx/bsongis/pxx2
Pulses refactoring
2018-11-03 16:42:57 +01:00
Bertrand Songis 9d93d88a66 PXX seems now OK on X7. More tests needed 2018-11-03 16:28:57 +01:00
Bertrand Songis 2ddc047ac8 Update CREDITS.txt 2018-11-02 22:29:30 +01:00
Bertrand Songis da0fe00c10 Update CREDITS.txt 2018-10-27 16:13:12 +02:00
Bertrand Songis afb99946b2 Update CREDITS.txt 2018-10-26 21:33:04 +02:00
Kilrah 4ab9730ed6 flexr9m also for non-frsky arm (fix #6224) 2018-10-21 09:49:11 +02:00
Kilrah 8a56cbd577 No topbar on horus 2018-10-18 11:43:39 +02:00
Bertrand Songis d1ff86d336 Merge pull request #6220 from opentx/3djc/lua-add-curves-to-inputs
LUA : Add curves to inputs
2018-10-12 17:13:47 +02:00
Bertrand Songis 73d9d0ec06 Merge pull request #6219 from MRC3742/2.3
Multiprotocol listing updates for 2.3 branch
2018-10-12 08:09:12 +02:00
3djc 04c95d2fdb LUA : Add curves to inputs 2018-10-12 07:34:56 +02:00
3djc 577eb6224f Allow commit-tests to be run much faster on dev PC (does not affect adversely Travis) 2018-10-12 07:31:34 +02:00
MRC3742 8dd10103d6 Updates to build in 2.3 for ARM9X 2018-10-11 23:01:12 -04:00
MRC3742 3dbcd436e8 Multiprotocol listing updates for 2.3 branch 2018-10-11 21:53:05 -04:00
3djc b393976879 Add binding options to ARM non FRSKY boards (2.3 branch) 2018-10-11 10:07:55 +02:00
Bertrand Songis c19e363025 Merge pull request #6155 from elecpower/print_center_beep_refactor
Refactor print center beep
2018-10-11 09:50:06 +02:00
Bertrand Songis 4525087ce9 Merge pull request #6180 from opentx/mpaperno/cpn_noavr
Companion AVR removal - stage 1.
2018-10-11 09:47:44 +02:00
Bertrand Songis 15ed4f6d56 Merge pull request #6160 from opentx/mpaperno/simu_better_shutdown_2.3
Refactor simu startup and shutdown handling (for 2.3 branch):
2018-10-11 09:41:58 +02:00
3djc 7064a9fbcc Improve #6208 fix 2018-10-11 07:09:55 +02:00
Bertrand Songis 53df20c005 Fixes #6208 2018-10-10 18:23:05 +02:00
Bertrand Songis bbfa94151f Regular PXX will need to be checked 2018-10-10 09:49:25 +02:00
Bertrand Songis fd4b309e0b PXX2 uses S.PORT CRC algorithm 2018-10-10 09:47:34 +02:00
Bertrand Songis 2823fe9a12 PXX2 init was not called 2018-10-10 08:49:58 +02:00
Bertrand Songis 67b145b22e Compilation fixes 2018-10-09 22:56:51 +02:00
bsongis 62dcd6ac5e Refactoring continued 2018-10-09 12:47:22 +02:00
Bertrand Songis 946f66b128 Pulses refactoring ... WIP 2018-10-09 07:57:58 +02:00
Bertrand Songis f798bbfcc7 Wrong baudrate chosen for PXX2 on setup 2018-10-08 08:22:20 +02:00
Bertrand Songis 713402b572 PXX2 first draft 2018-10-08 00:12:53 +02:00
Bertrand Songis 415cda6fc9 Update CREDITS.txt 2018-10-06 12:14:52 +02:00
Bertrand Songis 1156aa24d0 Update CREDITS.txt 2018-10-05 07:42:28 +02:00
3djc 3faa7e10d0 Improve spanish timer speech 2018-10-04 17:13:00 +02:00
Bertrand Songis b97696624f Update CREDITS.txt 2018-10-01 20:31:15 +02:00
Bertrand Songis ece41bdd75 Update CREDITS.txt 2018-09-29 20:03:20 +02:00
3djc eddce1d770 Merge branch '2.3' of https://github.com/opentx/opentx into 2.3 2018-09-28 10:01:57 +02:00
3djc 4387fef301 Fixes to Gassuit for future firmware
SxR script for all radio
2018-09-28 10:01:15 +02:00
Bertrand Songis 39e761b76c Update CREDITS.txt 2018-09-27 19:16:44 +02:00
3djc f330ea8a90 Minor spanish TTS changes 2018-09-27 09:28:43 +02:00
Bertrand Songis 34f0ca5e8f Update CREDITS.txt 2018-09-26 09:07:29 +02:00
3djc e954d87b53 Improve x9 multi wizard 2018-09-24 14:34:36 +02:00
3djc 1c7a2194e1 Small multi wizard fixes 2018-09-24 14:28:02 +02:00
3djc af0b55f642 Default channel order to AETR and review pages sequence 2018-09-24 14:17:35 +02:00
Bertrand Songis bfcc0ffddf Update CREDITS.txt 2018-09-24 07:58:28 +02:00
Bertrand Songis b280886bca Update CREDITS.txt 2018-09-23 17:11:29 +02:00
Bertrand Songis 8d3ea37309 Update CREDITS.txt 2018-09-22 23:25:40 +02:00
3djc 3ee37466fd Xlite/X7 multi wizard update (now includes switches) 2018-09-21 19:04:56 +02:00
3djc 26c4927993 Prep for upcommnig GasSuite firmware update 2018-09-21 13:02:22 +02:00
Bertrand Songis 1bd8558eeb Update CREDITS.txt 2018-09-21 10:25:02 +02:00
Max Paperno a93ab235be [Companion][MdiChild] En/disable radio settings and model copy/paste actions when clipboard changes externally (another MDI window or CPN instance). 2018-09-19 17:21:38 -04:00
Bertrand Songis 347a6251e3 Update CREDITS.txt 2018-09-19 18:56:58 +02:00
Max Paperno f8afc40198 [Companion][Boards] Remove final usage of two function alias macros. 2018-09-19 06:47:36 -04:00
Max Paperno 681bc82185 [Companion] Move CHECK_IN_ARRAY() to macros.h; Change DIM() return type; Refactor/fix removeAccents() to handle uppercase. 2018-09-19 06:47:36 -04:00
Max Paperno b4d992f490 [Companion][Firmware] Make Option struct a member; Add/use typedefs for options group and list; Use accessor functions for languages and options; Re-arrange fw options a little for better layout in UI; Remove dead code, cosmetics. 2018-09-19 06:47:36 -04:00
Max Paperno 13b156402f [Companion] Verify that radio type in chosen profile actually exists, and add warning to the contrary (at startup and also on profile switch); Add/move some functionality to AppMessages and make it classy (todo: rename file). 2018-09-19 06:47:35 -04:00
Max Paperno fdcee1ca9f [Companion][Firmware] Cosmetics on translation calls. 2018-09-19 06:47:35 -04:00
Max Paperno 02655d055c [Companion][Firmware] Remove all AVR flavors and options from available firmwares list, but keep base types for import purposes; Consolidate "ARM9X" flavor options; Consolidate Rf options. 2018-09-19 06:47:35 -04:00
Max Paperno d8a06158b1 [Companion][AppPreferencesDialog] Refactor firmwareOptionChanged(), getFirmwareVariant(), & populateFirmwareOptions() for clarity/efficiency; Remove AVR-only "voice" option handling and related items; Add getBaseFirmware(). 2018-09-19 06:47:35 -04:00
Max Paperno 62608cdc7d [Companion][TelemetrySensorPanel] Fix signed/unsigned compare warning. 2018-09-19 05:23:41 -04:00
Max Paperno 1b00fd2a9d [Companion][TelemetrySimulator] Fix sending of A3/A4 values (closes #6177); Adjust some min/max value ranges which were too small, and individual cell max values which were too high. 2018-09-19 04:00:04 -04:00
Max Paperno 0ea4b9ed9b [Companion][TelemetrySensorPanel] Fix offset decimals not updating properly when sensor precision is changed. 2018-09-19 03:58:46 -04:00
Andre Bernet e85ad43821 Prevent page changes during value editing (#6124) 2018-09-18 10:54:54 +02:00
3djc 1257b50bf4 Fix for non certified firmware 2018-09-18 10:51:29 +02:00
Kilrah aa9fa1dc84 eu and flexr9m now mutually exclusive 2018-09-18 10:51:24 +02:00
3djc 6ed7c30952 GasSuite protocol changes 2018-09-11 16:34:35 +02:00
Max Paperno 31b9f805ea [Simulator] Fix telemetry simulator log reader expected header for Cels column (closes #6167). 2018-09-10 23:20:51 -04:00
Bertrand Songis 8da83db1e5 Update CREDITS.txt 2018-09-09 23:25:59 +02:00
Bertrand Songis 9b6ac82ad8 Update CREDITS.txt 2018-09-09 23:18:10 +02:00
Max Paperno 66cd99bf6b [simu] Updates for RTOS abstraction layer; Remove further SIMU_SLEEP usages. 2018-09-08 22:04:37 -04:00
Max Paperno a2006940db [simu] Refactor simu startup and shutdown handling (for 2.3 branch):
* Use pwrCheck() as primary control point for shutdown, centralizes thread control in simpgmspace module;
 * Remove main_thread_running in favor of separate variables for startup mode and shutdown flag;
 * Don't start a thread for ARM startup, just run simuMain() directly (the thread just exits anyway);
 * Refactor SIMU_SLEEP() macro, and remove all unnecessary uses of it, also remove SIMU_SLEEP_NORET;
 * Add startType param to opentxStart() to control splash and startup checks;
 * Fixes backlight never turning off in simulator with "SWITCH" power button type (pwrPressed() was always true);
 * Fixes simu shutdown when model checklist is displayed at startup;
 * Adds stubs to possibly simulate a "soft" power button in the future.
2018-09-08 22:04:37 -04:00
Max Paperno 942ae1847d [CLI] Update CLI to use RTOS abstraction layer; Also remove a redundant/unused runMemoryTest(). 2018-09-08 19:07:43 -04:00
Max Paperno 691d3e6e33 [rtos] Make sure RTOS_WAIT_MS() sleeps > 0 ticks; Add RTOS_GET_MS(); Calculate ticks per ms at compile time; Fix field narrowing warning on RTOS_GET_TIME(). 2018-09-08 18:51:36 -04:00
3djc 55789db088 Merge pull request #6154 from elecpower/print_model_switch_issue_23
Fix getSize corrupting model and settings
2018-09-05 11:55:52 +02:00
elecpower a006abb94b Fix getSize corrupting model and settings 2018-09-05 19:13:32 +10:00
elecpower a4e92e8821 Refactor center beep 2018-09-05 17:35:20 +10:00
3djc 7b61185287 Fix german sensor lost audio 2018-09-05 08:38:04 +02:00
Sebastien Charpentier 210cee96d8 Updated French translation (#6151)
* Initial version.

* Updated French translation.
2018-09-04 11:47:08 +02:00
Max Paperno 4ff75ae87f [Simulator] Fix mixer outputs monitor not updating when channel value hasn't changed (fixes #6064). (#6122) 2018-09-04 11:46:40 +02:00
3djc f13bf76699 Turn on backlight on power press (but not on startup) (#6145) 2018-09-02 13:35:25 +02:00
Bertrand Songis ddb9fac4e1 Update CREDITS.txt 2018-09-01 13:47:32 +02:00
3djc c259dbc6e0 Cosmetics 2018-09-01 09:38:39 +02:00
3djc 34891142ac Introduce GasSuite config tool (untested) 2018-09-01 09:06:00 +02:00
3djc cc92c8a229 Fix R9M flex power settings missing for non xlite 2018-08-31 18:26:35 +02:00
3djc e97cdd00a8 Merge fixes 2018-08-30 13:34:13 +02:00
3djc 95c035ed73 Support for non certified firmwares (#6118)
* Support new r9m firmwares

* More future proof, thx Kilrah

* (significant) typo

* Companion part

* Make support a compilation option

* Fix compilation for normal users

* Warning popup for usability tests

* Better implementation

* All sizes

* Cosmetics

* Flex is EU+/AU+ only

* [Companion] Handle "flexr9m" option in module settings UI (to match radio UI, including warning msg); Move some "toString" functions out of ModelPrinter into ModuleData/Multiprotocols; "Future-proof" available R9M power options based on "stdr9m" fw option; Fix missing "Hitec" MM protocol name; Fix printing of R9M-EU power level in ModelPrinter.

* Cosmetics

* Rename R9M flex option

* Move failsafe further back to prevent nav oddity
2018-08-30 13:16:39 +02:00
Bertrand Songis 6113494d08 Update CREDITS.txt 2018-08-27 22:18:35 +02:00
Bertrand Songis e2f126dd27 Update CREDITS.txt 2018-08-27 22:16:23 +02:00
Bertrand Songis a476ee53aa Update CREDITS.txt 2018-08-27 22:15:38 +02:00
Kilrah bf5e5874b4 [Companion] Set decimals first on autospinbox or value can be truncated (fix #6094) 2018-08-25 21:03:45 +02:00
Amir Guindehi 51b3a0c68f inverted direction of X9E wheel in devices menu, which was different from the direction taken in device menu. turning the wheel to the right moves down in the menus everywhere now. (#6117) 2018-08-25 10:13:59 +02:00
Bertrand Songis e65f72476a Update CREDITS.txt 2018-08-22 18:33:55 +02:00
Kilrah 9df21ceb6e NL TTS as copy of EN as per new info on #6108. 2018-08-19 11:43:04 +02:00
Kilrah d3d5e6f215 Sync companion TTS language list with firmware (fix #6108) 2018-08-18 11:53:28 +02:00
Bertrand Songis a13d17e413 Update CREDITS.txt 2018-08-15 14:45:29 +02:00
Bertrand Songis baf44c321a Update CREDITS.txt 2018-08-07 21:17:38 +02:00
Kilrah fbcdcabab5 VC++ compilation 2018-08-05 20:04:12 +02:00
Bertrand Songis 73c1ed4023 VC++ compilation fix 2018-08-05 19:55:59 +02:00
Bertrand Songis 2c47883cc2 Companion GCC8 warnings removed 2018-08-05 19:33:28 +02:00
Bertrand Songis 8a51682190 Merge pull request #6087 from opentx/rtos_and_align_macros
Rtos and align macros
2018-08-05 16:26:18 +02:00
Bertrand Songis f1c6333d5f The splash was not aligned => radio doesn't boot 2018-08-05 16:16:15 +02:00
Bertrand Songis 92de1313e7 Cosmetics 2018-08-05 15:58:16 +02:00
Kilrah ce7cb7f7e9 Fix Horus bootloader needing 2 encoder clicks per line 2018-08-05 15:47:57 +02:00
Bertrand Songis 4f741dfad2 Cosmetics 2018-08-05 15:47:53 +02:00
Bertrand Songis f226cde6fe Dead code removed 2018-08-05 15:27:50 +02:00
Bertrand Songis 7eb3eb9ec5 Cosmetics 2018-08-05 14:26:44 +02:00
Bertrand Songis ffa012eeb6 Cosmetics 2018-08-05 14:24:30 +02:00
Bertrand Songis 94f9eb7a35 Unused FSPLASH option removed 2018-08-05 14:22:23 +02:00
Bertrand Songis 6a520f18cf Update CREDITS.txt 2018-08-05 14:07:55 +02:00
Bertrand Songis de8f9ebac9 Compilation fix 2018-08-05 14:06:12 +02:00
Bertrand Songis b14f1f29a9 Compilation fix 2018-08-05 13:38:58 +02:00
Bertrand Songis 49aac252d7 Remaining Phase instead of Flightmode 2018-08-05 13:35:52 +02:00
Bertrand Songis ed91931184 More AVR removal 2018-08-05 13:12:51 +02:00
Bertrand Songis ea76998beb More AVR removal 2018-08-05 12:39:05 +02:00
Bertrand Songis f3bfde242b RTOS refactoring + more AVR removal 2018-08-05 12:06:48 +02:00
Bertrand Songis f60733b561 __ALIGNED macro unified 2018-08-05 09:56:47 +02:00
Bertrand Songis d47c3cedb4 Update CREDITS.txt 2018-08-05 09:04:34 +02:00
Bertrand Songis ea7ade197e MODULE_ALWAYS_SEND_PULSES define removed 2018-08-04 21:14:44 +02:00
Bertrand Songis bba0e5e00c Merge pull request #6038 from opentx/mpaperno/cpn_src_models
Conitnued RawSource/RawSwitch data models refactoring
2018-08-04 10:19:53 +02:00
Bertrand Songis b1cd632bd4 Merge pull request #6079 from opentx/schwabe/multinewprotocol
Update Multi protocols
2018-08-04 10:18:20 +02:00
Bertrand Songis 61b82254d0 Merge pull request #6084 from opentx/modules_type_macros
All macros for modules removed
2018-08-04 10:17:35 +02:00
Bertrand Songis 3c66454953 Merge pull request #6083 from opentx/gcc8_warnings_fixed
Gcc8 warnings fixed
2018-08-04 10:16:38 +02:00
Bertrand Songis 85ad25e0e8 All macros for modules removed 2018-08-04 00:13:32 +02:00
Bertrand Songis 131078e3a0 GCC new warnings fixed (GCC) 8.1.1 20180531 2018-08-03 23:02:43 +02:00
Bertrand Songis a77f00d665 Some bitmaps shifted by 2 pixels on load 2018-08-03 23:00:42 +02:00
Arne Schwabe eaae858a38 Update Multi protocols 2018-08-03 13:21:31 +02:00
Bertrand Songis cdfdcf6d13 VOICE definition removed (always used) 2018-08-03 08:33:33 +02:00
Bertrand Songis 298f41fc76 Update CREDITS.txt 2018-08-03 08:13:16 +02:00
Bertrand Songis cdab8a4d9e Update CREDITS.txt 2018-08-03 08:03:54 +02:00
Bertrand Songis d6d3bc0159 Update CREDITS.txt 2018-08-01 11:12:28 +02:00
Bertrand Songis 9ee8f3613f Update CREDITS.txt 2018-07-31 08:06:30 +02:00
Bertrand Songis 3b8dd447fa Update CREDITS.txt 2018-07-30 22:31:37 +02:00
Max Paperno b6a97318ec [Companion][FirmwarePreferencesDialog] Update the displayed latest firmware version number after a download completes. 2018-07-16 18:38:36 -04:00
Max Paperno 989abd017e [Companion][downloadDialog] Canceling the download dialog during download now terminates the active network request and removes the file. 2018-07-16 18:37:00 -04:00
Max Paperno 71fd6dfa47 [Companion][AppData] Fix firmware version storage path when reading. 2018-07-16 18:34:21 -04:00
Max Paperno 8d00e1dc8c [Companion][MainWindow] Allow aborting version update check network request. 2018-07-16 17:48:19 -04:00
Max Paperno 34e1075582 [Companion][AppPreferencesDialog] If not ALLOW_NIGHTLY_BUILDS then either hide nightly channel option, or if user already has it selected then display a warning (in case they also have nightly installed in parallel). 2018-07-16 17:39:22 -04:00
Max Paperno df5722717a [Companion] Centralize download URLs; URLs now based on build major.minor version macros; Remove AVR fw download URL; Make some QStrings cheaper. 2018-07-16 17:36:33 -04:00
Max Paperno 71c5132c57 [Companion][MainWindow] Fix update check progress bar dialog remaining open when unnecessary; Also check for firmware updates even if CPN check fails with error. 2018-07-16 16:54:36 -04:00
Max Paperno b15ac0f2e1 Merge branch '2.2' into 2.3 2018-07-16 14:01:33 -04:00
Kilrah 2296cd5faf Flight modes and "Tele" were unreachable in LS on 128x64 radios 2018-07-14 20:01:03 +02:00
Kilrah b50826bc74 Do not load global function scripts if global functions are disabled in model settings (fix #6029) 2018-07-14 13:21:24 +02:00
3djc 409036b6ed Possible fix to gtest 2018-07-14 11:13:46 +02:00
Bertrand Songis 5ee3825a50 Merge pull request #6041 from opentx/schwabe/fix_setcurves_6026
Fix setting x values < 0 for custom curvs (fixes #6026)
2018-07-13 19:58:14 +02:00
Arne Schwabe c99dc375e8 Fix setting x values < 0 for custom curves (fixes #6026)
Also accept bool for smooth parameter as the documentation suggest
2018-07-13 09:36:30 +02:00
Max Paperno ca63b92e5b [Companion] Refactor RawSource & RawSwitch data models to abstract the base classes and reduce redundancy; Move data models to own folder. 2018-07-12 13:20:07 -04:00
Max Paperno 70aa7c6ad8 [Companion] Refactor FlightModePanel and TimerPanel to use shared RawSwitch data models instead of one per instance. 2018-07-12 13:20:07 -04:00
Max Paperno 81c33b6432 [Companion] Refactor RawSwitchItemModel and RawSwitchFilterItemModel for better efficiency, does not invalidate whole model on updates (structure is almost identical to the RawSource variants). 2018-07-12 13:20:07 -04:00
Max Paperno b76a0a8789 Minor cleanup on RawSourceItemModel and TelemetryCustomScreen. 2018-07-12 13:20:07 -04:00
Max Paperno ed255ce1c3 [Companion] Updates to use new RawSource data models in UI. 2018-07-12 13:20:06 -04:00
Max Paperno 3b8d177861 [Companion] Start RawSource / RawSwitch data models refactor; Create RawSourceItemModel and RawSourceFilterItemModel. 2018-07-12 13:20:06 -04:00
Max Paperno 00efc0d571 Merge fix. 2018-07-12 13:15:41 -04:00
Max Paperno 7bc59784b5 Merge branch '2.2' into 2.3 2018-07-12 13:09:34 -04:00
3djc 3556d7c0e8 Apply #6036 equivalent to 2.3 2018-07-12 12:22:07 +02:00
Bertrand Songis b5078c5326 Merge pull request #6036 from opentx/bsongis/revert_PR#5664
Fixes #6032
2018-07-12 11:40:08 +02:00
3djc 89656d8195 Fix Gtest (fullfilling my debt !) 2018-07-12 08:56:03 +02:00
3djc 69d3e9be0a Add Gtest (fullfilling my debt !) 2018-07-12 07:40:57 +02:00
Bertrand Songis 94bd8a237d Revert "Apply THR trim when cross triming (#5664)"
This reverts commit 1ebd289
2018-07-12 00:42:38 +02:00
Bertrand Songis e10cbed69f Fixes #6032 2018-07-11 22:51:10 +02:00
Bertrand Songis 12d675a0a7 Merge pull request #6035 from opentx/virtual_inputs_define_removed
VIRTUAL_INPUTS #define removed
2018-07-11 22:39:26 +02:00
Bertrand Songis d2697345e1 VIRTUAL_INPUTS #define removed 2018-07-11 18:54:05 +02:00
Bertrand Songis a8707baf57 Merge pull request #6034 from opentx/navigation_files_splitted
Navigation methods splitted to avoid a lot of #ifdef
2018-07-11 16:39:02 +02:00
Bertrand Songis 5eff34ce8a Navigation methods splitted to avoid a lot of #ifdef 2018-07-11 15:17:14 +02:00
Bertrand Songis 0bb96a7413 Merge pull request #6033 from opentx/remaining_cpuarm_removed
Remaining CPUARM removed
2018-07-11 14:03:14 +02:00
Bertrand Songis db1d3fcb32 Remaining CPUARM removed 2018-07-11 13:33:51 +02:00
Bertrand Songis 3f1d09bc68 Merge pull request #6016 from opentx/schwabe/removeAVR
Remove a lot more AVR specific code
2018-07-11 13:19:23 +02:00
Max Paperno 39db1b6537 [Companion][LogicalSwitchesPanel] Workaround for added LSs missing from Sources selector on LS edit page (closes #4917 (again)). 2018-07-10 14:38:00 -04:00
Max Paperno c408c30bc1 Fix libsimulator build MSVC warnings introduced in commit 6110bbc. 2018-07-09 13:06:38 -04:00
Max Paperno 1e6cfc373e Rename jtag-flash -> flash-jtag 2018-07-09 12:18:40 -04:00
Max Paperno a611281a01 Flash with ST-LINK_CLI. 2018-07-09 12:18:39 -04:00
Max Paperno 6110bbce98 Support Companion build with clang-cl on Windows (fw/libsimu not working yet due to compiler-specific macros in that code). 2018-07-09 12:02:26 -04:00
Max Paperno d507dbb5dd Add SIMU_TARGET build option to exclude libsimulator & simu from all/install. 2018-07-09 11:53:38 -04:00
Max Paperno f60d3b80be Exclude Qt rendering engine binaries from Windows Companion install. 2018-07-09 11:48:04 -04:00
Max Paperno e24a736fc9 Merge branch '2.2' into 2.3 2018-07-08 21:01:01 -04:00
Raphael Coeffic e916c6dc9a fixed GPS coords precision in telemetry simulator when loaded from CSV log 2018-07-08 21:00:37 -04:00
Bertrand Songis 3540015132 Merge pull request #6002 from opentx/raphaelcoeffic/rle_bitmaps
[Horus] save space in bootloader and firmware by using RLE compression
2018-07-08 16:47:22 +02:00
Bertrand Songis 4909d176ec Merge pull request #6008 from opentx/raphaelcoeffic/lua_serial
add LUA access to serial port (serial2 and USB)
2018-07-08 16:44:55 +02:00
Bertrand Songis 2001c0d408 Merge pull request #6020 from opentx/mpaperno/sim_telemsim_pause_options
Add start/pause/RSSI-disable options to Telemetry Simulator
2018-07-08 16:41:36 +02:00
Kilrah 1383afb36f Use BT detection on X-Lite too (current prod has no module, preprod has one, future batches unknown) 2018-07-08 15:49:10 +02:00
Kilrah 9904d6deb0 Fix typo 2018-07-08 15:38:39 +02:00
Bertrand Songis e8d8fc1806 Prevent from writing the whole font when a char is missing (i.e. special chars) 2018-07-08 13:18:33 +02:00
Max Paperno 10e6745e21 Don't send telemetry when main simulator is not running. 2018-07-06 15:15:14 -04:00
Max Paperno b2713df6bb Cosmetics. 2018-07-06 14:59:43 -04:00
Max Paperno 23aaee9ecf [Simulator][TelemetrySimulator] Add persistent option to enable simulation when window is opened; Add option to pause simulation on window hide (was always true); Add option to set RSSI=0 on simulation pause to trigger “telemetry lost” alarm. 2018-07-06 14:03:41 -04:00
Raphael Coeffic 1fec7a7c51 enabled USB_SERIAL on Horus by default 2018-07-06 10:01:09 +02:00
Raphael Coeffic 25c02b96f3 add LUA access to serial port (serial2 and USB) 2018-07-06 10:01:09 +02:00
Raphael Coeffic 8e39de0368 fix horus LCD tests 2018-07-06 08:59:34 +02:00
Raphael Coeffic 7806382d8e add RLE support for other bootloader bitmaps as well 2018-07-06 08:59:34 +02:00
Raphael Coeffic 96afa57d84 use RLE compressed fonts on Horus 2018-07-06 08:59:34 +02:00
Raphael Coeffic caaba0ab3f img2lbm: added RLE encoding for 1bit, 4bit & 8bit formats
RLE encoding is triggered by using an output filename with “.rle” extension.
2018-07-06 08:59:33 +02:00
3djc 5dd365238e Merge branch '2.2' into 2.3 2018-07-06 07:16:27 +02:00
Bertrand Songis e6aea64689 Merge pull request #6006 from opentx/mpaperno/cpn_settings_refact
Refactor Companion settings system
2018-07-05 19:09:47 +02:00
Bertrand Songis 86b48d8258 Merge pull request #6009 from opentx/mpaperno/cpn_fsync_v2
SD Sync "version 3"
2018-07-05 19:07:10 +02:00
Raphael Coeffic 4880497db5 generate_datacopy.py fixes (#6015)
* fix generate_datacopy on osx

* more datacopy fixes

* added support for linux & llvm-3.8 (default on debian stretch)
2018-07-05 19:04:28 +02:00
Max Paperno d253c3163b [Companion] Delete QNetworkReply after update checks and release notes d-load (prevents leftover open handles, see QNetworkAccessManager docs); Use only one QNetworkAccessManager in MainWindow and properly dispose of it. (#6010) 2018-07-05 19:01:55 +02:00
Arne Schwabe 961c1d60e0 Remove templates 2018-07-05 12:05:55 +02:00
Arne Schwabe aa5d8c4ba7 Remove remaining references to Mavlink 2018-07-05 12:05:55 +02:00
Arne Schwabe c80f0da4ac Remove various references of AVR from script and referenced files 2018-07-05 12:05:55 +02:00
Arne Schwabe 9c7cfe9252 Remove all CPUM128/CPUM2560/CPUM2561 macros
Also remove pulses_avr*
2018-07-05 12:05:55 +02:00
Arne Schwabe a5b44fa877 Remove ARM_FIELD and AVR_FIELD macros 2018-07-05 12:05:55 +02:00
Arne Schwabe fdedcf4de0 Remove CASE_CURVES 2018-07-05 12:05:55 +02:00
Arne Schwabe 8530cce10a Remove CASE_PERSISTENT_TIMERS 2018-07-05 12:05:55 +02:00
Arne Schwabe c75d873b91 Remove CASE_CPUARM and IF_CPUARM macros 2018-07-05 12:05:55 +02:00
Arne Schwabe cbf60380f2 Assume CURVES are always defined 2018-07-05 12:05:55 +02:00
Arne Schwabe e76d1d0c3d Remove unused telemetry protocols 2018-07-05 12:05:55 +02:00
Arne Schwabe d831b0f55e More AVR cleanup 2018-07-05 12:05:54 +02:00
Max Paperno 4300e4b022 Merge branch '2.2' into 2.3 2018-07-05 05:30:58 -04:00
3djc ca3093e07e Do not build avr simu anymore 2018-07-05 10:26:17 +02:00
3djc 47cfd7da98 Fix some files permission 2018-07-05 10:06:19 +02:00
3djc 8e66b32c95 Fix some files permission 2018-07-05 10:05:07 +02:00
Kilrah 1dd3aadbd8 Display stick type when applicable
(cherry picked from commit daedeed)
2018-07-05 08:44:39 +02:00
LapinFou ec49fb9e49 Shorten translation.
(cherry picked from commit 337e224)
2018-07-05 08:44:28 +02:00
LapinFou 4313d23ba7 Updated French Translation.
(cherry picked from commit 8dda878)
2018-07-05 08:44:19 +02:00
LapinFou 5a6f3f04e7 Initial version.
(cherry picked from commit eeaab12)
2018-07-05 08:44:13 +02:00
Arne Schwabe aa1493cad0 Use nano.spec for linking bootloader (#6004)
This saves about 2kB on the Taranis X-Lite

(cherry picked from commit 5dd0ac7)
2018-07-05 08:43:46 +02:00
3djc dd632969f3 Massive clean thanks to Schwabe : unifdef -m -DCPUARM -UCPUM64 -UCPUM2560 -UPCBSTD -UPCBMEGA2560 -UPCBGRUVIN9X -UPCB9X $(find . -name "*.cpp" -or -name "*.h") 2018-07-05 08:04:55 +02:00
3djc c032b30247 avr-remove remove files in main dir and targets 2018-07-03 09:44:03 +02:00
3djc ec0c82a4bf avr-remove main CmakeList 2018-07-03 09:29:20 +02:00
3djc b07547df75 Remove avr from commit-tests.sh 2018-07-03 09:00:27 +02:00
3djc 617cc47231 Ask Travis to not build avr anymore 2018-07-02 15:14:42 +02:00
3djc fd68286b2f Merge pull request #6011 from opentx/LapinFou/Fr_Translation
Updated French translation
2018-07-02 12:33:33 +02:00
Kilrah daedeed8d7 Display stick type when applicable 2018-07-02 12:29:54 +02:00
LapinFou 337e224ad3 Shorten translation. 2018-07-02 10:17:25 +02:00
LapinFou 8dda878c62 Updated French Translation. 2018-07-01 18:05:56 +02:00
LapinFou eeaab1268e Initial version. 2018-07-01 18:03:23 +02:00
Max Paperno 66ffa18dce [Companion] Rework SD Sync implementation:
~ Move UI to new FileSyncDialog class;
  ~ Improve UI responsiveness during operation (closes #5005);
  + Add log verbosity option (also helps with UI response);
  + Add several filtering settings in new "extra options" panel (include/exlude patterns, symlinks, recursive, empty folders);
  ~ Exclude patterns ".*" and "System Volume*" by default (addresses #5213, #5106);
  + Sanity check file timestamps when using date comparison, future dates are invalid (addresses #5735);
  ~ Folders are no longer included in file counts (total/created/etc);
  ~ Ignore unreadable files/dirs (also enables NTFS permissions check);
  ~ Switch from QMutex to QReadWriteLock.
2018-06-30 12:03:49 -04:00
Arne Schwabe 5dd0ac75bc Use nano.spec for linking bootloader (#6004)
This saves about 2kB on the Taranis X-Lite
2018-06-30 17:40:33 +02:00
Max Paperno a236b4c59b [Companion][ProgressWidget] Improve handling of showing/hiding details text; Speed up addMessage(); Adjust layout size policies. 2018-06-30 10:24:09 -04:00
Max Paperno ff82a575f6 [Companion][AutoLineEdit] Add ability to work with QString data type w/out default validation. 2018-06-30 10:24:08 -04:00
Max Paperno 86fb88cdee [Companion][AutoComboBox] Add updateValue() function in line with other Auto* widgets; Add currentDataChanged() signal. 2018-06-30 10:24:08 -04:00
Max Paperno 316a2508a5 [Companion] Add AutoBitsetCheckBox 2018-06-30 10:24:08 -04:00
Max Paperno 63476c03f3 [Companion] Implement application settings import and export via GUI and CLI. 2018-06-29 20:18:35 -04:00
Max Paperno 60c8b1b2be Change to v2.3 [ci skip] 2018-06-29 20:13:27 -04:00
Max Paperno 988c837011 [Companion] Refactor settings system (CompStoreObj/AppData/etc):
~ All stored properties are fully dynamic, using an extended version of the Qt Property System;
 ~ CompStoreObj is now QObject subclass;
 + All properties now have change notifier signals;
 ~ Do not store default values in settings;
 + Add _reset() and _default() functions for each property;
 + Settings import now ignores all non-existent properties automatically;
 + Add settings export functions;
 + Add more version macros;
 ~ Remove template functions;
 ~ Move DownloadBranchType and create NewModelAction enums and register with Qt meta system;
 ~ Multiple efficiency and optimization changes (const functions, literals, etc).
2018-06-29 20:00:10 -04:00
Max Paperno 2869d8574d [SimulatorOptions] Add comparison operators. 2018-06-29 19:47:25 -04:00
Max Paperno d233fa39bd Bump version to 2.3.0 in CMakeFiles. 2018-06-29 19:44:39 -04:00
Arne Schwabe a26879dca8 Revert "Remove -nostartfiles linker option from bootloader (#5996)"
This reverts commit 17b4aa2466.

Removing the -nostartfiles caused the Taranis bootloader to include
a number of strange functions. Instead define _fini to avoid the linker
issues.
2018-06-30 00:46:50 +02:00
Arne Schwabe 429d55769c Revert "Remove -nostartfiles linker option from bootloader (#5996)"
This reverts commit 17b4aa2466.

Removing the -nostartfiles caused the Taranis bootloader to include
a number of strange functions. Instead define _fini to avoid the linker
issues.
2018-06-30 00:39:54 +02:00
Yannick Richter 9cbd0b9813 Full 11 bit USB HID gamepad resolution and fixed offsets for compatibility (#5825)
* Changed USB Gamepad resolution to full 11 bit and fixed offset issues for some games

* Changed USB Gamepad resolution to full 11 bit and fixed offset issues for some games

* Changed USB Gamepad resolution to full 11 bit and fixed offset issues for some games
2018-06-29 08:07:30 +02:00
Max Paperno 71912cfdbd Refactor Companion Windows install and installer targets (#5949)
* [companion][build][Windows] Refactor 'install' and 'installer' targets: Use qtwindeploy to collect Qt dependencies; 'install' with WIN_DO_FULL_INSTALL=YES now really copies everything needed; Simplified NSIS script, now also supports MinGW build; Refactor libeay search.

* Rename nsis input script.

* Fix NSIS input script name in CMakeLists.txt.

* [Companion][build] Create new Windows icon with more sizes; move icon files out of src root.
2018-06-29 08:07:02 +02:00
3djc 7db74cb017 Review pulse start sequence (#5998) 2018-06-29 08:05:08 +02:00
Max Paperno 2eec091ac0 Companion custom functions sound playback fixes (#6000)
* [CompanionIcon] Can now add multiple image files to icon for representing different UI states (checked/active/etc).

* [Companion][CustomFunctionsPanel] Fix sound file locked after playback (fixes #5222, fixes #5997); Refactor play button (fixes #4929); Create new QMediaPlayer on each play and load in "LowLatency" mode instead of stream.
2018-06-29 08:04:45 +02:00
Bertrand Songis cb19949a82 Update CREDITS.txt 2018-06-28 00:28:47 +02:00
Sebastien Charpentier 54e0795e51 Fr Translation update (#5991)
* Initial version.

* Updated French translation.
2018-06-27 16:13:40 +02:00
Raphael Coeffic 1492a346d3 fixes #5988 (#5992) 2018-06-27 16:12:33 +02:00
Arne Schwabe 968e7233e5 Clean up PWM stick reads, remove double averaging (#5995)
We already do averaging in the normal anaIn/getADC().
Also according to Mike's and my own research we don't need the averaging.

Tested on two X-Lites with PMW sticks
2018-06-27 16:10:27 +02:00
Arne Schwabe 17b4aa2466 Remove -nostartfiles linker option from bootloader (#5996)
* Remove -nostartfiles linker option from bootloader

Compiling with this option creates undefined references to _fini

* Remove now empty init.c
2018-06-27 16:09:12 +02:00
Bertrand Songis 6be0c3f4c6 Update CREDITS.txt 2018-06-25 14:45:50 +02:00
Kilrah c3b23fcc6e Prevent users from cheating (fix #5990) 2018-06-25 09:44:16 +02:00
Bertrand Songis af88b60c0e Update CREDITS.txt 2018-06-24 15:50:37 +02:00
3djc 793e971460 early release prep 2018-06-23 10:22:12 +02:00
3djc a9e88c272a Remove misleading RC99 (#5982)
Replace 'release' by 'version' in a few places
2018-06-23 09:07:13 +02:00
3djc f76c23d7f7 Remove nofp option for a few board (#5986)
* Remove nofp option for a few board

* Little fix
2018-06-23 09:06:43 +02:00
3djc c8205c4cff Cosmetics around R9M Lite FCC 2018-06-22 19:33:25 +02:00
3djc ab9b77fa90 Merge pull request #5985 from DieHertz/diehertz/crossfire-lua-xlite-support
Added X-Lite support to CROSSFIRE Lua
2018-06-22 09:44:37 +02:00
Andrey Mironov 80c2bc7242 Added X-Lite support to CROSSFIRE Lua 2018-06-22 10:11:06 +03:00
3djc 4d126dd91a Fix setFailafe SF
Fixes #5984
2018-06-22 07:51:05 +02:00
Bertrand Songis 8a30c5d951 Update CREDITS.txt 2018-06-20 16:04:27 +02:00
Bertrand Songis 817994c47e Update CREDITS.txt 2018-06-20 07:22:36 +02:00
Arne Schwabe e3ea859592 Ignore hidden folder on sync (#5976) 2018-06-18 15:39:34 +02:00
Kilrah 23f53077cf PPM frame length default was missing 2018-06-18 10:07:50 +02:00
Kilrah 091bf2fdf0 Hide hidden files 2018-06-17 22:07:33 +02:00
3djc 47dbd0dd3e Increment SDCard version for Russian TTS 2018-06-17 09:17:22 +02:00
Alexander Novikov 67585a6fa7 Fixed: long filenames (RU TTS) (#5974) 2018-06-16 22:35:30 +02:00
3djc 0d9aca84a9 Fix X7 R9M power line not enabled (#5973)
* Do not expect MODULE_R9M_FULLSIZE to be defined for non xlite

* Cosmetics
2018-06-16 19:24:46 +02:00
Kilrah a0c2f0bf19 Timer mode overflow (fix #5927) 2018-06-16 11:44:34 +02:00
3djc bd1c9274b3 Xlite adc stick fix (#5972)
* Xlite ADC stick order fix

* In the right order this time
2018-06-16 11:24:39 +02:00
Max Paperno 812ba76e0d [Companion][ModulePanel] Fix RF Output Power setting getting reset to default on every update() (re-opening model editor, etc) (fixes #5954); Prevent some needless updates during setup. (#5970) 2018-06-16 00:09:09 +02:00
Kilrah 60cf6b8058 DE translation fix 2018-06-15 23:00:06 +02:00
Kilrah ee4f8bda88 Don't reinitialise last flight mode on flight reset (Fix #5932) 2018-06-15 22:48:43 +02:00
3djc f50f2aefc0 French sensorok audio message changed to something less error prone. Update SDcard version to 17 2018-06-15 17:36:22 +02:00
Sebastien Charpentier 0e7e27edbf Updated French translation (#5967)
* Initial version

* Updated French translation.
2018-06-14 19:34:18 +02:00
Sebastien Charpentier a2d797310a Updated French Translation (#5955)
* Initial version

* French Translation
2018-06-13 22:28:08 +02:00
Max Paperno 1de4d86661 [Companion][MixesPanel] Fix disappearing mixer lines after an invalid line is removed. (#5957) 2018-06-13 22:27:45 +02:00
3djc cd7c075b3b Do not display disabled trim on main views (#5962)
* Proof of concept

* Add Horus

* Better implementation

* AVR compilation fix
2018-06-13 22:26:49 +02:00
Raphael Coeffic 6595bcfc3c fix models list reload after USB mass storage connection (#5963) 2018-06-13 22:26:11 +02:00
3djc 60423b81ad Turn backlight on for switch warning (#5965)
* Turn backlight on for switch warning

* Turn backlight on for splash screen
2018-06-13 22:25:42 +02:00
3djc 6898efcc02 Prevent X9E simu crash when BT is enabled (#5966)
* Better 'non horus BT' XE handling

* Cleanup

* Adjust BT message for X9E

* [Companion][HardwarePanel][X9E] Change BT Mode options to OFF/Enabled, X9E only.
2018-06-13 22:25:22 +02:00
3djc 7aca3eb5b7 Merge pull request #5964 from opentx/schwabe/fix_german
Fix a few things in german translation
2018-06-13 17:01:37 +02:00
Arne Schwabe 6f116510da Fix tts for German number over 100 with decimal point 2018-06-12 17:31:45 +02:00
Arne Schwabe ad26e4acba Fix German timer tts 2018-06-12 17:31:45 +02:00
Arne Schwabe 169d03ea9c Remove unused files for mac build 2018-06-12 14:20:23 +02:00
3djc 2de9c62083 Adapt to new server 2018-06-12 10:26:32 +02:00
3djc fd9ecc589e Add missing German tts strings 2018-06-12 09:58:37 +02:00
Kilrah d74c6acc0b We can now know what radio a random file comes from a little more easily... 2018-06-11 23:01:50 +02:00
3djc 9bdd0c682d Fix 2.2.2RC1 no gvar compile (#5961)
* Make model_gars.cpp flag dependend

* Cosmetics
2018-06-11 19:05:40 +01:00
3djc f135413b6d rc != release 2018-06-10 11:03:06 +02:00
3djc cebe1d0cb7 rc != release 2018-06-10 10:57:30 +02:00
3djc a3ee869ee9 Release prep 2018-06-10 10:09:35 +02:00
3djc f510650a42 Release prep 2018-06-10 09:04:19 +02:00
3djc add297920a Cosmetics 2018-06-09 12:04:36 +02:00
3djc 8cc61e5a8a Merge branch '2.2' of https://github.com/opentx/opentx into 2.2 2018-06-09 11:59:11 +02:00
3djc d58c660822 Add translation for HORUS text viewer 2018-06-09 11:59:02 +02:00
Neil Horne d460f005c6 Companion curve enhancements (#5947)
* Add point to custom curve using mouse click

* Add more curve enhancements delete and resize points

* add scene constructor
2018-06-09 11:35:41 +02:00
3djc 13c5387dc9 Disable pulse while model notes are displayed (#5758)
* Implement model note view without menu handler. Use it before pulse starts

* Also at model change. Handle wd reset and start pulses after mixer

* Fix Horus compile

* Fix Horus crash

* Fix coding style issue
2018-06-09 11:34:56 +02:00
3djc 45804b318a Improve r9m power handling (#5950)
* Rework around reusable buffer

* small fix

* Rework 212 & 480 handling too

* Optimize

* Compilation fix
2018-06-06 17:07:27 +02:00
Sebastien Charpentier 9ffcac744a Updated French Translation (#5948)
* Initial version

* Updated French translation + fixed some typo

* Fixed warning message
2018-06-06 11:19:18 +02:00
Bertrand Songis 365554980d Update CREDITS.txt 2018-06-05 18:27:05 +02:00
Arne Schwabe 702a8cb0c3 fix clang compiler warning 2018-06-05 11:21:10 +02:00
Max Paperno 0a4ca595ed [Companion][MixersListWidget] Enable multiple selection capability on Inputs and Mixes editors (closes #5029); Fix bug with custom style propagation; cosmetics. 2018-06-05 03:34:42 -04:00
Sebastien Charpentier 5302254462 Fr Translation (#5941)
* Initial version

* Updated French translation.
2018-06-04 22:23:21 +02:00
Max Paperno 41419b4cee [Companion] Move some single-use functions out of helpers module; cosmetics. 2018-06-04 05:15:16 -04:00
Max Paperno 8de53f18e6 [LogsDialog] Fix GE export on OSX (since 9796654). 2018-06-04 05:12:57 -04:00
Max Paperno 777fc58578 [Companion][ModulePanel] Fix RF Output Power warning message display. 2018-06-04 04:51:32 -04:00
Max Paperno e2977540d9 [Simulator][SimulatorOptions] Fix the misguided version check. 2018-06-04 04:51:09 -04:00
Arne Schwabe 0073889d93 Remove leftover text from old template 2018-06-04 10:28:12 +02:00
3djc c11a88f108 Fix title display issue in french under Liunux 2018-06-04 09:37:16 +02:00
Andre Bernet 14a96e17be OSX compilation 2018-06-04 07:57:28 +01:00
Max Paperno 2c5b54d7f3 [Companion][build][Windows] Allow alternate locations for OpenSSL DLLs to be included with CPN installation (removes PyQt4 dependency). (#5939) 2018-06-04 07:44:00 +02:00
Max Paperno 3af2b090e5 Fix remaining model editor sync issues with RawSource changes. (#5936)
* [Companion] Fix RawSource updates in Custom Function selectors (part fix for #4917).

* [Companion] Fix RawSource updates in HeliPanel selectors (closes #4917).
2018-06-03 23:20:14 +02:00
Max Paperno 9796654816 [Companion] Log viewer Google Earth fixes (#5937)
* [Companion][LogsDialog] Use relative path for Google Earth track icon (fixes #5080); Use detached process to launch GE (does not restart GE for every export, does not keep handle to GE process); Fix typo in warning message.

* [LogsDialog] Use GE export file path as base for icon path (don't assume TempDir); Fix auto-connection warning from Qt due to misnamed function; Remove redundant check for existing GE file.
2018-06-03 23:19:25 +02:00
Raphael Coeffic a6afbebc94 support for CLI (over USB CDC) without DEBUG (#5940) 2018-06-03 23:17:29 +02:00
Max Paperno 487c0de90f [Companion][InputsPanel] Fix "ghost" input names being left over when moving items (closes #5740); Cut/paste and drag-move will now also copy the input name if destination input is nameless and source input becomes empty (will not duplicate names); Clean up/simplify some code. (#5942) 2018-06-03 23:16:20 +02:00
Max Paperno c19b1a65bf [Companion][MdiChild] Possible fix for "disappearing" toolbars in file editor windows. 2018-06-03 15:42:52 -04:00
Max Paperno cd8f006d31 [Companion] HardwarePanel - fix saving of Bluetooth Mode selection (and related Qt warning), introduced in a87722b. 2018-06-02 21:10:51 -04:00
Max Paperno 40c5f0432c [Companion] AutoComboBox - fix possible crash with null field. 2018-06-02 21:10:51 -04:00
Bertrand Songis 6c51026357 Update CREDITS.txt 2018-06-02 21:31:21 +02:00
Bertrand Songis 806715e166 Bsongis/companion r9m fixes (#5914)
* Cosmetics

* First part ...

* First part ...

* Second part ...

* End?

* Handle new  R9M and R9M lite

* Display 'mini' module in case of R9M and xlite
2018-06-02 18:16:51 +02:00
Arne Schwabe 0e1a6bd60b Add issue templates (#5922) 2018-06-02 18:16:31 +02:00
Neil Horne 48f804210c Use fixed width font for checklist (#5925) 2018-06-02 18:15:53 +02:00
3djc a87722b078 Add BT mode handling (#5926)
Enable BT for Xlite and X7
2018-06-02 18:15:37 +02:00
Arne Schwabe e3f2664440 Update multi protocol definitions (#5930) 2018-06-02 18:15:13 +02:00
Arne Schwabe ce77fbd2ff No longer use deprecated qt5_use_modules (#5931)
QT 5.11 finally removes the qt5_use_modules macro.
Instead target_link_libraries with the Qt5::Lib added should be used.
Since we already use that in one place, it should work everywhere. Since
the common companion lib already depends on Core, widges and multimedia
components that link against it, also implicitly link against those
libraries.
2018-06-02 18:14:49 +02:00
Bertrand Songis 9612d6e347 Update CREDITS.txt 2018-05-31 20:53:12 +02:00
mhotar dd4cc710f2 Xlite simu images with transparency 2018-05-31 01:21:55 +02:00
3djc db9420e715 Adjust antenna selection text to actual radio capabilities 2018-05-30 10:10:35 +02:00
3djc f2c82a6262 Remove warning 2018-05-30 09:41:22 +02:00
Kilrah d23dd5b430 Antenna selection missing in companion for xlite 2018-05-30 09:24:36 +02:00
3djc 6d649279c8 Remove potentially misleading message. Fixes #5918 2018-05-30 08:40:39 +02:00
Kilrah 2cd4e6acfa Horus UI cosmetics 2018-05-27 17:57:03 +02:00
Kilrah b8e9d5542d Xlite LRUD key REPT events were missing in lua 2018-05-27 12:01:28 +02:00
Kilrah 487bf8bce7 Xlite can now change telemetry screens 2018-05-27 11:34:47 +02:00
3djc 535e41d43e Add required keyword for xlite. Fix #5909 2018-05-26 08:51:08 +02:00
Kilrah adbeb30c8b Remove inactive trims from Xlite right simu stick (TODO something nicer) 2018-05-24 21:01:35 +02:00
Sebastien Charpentier fc9ca545ad Fr translation update (#5906)
* Initial version

* Updated French translation

* 1 space was missing.

* - Translate last remaining field.
- Fixed F.In/F.Out translation.
2018-05-24 18:13:41 +02:00
Kilrah 3680b93d89 Fix compilation warning / code errors 2018-05-23 19:40:55 +02:00
Andre Bernet dba05e9adf Add missing simulators to linux companion build script 2018-05-23 19:03:38 +02:00
3djc ce344bc704 Cleanup 2018-05-23 17:12:48 +02:00
Kilrah 1df88dcb5f Disable option until implemented 2018-05-23 14:12:18 +02:00
Raphael Coeffic 3665d2afb4 added X9E navigation to the crossfire scripts (#5904)
Submitted on behalf of @aguindehi

fixes #5893
2018-05-23 08:10:35 +02:00
Kilrah ffb6b1a6fd Doc 2018-05-22 23:12:12 +02:00
Kilrah a1de19c105 Xlite simu shift working, dirty hack to get mouse wheel to do the right thing 2018-05-22 23:09:32 +02:00
Kilrah 31073fc0a9 Add X-Lite to simu build scripts 2018-05-22 22:35:45 +02:00
Kilrah 5fefc69eb6 Cosmetics 2018-05-22 22:29:08 +02:00
Kilrah f0bea027c1 Match voltage settings and fix simu giving voltage below default min 2018-05-22 22:27:59 +02:00
Andre Bernet 7ce17c56a2 Directory case issue 2018-05-22 21:46:15 +02:00
Kilrah e4fc76503c VC++ compilation 2018-05-22 21:29:55 +02:00
Kilrah d181050706 Cleanup 2018-05-22 21:09:50 +02:00
Kilrah a93692ee59 Xlite simulator WIP 2018-05-22 20:53:55 +02:00
Kilrah 88c72e0cb9 VC++ compilation 2018-05-22 19:29:48 +02:00
Raphael Coeffic 7379f6064e Horus: add receiver number check (#5841)
* add receiver number check for Horus

* find the first free model ID on LONG ENTER

* use the next free model ID for new models

* improve free model ID support for std LCD as well

* fixed “duplicate model”

* fixed ModelsList::isModelIdUnique()
2018-05-21 19:03:51 +02:00
Raphael Coeffic ea898e5122 [Horus] font fixes (#5901)
* avoid generating a blank part for font size that do not have extras

* use “stretch” instead of “jessie”

.. and add libgtest-dev.

* keep space width equal 4, no matter what

* updated generated fonts

* updated reference images

* Replace PyQt completely (#5902)

* ported img2lbm.py to Pillow (and get rid of PyQt)

* removed PyQt from Dockerfile

* fixed travis

* fixed issue with img2lbm and Horus bitmaps
2018-05-21 19:03:15 +02:00
Sebastien Charpentier 842b04627a DE Translation (#5892)
* Initial version.

* I'm pushing DE update on behalf of Helmut Renz.

* Version 2 of translation
2018-05-21 14:27:59 +02:00
Kilrah a368d74619 Revert "Xlite PPM/Heartbeat trainer input (#5881)"
This reverts commit 25049d041d.
2018-05-21 11:17:19 +02:00
mhotar 899240d2ac Xlite simu images
..someone should do the coding magic here :)
2018-05-21 10:50:04 +02:00
Raphael Coeffic 526f460cd4 Generate font bitmaps without Qt (using Python Pillow) (#5891)
* Generate font bitmaps without Qt (using Python Pillow)
* Roboto font now default
2018-05-21 10:45:13 +02:00
Andre Bernet 8e7e036591 Potential fix for #5895 (#5897)
Fixes #5895
2018-05-21 10:43:44 +02:00
Bertrand Songis 993e543162 Bsongis/issue 5896 (#5898)
* Fixes #5896
* No voltage alarm during X-Lite debugging ...
* Some cleanups
2018-05-21 10:40:34 +02:00
marbalon 1b3897a425 Validate RSSI instance to allow user defined RSSI source (issue #5842) (#5846) 2018-05-21 10:37:09 +02:00
Neil Horne 2f91eba85d Model print and compare user customisable style (#5866)
* New feature: Model print and compare customisable style

* Layout cosmetics.

* File handling tweak
Message cosmetics
2018-05-21 10:07:49 +02:00
Andre Bernet 25049d041d Xlite PPM/Heartbeat trainer input (#5881)
* Xlite PPM/Heartbeat trainer input

* UI adaptations

* Sky9x has no trainer settings!
2018-05-21 10:06:59 +02:00
3djc ae1aff6863 Fix scrolling on x7 model setup screen when pot warn is set to off 2018-05-20 15:45:06 +02:00
3djc 9227edac18 Revert "Fix #5896 (xlite center beep config missing last collumn)"
This reverts commit f5d61306c9.
2018-05-18 12:42:45 +02:00
3djc f5d61306c9 Fix #5896 (xlite center beep config missing last collumn) 2018-05-18 12:39:41 +02:00
Bertrand Songis 396b5fb270 Update CREDITS.txt 2018-05-17 18:11:17 +02:00
Bertrand Songis d2c0b0e0f5 Update CREDITS.txt 2018-05-16 08:34:57 +02:00
3djc 8366d6ec2a R9M Lite FCC has only one power mode (#5887)
* R9M Lite FCC has only one power mode

* Increase code reliability if new option changes are introduced
2018-05-15 16:41:56 +02:00
Bertrand Songis 0eeb197c81 Update CREDITS.txt 2018-05-14 18:47:38 +02:00
Kilrah 065c5916b7 Update all translations (getting close) 2018-05-13 21:26:56 +02:00
Sebastien Charpentier 0e93a43ab5 Updated French translation (#5886)
* Initial version

* Updated French Translation

* Clarification
2018-05-13 21:25:29 +02:00
Bertrand Songis fd3f2eb1e5 Compilation fix 2018-05-10 13:57:52 +02:00
3djc 46881aff2e Prep work 2018-05-10 09:33:56 +02:00
Bertrand Songis db276cecbf S.PORT flash on all available interfaces (possibly 3) 2018-05-10 08:22:39 +02:00
Bertrand Songis 0c7add8f8e Bsongis/travis fail (#5882)
Travis again here
2018-05-10 08:20:55 +02:00
3djc 6896381ab2 Bumping SD version so it does not get forgotten 2018-05-09 10:50:24 +02:00
Raphael Coeffic 56d040ee06 Reset backlight timer on rotary encoder (keys mode) (#5874)
* horus: reset backlight timer on rotary encoder (keys mode)
* taranis: reset backlight timer on rotary encoder (keys mode)
2018-05-08 22:39:02 +02:00
Raphael Coeffic 462f6244aa fixes #5870 (#5876)
fixes #5870
2018-05-08 22:33:58 +02:00
Raphael Coeffic 54d430f3c5 [X10] mute audio when fifo buffer is empty (#5875)
* [X10] mute audio when fifo buffer is empty
* do not push audio data if volume is muted.
2018-05-08 22:27:19 +02:00
3djc f2d444e2d5 some xlite peripheral settings (#5877)
* Refine xlite compilation options

* noras is for 9d+ only
2018-05-08 22:19:04 +02:00
3djc 23e2e3743c Future R9MEU firmware preparation (#5869)
PXX update for R9M FCC/EU
2018-05-07 21:54:20 +02:00
Alexander Novikov 2d207b528a Added: "thousand" and "thousands" (system sounds, Russian voice) (#5872)
Fixed: pronunciation of some phrases (Ru)
Added: some extra voice messages (Ru): flight modes/statuses etc
2018-05-07 21:52:07 +02:00
Kilrah 843f17e56f Merge remote-tracking branch 'origin/3djc/xlite-swwarning-fix' into 2.2 2018-05-07 10:36:59 +02:00
3djc 9915a1fd3a Make xlite sw toggle warning more natural 2018-05-07 10:33:51 +02:00
3djc 3334e06ec6 Fix xlite POTS 2018-05-07 09:59:52 +02:00
Kilrah 78e0a4ff1e PPM center was displayed wrong on 128x64 2018-05-07 09:42:49 +02:00
3djc b5d6761fe4 Fix missing column on xlite 2018-05-07 09:38:51 +02:00
Raphael Coeffic b29352b816 fixes trim re-use for T5 & T6 (#5873) 2018-05-06 21:42:43 +02:00
3djc a778116b9a Dirty fix (but can we do any better ?) (#5863) 2018-05-04 15:10:08 +02:00
Bertrand Songis 1afaded712 [Xlite] Either ADC or PWM used for sticks (similar to X10) (#5867) 2018-05-04 13:58:47 +02:00
3djc c7e63f52ce Update Travis QT version 2018-05-03 12:47:06 +02:00
Bertrand Songis 5696165d66 Update CREDITS.txt 2018-05-02 16:04:54 +02:00
qba667 2ef3d72c72 LEFT and RIGHT working for navigation again. 2018-05-01 15:45:08 +02:00
qba667 33807621bc Boot success. Mixed disabled. 2018-05-01 13:42:28 +02:00
Bertrand Songis cfc02f67eb Bsongis/xlite pxx (#5856)
Pulses refactoring
2018-04-29 22:55:29 +02:00
3djc 6ec64b227c 3djc/xlite sf nav (#5855)
* Another nav

* Fix popup

* Cosmetics
2018-04-29 22:17:27 +02:00
Bertrand Songis 5ca7cbc91e Update CREDITS.txt 2018-04-29 18:53:26 +02:00
qba667 bb51e7c0f6 Boot on M0 completed. 2018-04-29 14:33:01 +02:00
Kilrah 6ada5d46b0 Better trainer mode default on Xlite 2018-04-29 11:20:08 +02:00
Andre Bernet 69bf7b3cd3 Always map xlite primary trims to Aileron/Elev (#5852) 2018-04-28 15:51:29 +02:00
Kilrah b386dd23fb Fix fast value edit 2018-04-27 12:56:28 +02:00
Kilrah fd4e03c565 Correct switch support 2018-04-27 12:46:06 +02:00
Kilrah 15c5898488 Fix SF Play Track on SC-SD 2018-04-27 12:35:24 +02:00
Bertrand Songis a0c1beb61f [X-Lite] Next round of changes (#5847)
* [X-Lite] PXX is now sent every 4ms
* New option PXX_FREQUENCY (HIGH / LOW)
* [X-Lite] It now sends 16 channels per 4ms
2018-04-27 08:45:00 +02:00
3djc 7979401675 Remove unneeded test 2018-04-26 19:29:35 +02:00
3djc 09e6fde327 Fix broken name edition (@bsongis please double check) 2018-04-26 10:22:09 +02:00
3djc a2518c1156 fix sxr xlite 2018-04-26 09:57:16 +02:00
3djc f70dba5e6e 'shift' less nav 2018-04-26 09:19:34 +02:00
Bertrand Songis 99604dccc9 XLite support (#5806) 2018-04-25 23:07:04 +02:00
Sebastien Charpentier 37f96d452a Fr Translation (#5845)
* Fixed few typos.

* CFN (Custom Fonction N) translation.

* Removed useless dot.
2018-04-25 19:14:14 +02:00
Bertrand Songis 584a4e082e Update CREDITS.txt 2018-04-25 13:05:06 +02:00
Jesper Frickmann d59a853f0c Issue #5696 (#5698)
When an "Adjust GV" special function is reusing trim buttons to increase/decrease GVs, then the trim limits are applied instead of GV limits. This patch applies the GV limits.
2018-04-25 08:04:43 +02:00
Raphael Coeffic 2ad0db2d80 Set all custom failsafe channels at once (#5834)
* added setCustomFailsafe()

* failsafe setup: set all custom channels with ENTER long press

implements #5820

* added “outputs -> failsafe” menu item on horus

* change “Trims >> Subtrims” to “Trims => Subtrims”

* use translated string for “Outputs => Failsafe”

* fixed entered TR_TRIMS2OFFSETS and TR_OUTPUTS2FAILSAFE

When using ZCHARs in Horus texts, there are some artefacts when highlighted.

* added “outputs -> failsafe” menu item on taranis 212x64 LCD

* added “outputs -> failsafe” menu item on taranis 128x64 LCD

* fixed indentation
2018-04-24 08:13:09 +02:00
qba667 9a66d29b6b Merge branch 'M0' of https://github.com/qba667/opentx into M0 2018-04-23 18:22:44 +02:00
qba667 2cb53563f2 Using --specs=nano.specs 2018-04-23 18:22:09 +02:00
3djc 4f8f00c4e2 Make cut use mixer instead of override (#5799)
Make cut use mixer instead of override
2018-04-23 13:15:14 +02:00
Raphael Coeffic 697403b841 fixed PIXEL_PTR() macro on X10
fixes #5764
2018-04-22 12:06:20 +02:00
Jakub 43add842ae Unused modules removed.
Telemetry sensors limited to 16
MSC_MEDIA_PACKET set to 128
Serial2 disabled
Menu stack reduced
2018-04-19 14:45:27 +02:00
Jakub b4b6e064f3 Using nano.specs but not bin allocator. 2018-04-19 13:42:20 +02:00
Jakub 44bbcd9c06 Using AVR sound on STM32F0 2018-04-19 13:27:09 +02:00
Bertrand Songis 1f8ebea10c Update CREDITS.txt 2018-04-18 15:42:56 +02:00
Bertrand Songis fb4bc0a528 Update CREDITS.txt 2018-04-18 15:42:33 +02:00
Andre Bernet 01c37701d9 New chat URL 2018-04-18 16:50:38 +04:00
Jakub 23c1d39bc4 PXX removed for M0 2018-04-18 12:22:42 +02:00
3djc 5b15481138 Update README.md 2018-04-17 12:21:50 +02:00
Sebastien Charpentier 8f8b809756 Updated French Translation (#5832)
* Initial version

* Updated French translation
2018-04-16 22:48:39 +02:00
qba667 a13f6f4dd9 Try to fit into STM32F091 2018-04-16 21:34:01 +02:00
Raphael Coeffic 29cbeb8782 add boot version tag to taranis bootloader (#5831)
Allows for detecting the bootloader at the beginning of firmware.

fixes #5826
2018-04-16 07:30:09 +04:00
qba667 ea55b42bc8 Compiling without errors. 2018-04-15 18:19:29 +02:00
3djc 746a2ae528 Improve switch warning UI for 128x64 Taranis (#5822)
* - Match X9 behavior
- Made to handle replacing SH by a two pos and the future two additional switches
- Use string tables to find switch standard designation

* Compile fix
2018-04-15 09:47:35 +02:00
Bertrand Songis 9c4a81a6ee Fixes #5816 (#5830) 2018-04-15 09:46:17 +02:00
Bertrand Songis bae00c0e20 Update CREDITS.txt 2018-04-12 22:12:41 +02:00
3djc 1835cb12be Fix small negative GPS values (#5810) 2018-04-12 22:05:15 +04:00
Max Paperno 9e4a0680ab [Simulator] Add mixes display to Radio Outputs widget (#5811)
* [Simulator] Add mixes output display to RadioOutputsWidget (closes #2655).

* Add proper limits reporting & representation for channel and mix values in RadioOutputsWidget.
2018-04-12 22:02:27 +04:00
Raphael Coeffic 7b12c99a0b bootloader: use software reset instead of jump (#5823)
fixes #5627
2018-04-12 20:49:50 +04:00
Bertrand Songis 39c5d65f76 Update CREDITS.txt 2018-04-11 21:53:29 +02:00
Bertrand Songis 5f91426fec Update CREDITS.txt 2018-04-10 17:57:26 +02:00
Jakub 3049096b3e porting backup 2018-04-10 16:54:06 +02:00
3djc 910fc28dce Rework BL behavior for Horus (#5813) 2018-04-10 11:40:45 +02:00
qba667 2a57b9317c Target added 2018-04-10 07:20:47 +02:00
qba667 64e79d6a78 Working copy 2018-04-10 07:20:21 +02:00
Bertrand Songis f79703e7fd Update CREDITS.txt 2018-04-08 21:09:38 +02:00
qba667 73e72be323 Common files added for F0 2018-04-08 13:57:16 +02:00
qba667 16009cfde9 CoOS added config for M0 2018-04-08 13:54:33 +02:00
qba667 99369facbf STM32F0xx_StdPeriph_Lib_V1.5.0 added 2018-04-08 13:53:13 +02:00
Bertrand Songis 85a2a575a3 Update CREDITS.txt 2018-04-07 08:33:08 +02:00
3djc a07f37e99d Merge pull request #5805 from opentx/LapinFou/Fr_Translation
Updated French translation
2018-04-05 20:17:39 +02:00
LapinFou 3d0fd81cc4 Fixed wrong (and confusing) translation. 2018-04-05 20:10:17 +02:00
Bertrand Songis ec463819fe Bsongis/xlite fixes (#5803)
X-Lite fixes
2018-04-04 23:40:21 +02:00
Bertrand Songis fabee0e675 X-Lite bootloader 2018-04-04 16:01:15 +02:00
3djc 1b005c83eb Review newAntennaSel 2018-04-04 11:29:34 +02:00
Bertrand Songis c7e882e97d X-Lite external antenna on internal module 2018-04-04 11:05:07 +02:00
Bertrand Songis 0c09c07cd2 xlite antenna selection menu (#5801) 2018-04-04 11:00:24 +02:00
3djc b02344ffc5 Rework Horus BL handling (#5800) 2018-04-03 23:05:27 +02:00
Bertrand Songis 329b753df5 XLite REV 0.2 support (#5785)
XLite REV 0.2 support
2018-04-02 20:37:34 +02:00
3djc 6535ccbdd8 Improve RSSI shutdown display message on Horus (#5782)
Improve RSSI shutdown display message on Horus
2018-04-02 17:11:45 +02:00
Martin Hotar 6a7ed83f6a horus mask_iconback fixed (#5795)
mask_iconback in modelsel did not fit to the category text size
2018-04-02 17:04:09 +02:00
Bertrand Songis a1863b9fed Update CREDITS.txt 2018-04-01 14:54:09 +02:00
Bertrand Songis 5af04b84f0 Update CREDITS.txt 2018-03-31 10:03:00 +02:00
Bertrand Songis f11de747de Update CREDITS.txt 2018-03-29 07:28:18 +02:00
3djc e51eae5203 Merge pull request #5788 from opentx/LapinFou/Fr_Translation
Updated French translation
2018-03-28 22:08:07 +02:00
LapinFou a3838e1023 Update French translation 2018-03-28 21:28:03 +02:00
LapinFou fb6790c4f5 Initial version 2018-03-28 21:18:08 +02:00
Bertrand Songis 93ca928e98 Update CREDITS.txt 2018-03-28 19:14:31 +02:00
Bertrand Songis 40cd40cebd Update CREDITS.txt 2018-03-26 18:19:23 +02:00
Bertrand Songis 59f680048b Update CREDITS.txt 2018-03-25 23:55:05 +02:00
Neil Horne 33998c2981 Add Companion Outputs context menu (#5665)
* Start of cut copy paste delete

* Outputs context menu continued

* Mods from testing

* Add tool tip to channel label
2018-03-25 09:44:41 +02:00
Alexander Novikov 6e756c434a Fixed: compilation if SIMU_DISKIO = ON (#5723) 2018-03-25 09:39:17 +02:00
3djc b00c4e30d0 Use first persistant timer as display value in Horus modelselect (#5772)
[Horus] When selecting model, displays first permanent timer or 00:00 if none exist
2018-03-25 09:33:55 +02:00
3djc 0025c01024 Add mixer warning UI to Horus (#5780) 2018-03-25 09:21:40 +02:00
Bertrand Songis 05c7fbeb0b Update CREDITS.txt 2018-03-22 18:54:27 +01:00
Bertrand Songis 84c4b3c1b8 Missing x100 factor for ESC RPMs 2018-03-21 18:56:41 +01:00
3djc d76c693147 Improve some messsages (#5778) 2018-03-21 18:48:23 +01:00
Bertrand Songis b331363de1 Update CREDITS.txt 2018-03-19 19:36:35 +01:00
Bertrand Songis daad94eedb Update CREDITS.txt 2018-03-18 18:01:33 +01:00
Bertrand Songis 2b604a49ea FrSky new sensors support (#5766)
FrSky new sensors support
2018-03-17 22:50:06 +01:00
Bertrand Songis 2415418dca Update CREDITS.txt 2018-03-17 22:28:44 +01:00
3djc 1ffc4b9f7f Fix for S6R that are not showing quick mode for unknown reason (#5768) 2018-03-17 18:20:42 +04:00
Bertrand Songis dd5fb2cf88 Update CREDITS.txt 2018-03-16 20:28:54 +01:00
Bertrand Songis cdb2b2e1a7 Update CREDITS.txt 2018-03-13 21:05:24 +01:00
Arne Schwabe 14ea97337b Fix translation of remotes (closes #5760) (#5762) 2018-03-13 21:25:24 +04:00
3djc 533225f106 Merge pull request #5755 from opentx/LapinFou/Fr_Translation
Updated French translation
2018-03-10 19:19:38 +01:00
LapinFou 760b5ad276 Updated French translation. 2018-03-10 18:20:43 +01:00
LapinFou b5d689f39f Initial version 2018-03-10 18:13:21 +01:00
Bertrand Songis e5203b6e4a Update CREDITS.txt 2018-03-09 18:21:37 +01:00
Bertrand Songis a9d787b340 Update CREDITS.txt 2018-03-08 20:45:28 +01:00
Bertrand Songis 05144f39df Update CREDITS.txt 2018-03-06 17:29:54 +01:00
3djc 6bd38ce13a Replicate center trim beep behavior also when crossing trims (#5693)
* Replicate center trim beep behavior also when crossing trims

* Cosmetics
2018-03-04 13:11:22 +01:00
3djc a9716a340d For tests (#5702) 2018-03-04 13:10:35 +01:00
3djc 4a88660a3d Allow more the 2 hours digits for TIMEHOUR (#5715)
* Handle 3 digits or more in TIMEHOUR

* Cleanup
2018-03-04 13:09:59 +01:00
Andre Bernet da5af2cac2 Merge pull request #5742 from opentx/3djc/r9m-internall-ppm
Fix R9M missing bind when internal ppm is selected
2018-03-04 13:09:09 +01:00
Andre Bernet f7756d7d4d Merge pull request #5746 from opentx/3djc/fix-version-display
Fix UUID display on version screen
2018-03-04 13:04:34 +01:00
3djc a7a6a3d124 Lets not get something you can't display ! 2018-03-04 13:00:19 +01:00
3djc c905ed0338 Refresh UUID each run 2018-03-04 10:19:47 +01:00
3djc 455093ca23 Adapt FAI warning message 2018-03-03 18:58:08 +01:00
3djc cbf596e410 Remove internalppm from x7 options since it was never coded into 128 gui 2018-03-03 08:50:09 +01:00
3djc 78b3c5ec3f TARANIS_INTERNAL_PPM fixes 2018-03-02 16:01:01 +01:00
3djc 236b8991f6 Merge pull request #5736 from opentx/3djc/faimode-review
FAI mode reworks
2018-03-02 10:10:06 +01:00
3djc c8d9d18537 Fine tune 2018-03-02 08:29:41 +01:00
Bertrand Songis 3d7cca91ff Update CREDITS.txt 2018-02-28 22:56:38 +01:00
3djc 09a391dbf4 Crossfire compile fixes 2018-02-28 19:36:23 +01:00
3djc 9e0d29db1a Completely untested crossfire 2018-02-28 19:11:46 +01:00
3djc fcf32c82ba multi protocol 2018-02-28 18:09:18 +01:00
3djc 3ea835117a RxBt is allowed too 2018-02-28 17:46:47 +01:00
3djc 90ebc1a8be AVR compilation fix 2018-02-28 12:58:55 +01:00
3djc af7183151c Restore access from LUA since values are controled 2018-02-28 12:32:47 +01:00
3djc b8cb379234 Display telem screen is now ok since we control values 2018-02-28 12:30:06 +01:00
3djc fdf4d4926f POC for review and discussion 2018-02-28 11:34:32 +01:00
Kilrah 4cccff934f AVR version handling issues 2018-02-26 20:31:20 +01:00
Bertrand Songis 52e3a3fc15 Update CREDITS.txt 2018-02-25 20:54:55 +01:00
tgreer 4b7f822848 added case for UNIT_TEXT used by crossfire FM Sensor (#5724) 2018-02-25 01:18:23 +01:00
Jim Taylor a35ffe16cc Fix Issue 5633 - Workaround for Linux QT Styles (Breeze, Oxygen, ?) returning bad rect width. (#5695)
* Fix Issue 5633 - Workaround for Linux QT Styles (Breeze, Oxygen, ?) returning bad rect width.
2018-02-20 01:25:54 -05:00
Bertrand Songis 3785e24077 Update CREDITS.txt 2018-02-18 17:24:06 +01:00
Bertrand Songis 82ba845fc7 Update CREDITS.txt 2018-02-18 09:59:37 +01:00
Bertrand Songis a113154708 Update CREDITS.txt 2018-02-15 08:21:15 +01:00
3djc 11c2440dcd Small cleanup 2018-02-13 13:12:49 +01:00
3djc 17f686f39c Merge pull request #5689 from opentx/LapinFou/FixedWizard
Fixed Wizard Lua scripts for Horus radios.
2018-02-12 16:54:18 +01:00
LapinFou f498b54648 Fixed Wizard Lua script for Horus radios. 2018-02-12 16:29:45 +01:00
Kilrah 06141feb8b Translations 2018-02-11 23:46:19 +01:00
3djc b74b005215 Rename confusing Master/Battery to Master/Serial (#5663) 2018-02-11 23:43:12 +01:00
Kilrah 4c212ae507 Translations 2018-02-11 23:42:56 +01:00
3djc 1ebd2894c2 Apply THR trim when cross triming (#5664) 2018-02-11 23:26:29 +01:00
3djc d3951235bd Add gtimer support to LUA (#5669)
* Add gtimer support to LUA

* Copy/paste issue
2018-02-11 23:25:04 +01:00
3djc 073e1a8462 Align X9E audio definitions to ana inputs (#5687) 2018-02-11 23:23:40 +01:00
3djc 4cf257b997 Display only timer name if defined (#5684) 2018-02-11 23:23:19 +01:00
Bertrand Songis 51db756385 Update CREDITS.txt 2018-02-11 09:07:10 +01:00
3djc fc4d70a5e9 Fix tts generation on the new server 2018-02-10 13:22:41 +01:00
Bertrand Songis a73d8bc8f4 Update CREDITS.txt 2018-02-10 08:45:49 +01:00
3djc dc0b5838b1 Trigger SD card version change for S8R scripts 2018-02-09 08:26:06 +01:00
3djc afb0ca384a Compensate for S8R firmware bug
This fixes #5677
2018-02-08 19:14:09 +01:00
Bertrand Songis 817f81ebb2 Update CREDITS.txt 2018-02-08 18:51:45 +01:00
3djc 119b367205 128x64 GVAR support update (#5675)
* POC for usability feedbacks

* Working version for tests

* Remove tests leftover

* Make Travis happy ?

* Gvar popup handling
2018-02-07 20:44:04 +01:00
Bertrand Songis 975ecd0b9d Update CREDITS.txt 2018-02-07 13:00:14 +01:00
3djc 13c0b4b5f6 Update fr.h.txt 2018-02-05 20:48:37 +01:00
3djc 25d1cf4455 French translation. This fixes #5667 2018-02-05 07:40:33 +01:00
Bertrand Songis cd456a9a60 Update CREDITS.txt 2018-02-04 09:12:58 +01:00
Bertrand Songis cae1dd964d Update CREDITS.txt 2018-01-31 22:43:14 +01:00
Sebastien Charpentier 16a3bf10c8 Updated French translations. (#5659)
* Initial version

* Updated French translations.
2018-01-29 10:35:25 +01:00
Bertrand Songis 5e0f93210d Update CREDITS.txt 2018-01-28 07:49:39 +01:00
Bertrand Songis 2396a2b2e5 Update CREDITS.txt 2018-01-27 21:06:24 +01:00
Bertrand Songis 4dfbb9e597 Update CREDITS.txt 2018-01-26 19:20:22 +01:00
Bertrand Songis 6af5f94f90 Flash savings on 9X 2018-01-26 19:06:59 +01:00
Arne Schwabe 4925e756a6 Save memory (move usb mass storage buffer to reusableBuffer) (#5579)
* Save 128 byte by moving variable to stack

* Make usb mass storage buffer smaller on F2 processors and put into reuseablebuffer

- Lower USB mass storage buffer to 512 bytes per default on F2
  targets, makes usb speed slightly slower ~600 kB/s instead ~700 KB/s
  in my tests, saving 3584 bytes
- Save another ~300 bytes by putting that buffer into reusableBuffer

* Don't put id into reusuableBuffer

All uses of id can be on the stack as well. Makes no difference for ram usage but makes it safer to reuse reusableBuffer

* Only link cdc serial when needed

We always linked usb cdc even in non debug builds. CDC uses about ~600 byte of RAM for its buffers and structures.
2018-01-26 19:00:47 +01:00
3djc 95df593c2f Align python crossfire parser to c equivalent (#5595)
Align python Crossfire parser to C equivalent
2018-01-26 18:57:34 +01:00
3djc 8be6818a6d Fix custom scripts outputs handling (#5601) 2018-01-26 18:56:02 +01:00
3djc fcc3cd369e First draft of glider wiz (#5603) 2018-01-26 18:54:53 +01:00
3djc 87eec92c5d Expose more internal GPS data to lua (#5628) 2018-01-26 18:54:22 +01:00
Neil Horne d745e14cb5 Model print telemetry (#5645)
Model Print Telemetry
2018-01-26 18:53:15 +01:00
3djc 3355d41642 X7 : add missing trainer mode (#5652) 2018-01-26 18:51:25 +01:00
Bertrand Songis 0832a5c254 X-Lite PWM sticks (#5632)
X-Lite PWM sticks
2018-01-26 18:50:39 +01:00
Kilrah c7df47703e Translation cosmetics 2018-01-26 11:36:13 +01:00
Bertrand Songis a1ee9f865f Update CREDITS.txt 2018-01-25 11:44:03 +01:00
Bertrand Songis 1033e9fe96 Update CREDITS.txt 2018-01-20 21:58:31 +01:00
3djc 323b30a14b Fix companion x7 radio data and model read (#5638)
* Fix

* Typo
2018-01-19 13:46:44 +01:00
Bertrand Songis 2a2c0420a7 Update CREDITS.txt 2018-01-19 07:39:42 +01:00
Bertrand Songis f78704af93 Update CREDITS.txt 2018-01-18 19:06:54 +01:00
Bertrand Songis 34e61c45c9 Update CREDITS.txt 2018-01-17 09:08:58 +01:00
Bertrand Songis a1951f9756 Update CREDITS.txt 2018-01-16 08:05:21 +01:00
Bertrand Songis c96dc403b9 Update CREDITS.txt 2018-01-15 20:32:29 +01:00
Bertrand Songis 48f05f97b7 Update CREDITS.txt 2018-01-13 09:02:31 +01:00
Bertrand Songis 3208946017 Update CREDITS.txt 2018-01-12 14:33:03 +01:00
Bertrand Songis 7052f9504a Update CREDITS.txt 2018-01-10 08:28:06 +01:00
3djc 45d1755e19 X12S : give internal GPS access to LUA (#5610)
* Initial test

* Tested version

* Cosmetics
2018-01-08 15:12:28 +01:00
Kilrah bf29ebc354 Currently no working Bluetooth implementation on sky9x family 2018-01-06 13:21:09 +01:00
3djc e50fc2022f Fix #5558 2018-01-05 19:45:51 +01:00
Max Paperno a63e0eed4c [Companion] Fix logical switch misnumbering since a951292 (closes #5597). 2018-01-05 07:27:30 -05:00
Bertrand Songis 1218c9fa7d Update CREDITS.txt 2018-01-04 18:32:37 +01:00
3djc e50d10bfe6 Review crossfire python parser (reverted from commit 18a9758511) 2018-01-04 14:24:00 +01:00
3djc 18a9758511 Review crossfire python parser 2018-01-04 14:20:54 +01:00
3djc fcd8f05c3c X9 : Do not display timer name on telemetry page top bar (#5588)
* Do not display timer name on telemetry page top bar

* Size does matter, after all
2018-01-03 16:18:25 +01:00
Sebastien Charpentier 56afc57b7b Updated French translation (#5589)
* Initial version.

* Updated French Translation.
2018-01-03 16:17:23 +01:00
Bertrand Songis b3a0befe33 Update CREDITS.txt 2018-01-03 00:01:24 +01:00
3djc 669dfe73a4 x10 antenna is either int or ext (#5585)
* Differentiate x10 and x12

* Cosmetics
2018-01-02 14:38:15 +01:00
Bertrand Songis c4001c8507 Bsongis/frsky xlite (#5574)
FrSky X-Lite support added
2018-01-02 14:36:48 +01:00
Bertrand Songis 269831e0c4 Fixes #5502 (#5575)
* Fixes #5502

* RAS renamed to SWR
2018-01-02 10:41:15 +01:00
Bertrand Songis b22fa48e90 Update CREDITS.txt 2018-01-02 10:39:13 +01:00
Max Paperno 397388d230 Add .user files to gitignore [ci skip] 2018-01-02 02:26:43 -05:00
Max Paperno f5de319f40 [Companion] Remember last used log folder in Telemetry Simulator (fixes #5583). 2018-01-01 22:50:52 -05:00
Bertrand Songis 1c2fe7b9a6 Update CREDITS.txt 2017-12-30 21:23:58 +01:00
Sebastien Charpentier c545a2f0ed Updated French Translation. (#5580)
* Initial version

* Updated French translation.
2017-12-30 15:44:38 +01:00
Arne Schwabe 7f1dea6129 Silence CLangs warnings so -DWARNING_AS_ERROR does not break the build under OS X 2017-12-30 11:16:35 +01:00
Neil Horne 96d9ae4776 Model print enhancements - General settings (#5568)
* General model settings enhancements
* General model settings add custom failsafe settings
2017-12-29 06:19:34 -05:00
3djc 8ee9199abc R9M : activate automatically MODULE telem when possible (#5553)
* Fix #5543

* Auto activate R9M telem

* Adjust radio ui

* Thx @schwabe

* Stop being stupid ?

* PR rework

* [Companion] Removed "Module Telemetry" checkbox.
2017-12-29 09:47:45 +01:00
Bertrand Songis 3cba3a76a4 Sonar completely removed from Travis builds 2017-12-29 01:14:48 +01:00
Alexander Novikov 84d2a22b18 [Companion] Missing "Russian" voice in Radio Settings (#5570) 2017-12-29 01:11:46 +01:00
Sebastien Charpentier 8f87a07f62 Check Fr translations (#5567)
* Initial version.

* Check and updated French Translation.
2017-12-28 15:17:49 +01:00
Bertrand Songis fa9e829f5d Update CREDITS.txt 2017-12-27 20:31:24 +01:00
Bertrand Songis 920faa97d2 Update CREDITS.txt 2017-12-27 09:42:40 +01:00
Max Paperno f018425e12 [Companion] Qualify all translation strings (#5557)
* [Companion] Qualify all remaining QObject translations with proper class/object names; Centralize some common strings into constants.h.

* [Companion] Replace all instances of some common strings with macros from constants.h.

* [Companion] Fix translation warnings from lupdate.
2017-12-25 13:36:34 +01:00
3djc ad0f727880 128x64 Display RAS when needed (#5563)
* Display RAS when needed on 128x64

* AVR compile fixes
2017-12-25 13:34:54 +01:00
3djc 9696284e1d Make server build use 2 threads 2017-12-24 13:36:06 +01:00
Bertrand Songis 10d733d312 Update CREDITS.txt 2017-12-23 22:40:29 +01:00
3djc e9c2768cc0 Fix compilation in several languages 2017-12-23 10:36:46 +01:00
Bertrand Songis 4f7aba9c05 Revert "Bsongis/sonar (#5555)"
This reverts commit 7806c20
2017-12-22 20:18:21 +01:00
Bertrand Songis 892cece2aa Update CREDITS.txt 2017-12-22 08:05:01 +01:00
Bertrand Songis 7cb3f43862 Update CREDITS.txt 2017-12-21 22:13:54 +01:00
3djc 04ab98a634 Fix for stretch cmake in docker environment 2017-12-21 20:47:24 +01:00
Bertrand Songis 18ff09d52f Update CREDITS.txt 2017-12-21 18:32:11 +01:00
Max Paperno a951292f27 [Companion] Radio data translation/strings (#5554)
* [Companion] Add Qt tr() functions to all radio data classes instead of using generic QObject type.  (no functional changes)

* Small fix for gcc.

* Move more element name string generation to individual classes; settle on nameToString as function name.

* Also put firmware build options translations into Firmware scope.
2017-12-21 18:26:11 +01:00
Bertrand Songis 7806c2096d Bsongis/sonar (#5555)
Some sonar issues fixed
2017-12-21 18:25:27 +01:00
3djc b7855cf14d Fix firmware compile 2017-12-21 13:10:50 +01:00
Bertrand Songis dfb4153049 Update CREDITS.txt 2017-12-21 07:27:00 +01:00
Alexander Novikov 14d5416616 Added: scripts for nightly/rc/release builds (SD card content, Russian voice), Audio normalization, PSV files for TTSAutomate (#5469)
* Added: scripts for nightly build (SD card content, Russian voice), system sounds: done, other sounds: partially
Fixed: gTTS issue with unicode (Cyrillic) chars in command params (gTTS module instead of system command)

* Fixed: gTTS issue with Unicode (Cyrillic) chars in command params (gTTS module instead of system command), for release candidates and release
Changed: SOX params to normalize the audio
Added: "psv" parameter to export list of audio files into PSV format (see TTSAutomate https://github.com/CaffeineAU/TTSAutomate , to generate voice files using TTS engines from Microsoft, Amazon, Google etc)
Added: some extra voice files for RU
2017-12-20 18:30:44 +01:00
Max Paperno 63f6e0c43d Fix Companion build with Qt 5.2. 2017-12-20 11:22:36 -05:00
3djc 8069426b5c Prep 2.2.2N 2017-12-20 13:44:50 +01:00
Max Paperno 59a835b1b3 [Companion] Radio data refactoring (#5551)
* [Companion] Refactor radio data classes to own files, out of eeprominterface.cpp.  No functional changes.

* Move files related to refactoring. No functional or code changes.

* Fix clang warning and an include path.

* Fix indents on curvereference.cpp. [ci skip]
2017-12-20 13:31:43 +01:00
Bertrand Songis 727da06266 Files refactoring + costmetics (#5552) 2017-12-20 11:03:33 +01:00
Max Paperno 38762fb618 Move __attribute__ ((section(s), used)) macro, and cosmetics in definitions.h. (#5549) 2017-12-20 10:19:59 +01:00
3djc aff40dac8d Move a decade forward ! 2017-12-20 09:56:07 +01:00
Max Paperno e097d88ab2 Fix build with CMake < 3.1. 2017-12-20 03:04:50 -05:00
Max Paperno a16e64420e [Companion] Recent files menu: show full path of each file in status bar and tooltips. 2017-12-19 21:21:20 -05:00
Max Paperno 76ee7cdd7f Fix libsimulator builds, especially MSVC. 2017-12-19 17:58:15 -05:00
3djc 0e0ae3c4d1 1 too short (#5542)
* 1 too short

* Let the compiler do it's magic
2017-12-19 18:30:23 +01:00
Max Paperno 76ce186bd4 [Companion] Adjust source value ranges and editors in LS/CF/Telemetry (#5437)
* [Companion] RawSourceRange: Fix for timers and RTC; Remove unused "single precision" flag and logic; Add logic for "short" timer handling.

* [Companion] Add TimerEdit class for editing negative times; Implement TimerEdit in LS, CF, and Telemetry (bars) editors;

* [Companion] Refactor LogicalSwitchesPanel for fewer & more efficient updates; Fix newly-added LS not being available in source lists; Fix bug with timer/rtc comparison values getting reset to value of spin box instead of time editor.

* Add forgotten #include.

* [Companion] LogicalSwitchesPanel: Update raw sources list upon screen refresh (fixes #5374); Improve data entry in spin boxes (fixes #5375).

* Make gcc happy.

* [Companion] Set proper RawSourceRange for GVars, trims, mixer scripts, and sticks/switches/cyclic/MAX.

* [Companion] Fix backwards precision/range logic on telemetry sensors offset spinbox; Fix other minor range issues with ratio & offset.

* [Companion] Remove short limit on min/max timer values for LS & telem. bars.

* Switch to TimerEdit in maxLibQt.

* Fix gcc build.

* Remove unused files.

* Caps fix.
2017-12-19 12:17:49 +01:00
Max Paperno b69f36afe4 [Radio] Adjust value limits for mix sources and update UI for LSs, CFs & telem. (#5445)
* [firmware][ARM] Adjust some value limits for mix sources and update editing UI for LSs, CFs, & telem. bars:
    * Increase timer limits to +/-8:59:59 when used with LSs, CFs, & bars;
    * Increase Lua script output limits to +/-30K;
    * Trim limits based on extended limit model setting;
    * Limit TX voltage to 25.5;
    * Limit TX time comparison value to 29:59m;
    * Use proper GVar limits (user-configured), display precision, & unit in LSs & telem. bars;
    * Display timer values properly with hours (instead of mmm:ss).

* [firmware] getTimerString() would fail with times >= 100min if hours weren't shown.

* Fix builds w/out GVars.
2017-12-19 12:17:12 +01:00
Raphael Coeffic 716a91fc0c allow splash image to be loaded from SD on Horus (#5463)
* allow splash image to be loaded from SD on Horus

* added a new menu entry to assign splash screen
2017-12-19 12:15:03 +01:00
Raphael Coeffic 0d7832b208 Horus bootloader (#5455)
Horus bootloader
2017-12-19 12:13:59 +01:00
Max Paperno 908adb4d2b [sim] Cosmetics for switch position macros (also removes PCBFLAMENCO from simuSetSwitch). (#5474) 2017-12-19 12:13:18 +01:00
Bertrand Songis 7697bcb087 Update CREDITS.txt 2017-12-19 09:40:59 +01:00
Arne Schwabe 975759284d Implement reading firmware on Horus via USB (#5442)
* Add firmware lun target for non EEPROM platforms

* Fix Fat fat tables and make FAT 1024 byte big

* Niceify some constants

* Cleanup (saves 1024 byte of flash) and fix reporting wrong Size of drive

* Silence compiler warning, set right size for flash on X12/X10

* Add firmware.txt/bootload.txt to virtual drive that displays version information

* Report also version of other component (bootloader/firmware)

* Show version also in bootloader and fix F4 platforms

* Save space on X7

* Fix X7 logic

* Compile fix for AVR

* avr-gcc does not like no newline after ifdef

* Really fix avr
2017-12-18 23:19:19 +01:00
Raphael Coeffic d13e770ac4 improved Horus rotary encoder driver and generic behavior (#5510)
Improved Horus rotary encoder driver
2017-12-18 23:12:29 +01:00
3djc 04547a9206 Merge companion and firmware notes, and get them from the server (#5530) 2017-12-18 23:02:40 +01:00
Arne Schwabe 7dd32c8878 Implement s.port polling for multi (#5521)
Sport polling is implemented quite low level for regular s.port.
Go another approach for multi and add another multi type for s.port polling
2017-12-18 23:00:03 +01:00
Arne Schwabe d0ec3e0266 Fix problem with multi frsky fallback (#5496)
* Fix problem with frsky fallback

* Try to fix code style
2017-12-18 22:58:24 +01:00
Max Paperno 0dbad182e8 [Companion] Radio conversion improvements (#5534)
* Move MultiposPots & MultiposPotsPositions capability lookups and getAnalogInputName() to Boards class.

* Add RawSource::isAvailable() and RawSwitch::isAvailable(); Add board type param to various RawSource lookup functions.

* Add CustomFunctionData::toString(), FlightModeData::toString(), FactoryInstalledPots board capability, MAX_SWITCH_TYPE, & break out GeneralSettings source/switch defaults to own function.

* Add RadioDataConversionState class for tracking conversion actions.

* Implement RadioDataConversionState handler, add conversion process report, and improve/fix conversion issues:
    * Make sure all switches/pots/knobs have default configs for destination board type;
    * Try to move more custom control names, intelligently;
    * Convert model timers and throttle source;
    * Adjust for Horus 6P switch in place of Taranis S2 knob;
    * Adjust for extra sliders on X12 and X9E to move LS and RS to proper slots as needed;
    * Make sure ALL controls are validated, eg. to always account for extra trims/analogs/switches/etc which don't exist on destination;
    * Properly indicate invalid RawSource::toString() items with "???".

* Allow user to cancel out of file conversions & provide ample warnings if switching radio type/profile with unsaved file(s) still open;
Also: Fix bug with some orphaned MdiChild windows never being deleted; Create static bool Storage::isBoardCompatible(b1, b2).

* Add maxLibQt "stub" (will not compile).

* Add ExportableTableView for better presentation of conversion results table.

* Move getFourCC() and isBoardCompatible() to Boards class.
2017-12-18 22:56:39 +01:00
Raphael Coeffic e63a877ed6 added getRtcTime() LUA function (#5524)
This allows for retrieving the UNIX timestamp kept internally.
2017-12-18 21:04:02 +01:00
3djc 4df64695c7 BT Pin code (#5536)
* x7

* add x12 pin code
make strings translatable

* Cosmetics
2017-12-18 21:03:18 +01:00
3djc 394bc1689f Massive cleaning (#5538) 2017-12-18 20:54:22 +01:00
Bertrand Songis 6839939140 Update CREDITS.txt 2017-12-18 19:41:43 +01:00
Bertrand Songis 00c7b23d15 Update CREDITS.txt 2017-12-18 18:32:20 +01:00
lfischer85 bc6bfccade fix for X12s crossfire issues #5162 (#5533)
* fix X12s crossfire issues

* Update radio_hardware.cpp

* Update crossfire.h

* Update radio_hardware.cpp

* Removed now unnecessary macros.
2017-12-18 15:15:28 +01:00
Bertrand Songis ed2becce88 Update CREDITS.txt 2017-12-18 07:29:39 +01:00
3djc b39acdf18a Merge pull request #5526 from opentx/3djc/2.2.2-nightlies
Post 2.2.1
2017-12-18 07:18:28 +01:00
Bertrand Songis 149e039cd0 Update CREDITS.txt 2017-12-17 23:38:03 +01:00
Bertrand Songis f99fadaa20 Update CREDITS.txt 2017-12-17 22:48:43 +01:00
Bertrand Songis b5fd533362 Update CREDITS.txt 2017-12-17 22:41:29 +01:00
Bertrand Songis 8e88cfbf9a Update CREDITS.txt 2017-12-17 21:50:47 +01:00
Bertrand Songis 3969413779 Update CREDITS.txt 2017-12-17 19:19:25 +01:00
Damjan Adamic eedbf2fbb7 Launchpad files for 2.2.1 release:
* dropped support for trusty (Ubuntu 14.04 LTS) since it's QT version 5.2 is too old, we need at least 5.3
 * added bionic (Ubuntu 18.04 LTS)
2017-12-17 18:40:25 +01:00
Bertrand Songis fbb358bf71 Update CREDITS.txt 2017-12-17 15:39:07 +01:00
Bertrand Songis b3602cad87 Update CREDITS.txt 2017-12-17 15:01:31 +01:00
Bertrand Songis b9387ceeda Update CREDITS.txt 2017-12-17 14:08:50 +01:00
3djc 3aa7452e48 Post 2.2.1 2017-12-17 13:32:13 +01:00
3djc cca7180834 Release prep 2017-12-17 10:07:54 +01:00
Bertrand Songis 104ab8c7f3 Typo fix
Because omeone asked to to explain what means LDC today ...
2017-12-16 22:09:38 +01:00
Bertrand Songis e4d273aa0e Update CREDITS.txt 2017-12-16 17:12:32 +01:00
Bertrand Songis df61a1ab4e Update CREDITS.txt 2017-12-16 17:11:01 +01:00
Raphael Coeffic 1dcd8cc419 small fixes for french translation (#5517)
* fixed VKEYS french

fixes #5481

* fix french confirmation popup

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

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

* Rework power rssi code a bit

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

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

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

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

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

* There are apparently 4 valid choices

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

* - remove option from Companion
- cosmetics

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

* Cosmetics

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

* SFHSS also has failsafe implemented

* Show failsafe setting in Companion

* Fix missing protocol names

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

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

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

* Scale down radio picture a little

* last x10 change requires a sd version bump

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

* Different syntax for NOSONAR

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

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

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

* Forgot a couple

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

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

* Keep protection

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

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

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

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

* Fixing code styling

* Updating code style

* Updating code style

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

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

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

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

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

* Send config command

* Implement setting failsafe for multimodule

* Fix

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

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

* Update model print for global variables refactor

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

* Fix loop limit

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

* Compilation fixes

* Doc fix

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

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

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

* Fix compile error on platforms without key_page

* avr-gcc bails on missing eolf

* Fix navigation

* Just keep pushing ....

* compile fixes of 9x and use chainMenu

* Fixes

* Align x9 behavior to x7 (for once !)

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

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

* Fix x7

* Apparently - is standard separator for dates

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

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

* Updated French translation.

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

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

* wip

* Temporary hack to prevent X9E to enter reset loop

* The wait game starts :)

* Temporary compil fixes

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

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

* Add BOOL zone option to Horus LUA

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

* Moved baurate selection to general settings

* renamed mavbaud to telemetryBaudrate for ARM targets
translation added

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

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

* Removed the developers name

* Rendering issue fix

* Removed bottom bar & removed Heli

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

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

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

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

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

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

* Working script (tested with MicroTX)

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

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

* Implement showing multiple names

* Another way

* Improvement suggested by @schwabe (thx m8!)

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

* By unanimous vote of participants

* Updates based on Bertrtand's comments

* Colon right this time ?

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

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

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

* Disable R9M sport option if internal module has telemetry

* Fix X12s build

* Use macros instead of direct comparisions

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

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

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

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

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

* Bluetooth Telemetry

* En fix
Add all languages

* Temporary test for @bsongis

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

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

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

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

* Another two IS_ARM/HORUS_TARANIS mixups

* Fix condition

* Simplify/fix two if statements

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

* Settings import from previous versions now optional

* Hopefully cleaner implementation

* This crashes (already on 2.2)

* Translation

* Remove broken settings import from companion9x

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

* Rename functions

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

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

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

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

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

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

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

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

* minor fix

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

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

* Travis build fix

* Introduce time FONTSIZE_MASK macro

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

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

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

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

* Compile option

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

* Cosmetics

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

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

* Always disable a warning when RSSI Warnings are disabled

* Compile fix

* Fix typos, also mute sensor lost

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

* Compile fixes

* Also refactor Companion

* Cleanup unused datastruct on ARM

* Compile fix for AVR

* Change int to uin8_t for avr

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

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

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

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

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

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

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

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

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

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

* Implement jump over

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

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

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

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

* numbers too

* For drawTimer too

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

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

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

* [LogicalSwitchesPanel] Normalize LS name label.

* We had decided on "Lxx"

* Match firmware side

* ARM wasn't using the translations

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

* Bug fixes after actual testing of API

* Fix documentation

* Even more error checking

* Add example code how to use this function

* Silence gcc warnings

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

* Add standard example

* Fixes

* Don’t use an invalid number in example

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

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

* Updated French Translation.

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

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

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

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

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

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

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

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

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

* Update French translation concerning the new SD sync mechanism.

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

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

* Add CZ support

* Prep for release

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

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

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

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

* [HardwarePanel] Minor layout fix for BT option.

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

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

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

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

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

* Such a better fix thanks to @mhotar !

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

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

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

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

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

* [Companion] Fix small bug in HardwarePanel.

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

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

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

* Also fix SWR->RAS in simulator UI

* Only display RAS for external XJT module

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

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

* Next fix for #4831

* Initiate some CZ docs

* Some more structure, still a workframe

* My attempt to help with #4831

* Update tts_doc_cz.md

* copy/paste error

* Update tts_doc_cz.md

* missed one number/qr.quot

* Cosmetics

* Consistency in parameters order

* Nearly complete doc

* Cosmetics to facilitate coding for non CZ devs

* Fix integer+unit, cosmetics

* Update tts_doc Radians and Mililiters are Male gender

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

* Cosmetics

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

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

* Less worse fix ?

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

* Fix

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

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

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

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

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

* pl partial translation

* partial pl translation

* partial pl translation

* pl translation changes

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

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

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

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

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

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

* [Companion] Add file-close action.

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

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

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

* Make it all ARM

* Let's try not to brake timer adjust

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

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

* Fix some missing translations for avr

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

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

* Improvements based on Bertrand's comments

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

* Cosmetics

* Expend getFieldInfo instead of creating a new function

* Streamline units table

* @projeckk2glider comments

* Cosmetics

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

* Fixed some mistakes.

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

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

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

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

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

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

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

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

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

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

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

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

* [OpenTxSimulator] Fixes for Qt < 5.4.

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

* [Simulator] No helpers dependency for SimulatorStartupDialog.

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

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

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

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

* [OpenTxSimulator] Fix analogs array range.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* Cosmetics (unused includes).

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

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

* exported as plainSVG

* restart icons

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

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

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

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

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

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

* Clearer text

* Companion side

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

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

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

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

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

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

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

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

* No suffix for docker image

* generate sdcard file to subdirectories to match companion changes

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

* Allow both nightly and release to be built

* $ ambiguity

* Cleanup

* Tidy up

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

* Return total time, not delta time.

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

First commit, testings to be done

* Voice correction

* Better way to drive voice modules

Same thing as LCD drivers

* Issue #2337 (error mismatch) solved

* Font correction

* Fonts correction again

* oups...

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

* Documentation update

* I2C driver correction

* Mega2560 directory renamed to mega2560

* M2560 driver correction

* Voice directory correction

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

* Compliant to cmake documentation

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

* ‘{’ token forgotten

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

* Don't break 9XR-PRO !

* Fix

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

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

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

* Intermediate version.

* Intermediate version.

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

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

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

* Cosmetics

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

* Fix

* The shift is only for x7

* Add pots check and compil fixes

* Fix SF cannot be disabled

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

* Leave existing code untouched for non arm

* Fine tune rect

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

* USB driver cleanup

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

* Cosmetics

* Compilation fix

* Cosmetics

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

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

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

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

* Cosmetics

* Cosmetics

* Non ARM code cleanup

* Move telem screen to midsize

* Fine tune

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

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

Quick fix ... comments welcome :)

* Better hash function for strings

* One comment, one!

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

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

* Fix warnings with gcc 6

* Make the whole thing more C++ like

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

* Fix gcc warning

* another signedness fix

* Add missing include

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

* Add note about struct

* More cleanups

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

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

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

* Fix for older CMake.

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

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

* Add ability to restore too

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

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

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

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

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

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

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

* Compilation fix

* [X7] PCBREV PIN was inverted

* [X7] PULL DOWN on PCBREV PIN

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

* [X7] PCBREV resistor changed

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

* Additional type check

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

* Fixes, works on Horus

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

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

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

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

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

* Fix crash with module OFF

* Cosmetics

* Compilation fix / cosmetics

* Typo....

* Multi now available on all ARM platforms

* Does this help?

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

shorten some texts for Q X7 Display

* Update de.h.txt

shorten some texts for Q X7 Display

* Update de.h.txt

shorten some Texts for Q X7 display

* shorten some Text for  Q X7 display

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

* Copy menu fixed

* Cosmetics

* Better handling of model and categories signaling

* Cosmetics

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

* Remove unused viableModelSelected

* Take 2

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

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

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

* Enable long push for Global functions too

* Cleanup commented code

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

* Fixes #4404

* [9XR-PRO] Telemetry bug

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

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

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

* Remove grep dependency for lua exports generation

* Sneaky pythons hiding in code.

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

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

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

* Cosmetics before fixing #4400

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

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

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

+ some cosmetics

* Test removed too quickly

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

* There's no E

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

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

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

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

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

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

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

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

* X7 work

* X7 and X9 working

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

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

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

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

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

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

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

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

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

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

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

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

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

* [build] Fix for Qt 5.3.

* Add OpenTx headers to new files.

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

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

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

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

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

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

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

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

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

* Cleanup
2017-01-30 15:33:22 +01:00
Damjan Adamic bbe82db087 Cosmetics 2017-01-30 14:52:37 +01:00
Andre Bernet 5077b10274 Only convert storage if boards are actually different 2017-01-30 11:03:42 +01:00
Andre Bernet 00adc318ce The "Downloads" dialog (previously firmware preferences) doesn't actually change anything anymore, so shouldn't update anything and thus run a storage conversion 2017-01-30 10:54:26 +01:00
Andre Bernet b05d57fcce One more qt plugin needed on Win for jpg Horus model images 2017-01-30 10:02:35 +01:00
Bertrand Songis 11c20a5c2c [Build] Filelock added to avoid to compile the same firmware many tim… (#4333)
* [Build] Filelock added to avoid to compile the same firmware many times simultaneously
2017-01-30 09:16:18 +01:00
Bertrand Songis cc8de81128 [Build process] Rather move the binary than copy it to avoid race conditions 2017-01-29 13:42:46 +01:00
Bertrand Songis 3e00d016b2 [Horus] Better fix for #4222 - at least I hope so 2017-01-29 10:23:26 +01:00
Damjan Adamic 8eadee0719 Projectkk2glider/misc fixes (#4331)
* Re #4326: default backlight mode keys+sticks

* Re #4329: when saving radio/model data work on a copy of it, because Export() can change values. Fixes switch warnings change for Horus
2017-01-29 10:02:38 +01:00
Damjan Adamic d5e3fabf03 Read/write backup fixes: (#4327)
* Read/write backup fixes:
 * radio not found was show behind all windows (missing parent)
 * bad behavior on write when radio not found

* Disable model backup read/write for Horus (needs implementation)
2017-01-29 09:59:58 +01:00
3djc 8e73d25f1c Add more logs to firmware build 2017-01-29 09:41:08 +01:00
Max Paperno 06a024e3e9 [Simulator] Replace default structure version value. 2017-01-28 20:36:46 -05:00
Max Paperno 122104daf5 [build] Fix MSVC build with WIN_USE_CONSOLE; silence new CMake warning for now (from fbb6c13). 2017-01-28 19:29:27 -05:00
Max Paperno fae095ea18 [Simulator] Fix startup when using a new file for radio data (file is now properly created, errors from Storage are ignored); Do not start simulator at all in case of data errors; Fix startup option dialog when finding radio type from profile for first time; Fix RadioOptions struct version control; Cleanup unused WinConsole code; Fix a warning and a missing const reference; Move ~SimulatedUIWidget() to public. 2017-01-28 19:15:46 -05:00
Andre Bernet 32dc0dd2a0 [companion] Missing default for backlight off on Horus (fix #4326) 2017-01-28 21:07:52 +01:00
3djc 673d54cfee Rework X7 flight mode screen (#4319)
* Working ONE, need to check ALL for pertinence of drawShortTrimMode

* Show more data on screen ALL for X7

* Make trim display for FM0 X7 only

* Cosmetics
2017-01-28 19:59:11 +01:00
Kelly Byrd 7cff468239 Fix for #4222: On Horus GUI, can't edit X values for < 3-point curves. (#4325)
After looking at the Taranis GUI code, I decided to emulate what that
does, which is just skip over the X coord line in the menu if when
curve type is custom and points is <= 2.
2017-01-28 19:56:54 +01:00
Bertrand Songis dfbdcdba85 [X7] Hardware menu navigation fix (last line) + some TODO removed 2017-01-28 19:52:34 +01:00
Bertrand Songis c36d4d0be5 [X9E] Compilation fix on recent gcc 2017-01-28 19:48:42 +01:00
Andre Bernet cb35a59fc9 [Horus] Backlight driver wouldn't turn backlight on before 15% for prod hardware - no reason for it to be different from beta (#4326) 2017-01-28 19:37:39 +01:00
3djc 5cae3148ea Put back X7 in line with other radios (#4323)
Enabled LUA and GVARS for X7 in tools/build-companion.sh
2017-01-28 18:48:34 +01:00
Arne Schwabe fbb6c1308c Fix current simulator lib not included in dmg (#4296) 2017-01-28 18:00:22 +01:00
Damjan Adamic d1547dd32d Prevent Companion crash if input data is smaller than required (#4309) 2017-01-28 13:47:45 +01:00
3djc 2fbe5a78d1 Proposition : model number handling (#4308)
* Try something for discussions

* Better alternative

* Typo

* Improve

* Change delimiter

* Move delimiter to space

* * Refactoring of CategorizedStorageFormat::load() and CategorizedStorageFormat::save() to support unused model slots
* Fix all unsafe usages of QString::toStdString().c_str()

* Fixed radio data import [Horus] (broken in 0f90ff0b65)

(cherry picked from commit cc12601a01)

* Added Q_OBJECT to TreeModel and some cosmetics

(cherry picked from commit f40e64c2aa)

* Cleanup
2017-01-28 13:46:45 +01:00
Max Paperno de68db0905 [Simulator] Further improvements (reload radio, momentary switches, etc.) (#4303)
* [Simulator] Add ability to reload all radio data w/out exiting simulator (will also adjust UI for any hardware changes); Refactor how keymap help text is generated.

* [Simulator] Only update channel/logical switch/GVar output displays if the corresponding tab is actually visible (further CPU usage reductions).

* [Simulator] Implement momentary toggle switches with "latch" function.

* [Simulator] Mouse wheel event over multi-position knobs now properly rotates them to detent positions.

* [Simulator] Fix mouse wheel event propagation after multi-position knob rotation; Cosmetics.

* [Simulator] Internals: Greatly improve object cleanup on exit; Refactor SimulatedUIWidget timer event triggering.

* [Simulator] Fix throttle stick position/lock not being set properly upon repeated launches from Companion.

* [Simulator] Fix build w/out SDL. KnobWidget cleanup.

* [Companion] Do NOT delete SimulatorInterface on simulator dialog exit (fix possible crash on dialog close).

* [Simulator] Ensure joystick is NULL at start.

* [Simulator] Fix/improve color blending on 4-bit screens with different BG colors; Cosmetics.

* [Simulator] Fix LCD screenshot folder path; Fix timer slot for Qt backwards compatibility.

* [TravisCI] Set Qt version to 5.3 to match release build servers.

* Fixed segfault when saving setup with no models defined [Horus]

* Fixed radio data import [Horus] (broken in 0f90ff0b65)

* [Simulator] Always keep toggle switch active while held with mouse button.
2017-01-28 13:43:56 +01:00
3djc 2a1e5914f5 Translate some of the new stuff 2017-01-27 20:35:29 +01:00
Damjan Adamic f40e64c2aa Added Q_OBJECT to TreeModel and some cosmetics 2017-01-27 20:07:00 +01:00
Damjan Adamic cc12601a01 Fixed radio data import [Horus] (broken in 0f90ff0b65) 2017-01-27 19:26:21 +01:00
3djc 2f316b858a Fix #4302 (#4305)
Fixed: L1 switch was always edited in LS sub-menu [X7]
2017-01-27 09:39:09 +01:00
Damjan Adamic 16960cb9a0 Fixed segfault when saving setup with no models defined [Horus] 2017-01-27 09:32:43 +01:00
Damjan Adamic 7d849e1c4c Hide Show Splash Screen on Startup option in general settings [Horus] 2017-01-27 09:21:24 +01:00
Damjan Adamic 0f90ff0b65 Fixes #4299 and #4298 and other Horus import/export bugs. Checked all existing IS_TARANIS() macros and tuned them to IS_HORUS_OR_TARANIS() where needed. (#4301) 2017-01-26 22:15:17 +01:00
Damjan Adamic 8b1078d081 Fixes #4290: Input Offset fix [Horus] (#4293) 2017-01-26 18:26:40 +01:00
Damjan Adamic 8102f870fe Fixes for "Read Models and Settings from the radio": (#4291)
* show errors
 * close dialog in nothing in progress widget
2017-01-26 18:24:27 +01:00
3djc 1202fa84fa This just allow spanish to compile, no clues if translations are ok or not (#4297) 2017-01-26 15:33:50 +01:00
Bertrand Songis 764b18d883 [Companion] Fixes #4288 2017-01-26 07:22:58 +01:00
Max Paperno 8c9f574f92 [Simulator] Fix the Lua Reload button and help text which was shown/hidden for wrong radio types (the actual reload still worked using F7 key). 2017-01-26 00:25:56 -05:00
Max Paperno efcfdf171d [Simulator] Fix keymap help text (closes #4289). 2017-01-25 23:43:14 -05:00
Max Paperno d6d694a36f [simu] Fix keyboard switch controls for X7. 2017-01-25 14:01:07 -05:00
Max Paperno 6a52458e15 [simu][Simulator] Fix X7 switch position indexes. 2017-01-25 13:10:05 -05:00
Florent Martel 4a76c023e6 Update the luadoc for sportTelemetryPop() (#4287)
Followup on #4232: DIY ID range changed to 0x5000 - 0x52FF
2017-01-25 18:16:30 +01:00
Arne Schwabe 51d1e6e94a Add q303 multi protocols and fix subtype selection on 128x64 ui (#4286)
* Multi: add Q303 protocol and variants (CX10D/CX10WD)

* Fix subType selection on 128x64 UIs

* Fix options display on other radios for custom photo as well
2017-01-25 16:23:21 +01:00
Max Paperno 6e2474081f [Simulator] Further Simulator improvements. (#4282)
* Refactor CompStoreObj to use templates. Clean up some formatting.

* [Simulator] Add SimulatorOptions type to replace individual simulator options; Fix storage handler for custom types; Cleanup some redundant code.

* [Simulator][Joystick] Rework the joystick options/calibration dialog.  Can now enable/disable/select the Joystick from there. Delay start of calibration until Start is pressed (otherwise looks like last calibration didn't work). And generally refactor a lot of it to be smarter.

* Cosmetics.

* [Simulator] Add state handling for RadioWidget class. Split code to cpp file.

* [Simulator] Add SimulatorStartupDialog as its own UI class.

* [Simulator] Multiple changes and new features:
    All Horus data source options are now fully supported with data properly saved after use (SD path, .otx file, or custom data path);
    Loading .otx files now works for all radio types (but not saving data back to .otx);
    Switch and knob/slider states are now saved to per radio profile;
    Joystick configuration/calibration is now available directly from inside Simulator;
    Due to refactoring, all previously saved per-profile simulator settings are now invalid;
    Further consolidated simulator dialog startup/shutdown, now handles temp. paths internally, etc;
    With WIN_USE_CONSOLE defined, Simulator and Companion when started from Windows command line will now use that console for all messages (instead of opening a new one). This allows full debug output to be seen at all stages of execution and after exit.

* [Simulator] Fix build w/out SDL Joystick support.

* [Simulator] Fix bogus throttle warning on simulator start; Add forgotten RadioWidgetState flags to stream handlers; Add debug state saver in SimulatorOptions.
2017-01-25 16:20:45 +01:00
Bertrand Songis b53ec7392c [Companion] OTX format bug with X9D boards
The files were always converted as X9D doesn't have its own FourCC
2017-01-25 15:32:30 +01:00
Damjan Adamic 362698484f Url traces added (Companion) 2017-01-25 13:20:08 +01:00
3djc cbe0dc60e6 Enable LUA_COMPILER (#4283)
Added Companon firmware option luac
2017-01-25 13:09:53 +01:00
3djc 37b7714aff Prep for nightly 2017-01-25 10:59:42 +01:00
Damjan Adamic 398c3b1e33 DIY ID range changed to 0x5100 - 0x52FF (#4232)
[S.PORT] DIY range updated. The spec should follow soon
2017-01-25 08:22:24 +01:00
Bertrand Songis de49d155c6 [Companion] Compilation fix 2017-01-24 22:06:28 +01:00
Bertrand Songis 57aafeb062 [Companion] Refactoring - fixes the X9E=>X7 conversion segfault 2017-01-24 20:08:48 +01:00
Bertrand Songis 8f970fdbbf [9XR-PRO] Warning fixed (ATMEL code) 2017-01-24 18:57:45 +01:00
Bertrand Songis 0d05beae80 CRLF line endings converted to LF 2017-01-24 18:48:28 +01:00
Bertrand Songis 2f7bf7bcbd [9XR-PRO] Warning fixed (ATMEL code) 2017-01-24 18:47:09 +01:00
Bertrand Songis 6aa8337fc2 [9XR-PRO] Navigation issue in InputOne screen 2017-01-24 18:46:31 +01:00
3djc f686d15354 Shorten GVx to Gx on 128x64 radios, where screen estate is a real issue (#4280) 2017-01-24 18:29:21 +01:00
3djc aa19475c90 3djc/x7 mixer screen rework (#4281)
* Optimise display on 128x64

* Name if present are displayed (like now), but when the row is selected, the name moves on top and the display alternates between FM and other info

* Compile fix
2017-01-24 18:25:38 +01:00
Damjan Adamic 36928b7b60 Cosmetics 2017-01-24 11:26:19 +01:00
Damjan Adamic 6d2ea5c801 Changes to allow compilation with Qt5.2 2017-01-24 10:19:20 +01:00
Max Paperno 17a03e6c18 [Simulator] Dyanamic Simulator virtual hardware generation and many other improvements (#4260)
* Move simulator widgets to subfolder (no code changes).

* [Simulator] Major Simulator re-structuring to reduce code redundancies and allow for fully dynamic simulated hardware setup:
    SimulatorDialog is no longer sub-classed by individual radio UIs, instead a new class is added which handles just the "skin," LCD, and navigation controls (also makes setting up new models much quicker);
    All radio switches/knobs/sliders are populated dynamically based on loaded hardware configuration data (eeprom/bin), including control types and names (in case of no hardware config data, reasonable "factory defaults" are loaded);
    Starting Horus sim with alternate path for RADIO and MODEL data folders is now supported (.otx file is WIP);
    6-way switch now works properly and various other inconsistencies addressed (eg. some Horus analogs were backwards).

* Add missing OpenTX headers to new files.

* [Simulator] Fix loading of Horus hardware settings from Companion simulation.

* Update Travis CI build environment to Qt 5.7.

* [Simulator] Fix 9X missing colored side LCD images, an #include fix, and some cleanup.

* [TravisCI] Set up for parallel Travis builds and use Qt5.7 (#4263)

* Fix starting Simulator with non-existing file/folder structure (now properly creates new ones as needed, including Horus directories with default radio/model);  Temporarily remove option for using .otx file with Horus (until that feature is added).

* Load correct simulator skin for X7 when launching from Companion.

* X7 hardware defaults changed to match production hardware

* Fix minor compiler warning in mdichild.cpp, and some cleanup in eeprominterface.cpp.

* [Simulator] Centralize radio UI flavor determination.

* [Simulator] Updates:
    Add X7 UI flavor;
    Centralize LCD settings;
    Simplify drawing curved UI widgets;
    LCD color can be changed for any 1/4-bit display radio;
    Slight change on default LCD "off" color;
    Refactor LcdWidget to not use globals.

* [Companion] X7 EEPROM import fix

+ cosmetics
+ compilation error fixed on Manjaro

* [Companion] 9XR-PRO EEPROM import fix

+ cosmetics
+ compilation error fixed on Manjaro

* Navigation fix
French translations

* [X7] Main view cosmetics

* Fix switch/ana custom name import

* [Simulator] Add white border above/below X7 bezel, and use white-colored padding on sides; Adjust X7 default LCD color.

* Does this work? (#4269)

Read an Horus SD card produces a temporary .otx file now

* Bsongis/companion warning before automatic conversions (#4271)

* Does this work?

* Warning before automatic conversions

* Force different file name after conversion (#4272)

* Force different file name after conversion

* More detailed instructions

* [Companion] Files automatically named during XXX => Horus conversions
2017-01-24 07:54:12 +01:00
Damjan Adamic b3f4870da7 Refactoring of startup code, mainly dealing with detection of unexpec… (#4275)
* Refactoring of startup code, mainly dealing with detection of unexpected restart/shutdown

* Added g_FATFS_Obj initialization [Horus]

* Fix normal startup

* Use g_eeGeneral.unexpectedShutdown only on radios that have PWRMANAGE defined
Fixes for radios that don't have power control.
Other fixes

* CLI test for new()

* [Horus] Reboot protection reworked to also handle non-WDT events

(cherry picked from commit fe9a52779d062e3f24639479273c906abe6e440b)

Conflicts:
	radio/src/targets/horus/board.h

* Reverting most of the changes

* Cleanup

* Added comment that explains apparent non usage of the wdt_disable() function

* More cleanup

* Missing include

* Compilation fix
2017-01-24 07:52:33 +01:00
Andre Bernet bf15410bf1 3djc/x7 outputs (#4273)
[128x64] Rework Outputs screen
[X7] Fix for min/max limits bug
[X7/X9] UI fixes
2017-01-24 07:36:40 +01:00
Andre Bernet 824317c477 Fix linking problem due to SDL main definition 2017-01-23 22:11:07 +01:00
Bertrand Songis 821efb3499 .gitignore updated 2017-01-23 21:05:25 +01:00
3djc 6027c519e4 Force symlimits and ppmca for ARM (#4267)
Make PPM_LIMITS_SYMETRICAL(symlimits), PPM_CENTER_ADJUSTABLE(ppmca)  and CURVES mandatory on ARM platforms.
2017-01-23 20:08:39 +01:00
Bertrand Songis 227e412b68 [Companion] Cosmetics 2017-01-23 19:48:07 +01:00
3djc a5577da36d Fix firmware version recognition for Horus (#4276) 2017-01-23 19:42:31 +01:00
Bertrand Songis d60de4466a [Horus] Malloc check added 2017-01-22 22:01:39 +01:00
Bertrand Songis cdb3f48da7 [Horus] Malloc check added 2017-01-22 21:44:44 +01:00
Bertrand Songis 2f0492cec5 [Horus] Malloc check added 2017-01-22 21:41:06 +01:00
Bertrand Songis fb6c9cde6b [Horus] Malloc check added 2017-01-22 21:32:19 +01:00
Bertrand Songis 05129b6785 [Companion] Horus default view setup 2017-01-22 19:07:46 +01:00
Bertrand Songis ff7c698371 [Companion] Files automatically named during XXX => Horus conversions 2017-01-22 18:17:14 +01:00
Andre Bernet 7c33043ac0 Force different file name after conversion (#4272)
* Force different file name after conversion

* More detailed instructions
2017-01-22 17:44:55 +01:00
Andre Bernet be0ef50195 Fix Horus haptic import without code complexification. Will reset people's haptic mode setting on Horus, but we can afford it. 2017-01-22 17:24:58 +01:00
Andre Bernet 7990973b35 Revert "Fix Horus haptic mode (#4224)"
This reverts commit 9bbc595eb1.
2017-01-22 17:20:28 +01:00
Andre Bernet 9666a7f649 Horus model image support 2017-01-22 16:25:40 +01:00
Bertrand Songis 285b8786b9 Bsongis/companion warning before automatic conversions (#4271)
* Does this work?

* Warning before automatic conversions
2017-01-22 15:31:22 +01:00
Andre Bernet 7a60714071 [companion] Missing General settings items added 2017-01-22 14:52:12 +01:00
Bertrand Songis c21be4845e Does this work? (#4269)
Read an Horus SD card produces a temporary .otx file now
2017-01-22 14:08:13 +01:00
Andre Bernet 9bbc595eb1 Fix Horus haptic mode (#4224) 2017-01-22 13:19:20 +01:00
Andre Bernet d9d7920c1c Fix switch/ana custom name import 2017-01-22 12:08:55 +01:00
Andre Bernet eea7d503fa [X7] Main view cosmetics 2017-01-22 11:26:28 +01:00
Andre Bernet 293f1e8805 Navigation fix
French translations
2017-01-22 11:16:14 +01:00
Bertrand Songis 7140eec2df [Companion] 9XR-PRO EEPROM import fix
+ cosmetics
+ compilation error fixed on Manjaro
2017-01-22 09:09:15 +01:00
3djc 2ffbb4e46c Changes to allow Linux companion to be compiled with qt5.7 (#4262) (#4265)
* Changes to allow Linux companion to be compiled with qt5.7

* Optimize
 (reverted from commit cc205dcc91)
2017-01-22 00:03:06 +01:00
Bertrand Songis 54d1cb8f9a [Companion] X7 EEPROM import fix
+ cosmetics
+ compilation error fixed on Manjaro
2017-01-21 23:56:34 +01:00
Max Paperno 3e9a60b9b7 Fix minor compiler warning in mdichild.cpp, and some cleanup in eeprominterface.cpp. 2017-01-21 16:47:54 -05:00
Andre Bernet 5144550e4e UI cosmetics 2017-01-21 21:53:23 +01:00
Bertrand Songis 89680ddf70 Warning fixed on Manjaro 2017-01-21 21:22:53 +01:00
Andre Bernet e94d123404 Horus has 9 scripts 2017-01-21 20:12:48 +01:00
Andre Bernet 8cc8b53d63 Add "Adjust RTC" option for ARM128 2017-01-21 17:30:24 +01:00
Max Paperno 70e4dbd45b [TravisCI] Set up for parallel Travis builds and use Qt5.7 (#4263)
* [TravisCI] Set up for parallel Travis builds and use Qt5.7 (with option of selecting version).  commit-tests.sh script can now optionally build one, all, or sets of targets.

* [TravisCI] Move "COMPANION" build to first slot and rename to "DEFAULT".

* [TravisCI] Fix "ALL" build flavor, remove TARANIS flavor, rename HORUS to X12, streamline some code, add comments, fix indents.
2017-01-21 17:18:42 +01:00
Andre Bernet 0ee59dc438 X7 hardware defaults changed to match production hardware 2017-01-21 12:21:57 +01:00
Damjan Adamic 3085ba7d91 Fixes for simulator paths on Windows (#4259) 2017-01-20 21:45:47 +01:00
3djc cc205dcc91 Changes to allow Linux companion to be compiled with qt5.7 (#4262)
* Changes to allow Linux companion to be compiled with qt5.7

* Optimize
2017-01-20 20:13:33 +01:00
Bertrand Songis 0ff8ed35b9 [Companion] clang warning fixed 2017-01-20 20:10:07 +01:00
Damjan Adamic 7e0c461740 Copyright OpenTX Team 2011-2017 2017-01-20 20:00:21 +01:00
Damjan Adamic 0a351112dd Re #4224: Enable .otx file drag&drop on main window 2017-01-20 19:35:46 +01:00
Damjan Adamic f3521728ef Cosmetics 2017-01-20 19:22:18 +01:00
3djc 12a8770ad5 Companion : add Horus antenna handling (#4258)
Horus antenna handling
2017-01-20 07:40:13 +01:00
Bertrand Songis 212838f12a [Companion] clang / linux compilation fix 2017-01-20 07:38:46 +01:00
Bertrand Songis 28ccf7d8ee [Companion] Crash fix 2017-01-20 07:22:26 +01:00
Bertrand Songis 324544835a [Companion] Compilation fix 2017-01-19 21:31:18 +01:00
3djc 905301fc06 Change "External" to "Ext+Int" to reflect actual Horus antenna handling (#4255) 2017-01-19 21:28:47 +01:00
Damjan Adamic e59a51e25f Re #4224: Enable reading and writing Models and Settings from/to Horu… (#4254)
* Re #4224: Enable reading and writing Models and Settings from/to Horus radio (SD card)

* Fix for findMassstoragePath() on Windows (which got there in previous commit)
2017-01-19 21:26:18 +01:00
Bertrand Songis 3c62cbf200 [Companion] Better storage traces 2017-01-19 21:19:17 +01:00
Bertrand Songis 0d6f5b470b [Companion] Crash fixed 2017-01-19 19:14:55 +01:00
Bertrand Songis 1460620483 [Companion] Rename category function added 2017-01-18 18:43:12 +01:00
Bertrand Songis c707715f3d [Companion] Delete category function added 2017-01-18 16:37:38 +01:00
Bertrand Songis a412992783 [Companion] Conversions from Taranis to Horus (default category added) 2017-01-18 16:21:50 +01:00
Bertrand Songis 83380d288c [Companion] Refresh problems fixed 2017-01-18 15:46:12 +01:00
Bertrand Songis 01a4470e23 [Companion] Compilation fixes 2017-01-18 15:32:16 +01:00
Bertrand Songis 1924d28be3 [Companion] Fixes 2017-01-18 15:25:43 +01:00
3djc 38c7f1c7d3 Do not use color coded RSSI alarms on Taranis/Horus prints (#4253)
* Do not use color coded RSSI alarms on Taranis/Horus prints

* Cosmetics (yes, again :s)
2017-01-18 14:29:50 +01:00
Bertrand Songis b84398bcc7 [Companion] New fixes:
* New signal MainWindow::FirmwareChanged
* New RadioData conversions introduced
2017-01-18 12:57:01 +01:00
Bertrand Songis 173d5aba06 [Companion] Another fix for #4224 2017-01-18 11:34:21 +01:00
Bertrand Songis badea8e6a8 [Companion] Another fix for #4224 2017-01-18 11:29:05 +01:00
Bertrand Songis 0e8fba1fe6 [Companion] Another fix for #4224 2017-01-18 11:12:52 +01:00
Bertrand Songis 61e91a9c32 [Companion] All Horus functions now enabled 2017-01-18 10:55:37 +01:00
Bertrand Songis 98357995fa [Horus] In case of current model missing on SD we create an empty model 2017-01-18 10:35:32 +01:00
Bertrand Songis cfdd37bbbb Switch to .otx extension instead of .eepe for new files 2017-01-18 10:22:37 +01:00
Bertrand Songis 125c301c56 Another fix for #4224 2017-01-18 10:11:47 +01:00
Bertrand Songis 9535e80745 Compilation fix 2017-01-18 09:15:56 +01:00
Bertrand Songis 8abc2a7179 [Companion] It's now possible to add Categories 2017-01-18 08:27:17 +01:00
Bertrand Songis e740a88e13 Cosmetics 2017-01-18 07:37:06 +01:00
3djc 55ee19b50a 3djc/enhance companion get capability (#4243)
* Add info on switches/sliders/pots setup when delivered from factory (other calls return user installed max possible)

* Fix

* getCapability() : Refine actoryInstalledSwitches, add NumTrimSwitches, remove FactoryInstalledPots & FactoryInstalledSliders;
GeneralSettings() initialization : Use `FactoryInstalledSwitches` count instead of `Switches` for default setup, and also set up correct number of sliders for X9E (4) and X7 (0).

* Enum order cosmetics.  [ci skip]
2017-01-18 07:34:08 +01:00
Max Paperno d29c381c19 [Companion] Move SwitchType enum to RadioData GeneralSettings (#4249)
* [Companion] Move SwitchType enum to RadioData GeneralSettings for consistency.

* Fix default 9X switch index positions & trainer switch name.
2017-01-18 07:33:28 +01:00
Max Paperno 56dc2f94ce [build] Only add SIMU_AUDIO option if SDL was found, and turn it ON by default. (#4248) 2017-01-17 19:49:12 +01:00
Bertrand Songis 61d27ebd75 Bsongis/horus create radiodata from scratch (#4251)
[Companion] It's now possible to add models on an empty EEPROM, save and reload the .otx
2017-01-17 19:41:09 +01:00
Max Paperno 2bca437e55 [simu] Fix a few simufatfs.cpp build issues on MinGW and clang. 2017-01-17 06:35:14 -05:00
Max Paperno c67fdcfd6e [Simulator] Fix standalone simulator setting SD card path. 2017-01-17 04:54:05 -05:00
Max Paperno 992c4c4822 [Simulator] Remove keyboard grabbing, causing issues in Linux. 2017-01-17 02:47:54 -05:00
Bertrand Songis 4d4a7471f3 [X7] EEPROM Variant introduced for Companion import (#4245)
* [X7] EEPROM Variant introduced for Companion import
* [X7] Also different FourCC needed if we want to use .otx files
* Allow early version of X7 firmware Eeprom to migrate to new variant (#4246)
* Allow early version of X7 firmware Eeprom to migrate to new variant
2017-01-16 21:52:34 +01:00
Damjan Adamic 979de6bfa2 Re #4224: Companion Hours simulator now uses temporary directory for radio/models settings. (#4247) 2017-01-16 21:35:52 +01:00
mhotar 99b9de271c X7 simu images 2017-01-16 20:46:59 +01:00
Arne Schwabe e0113e9bb9 Another small multi protocol update, add H26WH mjxq subprotocol and telmetry as option for Bayang (#4244) 2017-01-16 18:58:43 +01:00
Damjan Adamic 19213c8013 Windows build fixes 2017-01-16 15:09:39 +01:00
Arne Schwabe 0de4d9e7ad Fix clang warnings about virtual save methods not overriding the base method (const vs non const) 2017-01-16 12:54:16 +01:00
Arne Schwabe 22a9ec286a Fix compilation on OS X 2017-01-16 12:40:53 +01:00
Andre Bernet 5623760c3e String lengths 2017-01-16 11:35:22 +01:00
Bertrand Songis 263c07ace1 Compilation fix 2017-01-16 06:49:15 +01:00
Damjan Adamic f7543e3220 Projectkk2glider/simu tmp sd path (#4231)
* Re #4224: Introduced settingsPath and use std::string for paths in simpgmspace.

* Re #4224: Relevant parts of simpgmspace.cpp moved into simufatfs.cpp and simudisk.cpp

* Removed "/" from "mask_monitor_logsw.png"

* Re #4224: findTrueFileName() refactoring

* Faster gtests (less waiting for eeprom operations to finish)

* Re #4224: Radio settings and models directories now taken from alternate path (if set) [simu]

* Fixes #3322: together with previous changes to the SD browser this prevents the simulator from browsing higher than SD card root path.

* f_chdir() debug traces
2017-01-15 21:53:18 +01:00
Arne Schwabe bedaa505a2 Add two new multi protocols (#4240)
- Add binding sound while multi module is binding.
2017-01-15 21:51:44 +01:00
3djc 81e042971c getCapability review (#4238)
* getCapability review

* X7 has haptic too

* Typo

* @bsongis feedback and other cosmetics
2017-01-15 20:53:05 +01:00
Max Paperno 616eb9206d [companion] Minor warning fix. 2017-01-15 14:46:17 -05:00
Andre Bernet 2b9badf728 Compilation fix 2017-01-15 17:48:32 +01:00
Bertrand Songis a65aa3d6c7 [Companion] Work in progress - QTreeView in MdiChild (#4197)
[Companion] QTreeView in MdiChild, Horus and X7 support added, fixes for #4224
2017-01-15 17:45:57 +01:00
3djc d6b84371a9 Create a home for x7 sdcard data (#4230) 2017-01-15 15:27:58 +01:00
Neil Horne 05ca719522 Port #4189 to next (#4235)
Add data modification for su trim, min and max
2017-01-15 15:27:23 +01:00
3djc dcf9870b3a 3djc/x7 rssi levels (#4236)
* Remove color leveled RSSI warning in line with X9 and Horus

* Some AVR love (or not !)
2017-01-15 15:26:53 +01:00
Damjan Adamic 985dff2af7 Fixes #3683: Display trainer icon in master mode when IS_TRAINER_INPUT_VALID() is true, don't rely on trainer jack connected detection. (#4233) 2017-01-15 10:01:30 +01:00
Damjan Adamic 2e12b6401f Re #3719: documentation updated for model.setLogicalSwitch() - how to set "and" parameter (previous commit was wrong). 2017-01-14 16:18:19 +01:00
Damjan Adamic 85306a0d91 Re #3719: documentation updated for model.getLogicalSwitch() - how to set "and" parameter. 2017-01-14 16:05:59 +01:00
mhotar d9bac83532 9X simu photo button action 2017-01-13 20:45:04 +01:00
Arne Schwabe 0bdf935fc1 Only show telemetry selection if it is sensible to do (as on Taranis/… (#4215)
* Only show telemetry selection if it is sensible to do (as on Taranis/Horus)

* Cosmetics
2017-01-12 21:42:47 +01:00
Max Paperno f4f07d3c0c [build] Add comprehensive firmware size reporting scripts for ARM MCUs. (#4218)
* [build] Add comprehensive firmware size reporting scripts for ARM MCUs.

* [build] Add firmware size reports to commit-tests.sh.

* [build] Set permissions on new scripts.

* [build] Add -Wno-error option to commit-tests.sh.

* [build] Revert firmware size report to using `arm-none-eabi-size` if bash not found (eg. on Windows).

* [git] Add .gitattributes to force line endings on UNIX shell scripts.
2017-01-12 21:32:36 +01:00
3djc 3944f30d06 3djc/x7 hardware screen (#4221)
* Introduce hardware screen for X7

* Cosmetics

* Shorten pot string for 128, other cosmetics

* Fix translation strings
2017-01-11 22:44:26 +01:00
Damjan Adamic 4fd42e0e3d Fixes #4209: Backlight was always 100% due to wrong test for the unexpected shutdown. (#4220) 2017-01-11 22:36:21 +01:00
Andre Bernet d520dac7ba French translations 2017-01-11 15:43:18 +01:00
Andre Bernet b06864f286 Add new S6R parameters for FW 20161226 2017-01-11 13:50:52 +01:00
Andre Bernet 79ab38af8a French translations 2017-01-11 13:29:54 +01:00
Kongse e70a857459 Chinese translation minor revise (#4217) 2017-01-11 10:23:44 +01:00
3djc 070d24ef66 fix curves on X7 (#4216)
* fix curve selection display on X7

* Fix undue telemety type row being show on telem screen

* Fix undue telemety type row being show on telem screen (reverted from commit f3d082f44fa70020d0787d7e7d3d5b494ef062b7)
2017-01-11 10:02:54 +01:00
Bertrand Songis f2b283c585 [All] All FourCC changed (o9x changed to otx) (#4214) 2017-01-09 22:30:01 +01:00
Bertrand Songis 58382d8aca [Horus] Fixes #4205 (#4210)
[Horus] Fixes #4205
2017-01-09 18:17:19 +01:00
3djc dc51a95029 Allow my X9e to boot ! (#4211)
Thanks
2017-01-09 18:16:16 +01:00
Arne Schwabe 707b000111 Install also multimedia and print support plugins for OS X (#4212)
* Install also multimedia and print support plugins for OS X

* cosmetics
2017-01-09 18:14:37 +01:00
3djc 651f7b3f93 X7-improvement (#4208)
* Allow autoswitch for LS AND

* Add POPUPMENU base edit/clear/copy/paste to LS screen

* Add long menu to OUTPUTS screen

* Compil fix

* Compil fix

* Translations for outputs POPMENU 128x64
2017-01-08 19:54:57 +01:00
3djc 1642732e8f 3djc/horus checklist improvement (#4195)
* Add the possibility of modelfilename.txt to Horus checklist

* Typo

* Cosmetics
2017-01-08 19:00:45 +01:00
Andre Bernet e7f258ee45 Fix Chinese translation (fix #4179)
Remove disabled languages from build
2017-01-08 10:10:41 +01:00
Max Paperno 95e59d931e [build] Suppress TRACE_SIMPGMSPACE messages in TravisCI build. Cosmetics. 2017-01-08 03:52:09 -05:00
Kongse 01a1b74028 #4179 cn translation done (#4196)
translation finished
2017-01-08 09:50:51 +01:00
Max Paperno 4f988babbf Fix initializer list issue with ZoneOptionValue (#4203)
* [480x272] Fix initializer list issue with ZoneOptionValue (technically not C++11), now works x-platform as well, lowers Flash use; Spit out Zone, ZoneOption, ZoneOptionValue to own unit. (Fixes https://github.com/opentx/opentx/pull/4199/files#r94867147)

* [480x272] Revert to Flash usage for ZoneOptionValue types (still fixes MSVC build). (Ref: https://github.com/opentx/opentx/commit/82dce3ee601049cf548ff4518902ab8e8fa62a0b#commitcomment-20388918 & https://github.com/opentx/opentx/pull/4199#discussion_r94835251)

* Cosmetics.

* [480x272] Cosmetics.
2017-01-08 09:48:37 +01:00
Max Paperno 1f788723f9 Build system updates, including -Werror on TravisCI (#4202)
* [TravisCI] Build using avr-gcc 4.9.2 (up from 4.8.2). Relies on https://github.com/opentx/opentx/pull/4169 . Fixes all linker warnings, makes clean build.

* [build] Add ARM/AVR compiler version check/display and a workaround for avr-gcc linker warnings when using WARNINGS_AS_ERRORS=true.

* [TravisCI] Enable -Werror on all build targets (WARNINGS_AS_ERRORS=true).

* [build] CMake script updates:
  Enable WARNINGS_AS_ERRORS option for all targets (not just firmware);
  Consolidate some C/CXX flag settings for firmware target, avoid duplication/redundancy;
  All warning flags are now passed to linker (GCC only);
  Add a "build report" for each main target showing compiler, flags, and defines, with verbosity controlled by new VERBOSE_CMAKELISTS option;
  Added properties to PCB, TRANSLATIONS, and a few other options (makes option selector lists in cmake-gui);
  Add macro for conditionally adding C++11 flag;
  Silence CMake >3.0 warnings about CMP0054 policy not being set;
  Reverts AVR linker -Werror workaround;
  Misc. cleanup/consolidation.

* [build] More CMakeLists updates:
  Silence superfluous "CRT_SECURE" series MSVC warnings;
  Formalize finding pthread lib/dll on MSVC builds and fix some issues with install target script;
  Add property string lists to more options;
  Quotes some paths with possible spaces, & other minor cosmetics.

* [build] firmware/bootloader: Remove remaining CMake default compiler flags and add FIRMWARE_C[XX}_FLAGS[_DEBUG] options for user to specify additional flags. Also move ASM language call to silence CMake warning w/MSVC.

* [build] Workaround bogus "uninitialized" warnings from AVR linker.

* [tests] Add custom printer for less verbose gtest output (use --verbose option to revert to gtest default).

* [build] Use less verbose CMake output for TravisCI builds. Formalize search for gtest code and enable gtests target on WIN32-GCC. Minor language fix.
2017-01-08 09:44:33 +01:00
Bertrand Songis 54742fcad9 Compilation fixes for Arch Linux 2017-01-07 18:42:56 +01:00
3djc 91c00d0728 Cosmetics 2017-01-07 12:09:51 +01:00
3djc a05f20a829 3djc/x7: LS fix limits (#4204)
* X7 limits where wrong : for exemple, if you not set a compare value bigger than 15 in a logicial switch.

This fix it and also takes into account some radio settings (like extended limits)

* Take II

* Cosmetics

* Cosmetics

* Cosmetics (reverted from commit 2282c2633b6986ed999f898ef9611f236477ff7c)

* some #ifdef nightmare cleanup
2017-01-07 10:30:46 +01:00
Damjan Adamic 865ec6eca3 Remove extra NULL from OutputsWidget::options[] 2017-01-07 09:04:26 +01:00
Max Paperno 52b68c9ea2 [companion] Fix a few reasonable warnings brought up by MSVC /W3. (#4206) 2017-01-07 08:33:56 +01:00
Andre Bernet 51f186597c [companion] One more DLL was missing in distrib, fixes the long standing companion play sound issues on Windows 2017-01-06 14:48:57 +01:00
3djc bf549ace10 Merge pull request #4200 from opentx/3djc/Horus-optimize-plane-wiz
Move to image elements rather than full screen pictures
2017-01-06 09:53:09 +01:00
Andre Bernet e49bbfe91f Cleanup 2017-01-05 23:24:29 +01:00
Andre Bernet 0e65aad1a8 [companion] Distributing qm files is useless since we compile them in as qrc 2017-01-05 23:16:23 +01:00
Andre Bernet af34a1568f [companion] Don't disable standard buttons on printdialog 2017-01-05 23:01:28 +01:00
Andre Bernet c7e0bf23ad [companion] Fix Windows printing 2017-01-05 22:43:59 +01:00
Damjan Adamic 82dce3ee60 Projectkk2glider/flash savings (#4199)
* Flash savings: getFileExtension() de-templated, saves 160 bytes

* Flash savings: several variables moved to rodata, RGB macro optimization (speed and can now be used to initialize rodata)

Result for Horus:
   text	   data	    bss	    dec
1261182	 808603	  42020	2111805   before
1267149	 803335	  42124	2112608   after (data size also counts .sram section)

5kB saved in .data section (RAM and FLASH)

* Removed compiler warnings

* RGB() and ARGB() gtests added

* ARGB() optimized
2017-01-05 21:44:59 +01:00
Andre Bernet 3b58ee8d3c Missing reference to CN translation 2017-01-05 20:58:19 +01:00
mhotar 0586c8fb05 horus wizard, image adjustments 2017-01-05 20:33:38 +01:00
3djc 51c5eba087 3djc/x7 custom scripts (#4201)
[X7] Custom scripts
2017-01-05 20:26:44 +01:00
3djc 540c56d8ab Move to image elements rather than full screen pictures, thanks to @Mhotar 2017-01-05 07:29:36 +01:00
Bertrand Songis fa5e5d670b [Simu] Revert to the good old keys until there is a compromise found
C is used for SWC
2017-01-04 18:33:31 +01:00
Bertrand Songis 0933a258e3 [Horus] Categories names were written in SMLSIZE when selected, that was weird 2017-01-04 18:32:08 +01:00
Bertrand Songis 1d9c9a6cdb Cosmetics 2017-01-04 18:31:10 +01:00
Bertrand Songis b77332e75a [Horus] Fixes #4177 2017-01-04 09:27:57 +01:00
3djc bdf3d17652 Move fix to a better place 2017-01-03 11:42:12 +01:00
3djc 406a568c2c This fixes #4191 while maintaining 2.1 and 2.2 taranis behavious (ie instant trim can go up to extended trim, ignoring if extending trim is activ or not) 2017-01-03 10:57:34 +01:00
Damjan Adamic 659f9e0556 Fixed a problem with MSVC 2017-01-02 22:36:46 +01:00
3djc f8c6b20a35 Add missing units (#4181)
* Add missing units

* Add import shift
2017-01-02 11:32:54 +01:00
Damjan Adamic 803dc7d853 Projectkk2glider/issue 4138 and other fixes (#4182)
* Fixed Companion translations cmake target

* Some translations had problems with string termination (missing or excessive " characters)

* Fixes #4138: Use [RTN] instead of [EXIT] on Horus

* Define spare bits if BUZZER is not defined
2017-01-02 11:31:55 +01:00
Damjan Adamic afe3d4a1e9 Custom OpenTX types moved to separate file opentx_types.h, fixes linker problem with lcdDrawBitmapPattern() in release build (#4188) 2017-01-02 11:29:20 +01:00
3djc 2a0a75a178 3djc/horus narrow arrows gap (#4183)
* Narrow gap between previous char and up and down arrow in STDSIZE

* Change font generator too and run it once

* Only apply to stdsize
2017-01-02 11:24:43 +01:00
3djc b931b0c85c Add handling of negative width (#4187) 2017-01-02 11:20:56 +01:00
Andre Bernet eb4508e12d [companion] Add zh_CN Chinese translation (fix #4179)
Fix lupdate working dir
2017-01-01 09:25:00 +01:00
Max Paperno bcdc4fef88 [libsimulator] Fix MSVC build. 2016-12-31 11:42:54 -05:00
Max Paperno ebdc73a421 [simulator] Fix standalone simulator radio type name in window title. 2016-12-30 19:12:20 -05:00
Max Paperno 5bf7a6c28d Simulator key/mouse mapping improvements (#4175)
* [simulator] Keyboard and mouse control adjustments:
  ~ Make kay/mouse navigation more consistent between radios and ensure keyboard events are always properly detected (eg. after clicking on a control);
  * Fix mouse wheel direction for rotary encoder emulation (fixes https://github.com/opentx/opentx/issues/4160);
  * Fix page up/down buttons on Horus (also #4160);
  ~ Horus rotary encoder can now be controlled with +/- keys (also keeps X/C, otherwise supersedes https://github.com/opentx/opentx/pull/4087 );
  ~ DEL key now another alternative for ESC/BKSP (brings all controls to number pad);
  ~ "=" key now acts same as "+" key (+ requires SHIFT in main row on most US keyboards);
  * Fix controls direction when using mouse wheel over RC switches;
  + Add help text showing keyboard mappings for each radio type (activate on F1 key).

* [simulator] Enable mouse wheel scrolling on radios w/out a rotary encoder (acts as +/- keys on X9D, PU/DN keys on 9X).
2016-12-30 22:36:29 +01:00
3djc 1d3b6721c6 If no WIZARD are present, do not display anything (#4173)
* If no WIZARD are present, do not display anything

* Cosmetics

* More cosmetics ;)

* String cleanup

* Bertrand's feedbacks
2016-12-30 18:20:46 +01:00
Max Paperno 1eead1504c Clean up build warnings (#4169)
* [build][OSX] Fix clang warnings.

* [build][OSX] A few more warnings taken care of.

* [build] Fixed yet more build warnings across all platforms.

* [build] Fix final warning due to bad CMake flag.

* [build] Remove unused variables as requested, fix indent.

* Fix output display limit type for 8-bit targets.
2016-12-30 18:16:11 +01:00
Raphael Coeffic 1666fd7355 lua: added EVT_MENU_LONG on Taranis (#3991) 2016-12-28 22:39:59 +01:00
joaquins 5e00436b79 Horus outputs widget: display channel name when available (issue #4145) (#4147)
* Display channel name instead of number, when name is non-empty

* Bars made full width, channel + name on left side, output value on right side. Background color added.

* Reverted redefinition of chanString, background color changed to BARGRAPH_BGCOLOR

* Added borders around bars

* Added BG border configuration. Refactored RECT_OFFSET into RECT_BORDER to allow easy change in border thickness.

* Fixed vertical line offset.

* BG settings affecting actual BG, not the border
2016-12-27 22:07:49 +01:00
Max Paperno e204031ef6 Standalone simulator startup options (#4164)
* [simulator] Save and restore Simulator window sizes and positions (based on current radio profile).

* [simulator] Set startup throttle stick lock in standalone sim based on default mode in current Companion radio profile;
  Add new flag indicating standalone simulator;
  Unique titles for simulator console windows.

* [simulator] New/updated Simulator startup options:
  Radio profile used for standalone Simulator can now be separate from Companion;
  Allow selecting a radio profile and EEPROM image file (in addition to radio type) at startup via GUI and CLI;
  All startup settings are saved between uses.
2016-12-27 22:04:24 +01:00
Damjan Adamic fd01376f1e Reduced Companion simulator CPU usage by a factor of 5. (#4167) 2016-12-27 22:00:23 +01:00
Andre Bernet 625babc55e Companion modification propagation fixes (Fix #4155 and #3254) 2016-12-24 11:31:57 +01:00
Max Paperno 8f74388ae1 [companion] Fix CP1252 Windows build warnings by reverting arrow character encoding (fixes https://github.com/opentx/opentx/pull/4154#discussion_r93789409) 2016-12-23 18:44:56 -05:00
Max Paperno e90bd0fd70 Enable Windows build with Qt5.5+ & MinGW-w64 (#4150)
* [Windows][MinGW] Update some WIN32 macro checks in source code to be MSVC-specific (not needed for GCC-based builds).

* [build] CMakeLists updates:
  Adjust for Windows MinGW builds: now fully compatible with Qt5.5+ and MinGW-w64 toolchain (included in Qt installs);
  Add option to specify path to required libraries/includes (instead of hard-coding `c:\programs`);
  Add package check for Python and use found executable name;
  Remove custom FindSdl package handler in favor of stock (and improved) CMake one (still works with Windows);
  Do not force SIMU_AUDIO and LUA_COMPILER in SIMU builds (leave it up to user);
  Add SIMU_LUA_COMPILER option specifically for SIMU builds (default = ON);

* [build][Windows] Rewrite/Fix Windows Companion `install` target, with two options:
    a) just copy supporting Qt and c++ DLLs to build folder so programs can be quickly be run from there (this is default and similar to the old behavior);
    b) full installation to CMAKE_INSTALL_PREFIX path, including all binaries, supporting DLLs, language files, and OTx utilities.
  Option b) can be selected with new WIN_DO_FULL_INSTALL parameter;
  Also cleans up the Linux install a bit and consolidates the OS X parts;

* [simulator][Windows] Add option to build Windows simulator with system console/terminal enabled (both standalone and when launched from Companion). Mostly useful for debug as it gives output messages much sooner in the startup process than the current debug console. Also helpful because you don't have to open it manually on every launch, and it remembers last window position and size. Possible candidate for a user-selectable runtime option in the future.

* [Windows] Fix MSVC build issues.

* [build] More build fixes:
  Use a customized FindSDL.cmake script again due to bugs and deficiencies in the official version (based on script from CMake v3.7);
  Fixes missing SDL DLL error in NSIS installer);
  Use string for Timers option (checkbox in GUI is confusing);
  Remove an unused variable.

* [simu][Windows] Fix f_getcwd() cutting off too many characters (fixes SD browser interactions).
2016-12-24 00:11:07 +01:00
Arne Schwabe 06b0694f03 Schwabe/multi telemetry (#4151)
* Add FY805 protocol

* Fix stray space

* Fix multi sending 120% instead of 100%.

* Implement a custom telemetry for the multi module

The custom telemetry allows the module to tell the telemetry protocol to OpenTX and also allows signaling the status of the Module (e.g. invalid protocol) to OpenTX

This should also close #3979.

* Cosmetics and a few small bugfixes

* remove empty if

* Move status line directly below the mode to be always visible when selecting a protocol

* warn if internal RF module is on

* Replace sprint with small helper function to build on AVR ARM (AR9X, 9XPRO, …)

* TR in wrong order, RF_PROTO_OFF inverted

* Refactor definition of Multimodule protocols to have one central place to define all multi protocol properties

* Also update protocols in companion

* Update multi version number to display as a.b.c.d
2016-12-24 00:04:11 +01:00
3djc d1ef22ee47 3djc/taranis draw number review (#4157)
* Move to Horus style implementation

* TINSIZE handling

* Fix timers

* Add the option to align left on first digit (ie '-' if left of alignment point)

* Compile fix

* Reduce DBL font dot size

* Get ready for PR

* Remove unused function

* Remove leftover declaration

* Performance

* Cosmetics
2016-12-23 23:57:32 +01:00
Max Paperno b0de35f57d Reduce width of all simulator windows (#4154)
* [simu] Reduce width of all simulator windows and also height of Horus window. (https://github.com/opentx/opentx/issues/3135)

* [simu] New vertical channel outputs layout for all simulators, all outputs in one window and horizontally scrollable. Consolidate outputs and gvars widgets to one code base for all sims. Make simulator dialog re-sizable.

* [simu] Make simulation dialog resizable, and greatly reduce minimum size requirements of all simulators. Introduces new VirtualJoystickWidget class with all controls. Simplifies every simulator dialog UI form.
2016-12-23 23:56:28 +01:00
Bertrand Songis df835da07d [X7] Typo 2016-12-23 23:51:51 +01:00
Bertrand Songis 74c03f0d4e [Horus] Companion default types for switches / pots / sliders 2016-12-23 23:49:51 +01:00
joaquins d9981b25d9 Fixes #4085: Horus simulator rotary control improvements (#4087)
* Fix for issue with trackpad & mouse wheel: Small movements up or down send delta=0, causing always events in the same direction.
* Changed keys to X,C
2016-12-23 20:13:00 +01:00
3djc bab5fc339e Lua setTelemetryValue() function fixes (#4158)
* Protect subId, prevent endless loop in sensor discovery if more than 7 is passed.
* Documentation updated
* Add additional parameter checks
2016-12-23 19:32:39 +01:00
Andre Bernet 1b43d8993e [128x64] French translations 2016-12-20 00:30:36 +01:00
Andre Bernet ca7d82fc5b UI cosmetics 2016-12-20 00:17:50 +01:00
Bertrand Songis 226877ec1e [X7] SD Manager fix (when coming from Text view) - #4143 2016-12-19 23:58:25 +01:00
Andre Bernet cdc739a663 Forgot about poor old 9x 2016-12-19 23:26:32 +01:00
Bertrand Songis 7343ad0de5 Warnings removed 2016-12-19 23:20:11 +01:00
Bertrand Songis 7da9aa811a [TARANIS/HORUS] UNEXPECTED_SHUTDOWN() macro improved following @projectkk2glider advice 2016-12-19 23:11:37 +01:00
Andre Bernet 1d42d329cf Text view scroll for X9E 2016-12-19 22:37:30 +01:00
Andre Bernet a2a88ae8d2 [128x64] Fix LS V2 display format 2016-12-19 22:03:08 +01:00
Andre Bernet 6b80e6572b [128x64] Telemetry item handling in Reset SF 2016-12-19 21:31:14 +01:00
Andre Bernet 2b56ea70df [128x64] UI fixes, French translations 2016-12-19 21:26:12 +01:00
Bertrand Songis 86ee899905 [X7/X9/SKY9X] Bad handling of UNEXPECTED_SHUTDOWN ! 2016-12-19 19:44:32 +01:00
Bertrand Songis d52f89674c [X7] Pots calibration fix - #4143 2016-12-19 17:52:16 +01:00
Bertrand Songis 880216c544 [X7] Text view fix - #4143 2016-12-19 17:51:22 +01:00
Bertrand Songis eb3da74331 [X7] Telemetry scripts terminated with [EXIT Long] - #4143 2016-12-19 17:50:03 +01:00
Andre Bernet aabbc375a3 Add dot and "W" to TINSIZE font 2016-12-18 20:20:39 +01:00
Bertrand Songis 2fdf621b2f Typo - Fixes #4149 2016-12-18 09:53:52 +01:00
Bertrand Songis fa0cc546e4 Compilation fix 2016-12-18 09:45:37 +01:00
Bertrand Songis 66fb949c82 [HORUS] Arbitrary limit for themes / layouts / widgets now removed 2016-12-17 23:33:47 +01:00
Max Paperno bce42bb25c Fix static initialization order problem with Horus GUI (#4141)
* [480x272] Fix static initialization order problem with Layout, Theme, & Widget factories.

* [480x272] Fix return from drawTimerMode().

* [480x272] Remove use of macros for registered Layout, Widget, & Theme class lists; remove extern declarations (cosmetic).

* [480x272] Convert Layout and Theme registry to dynamic lists (still max. of 10 each);
  Hide indicator arrow when user is at start/end of available widgets in spinner UI;
  Add some sanity checking to pointer usage in screens_setup;
  Add an (arbitrary) limit of 20 Widgets;
  And a line break! :)
2016-12-17 23:29:26 +01:00
Bertrand Songis d4d3d51a9d [X7] Sources / Switches popup menu fix - #4143 2016-12-17 23:26:35 +01:00
Bertrand Songis e99e47aeac [X7] Text view fix - #4143 2016-12-17 23:15:34 +01:00
Bertrand Songis 00ab6e2294 [X7] SH fix - #4143 2016-12-17 23:09:42 +01:00
Bertrand Songis ad8df76c37 [X7] Screenshots fix - #4143 2016-12-17 14:14:16 +01:00
Max Paperno a2e37c5dbc Minor build fixes (#4142)
* [480x272] Fix compiler warnings with awkward extern define in layout.h.

* [firmware][misc] Fix build error with undefined SPLASH; Fix 128x64 syntax error in model_setup.cpp; Fix compiler warning on static init in diskio.cpp.

* [480x272] Revert "Fix compiler warnings with awkward extern define in layout.h." and modify lcd::drawSource() to use mixsrc_t for consistency.

This reverts commit d85d994c877a94c1933c6ece806565ca822d0f54.

* [firmware] Cleanup struct init in diskio modules.
2016-12-17 13:48:55 +01:00
Max Paperno 143f5ce05e [simu] Fix Windows builds with SD-enabled targets; Centralize SD check condition. Make some compiler checks more specific (eg. !minGW). (#4144) 2016-12-17 13:41:16 +01:00
Max Paperno 5d5dc67605 Add runtime Lua script pre-compilation and general .luac file support (#3318) (#4119)
* [simu] simpgmspace: Populate file date/time/size  in f_stat(); Add f_utime(); Fix f_getcwd() on Windows; Fix f_mkdir() build error on Windows.

* [Lua] Add runtime support for script pre-compilation. Changes behavior with LUA_COMPILER (Re: https://github.com/opentx/opentx/issues/3318):
  All .lua scripts are now compiled and saved to binary "bytecode" file (.luac extension) upon first execution;
  Scripts are also automatically re-compiled if .lua source file is newer than existing .luac file;
  The pre-compiled .luac version is loaded if modification time is newer or equivalent to .lua source file;
  If a .luac version of a script exists, then the .lua version does not need to be present;
  Guards against bytecode compatibility issues (binaries from 64-bit sim will not run on 32-bit sim/radio);
  In SIMU and DEBUG builds, the source .lua file is always preferred in order to preserve full debug info (this is is controlled with new LUA_SCRIPT_LOAD_MODE macro, see lua_api.h);
  GC is now run after each script is loaded.

* [Lua] Add loadScript() API function as alternative to loadfile() from Lua base. This can take advantage of the new OTx script pre-compilation features to reduce memory footprint when loading functions dynamically. This is an interface to luaLoadScriptFileToState(). Fully documented.

* [SD][Lua] Flexible file extensions support:
  Allow for variable length file extensions throughout system (no longer hard-coded in LEN_FILE_EXTENSION);
  Fixes issues with renaming files in SD manager which have file extensions longer than ".ext";
  Expand general support for multiple file extensions per file type in sdListFiles() (eg. .lua and .luac for scripts);
  Lua scripts with .luac extensions can now be selected in custom/telemetry/function menus even if no .lua version exists (duplicates are not shown);
  .luac files can now also be executed from SD file manager UI.

* [Build] Added CMake options for LUA_COMPILER and LUA_SCRIPT_LOAD_MODE.

* Cosmetics.

* [SD][gui] Improve efficiency of some file name handling routines in sdmanager GUI and sdListFiles() by extending getFileExtension() function. Use shared isExtensionMatching() in place of isImageFileExtension(). Only allow executing .luac files when LUA_COMPILER defined (as per request).

* [simpgmspace] Fix f_mkdir() for MSVC build and misc. cleanup.

* [Lua] Use getFileExtension() in script loader to determine file type and check for buffer overflow.
2016-12-17 10:56:40 +01:00
Bertrand Songis 28006d26a9 Cosmetics - will help for #4142 2016-12-17 10:45:56 +01:00
Andre Bernet 1182f80e64 Symlimits should be always on on ARM platforms 2016-12-16 23:58:55 +01:00
Damjan Adamic d6d91b5798 Fixes #4129: error in lua documentation of model.setGlobalVariable for flight mode parameter 2016-12-16 19:21:38 +01:00
Bertrand Songis a7e7050af3 2 new sensors parsed in sport-parse.py script 2016-12-16 18:52:44 +01:00
Bertrand Songis d35736732b [X7D] EEPROM support fixes 2016-12-16 07:29:14 +01:00
3djc e2a18d3fdc Deletion confirm changed from filename to modelname(filename) (#4100)
* Deletion confirm chnaged from filename to modelname(filename)

* Improvements based on Bsongis remarks

* Fix taranis confirm that was not displaying anything

* Got carried away, back to a simpler requirement

* Cosmetics

* Bertrand's feedbacks, take 2 :)

* Use reusable buffer
2016-12-15 20:14:33 +01:00
3djc 6e7eb99763 Typos 2016-12-15 19:07:31 +01:00
3djc 0c7c77706d Add X7 sdcard pack generation for nightlies22 (#4140) 2016-12-15 18:30:37 +01:00
3djc 822083300e X7 bootloader improvement (#4139) 2016-12-15 18:30:20 +01:00
Andre Bernet 1f46295c68 [128x64] Fix failsafe press-to-set 2016-12-13 15:29:54 +01:00
Andre Bernet 71a354c1a0 [X7] Too many horizontal lines completely screw the X7 LCD - removing the rectangle solves it, still clear enough 2016-12-13 15:22:20 +01:00
3djc 2dd220e1b9 Fix copy and move not happening on X9E (#4130) 2016-12-13 13:20:05 +01:00
Andre Bernet fbe11119b8 Fix battery bars on small screens 2016-12-13 12:34:36 +01:00
Andre Bernet 6f325886a1 Fix X7 battery voltage calibration 2016-12-13 12:16:36 +01:00
Bertrand Songis 82d6b96f8b X7D renamed to X7 2016-12-12 07:39:51 +01:00
Bertrand Songis 7b5dfd7de5 [X9D/X7D] FrSky splash is now an option 2016-12-11 21:05:29 +01:00
Mike Morrison 4f47c13efc fix log playback when log frequency is .1s (#4115) 2016-12-11 20:36:30 +01:00
Damjan Adamic 4233e71954 Lua docs updated 2016-12-11 20:11:56 +01:00
Damjan Adamic a4d899844e Re #4125: New functions usbStart() and usbStop() to make USB code cleaner 2016-12-11 16:28:23 +01:00
Benjamin Boy aecf53b3e1 Fixed a problem with precesion 0,0 0,00 (#4120)
When precesion is set to 0,0 or 0,00 and the choosen value is 1,0 or 1,00 following happens:
eins meter
This is incorrect so i coded another part in the else part of "qr.rem > 0"  that checks if qr.quot is 1. If it is following happens now:
ein meter
2016-12-11 10:35:57 +01:00
Damjan Adamic 29c43d9e33 Projectkk2glider/usb hardening (#4125)
* USB fixes:
 * USB initialized when USB cable is inserted and de-initialized when disconnected (this was the original way, which proved itself unreliable in the past. Now with the new USB library it appears to work without any problems. Used in this way result in safer operation - USB controller is disabled while unconnected)
Works without force device mod
 * Serial: initialization of global variables
 * Reduced RAM usage - data moved to FLASH

* Detailed USB interrupt counters (+ debug print fix)
2016-12-11 10:33:52 +01:00
3djc c3238ee38c Port #4116 to Next (#4118)
Fixes #4103: SF repeat parameter was not reset when changing function type
2016-12-10 19:33:13 +01:00
Andre Bernet 6325c3d40f Compilation fix 2016-12-10 18:53:05 +01:00
Andre Bernet 86b85aabc5 Disable rotary encoder rotation while pressed (will hopefully prevent some of the common unwanted edits when pressing, thanks 3djc for the idea) 2016-12-10 18:44:09 +01:00
Andre Bernet 98b695c284 [128x64] Fix and cleanup custom failsafe menu (Fix #4123) 2016-12-10 17:51:24 +01:00
Andre Bernet a747d99ec4 VC++ compilation 2016-12-10 11:24:50 +01:00
Andre Bernet 74a7ae3134 VC++ compilation 2016-12-10 10:35:41 +01:00
Andre Bernet 985541db50 Add X7D to build script 2016-12-10 09:34:43 +01:00
Andre Bernet e3cb1fe91b Merge branch 'kilrah/vc_mp' into next 2016-12-09 11:24:43 +01:00
Andre Bernet a743068fdc Compilation fix 2016-12-08 23:58:26 +01:00
3djc fe85290a18 Fix #4111 and fix capitalize issue (#4112) 2016-12-08 22:35:16 +01:00
Andre Bernet f99cba75d1 Enable multiprocessor compilation on windows 2016-12-08 22:31:00 +01:00
Arne Schwabe 85f3e3510e Update protocols of Multi module (#4093)
* Update protocols of Multi module

* Fix missing ;
2016-12-08 21:33:59 +01:00
Bertrand Songis ec56d2dbdb [Companion] MdiChild now use a QTreeWidget instead of a QListWidget (… (#4096)
* [Companion] MdiChild now use a QTreeWidget instead of a QListWidget (for Horus compatibility)

* [Companion] Horus models.txt parsing / writing implemented

* Fix for QT53 (#4109)
2016-12-08 21:26:08 +01:00
Arne Schwabe dd77670007 Also bundle avrdude in addition to dfu-util and default to the executables in the bundle (#4106) 2016-12-08 21:22:12 +01:00
3djc 3f4502d970 Fix ROT encoder nav for wizards (#4105) 2016-12-08 20:41:50 +01:00
Arne Schwabe 0c255572ec Enable hide according to http://doc.qt.io/qt-5/highdpi.html (#4110)
* Enable hide according to http://doc.qt.io/qt-5/highdpi.html

* Also enable Retina support for OS X
2016-12-08 20:38:39 +01:00
Bertrand Songis 59f3e1aea8 Cosmetics 2016-12-07 11:38:52 +01:00
Bertrand Songis 886f9661fd [All] Default value for GVARS option is OFF 2016-12-07 11:38:23 +01:00
Bertrand Songis 8326c867be [X7D] Compilation fix for DEBUG mode 2016-12-07 08:11:27 +01:00
Arne Schwabe d37eb70b42 Fix build on non Taranis ARM platforms 2016-12-06 22:42:11 +01:00
Damjan Adamic 5a5cf7cf33 Projectkk2glider/issue 4086 usb and serial (#4097)
* Serial2 changes:
  * stm32 driver moved to common dir.
  * earlier start of driver (Taranis)
  * wait for free buffer time limited
USB changes:
 * Upgrade to ST USB-Host-Device_Lib_V2.2.0 (from V2.1.0) - this fixed a problem with USB serial #4086)
 * other fixes for #4086

* USB-Host-Device_Lib: renamed directory to V2.2.0 (from V2.1.0)
2016-12-06 20:32:30 +01:00
Bertrand Songis 9a6e64e67b [X7D] Prevents the user from selecting an external module when there is already a Wireless trainer module in the module bay 2016-12-06 20:30:23 +01:00
Bertrand Songis 5c83d03134 [X7D/X9D/X9E] Reboot because of bad deinit of Trainer port when in SBUS mode 2016-12-06 20:24:44 +01:00
3djc 01c4ddb8e3 Fix BT compile (#4104) 2016-12-06 11:17:01 +01:00
Andre Bernet 2b01481151 [Taranis] MODELS directory was missing on SD card 2016-12-04 18:52:39 +01:00
Damjan Adamic 300b8ece4e CLI fix 2016-12-04 18:30:54 +01:00
3djc 119f3ef88c Fix tricky access to Horus settings (#4094) 2016-12-04 12:18:57 +01:00
3djc 3cd139b906 Update build-sdcard.sh
Keep version history for now
2016-12-03 18:58:57 +01:00
3djc e4848200a0 Update build-nightly.sh 2016-12-03 18:30:14 +01:00
3djc 75cbe0f984 Fix (#4090) 2016-12-03 15:53:30 +01:00
Bertrand Songis 9a43a6ebb7 [Sky9x] Remarks from @projectkk2glider taken into account 2016-12-03 11:15:40 +01:00
3djc 35e199b579 Prep for Nightly (#4089)
* Prep for Nightly

* Compile fix

* Much nicer :)

* One more

* Fix

* Last one

* Cosmetics
2016-12-03 09:36:51 +01:00
Bertrand Songis 862ff2f80d Compilation fix 2016-12-02 22:22:08 +01:00
Bertrand Songis 1512266eac [Companion] Horus fixes 2016-12-02 22:15:10 +01:00
Bertrand Songis 8cd581f770 [Companion] Horus fixes 2016-12-02 20:41:49 +01:00
Bertrand Songis 440ca771df [Companion] Horus analog input names fixed 2016-12-02 20:27:28 +01:00
Bertrand Songis c23ac292b7 [Companion] Horus simulator fixes 2016-12-02 19:56:41 +01:00
Bertrand Songis 9b3cd8eeff [SKY9X] Audio fix - Tested on 9XR-PRO (#4088)
* [SKY9X] Audio fix - Tested on 9XR-PRO

* [X7D] Bootloader fixes
2016-12-02 18:50:23 +01:00
Bertrand Songis 705823a9a6 [X7D] UI fixes 2016-12-02 18:37:53 +01:00
Bertrand Songis 1d192d9fd2 [Crossfire] LF instead of CRLF 2016-12-01 22:08:24 +01:00
Bertrand Songis 9229a08625 [Crossfire] Lua script fixes 2016-12-01 22:07:32 +01:00
Bertrand Songis bf0bdcb280 [X7D] Cosmetics 2016-12-01 21:38:23 +01:00
Bertrand Songis f244cacfd3 [X7D] Switches order modification 2016-12-01 21:36:56 +01:00
Bertrand Songis a0ee52bb44 [X7D] Logical switches screen bugs 2016-12-01 18:26:34 +01:00
Bertrand Songis c5ae06c163 [X7D] Timer2 flashing when negative 2016-12-01 18:07:10 +01:00
3djc a5e8994028 Cosmetics 2016-11-30 12:01:42 +01:00
3djc 9f0f79469a 3djc/horus wizard plane (#4082)
* Introduce plane Wizard

* Simplify code
2016-11-30 11:51:23 +01:00
3djc 781ce1ea34 3djc/horus s6 r improvement (#4081)
* Progressive bitmap loading

* Cosmetics
2016-11-30 11:49:30 +01:00
Bertrand Songis 90cb917c24 [Horus] Compilation failed when LUA not defined 2016-11-30 07:55:32 +01:00
Bertrand Songis 702cd56aae Update CREDITS.txt 2016-11-29 23:17:26 +01:00
Bertrand Songis d59fc2999b [X7D/SKY9X] Order changed in About screens 2016-11-29 20:05:36 +01:00
Bertrand Songis f497c1169a [X7D/SKY9X] About screen bugs 2016-11-29 20:02:42 +01:00
Bertrand Songis 5b37b00e17 [X7D/SKY9X] Custom views bugs 2016-11-29 19:56:00 +01:00
Bertrand Songis c0a6f3f9e3 [X7D/SKY9X] Telemetry screen bug 2016-11-29 19:39:38 +01:00
Bertrand Songis 6cd031d2cc [X7D/SKY9X] Logical switches screen bugs 2016-11-29 19:34:58 +01:00
Bertrand Songis 9ab415dadb Cosmetics - translations alignment 2016-11-29 18:11:56 +01:00
Bertrand Songis 7ee85da0cf [X7D] Error message too long 2016-11-29 18:00:50 +01:00
Andre Bernet d052caf65a Horus Multimodule compilation fix 2016-11-29 12:08:57 +01:00
Damjan Adamic 92553b6589 Projectkk2glider/lua bitmap free (#4075)
* Better memory stats (CLI)

* Bitmap buffer overflow check added

* Lua bitmap improvements

* Proper handling of symbolic links in simulator

* S6R Lua script fixes:
 * added progress screen while loading bitmaps
 * memory for bitmaps is now freed when leaving the script

* S6R Lua script: improved bitmap loading

* * Lua Themes and Widgets moved to separate file and separate Lua state
* Stand-alone, mixer and function scripts now behave the same as on Taranis (restarted after the stand-alone script was run)
* both Lua states are independent: Themes and Widgets is initialized only at the start, the other one is initialized before and after the stand-alone script is run

* Better leak test and report in BitmapBuffer

* Re #3318: Lua compiler enabled in simu and Companion simulator. Usage:
 * any time <xxx>.lua file is about to be loaded and if file <xxx>.lua.src exists:
   * load contents of <xxx>.lua.src
   * compile Lua code
   * save compiled code into <xxx>.lua (effectively overwrites existing file)
 * immediately following the compilation the real file loading is done from <xxx>.lua (which by now contains compiled Lua bytecode)
2016-11-28 23:08:18 +01:00
Mike Morrison ae383cd6a4 fixed fq777-124 and assan protocol selection 2016-11-28 10:48:02 +01:00
Bertrand Songis 510e2ea450 [Companion] Horus support missing the top bar and current view 2016-11-27 20:11:36 +01:00
Bertrand Songis 3c47da2b39 [Companion] .eepe files should be again OK 2016-11-27 19:45:41 +01:00
Arne Schwabe 7a8f8d611e [FlySky IBUS] Fix some sensor interpretation (#4077)
Also use SNR instead RSSI for FlySky since SNR gives a better indication of signal quality and also our current implementation of RSSI warning cannot really handle negative values
2016-11-27 18:50:46 +01:00
Bertrand Songis ee1f6e5bdc [Companion] It's now possible to create an empty Horus storage and simulate it (only the 1st model) 2016-11-27 14:47:01 +01:00
Bertrand Songis 8854cf9e87 [Companion] Horus models export for simulation now OK 2016-11-27 00:45:24 +01:00
Bertrand Songis 0ca0785912 [Companion] Another simplification 2016-11-24 07:24:49 +01:00
Bertrand Songis d82ec0fe9c [Companion] Unix format used everywhere 2016-11-23 16:46:56 +01:00
Bertrand Songis d5e4f7b6e9 [Companion] Unix format used everywhere 2016-11-23 16:42:24 +01:00
Bertrand Songis b0f5b646af [Companion] Copyright added to all files 2016-11-23 16:40:47 +01:00
Bertrand Songis 5f9737fc70 [Companion] Old EEPROM support removed 2016-11-23 16:40:47 +01:00
Bertrand Songis 9590b5f00e [Companion] Horus support. Now the GVars and Telemetry sensors 2016-11-23 16:40:46 +01:00
Bertrand Songis 343d6daf86 [Companion] Some refactoring around the splash image handling (#4067) 2016-11-23 08:46:22 +01:00
Arne Schwabe 9983ff9851 Add new sensors for Spektrum’s Serial Telemetry Receiver (SPM4649T) (#4037)
* Add new sensors for Spektrum’s Serial Telemetry Receiver (SPM4649T)

* Use define instead of hardcoded number
2016-11-22 21:08:39 +01:00
Jim Taylor 324addba2c Fix Issue 4057 for X9E also. (#4066) 2016-11-22 18:19:40 +01:00
Jim Taylor bda86d6e6a Fix issue 4957 Taranis splash screens formatted incorrectly. (#4064) 2016-11-22 07:40:38 +01:00
Bertrand Songis 380b42c57f [Companion] Horus support. Now the Logical switches, Special functions and Flight modes 2016-11-21 23:28:21 +01:00
Bertrand Songis a2dd222c9c [Companion] Horus support. Now the curves are OK 2016-11-21 22:36:29 +01:00
Bertrand Songis a3bff8cf61 [Companion] Code refactoring 2016-11-21 22:15:52 +01:00
3djc 03bb622456 Fine tune model select screen (#4059) 2016-11-21 21:11:10 +01:00
3djc a6bdf58619 Fix two column handling (#4061) 2016-11-21 20:09:09 +01:00
Bertrand Songis 4b84cd27b2 [Horus] Protection against buffer overflow 2016-11-21 18:40:22 +01:00
Bertrand Songis 34fa612f07 [Companion] Horus support continued
Now the inputs
2016-11-20 23:26:41 +01:00
Bertrand Songis aade6933ea [Companion] Horus support continued
Timers + Mixes should be OK now
2016-11-20 22:55:58 +01:00
Bertrand Songis ecb5416057 [Companion] Horus support started
We only have the model name of the 1st model, but that's a good start ;)
2016-11-20 22:49:26 +01:00
Bertrand Songis d42fc6c471 [Companion] Cosmetics in EEPROM import 2016-11-20 22:49:26 +01:00
Bertrand Songis f5e1b01cd3 [Horus] I really prefer when model name is aligned 2016-11-20 22:49:26 +01:00
Damjan Adamic 2763567122 Companion firmware options:
* layout changed to 4 columns
 * fixed broken options (by commit 51cb50151)
 * added missing "horussticks" for X9E
2016-11-20 18:37:58 +01:00
Bertrand Songis 286ef8bdc1 [ARM] Always 3 timers now 2016-11-20 11:38:55 +01:00
Bertrand Songis 51cb501510 [Companion] Firmware options simplification 2016-11-20 11:32:01 +01:00
Bertrand Songis b93b0a6500 [X7D/X9E] GVars display fixed (menus INPUTS / MIXES / OUTPUTS) (#4053) 2016-11-20 11:07:59 +01:00
Damjan Adamic 2d0a8a9611 Add display of detailed failure message when TX module firmware updat… (#4048)
* Add display of detailed failure message when TX module firmware update fails.

* Cosmetics
2016-11-19 23:25:22 +01:00
Bertrand Songis 147d042747 [Horus] XXL font is now 64px high 2016-11-19 20:49:06 +01:00
3djc 10914c741c Fix compile with gvars (#4046)
* Fix compile with gvars

* Rework
2016-11-19 20:47:04 +01:00
Thibault Jouan 908138d81a Fix build on FreeBSD (#4051)
* Fix radio firmwares build under FreeBSD (#4050)

* Fix companion "mountlist" build under FreeBSD (#4049)
2016-11-19 20:46:37 +01:00
3djc a35d6b6a05 3djc/horus fix #4041 (#4042)
* Reduce model name size until they fit into the buffer

* SMLSIZE is better (but cut is still needed)

* Rework screen layout to handle up to 15 chars

* Allow for the two scroolbars (models and cats)
2016-11-19 13:07:06 +01:00
Bertrand Songis a083342cda Fixes #3879 2016-11-19 12:35:12 +01:00
3djc e14d04b57d Revise column for mixer (#4045)
This fixes #4043
2016-11-19 12:27:22 +01:00
Bertrand Songis 796f0b75ff [X9E] Switch warning export issue 2016-11-18 22:52:31 +01:00
3djc 32581568d3 Follow up clean 2016-11-18 18:59:49 +01:00
3djc 6c006c3e2c Horus/fix #4036 (#4038)
* Remove 'static' from bitmapbuffer that where causing issues when changing theme. I have checked that this does not create extra sdcard access

* Cosmetics

* Move calibration bitmaps to theme

* Overlaping PR

* There no theme changing during shutdown

* Cosmetics
2016-11-18 18:51:11 +01:00
3djc d59fdc07c4 Catch up for Dark Blue theme (#4040) 2016-11-18 18:43:14 +01:00
Bertrand Songis 9582f76f91 [Crossfire] Lua script continued 2016-11-18 18:26:03 +01:00
Bertrand Songis a09565fcd6 [Crossfire] Lua script continued 2016-11-18 18:25:41 +01:00
Bertrand Songis c4582b45bb Fixes #3967 2016-11-17 23:22:44 +01:00
3djc cf10ab5f20 3djc/horus wizard (#4034)
* Initial commit

* Cosmetics

* Add dummy wizard for testing purposes

* Graphics enhancement by MHotar

* Only if LUA + cosmetics

* cosmetics on the sample wizards

* Remove warning
2016-11-17 23:13:56 +01:00
3djc e6e9d8eca1 Fix german units (#4032) 2016-11-17 23:13:09 +01:00
Martin Hotar ced1dc83b0 simulator22 horus buttons (#4035)
* horus simulator control buttons

* button polygon setPoints
2016-11-17 23:12:44 +01:00
Bertrand Songis a0a460087f Warnings removed 2016-11-17 09:49:07 +01:00
Bertrand Songis 905cb497d8 Remaining trace removed 2016-11-17 09:37:41 +01:00
Bertrand Songis 18f5ea37f5 Fixes #3953 - Tests needed! 2016-11-17 09:32:53 +01:00
Bertrand Songis 916d7038f7 Warning removed 2016-11-17 09:32:01 +01:00
Bertrand Songis c0fa5734ab Fixes #3969 2016-11-16 23:53:26 +01:00
Bertrand Songis 9fb6f7b5f5 Fixes #3996 2016-11-16 23:47:19 +01:00
Bertrand Songis 00447e5fe6 Fixes #3972 2016-11-16 23:23:20 +01:00
Damjan Adamic 4eac2e58a0 Added missing trainer detect pin initialization (Horus) 2016-11-16 21:32:14 +01:00
Damjan Adamic b95eaa147f Struct size checks adjusted for PCBSKY9X 2016-11-16 21:31:40 +01:00
Bertrand Songis 295f7f3a9f Compilation fix 2016-11-16 13:07:18 +01:00
Damjan Adamic 60524f77f0 Projectkk2glider/companion archive support (#4017)
* Files moved to thirdparty directory
* Miniz library added
* Unused simulators removed: er9x, th9x, ersky9x
* Example of opening archive file .eepe2 (File->Open)
* File reorganization, bunch of files moved to storage directory
* Added StorageSdcard class to handle storage for radios that use SD card to store radio settings and models
2016-11-16 13:05:57 +01:00
Bertrand Songis fb27acf286 Bsongis/x7d companion support (#4028)
[X7D] Companion support added
2016-11-16 12:59:15 +01:00
Jim Taylor 4dda2c64d3 Fix Issue 4026 - Companion 2.2 Model Setup still using SD card BMP (#4027)
directory instead of IMAGES directory for model images.
2016-11-16 08:38:17 +01:00
mhotar 83b81b4bb9 horus wizard images for @3djc 2016-11-15 21:57:45 +01:00
3djc 878c1bb80b Fix center stop that was not working when trim was changing from positive to negative (#4024) 2016-11-15 19:42:11 +01:00
Bertrand Songis d2a4ca1d12 Another fix for Mike's bootloader issue 2016-11-15 18:35:33 +01:00
Bertrand Songis 89504963a5 Dead code removed 2016-11-15 18:34:40 +01:00
Bertrand Songis e1815b576f Typo, Horus build was still fetching Mike's bootloader 2016-11-15 07:42:42 +01:00
Bertrand Songis 55ede8541b [9XR-PRO] Google tests OK 2016-11-14 23:52:37 +01:00
Bertrand Songis 8e77430cb1 [9XR-PRO] Warnings removed 2016-11-14 22:53:59 +01:00
Bertrand Songis 06e7e258e8 [9XR-PRO] UI Fixes 2016-11-14 22:36:04 +01:00
Bertrand Songis 10fe5530f9 Fix analog input order for sky9x (all flavors except REVA) 2016-11-14 21:42:52 +01:00
Bertrand Songis a46acf09e3 Mike's Bootloader was fetched for Horus 2016-11-14 18:16:18 +01:00
Bertrand Songis b2878e6ea6 Google tests didn't compile correctly on all platforms and it was not reported as an error 2016-11-14 18:08:56 +01:00
Bertrand Songis 26a35ebcee [9XR-PRO] CMake error when Mike's bootloader is not correctly downloaded 2016-11-13 20:28:29 +01:00
Arne Schwabe 6b57f7afa7 Add FlySky Telemetry (#3997)
Add FlySky Telemetry
2016-11-13 19:09:33 +01:00
Bertrand Songis bfb5e9b8a6 Bsongis/x7d fixes (#4019)
* [X7D] Various fixes

[Others]
- Fixes the Mixer / Inputs MOVE / COPY problem on X9E
- Adds the copy/paste/rename feature in SDCARD menu on X7D/SKY9X
- Merges some duplicated code using the new directory structure
- Cosmetics
2016-11-13 19:06:21 +01:00
3djc fd33cc9d2b This merges S6R dir on Taranis (two different lua still exist for config and calib) (#4020) 2016-11-13 11:20:37 +01:00
3djc dccfb03b67 3djc/add f gets (#3998)
* Introduce f_gets()

* Comment out debug TRACE

* Windows editing protection

* Store strlen result + uncrustify

* Uncrustify was probably too harsh !

* Cosmetics
2016-11-11 22:23:05 +01:00
Damjan Adamic 7b2d8b1f0a Bluetooth driver added to Horus, BT_EN_GPIO_PIN was wrong on beta board (#4005)
CLI interface for Bluetooth
2016-11-11 19:56:36 +01:00
3djc 5869b81e9c Rb10 support (#4015)
* Rb10 support

* Even more thorough check

* A simpler test for the more complex scenario :) (thx Bsongis :))
2016-11-11 19:55:53 +01:00
3djc c0837a59a6 Add back model bin name, currently needed if you want to use model notes (#3994)
* Add back model bin name, currently needed if you want to use model notes

* Turn into code graphics by Mhotar(tm)
2016-11-10 21:45:07 +01:00
Bertrand Songis d58244ebde Bsongis/lua interpreter added on x7d (#3999)
* [X7D] Lua option added (only standalone scripts)

* [X7D] Compilation fix

* [X7D] Compilation fix

* [X7D] Compilation fix

* [X7D] Compilation fix
2016-11-10 21:41:16 +01:00
Raphael Coeffic 35571ad4d1 [LUA] added docs for telemetry push/pop functions (#4013)
related to #4009
2016-11-10 21:40:37 +01:00
Andre Bernet 23ee9d1d6b [Horus] An empty GF line would default to Override the first time it is used, but Override is not available in GFs. 2016-11-10 21:45:37 +04:00
Raphael Coeffic 95598e5de0 Merge pull request #4009 from opentx/raphaelcoeffic/lua_sport_buffer_query
lua: allow telemtry output buffer availability to be queried
2016-11-09 21:22:05 +01:00
Raphael Coeffic a315f6702b lua: allow telemetry buffer availability to be queried
When crossfireTelemetryPush() or sportTelemetryPush() is called without arguments, it returns a boolean telling whether or not the output buffer is currently available.

This simplifies the LUA in case SPORT or Crossfire is used as a transport for bigger requests (like MSP/SPORT).
2016-11-09 16:17:54 +01:00
Andre Bernet fd127e1ec2 Fix curve settings alignment (Fix #4006) 2016-11-09 09:36:50 +04:00
fraternl 80085cc76c NL translations (#4007)
* Added translation for expected version and delete error

* Some more translations

* consolidated "Toon Trims" to 1 string
2016-11-09 08:59:31 +04:00
fraternl a8940ede63 Added NL translation for expected version and delete error (#4004) 2016-11-08 18:56:16 +01:00
3djc b06d14b4c7 Add bottom mixer status bar when editing mixer (#4001)
* Add bottom mixer status bar when editing mixer

* Cosmetics
2016-11-08 15:32:29 +04:00
3djc 189c49f725 Merge pull request #3936 from rcbebo82/rcbebo82/de_spoken_language
German spoken language fixed.
2016-11-08 11:38:51 +01:00
Arne Schwabe 345ea0f3e8 Add constants for LUA telemetry (#3990)
* Add constants for LUA telemetry

This commit added 896 bytes to flash size which is a significant size. An alternative would to just document the values in the lua telemetry function.

Shortening some of the UNIT names (e.g. UNIT_MW instead of UNIT_milliwatts) or shortening UNIT_ to U_ could save a few bytes but the

* #if 0 ... #endif constants

* horus has 2MB flash
2016-11-06 18:29:10 +01:00
Bertrand Songis 3b3b528bbf [Crossfire] Bind and OTA Rx firmware update now OK 2016-11-06 11:54:05 +01:00
Florent Martel 08148e2e33 Lua setTelemetryValue with optional params (#3993) 2016-11-05 13:16:56 +01:00
Bertrand Songis 19789c115c [Lua] popupConfirmation function added 2016-11-05 12:47:48 +01:00
Benjamin Boy a67135d139 Normal number 1 is spoken now as "eins" not "ein"!
All numbers should work now, anyone who can test the code?
2016-11-04 17:04:40 +01:00
Arne Schwabe 6b5d2039dc Add firmware-size target to ARM 2016-11-04 12:46:58 +01:00
Benjamin Boy 3e952be074 Precison 1 now also works. Could anyone else check the code? 2016-11-04 11:42:15 +01:00
3djc 2fcab1e8c5 Fix column alignment between text/digits (#3984) 2016-11-03 22:07:03 +01:00
3djc 00b23a4210 3djc/fix #3777 (#3986)
* Models notes where overwritten before even having a chance to be displayed

* Models notes where overwritten before even having a chance to be displayed (reverted from commit 0834894b61ed527c3c65d6356793a08ff6e3be6a)

* Delay the checks until after the main menu is launched to avoid the model notes to be overwritten even before appearing
2016-11-03 22:06:18 +01:00
Bertrand Songis 0318d63bf8 [X7D] Quick & dirty fix for special functions navigation which was broken 2016-11-03 22:01:30 +01:00
Bertrand Songis f01f588ad2 [SKY9X/AR9X/X7D] Main timer badly displayed 2016-11-03 18:24:00 +01:00
Bertrand Songis c52e9be3d5 [XFire] New function added to raise a warning popup 2016-11-02 22:13:45 +01:00
Damjan Adamic d2144001d1 Various fixes for gtests that were shown when running tests in random… (#3978)
* Various fixes for gtests that were shown when running tests in random sequence. Enabled random gtests shuffling in commit tests.

* 9X gtests fixes

* more gtests fixes

* even more gtests fixes

* Another round of gtests fixes

* Code deduplication with test fixtures

* More fixtures
2016-11-02 22:03:44 +01:00
Arne Schwabe dfc81cecad Fix Atmel ARM Linker script for gcc 5.4.1 (#3982)
Copy .init and .fni section over from the STM32 linker scripts to make targets like AR9X buildable again. Tested by @sreichholf on a AR9X board
2016-11-02 16:20:49 +01:00
3djc b22bd1f315 3djc/fix #3965 (#3981)
* Introduce 'magnetic 0' for trims

* Removing magnetic 0 that could feel unnatural to a force to 0 when changing side

* Efficiency

* Optimise

* Optimise (reverted from commit 41fc09f0bd37dd4c3067f7406562ab68c07b22ca)

* Bertrand's feedback incorporated

* Another one (bites the dust ?)
2016-11-02 13:33:02 +01:00
Bertrand Songis 45a8cd94e7 [Crossfire] Lua script continued 2016-11-02 13:31:50 +01:00
Arne Schwabe a50d69c3b2 Mark gtest variables cached (#3980)
* Mark gtest variables cached

Set GTEST location variables as CACHE so they can be modified when gtest is in a different location from the cmake call (/usr/src, /usr/include is not writable on OS X)

* Uppercase location and write Google Test like Google does
2016-11-02 13:05:13 +01:00
Damjan Adamic 5ba14734cb Projectkk2glider/gps misc fixes (#3970)
* Fixed Lua GPS date (year is now kept with four digits)

* * GPS year displayed with two digits
* GPS date/time handling fixes
2016-11-02 13:03:26 +01:00
Damjan Adamic a332f7a872 Fixes #3964: Added free space check before putting new data into Lua … (#3968)
* Fixes #3964: Added free space check before putting new data into Lua Telemetry Fifo

* Copy-paste error

* Compilation fix

* Another compilation fix
2016-11-02 12:56:43 +01:00
Florent Martel 450430f22e Provide getRSSI lua method (#3976) 2016-11-02 12:53:07 +01:00
Bertrand Songis 0fe85834ab [XFire] Crossfire parameters chunks support added 2016-11-02 12:50:17 +01:00
Arne Schwabe 54a9393588 Implement setting sensor values from LUA (#3977)
* Implement setting sensor values from LUA

* Fix name of lua sensors
2016-11-02 12:48:11 +01:00
3djc 2974af5018 Make abs macro AVR specific. This fixes gcc >= 6.2 compile issues. (#3960)
* Make abs macro AVR specific. This fixes gcc >= 6.2 compile issues. Tested on gcc 6.2 and 4.9.2

* Since we are getting conflicting result, and only 4 byte diff, lets remove it altogether ! And yeah, there was that typo too ;)
2016-11-02 11:10:03 +01:00
Bertrand Songis c3f0b01307 [XFire] Telemetry parser script updated 2016-11-02 09:19:14 +01:00
Andre Bernet 8a9f541753 Merge pull request #3974 from craftandtheory/frsky_definescleanup
Simple cleanup of #if defined
2016-11-01 15:28:20 +04:00
floaledm 74df9778bb Simple cleanup of #if defined 2016-11-01 04:56:58 -05:00
Andre Bernet 8408c1017d Merge pull request #3971 from opentx/schwabe/show_commit_on_radio
Display commit on radio
2016-11-01 09:55:15 +04:00
Arne Schwabe bbcd5c9336 Explicilty set CMP0042 to NEW, which is the default anyway, to silence cmake warning on OS X 2016-11-01 01:19:42 +01:00
Arne Schwabe 798f5e6826 Display commit on radio
This makes it easier to diagnose which exact version is on a radio when dealing with build from source version
2016-10-31 21:32:15 +01:00
Damjan Adamic ff2fdacfb2 Fixes #3872: Companion export to Google Earth now converts feet to meters if GPS altitude is logged in feet. 2016-10-31 11:58:35 +01:00
Damjan Adamic 258b8adfb9 Fixes #3912: Deleting file in SD manager updates the list wrongly (Horus) 2016-10-31 11:07:44 +01:00
Damjan Adamic c043c377a7 Fixes #3935: overlapping display of EDGE logical switch parameters (Horus) 2016-10-30 16:50:50 +01:00
Damjan Adamic 37ea272bd4 Replaced all 1900 with TM_YEAR_BASE 2016-10-30 11:35:12 +01:00
Andre Bernet 6378c97b33 Companion works on WinXP again 2016-10-30 12:05:57 +04:00
Damjan Adamic 024b07a384 Incorrect unit was used for UNIT_CELLS in SD Logs 2016-10-29 21:28:04 +02:00
Damjan Adamic 88f8ea0e14 Merge pull request #3959 from opentx/schwabe/fix_clang_warnings2
Schwabe/fix clang warnings2
2016-10-27 20:21:03 +02:00
Bertrand Songis 8626c0728c [Companion] Fixes #3858 (#3958) 2016-10-27 20:12:45 +02:00
Arne Schwabe 1a9a23c420 Completely remove verify macro in favour of static_assert 2016-10-27 15:08:10 +02:00
Arne Schwabe ae01156598 Use static_assert instead of using homegrown macro 2016-10-27 14:59:01 +02:00
Arne Schwabe 2e65e745ee - Remove warnings about deprecated QStyleOptionView by using unversioned version
- Fix warning about converting strings.
2016-10-27 14:53:24 +02:00
Arne Schwabe 0b0059908c Abort cmake if leftover files of 2.1 are found (#3955)
This is becoming a FAQ. File selection might not be perfect but is good enough to trigger the error.
2016-10-26 20:36:58 +02:00
Arne Schwabe 92dde79dec New protocol and telemetry: FlySky AFHDS2A (#3948)
* New protocol for multimode FlySky AFHDS2A

* Also add AFHDS2A protocol to companion

* fix compile error
2016-10-25 22:51:34 +02:00
3djc d218b33609 Merge pull request #3950 from opentx/3djc/Horus-enable-perm-scripts
3djc/horus enable perm scripts
2016-10-24 09:04:15 +02:00
Damjan Adamic 0eba5c4c9c Added missing audio volume initialization (caused by ed07dd76ef) 2016-10-23 21:00:47 +02:00
3djc 4825ffe2f3 Cosmetics 2016-10-23 14:44:07 +02:00
3djc cff0b33f4b Cosmetics 2016-10-23 14:42:59 +02:00
3djc 4f24088719 Enable permanent scripts on Horus 2016-10-23 14:41:05 +02:00
Arne Schwabe e580927fc1 Add opentx os x build vm and allow more cores to be used for fast mac… (#3947)
* Add opentx os x build vm and allow more cores to be used for fast machines.
2016-10-23 13:18:26 +02:00
Arne Schwabe 73a7027eb9 [X9D] Allow toggling Haptic option for Taranis X9D (closes #3946) (#3949) 2016-10-23 12:28:18 +02:00
3djc ae47b1a4d1 Fix sdcard rev 2016-10-22 15:49:05 +02:00
3djc 566b6f1dfa Fix version for sdcard 2016-10-22 15:41:57 +02:00
3djc 3ad33410b1 Reuse firmware code location 2016-10-22 15:07:53 +02:00
Andre Bernet f8d5a7763a Merge pull request #3883 from opentx/schwabe/spektrum_dsm2_bind
Update OpenTX Multi code to match current DIY-MULTI module code
2016-10-21 20:32:09 +02:00
Damjan Adamic 17ebe560f6 Removed unneeded debug trace (audio) 2016-10-21 19:57:07 +02:00
Andre Bernet 978867d509 Merge branch 'next' into schwabe/spektrum_dsm2_bind
# Conflicts:
#	radio/src/translations/de.h.txt
2016-10-21 19:36:31 +02:00
Arne Schwabe 186634cc08 Change the companion bundle name to not include the version (#3943)
* Change the companion bundle name to not include the version

This show only up in the Apple Menu, a version numbers look really strange there. The title of the main window and CMD-TAB still show 2.2 there.

* Drop OpenTX instead of version
2016-10-21 19:24:23 +02:00
3djc a57298fc8f Fix path and names 2016-10-21 17:39:19 +02:00
Arne Schwabe e13dd6490d Rename "autobind" to "bind on powerup"
The autobind designation confused many users. Bind on power up should give more clarity
2016-10-21 17:14:01 +02:00
Arne Schwabe c4ad38670f Fix french translation and move custom protocol string in its own string 2016-10-21 17:00:59 +02:00
Damjan Adamic f4b54ea332 Fixes #3937: When executed from Special Functions, Flight Reset cause… (#3942)
* Fixes #3937: When executed from Special Functions, Flight Reset caused a GUI lockup

* Cosmetics
2016-10-21 12:16:33 +02:00
3djc 81e9fe5201 Standardize app naming 2016-10-21 10:48:37 +02:00
3djc 93d7e134b0 Since we do not have support for nl TTS, better not compile it 2016-10-21 09:40:27 +02:00
3djc e730bf1968 Port to next (#3941) 2016-10-21 09:24:21 +02:00
Bertrand Songis e8f043921f [Companion] Warning removed 2016-10-21 08:37:05 +02:00
Bertrand Songis d4b6ebd2fe [Companion] Warning removed 2016-10-21 00:19:28 +02:00
Arne Schwabe ad8cd2546e Schwabe/silence register warnings clang (#3940)
* Ignore deprecated register warning for the the STM include files

Ignore the warning with the use of #pragma which is not elegant but otherwise we would have to change the vendor files

* Remove usage of register in C/C++ files.

Modern compilers ignore it anyway and C++11 actually deprecates it. Removing also removes a number of clang warnings about this
2016-10-21 00:09:54 +02:00
Bertrand Songis ba824537d4 [Companion] Cosmetics 2016-10-20 21:14:34 +02:00
Bertrand Songis 3db86b2276 [Companion] Warning removed 2016-10-20 20:58:34 +02:00
Bertrand Songis 71bb6de3dd [X7D] Rotary encoder initialization 2016-10-20 18:54:51 +02:00
Bertrand Songis d2f688c7d9 [X7D] Bootloader fix 2016-10-20 18:54:04 +02:00
Bertrand Songis 2b1c8ee783 [X7D] DMA write on adcValues overflow over rotary encoder value (rotary encoder was always moving) 2016-10-20 18:53:32 +02:00
Bertrand Songis 774bd48b47 [X7D] Audio volume initialization was not correctly done 2016-10-20 18:26:22 +02:00
Bertrand Songis ed07dd76ef [X7D] Audio volume initialization was not correctly done 2016-10-20 17:54:06 +02:00
Damjan Adamic 44133b595d Re #3815: Audio refactoring (#3926) 2016-10-19 22:56:25 +02:00
Arne Schwabe a19f4c78bf Fix building with precompiled QT (rpath fix), fix build-compaion.sh script 2016-10-19 22:26:29 +02:00
Bertrand Songis 9f67c0c49b [X7D] Software volume 2016-10-19 20:40:47 +02:00
Arne Schwabe 9a02e0b6b3 Schwabe/cpack osx (#3776)
* [Companion] Add logic to add background and DS_Store. Start with Cpack for OS X

* Major overhaul of the OpenTX packing for OS X

* Update DS_Store to not show toolbar (noticed by @Kilrah, thanks!)

* Minor fixes

* set BU_CHMOD_ITEMS to avoid packaging errors

* Rename the app to a nicer name on OS X (OpenTX Companion 2.2.app instead of companion.app)

* Embed dfu-util into bundle (first part of #3908)

* Fix showing status bar showing in disk image

* Workaround for CMAKE_OSX_DEPLOYMENT_TARGET
2016-10-19 18:00:27 +02:00
Benjamin Boy 236d3149ee German spoken language fixed.
Spoken numbers fixed:
100 -> "ein", "hundert"
1000 -> "ein", "tausend"
999 -> "9", "hundert", "99"

Timers:
60 seconds -> "eine", "minute"
3600 seconds -> "eine", "stunde"
120 seconds -> "2", "minuten"

Sound files needed to be generated because new words are used.
2016-10-19 14:17:15 +02:00
3djc 72bffae7fd Horus deserves it too ! (#3938) 2016-10-19 13:27:23 +02:00
Arne Schwabe 25a91076d6 Multiple fixes for German translation (#3930)
* Multiple fixes for German translation

* Add changes/better wording by @rcbebo82, thanks!

* Use less controversial translation for killed

* change all line ending to '\n'

* Also add translations from pull request #3929

* Fix too long strings for 128x64 UIs
2016-10-18 23:34:11 +02:00
Damjan Adamic 85f7a09b9c Fixes #3858: added edge detection to RESET and GVAR INC/DEC functions (#3921)
* Fixes #3858: added edge detection to RESET and GVAR INC/DEC functions

* Re #3858: Gtests added for Special Functions: FLIGHT_RESET and GVAR_INC

* Re #3858: Gtests fixed

* Re #3858: Gtests fixed 2
2016-10-18 18:19:11 +02:00
3djc b56a65cc1a 3djc/horus fix3924 (#3932)
* Forbid delete category when not empty. Add confirmation
This fixes #3924 and #3823

* Cosmetics
2016-10-18 18:18:00 +02:00
Damjan Adamic 4513cf89f2 Projectkk2glider/fatfs 0.12 (#3925)
* Re #3815: Disk cache: Write statistic added. Bigger disk cache. Show disk cache misses in CLI.

* Update to the latest FatFS R0.12b (all existing OpenTX patches have been already applied in upstream, only few ff.h modifications needed for simulator)

* Missing file

* SD card manager: do not show parent dir [..] for root directory
2016-10-18 18:14:17 +02:00
3djc eb24bbacbb Merge pull request #3916 from opentx/3djc/revise-sdcard-version
3djc/revise sdcard version
2016-10-18 10:38:07 +02:00
Bertrand Songis 407cc432f2 [X7D] Switches fixes 2016-10-18 00:06:50 +02:00
Bertrand Songis b85dcb9f85 [X7D] ADC fixes 2016-10-17 22:55:03 +02:00
Arne Schwabe 1aa6d113ee Remove DSM wrong PNRG since the multi will avoid ids that trigger this problem 2016-10-17 01:03:50 +02:00
3djc 325af01421 Cosmetics 2016-10-16 23:12:24 +02:00
Arne Schwabe 6bec8cef5a Stop bind on bind response received 2016-10-16 22:24:37 +02:00
Arne Schwabe f12ce22ade SFHSS also allows frequency fine tuning 2016-10-16 22:24:37 +02:00
Arne Schwabe a21d3e6f2e Fix sending number of dam channels, give DSM2 debug telemetry output a better name 2016-10-16 22:24:36 +02:00
Arne Schwabe 543a1d14e8 Port all Multi changes also to 9X and Horus UI 2016-10-16 22:24:36 +02:00
Arne Schwabe 4082a320b8 Fix also companion not use the CUSTOM protocol as normal protocol anymore. 2016-10-16 22:24:36 +02:00
Arne Schwabe 278e71d6f9 Fix the custom protocol logic for multi
There parts that were not handling custom vs non custom right
2016-10-16 22:24:18 +02:00
Arne Schwabe b56b7d06cb Allow Companion to read/write the change struct format and make reading/writing a bit cleaner 2016-10-16 22:17:38 +02:00
Arne Schwabe c055e93247 Rework DSM2/X support, auto protocol selection for DSM2
Support more than 31 protocols for the multi module. Breaks existing multi eeproms, need to reselect protocols
2016-10-16 22:17:38 +02:00
Arne Schwabe c592fed9f1 Implement the new multi protocols 2016-10-16 22:17:38 +02:00
Arne Schwabe bcf7b48359 Implement parsing the bind packet from DSM2 (untested) 2016-10-16 22:17:38 +02:00
Damjan Adamic b8e5d60fca Fixes #3580: GVAR Subtrim option only available on Taranis and Horus (thanks to elecpower) 2016-10-16 17:47:03 +02:00
3djc 41dc15f765 Wording and translations 2016-10-16 13:21:24 +02:00
3djc b2bf90be34 Revise (tentative) wording
Put back full version string
2016-10-16 13:02:07 +02:00
3djc cd2204893e Missing bits 2016-10-16 12:00:43 +02:00
3djc 3ef83348b1 Generate sdcard files zip with version number 2016-10-16 11:58:58 +02:00
3djc 2b61f674bb Displays required sdcard version on error 2016-10-16 11:45:06 +02:00
Bertrand Songis 52c4ab4c75 [X7D] LCD was upside down 2016-10-16 10:39:09 +02:00
lichtl adb4b122bb Fix #3837 - Fix wizard for non Horus (#3902)
* move WIZARD in correct folder

* remove lcd.lock function
2016-10-16 09:29:12 +02:00
3djc 26d2de18c2 Change default at model creation from XJT-D16 8CH to XJT-D16 16CH on … (#3913)
* Change default at model creation from XJT-D16 8CH to XJT-D16 16CH on Taranis and Horus

* Set defaultto 16CH also on protocol change

* External module on Taranis

* MACRO's are good for you

* They are so good they should be used everywhere !

* And everywhere also includes the 9X UIs!
2016-10-16 09:22:36 +02:00
Andre Bernet 504bb7a98c [Horus] Reset SF didn't handle telemetry sensors 2016-10-15 13:51:52 +02:00
3djc 8de57dc1a3 Prevent segfault on extended trim (#3907)
* Prevent segfault on extended trim
This fixes @3860

* Cosmetics
2016-10-15 10:33:56 +02:00
3djc 7e02981c52 Merge pull request #3906 from opentx/3djc/S6R-improvement
Use a less controversial wording + performance fixes.
2016-10-15 10:22:39 +02:00
Damjan Adamic b50fca5849 Move standalone simulator EEPROM back in user documents directory (changed in aec2170e7e) 2016-10-14 11:07:45 +02:00
Damjan Adamic 5ca9280627 Fixed: standalone simulator could not create directory for EEPROM file 2016-10-14 09:57:40 +02:00
3djc 253208d20e Merge pull request #3903 from opentx/3djc/XJT-Latency-info
3djc/xjt latency info
2016-10-14 08:13:22 +02:00
3djc b1d9011dae Improve Taranis as well 2016-10-14 07:31:26 +02:00
3djc c30d99a7e3 Use a less controversial wording + performance fixes.
This fixes #3905
2016-10-13 23:08:49 +02:00
Damjan Adamic 0c26cd0723 Fixes #3841: simulator EEPROM thread was not created in Release build 2016-10-13 16:10:04 +02:00
3djc 628c7150df proper handling of external module 2016-10-13 11:46:19 +02:00
3djc 233ce403de XJT lat for Taranis 2016-10-13 10:22:56 +02:00
3djc 2ff1a075b2 Display XJT latency on Horus 2016-10-13 10:13:29 +02:00
Damjan Adamic 10f3d1c4b7 WARNINGS_AS_ERRORS enabled in commit tests for X7D 2016-10-12 22:21:36 +02:00
Damjan Adamic 0d74148d70 Added WARNINGS_AS_ERRORS cmake option for radio firmware 2016-10-12 22:05:29 +02:00
Damjan Adamic e5a5a6319f Fixes for lua_exports generation 2016-10-12 21:20:24 +02:00
Bertrand Songis 85273d07c1 #3817 fixes 2016-10-12 18:12:12 +02:00
Andre Bernet ed2a232bda Allow selecting a model image from the SD manager (#3817) 2016-10-12 17:42:34 +02:00
3djc 515c122521 3djc/build revise handling sdcard.version (#3897)
* Move opentx.sdcard.version creation to server build process

* opentx.sdcard.version should not exist prior, but just in case ...
2016-10-12 17:38:24 +02:00
Bertrand Songis f0608f4837 Registered widgets limit removed (#3899) 2016-10-12 17:36:37 +02:00
3djc 7e8bebfaac S6R support (#3896) 2016-10-09 21:25:19 +02:00
Andre Bernet fcdab1ff4e Bump SD version on repo 2016-10-09 17:01:26 +02:00
3djc e7281c957c 3djc/add sdcard dir struct (#3894)
* Add taranis

* Add readme to folder structure

* Add templates

* Add directory structure for Horus

* remove snake for Horus

* No telem folder for Horus, use widgets instead

* Include some details on formats

* Improvement based on bsongis feedbacks

* Cosmetics

* sdcard version change required
2016-10-09 10:37:52 +02:00
Damjan Adamic 2dd8b8702f Re #3827: added mutex to getADC(), because adcRead() is not reentrant (#3889)
* Re #3827: added mutex to getADC(), because adcRead() is not reentrant

* Re #3827: alternative solution to prevent calling getADC() from different threads, because adcRead() is not reentrant

* Cosmetics
2016-10-08 22:09:25 +02:00
3djc 1e4470a007 Revert commit 7c6dd36ee1, which was preventing LEFT even when specified 2016-10-08 12:04:48 +02:00
Bertrand Songis 8c1231869e [Horus] S.PORT to Lua passthrough (#3810)
* [Horus] S.PORT to Lua passthrough

* Fixes. Still not tested

* Do not speak when we have nothing to say

* Move outputTelemetryBufferSize check earlier
2016-10-08 09:40:31 +02:00
Damjan Adamic 7509146a8f Fixes #2577: order of displayed GPS coordinates changed according to ISO 6709 (latitude before longitude) (#3878) 2016-10-08 09:39:46 +02:00
Arne Schwabe c4a1dc4c70 Add 'Z' as key to the rotary encoder emulation (#3881)
This helps us people with non AZERTY keyboards that have Z left to the X. Doesn't help German layouts with 'Y' next to 'X' but that key is already used as trim key.
2016-10-08 09:38:21 +02:00
Damjan Adamic 88e1740422 Fixes #3882: Widget option min an max values were not parsed (resulted in Lua disabled) 2016-10-07 15:18:49 +02:00
3djc c240042207 Merge pull request #3880 from opentx/3djc/lua-make-luaDrawNumber-consistent
Ensure default for luaDrawNumber is RIGHT for consistency with 2.1.x
2016-10-07 13:39:17 +02:00
3djc 0110578bfe Improve documentation 2016-10-07 11:21:12 +02:00
Arne Schwabe 3d9e2357c0 Make tools/commit-tests.sh work again on OS X 2016-10-07 11:10:49 +02:00
Arne Schwabe c41455aac4 Fix typo that breaks internal PPM for Taranis 2016-10-07 11:09:00 +02:00
3djc 7c6dd36ee1 Ensure default for luaDrawNumber is RIGHT for consistency with 2.1.x 2016-10-07 10:54:54 +02:00
Damjan Adamic def3ba9d66 S-PORT GPS parsing was wrong: latitude and longitude were exchanged with each other
Telemetry simulator latitude and longitude were exchanged with each other (reverted from commit e7f6d321dd)
2016-10-06 10:51:45 +02:00
Damjan Adamic e7f6d321dd Telemetry simulator latitude and longitude were exchanged with each other 2016-10-06 10:31:26 +02:00
Damjan Adamic f3c2a4db93 Fixed Frsky-D telemetry protocol GPS sensor, gtests added 2016-10-05 17:57:02 +02:00
Damjan Adamic 5157a9f33c Fixes #3843: GPS logging in decimal degrees format. Companion export to Google Earth fixed. 2016-10-05 17:57:02 +02:00
3djc 5864834661 Merge pull request #3876 from opentx/3djc/Horus-input-tidy-up
Tidy up column spacing
2016-10-05 11:09:46 +02:00
3djc c766d44bbd Tidy up column spacing 2016-10-05 10:21:02 +02:00
Arne Schwabe 850f41df42 Compilation fix for Clang/OS X 2016-10-03 23:39:46 +02:00
3djc b8985b9d19 Fix indexing in outputs (listed bug was also affected copy sticks/trims to subtrims) (#3871)
Fix #3870
2016-10-03 15:03:32 +02:00
Damjan Adamic 29e618146c Taranis compilation fixes 2016-10-02 17:43:01 +02:00
Damjan Adamic 2a8629c670 Fixes #3826: disable Lua platform optimizations (lua_number2integer() behaves the same way on all platforms) 2016-10-02 17:00:03 +02:00
3djc 689587c2e0 Merge pull request #3848 from rcbebo82/patch-3
Update tts_de.py
2016-09-27 10:14:27 +02:00
Benjamin Boy b95deeee9f Update tts_de.py
Final change for trims.
2016-09-26 21:37:24 +02:00
Benjamin Boy 33608b3eb2 Update tts_de.py
Changed Endtrim and Mintrim to the same spoken words.
2016-09-26 15:55:12 +02:00
Benjamin Boy 069576515d Update tts_de.py 2016-09-26 14:24:48 +02:00
3djc 670a832985 Bug fix for X9E (FM all active at the same time in special funcitons) (#3854)
* Bug fix for X9E (FM all active at the same time in special funcitons)

* Fix the fix
2016-09-25 09:36:44 +02:00
3djc 435346ce3a Merge pull request #3850 from opentx/3djc/companion-fixes-port2-next
Port fixes by elecpower to next
2016-09-24 14:12:29 +02:00
3djc 88177572fc Port fixes by electpower to next
Fixed #3662
2016-09-24 13:05:07 +02:00
Benjamin Boy f00d5d9417 Update tts_de.py
Translated crow to "Butterfly", changed filenames accordingly to the english ones so its possible to change from english to german without the need of editing the Special Functions section per model.
Removed "Minimale Trimmung", in my opinion this makes no sense a trim only can be at maximum or at center.
2016-09-23 13:58:53 +02:00
Bertrand Songis 013a5c06e6 [X7D] Impossible to play a wav file from the SD File Manager 2016-09-23 07:03:15 +02:00
3djc ad8394cbd3 Merge pull request #3842 from opentx/3djc/fix-3774
Companion bugfix
2016-09-22 09:51:08 +02:00
3djc b1332c6494 Port to next work by Elecpower: https://github.com/opentx/opentx/pull/3838 2016-09-22 07:43:24 +02:00
Damjan Adamic fa174a8279 CLI cosmetics 2016-09-20 21:58:25 +02:00
Damjan Adamic f03837f45d Fixes #3836: if multi-block SD read fails, fall back to the single block reads [Horus] 2016-09-20 21:12:43 +02:00
Damjan Adamic 444d552d5a CLI improvements:
* repeat last command on empty line input
 * added SD card read test [testsd] (multi block read of last sectors)
2016-09-20 20:04:02 +02:00
Damjan Adamic 3b10c28b66 SD timeouts increased [Horus] 2016-09-19 22:07:05 +02:00
Damjan Adamic 3fddb28c4f CLI readsd fixes 2016-09-19 22:07:05 +02:00
Damjan Adamic ac85678616 Disk cache debug traces fix 2016-09-19 22:07:05 +02:00
mhotar 2ab636b9ed CZ translations 2016-09-19 22:02:17 +02:00
mhotar f4e5d27b6c CZ translations 2016-09-19 21:59:38 +02:00
mhotar 562f33e224 CZ translations 2016-09-19 21:43:34 +02:00
3djc e82ff230a5 Allow timer up to the max the timer can handle (#3830) 2016-09-19 21:00:18 +02:00
3djc 0a5b357bab Add (again ?) saving perstistanttimers/pot/sensoors on Horus model change (#3829) 2016-09-19 20:59:33 +02:00
3djc 9b6217e1c3 S6R : Add nice graphics by mhotar (#3831)
* Add nice graphics by mhotar

* Cosmetics
2016-09-19 20:58:26 +02:00
Damjan Adamic d12015e91d Sector size fix for non SD-HC cards [Horus] 2016-09-18 23:03:05 +02:00
3djc f675506bc6 3djc/taranis improve s6 r (#3825)
* Step 1 : calibration

* Step 2 : remove calib for main LUA

* Clean BMP
2016-09-18 15:59:55 +02:00
3djc 3107bbb88b Insert a calibration complete step and move bmp to folder (#3819) 2016-09-17 21:50:25 +02:00
Damjan Adamic 91cea45a43 Audio fixes (#3818)
* * Switches audio filenames were wrong [Horus]
* sdAvailableLogicalSwitchAudioFiles was too small (we now have 64 LSW), fixed with BitFiled class

* Enabled Travis Gtests on Horus

* SD card version mismatch trace

* Re #3815: Audio debug timers added
2016-09-17 21:49:52 +02:00
3djc 9a40902c9d Fix too happy Travis 2016-09-17 12:08:56 +02:00
3djc 7bfb213687 Allow sdcard version change from cmake (#3816)
* Allow sdcard version change from cmake

* Make it sdcard version check ARM only

* Move to common ARM
2016-09-17 08:53:01 +02:00
3djc 6c38dcc885 Sound filemane too long 2016-09-16 13:21:23 +02:00
3djc 04ead96133 Typo, thx Kilrah 2016-09-16 10:36:38 +02:00
3djc 5254f0cc7b Make linux Companion happy 2016-09-16 08:58:45 +02:00
mhotar 980f8c52e8 CZ partial cz translation 2016-09-15 21:41:08 +02:00
Bertrand Songis 298716189e Cosmetics 2016-09-15 19:30:54 +02:00
Bertrand Songis 7635f9d91e Warning fixed 2016-09-15 19:30:24 +02:00
3djc 64748a6339 Cosmetics 2016-09-15 18:17:15 +02:00
3djc 8f54e3188e Merge pull request #3809 from rcbebo82/patch-1
Update tts_de.py
2016-09-15 18:11:44 +02:00
Benjamin Boy de67a9c215 Update tts_de.py 2016-09-15 17:00:22 +02:00
Benjamin Boy 584c9b592c Update tts_de.py 2016-09-15 16:46:47 +02:00
Benjamin Boy 5f80f9b246 Update tts_de.py
Some Translation Errors corrected.
2016-09-15 16:44:05 +02:00
3djc 740356c4c2 Tested ok on X9E and HORUS dev, more test needed (#3802) 2016-09-14 18:59:08 +02:00
3djc 576c148b9c Add X12S keypad FIRST events to LUA (#3801)
* Add X12S keypad FIRST events to LUA

* X9E fix
2016-09-14 18:57:45 +02:00
3djc 8bafdb1725 3djc/faster local commit tests (#3800)
* Allow passing desired core usage for commit-tests (speed up local execution)

* Cosmetics

* Cosmetics

* Allow make style -j8 as well

* Looks better like this I think
2016-09-14 18:55:37 +02:00
3djc bbb2fe2dbc Merge pull request #3796 from opentx/3djc/Horus-fix-model-setup-pots
Fix model setup screen for Horus of pots and slides checks handling
2016-09-14 08:15:40 +02:00
3djc b4f957a166 Cosmetics 2016-09-14 08:01:07 +02:00
3djc 856cddbc84 Fix model setup screen for Horus of pots and slides checks handling
Note : this fix only the UI, another PR will fix behaviour
2016-09-13 20:21:37 +02:00
Bertrand Songis edee15b21d Typos 2016-09-13 20:16:48 +02:00
Bertrand Songis dbd47737cb Compilation fix 2016-09-13 19:39:23 +02:00
Bertrand Songis c3a07675e4 Compilation fix 2016-09-13 18:48:35 +02:00
Bertrand Songis 2b32abe467 [ARM boards] Model persistent timers / telemetry / pots positions were not always correctly saved 2016-09-13 18:35:03 +02:00
Bertrand Songis 4a88d3477d Fixes #3766 2016-09-13 18:31:57 +02:00
Damjan Adamic acebc53470 Fixes #3782: nl translations updated (by fraternl) 2016-09-12 21:22:53 +02:00
Bertrand Songis d44f98d677 Fixes #3770 2016-09-12 18:32:26 +02:00
3djc 4d44eb97f5 Add rotary encoder support (#3792) 2016-09-12 11:49:58 +02:00
Bertrand Songis 1684256ed2 Merge pull request #3791 from opentx/3djc/LUA-move-evt-to-event_t
Move lua evt param from signed uint8_t to unsigned event_t
2016-09-12 07:41:59 +02:00
3djc d84fd993c9 Move lua evt param from signed uint8_t to unsigned event_t 2016-09-12 07:20:06 +02:00
Bertrand Songis 0f217b3507 Compilation fix 2016-09-11 23:34:49 +02:00
Bertrand Songis 8a31c1d555 Merge pull request #3789 from opentx/projectkk2glider/issue_3771_sd_lockup
Projectkk2glider/issue 3771 sd lockup
2016-09-11 22:36:01 +02:00
Damjan Adamic 038c997b8f Disable GPS messages that are not needed
GPS RTC sync fixes
2016-09-11 21:53:45 +02:00
Damjan Adamic cb08d37369 Interrupts must stay enabled on Horus when pushing audio buffer from audio thread (this affected 1ms interrupt) 2016-09-11 21:53:45 +02:00
Damjan Adamic 0076dd99e0 SDIO timeout fixes 2016-09-11 21:53:44 +02:00
Damjan Adamic e229c8f8e7 Log file moved to RAM and aligned for proper DMA access. Log functions renamed. 2016-09-11 21:37:54 +02:00
Damjan Adamic 6ddb9e414f Getting rid of sdMountPoll() on ARM 2016-09-11 21:37:54 +02:00
Damjan Adamic 183b24086a Trace installed 2016-09-11 21:37:54 +02:00
Bertrand Songis 4d03db1c49 Merge pull request #3787 from opentx/3djc/Horus-fix-hard-setup
Fix column handling
2016-09-11 18:36:19 +02:00
Bertrand Songis c15b35fff2 Merge pull request #3786 from opentx/3djc/TARANIS-Fix-Pots-checks
3djc/taranis fix pots checks
2016-09-11 18:35:51 +02:00
3djc de479fe6fc Fix column handling 2016-09-11 13:50:45 +02:00
Andre Bernet 0d12832d30 Revert "[Horus] Fixes #3770 - needs tests"
This reverts commit f131c79b87.
2016-09-11 13:41:53 +02:00
3djc 5590feac0f Make column handling consistent. Simu tested on x9d, x9d+, x9e 2016-09-11 13:14:03 +02:00
Damjan Adamic 8e3a228fc9 Cleanup 3 2016-09-11 11:21:58 +02:00
Damjan Adamic 8899d70e08 Cleanup 2 2016-09-11 11:05:33 +02:00
Damjan Adamic 3653b06ad9 Cleanup 2016-09-11 10:58:59 +02:00
3djc 60dc0cc68c Fixes 2016-09-11 09:39:06 +02:00
3djc c9b590465c Fix 2016-09-10 20:14:01 +02:00
3djc 3b5e5ebfa3 The 4 sliders are now treated equally :)
WARNING :
-you WILL need to go in hardware menu to add the 2 missing sliders .
definition
- you also NEED to go to calibration (where you will now see the 4 sliders)
2016-09-10 19:31:18 +02:00
mhotar 35ebe455c0 CZ tts updated 2016-09-10 19:00:46 +02:00
Damjan Adamic 294611c457 Fixes #3772: USB Joystick channels were mapped incorrectly on Horus 2016-09-10 12:06:51 +02:00
3djc df7882e14f Yes, commit-check would have been a good idea :s 2016-09-10 11:12:45 +02:00
3djc 19fd1f2556 Finaly working on X9E, tested both man and auto 2016-09-10 10:40:54 +02:00
Bertrand Songis 95fc89ec67 Merge pull request #3779 from opentx/mhotar/fullczcharset
Reduced anf full cz charset for Horus and the others
2016-09-09 21:51:13 +02:00
3djc 42cdf71b8d Change language directly 2016-09-09 20:46:28 +02:00
3djc 77010ee7e3 TRACE test 2016-09-09 20:41:48 +02:00
3djc 6769dab121 NOT HORUS = cz_reduced 2016-09-09 09:13:55 +02:00
Arne Schwabe c0cc4e250e Fix polarity for last pulse with DSM2/Multi
The DSM/Multi timing changed the index to begin with 0 instead of 1 and that broke the putDSM2Flush logic
2016-09-08 23:01:13 +02:00
Bertrand Songis a61c206c38 Merge pull request #3778 from opentx/schwabe/fix_pulses_timing
Fix timing of Multi and DSM2 protocol
2016-09-08 21:26:28 +02:00
Arne Schwabe de3db6eec0 Fix timing of Multi and DSM2 protocol
We send an extra stopbit and the logic for driving the transistor was swapped. Thanks Mike for noticing (http://www.rcgroups.com/forums/showpost.php?p=35671709&postcount=5151)
2016-09-08 20:24:22 +02:00
Arne Schwabe 753b12f886 Compile fix for gcc 5 2016-09-08 20:23:39 +02:00
3djc 833d6a6b27 Add some missing plural forms, increment audio version 2016-09-08 08:52:51 +02:00
Bertrand Songis 4343bd9826 [Crossfire] Tx power enum was displayed instead of real value 2016-09-08 06:43:34 +02:00
Andre Bernet 15f62be1db Cosmetics 2016-09-07 19:19:15 +02:00
mhotar 610762a89d blue theme images 2016-09-06 22:40:17 +02:00
Bertrand Songis f131c79b87 [Horus] Fixes #3770 - needs tests 2016-09-06 20:12:24 +02:00
Bertrand Songis 3156dd3040 [Horus] Display problem in INPUT screen (no scroll) 2016-09-06 19:53:58 +02:00
mhotar f2218fa44d dmg background 2016-09-06 16:50:14 +02:00
Bertrand Songis a5e8deabac Merge pull request #3744 from opentx/schwabe/multi_new_protocols
Add new protocols supported by the DIY Multi module
2016-09-05 22:14:27 +02:00
Bertrand Songis 250bcde474 Merge pull request #3765 from opentx/3djc/Horus-add-timer3
Add timer3 as default on Horus
2016-09-05 22:12:58 +02:00
Bertrand Songis 1ac835d420 Cosmetics 2016-09-05 22:11:48 +02:00
3djc db326b6723 Make timer3 default for all arm boards 2016-09-05 20:20:19 +02:00
Bertrand Songis 9d94f26ed6 Merge pull request #3756 from opentx/projectkk2glider/gps_clock_to_rtc_improvements
Projectkk2glider/gps clock to rtc improvements
2016-09-05 19:44:09 +02:00
Bertrand Songis 5dd46afaac Merge pull request #3767 from opentx/schwabe/pxx_own_struct
[Horus] Give pxx its own substruct instead of using ppm (cosmetics)
2016-09-05 19:34:47 +02:00
Bertrand Songis cc2c2b094e [Horus] S.PORT devices update should work (not tested)
[Horus] SD Manager files renaming fixed (quick & dirty, I would prefer a popup)
2016-09-05 19:33:06 +02:00
Arne Schwabe c16317609f [Horus] Give pxx its own substruct instead of using ppm (cosmetics) 2016-09-05 15:57:27 +02:00
Arne Schwabe 17adab3177 Telemetry on MULTI default to FrSky Hub telemetry, not smartport 2016-09-05 15:47:11 +02:00
3djc 209f8d646c Add timer3 as default on Horus 2016-09-05 10:20:04 +02:00
Bertrand Songis fd138cf22a [X7D] Compilation fix 2016-09-04 22:27:36 +02:00
Bertrand Songis d178982ec5 Cosmetics 2016-09-04 20:10:16 +02:00
Bertrand Songis 9a525f453b [HORUS] Bigger checkboxes 2016-09-04 20:05:51 +02:00
Bertrand Songis 04651784b5 [X9D+] S3 not available if disabled in HARDWARE menu 2016-09-04 20:05:51 +02:00
Bertrand Songis 7100eb990e Merge pull request #3759 from opentx/3djc/Fix#3757
Fix #3757
2016-09-04 20:03:04 +02:00
3djc 3d1a35c41f The simu needs it too 2016-09-04 18:54:20 +02:00
3djc 7be125ee4d Fix #3757 2016-09-04 18:20:38 +02:00
Bertrand Songis 75fe828e21 [X9D+] SH was not working anymore 2016-09-04 16:32:15 +02:00
Bertrand Songis ba74f3e61c [X9D] Fixes #3758 (not tested) 2016-09-04 00:03:32 +02:00
Damjan Adamic 61e6e63856 Missing menu itema and compilation fix 2016-09-02 23:25:05 +02:00
Damjan Adamic 874483ba55 Compilation fixes 2016-09-02 23:07:58 +02:00
Damjan Adamic bbadf9064a Compilation fix 2016-09-02 22:48:20 +02:00
Damjan Adamic 37df6f1968 * GPS sensor date/time now kept in UTC (previous conversion to local time was wrong)
* internal GPS sensor can now set RTC clock [Horus]
2016-09-02 22:35:54 +02:00
Damjan Adamic f9a5c99f29 Code style fixes (uncrustify + manual) 2016-09-02 21:18:19 +02:00
Damjan Adamic d8a00c3f3d * Code refactoring for GPS to RTC clock
* Enabled GPS adjust RTC option for Horus
* Moved sensor ID to the right to allow display of GPS date/time in Telemetry screen
2016-09-02 20:47:56 +02:00
Bertrand Songis 2463a077b6 [Horus] Delay reduced for each step during calibration of the 6POS switch 2016-09-02 19:23:47 +02:00
Bertrand Songis 712be64016 [Horus] Cosmetics 2016-09-02 19:22:53 +02:00
Bertrand Songis b1cf4da7bb [Horus] Optimization for the Model Select screen (proxy design pattern) 2016-09-02 18:55:33 +02:00
Bertrand Songis aecf70158e Cosmetics 2016-09-02 18:54:32 +02:00
Bertrand Songis 3763552f4a Cosmetics 2016-09-02 18:53:36 +02:00
Bertrand Songis 061e163a62 [Horus + Taranis] Navigation improvement in the Trainer menu 2016-09-02 18:51:56 +02:00
Bertrand Songis 6225c048ef [Taranis] Display problem in the Mixer screen 2016-09-02 18:50:55 +02:00
3djc 07c4563764 Adjust languages for DB (#3754) 2016-09-02 17:49:05 +02:00
3djc 7bb5ece2c6 Regenerate sdcard pack only on opentx.sdcard.version change 2016-09-02 17:41:10 +02:00
3djc 580e4e71eb Sound generation change now ready to run 2016-09-02 10:13:54 +02:00
3djc 64b7369a51 FIX 2016-09-02 09:55:00 +02:00
3djc c089be96f5 Fix path on server 2016-09-02 09:52:25 +02:00
3djc 6ea6c2c8f1 Change sound generation for nightly to linux based 2016-09-02 09:46:38 +02:00
3djc 76def1195f Temporary disable sdcard regen on nightly 2016-09-01 23:58:33 +02:00
mhotar d30c7cc97d One CZ char was duplicated in translate.py 2016-09-01 21:02:08 +02:00
Bertrand Songis bf43aa839e [Horus] CZ font 2016-09-01 18:54:21 +02:00
Arne Schwabe e1a60b801a Add new protocols supported by the DIY Multi module 2016-09-01 13:09:13 +02:00
Bertrand Songis 9639be152d [Horus] CZ fonts 2016-08-31 21:36:09 +02:00
mhotar 7e296db599 full cz charset for horus 2016-08-31 21:33:37 +02:00
2128 changed files with 515738 additions and 479045 deletions
+88
View File
@@ -0,0 +1,88 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
jobs:
build-std:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
python3 ./tools/build-flysky.py -bI6X -tALL $PWD/
- store_artifacts:
path: output
build-std-dfplayer:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
python3 ./tools/build-flysky.py -bI6X_DFPLAYER -tALL $PWD/
- store_artifacts:
path: output
build-heli:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
python3 ./tools/build-flysky.py -bI6X_HELI -tALL $PWD/
- store_artifacts:
path: output
build-heli-dfplayer:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
python3 ./tools/build-flysky.py -bI6X_HELI_DFPLAYER -tALL $PWD/
- store_artifacts:
path: output
build-en:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
python3 ./tools/build-flysky.py -bI6X_DFPLAYER -bI6X_HELI -bI6X -tEN $PWD/
- store_artifacts:
path: output
workflows:
openi6x-release-workflow:
jobs:
- build-en:
filters:
branches:
ignore:
- master
- /.*-maintenance/
- build-std:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-std-dfplayer:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-heli:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-heli-dfplayer:
filters:
branches:
only:
- master
- /.*-maintenance/
+112
View File
@@ -0,0 +1,112 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
# Source files
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
*.lua text
*.pxd text
*.py text
*.py3 text
*.pyw text
*.pyx text
*.pl text
*.pm text
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wmaproj text eol=crlf
*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf
*.sh eol=lf
# Compiled Object files
*.slo binary
*.lo binary
*.o binary
*.obj binary
# Precompiled Headers
*.gch binary
*.pch binary
# Compiled Dynamic libraries
*.so binary
*.dylib binary
*.dll binary
# Compiled Static libraries
*.lai binary
*.la binary
*.a binary
*.lib binary
# Executables
*.exe binary
*.out binary
*.app binary
# Binary files
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyd binary
*.pyo binary
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text
*.adoc text
*.textile text
*.mustache text
*.csv text
*.tab text
*.tsv text
*.sql text
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as an asset (binary) by default. If you want to treat it as text,
# comment-out the following line and uncomment the line after.
*.svg binary
#*.svg text
*.eps binary
+30
View File
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help the OpenTX team to improve OpenTX
---
*Before submitting, search the open issue if there is already a report of the bug*
Also often minor bugs are already fixed in nightly builds, often it is
a good idea to test (in a controlled environment like a bench setup)
with a nightly firmware to see if the bug still exists.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**General information**
- OpenI6X version (e.g. 1.8.0)
- Hardware (e.g. external module model)
+16
View File
@@ -0,0 +1,16 @@
---
name: Help
about: Problems or question of using OpenTX
---
The issue tracker here is for devlopment of OpenTX. This is not a
support site, only a bug tracking system. Please use support groups
like [rcgroups](https://rcgroups.com/) or
[openrcforum](https://www.openrcforums.com/forum/). See also our
[manual](https://opentx.gitbooks.io/manual-for-opentx-2-2/).
For quick questions you can also join our general chat.
Issues that fall into the category of asking for help, will be
generally closed as invalid without an answer.
+18
View File
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project to make OpenTX even better
---
*Before suggesting a new feature here, please search the open issue if there is already a request for the feature*
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+18 -8
View File
@@ -2,12 +2,22 @@
/.*project
/.settings
/.autotools
radio/src/bootloader/.dep/
radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.stamp
radio/src/lua/lua_fields_*.txt
radio/src/lua/lua_exports_*.txt
/*.user
/*.user.*
build*/
cmake-build-*/
/debian/
/CMakeFiles/*
radio/src/CmakeFiles/*
/.vscode/
*.cmake
*.make
*.marks
/nbproject/
*.bin
/radio/src/CMakeFiles/firmware.dir/link.txt
.push.settings.jsonc
build.sh
firm.sh
flash.sh
*.patch
+3
View File
@@ -0,0 +1,3 @@
[submodule "radio/src/thirdparty/GCS_MAVLink/include_v1.0"]
path = radio/src/thirdparty/GCS_MAVLink/include_v1.0
url = https://github.com/mavlink/c_library_v1.git
+7
View File
@@ -0,0 +1,7 @@
# .gitpod.yml
image:
file: Dockerfile
tasks:
- init: echo 'Welcome!'
- command: mkdir build && cd build
+47 -14
View File
@@ -1,27 +1,60 @@
sudo: required
dist: trusty
language: python
language: cpp
compiler: gcc
virtualenv:
system_site_packages: true
python:
- 3.4
env:
global:
# - QT_BASE=53
# - QT_BASE=54
# - QT_BASE=55
# - QT_BASE=56
- QT_BASE=57
# - GCC_ARM=/opt/gcc-arm-none-eabi/bin
- PYTHONPATH=${PYTHONPATH}:/usr/lib/python3/dist-packages
matrix:
#
# ALL will build every individual board & DEFAULT, sequentially.
# DEFAULT is "make all" (including Companion & Simulator), with default settings
#
# - FLAVOR=ALL
- FLAVOR=DEFAULT
- FLAVOR=ARM9X
# - FLAVOR=AR9X
# - FLAVOR=SKY9X
# - FLAVOR=9XRPRO
- FLAVOR=X7
- FLAVOR=XLITE
- FLAVOR=X9
# - FLAVOR=X9D
# - FLAVOR=X9D+
# - FLAVOR=X9E
- FLAVOR=HORUS
# - FLAVOR=X10
# - FLAVOR=X12Sr10
# - FLAVOR=X12S
before_install:
- sudo add-apt-repository ppa:ubuntu-sdk-team/ppa --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
- if [ "$QT_BASE" = "53" ]; then sudo add-apt-repository ppa:beineri/opt-qt532-trusty -y; fi
- if [ "$QT_BASE" = "54" ]; then sudo add-apt-repository ppa:beineri/opt-qt542-trusty -y; fi
- if [ "$QT_BASE" = "55" ]; then sudo add-apt-repository ppa:beineri/opt-qt551-trusty -y; fi
- if [ "$QT_BASE" = "56" ]; then sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y; fi
- if [ "$QT_BASE" = "57" ]; then sudo add-apt-repository ppa:beineri/opt-qt571-trusty -y; fi
- sudo apt-get update -qq
- pyenv uninstall -f 2.7.6 && pyenv install 3.5.4 && pyenv global 3.5.4
- pip install pillow
install:
- sudo apt-get --yes --force-yes install qtbase5-dev qtmultimedia5-dev qttools5-dev qttools5-dev-tools python3-pyqt5 curl gcc-arm-none-eabi libfox-1.6-dev libgtest-dev
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/gcc-avr_1%253a4.8-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpfr4_3.1.2-1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/avr-libc_1%253a1.8.0-4.1_all.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/binutils-avr_2.23.1-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpc3_1.0.1-1ubuntu1_amd64.deb
- sudo dpkg --install gcc-avr_1%3a4.8-2.1_amd64.deb avr-libc_1%3a1.8.0-4.1_all.deb libmpfr4_3.1.2-1_amd64.deb binutils-avr_2.23.1-2.1_amd64.deb libmpc3_1.0.1-1ubuntu1_amd64.deb
- sudo apt-get --yes --force-yes install curl libmpfr4 libmpc3 libfox-1.6-dev libgtest-dev
- sudo apt-get --yes --force-yes install gcc-arm-none-eabi
# Trying to build with gcc-arm 4.7 isn't working because it can't find the compiler, despite adding to PATH (in commit-tests.sh) by defining GCC_ARM above
# - wget --quiet https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2
# - tar xjf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2
# - mv gcc-arm-none-eabi-4_7-2013q3 /opt/gcc-arm-none-eabi
- sudo apt-get install --yes --force-yes -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}svg qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh
script:
- ./tools/commit-tests.sh .
- ./tools/commit-tests.sh
+163 -24
View File
@@ -1,57 +1,196 @@
project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "2")
set(VERSION_MINOR "1")
set(VERSION_REVISION "0")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
message(STATUS "OpenTX ${VERSION}")
set(SDCARD_REVISION "0018")
set(SDCARD_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}V${SDCARD_REVISION})
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0023 OLD)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW) # for ninja
endif()
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
set(SIMU_SRC_DIRECTORY ${COMPANION_SRC_DIRECTORY}/simulation)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND)
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
else()
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif()
message(STATUS "Looking for FOX ")
find_package(Fox)
if ((NOT FOX_FOUND) AND (NOT WIN32))
message("Libfox not found, simu target will not be available")
endif()
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
message(STATUS "OpenI6X ${VERSION} @${GIT_STR}")
# options shared by all targets
option(APP_CUSTOM_DBG_HANDLER "Use custom message handler for debug output in all Qt apps." ON)
set(APP_CUSTOM_DBG_LEVEL "0" CACHE STRING
"Debug output level: 0=debug+; 1=info+; 2=warn+; 3=critical+; 4=fatal only.")
set(APP_CUSTOM_DBG_SHOW_FILE "DEFAULT" CACHE STRING
"Show source file names in debug output. 1/0/DEFAULT (default is ON with DEBUG builds).")
option(VERBOSE_CMAKELISTS "Show extra information while processing CMakeLists.txt files." OFF)
option(WARNINGS_AS_ERRORS "Treat any compiler warning as an error (adds -Werror flag)." OFF)
if(WIN32)
set(WIN_EXTRA_LIBS_PATH "C:/Programs" CACHE PATH
"Base path to extra libs/headers on Windows (SDL & pthreads folders should be in here).")
list(APPEND CMAKE_PREFIX_PATH "${WIN_EXTRA_LIBS_PATH}" "${WIN_EXTRA_LIBS_PATH}/SDL") # hints for FindSDL
endif()
# Python check
find_package("PythonInterp")
if(PYTHONINTERP_FOUND)
message(STATUS "Python found, version: ${PYTHON_VERSION_STRING}")
get_filename_component(PYTHON_DIRECTORY ${PYTHON_EXECUTABLE} DIRECTORY)
else()
message(WARNING "Python not found! Most firmware and simu flavors not buildable.")
set(LUA NO)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # regular Clang or AppleClang
set(CLANG TRUE)
endif()
option(DISABLE_COMPANION "Disable building companion and simulators" OFF)
if(NOT DISABLE_COMPANION) # FIXME cosmetics/style
find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
find_package(Qt5Svg)
if(Qt5Core_FOUND)
message(STATUS "Qt Version: ${Qt5Core_VERSION}")
### Get locations of Qt binary executables & libs (libs are for distros, not for linking)
# first set up some hints
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(qt_core_path ${QtCore_LOCATION} PATH)
if(APPLE)
get_filename_component(qt_core_path "${qt_core_path}/.." ABSOLUTE)
endif()
set(QT_LIB_DIR ${qt_core_path} CACHE PATH "Path to Qt libraries (.dll|.framework|.so).")
find_path(QT_BIN_DIR NAMES "qmake" "qmake.exe" HINTS "${CMAKE_PREFIX_PATH}/bin" "${qt_core_path}/../bin" "${qt_core_path}" DOC "Path to Qt binaries (qmake, lupdate, etc.).")
find_program(QT_QMAKE_EXECUTABLE qmake HINTS "${QT_BIN_DIR}" DOC "Location of qmake program.")
find_program(QT_LUPDATE_EXECUTABLE lupdate HINTS "${QT_BIN_DIR}" DOC "Location of Qt's 'lupdate' program for updating translation files.")
# Try to find Qt translations
if(QT_QMAKE_EXECUTABLE)
execute_process(
COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE qt_translations_hint
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
find_path(QT_TRANSLATIONS_DIR NAMES "qt_en.qm" HINTS "${qt_translations_hint}" DOC "Path to prebuilt Qt translations (qt_*.qm).")
### Common definitions for the Qt-based apps
list(APPEND APP_COMMON_DEFINES -DSIMU)
list(APPEND APP_COMMON_DEFINES -DQXT_STATIC)
list(APPEND APP_COMMON_DEFINES -DQT_USE_QSTRINGBUILDER) # more efficient QString construction using % operator
if(MSVC)
list(APPEND APP_COMMON_DEFINES -D__STDC_LIMIT_MACROS)
endif()
if(APP_CUSTOM_DBG_HANDLER)
# provide full qDebug log context to our custom handler. This may also affect libsimulator, which is why it is here
list(APPEND APP_COMMON_DEFINES -DQT_MESSAGELOGCONTEXT)
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_ENABLE=1)
if(APP_CUSTOM_DBG_LEVEL GREATER -1 AND APP_CUSTOM_DBG_LEVEL LESS 5)
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_DEFAULT_LEVEL=${APP_CUSTOM_DBG_LEVEL})
endif()
if(NOT APP_CUSTOM_DBG_SHOW_FILE STREQUAL "DEFAULT" AND (APP_CUSTOM_DBG_SHOW_FILE STREQUAL "1" OR APP_CUSTOM_DBG_SHOW_FILE STREQUAL "0"))
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_SHOW_SRC_PATH=${APP_CUSTOM_DBG_SHOW_FILE})
endif()
else()
list(APPEND APP_COMMON_DEFINES -DAPP_DBG_HANDLER_ENABLE=0)
endif()
else()
message(WARNING "Qt not found! Companion and Simulator builds disabled.")
endif()
if(NOT WIN32)
find_package(Fox QUIET) # QUIET not working on WIN32?
if (FOX_FOUND)
message(STATUS "Foxlib found at ${FOX_LIBRARY}")
else() # if(NOT WIN32)
message("Libfox not found, simu target will not be available")
endif()
endif()
if(Qt5Core_FOUND OR FOX_FOUND)
set(SDL_BUILDING_LIBRARY YES) # this prevents FindSDL from appending SDLmain lib to the results, which we don't want
find_package("SDL")
if(SDL_FOUND)
message(STATUS "SDL Lib: ${SDL_LIBRARY}; Headers: ${SDL_INCLUDE_DIR}; Version: ${SDL_VERSION_STRING}")
if (NOT ${SDL_VERSION_STRING} VERSION_LESS "2.0")
message(FATAL_ERROR "OpenTX requires SDL 1.x, not 2.x")
endif()
else()
message(STATUS "SDL not found! Simulator audio, and joystick inputs, will not work.")
endif()
endif()
endif(NOT DISABLE_COMPANION)
# Check for a file that is typically left from a OpenTX 2.1 build and abort if found
if (EXISTS ${RADIO_SRC_DIRECTORY}/stamp.h OR EXISTS ${RADIO_SRC_DIRECTORY}/translations/en.h)
message(FATAL_ERROR "Source directory contains files leftover from a OpenTX 2.1 build. Please run `git clean -f` in source directory (Careful: Will remove any extra files) or do a new clean git checkout")
endif()
# Windows-specific includes and libs shared by sub-projects
if(WIN32)
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIRECTORY}/thirdparty/windows/dirent")
if(MSVC)
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIRECTORY}/thirdparty/windows/msinttypes")
set(WIN_PTHREAD_BASE_PATH "${WIN_EXTRA_LIBS_PATH}/pthreads/Pre-built.2" CACHE PATH "Where to find pthreads include and lib folders.")
list(APPEND WIN_INCLUDE_DIRS "${WIN_PTHREAD_BASE_PATH}/include")
find_file(WIN_PTHREAD_LIB pthreadVC2.lib PATHS "${WIN_PTHREAD_BASE_PATH}" PATH_SUFFIXES lib/x86 lib NO_DEFAULT_PATH)
find_file(WIN_PTHREAD_DLL pthreadVC2.dll PATHS "${WIN_PTHREAD_BASE_PATH}" PATH_SUFFIXES lib/x86 lib dll/x86 dll NO_DEFAULT_PATH)
if(WIN_PTHREAD_LIB)
list(APPEND WIN_LINK_LIBRARIES "${WIN_PTHREAD_LIB}")
else()
message(SEND_ERROR "pthreadVC2.lib not found!")
endif()
else()
set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES OFF)
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES OFF)
endif()
endif()
add_subdirectory(${RADIO_SRC_DIRECTORY})
if(Qt5Widgets_FOUND)
if(Qt5Core_FOUND AND NOT DISABLE_COMPANION)
add_subdirectory(${COMPANION_SRC_DIRECTORY})
endif()
+1474 -1
View File
File diff suppressed because it is too large Load Diff
-852
View File
@@ -1,852 +0,0 @@
<a href="http://frsky-rc.com">FrSky (monthly)</a>
<a href="http://alofthobbies.com">Aloft Hobbies</a>
<a href="http://jonathan.it">Jonathan Modellismo</a>
<a href="http://wstech.de">WsTech</a>
<a href="http://aviomotive.com">Aviomotive</a>
<a href="http://boltrc.com">BoltRC</a>
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
<a href="http://litepilots.com">LitePilots</a>
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
<a href="http://3drobotics.com">3D Robotics</a>
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
Mario Sette
Felice Baratto
Alessandro Mari
Gianpiero Spontina
Ingo Kuzniak
Hans-Åke Rahm
Tamas Varga
Thomas Gregg
Didier Christien
Alain Pinard
Sergio Melas
Paul Montenot
Chris Guy
Adrien Gravouille
Thomas Black
Marc Lucht
Zdenek Trojanek
Martin Hotar
Stefan Grundevik
Fabio Eboli
Federico Zotti
Albin Esbjörnsson
Kilian Hüttenhofer
Stephen Stough
Adilson Oliveira
Robert Saint Marie
Tad Leake
Andreas Weitl
Chan Lofland
Dirk Kasten
Denisov Alexander
Timo Varppee
Ondrej Hatapka
Valérie Billon
R. Scott Page
Johan Cronje
Renato Aranghelovici
Jeffrey Irvin
John Rodgers
Kenneth Crump
Damjan Adamic
Martin Wilson
Joe Street
John Holdsworth
Daniel Schwartz
Dean Church (monthly)
Michael Halse
David Mark
Ted Moss
Jim Wagner
Nicola Porzi
Michael Halse
Chewytm
Espen Solbu
Mike Frizell
Bruce Jones
Stefano Airaghi
Dan Eeckhout
Alex Calderhead
Leonard MacKey
Heung Jin Choi
Mike Retterer
Keith Wood
Viljo Liukku
Eric Beier
Burt Pickard-Richardson
Helmut Renz
Rick Harms
Vincenzo Vavala
Patricia Martin
Harald Klein
Carl Petersen
Douglas Burkett
Clifford Evans
Teodor Yantchev
Jarad Berkman
Christian Schulz
Gregory J Shepherd
Michael Shellim
Ming Wang
Bernard Lukaschek
Nigel Chippindale
Mike Perkins
Ted Hammond
David Beanland
Bernd Koehler
Frédéric Duflos
Dave Fasken
Heinrich Illig
Michael Collins
Michael Manning
Craig Lorentz
André Lasseret
Felipe Alexandre de Oliveira
Brian Harris
Philippe Herbots
Rainer Nelte
Franck Bernhard
Erhard Werner
Stig Jøran Moen
Keith Hertzog
Christophe Dauvergne
Tauno Rautakorpi
Sven Assmus
Paul Dittman
Mike Matheny
Cheryl Wynne
Emay Toha
Don Nolder
André Lasseret
Filip Lowette
Arnaldo Gabella
Fiorenzo Agnelli
Michele Villa
Christophe Rodriguez
Larisa Filocamo
Hartmut Sahm
Åke Brodin
Ted Moss
Filippos Tigarakis
Chewytm
Eric Burdis
Nigel Chippindale
Michael Deasy
Stephen Stough
Kenneth Lilja (monthly)
Robert Jero
Gary Bancroft
Robert Cotsford
NorthSide
George Constandinides
Robert Schonk Jr
Kevin Berkefeld
Peter Webster
Mike Matheny
Martin Sniedze
Fernando Rimoldi
Sidney Fisher
Bruce Anderson
John Rodgers
Ed Pare
Thomas Kilduff
Robert Ferguson
Bryan Green
Kevin Berkefeld
Julien Michel
Krittikun Chiraphanda
Douglas Law
Alberto Scotti
Oliver Kunkel
D. Joseph Frazier
Heiko Polig
Andrew Fernie
Marco Lange
Nick McMillan
Michel Baily (monthly)
Patrick Mullen
Scott Campbell
Erich Roeder
Wayne Davy
Michael Fontenot
Willie Swanepoel
Satoru Sasaki
Tyler Darby
Nicholas Crego
Johan Moelich
Timo Esser
Brian Paddock
Jean Pierre Parisy
Norbert Martsch
Jean-Marie Guitard
Tilman Baumann
Fred Larssen
Ari Aalto
Robert Sams
Kirk Robertson
John Koontz
Jeffery Golias
Paul Robinson
Dave Matison
Mike Matheny
Pino Agostino
Graham Boucher
Nelson Noura
Joel Allamy
Philip David Martin
Sean Stephen
Bruce Mackay
Blake Spilman
Timothy Pelletier
Glen Roe (ShowMaster)
Jan Van Ooteghem
Lawrence Christensen
Leo Duflou
Bruce Wood
Arnd Feige
Tauno Rautakorpi
Steve Coley
Stefan Kiendl
Gregory Nuspel
Mitchell Brenner
Ronnnie DePrez
Ferenc Koller
Robert Sessler
Didier Lanot
Rodney Hunt
Steve Bernard
Paul Nazaroff
Gordon Ernenputsch
Ksamak
Marc Gittelman
David Poole
Ralph Sauer
Karl-Heinz Gansel
Michels Bernhard
Thomas Demmelbauer
Felice Baratto
Michael Halse
Horst Kampen
Ian Gough
Matthew Brett
Lexington S Morley
Clemens Drews
Axel Stöckle
Roberto Orsello
Richard Ruck
Hugh Caldwell
Christian Marauli
Albin Esbjörnsson
Per Esbjörnsson
Bernd Hohmann
Sławomir Juszczak
Stephen Henderson
David Morgan
Aloft Hobbies
Netanel Hobara
Cameron Galipo
Doug Schafer
Pietro Rossin
Earl Killingsworth
Victor B Wright
Terry McKinley
Марков Алексей
Offer Shmuely
Ian Lobley
Stéphane Fortas
Peter Mitrik
Thomas Majewski
ANF King
Henrik Hammarström
Kenneth Lilja
R Wells
Uwe Jordt
Harald Wilczak
Bernhard Lohmann
Ferenc Koller
Robert Ferguson
Daniel Byers
Tyler Darby
Miguel Villalpando
Kim Dong Hoon
Terry McKinley
Walter Bell
Clinton Linck
Josep Clodas Sola
Thierry Martin
Peter Mauro
Mitchell Brenner
Yak
Lluis Bullich Rañe
Steffen Rohr
Eric Jacquin
Harvest Lane
Ville Kuvaja
DK-System
Heinz Vogel
Heung Jin Choi
MMJS van der Helm
Dan Neelands
Yashiro Masayuki
Isaac Sloan
Harold Baird
Roy Bender
Bradley Murchie
Maximilian Süß
Dean Jansa
Ronald Donker
Paul Oldenkamp
Dietmar Drees
Bradley Murchie
Richard Fahie
James Kaufman
Henry Deucker
Christian Fuchs
Arold Reinders
Robert Miller
Mark Gaskievicz
Roland Müller
Frank Gewalt
Remi Viard
Reginald H Millsom
Pierluigi Sommaruga
A Harris
Stefan Grunenberg
Francisco Gutierrez Muñoz
Steve Coley
Sean Cull
Roberto Orsello
David Finger
Jean-Marie Oddo
Mike Matheny
Glen Roe (Showmaster)
Arron Bates
Tim Spurr
Daniel Morgan
Trent Ready
Mark Maskiell
Robert Crockford
Mark Illum
David McGuire
Martyn Coles
Jose Sobral
Heung Jin Choi
Tomasz Janiak
Fabien Gagné
Joe Street
Micha Ronen
Albert Blondin
Klaus Schuebel
Evening Shade Pottery
Thomas Kilduff
Sven Assmus
Markus Eberl
Nicholas Field
Harald Wilczak
John Grepps
Anthony Burbidge
Sherba Baine
Gordon Evans
Fred Figge
Uwe Kuehn
David Beatty
Aaron Stringer
Alan J Wasserman
Wolfgang Rauser
Samuel Cook
Friedrich Ipolt
Barrington Cole
Charles Lakins
Thos. O'Meara Photography
Adam Chevalier
Mike Mulligan
Serge Michaux
Robert Young
Wilco Hijink
Roy Nixon
Lexington S Morley
Daryl Dacko
Beat Zurflueh
Piotr Kundu
Kevin Berkefeld
Tomasz Klys
Mirco Didone'
Christoph Schroeter
Zdenek Trojanek
Bryan Anderson
Kamco Enterprises
Robert Bates
Robert Brown
Dennis Marinus
Ronald Van Putte
Thomas Kvitle Jenssen
Patrick Tuxbury
Istvan Magi
Sasaki Satoru
David Laburthe
Vit Jelinek
Pablo Gomez Martinez
Alan Thoren
Jack Clodfelter
William Simon
James Houck
Peter Fithern
Thomas Svedman
TechFixPros
Rafael Eric Suarez Nordlow
Colin Rycroft
Emanuel Stassar
Michael Gregory
Robert Russell
Felix Kaiser
Joshua Bardwell
Davd Goodall
Leonard MacKey
Miles Kelly
Sergio Robledo
Mikael Wallbäck
Daniel Malcman
Paul Dittman
Attilio Rausse
Sidney Gates
Andrea Montefusco
Paul Luby
Donald L Webster
Kenneth Frehafer
Matthias Hase
Markus Wolf
Andrew Fazio
Stefan Künst
Stephen Adams
Tauno Rautakorpi
Frank Houvenaghel
George Neusse
Andreja Rusjakovski
Axel Stöckle
Erwin Störrle
Rodger Hopper
Fernando Cesar
Jonathan Gillis
DK-System
Lexington S Morley
Bernd Koehler
Davis RC
Pete Johnson
Patricia Martin
Florian Tschacher
Brian Spearing
Craig Hall
Joseph Case
Harald Klein
Robert Crockford
Chris Boultinghouse
Kitsew
Georgios Papadopoulos
Fourmost Products
Dennis Miller
Dave Matison
Maximilian Radig
Juan Rodriguez
Robert Sessler
John Murray
Martin Sniedze
David Poole
Manfred Delakowitz
Martijn Kruissen
Jörgen Norman
Nathan Kinney
John Godden
Larry Roper
Mike Frizell
Daniel Pospolita
Peter Herz
Don Mondrik
Paul Fram
Charles Knight
Matthew Adams
Kenneth Reed
Gary Wild
Christof Ramm
Bruno Bedard
Salih Samim Aydin
Alexander Pils
Andrew Scerbina
Donovan Bodishbaugh
Ray Dunn
Burt Pickard-Richardson
Robert Ferguson
CY Enterprise
Michel Stathakis Neto
Beat Zurflueh
Portstate Pty Ltd
Jens Hoffmann
Ricardo Santos
Jean-Francois Le Breton
Michael Deasy
Anindya Mukerjee
Emay Toha
Kamco Enterprises
Peter Mueller
Giovanni Trentini
Cecil Porter
Robert Canavan
Greg Higginbottom
Tim Walker
Spis Ltd/TurboNote
Patricia Cox
Matthew Lukes
Sabine Witte
Phillip Perry
Beat Zurflueh
Russell Stutzman
Dietmar Drees
Kenneth Ward
Jens Lochmüller
Anthony Witham
Peter Hauke
Arizona Action Photos
Francis F Dale
Willie Swanepoel
Edward Hauser
Adilson Oliveira
Joseph Ordille
Michael Shellim
Teddie Holmes
Alexandre Rault
Eric Albin
Lukas Kliment
Bernard Philippe
Bernard Delpy
Didier Klein
Arnaldo Guedes
Cyberauto Systems
John Alsbrooks
John Kearney
Christopher Borden
Marc Virgilio Ricci
Frederick Davie
Jürgen Enders
Terrence Pitts
Thomas Sandner
Marco Coltorti
Harald Wilczak
Rodney Lorimor
Richard Davis
Stephen Palmer
Michael Napolitan
Joshua Bardwell
Fred Dawson
Jim Wagner
Peter Johnson
Fredrik Lewerth
Arvin Stenersen
Daniel Morgan
Roy Nixon
Joachim Blunck
Karl-Heinz Gansel
Monrovia Mountain Enterprises
Alessandro Villa
Jan-Åke Nilsson
Matthias Rei
DVR Solutions BV
Bertrand Condevaux Lanloy
Henri Mirra
Aurélien Planiol
Kevin Caldwell
Andrew Garello
Tomasz Maziarz
Russell Flack
Fernando Rimoldi
Greg Reid
Dietmar Drees
Holger Landwehr
Arno Loehdorf
Boon Sripattha
Patrik Åkerfeldt
Alonzo Fretwell
Renjith Chandrasekharan
Ruben Gomez Hernandez
Michael Gardner
Judith Green
Timo Ruppell
John Lipscomb
Norbert Wenke
Erik Frieberg
Raimo Ruotsalainen
Brian Harris
Sebastian Blüml
Efisio Maxia
Jeff Theobald
Anthony Rizzo
Rodney Huddleston
Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Donald Burke
Ronald Donker
Fredie Singh
Patrizio Simoncini
Harald Gabler
Michael Brown
Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Christian Grandjean
Roger Bergevin
NorthSide
Sigmund Martinsen
Lionel Lafraise
Gisli Ofeigsson
The Gruvin9x Project
Manuel McLure
Fernando Rimoldi
Hiltenkamp Stephan
Sandeep Kishore Jain
Greg Parker
Norman Maaß
Adriano Del Ben
Justin Poole
Kenneth Harrison
Eugene LaFaille
John O'Shaughnessy
Uwe Jordt
Stuart Olson
Frédéric Devillard
Cheung Leo
Peter Webster
Jean-Claude Bachetta
Delfin Perena
Sae-wook Yoon
Focus on Excellence
Jeffery Golias
Nick Milton
Paul Zasso
Reidar Johannes Lillebotn
Handley William
Luke Williams
Michael Shellim
Brian Spearing
Derek Foster
Pasi Pitkänen
Lexington S Morley
Jeff Roberson
Volkov Victor
Bryan Anderson
Daniel Garber
Pavel Stein
Ravi Gupta
Patrick Tuxbury
Mark Deverell
John Capell
Neil McVean
Matthew Elyash
Kerry Cochrell
Willem Aandewiel
Reg Bell
Jean Chenoz
Philippe Grand
Tauno Rautakorpi
Jeff Dillingham
Brad Kelley
Shaun Currier
Danilo Schiara
John Hennig
RK Custom Homes
James Houck
Piet Teekens
Tommy Widenflycht
Johan Petrus Theophilus
Maria van Melis
Ralph Gustafson
Paul Luby
Andrew Duncan
Stephen Crowther
Edward Glover
Kelly Byrd
Brad Curtis
Wolfgang Kuhl
John Beidl
Roy Nixon
Glen Roe
CY Enterprise
Evening Shade Pottery
Gilles Dando
Patrick Richard
Justin Altemeier
Constant Dupuis
Tony Kenward
Pierre Rondel
Ernest Luguera Sanchez
Adam Brackney
Joe Baker
单 雷平
Ben Fay
Chris Monk
Stan von Miller
Christian Krebs
Michel Motte
Graziano Rampinelli
Joe Baker
Jean-Philippe Laurent
Romain Rouzaud
Michel Garbarino
Henri Mirra
Otto Fröhlich
Thomas Cramer
Anthony Trombetta
Fernando Rimoldi
Dietmar Drees
Michal Kowalski
Ivan Correa
Modellbau
Massimo Luigi Stara
Graham Baldwin
Tomasz Rejman
Wolfgang Lang
John Greenwood
Till von Reumont
Paul Pereira Brunner
Donald L Singer
Junsun Lee
Guy Lamaison
Erwin Dulken
Mike H Dailey
Jon Cammarata
Martin Krueger
Adolfo Perogio
Sylvain Techer
Wes Warner
Kevin Caldwell
Ali Ersan Gur
Hans-Rudolf Riniker
Sébastien Boutard
Jean Chessé
Mike H Dailey
Don Polk
Roberto Orsello
Borovikov Dmitriy
John Lipscomb
Peter Glassey
Joseph Kramer
F.Javier Martinez Velasco
Claudio Piccinini
John Jackson
John Beech
Rene TraaJohn Jackson
Sebastien Charpentier (monthly)
Nigel Hendriks
Frédéric Devillard
Albert Herzog
Anindya Mukerjee
Kenny Stanberry
Tauno Rautakorpi
Mathias Krapp
Fernando Rimoldi
Wolfgang Rauser
Richard Shagam
Stephen Bailey
DK-System
Casa Kuxtal
Christopher Potts
Douglas George
Michael Banks
Jon Wiltshire
David Green
Guy Willems
Xavier Mestelan Pinon
Maik Gottschalk
Scott Sparks
John Dunning
RAD51
Ron Powell
Alain Labonne
Carol Sills
Franck Aßmann
Larry Anderson
Mikael Wallbäck
Wes Warner
Christoffer H Henni
Donna Bayer
Garry Ogilvie
Karlheinz Sirsch
Fred Larssen
Rob Coppock
Franz Josef Hahn
Serge Ribault
Tanguy Le Moign
Barrett Powell
Patrice Lafeuille
Martin Blume
Marek Kopyto
Marco Lange
Gary Nix
Jack Oliphant
John Lever
Adolphe Montefiore
Steven De Weerdt
Håkan Berggen
Ayelet Egosi
Jean-Frederic Gaudreault
Jim Wagner
Lee Scott
Roger Keatley
Sherman Lovell
Hugh Caldwell
JB Fisher Company
Michels Bernhard
Pietro Rossin
Carsten Wache
Brock White
Steven Poretz
David Huelster
Gordon Stahl (monthly)
John Mathison
Richard Duczmal
Gregory Barron
Marcel Fischer
Klas Mälman
Viljo Liukku
Eric Smith
Sven Assmus
Luke Mole
NorthSide
Hannes Mössler
James Kaufman
Ravi Gupta
Lexington S Morley
Ralph Segar
Frédéric Devillard
Cory Theurer
Valentinos Zachariou
Garrett Paquette
Heung Jin Choi
Kerry Cochrell
Doug Miller
Andrzej Weydmann
Chair-man.nl
Eric Beier
Jay Warren
Marian Matej
Alastair Smith
Timothy Senecal
Dietmar Drees
Bruce Jones
Adil Busaidy
Herman Hofman
Jean Paul Michel
Peter McHenry
Julien lecoquierre
Jean-Marie Clay
Robert Nicoll
Dan Nixon
Ewald Moehring
Giovanni Carnesecchi
Paul Dumsday
Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
+46
View File
@@ -0,0 +1,46 @@
# Dockerfile
FROM archlinux:base
RUN pacman -Syu --noconfirm
# Install misc packages
RUN pacman -S --noconfirm \
7zip \
arm-none-eabi-gcc \
arm-none-eabi-newlib \
base-devel \
bc \
cmake \
cpio \
curl \
dos2unix \
erofs-utils \
git \
less \
nano \
python \
python-pip \
python-pilkit \
screen \
tree \
unzip \
vim \
wget \
zip
# HACK: Allow base-devel to run with root user
RUN sed -i '/E_ROOT/d' /usr/bin/makepkg
# Install yay
RUN git clone https://aur.archlinux.org/yay-bin.git /tmp/yay-bin && \
cd /tmp/yay-bin && \
makepkg -si --noconfirm && \
cd && rm -rf /tmp/yay-bin
#RUN git clone --recursive https://github.com/STMicroelectronics/STM32CubeG0.git /workspace/STM32CubeG0
#RUN git clone --recursive https://github.com/STMicroelectronics/STM32CubeG4.git /workspace/STM32CubeG4
# Personal dir dotfiles
#ADD home /home/
# Personal uploader scripts
#ADD root/bin /usr/local/bin/
View File
+56 -6
View File
@@ -1,9 +1,59 @@
##OpenTX 2.2 Branch
[![Release](https://img.shields.io/github/v/release/OpenI6X/opentx?include_prereleases)](https://github.com/OpenI6X/opentx/releases/latest)
[![GitHub all releases](https://img.shields.io/github/downloads/OpenI6X/opentx/total)](https://github.com/OpenI6X/opentx/releases)
[![GitHub license](https://img.shields.io/github/license/OpenI6X/opentx)](https://github.com/openi6x/opentx/blob/master/LICENSE)
![OpenI6X](https://circleci.com/gh/OpenI6X/opentx.svg?style=shield)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/openi6x/opentx/tree/master)
[![Discord](https://img.shields.io/discord/973289741862727741.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/3vKfYNTVa2)
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=next)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://opentx.rocket.chat](https://camo.githubusercontent.com/3d659054abd6ce21c0e47cf3b83a51bda69ca282/68747470733a2f2f64656d6f2e726f636b65742e636861742f696d616765732f6a6f696e2d636861742e737667)](https://opentx.rocket.chat)
[![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)
![Banner](https://github.com/OpenI6X/opentx/blob/master/doc/flysky/banner.png?raw=true)
The ongoing development on 2.2.x is done in this branch.
# Custom OpenTX / EdgeTX for Flysky FS-i6X
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.
Join our [Discord](https://discord.gg/3vKfYNTVa2), [RCGroups](https://www.rcgroups.com/forums/showthread.php?3916435-FlySky-I6X-port-of-OpenTX) or [Telegram](https://t.me/otx_flysky_i6x) to contribute, discuss or get help.<br>
## Instructions
- [FlySky i6X user interface](https://github.com/OpenI6X/opentx/wiki/Manual) and other differences to official EdgeTX/OpenTX devices.<br>
- [EdgeTX manual](https://manual.edgetx.org/bw-radios)
- [How to install, upgrade or restore firmware](https://github.com/OpenI6X/opentx/wiki/Flashing-&-Upgrading)<br>
- [Developers guide, how to build](https://github.com/OpenI6X/opentx/wiki/Development)<br>
- [Modifications](https://github.com/OpenI6X/opentx/wiki/Modifications)<br>
## Comparison
| Feature | FlySky i6X | OpenI6X |
|---------------------------|------------|------------------------------|
| Channels | 6/10 | 16 |
| Mixers | 3 | 32 |
| Models | 20 | 20 / unlimited<sup>[1]</sup> |
| Protocols | AFHDS, AFHDS2A, PPM | AFHDS2A + 16Ch modes, PPM, CRSF |
| Trainer | PPM | PPM, SBUS |
| Timers | _ | ✓ |
| Voice annoucements | _ | ✓<sup>[2]</sup> |
| Variometer | _ | ✓ |
| ExpressLRS ready | _ | ✓ Configurator built-in (no need for LUA) |
| Adjustable screen brightness | _ | ✓<sup>[3]</sup> |
| USB Modes | Joystick | Joystick, Storage, Serial (Telemetry mirror, Debug) |
| AUX Serial port | _ | ✓ SBUS Trainer, Telemetry mirror, Debug |
| FlySky FS-HZCZ03-ADJ Gimbal support | _ | ✓<sup>[4]</sup> |
| Languages | EN, CN | PL, EN, CZ, DE, ES, FI, FR, IT, NL, PT, SE |
<sub>[1] Unlimited by using USB mass storage mode eeprom backup/restore.</sub><br>
<sub>[2] By adding DFPlayer, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#dfplayer) in wiki.</sub><br>
<sub>[3] By wiring 2 pads, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#adjustable-backlight-level) in wiki.</sub><br>
<sub>[4] See [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#flysky-fs-hzcz03-adj-gimbal) in wiki.</sub>
## Credits
* Janek ([ajjjjjjjj](https://github.com/ajjjjjjjj)), continues Kuba's and Mariano's work, added sound, USB, ExpressLRS V2/V3 configuration, telemetry mirror, SBUS trainer, new/fixed drivers, ports, bugfixes.
* Mariano ([marianomd](https://github.com/marianomd)), continued Kuba's work and made it up to useable condition! Added gimbals, buttons, AFHDS2A, PPM, CRSF.
* Kuba ([qba667](https://github.com/qba667)), started this work and made this project possible, it is forked from his repo.
* Wilhelm ([wimalopaan](https://github.com/wimalopaan)) added 16 channels SBUS16 / IBUS16 modes.
* Rafael ([rafolg](https://github.com/rafolg)), ported FlySky Hall Gimbal support from EdgeTX.
* Tom ([tmcadam](https://github.com/tmcadam)) fixed AFHDS2A PWM mode selection.
* The internal RF code was taken from the great KotelloRC's [erfly6: Er9X for i6 and i6x](https://bitbucket.org/KotelloRC/erfly6/src/master/).
* Some of the internal RF fixes are a result of analysing [pascallanger's](https://github.com/pascallanger) [DIY-Multiprotocol-TX-Module](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module).
* ExpressLRS configurator is based on elrsV2/V3.lua from [ExpressLRS](https://github.com/ExpressLRS/ExpressLRS).
* Some of the ports are from [EdgeTX](https://github.com/EdgeTX/edgetx/).
* ADC code taken from [OpenGround](https://github.com/fishpepper/OpenGround).
* All the contributors of [OpenTX](https://github.com/opentx/opentx/).
+4 -4
View File
@@ -6,7 +6,7 @@ macro(add_bitmaps_target targetname filter width format)
set(target ${target}.lbm)
add_custom_command(
OUTPUT ${target}
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
DEPENDS ${bitmap}
)
list(APPEND bitmaps_files ${target})
@@ -14,11 +14,11 @@ macro(add_bitmaps_target targetname filter width format)
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
endmacro(add_bitmaps_target)
macro(add_truetype_font_target radio name font size bold)
macro(add_truetype_font_target radio name font size offset)
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
add_custom_target(ttf_${radio}_${name}
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${offset} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set(ttf_${radio}_fonts_targets ${ttf_${radio}_fonts_targets} ttf_${radio}_${name})
endmacro(add_truetype_font_target)
endmacro(add_truetype_font_target)
-19
View File
@@ -1,19 +0,0 @@
# Locate lupdate binary from QT
# This module defines
# LUPDATE_EXECUTABLE, where is QT lupdate
# LUPDATE_FOUND, if false, don't try to use lupdate
FIND_PROGRAM( LUPDATE_EXECUTABLE
NAMES
lupdate lupdate-qt4
)
MESSAGE( STATUS ${LUPDATE_EXECUTABLE} )
# if the program is found then we have it
IF( LUPDATE_EXECUTABLE )
SET( LUPDATE_FOUND "YES" )
ENDIF( LUPDATE_EXECUTABLE )
MARK_AS_ADVANCED( LUPDATE_EXECUTABLE )
+256
View File
@@ -0,0 +1,256 @@
#.rst:
# FindSDL
# -------
#
# Locate SDL library
#
# This module defines
#
# ::
#
# SDL_FOUND, if false, do not try to link to SDL
# SDL_LIBRARY, the name(s) of the library(ies) to link against
# SDL_LIBSDL, the full path and name of libSDL (or SDL.[lib|dll].
# SDL_LIBSDLMAIN, full path and name of libSDLmain (or SDLmain.lib).
# SDL_LIBRARY_PATH, the full path to the found libSDL
# SDL_INCLUDE_DIR, where to find SDL.h
# SDL_VERSION_STRING, human-readable string containing the version of SDL
#
#
#
# This module responds to the flag:
#
# ::
#
# SDL_BUILDING_LIBRARY
# If this is defined, then no SDL_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the proper link flags
# as part of the returned SDL_LIBRARY variable.
#
#
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
#
# Additional Note: If you see an empty SDL_LIBSDL in your
# configuration and no SDL_LIBRARY, it means CMake did not find your SDL
# library (SDL.dll, libsdl.so, SDL.framework, etc). Set
# SDL_LIBSDL to point to your SDL library, and configure again.
# Similarly, if you see an empty SDL_LIBSDLMAIN, you should set this
# value as appropriate. These values are used to generate the final
# SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY
# does not get created.
#
#
#
# $SDLDIR is an environment variable that would correspond to the
# ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
#
# Modified by Eric Wing. Added code to assist with automated building
# by using environmental variables and providing a more
# controlled/consistent search behavior. Added new modifications to
# recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL
# guidelines. Added a search for SDLmain which is needed by some
# platforms. Added a search for threads which is needed by some
# platforms. Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of SDL_LIBRARY to
# override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention is #include
# "SDL.h", not <SDL/SDL.h>. This is done for portability reasons
# because not all systems place things in SDL/ (see FreeBSD).
#
# Modified for OpenTx by Maxim Paperno 19-Dec-2016
# Added SDL_LIBSDL, SDL_LIBSDLMAIN & SDL_LIBRARY_PATH, removed SDLMAIN_LIBRARY,
# SDL_LIBRARY_TEMP, and fixed bug with recursive appending of supporting
# libraries to cached SDL_LIBRARY_TEMP variable.
#
#=============================================================================
#CMake - Cross Platform Makefile Generator
#Copyright 2000-2015 Kitware, Inc.
#Copyright 2000-2011 Insight Software Consortium
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions
#are met:
#
#* Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
#* Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
#* Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
#HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#------------------------------------------------------------------------------
#
#The above copyright and license notice applies to distributions of
#CMake in source and binary form. Some source files contain additional
#notices of original copyright by their contributors; see each source
#for details. Third-party software packages supplied with CMake under
#compatible licenses provide their own copyright notices documented in
#corresponding subdirectories.
#
#------------------------------------------------------------------------------
#
#CMake was initially developed by Kitware with the following sponsorship:
#
# * National Library of Medicine at the National Institutes of Health
# as part of the Insight Segmentation and Registration Toolkit (ITK).
#
# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
# Visualization Initiative.
#
# * National Alliance for Medical Image Computing (NAMIC) is funded by the
# National Institutes of Health through the NIH Roadmap for Medical Research,
# Grant U54 EB005149.
#
# * Kitware, Inc.
#=============================================================================
find_path(SDL_INCLUDE_DIR SDL.h
HINTS
ENV SDLDIR
PATH_SUFFIXES SDL SDL12 SDL11
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
find_library(SDL_LIBSDL
NAMES SDL SDL-1.1
HINTS
ENV SDLDIR
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
find_library(SDL_LIBSDLMAIN
NAMES SDLmain SDLmain-1.1
HINTS
ENV SDLDIR
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
PATHS
/sw
/opt/local
/opt/csw
/opt
)
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
if(NOT APPLE)
find_package(Threads)
endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL
if(MINGW)
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
endif()
if(SDL_LIBSDL)
# For SDLmain
if(SDL_LIBSDLMAIN AND NOT SDL_BUILDING_LIBRARY AND NOT SDL_INCLUDE_DIR MATCHES ".framework")
list(FIND SDL_LIBSDL "${SDL_LIBSDLMAIN}" _SDL_MAIN_INDEX)
if(_SDL_MAIN_INDEX EQUAL -1)
list(APPEND _SDL_LIBRARY_TEMP "${SDL_LIBSDLMAIN}")
endif()
unset(_SDL_MAIN_INDEX)
endif()
list(APPEND _SDL_LIBRARY_TEMP "${SDL_LIBSDL}")
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
if(APPLE)
list(APPEND _SDL_LIBRARY_TEMP "-framework Cocoa")
endif()
if(Threads_FOUND)
list(APPEND _SDL_LIBRARY_TEMP ${CMAKE_THREAD_LIBS_INIT})
endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL
if(MINGW)
list(INSERT 0 _SDL_LIBRARY_TEMP mingw32)
endif()
# Set the final string here so the GUI reflects the final state.
set(SDL_LIBRARY ${_SDL_LIBRARY_TEMP} CACHE STRING "Full list of required SDL & supporting libraries.")
unset(_SDL_LIBRARY_TEMP)
get_filename_component(_SDL_LIBRARY_TEMP ${SDL_LIBSDL} PATH)
set(SDL_LIBRARY_PATH ${_SDL_LIBRARY_TEMP} CACHE PATH "Path to SDL library.")
unset(_SDL_LIBRARY_TEMP)
endif()
if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
unset(SDL_VERSION_MAJOR_LINE)
unset(SDL_VERSION_MINOR_LINE)
unset(SDL_VERSION_PATCH_LINE)
unset(SDL_VERSION_MAJOR)
unset(SDL_VERSION_MINOR)
unset(SDL_VERSION_PATCH)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
REQUIRED_VARS SDL_LIBRARY SDL_LIBRARY_PATH SDL_INCLUDE_DIR
VERSION_VAR SDL_VERSION_STRING)
-159
View File
@@ -1,159 +0,0 @@
# - Locate the SDL library
# This module defines
# SDL_LIBRARY, the library to link against
# SDL_FOUND, if false, do not try to link to SDL
# SDL_INCLUDE_DIR, where to find SDL.h
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD).
FIND_PATH(SDL_INCLUDE_DIR SDL.h
$ENV{SDLDIR}/include
~/Library/Frameworks/SDL.framework/Headers
/Library/Frameworks/SDL.framework/Headers
/usr/local/include/SDL
/usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
/usr/local/include
/usr/include
/sw/include/SDL # Fink
/sw/include
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/opt/csw/include
/opt/include/SDL
/opt/include
C:/Programs/SDL/include
)
# I'm not sure if I should do a special casing for Apple. It is
# unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?),
# do they want the -framework option also?
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
# Remember that the OS X framework version expects you to drop in
# SDLmain.h and SDLmain.m directly into your project.
# (Cocoa link moved to bottom of this script.)
# SET (SDL_LIBRARY "-framework SDL -framework Cocoa" CACHE STRING "SDL framework for OSX")
# SET(SDL_LIBRARY "-framework SDL" CACHE STRING "SDL framework for OSX")
# Extract the path the framework resides in so we can use it for the -F flag
STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDL_FRAMEWORK_PATH_TEMP ${SDL_INCLUDE_DIR})
IF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# String is in default search path, don't need to use -F
SET(SDL_LIBRARY_TEMP "-framework SDL")
ELSE("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# String is not /Library/Frameworks, need to use -F
SET(SDL_LIBRARY_TEMP "-F${SDL_FRAMEWORK_PATH_TEMP} -framework SDL")
ENDIF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
)
# Clear the temp variable so nobody can see it
SET(SDL_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "")
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
FIND_LIBRARY(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
PATHS
$ENV{SDLDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib/x86
)
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
PATHS
$ENV{SDLDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
)
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP)
# For SDLmain
IF(SDLMAIN_LIBRARY)
SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
ENDIF(SDLMAIN_LIBRARY)
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# with the CACHE STRING. Maybe somebody else knows how to fix this.
# The problem is mainly cosmetic, and not a functional issue.
IF(APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if Find the threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# Set the final string here so the GUI reflects the final state.
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
+67 -67
View File
@@ -1,68 +1,68 @@
# Find Xerces-C
# The following setings are defined
# XERCESC_ROOT_DIR, the root of the include and lib directory
# XERCESC_INCLUDE_DIR, the full path of the include dir (ADVANCED)
# XERCESC_LIBRARIES, the name of the xerces-c library (ADVANCED)
# Look for a root installation
IF( MSVC )
SET( XERCES_WINDIR C:/Programs/xerces-vc )
ELSE( )
SET( XERCES_WINDIR C:/Programs/xerces )
ENDIF( )
FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
${XERCES_WINDIR}
"C:/mingw/msys/1.0/local"
"C:/Program Files/CodeSynthesis XSD 3.2"
/usr
/usr/local
"C:/MinGW"
$ENV{CODESYNTH}
DOC "The root of an installed xerces-c installation"
)
# try to find the header
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
${XERCESC_ROOT_DIR}/include
/usr/include
/usr/local/include
)
# Find the library
FIND_LIBRARY(XERCESC_LIBRARY
NAMES xerces-c xerces-c_3
PATHS
${XERCESC_ROOT_DIR}/lib
${XERCESC_ROOT_DIR}/lib/vc-9.0
${XERCESC_ROOT_DIR}/lib64/vc-9.0
/usr/lib
/usr/local/lib
DOC "The name of the xerces-c library"
)
IF (XERCESC_ROOT_DIR)
IF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
SET (XERCESC_FOUND TRUE)
SET (XERCESC_LIBRARIES "${XERCESC_LIBRARY}")
# FIXME: There should be a better way of handling this?
# FIXME: How can we test to see if the lib dir isn't
# FIXME: one of the default dirs?
LINK_DIRECTORIES(${XERCESC_ROOT_DIR}/lib)
ENDIF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
ENDIF (XERCESC_ROOT_DIR)
IF (XERCESC_FOUND)
IF (NOT XERCESC_FIND_QUIETLY)
MESSAGE (STATUS " found xerces-c: ${XERCESC_LIBRARY}")
ENDIF (NOT XERCESC_FIND_QUIETLY)
ELSE (XERCESC_FOUND)
IF (XERCESC_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Xerces-C")
ENDIF (XERCESC_FIND_REQUIRED)
ENDIF (XERCESC_FOUND)
MARK_AS_ADVANCED(
XERCESC_INCLUDE_DIR
XERCESC_LIBRARY
# Find Xerces-C
# The following setings are defined
# XERCESC_ROOT_DIR, the root of the include and lib directory
# XERCESC_INCLUDE_DIR, the full path of the include dir (ADVANCED)
# XERCESC_LIBRARIES, the name of the xerces-c library (ADVANCED)
# Look for a root installation
IF( MSVC )
SET( XERCES_WINDIR C:/Programs/xerces-vc )
ELSE( )
SET( XERCES_WINDIR C:/Programs/xerces )
ENDIF( )
FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
${XERCES_WINDIR}
"C:/mingw/msys/1.0/local"
"C:/Program Files/CodeSynthesis XSD 3.2"
/usr
/usr/local
"C:/MinGW"
$ENV{CODESYNTH}
DOC "The root of an installed xerces-c installation"
)
# try to find the header
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
${XERCESC_ROOT_DIR}/include
/usr/include
/usr/local/include
)
# Find the library
FIND_LIBRARY(XERCESC_LIBRARY
NAMES xerces-c xerces-c_3
PATHS
${XERCESC_ROOT_DIR}/lib
${XERCESC_ROOT_DIR}/lib/vc-9.0
${XERCESC_ROOT_DIR}/lib64/vc-9.0
/usr/lib
/usr/local/lib
DOC "The name of the xerces-c library"
)
IF (XERCESC_ROOT_DIR)
IF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
SET (XERCESC_FOUND TRUE)
SET (XERCESC_LIBRARIES "${XERCESC_LIBRARY}")
# FIXME: There should be a better way of handling this?
# FIXME: How can we test to see if the lib dir isn't
# FIXME: one of the default dirs?
LINK_DIRECTORIES(${XERCESC_ROOT_DIR}/lib)
ENDIF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
ENDIF (XERCESC_ROOT_DIR)
IF (XERCESC_FOUND)
IF (NOT XERCESC_FIND_QUIETLY)
MESSAGE (STATUS " found xerces-c: ${XERCESC_LIBRARY}")
ENDIF (NOT XERCESC_FIND_QUIETLY)
ELSE (XERCESC_FOUND)
IF (XERCESC_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Xerces-C")
ENDIF (XERCESC_FIND_REQUIRED)
ENDIF (XERCESC_FOUND)
MARK_AS_ADVANCED(
XERCESC_INCLUDE_DIR
XERCESC_LIBRARY
)
+51 -15
View File
@@ -1,14 +1,13 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
string(REGEX REPLACE "[^0-9]*([0-9]+)[^0-9]([0-9]+)[^0-9]([0-9]+).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "date not implemented")
set(${RESULT} 00.00.0000)
message(WARNING "date not implemented")
set(${RESULT} 00-00-0000)
endif(WIN32)
endmacro(today)
@@ -20,20 +19,57 @@ macro(now RESULT)
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "time not implemented")
message(WARNING "time not implemented")
set(${RESULT} 00:00:00)
endif(WIN32)
endmacro(now)
find_package(Git)
macro(git_id RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "Git ID implemented")
set(${RESULT} 0)
endif(WIN32)
set(${RESULT} 0)
if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(COMMAND "${GIT_EXECUTABLE}" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "--short=8" "HEAD" OUTPUT_VARIABLE proc_out ERROR_VARIABLE proc_err)
if(proc_err)
message(WARNING "Git failed with error: ${proc_err}")
else()
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${proc_out})
endif()
elseif(NOT GIT_FOUND)
message(WARNING "Git executable not found, revision number not available.")
else()
message(STATUS "Git repository not found, revision number not available.")
endif()
endmacro(git_id)
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
endmacro(use_cxx11)
macro(PrintTargetReport targetName)
if(CMAKE_CXX_COMPILER MATCHES "/(clang-)?cl\\.exe$")
set(cpp_version ${CMAKE_CXX_COMPILER_VERSION})
else()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE cpp_version)
endif()
if(cpp_version)
string(STRIP "v${cpp_version}" cpp_version)
else()
set(cpp_version "WARNING: COMPILER NOT FOUND!")
endif()
message("TARGET ${targetName}: cpp compiler ${CMAKE_CXX_COMPILER} ${cpp_version}")
if(VERBOSE_CMAKELISTS)
get_directory_property(DirOpts COMPILE_OPTIONS)
get_directory_property(DirDefs COMPILE_DEFINITIONS)
string(REPLACE ";" " " DirOpts "${DirOpts}")
string(REPLACE ";" "; " DirDefs "${DirDefs}")
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
message("\twith cpp flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}} ${DirOpts}")
message("\twith link flags: ${CMAKE_EXE_LINKER_FLAGS}")
message("\twith defs: ${DirDefs}")
message("--------------")
endif()
endmacro(PrintTargetReport)
+81 -8
View File
@@ -1,5 +1,78 @@
<h2>Version 2.2.1 / 2017-12-17</h2>
Please see <a href=http://www.open-tx.org/2017/12/16/opentx-2.2.1>this page</a> for details.
<h2>Version 2.2.0 / 2017-05-30</h2>
Major release! Please see <a href=http://www.open-tx.org/2017/05/30/opentx-2.2.0>this page</a> for details.
<h2>Version 2.1.9 / 2016-09-14</h2>
<ul>
<li>SD sync fixes (<a href=https://github.com/opentx/opentx/issues/3351>#3351</a>)</li>
<li>Fixed: Telemetry mode "FrSky D (cable)" choice was missing for Taranis (<a href=https://github.com/opentx/opentx/issues/3372>#3372</a>)</li>
<li>Show persistent option only for calculated sensors (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
<li>Fixed Flight mode clear command (<a href=https://github.com/opentx/opentx/issues/3214>#3214</a>)</li>
<li>Fixed a problem with Rotary encoders linked to flight mode (could freeze Companion) (<a href=https://github.com/opentx/opentx/issues/3459>#3459</a>, <a href=https://github.com/opentx/opentx/issues/3470>#3470</a>)</li>
<li>Telemetry simulator improvements: added fuel quantity sensor, increased RPM range (<a href=https://github.com/opentx/opentx/issues/3505>#3505</a>, <a href=https://github.com/opentx/opentx/issues/3506>#3506</a>)</li>
<li>Implemented minimal support for the DYI Multimodule (<a href=https://github.com/opentx/opentx/issues/3526>#3526</a>)</li>
<li>Fixed: GVar combo-box not being refreshed when GV check-box (re-)selected (<a href=https://github.com/opentx/opentx/issues/3518>#3518</a>)</li>
<li>Fixed: Heli inversion not correctly shown/saved from Companion on Radios without virtual inputs (<a href=https://github.com/opentx/opentx/issues/3510>#3510</a>)</li>
<li>Implemented print functions for the Heli setup screen (<a href=https://github.com/opentx/opentx/issues/3554>#3554</a>)</li>
<li>Fixed: Flight modes linked trims display value (<a href=https://github.com/opentx/opentx/issues/3547>#3547</a>, <a href=https://github.com/opentx/opentx/issues/3568>#3568</a>)</li>
<li>Fixed: New model global variables and rotary encoders initialisation (<a href=https://github.com/opentx/opentx/issues/3473>#3473</a>)</li>
<li>Fixed: Prevent circular linked global variables and rotary encoders (<a href=https://github.com/opentx/opentx/issues/3472>#3472</a>)</li>
<li>Fixed wrong log replay speed issue in Telemetry simulator (<a href=https://github.com/opentx/opentx/issues/3708>#3708</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.8 / 2016-04-14</h2>
<ul>
<li>Telemetry Simulator sensor instance number fixed (<a href=https://github.com/opentx/opentx/issues/3207>#3207</a>)</li>
<li>Fixed: Throttle Source combo-box was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
<li>RTC option tool-tip corrected (<a href=https://github.com/opentx/opentx/issues/3225>#3225</a>)</li>
<li>Fixed: Companion was looking for custom scripts at the wrong place (<a href=https://github.com/opentx/opentx/issues/3237>#3237</a>)</li>
<li>Offset displayed in inputs screen (<a href=https://github.com/opentx/opentx/issues/3248>#3248</a>)</li>
<li>Import/export handling was broken for Average formula telemetry sensors (<a href=https://github.com/opentx/opentx/issues/3262>#3262</a>)</li>
<li>Fixed: Hardware Setup control types and names were not stored in profile (<a href=https://github.com/opentx/opentx/issues/3260>#3260</a>)</li>
<li>Fixed voice language list (<a href=https://github.com/opentx/opentx/issues/3338>#3338</a>)</li>
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
<li>Fixed: Sync dialog new line problem (only present for some UI languages) (<a href=https://github.com/opentx/opentx/issues/3350>#3350</a>)</li>
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
<li>Default AVR fuse settings changed to disable JTAG interface (<a href=https://github.com/opentx/opentx/issues/3379>#3379</a>)</li>
<li>Channel range fix (Start, Channels) in Model Settings, Setup page, int/ext module settings</li>
<li>Use friendly GVAR names in dialogs (if available) (<a href=https://github.com/opentx/opentx/issues/3353>#3353</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.7 / 2016-01-04</h2>
<ul>
<li>Lua 'execute' failed in non-root directory (in Simulator) (<a href=https://github.com/opentx/opentx/issues/3024>#3024</a>)</li>
<!-- this is disabled until the speed problem is fixed <li>Header line always visible in Outputs, Logical Switches and Special Functions (<a href=https://github.com/opentx/opentx/issues/2861>#2861</a>)</li> -->
<li>LR12 changes: removed option for remote failsafe configuration, added in EU firmware variant</li>
<li>Added Clear option to the flight mode context menu (right click on the Name label) (<a href=https://github.com/opentx/opentx/issues/3026>#3026</a>)</li>
<li>New features for Telemetry Simulator: log replay, user friendly sensor values (<a href=https://github.com/opentx/opentx/issues/3124>#3124</a>)</li>
<li>Added F7 key to reload LUA permanent scripts in radio simulator (<a href=https://github.com/opentx/opentx/issues/3141>#3141</a>)</li>
<li>AR9X firmware flashing fall-back was wrong</li>
<li>Command line options support added to standalone simulator (try "./simulator21 --help" on Linux and "simulator.exe /help" on Windows for usage) (<a href=https://github.com/opentx/opentx/issues/3160>#3160</a>)</li>
<li>Various rounding problem fixed: Telemetry sensor Ratio parameter (<a href=https://github.com/opentx/opentx/issues/3117>#3117</a>),
Outputs Sub-trim, Min and Max values (<a href=https://github.com/opentx/opentx/issues/3156>#3156</a>)</li>
<li>Fixed: telemetry sensors Ratio and Offset value increment/decrement step (<a href=https://github.com/opentx/opentx/issues/3121>#3121</a>)</li>
<li>Hardware/Calibration tab split int two tabs (<a href=https://github.com/opentx/opentx/issues/2974>#2974</a>)</li>
<li>Fixed Fahrenheit temperature conversion error (if PREC was not 0) (<a href=https://github.com/opentx/opentx/issues/3146>#3146</a>)</li>
<li>Application Setting 'Enable automatic backup before writing firmware' was not saved (<a href=https://github.com/opentx/opentx/issues/3040>#3040</a>)</li>
<li>Fixed RPM package problem on Fedora (<a href=https://github.com/opentx/opentx/issues/3130>#3130</a>)</li>
<li>Fixed conversion errors when loading 2.0.x EEPE (<a href=https://github.com/opentx/opentx/issues/3177>#3177</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.6 / 2015-11-11</h2>
[Taranis]
<ul>
<li>Telemetry custom screen changes didn't emit modified signal (<a href=https://github.com/opentx/opentx/issues/3029>#3029</a>)</li>
<li>Hide D8/LR12 when eu firmware option is selected</li>
@@ -22,10 +95,10 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
<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.
<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>,
<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>
@@ -43,8 +116,8 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
<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.
<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>
@@ -125,7 +198,7 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
<li>Added Battery meter range setting (<a href=https://github.com/opentx/opentx/issues/2195>#2195</a>)</li>
<li>Improvements in Print and Compare dialogs (<a href=https://github.com/opentx/opentx/issues/2219>#2219</a>)</li>
<li>Reset pots to the middle by right double clicking them in Simulator (<a href=https://github.com/opentx/opentx/issues/1939>#1939</a>)</li>
<li>Minor fixes: <a href=https://github.com/opentx/opentx/issues/2153>#2153</a>,
<li>Minor fixes: <a href=https://github.com/opentx/opentx/issues/2153>#2153</a>,
<a href=https://github.com/opentx/opentx/issues/2138>#2138</a>,
<a href=https://github.com/opentx/opentx/issues/2090>#2090</a>,
<a href=https://github.com/opentx/opentx/issues/2122>#2122</a>
@@ -228,13 +301,13 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
<ul>
<li>Sound should be ok on all platforms</li>
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
<li>Various bug fixes</li>
<li>Various bug fixes</li>
</ul>
<h2>Version 2.0.3</h2>
<ul>
<li>EEPROM import bug on AdjustGVAR function</li>
<li>Timers correctly displayed in logical switches tab</li>
<li>Timers correctly displayed in logical switches tab</li>
</ul>
<h2>Version 2.0.2</h2>
+397 -230
View File
@@ -1,118 +1,231 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(SIMULATOR_INSTALL_PREFIX "" CACHE STRING "Alternative simulator library search path")
if(${CMAKE_SYSTEM_NAME} MATCHES "(Linux|FreeBSD)")
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (NOT ${SIMULATOR_INSTALL_PREFIX} STREQUAL "")
set(SIMULATOR_LIB_PATH ${SIMULATOR_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else()
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
endif()
message(STATUS "Simulators library search path: " ${SIMULATOR_LIB_PATH})
set(SIMULATOR_LIB_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else()
set(COMPANION_NAME "companion")
set(SIMULATOR_NAME "simulator")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
# This the name that the user will see in the generated DMG and what the application
# will be called under /Applications. We include the version string to make installing
# different versions for different eeproms easier, i.e. without manually renaming
set(COMPANION_OSX_APP_BUNDLE_NAME "OpenTX Companion ${VERSION_MAJOR}.${VERSION_MINOR}")
# On OS X we copy dfu-util to the application bundle. This the path from which we copy
# the binary (default homebrew path)
set(DFU_UTIL_PATH "/usr/local/bin/dfu-util")
set(AVRDUDE_PATH "/usr/local/bin/avrdude")
set(AVRDUDE_CONF "/usr/local/etc/avrdude.conf")
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
if(ALLOW_NIGHTLY_BUILDS)
add_definitions(-DALLOW_NIGHTLY_BUILDS)
endif(ALLOW_NIGHTLY_BUILDS)
option(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
if(DEBUG_IMPORT)
add_definitions(-DDEBUG_MODEL_IMPORT)
message(STATUS "EEPROM import debugging enabled")
endif(DEBUG_IMPORT)
option(DEBUG_STORAGE_IMPORT "Turn on debug output for storage import") # Disabled by default
if(DEBUG_STORAGE_IMPORT)
add_definitions(-DDEBUG_STORAGE_IMPORT)
message(STATUS "Storage import debugging enabled")
endif()
if(DEBUG)
add_definitions(-DDEBUG)
endif()
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)
endif()
if(WIN32)
option(WIN_DO_FULL_INSTALL "'install' target will perform a full installation into CMAKE_INSTALL_PREFIX path, otherwise only supporting DLLs are copied to binaries folder (default)" OFF)
option(WIN_USE_CONSOLE "Open a Windows command console for Simulator debug output." OFF)
if(WIN_USE_CONSOLE)
add_definitions(-DWIN_USE_CONSOLE_STDIO)
endif()
endif()
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
add_definitions(-DSIMU_AUDIO)
add_definitions(-DJOYSTICKS)
endif()
message(STATUS "Looking for QT lupdate ")
find_package(Lupdate)
if(LUPDATE_FOUND)
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
add_definitions(${APP_COMMON_DEFINES}) # set in top-level CMakeLists
if(NOT MSVC)
set(WARNING_FLAGS "${WARNING_FLAGS} -Wall")
if(WARNINGS_AS_ERRORS)
set(WARNING_FLAGS "${WARNING_FLAGS} -Werror")
endif()
else()
message("QT lupdate not found!")
# silence lots of warnings regarding "insecure" use of functions (sprintf, strcpy, etc)
set(WARNING_FLAGS "${WARNING_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
if(WARNINGS_AS_ERRORS)
set(WARNING_FLAGS "${WARNING_FLAGS} /WX")
endif()
endif()
add_definitions(-DQXT_STATIC)
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /LD")
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
link_directories(C:/Programs/pthreads/Pre-built.2/lib/)
set(PTHREAD_LIBRARY pthreadVC2.lib)
if(WIN32)
include_directories(SYSTEM ${WIN_INCLUDE_DIRS})
if(NOT WIN_USE_CONSOLE)
set(WIN_EXECUTABLE_TYPE WIN32) # GUI (WinMain) app
endif()
if(MSVC)
if(NOT CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /LD /MP")
endif()
if(NOT WIN_USE_CONSOLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,5.01") # is this even needed?
endif()
elseif(MINGW)
get_filename_component(MINGW_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
# struct packing breaks on MinGW w/out -mno-ms-bitfields: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991 & http://stackoverflow.com/questions/24015852/struct-packing-and-alignment-with-mingw
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields")
endif()
else()
set(PTHREAD_LIBRARY pthread)
add_definitions(-Wall)
link_directories(/usr/local/lib)
endif()
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
use_cxx11() # ensure gnu++11 in CXX_FLAGS with CMake < 3.1
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${COMPANION_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/shared
${SIMU_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
${COMPANION_SRC_DIRECTORY}/thirdparty/qcustomplot
${COMPANION_SRC_DIRECTORY}/thirdparty/miniz
${COMPANION_SRC_DIRECTORY}/storage
)
############# Do macro replacements on input files #############
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
############# Translations ###############
### Generate .qm files and assemble resource (qrc) file.
# available Companion translations (src/translations/*.ts)
set(LANGUAGES cs de en es fi fr it pl sv zh_CN)
foreach(language ${LANGUAGES})
list(APPEND companion_TS translations/companion_${language}.ts)
endforeach(language)
# .ts -> .qm
qt5_add_translation(companion_QM ${companion_TS})
# add Qt translations if found
if(QT_TRANSLATIONS_DIR)
# Some languages have all translations in one qt_*.qm file and others break them up into modules, in which case we need qt_base_*.qm
file(GLOB qtbase_QM "${QT_TRANSLATIONS_DIR}/qtbase_*.qm")
file(GLOB qt_QM "${QT_TRANSLATIONS_DIR}/qt_??.qm") # don't want to match "qt_help_*.qm"
list(APPEND qt_QM "${QT_TRANSLATIONS_DIR}/qt_zh_CN.qm" "${QT_TRANSLATIONS_DIR}/qt_zh_TW.qm") # exceptions not matched by the GLOB
else()
message(STATUS "QT_TRANSLATIONS_DIR not found, unable to package pre-built Qt translations with application.")
endif()
set(TRANSLATIONS_QRC "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc")
# Dynamically create translations.qrc file (XML) from all collected translation files.
foreach(qm_file ${companion_QM} ${qt_QM} ${qtbase_QM})
get_filename_component(qm_file_name ${qm_file} NAME)
# Add file with full path and file name (w/out path) as alias to be used in actual code
set(TRANSLATION_FILES_LIST "${TRANSLATION_FILES_LIST} <file alias=\"${qm_file_name}\">${qm_file}</file>\n")
endforeach()
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${TRANSLATIONS_QRC} @ONLY)
### Add optional "translations" target for updating .ts files
if(QT_LUPDATE_EXECUTABLE)
add_custom_target(translations
WORKING_DIRECTORY ${COMPANION_SRC_DIRECTORY}
COMMAND ${QT_LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
message(STATUS "Qt lupdate not found, 'translations' target will not be availabe.")
endif()
############# Common lib ###############
set(common_SRCS
appdebugmessagehandler.cpp
customdebug.cpp
helpers.cpp
translations.cpp
modeledit/node.cpp # used in simulator
modeledit/edge.cpp # used by node
)
set(common_MOC_HDRS
appdebugmessagehandler.h
helpers.h
modeledit/node.h
)
set(common_RESOURCES
companion.qrc
${TRANSLATIONS_QRC}
)
qt5_wrap_cpp(common_SRCS ${common_MOC_HDRS})
qt5_add_resources(common_RCC ${common_RESOURCES})
add_library(common ${common_SRCS} ${common_RCC})
target_link_libraries(common
firmwares
storage
simulation
maxLibQtWidgets
Qt5::Core
Qt5::Xml
Qt5::Widgets
${PTHREAD_LIBRARY}
${SDL_LIBRARY}
${WIN_LINK_LIBRARIES}
)
set(CPN_COMMON_LIB common)
############# Supporting libraries ###############
add_subdirectory(datamodels)
add_subdirectory(firmwares)
add_subdirectory(shared)
add_subdirectory(modeledit)
add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(qcustomplot)
add_subdirectory(qxtcommandoptions)
add_subdirectory(storage)
add_subdirectory(thirdparty/qcustomplot)
add_subdirectory(thirdparty/maxlibqt/src/widgets)
set(common_SRCS
eeprominterface.cpp
firmwares/th9x/th9xeeprom.cpp # TODO not needed
firmwares/th9x/th9xinterface.cpp
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
firmwares/opentx/open9xSky9xeeprom.cpp
firmwares/opentx/opentxinterface.cpp
file.cpp
appdata.cpp
)
qt5_wrap_cpp(common_SRCS)
add_library(common ${common_SRCS})
qt5_use_modules(common Core Xml Widgets)
############# Companion ###############
set(companion_SRCS
hexinterface.cpp
firmwareinterface.cpp
converteeprom.cpp
# xmlinterface.cpp
# ${PROJECT_BINARY_DIR}/radio.cxx
helpers.cpp
helpers_html.cpp
mdichild.cpp
modelslist.cpp
mountlist.cpp
apppreferencesdialog.cpp
fwpreferencesdialog.cpp
burnconfigdialog.cpp
multimodelprinter.cpp
comparedialog.cpp
contributorsdialog.cpp
creditsdialog.cpp
releasenotesdialog.cpp
releasenotesfirmwaredialog.cpp
customizesplashdialog.cpp
@@ -135,6 +248,8 @@ set(companion_SRCS
radionotfound.cpp
wizarddata.cpp
wizarddialog.cpp
styleeditdialog.cpp
dialogs/filesyncdialog.cpp # TODO move to own lib with other dialogs
)
set(companion_MOC_HDRS
@@ -145,7 +260,7 @@ set(companion_MOC_HDRS
printdialog.h
fusesdialog.h
logsdialog.h
contributorsdialog.h
creditsdialog.h
releasenotesdialog.h
releasenotesfirmwaredialog.h
customizesplashdialog.h
@@ -159,14 +274,16 @@ set(companion_MOC_HDRS
flashfirmwaredialog.h
flasheepromdialog.h
downloaddialog.h
modelslist.h
mdichild.h
mainwindow.h
radionotfound.h
helpers.h
wizarddialog.h
modelprinter.h
multimodelprinter.h
modelslist.h
styleeditdialog.h
helpers_html.h
dialogs/filesyncdialog.h
)
set(companion_UIS
@@ -187,213 +304,254 @@ set(companion_UIS
flashfirmwaredialog.ui
flasheepromdialog.ui
radionotfound.ui
styleeditdialog.ui
)
set(companion_RESOURCES
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
if(WIN32)
set(companion_SRCS ${companion_SRCS} icon.rc)
if(NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif()
set(icon_RC images/winicons/icon.rc)
endif()
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})
set(LANGUAGES he pl pt ru de fr es it sv cs fi nl)
foreach(language ${LANGUAGES})
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
endforeach(language)
qt5_wrap_ui(companion_SRCS ${companion_UIS})
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
qt5_add_translation(companion_QM ${companion_TS})
qt5_add_resources(companion_RCC ${companion_RESOURCES})
add_custom_target(gen_qrc DEPENDS ${companion_RCC})
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${companion_SRCS} ${icon_RC})
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit qcustomplot shared ${CPN_COMMON_LIB})
if(APPLE)
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
else()
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
PrintTargetReport("${COMPANION_NAME}")
############# Standalone simulator ###############
set(simu_SRCS simulator.cpp )
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${WIN_EXECUTABLE_TYPE} ${simu_SRCS} ${icon_RC})
target_link_libraries(${SIMULATOR_NAME} PRIVATE ${CPN_COMMON_LIB})
############# Install ####################
# Generate list of simulator plugins, used by all platforms
file(GLOB simulator_plugins "${CMAKE_BINARY_DIR}/*opentx-*simulator${CMAKE_SHARED_LIBRARY_SUFFIX}")
# the current flavour is not automatically added if build in the current cmake iteration, so always
# add its library name to be sure
string(TOLOWER ${PCB} FLAVOUR)
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD) # https://cmake.org/cmake/help/v3.0/policy/CMP0026.html
endif()
if(SIMU_TARGET)
get_property(current_plugin TARGET opentx-${FLAVOUR}-simulator PROPERTY LOCATION)
list(APPEND simulator_plugins "${current_plugin}")
endif()
add_dependencies(${COMPANION_NAME} gen_qrc)
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
############# Standalone simu ###############
set(simu_SRCS
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
)
set(simu_MOC_HDRS
modeledit/node.h
)
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
if(WIN32)
set(simu_SRCS ${simu_SRCS} icon.rc)
endif()
if(APPLE)
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
else()
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
endif()
add_dependencies(${SIMULATOR_NAME} gen_qrc)
# TODO not the same link command than companion?
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
############# Packaging ####################
message(STATUS ${CMAKE_BINARY_DIR} ${CMAKE_INSTALL_PREFIX}/bin)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "install " ${CMAKE_BINARY_DIR} " to " ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${CMAKE_BINARY_DIR}/ DESTINATION ${SIMULATOR_LIB_PATH} USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "libopentx-*.so"
PATTERN "CMakeFiles" EXCLUDE
PATTERN "_CPack_Packages" EXCLUDE
PATTERN "companion" EXCLUDE
PATTERN "radio" EXCLUDE
)
install(FILES ${simulator_plugins} DESTINATION "${SIMULATOR_LIB_INSTALL_PATH}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
if(${CMAKE_INSTALL_PREFIX} MATCHES "/usr/local")
install(FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
else()
install(FILES images/linuxicons/16x16/companion.png DESTINATION share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
set(INSTALL_TEMP_SHR_PFX "/usr/")
set(INSTALL_TEMP_LIB_PFX "/")
endif()
install(FILES images/linuxicons/16x16/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION ${INSTALL_TEMP_SHR_PFX}share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION ${INSTALL_TEMP_LIB_PFX}lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
install(FILES ../targets/linux/45-usbasp.rules DESTINATION ${INSTALL_TEMP_LIB_PFX}lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-usbasp.rules)
# Linux specific code
set(OperatingSystem "Linux")
elseif(WIN32)
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
endif()
if(WIN32)
if(MSVC)
set(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
elseif(WIN32)
if(NOT WIN_DO_FULL_INSTALL)
# Just copy supporting DLLs to build folder
set(INSTALL_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message(STATUS "Partial install to " ${INSTALL_DESTINATION})
else()
set(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
# Full Windows installation with all supporting files
set(INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}")
message(STATUS "Full install to " ${INSTALL_DESTINATION})
# companion & simulator binaries
install(TARGETS ${COMPANION_NAME} DESTINATION ${INSTALL_DESTINATION})
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${INSTALL_DESTINATION})
install(FILES ${simulator_plugins} DESTINATION "${INSTALL_DESTINATION}")
# supporting utilities
set(INSTALL_TEMP_FILES avrdude.exe avrdude.conf dfu-util.exe libusb0.dll libusb-1.0.dll license.txt)
foreach(tmpfile ${INSTALL_TEMP_FILES})
install(FILES "${COMPANION_SRC_DIRECTORY}/../targets/windows/${tmpfile}" DESTINATION ${INSTALL_DESTINATION})
endforeach()
endif() # WIN_DO_FULL_INSTALL
# Qt dlls (using windeployqt)
## Qt translations are already packaged into our custom qrc. Also don't need software rendering engines.
set(wdqtopts --no-translations --no-opengl-sw --no-system-d3d-compiler --no-angle)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(wdqtopts ${wdqtopts} --release) # release builds aren't always properly detected with mingw
endif()
if(MSVC)
set(wdqtopts ${wdqtopts} --no-compiler-runtime) # --compiler-runtime includes vcredist_x86, but we just copy the required DLLs manually
endif()
set(wdqtopts ${wdqtopts} -dir "${INSTALL_DESTINATION}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${COMPANION_NAME}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SIMULATOR_NAME}.exe")
# Add installer command to execute windeployqt
install(CODE "execute_process(COMMAND \"${QT_BIN_DIR}/windeployqt.exe\" ${wdqtopts})")
# SDL dll
if(SDL_FOUND AND EXISTS "${SDL_LIBRARY_PATH}/SDL.dll")
set(SDL_DIR ${SDL_LIBRARY_PATH}) # this is also used by NSIS installer script
install(FILES ${SDL_DIR}/SDL.dll DESTINATION ${INSTALL_DESTINATION})
elseif(SDL_FOUND)
message(WARNING "Installer: SDL.dll not found, set SDL_LIBRARY_PATH manually.")
endif()
set(SYSDIR "$ENV{windir}/system32")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/companion.nsi @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/simulator.nsi @ONLY)
# libeay (SSL) dlls (used by QtNetwork) -- not strictly required but avoids possible issues with downloads and Qt warnings.
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" WIN_PROGRAM_FILES)
find_path(EAY_LIB_DIR libeay32.dll HINTS
"${WIN_PROGRAM_FILES}/OpenSSL" "${WIN_PROGRAM_FILES}/OpenSSL-Win32"
"C:/OpenSSL/" "C:/OpenSSL-Win32/"
"${WIN_EXTRA_LIBS_PATH}" "${WIN_EXTRA_LIBS_PATH}/OpenSSL" "${WIN_EXTRA_LIBS_PATH}/OpenSSL-Win32"
"${MINGW_DIR}/../opt/bin"
"${PYTHON_DIRECTORY}/lib/site-packages/PyQt4"
PATH_SUFFIXES bin
DOC "Path to libeay32.dll and ssleay32.dll (OpenSSL)"
)
if (EAY_LIB_DIR)
install(FILES "${EAY_LIB_DIR}/libeay32.dll" "${EAY_LIB_DIR}/ssleay32.dll" DESTINATION ${INSTALL_DESTINATION} OPTIONAL)
else()
message(WARNING "Installer: SSL libs not found, set EAY_LIB_DIR manually.")
endif()
# C++/system dlls, depends on compiler
if(MSVC)
file(TO_CMAKE_PATH "$ENV{windir}/SysWOW64" WIN_SYSDIR) # This would be "system32" for a 64-bit build or on x86... but how to tell?
if (NOT EXISTS "${WIN_SYSDIR}")
file(TO_CMAKE_PATH "$ENV{windir}/system32" WIN_SYSDIR) # Must be 32-bit Windows.
endif()
install(FILES "${WIN_SYSDIR}/msvcp140.dll" "${WIN_SYSDIR}/vcruntime140.dll" DESTINATION ${INSTALL_DESTINATION} OPTIONAL)
if(WIN_PTHREAD_DLL)
install(FILES "${WIN_PTHREAD_DLL}" DESTINATION ${INSTALL_DESTINATION})
endif()
endif()
endif() # WIN32 install
############# Packaging ####################
# Create Windows installer with NSIS
if(WIN32)
find_program(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
"${WIN_EXTRA_LIBS_PATH}/NSIS"
)
if (NSIS_EXE)
file(TO_NATIVE_PATH "${INSTALL_DESTINATION}" NSIS_DISTRO) # all files in here will be included in installer
set(NSI_FILE "${PROJECT_BINARY_DIR}/companion/companion.nsi")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/companion.nsi.in" "${NSI_FILE}" @ONLY)
add_custom_target(installer
# The 'install' target prepares all the distro files, make sure it has been executed first.
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target install
COMMAND "${NSIS_EXE}" "${NSI_FILE}"
DEPENDS "${NSI_FILE}"
COMMENT "Building Windows NSIS installer..."
)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/companion.nsi
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/companion.nsi
COMMENT "Companion Windows NSIS Installer")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
COMMENT "Simulator Windows NSIS Installer")
add_custom_target(installer
DEPENDS ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
DEPENDS ${PROJECT_BINARY_DIR}/companion/simulator-windows.exe
SOURCES ${PROJECT_BINARY_DIR}/companion/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
)
endif()
if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(WORK_DIR ${CMAKE_BINARY_DIR}/Debug)
else()
set(WORK_DIR ${PROJECT_BINARY_DIR})
endif()
add_custom_target(addframeworks
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${COMPANION_NAME})
add_custom_target(makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks opentx-simulators-bundle)
endif()
if(LUPDATE_FOUND)
add_custom_target(translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
else()
add_custom_target(translations
COMMAND echo "Sorry, QT lupdate was not found."
)
endif()
set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTX open source firmware")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
# The file stripping is deliberately disabled, with the stripped file we get
# very poor trace-backs from the users when they report Companion crash
set(CPACK_STRIP_FILES FALSE)
# Qt5 + Cmake + Mac is poorly documented. A lot of this is guesswork
# and trial and error. Do not hesitate to fix it for the better
IF(APPLE)
set(plugin_dest_dir ${COMPANION_NAME}.app/Contents/Plugins)
set(qtconf_dest_dir ${COMPANION_NAME}.app/Contents/Resources)
set(APPS "\${CMAKE_INSTALL_PREFIX}/${COMPANION_NAME}.app")
set(companion_res_dir ${COMPANION_NAME}.app/Contents/Resources)
set_target_properties(${COMPANION_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Companion ${VERSION_MAJOR}.${VERSION_MINOR}")
set_target_properties(${SIMULATOR_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simulator ${VERSION_MAJOR}.${VERSION_MINOR}")
# Use a non standard Info.plist that adds Retina support flags
set_target_properties(${COMPANION_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
set_target_properties(${SIMULATOR_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
INSTALL(TARGETS ${COMPANION_NAME}
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)
install(FILES ${simulator_plugins} DESTINATION "${companion_res_dir}" COMPONENT Runtime)
# Write qt.conf to tell qt where to find it plugins
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
"[Paths]\nPlugins = Plugins\n")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
DESTINATION "${companion_res_dir}"
COMPONENT Runtime)
# menu file
install(DIRECTORY ${PROJECT_SOURCE_DIR}/companion/targets/mac/qt_menu.nib DESTINATION "${companion_res_dir}" COMPONENT Runtime)
# manually add the required plugins
foreach (plugin ${Qt5Multimedia_PLUGINS} ${Qt5PrintSupport_PLUGINS} ${Qt5Gui_PLUGINS} ${Qt5Svg_PLUGINS})
get_target_property(QPA_PLUGIN ${plugin} LOCATION)
get_filename_component(QPA_PLUGIN_FILENAME ${QPA_PLUGIN} NAME)
# Todo is there a nicer way to get the QT Plugin directory name?!
get_filename_component(QPA_PLUGIN_DIRECTORY ${QPA_PLUGIN} DIRECTORY)
get_filename_component(QPA_PLUGIN_DIRECTORY ${QPA_PLUGIN_DIRECTORY} NAME)
install(FILES ${QPA_PLUGIN} DESTINATION "${plugin_dest_dir}/${QPA_PLUGIN_DIRECTORY}/" COMPONENT Runtime)
list(APPEND bundle_qt_libs "\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/${QPA_PLUGIN_DIRECTORY}/${QPA_PLUGIN_FILENAME}")
endforeach()
# Add icon
set(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
set(MAC_ICON_FILE ${COMPANION_SRC_DIRECTORY}/images/${MACOSX_BUNDLE_ICON_FILE})
SET_SOURCE_FILES_PROPERTIES(${MAC_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(${COMPANION_SOURCES} ${COMPANION_SOURCES} ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE})
install(FILES ${MAC_ICON_FILE} DESTINATION ${companion_res_dir} COMPONENT Runtime)
# Copy dfu-util and avrdude, resolve symlink first
get_filename_component(DFU_UTIL_ABSOLUTE_PATH ${DFU_UTIL_PATH} REALPATH)
get_filename_component(AVRDUDE_ABSOLUTE_PATH ${AVRDUDE_PATH} REALPATH)
get_filename_component(AVRDUDECONF_ABSOLUTE_PATH ${AVRDUDE_CONF} REALPATH)
install(PROGRAMS ${DFU_UTIL_ABSOLUTE_PATH} ${AVRDUDE_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
install(FILES ${AVRDUDECONF_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
set(bundle_tools_path "\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/dfu-util;\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/avrdude")
# Include depencies (adding frameworks, fixing the embbeded libraries)
# I get write errors without setting BU_CHMOD_BUNDLE_ITEMS even though it is
# technically a hack (that is already is in the Bundle library ...)
install(CODE "
include(BundleUtilities)
file(GLOB bundle_simulator_libs \"\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/libopentx-*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
set(BU_CHMOD_BUNDLE_ITEMS on)
fixup_bundle(\"${APPS}\" \"\${bundle_simulator_libs};${bundle_qt_libs};${bundle_tools_path}\" \"${QT_LIB_DIR}\")
file(RENAME \"\${CMAKE_INSTALL_PREFIX}/${COMPANION_NAME}.app\" \"\${CMAKE_INSTALL_PREFIX}/${COMPANION_OSX_APP_BUNDLE_NAME}.app\")
" COMPONENT Runtime)
endif()
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
set(CPACK_GENERATOR "DEB")
execute_process(
@@ -407,13 +565,22 @@ if(DPKG_PROGRAM)
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
elseif(APPLE)
set(CPACK_GENERATOR "DragNDrop")
# set(CPACK_GENERATOR "TGZ") # for quick testing
set(CPACK_BINARY_DRAGNDROP ON)
set(CPACK_DMG_BACKGROUND_IMAGE ${COMPANION_SRC_DIRECTORY}/images/splash22_3_dmg.png)
set(CPACK_DMG_VOLUME_NAME "OpenTX Companion")
set(CPACK_DMG_DS_STORE ${PROJECT_SOURCE_DIR}/companion/targets/mac/DS_Store)
set(CPACK_PACKAGE_FILE_NAME "opentx-${CPACK_PACKAGE_NAME_LOWERCASE}-${VERSION}")
else(DPKG_PROGRAM)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
endif(DPKG_PROGRAM)
include(CPack)
-800
View File
@@ -1,800 +0,0 @@
/*
* Author - Kjell Kernen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "appdata.h"
// Global data and storage object
AppData g;
// ** CompStoreObj class********************
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
{
QSettings settings(COMPANY, PRODUCT);
if (tag2.isEmpty())
{
settings.remove(tag1);
}
else if (tag3.isEmpty())
{
settings.beginGroup(tag1);
settings.remove(tag2);
settings.endGroup();
}
else
{
settings.beginGroup(tag1);
settings.beginGroup(tag2);
settings.remove(tag3);
settings.endGroup();
settings.endGroup();
}
}
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newArray);
array = newArray;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newSList);
stringList = newSList;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newString);
string = newString;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newTruth);
truth = newTruth;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
settings.setValue(tag, newNumber);
number = newNumber;
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
// Retrieval functions
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
array = settings.value(tag, def).toByteArray();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
stringList = settings.value(tag, def).toStringList();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
string = settings.value(tag, def).toString();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
truth = settings.value(tag, def).toBool();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
{
QSettings settings(COMPANY, PRODUCT);
if (!group1.isEmpty()) settings.beginGroup(group1);
if (!group2.isEmpty()) settings.beginGroup(group2);
number = settings.value(tag, def).toInt();
if (!group1.isEmpty()) settings.endGroup();
if (!group2.isEmpty()) settings.endGroup();
}
// Retrieve and Store functions
void CompStoreObj::getset( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( array, tag, def, group1, group2);
store(array, array, tag, group1, group2);
}
void CompStoreObj::getset( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( stringList, tag, def, group1, group2);
store(stringList, stringList, tag, group1, group2);
}
void CompStoreObj::getset( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
{
retrieve( string, tag, def, group1, group2);
store(string, string, tag, group1, group2);
}
void CompStoreObj::getset( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
{
retrieve( truth, tag, def, group1, group2);
store(truth, truth, tag, group1, group2);
}
void CompStoreObj::getset( int &number, const QString tag, const int def, const QString group1, const QString group2 )
{
retrieve( number, tag, def, group1, group2);
store(number, number, tag, group1, group2);
}
// ** FwRevision class********************
int FwRevision::get( const QString fwType )
{
QString result;
retrieve( result, fwType, "", "FwRevisions" );
return result.toInt();
}
void FwRevision::set( const QString fwType, const int fwRevision )
{
QString tempString = QString("%1").arg(fwRevision);
store( tempString, tempString, fwType, "FwRevisions" );
}
void FwRevision::remove( const QString tag )
{
clear( "FwRevisions", tag );
}
// ** JStickData class********************
// Get declarations
int JStickData::stick_axe() { return _stickAxe; }
int JStickData::stick_min() { return _stickMin; }
int JStickData::stick_med() { return _stickMed; }
int JStickData::stick_max() { return _stickMax; }
int JStickData::stick_inv() { return _stickInv; }
// Set declarations
void JStickData::stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );}
void JStickData::stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );}
void JStickData::stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );}
void JStickData::stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );}
void JStickData::stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );}
// Constructor
JStickData::JStickData()
{
index = -1;
}
void JStickData::remove()
{
// Remove all JStickData values from settings file
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup( "JsCalibration" );
settings.remove( QString( "stick%1_axe").arg(index) );
settings.remove( QString( "stick%1_min").arg(index) );
settings.remove( QString( "stick%1_med").arg(index) );
settings.remove( QString( "stick%1_max").arg(index) );
settings.remove( QString( "stick%1_inv").arg(index) );
settings.endGroup();
// Reset all JStickData variables to initial values
init(index);
}
bool JStickData::existsOnDisk()
{
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("JsCalibration");
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
settings.endGroup();
return (axe > -1);
}
void JStickData::init(int newIndex)
{
index = newIndex;
_stickAxe = -1;
_stickMin = -32767;
_stickMed = 0;
_stickMax = 0;
_stickInv = 0;
// Do not write empty joystick calibrations to disk.
if ( !existsOnDisk() )
return;
flush();
}
void JStickData::flush()
{
getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" );
getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" );
getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
}
// ** Profile class********************
// Get declarations
QString Profile::fwName() const { return _fwName; }
QString Profile::fwType() const { return _fwType; }
QString Profile::name() const { return _name; }
QString Profile::sdPath() const { return _sdPath; }
int Profile::volumeGain() const { return _volumeGain; }
QString Profile::pBackupDir() const { return _pBackupDir; }
QString Profile::splashFile() const { return _splashFile; }
bool Profile::burnFirmware() const { return _burnFirmware; }
bool Profile::penableBackup() const { return _penableBackup; }
bool Profile::renameFwFiles() const { return _renameFwFiles; }
int Profile::channelOrder() const { return _channelOrder; }
int Profile::defaultMode() const { return _defaultMode; }
QString Profile::beeper() const { return _beeper; }
QString Profile::countryCode() const { return _countryCode; }
QString Profile::display() const { return _display; }
QString Profile::haptic() const { return _haptic; }
QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
QString Profile::controlTypes() const { return _controlTypes; }
QString Profile::controlNames() const { return _controlNames; }
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
int Profile::vBatWarn() const { return _vBatWarn; }
int Profile::vBatMin() const { return _vBatMin; }
int Profile::vBatMax() const { return _vBatMax; }
// Set declarations
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
void Profile::volumeGain (const int x) { store(x, _volumeGain, "volumeGain" ,"Profiles", QString("profile%1").arg(index));}
void Profile::pBackupDir (const QString x) { store(x, _pBackupDir, "pBackupDir" ,"Profiles", QString("profile%1").arg(index));}
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
void Profile::penableBackup (const bool x) { store(x, _penableBackup, "penableBackup" ,"Profiles", QString("profile%1").arg(index));}
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
void Profile::haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
void Profile::speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
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));}
// Constructor
Profile::Profile()
{
index = -1;
}
// The default copy operator can not be used since the index variable would be destroyed
Profile& Profile::operator=(const Profile& rhs)
{
name ( rhs.name() );
fwName ( rhs.fwName() );
fwType ( rhs.fwType() );
sdPath ( rhs.sdPath() );
volumeGain ( rhs.volumeGain() );
pBackupDir ( rhs.pBackupDir() );
splashFile ( rhs.splashFile() );
burnFirmware ( rhs.burnFirmware() );
renameFwFiles( rhs.renameFwFiles() );
penableBackup( rhs.penableBackup() );
channelOrder ( rhs.channelOrder() );
defaultMode ( rhs.defaultMode() );
beeper ( rhs.beeper() );
countryCode ( rhs.countryCode() );
display ( rhs.display() );
haptic ( rhs.haptic() );
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
controlTypes ( rhs.controlTypes() );
controlNames ( rhs.controlNames() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
txVoltageCalibration ( rhs.txVoltageCalibration() );
vBatWarn ( rhs.vBatWarn() );
vBatMin ( rhs.vBatMin() );
vBatMax ( rhs.vBatMax() );
return *this;
}
void Profile::remove()
{
// Remove all profile values from settings file
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("Profiles");
settings.remove(QString("profile%1").arg(index));
settings.endGroup();
// Reset all profile variables to initial values
init(index);
}
bool Profile::existsOnDisk()
{
QSettings settings(COMPANY, PRODUCT);
settings.beginGroup("Profiles");
settings.beginGroup(QString("profile%1").arg(index));
QStringList keyList = settings.allKeys();
settings.endGroup();
settings.endGroup();
return (keyList.length() > 0);
}
void Profile::initFwVariables()
{
_beeper = "";
_countryCode = "";
_display = "";
_haptic = "";
_speaker = "";
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_controlTypes = "";
_controlNames = "";
_txCurrentCalibration = 0;
_gsStickMode = 0;
_ppmMultiplier = 0;
_txVoltageCalibration = 0;
_vBatWarn = 0;
_vBatMin = 0;
_vBatMax = 0;
}
void Profile::init(int newIndex)
{
index = newIndex;
_fwName = "";
_fwType = "";
_name = "";
_sdPath = "";
_volumeGain = 10;
_pBackupDir = "";
_splashFile = "";
_burnFirmware = false;
_renameFwFiles = false;
_penableBackup = false;
_channelOrder = 0;
_defaultMode = 1;
initFwVariables();
// Do not write empty profiles to disk except the default (0) profile.
if ( index > 0 && !existsOnDisk())
return;
flush();
}
void Profile::flush()
{
// Load and store all variables. Use default values if setting values are missing
getset( _fwName, "fwName" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _volumeGain, "volumeGain" ,10 ,"Profiles", QString("profile%1").arg(index));
getset( _pBackupDir, "pBackupDir" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _penableBackup, "penableBackup" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
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));
}
// ** AppData class********************
// Get declarations
QStringList AppData::recentFiles() { return _recentFiles; }
QByteArray AppData::mainWinGeo() { return _mainWinGeo; }
QByteArray AppData::mainWinState() { return _mainWinState; }
QByteArray AppData::modelEditGeo() { return _modelEditGeo; }
QString AppData::armMcu() { return _armMcu; }
QString AppData::avrArguments() { return _avrArguments; }
QString AppData::avrPort() { return _avrPort; }
QString AppData::avrdudeLocation() { return _avrdudeLocation; }
QString AppData::dfuArguments() { return _dfuArguments; }
QString AppData::dfuLocation() { return _dfuLocation; }
QString AppData::locale() { return _locale; }
QString AppData::mcu() { return _mcu; }
QString AppData::programmer() { return _programmer; }
QString AppData::sambaLocation() { return _sambaLocation; }
QString AppData::sambaPort() { return _sambaPort; }
QString AppData::lastSimulator() { return _lastSimulator; }
QString AppData::backupDir() { return _backupDir; }
QString AppData::gePath() { return _gePath; }
QString AppData::eepromDir() { return _eepromDir; }
QString AppData::flashDir() { return _flashDir; }
QString AppData::imagesDir() { return _imagesDir; }
QString AppData::logDir() { return _logDir; }
QString AppData::libDir() { return _libDir; }
QString AppData::snapshotDir() { return _snapshotDir; }
QString AppData::updatesDir() { return _updatesDir; }
bool AppData::jsSupport() { return _jsSupport; }
bool AppData::maximized() { return _maximized; }
bool AppData::showSplash() { return _showSplash; }
bool AppData::snapToClpbrd() { return _snapToClpbrd; }
bool AppData::autoCheckApp() { return _autoCheckApp; }
bool AppData::autoCheckFw() { return _autoCheckFw; }
bool AppData::simuSW() { return _simuSW; }
bool AppData::useWizard() { return _useWizard; }
int AppData::backLight() { return _backLight; }
int AppData::embedSplashes() { return _embedSplashes; }
int AppData::fwServerFails() { return _fwServerFails; }
int AppData::generalEditTab() { return _generalEditTab; }
int AppData::iconSize() { return _iconSize; }
int AppData::historySize() { return _historySize; }
int AppData::jsCtrl() { return _jsCtrl; }
int AppData::id() { return _id; }
int AppData::theme() { return _theme; }
int AppData::warningId() { return _warningId; }
// Set declarations
void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
void AppData::mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );}
void AppData::mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );}
void AppData::modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );}
void AppData::armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );}
void AppData::avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );}
void AppData::avrPort (const QString x) { store(x, _avrPort, "avr_port" );}
void AppData::avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );}
void AppData::dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );}
void AppData::dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );}
void AppData::locale (const QString x) { store(x, _locale, "locale" );}
void AppData::mcu (const QString x) { store(x, _mcu, "mcu" );}
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
void AppData::lastSimulator (const QString x) { store(x, _lastSimulator, "last_simulator" );}
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
void AppData::eepromDir (const QString x) { store(x, _eepromDir, "lastDir" );}
void AppData::flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );}
void AppData::imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );}
void AppData::logDir (const QString x) { store(x, _logDir, "lastLogDir" );}
void AppData::libDir (const QString x) { store(x, _libDir, "libraryPath" );}
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );}
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
void AppData::useWizard (const bool x) { store(x, _useWizard, "useWizard" );}
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
void AppData::fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );}
void AppData::generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );}
void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );}
void AppData::historySize (const int x) { store(x, _historySize, "history_size" );}
void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
void AppData::id (const int x) { store(x, _id, "profileId" );}
void AppData::theme (const int x) { store(x, _theme, "theme" );}
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
// Constructor
AppData::AppData()
{
}
void AppData::init()
{
//Initialize the profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
//Initialize the joysticks
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
QSettings settings(COMPANY, PRODUCT);
// Copy existing 2.1 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings21("OpenTX", "Companion 2.1");
QStringList keys = settings21.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings21.value(*i) != QString("") && settings21.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings21.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Copy existing 2.0 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings20("OpenTX", "Companion 2.0");
QStringList keys = settings20.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings20.value(*i) != QString("") && settings20.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings20.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Else copy existing <2.0.16 settings if present
if (profile[0].name().isEmpty())
{
QSettings pre2016settings("OpenTX", "OpenTX Companion");
QStringList keys = pre2016settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (pre2016settings.value(*i) != QString("") && pre2016settings.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, pre2016settings.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Else import settings from companion9x if present
if (profile[0].name().isEmpty())
{
QSettings c9x_settings("companion9x", "companion9x");
// Copy all settings from companion9x to companion
QStringList keys = c9x_settings.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
settings.setValue(*i, c9x_settings.value(*i));
}
// Store old values in new locations
autoCheckApp(settings.value("startup_check_companion9x", true).toBool());
useWizard(settings.value("wizardEnable", true).toBool());
// Convert and store the firmware type
QString fwType = settings.value("firmware", "").toString();
fwType.replace("open9x","opentx");
fwType.replace("x9da","taranis");
profile[0].fwType( fwType );
// Move the Companion9x profile settings to profile0, the new default profile
profile[0].name( settings.value( "Name", "" ).toString());
profile[0].sdPath( settings.value( "sdPath", "" ).toString());
profile[0].splashFile( settings.value( "SplashFileName", "" ).toString());
profile[0].burnFirmware( settings.value( "burnFirmware", false ).toBool());
profile[0].renameFwFiles( settings.value( "rename_firmware_files", false ).toBool());
profile[0].channelOrder( settings.value( "default_channel_order", "0" ).toInt());
profile[0].defaultMode( settings.value( "default_mode", "1" ).toInt());
// Ensure that the default profile has a name
if ( profile[0].name().isEmpty() )
profile[0].name("My Radio");
// Delete obsolete settings fields from companion9x
settings.remove("ActiveProfile");
settings.remove("burnFirmware");
settings.remove("custom_id");
settings.remove("default_channel_order");
settings.remove("default_mode");
settings.remove("firmware");
settings.remove("lastFw");
settings.remove("modelEditTab");
settings.remove("Name");
settings.remove("patchImage");
settings.remove("rename_firmware_files");
settings.remove("sdPath");
settings.remove("SplashFileName");
settings.remove("startup_check_companion9x");
settings.remove("wizardEnable");
// Delete settings that we do not want to carry over from 1.52
settings.remove("dfu_location");
// Select the new default profile as current profile
id( 0 );
}
// Remove settings that have been made obsolete during companion2.0 development
settings.remove("compilation-server");
// Load and store all variables. Use default values if setting values are missing
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
getset( _tempString, "settings_version" ,"220" ); // This is a version marker. Will be used to upgrade the settings later on.
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
getset( _mainWinState, "mainWindowState" ,"" );
getset( _modelEditGeo, "modelEditGeometry" ,"" );
getset( _armMcu, "arm_mcu" ,"at91sam3s4-9x" );
getset( _avrArguments, "avr_arguments" ,"" );
getset( _avrPort, "avr_port" ,"" );
getset( _avrdudeLocation, "avrdudeLocation" ,"" );
getset( _dfuArguments, "dfu_arguments" ,"-a 0" );
getset( _dfuLocation, "dfu_location" ,"" );
getset( _locale, "locale" ,"" );
getset( _mcu, "mcu" ,"m64" );
getset( _programmer, "programmer" ,"usbasp" );
getset( _sambaLocation, "samba_location" ,"" );
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
getset( _lastSimulator, "last_simulator" ,"" );
getset( _backupDir, "backupPath" ,"" );
getset( _gePath, "gePath" ,"" );
getset( _eepromDir, "lastDir" ,"" );
getset( _flashDir, "lastFlashDir" ,"" );
getset( _imagesDir, "lastImagesDir" ,"" );
getset( _logDir, "lastLogDir" ,"" );
getset( _libDir, "libraryPath" ,"" );
getset( _snapshotDir, "snapshotpath" ,"" );
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
getset( _enableBackup, "enableBackup" ,false );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
getset( _useCompanionNightlyBuilds, "useCompanionNightlyBuilds" ,false );
getset( _useFirmwareNightlyBuilds, "useFirmwareNightlyBuilds" ,false );
getset( _jsSupport, "js_support" ,false );
getset( _maximized, "maximized" ,false );
getset( _showSplash, "show_splash" ,true );
getset( _snapToClpbrd, "snapshot_to_clipboard" ,false );
getset( _autoCheckApp, "startup_check_companion" ,true );
getset( _autoCheckFw, "startup_check_fw" ,true );
getset( _simuSW, "simuSW" ,false );
getset( _useWizard, "useWizard" ,true );
getset( _backLight, "backLight" ,0 );
getset( _embedSplashes, "embedded_splashes" ,0 );
getset( _fwServerFails, "fwserver" ,0 );
getset( _generalEditTab, "generalEditTab" ,0 );
getset( _iconSize, "icon_size" ,2 );
getset( _jsCtrl, "js_ctrl" ,0 );
getset( _historySize, "history_size" ,10 );
getset( _id, "profileId" ,0 );
getset( _theme, "theme" ,1 );
getset( _warningId, "warningId" ,0 );
}
-392
View File
@@ -1,392 +0,0 @@
/*
* Author - Kjell Kernen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
// All temporary and permanent global variables are defined here to make
// initialization and storage safe and visible.
// Do not access variables in QSettings directly, it is not type safe!
#ifndef COMPANION_APPDATA_H
#define COMPANION_APPDATA_H
#include <QByteArray>
#include <QStringList>
#include <QString>
#include <QSettings>
#define COMPANY "OpenTX"
#define PRODUCT "Companion 2.2"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
class CompStoreObj
{
public:
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
void store(const QString newString, QString &string, const QString tag, const QString group1="", const QString group2="" );
void store(const bool newTruth, bool &truth, const QString tag, const QString group1="", const QString group2="" );
void store(const int newNumber, int &number, const QString tag, const QString group1="", const QString group2="" );
// Retrieval functions
void retrieve( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
void retrieve( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
void retrieve( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
// Retrieve and Store functions
void getset( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
};
class FwRevision: protected CompStoreObj
{
public:
int get( const QString);
void set( const QString, const int );
void remove( const QString );
};
class JStickData: protected CompStoreObj
{
private:
int index;
int _stickAxe;
int _stickMin;
int _stickMed;
int _stickMax;
int _stickInv;
public:
// All the get definitions
int stick_axe();
int stick_min();
int stick_med();
int stick_max();
int stick_inv();
// All the set definitions
void stick_axe(const int);
void stick_min(const int);
void stick_med(const int);
void stick_max(const int);
void stick_inv(const int);
JStickData();
void remove();
bool existsOnDisk();
void init(int index);
void flush();
};
class Profile: protected CompStoreObj
{
private:
// Class Internal Variable
int index;
// Application Variables
QString _fwName;
QString _fwType;
QString _name;
QString _sdPath;
int _volumeGain;
QString _pBackupDir;
QString _splashFile;
bool _burnFirmware;
bool _penableBackup;
bool _renameFwFiles;
int _channelOrder;
int _defaultMode;
// Firmware Variables
QString _beeper;
QString _countryCode;
QString _display;
QString _haptic;
QString _speaker;
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
QString _controlTypes;
QString _controlNames;
int _txCurrentCalibration;
int _gsStickMode;
int _ppmMultiplier;
int _txVoltageCalibration;
int _vBatWarn;
int _vBatMin;
int _vBatMax;
public:
// All the get definitions
QString fwName() const;
QString fwType() const;
QString name() const;
QString sdPath() const;
int volumeGain() const;
QString pBackupDir() const;
QString splashFile() const;
bool burnFirmware() const;
bool renameFwFiles() const;
bool penableBackup() const;
int channelOrder() const;
int defaultMode() const;
QString beeper() const;
QString countryCode() const;
QString display() const;
QString haptic() const;
QString speaker() const;
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
QString controlTypes() const;
QString controlNames() const;
int txCurrentCalibration() const;
int gsStickMode() const;
int ppmMultiplier() const;
int txVoltageCalibration() const;
int vBatWarn() const;
int vBatMin() const;
int vBatMax() const;
// All the set definitions
void name (const QString);
void fwName (const QString);
void fwType (const QString);
void volumeGain (const int);
void sdPath (const QString);
void pBackupDir (const QString);
void splashFile (const QString);
void burnFirmware (const bool);
void renameFwFiles (const bool);
void penableBackup (const bool);
void channelOrder (const int);
void defaultMode (const int);
void beeper (const QString);
void countryCode (const QString);
void display (const QString);
void haptic (const QString);
void speaker (const QString);
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void controlTypes (const QString);
void controlNames (const QString);
void txCurrentCalibration (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
void txVoltageCalibration (const int);
void vBatWarn (const int);
void vBatMin (const int);
void vBatMax (const int);
Profile();
Profile& operator=(const Profile&);
void remove();
bool existsOnDisk();
void init(int newIndex);
void initFwVariables();
void flush();
};
#define BOOL_PROPERTY(name, dflt) \
public: \
inline bool name() { return _ ## name; } \
void name(const bool val) { store(val, _ ## name, # name); } \
private: \
bool _ ## name;
class AppData: protected CompStoreObj
{
BOOL_PROPERTY(enableBackup, false)
BOOL_PROPERTY(outputDisplayDetails, false)
BOOL_PROPERTY(backupOnFlash, true)
BOOL_PROPERTY(checkHardwareCompatibility, true)
BOOL_PROPERTY(useCompanionNightlyBuilds, false)
BOOL_PROPERTY(useFirmwareNightlyBuilds, false)
// All the global variables
public:
Profile profile[MAX_PROFILES];
JStickData joystick[MAX_JOYSTICKS];
FwRevision fwRev;
private:
QStringList _recentFiles;
QByteArray _mainWinGeo;
QByteArray _mainWinState;
QByteArray _modelEditGeo;
QString _armMcu;
QString _avrArguments;
QString _avrPort;
QString _avrdudeLocation;
QString _dfuArguments;
QString _dfuLocation;
QString _locale;
QString _mcu;
QString _programmer;
QString _sambaLocation;
QString _sambaPort;
QString _lastSimulator;
QString _backupDir;
QString _gePath;
QString _eepromDir;
QString _flashDir;
QString _imagesDir;
QString _logDir;
QString _libDir;
QString _snapshotDir;
QString _updatesDir;
bool _maximized;
bool _jsSupport;
bool _showSplash;
bool _snapToClpbrd;
bool _autoCheckApp;
bool _autoCheckFw;
bool _simuSW;
bool _useWizard;
int _backLight;
int _embedSplashes;
int _fwServerFails;
int _generalEditTab;
int _iconSize;
int _jsCtrl;
int _historySize;
int _id;
int _theme;
int _warningId;
public:
// All the get definitions
QStringList recentFiles();
QByteArray mainWinGeo();
QByteArray mainWinState();
QByteArray modelEditGeo();
QString armMcu();
QString avrArguments();
QString avrPort();
QString avrdudeLocation();
QString dfuArguments();
QString dfuLocation();
QString lastFw();
QString locale();
QString mcu();
QString programmer();
QString sambaLocation();
QString sambaPort();
QString lastSimulator();
QString backupDir();
QString gePath();
QString eepromDir();
QString flashDir();
QString imagesDir();
QString logDir();
QString libDir();
QString snapshotDir();
QString updatesDir();
bool jsSupport();
bool maximized();
bool showSplash();
bool snapToClpbrd();
bool autoCheckApp();
bool autoCheckFw();
bool simuSW();
bool useWizard();
int backLight();
int embedSplashes();
int fwServerFails();
int generalEditTab();
int iconSize();
int historySize();
int jsCtrl();
int id();
int theme();
int warningId();
// All the set definitions
void recentFiles (const QStringList x);
void mainWinGeo (const QByteArray);
void mainWinState (const QByteArray);
void modelEditGeo (const QByteArray);
void armMcu (const QString);
void avrArguments (const QString);
void avrPort (const QString);
void avrdudeLocation (const QString);
void dfuArguments (const QString);
void dfuLocation (const QString);
void lastFw (const QString);
void locale (const QString);
void mcu (const QString);
void programmer (const QString);
void sambaLocation (const QString);
void sambaPort (const QString);
void lastSimulator (const QString);
void backupDir (const QString);
void gePath (const QString);
void eepromDir (const QString);
void flashDir (const QString);
void imagesDir (const QString);
void logDir (const QString);
void libDir (const QString);
void snapshotDir (const QString);
void updatesDir (const QString);
void maximized (const bool);
void jsSupport (const bool);
void showSplash (const bool);
void snapToClpbrd (const bool);
void autoCheckApp (const bool);
void autoCheckFw (const bool);
void simuSW (const bool);
void useWizard (const bool);
void backLight (const int);
void embedSplashes (const int);
void fwServerFails (const int);
void generalEditTab (const int);
void iconSize (const int);
void historySize (const int);
void jsCtrl (const int);
void modelEditTab (const int);
void id (const int);
void theme (const int);
void warningId (const int);
// Constructor
AppData();
void init();
};
extern AppData g;
#endif // COMPANION_APPDATA_H
+163
View File
@@ -0,0 +1,163 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "appdebugmessagehandler.h"
#include <QFileDevice>
AppDebugMessageHandler::AppDebugMessageHandler(QObject * parent) :
QObject(parent),
m_appDebugOutputLevel(APP_DBG_HANDLER_DEFAULT_LEVEL),
m_showSourcePath(APP_DBG_HANDLER_SHOW_SRC_PATH),
m_showFunctionDeclarations(APP_DBG_HANDLER_SHOW_FUNCTION_DECL)
{
m_srcPathFilter = QRegularExpression("^" APP_DBG_HANDLER_SRC_PATH "[\\\\\\/](.*?)$", QRegularExpression::InvertedGreedinessOption);
m_functionFilter = QRegularExpression("^.+?(\\w+\\().+$");
}
AppDebugMessageHandler * AppDebugMessageHandler::instance()
{
static AppDebugMessageHandler * _instance = NULL;
#if APP_DBG_HANDLER_ENABLE
if(_instance == NULL && !qApp->closingDown())
_instance = new AppDebugMessageHandler(qApp); // Ensure this object is cleaned up when the QApplication exits.
#endif
return _instance;
}
void AppDebugMessageHandler::setAppDebugOutputLevel(const quint8 & appDebugOutputLevel)
{
m_appDebugOutputLevel = appDebugOutputLevel;
}
void AppDebugMessageHandler::setShowSourcePath(bool showSourcePath)
{
m_showSourcePath = showSourcePath;
}
void AppDebugMessageHandler::setShowFunctionDeclarations(bool showFunctionDeclarations)
{
m_showFunctionDeclarations = showFunctionDeclarations;
}
void AppDebugMessageHandler::addOutputDevice(QIODevice * device)
{
if (device && !m_outputDevices.contains(device))
m_outputDevices.append(device);
}
void AppDebugMessageHandler::removeOutputDevice(QIODevice * device)
{
if (device) {
// no QVector::removeAll() in Qt < 5.4
int i = 0;
foreach (QIODevice * d, m_outputDevices) {
if (d == device)
m_outputDevices.remove(i);
++i;
}
}
}
void AppDebugMessageHandler::installAppMessageHandler()
{
m_defaultHandler = qInstallMessageHandler(g_appDebugMessageHandler);
}
void AppDebugMessageHandler::messageHandler(QtMsgType type, const QMessageLogContext & context, const QString & msg)
{
static const char symbols[] = { 'D', 'W', 'E', 'X', 'I' }; // correspond to QtMsgType enum
// normalize types, QtDebugMsg stays 0, QtInfoMsg becomes 1, rest are QtMsgType + 1
quint8 lvl = type;
if (type == QtInfoMsg)
lvl = 1;
else if (type > QtDebugMsg)
++lvl;
if (lvl < m_appDebugOutputLevel && type != QtFatalMsg)
return;
#if defined(Q_OS_LINUX) && (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
// Filter out lots of QPainter warnings from undocked QDockWidgets... hackish but effective (only workaround found so far)
if (lvl == 2 && QString(context.function).contains("QPainter::"))
return;
#endif
QString msgPattern = QString("[%1] ").arg(symbols[type]);
if (m_showSourcePath) {
QString file = QString("%1::").arg(context.file);
file.replace(m_srcPathFilter, "\\1");
msgPattern.append(file);
}
if (m_showFunctionDeclarations)
msgPattern.append(context.function);
else
msgPattern.append("%{function}()");
msgPattern.append(":%{line} -%{if-category} [%{category}]%{endif} %{message}");
if (type == QtFatalMsg)
msgPattern.append("\nBACKTRACE:\n%{backtrace depth=12 separator=\"\n\"}");
qSetMessagePattern(msgPattern);
if (!m_defaultHandler || m_outputDevices.size() || receivers(SIGNAL(messageOutput(quint8, const QString &)))) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
msgPattern = qFormatLogMessage(type, context, msg);
#else
msgPattern.replace("%{line}", QString::number(context.line));
msgPattern.replace("%{if-category} [%{category}]%{endif}", QString(context.category));
msgPattern.replace("%{message}", msg);
if (!m_showFunctionDeclarations) {
QString func = context.function;
msgPattern.replace("%{function}", func.replace(m_functionFilter, "\\1)"));
}
#endif
emit messageOutput(lvl, msgPattern);
foreach (QIODevice * d, m_outputDevices) {
if (d && d->isWritable() && (!d->property("level").isValid() || d->property("level").toInt() <= lvl)) {
d->write(qPrintable(msgPattern % "\n"));
if (QFileDevice * fd = qobject_cast<QFileDevice *>(d))
fd->flush();
}
}
}
// if (QThread::currentThread() == qApp->thread()) // gui thread
if (m_defaultHandler) {
m_defaultHandler(type, context, msg);
}
else {
fprintf(stderr, "%s", qPrintable(msgPattern));
if (type == QtFatalMsg)
abort();
}
}
// Message handler which is installed using qInstallMessageHandler. This needs to be global.
void g_appDebugMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
if (AppDebugMessageHandler::instance())
AppDebugMessageHandler::instance()->messageHandler(type, context, msg);
}
+142
View File
@@ -0,0 +1,142 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef APPDEBUGMESSAGEHANDLER_H
#define APPDEBUGMESSAGEHANDLER_H
#include <cstdlib>
#include <iostream>
#include <QApplication>
#include <QDebug>
#include <QIODevice>
#include <QMessageLogContext>
#include <QObject>
#include <QRegularExpression>
#include <QString>
/*
* Custom debug/message handler class to work in conjunction with qDebug() family of functions.
* Formats all stderr output generated by the application in a consistent manner.
* It can also be used by other event listeners to intercept messages they may be interested in (connect to messageOutput() signal).
*
* Include this header to use qInfo() safely with Qt < v5.5 (qInfo becomes alias for qDebug).
*
* Note that the default message format can still be overriden by setting QT_MESSAGE_PATTERN environment variable at _runtime_.
* see: https://doc.qt.io/qt-5/qtglobal.html#qSetMessagePattern
*
* This is an app-wide "global" thread-safe singleton class, use it with AppDebugMessageHandler::instance().
* For example, at start of application:
*
* QApplication app(argc, argv);
* AppDebugMessageHandler::instance()->installAppMessageHandler();
*
* To connect to a signal:
*
* connect(AppDebugMessageHandler::instance(), &AppDebugMessageHandler::messageOutput, this, &DebugOutput::onAppDebugMessage);
*
* This singleton will self-destruct upon QApplication termination.
*
*/
#if defined(QT_DEBUG) || defined(DEBUG)
#define APP_DBG_HANDLER_IS_DBG_BUILD 1
#else
#define APP_DBG_HANDLER_IS_DBG_BUILD 0
#endif
// Enable/disable this custom handler handler entirely
#ifndef APP_DBG_HANDLER_ENABLE
#define APP_DBG_HANDLER_ENABLE 1
#endif
// Default log level (can also be set with setAppDebugOutputLevel()):
// 0 = debug+; 1 = info+; 2 = warn+; 3 = critical+; 4 = fatal only
#ifndef APP_DBG_HANDLER_DEFAULT_LEVEL
#define APP_DBG_HANDLER_DEFAULT_LEVEL 0
#endif
// Include source file path/name in output (filtered with APP_DBG_HANDLER_SRC_PATH)
#ifndef APP_DBG_HANDLER_SHOW_SRC_PATH
#define APP_DBG_HANDLER_SHOW_SRC_PATH APP_DBG_HANDLER_IS_DBG_BUILD
#endif
// Show just the function Class::name vs. full declaration with return and param types
#ifndef APP_DBG_HANDLER_SHOW_FUNCTION_DECL
#define APP_DBG_HANDLER_SHOW_FUNCTION_DECL 0
#endif
// base path for source file name filter, everything after this is kept; RegEx, non-greedy
#ifndef APP_DBG_HANDLER_SRC_PATH
#define APP_DBG_HANDLER_SRC_PATH ".*src"
#endif
// Make sure to include this header if using qInfo()
#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
#if defined(QT_NO_INFO_OUTPUT)
#define qInfo QT_NO_QDEBUG_MACRO
#else
#define qInfo qDebug
#endif
#define QtInfoMsg QtMsgType(4)
#endif
class AppDebugMessageHandler : public QObject
{
Q_OBJECT
public:
// This class implements the singleton design pattern and is therefore publicly accessible only through instance().
static AppDebugMessageHandler * instance();
AppDebugMessageHandler(AppDebugMessageHandler const &) = delete;
void operator = (AppDebugMessageHandler const &) = delete;
void setAppDebugOutputLevel(const quint8 & appDebugOutputLevel);
void setShowSourcePath(bool showSourcePath);
void setShowFunctionDeclarations(bool showFunctionDeclarations);
void addOutputDevice(QIODevice * device);
void removeOutputDevice(QIODevice * device);
void installAppMessageHandler();
void messageHandler(QtMsgType type, const QMessageLogContext & context, const QString & msg);
private:
// This class implements the singleton design pattern and therefore has only a private constructor.
explicit AppDebugMessageHandler(QObject * parent = Q_NULLPTR);
~AppDebugMessageHandler() { }
QtMessageHandler m_defaultHandler;
QRegularExpression m_srcPathFilter;
QRegularExpression m_functionFilter;
quint8 m_appDebugOutputLevel;
QVector<QIODevice *> m_outputDevices;
bool m_showSourcePath;
bool m_showFunctionDeclarations;
signals:
void messageOutput(quint8 level, const QString & msg);
};
// Message handler which is installed using qInstallMessageHandler. This needs to be global.
// Use AppDebugMessageHandler::instance()->installAppMessageHandler();
// instead of installing this function directly (it will verify this handler is enabled, etc).
void g_appDebugMessageHandler(QtMsgType, const QMessageLogContext &, const QString &);
#endif // APPDEBUGMESSAGEHANDLER_H
+245 -207
View File
@@ -1,29 +1,49 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "apppreferencesdialog.h"
#include "ui_apppreferencesdialog.h"
#include "mainwindow.h"
#include "appdata.h"
#include "helpers.h"
#include "firmwareinterface.h"
#ifdef JOYSTICKS
#include "storage.h"
#if defined(JOYSTICKS)
#include "joystick.h"
#include "joystickdialog.h"
#endif
#include <QDesktopServices>
#include <QtGui>
AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) :
QDialog(parent),
ui(new Ui::AppPreferencesDialog)
ui(new Ui::AppPreferencesDialog),
updateLock(false),
mainWinHasDirtyChild(false)
{
ui->setupUi(this);
updateLock=false;
setWindowIcon(CompanionIcon("apppreferences.png"));
initSettings();
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(onBaseFirmwareChanged()));
connect(ui->opt_appDebugLog, &QCheckBox::toggled, this, &AppPreferencesDialog::toggleAppLogSettings);
connect(ui->opt_fwTraceLog, &QCheckBox::toggled, this, &AppPreferencesDialog::toggleAppLogSettings);
#ifndef JOYSTICKS
#if !defined(JOYSTICKS)
ui->joystickCB->hide();
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->hide();
@@ -39,59 +59,98 @@ AppPreferencesDialog::~AppPreferencesDialog()
delete ui;
}
void AppPreferencesDialog::writeValues()
void AppPreferencesDialog::setMainWinHasDirtyChild(bool value)
{
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
mainWinHasDirtyChild = value;
}
void AppPreferencesDialog::accept()
{
Profile & profile = g.currentProfile();
g.autoCheckApp(ui->autoCheckCompanion->isChecked());
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked());
g.OpenTxBranch(AppData::DownloadBranchType(ui->OpenTxBranch->currentIndex()));
g.autoCheckFw(ui->autoCheckFirmware->isChecked());
g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked());
g.useWizard(ui->modelWizard_CB->isChecked());
g.removeModelSlots(ui->opt_removeBlankSlots->isChecked());
g.newModelAction(ui->opt_newMdl_useWizard->isChecked() ? AppData::MODEL_ACT_WIZARD : ui->opt_newMdl_useEditor->isChecked() ? AppData::MODEL_ACT_EDITOR : AppData::MODEL_ACT_NONE);
g.historySize(ui->historySize->value());
g.backLight(ui->backLightColor->currentIndex());
g.profile[g.id()].volumeGain(round(ui->volumeGain->value() * 10.0));
profile.volumeGain(round(ui->volumeGain->value() * 10.0));
g.libDir(ui->libraryPath->text());
g.gePath(ui->ge_lineedit->text());
g.embedSplashes(ui->splashincludeCB->currentIndex());
g.enableBackup(ui->backupEnable->isChecked());
g.appDebugLog(ui->opt_appDebugLog->isChecked());
g.fwTraceLog(ui->opt_fwTraceLog->isChecked());
g.appLogsDir(ui->appLogsDir->text());
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsCtrl(ui->joystickCB ->currentIndex());
}
else {
g.jsSupport(false);
g.jsCtrl(0);
}
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
g.profile[g.id()].sdPath(ui->sdPath->text());
g.profile[g.id()].pBackupDir(ui->profilebackupPath->text());
g.profile[g.id()].penableBackup(ui->pbackupEnable->isChecked());
g.profile[g.id()].splashFile(ui->SplashFileName->text());
profile.channelOrder(ui->channelorderCB->currentIndex());
profile.defaultMode(ui->stickmodeCB->currentIndex());
profile.renameFwFiles(ui->renameFirmware->isChecked());
profile.burnFirmware(ui->burnFirmware->isChecked());
profile.sdPath(ui->sdPath->text());
profile.pBackupDir(ui->profilebackupPath->text());
profile.penableBackup(ui->pbackupEnable->isChecked());
profile.splashFile(ui->SplashFileName->text());
// The profile name may NEVER be empty
if (ui->profileNameLE->text().isEmpty())
g.profile[g.id()].name(tr("My Radio"));
profile.name(tr("My Radio"));
else
g.profile[g.id()].name(ui->profileNameLE->text());
profile.name(ui->profileNameLE->text());
bool fwchange = false;
Firmware * newFw = getFirmwareVariant(); // always !null
// If a new fw type has been choosen, several things need to reset
current_firmware_variant = getFirmwareVariant();
QString id = current_firmware_variant->getId();
if (g.profile[g.id()].fwType() != id) {
g.profile[g.id()].fwName("");
g.profile[g.id()].initFwVariables();
g.profile[g.id()].fwType(id);
if (Firmware::getCurrentVariant()->getId() != newFw->getId()) {
// check if we're going to be converting to a new radio type and there are unsaved files in the main window
if (mainWinHasDirtyChild && !Boards::isBoardCompatible(Firmware::getCurrentVariant()->getBoard(), newFw->getBoard())) {
QString q = tr("<p><b>You cannot switch Radio Type or change Build Options while there are unsaved file changes. What do you wish to do?</b></p> <ul>" \
"<li><i>Save All</i> - Save any open file(s) before saving Settings.<li>" \
"<li><i>Reset</i> - Revert to the previous Radio Type and Build Options before saving Settings.</li>" \
"<li><i>Cancel</i> - Return to the Settings editor dialog.</li></ul>");
int resp = QMessageBox::question(this, windowTitle(), q, (QMessageBox::SaveAll | QMessageBox::Reset | QMessageBox::Cancel), QMessageBox::Cancel);
if (resp == QMessageBox::SaveAll) {
// signal main window to save files, need to do this before the fw actually changes
emit firmwareProfileAboutToChange();
}
else if (resp == QMessageBox::Reset) {
// bail out early before saving the radio type & firmware options
QDialog::accept();
return;
}
else {
// we do not accept the dialog close
return;
}
}
Firmware::setCurrentVariant(newFw);
profile.fwName("");
profile.resetFwVariables();
profile.fwType(newFw->getId());
fwchange = true;
}
QDialog::accept();
if (fwchange)
emit firmwareProfileChanged(); // important to do this after the accepted() signal
}
void AppPreferencesDialog::on_snapshotPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
QString fileName = QFileDialog::getExistingDirectory(this, tr("Select your snapshot folder"), g.snapshotDir());
if (!fileName.isEmpty()) {
g.snapshotDir(fileName);
g.snapToClpbrd(false);
@@ -101,34 +160,43 @@ void AppPreferencesDialog::on_snapshotPathButton_clicked()
void AppPreferencesDialog::initSettings()
{
const Profile & profile = g.currentProfile();
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
ui->burnFirmware->setChecked(profile.burnFirmware());
ui->snapshotPath->setText(g.snapshotDir());
ui->snapshotPath->setReadOnly(true);
if (ui->snapshotClipboardCKB->isChecked()) {
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
#if defined(ALLOW_NIGHTLY_BUILDS)
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
#else
ui->useCompanionNightlyBuilds->hide();
ui->useFirmwareNightlyBuilds->hide();
#if !defined(ALLOW_NIGHTLY_BUILDS)
// remove nightly version option entirely unless it's the current one (because user might have nightly version also installed)
if (g.OpenTxBranch() != AppData::BRANCH_NIGHTLY_UNSTABLE)
ui->OpenTxBranch->removeItem(2);
// if it's already selected, add a warning message
else
ui->updatesLayout->addWidget(new QLabel("<font color='red'>" % tr("Note: Nightly builds are not available in this version, Release/RC update channel will be used.") % "</font>", this));
#endif
ui->OpenTxBranch->setCurrentIndex(g.OpenTxBranch());
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
ui->showSplash->setChecked(g.showSplash());
ui->historySize->setValue(g.historySize());
ui->backLightColor->setCurrentIndex(g.backLight());
ui->volumeGain->setValue(g.profile[g.id()].volumeGain() / 10.0);
ui->volumeGain->setValue(profile.volumeGain() / 10.0);
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
if (IS_TARANIS(getCurrentBoard())) {
ui->backLightColor->setEnabled(false);
}
ui->simuSW->setChecked(g.simuSW());
ui->modelWizard_CB->setChecked(g.useWizard());
ui->opt_removeBlankSlots->setChecked(g.removeModelSlots());
ui->opt_newMdl_useNone->setChecked(g.newModelAction() == AppData::MODEL_ACT_NONE);
ui->opt_newMdl_useWizard->setChecked(g.newModelAction() == AppData::MODEL_ACT_WIZARD);
ui->opt_newMdl_useEditor->setChecked(g.newModelAction() == AppData::MODEL_ACT_EDITOR);
ui->libraryPath->setText(g.libDir());
ui->ge_lineedit->setText(g.gePath());
@@ -137,15 +205,22 @@ void AppPreferencesDialog::initSettings()
ui->backupPath->setText(g.backupDir());
ui->backupEnable->setEnabled(true);
ui->backupEnable->setChecked(g.enableBackup());
} else {
}
else {
ui->backupEnable->setDisabled(true);
}
} else {
ui->backupEnable->setDisabled(true);
}
else {
ui->backupEnable->setDisabled(true);
}
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
#ifdef JOYSTICKS
ui->opt_appDebugLog->setChecked(g.appDebugLog());
ui->opt_fwTraceLog->setChecked(g.fwTraceLog());
ui->appLogsDir->setText(g.appLogsDir());
toggleAppLogSettings();
#if defined(JOYSTICKS)
ui->joystickChkB->setChecked(g.jsSupport());
if (ui->joystickChkB->isChecked()) {
QStringList joystickNames;
@@ -171,35 +246,33 @@ void AppPreferencesDialog::initSettings()
ui->joystickCB->setDisabled(true);
ui->joystickcalButton->setDisabled(true);
}
#endif
// Profile Tab Inits
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
ui->sdPath->setText(g.profile[g.id()].sdPath());
if (!g.profile[g.id()].pBackupDir().isEmpty()) {
if (QDir(g.profile[g.id()].pBackupDir()).exists()) {
ui->profilebackupPath->setText(g.profile[g.id()].pBackupDir());
#endif
// Profile Tab Inits
ui->channelorderCB->setCurrentIndex(profile.channelOrder());
ui->stickmodeCB->setCurrentIndex(profile.defaultMode());
ui->renameFirmware->setChecked(profile.renameFwFiles());
ui->sdPath->setText(profile.sdPath());
if (!profile.pBackupDir().isEmpty()) {
if (QDir(profile.pBackupDir()).exists()) {
ui->profilebackupPath->setText(profile.pBackupDir());
ui->pbackupEnable->setEnabled(true);
ui->pbackupEnable->setChecked(g.profile[g.id()].penableBackup());
ui->pbackupEnable->setChecked(profile.penableBackup());
} else {
ui->pbackupEnable->setDisabled(true);
}
} else {
}
else {
ui->pbackupEnable->setDisabled(true);
}
ui->profileNameLE->setText(g.profile[g.id()].name());
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
displayImage( g.profile[g.id()].splashFile() );
ui->profileNameLE->setText(profile.name());
QString hwSettings;
if (g.profile[g.id()].stickPotCalib() == "" ) {
if (profile.stickPotCalib() == "" ) {
hwSettings = tr("EMPTY: No radio settings stored in profile");
}
else {
QString str = g.profile[g.id()].timeStamp();
QString str = profile.timeStamp();
if (str.isEmpty())
hwSettings = tr("AVAILABLE: Radio settings of unknown age");
else
@@ -207,16 +280,15 @@ void AppPreferencesDialog::initSettings()
}
ui->lblGeneralSettings->setText(hwSettings);
Firmware * current_firmware = GetCurrentFirmware();
foreach(Firmware * firmware, firmwares) {
QString currType = QStringList(profile.fwType().split('-').mid(0, 2)).join('-');
foreach(Firmware * firmware, Firmware::getRegisteredFirmwares()) {
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
if (current_firmware->getFirmwareBase() == firmware) {
if (currType == firmware->getId()) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
}
}
baseFirmwareChanged();
onBaseFirmwareChanged();
}
void AppPreferencesDialog::on_libraryPathButton_clicked()
@@ -262,6 +334,15 @@ void AppPreferencesDialog::on_ProfilebackupPathButton_clicked()
}
}
void AppPreferencesDialog::on_btn_appLogsDir_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this, tr("Select a folder for application logs"), ui->appLogsDir->text());
if (!fileName.isEmpty()) {
ui->appLogsDir->setText(fileName);
}
}
void AppPreferencesDialog::on_ge_pathButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
@@ -269,8 +350,8 @@ void AppPreferencesDialog::on_ge_pathButton_clicked()
ui->ge_lineedit->setText(fileName);
}
}
#ifdef JOYSTICKS
#if defined(JOYSTICKS)
void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) {
QStringList joystickNames;
@@ -307,41 +388,26 @@ void AppPreferencesDialog::on_joystickcalButton_clicked() {
void AppPreferencesDialog::on_sdPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath());
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.currentProfile().sdPath());
if (!fileName.isEmpty()) {
ui->sdPath->setText(fileName);
}
}
void AppPreferencesDialog::on_removeProfileButton_clicked()
bool AppPreferencesDialog::displayImage(const QString & fileName)
{
if ( g.id() == 0 ) {
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
}
else {
g.profile[g.id()].remove();
g.id( 0 );
initSettings();
}
}
// Start by clearing the label
ui->imageLabel->clear();
bool AppPreferencesDialog::displayImage( QString fileName )
{
// Start by clearing the pixmap
ui->imageLabel->setPixmap(QPixmap());
QImage image(fileName);
if (image.isNull())
if (fileName.isEmpty())
return false;
// Use the firmware name to determine splash width
int width = SPLASH_WIDTH;
if (g.profile[g.id()].fwType().contains("taranis"))
width = SPLASHX9D_WIDTH;
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
ui->imageLabel->setFixedSize(width, SPLASH_HEIGHT);
QImage image(fileName);
if (image.isNull())
return false;
ui->imageLabel->setPixmap(makePixMap(image));
ui->imageLabel->setFixedSize(getCurrentFirmware()->getCapability(LcdWidth), getCurrentFirmware()->getCapability(LcdHeight));
return true;
}
@@ -357,7 +423,7 @@ void AppPreferencesDialog::on_SplashSelect_clicked()
if (!fileName.isEmpty()){
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
displayImage(fileName);
ui->SplashFileName->setText(fileName);
}
@@ -369,154 +435,126 @@ void AppPreferencesDialog::on_clearImageButton_clicked()
ui->SplashFileName->clear();
}
void AppPreferencesDialog::showVoice(bool show)
void AppPreferencesDialog::onBaseFirmwareChanged()
{
ui->voiceLabel->setVisible(show);
ui->voiceCombo->setVisible(show);
QTimer::singleShot(0, this, SLOT(shrink()));
populateFirmwareOptions(getBaseFirmware());
}
void AppPreferencesDialog::baseFirmwareChanged()
Firmware *AppPreferencesDialog::getBaseFirmware() const
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(Firmware * firmware, firmwares) {
if (firmware->getId() == selected_firmware) {
populateFirmwareOptions(firmware);
break;
}
}
return Firmware::getFirmwareForId(ui->downloadVerCB->currentData().toString());
}
Firmware * AppPreferencesDialog::getFirmwareVariant()
Firmware * AppPreferencesDialog::getFirmwareVariant() const
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
QString id = ui->downloadVerCB->currentData().toString();
foreach(Firmware * firmware, firmwares) {
QString id = firmware->getId();
if (id == selected_firmware) {
foreach(QCheckBox *cb, optionsCheckBoxes) {
if (cb->isChecked()) {
id += QString("-") + cb->text();
}
}
if (voice && voice->isChecked()) {
id += QString("-tts") + ui->voiceCombo->currentText();
}
if (ui->langCombo->count()) {
id += QString("-") + ui->langCombo->currentText();
}
return GetFirmware(id);
}
foreach(QCheckBox *cb, optionsCheckBoxes.values()) {
if (cb->isChecked())
id += "-" + cb->text();
}
// Should never occur...
return default_firmware_variant;
if (ui->langCombo->count())
id += "-" + ui->langCombo->currentText();
return Firmware::getFirmwareForId(id);
}
void AppPreferencesDialog::firmwareOptionChanged(bool state)
void AppPreferencesDialog::onFirmwareOptionChanged(bool state)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
if (cb == voice) {
showVoice(voice->isChecked());
}
Firmware * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
if (firmware->getId() == selected_firmware) {
foreach(QList<Option> opts, firmware->opts) {
foreach(Option opt, opts) {
if (cb->text() == opt.name) {
foreach(Option other, opts) {
if (other.name != opt.name) {
foreach(QCheckBox *ocb, optionsCheckBoxes) {
if (ocb->text() == other.name) {
ocb->setChecked(false);
}
}
}
}
return;
}
}
}
if (!(cb && state))
return;
// This de-selects any mutually exlusive options (that is, members of the same QList<Option> list).
const Firmware::OptionsList & fwOpts = getBaseFirmware()->optionGroups();
for (const Firmware::OptionsGroup & optGrp : fwOpts) {
for (const Firmware::Option & opt : optGrp) {
if (cb->text() == opt.name) {
QCheckBox *ocb = nullptr;
foreach(const Firmware::Option & other, optGrp)
if (other.name != opt.name && (ocb = optionsCheckBoxes.value(other.name, nullptr)))
ocb->setChecked(false);
return;
}
}
}
}
}
void AppPreferencesDialog::toggleAppLogSettings()
{
bool vis = (ui->opt_appDebugLog->isChecked() || ui->opt_fwTraceLog->isChecked());
ui->appLogsDir->setVisible(vis);
ui->lbl_appLogsDir->setVisible(vis);
ui->btn_appLogsDir->setVisible(vis);
}
void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
{
const Firmware * parent = firmware->getFirmwareBase();
const Firmware * baseFw = firmware->getFirmwareBase();
QStringList currVariant = Firmware::getCurrentVariant()->getId().split('-');
const QString currLang = ui->langCombo->count() ? ui->langCombo->currentText() : currVariant.last();
updateLock = true;
QString id = current_firmware_variant->getId();
ui->langCombo->clear();
foreach(const char *lang, parent->languages) {
for (const char *lang : baseFw->languageList()) {
ui->langCombo->addItem(lang);
if (id.endsWith(lang)) {
if (currLang == lang) {
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
}
}
voice = NULL; // we will search for a voice checkbox
if (optionsCheckBoxes.size()) {
currVariant.clear();
QMutableMapIterator<QString, QCheckBox *> it(optionsCheckBoxes);
while (it.hasNext()) {
it.next();
QCheckBox * cb = it.value();
if (cb->isChecked())
currVariant.append(it.key()); // keep previous selections
ui->optionsLayout->removeWidget(cb);
cb->deleteLater();
it.remove();
}
}
int index = 0;
QWidget * prevFocus = ui->voiceCombo;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
QCheckBox * checkbox = new QCheckBox(ui->profileTab);
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
optionsCheckBoxes.push_back(checkbox);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
if (prevFocus) {
QWidget::setTabOrder(prevFocus, checkbox);
}
}
QCheckBox *cb = optionsCheckBoxes.at(index++);
if (cb) {
cb->show();
cb->setText(opt.name);
cb->setToolTip(opt.tooltip);
cb->setCheckState(id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
if (opt.name == QString("voice")) {
voice = cb;
}
prevFocus = cb;
}
QWidget * prevFocus = ui->langCombo;
for (const Firmware::OptionsGroup &optGrp : baseFw->optionGroups()) {
for (const Firmware::Option &opt : optGrp) {
QCheckBox * cb = new QCheckBox(ui->profileTab);
cb->setText(opt.name);
cb->setToolTip(opt.tooltip);
cb->setChecked(currVariant.contains(opt.name));
ui->optionsLayout->addWidget(cb, index / 4, index % 4);
QWidget::setTabOrder(prevFocus, cb);
// connect to duplicates check handler if this option is part of a group
if (optGrp.size() > 1)
connect(cb, &QCheckBox::toggled, this, &AppPreferencesDialog::onFirmwareOptionChanged);
optionsCheckBoxes.insert(opt.name, cb);
prevFocus = cb;
++index;
}
}
for (; index<optionsCheckBoxes.size(); index++) {
QCheckBox *cb = optionsCheckBoxes.at(index);
cb->hide();
cb->setCheckState(Qt::Unchecked);
// TODO: Remove once splash replacement supported on Horus
// NOTE: 480x272 image causes issues on screens <800px high, needs a solution like scrolling once reinstated
if (IS_HORUS(baseFw->getBoard())) {
ui->widget_splashImage->hide();
ui->SplashFileName->setText("");
}
ui->voiceCombo->clear();
foreach(const char *lang, parent->ttslanguages) {
ui->voiceCombo->addItem(lang);
if (id.contains(QString("-tts%1").arg(lang))) {
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
}
else {
ui->widget_splashImage->show();
ui->SplashFileName->setText(g.currentProfile().splashFile());
displayImage(g.currentProfile().splashFile());
}
showVoice(voice && voice->isChecked());
updateLock = false;
QTimer::singleShot(0, this, SLOT(shrink()));
QTimer::singleShot(50, this, &AppPreferencesDialog::shrink);
}
void AppPreferencesDialog::shrink()
{
resize(0,0);
adjustSize();
}
+51 -27
View File
@@ -1,5 +1,25 @@
#ifndef APPPREFERENCESDIALOG_H
#define APPPREFERENCESDIALOG_H
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _APPPREFERENCESDIALOG_H_
#define _APPPREFERENCESDIALOG_H_
#include <QDialog>
#include <QCheckBox>
@@ -16,49 +36,53 @@ class AppPreferencesDialog : public QDialog
Q_OBJECT
public:
explicit AppPreferencesDialog(QWidget *parent = 0);
explicit AppPreferencesDialog(QWidget * parent = 0);
~AppPreferencesDialog();
Joystick *joystick;
private:
QList<QCheckBox *> optionsCheckBoxes;
bool updateLock;
void showVoice(bool);
void showVoice();
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const Firmware *);
Firmware * getFirmwareVariant();
QCheckBox * voice;
Joystick * joystick;
Ui::AppPreferencesDialog *ui;
void initSettings();
bool displayImage( QString fileName );
void loadProfileString(QString profile, QString label);
void loadFromProfile();
public slots:
void accept() Q_DECL_OVERRIDE;
void setMainWinHasDirtyChild(bool value);
signals:
void firmwareProfileChanged();
void firmwareProfileAboutToChange(bool saveFiles = true);
protected slots:
void shrink();
void baseFirmwareChanged();
void firmwareOptionChanged(bool state);
void shrink();
void onBaseFirmwareChanged();
void onFirmwareOptionChanged(bool state);
void toggleAppLogSettings();
void writeValues();
void on_libraryPathButton_clicked();
void on_snapshotPathButton_clicked();
void on_snapshotClipboardCKB_clicked();
void on_backupPathButton_clicked();
void on_ProfilebackupPathButton_clicked();
void on_ge_pathButton_clicked();
void on_sdPathButton_clicked();
void on_removeProfileButton_clicked();
void on_SplashSelect_clicked();
void on_clearImageButton_clicked();
void on_btn_appLogsDir_clicked();
#ifdef JOYSTICKS
#if defined(JOYSTICKS)
void on_joystickChkB_clicked();
void on_joystickcalButton_clicked();
#endif
private:
void initSettings();
void populateFirmwareOptions(const Firmware *);
Firmware * getBaseFirmware() const;
Firmware * getFirmwareVariant() const;
bool displayImage(const QString & fileName);
Ui::AppPreferencesDialog *ui;
QMap<QString, QCheckBox *> optionsCheckBoxes;
bool updateLock;
bool mainWinHasDirtyChild;
};
#endif // APPPREFERENCESDIALOG_H
#endif // _APPPREFERENCESDIALOG_H_
File diff suppressed because it is too large Load Diff
+53 -16
View File
@@ -1,3 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "burnconfigdialog.h"
#include "ui_burnconfigdialog.h"
#include "eeprominterface.h"
@@ -6,7 +26,7 @@
#include "progressdialog.h"
#include "process_flash.h"
#if !defined WIN32 && defined __GNUC__
#if !defined _MSC_VER && defined __GNUC__
#include <unistd.h>
#endif
@@ -20,8 +40,8 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
getSettings();
populateProgrammers();
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_STM32(eepromInterface->getBoard())) {
Board::Type board = getCurrentBoard();
if (IS_STM32(board)) {
setWindowTitle(tr("DFU-UTIL Configuration"));
ui->avrArgs->hide();
ui->avrdude_location->hide();
@@ -37,10 +57,10 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
ui->label_sb1->hide();
ui->label_sb3->hide();
ui->samba_location->hide();
ui->samba_port->hide();
ui->samba_port->hide();
ui->sb_browse->hide();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
else if (IS_SKY9X(board)) {
setWindowTitle(tr("SAM-BA Configuration"));
ui->avrArgs->hide();
ui->avrdude_location->hide();
@@ -77,7 +97,7 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
ui->dfuArgs->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
connect(this,SIGNAL(accepted()),this,SLOT(putSettings()));
connect(this, SIGNAL(accepted()), this, SLOT(putSettings()));
}
burnConfigDialog::~burnConfigDialog()
@@ -85,6 +105,18 @@ burnConfigDialog::~burnConfigDialog()
delete ui;
}
QStringList burnConfigDialog::getAvrdudeArgs()
{
QStringList args = avrArgs;
if (!avrPort.isEmpty())
args << "-P" << avrPort;
#if defined(__APPLE__)
args << "-C" << QFileInfo(QApplication::applicationDirPath() + "/../Resources/avrdude.conf").absoluteFilePath();
#endif
return args;
}
void burnConfigDialog::getSettings()
{
avrLoc = g.avrdudeLocation();
@@ -100,11 +132,16 @@ void burnConfigDialog::getSettings()
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
#elif defined __APPLE__
if ( avrLoc.isEmpty())
avrLoc = "/usr/local/bin/avrdude";
avrLoc = QFileInfo(QApplication::applicationDirPath() + "/../Resources/avrdude").absoluteFilePath();
if ( sambaLoc.isEmpty())
sambaLoc = "/usr/local/bin/sam-ba";
if ( dfuLoc.isEmpty())
dfuLoc = QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath();
dfuLoc = QFileInfo(QApplication::applicationDirPath() + "/../Resources/dfu-util").absoluteFilePath();
#elif defined __FreeBSD__
if (avrLoc.isEmpty())
avrLoc = "/usr/local/bin/avrdude";
if (dfuLoc.isEmpty())
dfuLoc = "/usr/local/bin/dfu-util";
#else
if ( avrLoc.isEmpty())
avrLoc = "/usr/bin/avrdude";
@@ -144,7 +181,7 @@ void burnConfigDialog::getSettings()
ui->pushButton_3->setEnabled(true);
} else {
ui->pushButton_3->setDisabled(true);
}
}
}
void burnConfigDialog::putSettings()
@@ -308,30 +345,30 @@ void burnConfigDialog::on_pushButton_4_clicked()
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
{
EEPROMInterface *eepromInterface = GetEepromInterface();
Board::Type board = getCurrentBoard();
if (checked) {
if (IS_STM32(eepromInterface->getBoard())) {
if (IS_STM32(board)) {
ui->label_dfu2->show();
ui->dfuArgs->show();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
else if (IS_SKY9X(board)) {
ui->label_sb2->show();
ui->arm_mcu->show();
}
else {
ui->label_av3->show();
ui->avrdude_mcu->show();
QMessageBox::warning(this, tr("Companion"),
QMessageBox::warning(this, CPN_STR_APP_NAME,
tr("<b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent."),
QMessageBox::Ok);
}
}
else {
if (IS_STM32(eepromInterface->getBoard())) {
if (IS_STM32(board)) {
ui->label_dfu2->hide();
ui->dfuArgs->hide();
}
else if (IS_SKY9X(eepromInterface->getBoard())) {
else if (IS_SKY9X(board)) {
ui->label_sb2->hide();
ui->arm_mcu->hide();
}
@@ -346,7 +383,7 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
void burnConfigDialog::shrink()
{
resize(0,0);
resize(0, 0);
}
+24 -4
View File
@@ -1,5 +1,25 @@
#ifndef BURNCONFIGDIALOG_H_
#define BURNCONFIGDIALOG_H_
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _BURNCONFIGDIALOG_H_
#define _BURNCONFIGDIALOG_H_
#include <QtWidgets>
@@ -22,7 +42,7 @@ public:
QString getAVRDUDE() {return avrLoc;}
QString getSAMBA() {return sambaLoc;}
QString getDFU() {return dfuLoc;}
QStringList getAvrdudeArgs() { QStringList args = avrArgs; if (!avrPort.isEmpty()) args << "-P" << avrPort; return args; }
QStringList getAvrdudeArgs();
QStringList getDFUArgs() {return dfuArgs;}
QString getProgrammer() {return avrProgrammer;}
QString getMCU() {return avrMCU;}
@@ -70,4 +90,4 @@ private slots:
void putSettings();
};
#endif // BURNCONFIGDIALOG_H_
#endif // _BURNCONFIGDIALOG_H_
+285 -168
View File
@@ -1,168 +1,285 @@
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QApplication>
#include <QTranslator>
#include <QLocale>
#include <QString>
#include <QDir>
#include <QFileInfo>
#include <QSplashScreen>
#include <QThread>
#include <iostream>
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
#include <SDL.h>
#undef main
#endif
#include "mainwindow.h"
#include "version.h"
#include "eeprominterface.h"
#include "appdata.h"
#if defined WIN32 || !defined __GNUC__
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#endif
#ifdef __APPLE__
#include <QProxyStyle>
class MyProxyStyle : public QProxyStyle
{
public:
void polish ( QWidget * w ) {
QMenu* mn = dynamic_cast<QMenu*>(w);
QPushButton* pb = dynamic_cast<QPushButton*>(w);
if(!(mn || pb) && !w->testAttribute(Qt::WA_MacNormalSize))
w->setAttribute(Qt::WA_MacSmallSize);
}
};
#endif
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(companion);
QApplication app(argc, argv);
app.setApplicationName("OpenTX Companion");
app.setOrganizationName("OpenTX");
app.setOrganizationDomain("open-tx.org");
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
g.init();
QStringList strl = QApplication::arguments();
if (strl.contains("--version")) {
printf("%s\n", VERSION);
fflush(stdout);
exit(0);
}
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
QTranslator companionTranslator;
companionTranslator.load(":/companion_" + g.locale());
QTranslator qtTranslator;
qtTranslator.load((QString)"qt_" + g.locale().left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
#ifdef JOYSTICKS
sdlFlags |= SDL_INIT_JOYSTICK;
#endif
#ifdef SIMU_AUDIO
sdlFlags |= SDL_INIT_AUDIO;
#endif
if (SDL_Init(sdlFlags) < 0) {
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
}
#endif
registerEEpromInterfaces();
registerOpenTxFirmwares();
registerSimulators();
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
g.profile[g.id()].fwName("");
}
QString splashScreen;
splashScreen = ":/images/splash.png";
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
MainWindow *mainWin = new MainWindow();
if (g.showSplash()) {
splash->show();
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
}
else {
mainWin->show();
}
int result = app.exec();
delete splash;
delete mainWin;
unregisterSimulators();
unregisterOpenTxFirmwares();
unregisterEEpromInterfaces();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
#endif
return result;
}
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <QApplication>
#include <QDateTime>
#include <QDir>
#include <QFile>
#include <QMessageBox>
#include <QSplashScreen>
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
#include <SDL.h>
#undef main
#endif
#include "appdebugmessagehandler.h"
#include "customdebug.h"
#include "mainwindow.h"
#include "version.h"
#include "appdata.h"
#include "simulatorinterface.h"
#include "storage.h"
#include "translations.h"
#include "helpers.h"
#ifdef __APPLE__
#include <QProxyStyle>
class MyProxyStyle : public QProxyStyle
{
public:
void polish ( QWidget * w ) {
QMenu* mn = dynamic_cast<QMenu*>(w);
QPushButton* pb = dynamic_cast<QPushButton*>(w);
if(!(mn || pb) && !w->testAttribute(Qt::WA_MacNormalSize))
w->setAttribute(Qt::WA_MacSmallSize);
}
};
#endif
void importError()
{
QMessageBox::critical(nullptr, CPN_STR_APP_NAME, QCoreApplication::translate("Companion", "The saved settings could not be imported, please try again or continue with current settings."), QMessageBox::Ok, 0);
}
void checkSettingsImport(bool force = false)
{
QString previousVersion;
bool found;
if (!(found = g.findPreviousVersionSettings(&previousVersion))) {
found = QDir(CPN_SETTINGS_BACKUP_DIR).entryList(QStringList({"*.ini"}), QDir::Files).size() > 0;
}
if (!found && !force)
return;
const QString impFileBtn = QCoreApplication::translate("Companion", "Import from File");
const QString impPrevBtn = QCoreApplication::translate("Companion", "Import from v%1").arg(previousVersion);
const QString impNoneBtn = QCoreApplication::translate("Companion", "Do not import");
QString msg;
if (previousVersion.isEmpty()) {
if (found)
msg = QCoreApplication::translate("Companion", "We have found possible Companion settings backup file(s).\nDo you want to import settings from a file?");
else
msg = QCoreApplication::translate("Companion", "Import settings from a file, or start with current values.");
}
else {
msg = QCoreApplication::translate("Companion", "We have found existing settings for Companion version: %1.\nDo you want to import them?\n\n" \
"If you have a settings backup file, you may import that instead.").arg(previousVersion);
}
const int ret = QMessageBox::question(nullptr, CPN_STR_APP_NAME, msg, impNoneBtn, impFileBtn, (previousVersion.isEmpty() ? QString() : impPrevBtn), 0, 0);
if (!ret)
return;
// Import from previous version
if (ret == 2) {
if (!g.importSettings(previousVersion)) {
// very unlikely, but just in case of unexpected error, restart the import
importError();
checkSettingsImport();
}
return;
}
// Import from file
bool err = false;
QString impFile = CPN_SETTINGS_BACKUP_DIR;
impFile = QFileDialog::getOpenFileName(nullptr, QCoreApplication::translate("Companion", "Select %1:").arg(CPN_STR_APP_SETTINGS_FILES), impFile, CPN_STR_APP_SETTINGS_FILTER);
if (!impFile.isEmpty() && QFileInfo(impFile).isReadable()) {
QSettings fromSettings(impFile, QSettings::IniFormat);
if (g.importSettings(&fromSettings)) {
return;
}
else {
importError();
err = true;
}
}
// Restart the import prompt if user cancelled the file select dialog but we do have previous settings, or if we had a file import error.
if (err || !previousVersion.isEmpty())
checkSettingsImport();
}
void printHelpText()
{
printf(qPrintable(QString(APP_COMPANION % " v%s\n\n")), VERSION);
const char tmpl[] = " %s \t %s\n";
printf(tmpl, "--export", QCoreApplication::translate("Companion", "Save application settings to file...").toUtf8().constData());
printf(tmpl, "--import", QCoreApplication::translate("Companion", "Load application settings from file or previous version...").toUtf8().constData());
printf(tmpl, "--defaults", QCoreApplication::translate("Companion", "Reset ALL application settings to default and remove radio profiles...").toUtf8().constData());
printf(tmpl, "--quit ", QCoreApplication::translate("Companion", "Exit before settings initialization and application startup.").toUtf8().constData());
printf(tmpl, "--version", QCoreApplication::translate("Companion", "Print version number and exit.").toUtf8().constData());
printf(tmpl, "--help|-h", QCoreApplication::translate("Companion", "Print this help text.").toUtf8().constData());
fflush(stdout);
}
int main(int argc, char *argv[])
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
/* From doc: This attribute must be set before Q(Gui)Application is constructed. */
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
app.setApplicationName(APP_COMPANION);
app.setOrganizationName(COMPANY);
app.setOrganizationDomain(COMPANY_DOMAIN);
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
const QStringList args(QApplication::arguments());
if (args.contains("--help") || args.contains("-h") || args.contains("/?")) {
printHelpText();
exit(0);
}
if (args.contains("--version")) {
printf("%s\n", VERSION);
fflush(stdout);
exit(0);
}
Q_INIT_RESOURCE(companion);
if (AppDebugMessageHandler::instance())
AppDebugMessageHandler::instance()->installAppMessageHandler();
CustomDebug::setFilterRules();
// handle settings export/import/reset via CLI
bool doExport = args.contains("--export");
bool doImport = args.contains("--import");
bool doReset = args.contains("--defaults");
if (doExport)
Helpers::exportAppSettings();
if (doReset) {
char ok;
printf("%s [Y/N] ", QCoreApplication::translate("Companion", "Reset ALL application settings to default values and remove radio profiles, are you sure?").toUtf8().constData());
std::cin >> ok;
if (ok != 'Y' && ok != 'y')
exit(0);
if (!doExport) {
printf("%s [Y/N] ", QCoreApplication::translate("Companion", "Would you like to perform a backup first?").toUtf8().constData());
std::cin >> ok;
if (ok == 'Y' || ok == 'y')
Helpers::exportAppSettings();
}
g.resetAllSettings();
g.storeAllSettings();
std::cout << QCoreApplication::translate("Companion", "Application settings were reset and saved.").toUtf8().constData() << std::endl;
}
if (doImport)
checkSettingsImport(true);
// give option to quit before settings init
if (args.contains("--quit"))
exit(0);
// end CLI handling
if (!doImport && g.isFirstUse())
checkSettingsImport(false);
g.init();
QFile dbgLog;
if (AppDebugMessageHandler::instance() && g.appDebugLog() && !g.appLogsDir().isEmpty() && QDir().mkpath(g.appLogsDir())) {
QString fn = g.appLogsDir() % "/CompanionDebug_" % QDateTime::currentDateTime().toString("yy-MM-dd_HH-mm-ss") % ".log";
dbgLog.setFileName(fn);
if (dbgLog.open(QIODevice::WriteOnly | QIODevice::Text)) {
AppDebugMessageHandler::instance()->addOutputDevice(&dbgLog);
}
}
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
Translations::installTranslators();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
#ifdef JOYSTICKS
sdlFlags |= SDL_INIT_JOYSTICK;
#endif
#ifdef SIMU_AUDIO
sdlFlags |= SDL_INIT_AUDIO;
#endif
if (SDL_Init(sdlFlags) < 0) {
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
}
#endif
registerStorageFactories();
registerOpenTxFirmwares();
SimulatorLoader::registerSimulators();
Profile & profile = g.currentProfile();
if (profile.fwType().isEmpty()){
profile.fwType(Firmware::getDefaultVariant()->getId());
profile.fwName("");
}
QString splashScreen;
splashScreen = ":/images/splash.png";
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
Firmware::setCurrentVariant(Firmware::getFirmwareForId(g.profile[g.id()].fwType()));
MainWindow *mainWin = new MainWindow();
if (g.showSplash()) {
splash->show();
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
}
else {
mainWin->show();
}
int result = app.exec();
delete splash;
delete mainWin;
SimulatorLoader::unregisterSimulators();
unregisterOpenTxFirmwares();
unregisterStorageFactories();
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
SDL_Quit();
#endif
qDebug() << "COMPANION EXIT" << result;
if (dbgLog.isOpen()) {
AppDebugMessageHandler::instance()->removeOutputDevice(&dbgLog);
dbgLog.close();
}
return result;
}
+111 -24
View File
@@ -1,25 +1,78 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>images/customize.png</file>
<file>icon.png</file>
<file alias="icon.png">images/icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../releasenotes.txt</file>
<file>images/simulator/Horus/middle.png</file>
<file>images/simulator/Horus/left.png</file>
<file>images/simulator/Horus/right.png</file>
<file>images/simulator/Horus/top.png</file>
<file>images/simulator/Horus/bottom.png</file>
<file>images/simulator/Horus/led.png</file>
<file>images/simulator/Horus/border-right.png</file>
<file>images/simulator/Horus/left_btn1.png</file>
<file>images/simulator/Horus/left_btn2.png</file>
<file>images/simulator/Horus/left_scrnsht.png</file>
<file>images/simulator/Horus/right_btnU.png</file>
<file>images/simulator/Horus/right_btnL.png</file>
<file>images/simulator/Horus/right_btnD.png</file>
<file>images/simulator/Horus/right_btnR.png</file>
<file>images/simulator/Horus/right_ent.png</file>
<file>images/screenshot.png</file>
<file>images/splash.png</file>
<file>images/companion-title.png</file>
<file>images/maps.png</file>
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/taranison.png</file>
<file>images/simulator/icons/svg/arrow_click.svg</file>
<file>images/simulator/icons/svg/camera.svg</file>
<file>images/simulator/icons/svg/camera-active.svg</file>
<file>images/simulator/icons/svg/console.svg</file>
<file>images/simulator/icons/svg/console-active.svg</file>
<file>images/simulator/icons/svg/eraser.svg</file>
<file>images/simulator/icons/svg/eraser-active.svg</file>
<file>images/simulator/icons/svg/fixed_x.svg</file>
<file>images/simulator/icons/svg/fixed_x-on.svg</file>
<file>images/simulator/icons/svg/fixed_y.svg</file>
<file>images/simulator/icons/svg/fixed_y-on.svg</file>
<file>images/simulator/icons/svg/folder_open.svg</file>
<file>images/simulator/icons/svg/hold_x.svg</file>
<file>images/simulator/icons/svg/hold_x-on.svg</file>
<file>images/simulator/icons/svg/hold_y.svg</file>
<file>images/simulator/icons/svg/hold_y-on.svg</file>
<file>images/simulator/icons/svg/info.svg</file>
<file>images/simulator/icons/svg/info-active.svg</file>
<file>images/simulator/icons/svg/joystick_settings.svg</file>
<file>images/simulator/icons/svg/joystick_settings-active.svg</file>
<file>images/simulator/icons/svg/line_horiz.svg</file>
<file>images/simulator/icons/svg/mouse.svg</file>
<file>images/simulator/icons/svg/toggle_lock.svg</file>
<file>images/simulator/icons/svg/toggle_lock-on.svg</file>
<file>images/simulator/icons/svg/radio_outputs.svg</file>
<file>images/simulator/icons/svg/radio_outputs-active.svg</file>
<file>images/simulator/icons/svg/reload_script.svg</file>
<file>images/simulator/icons/svg/reload_script-active.svg</file>
<file>images/simulator/icons/svg/restart.svg</file>
<file>images/simulator/icons/svg/restart-active.svg</file>
<file>images/simulator/icons/svg/telemetry.svg</file>
<file>images/simulator/icons/svg/telemetry-active.svg</file>
<file>images/simulator/icons/svg/trainer.svg</file>
<file>images/simulator/icons/svg/trainer-active.svg</file>
<file>images/simulator/icons/svg/word_wrap.svg</file>
<file>images/simulator/icons/svg/word_wrap-on.svg</file>
<file>images/simulator/X12/middle.png</file>
<file>images/simulator/X12/left.png</file>
<file>images/simulator/X12/right.png</file>
<file>images/simulator/X12/top.png</file>
<file>images/simulator/X12/bottom.png</file>
<file>images/simulator/X12/led.png</file>
<file>images/simulator/X12/border-right.png</file>
<file>images/simulator/X12/left_btn1.png</file>
<file>images/simulator/X12/left_btn2.png</file>
<file>images/simulator/X12/left_scrnsht.png</file>
<file>images/simulator/X12/right_btnU.png</file>
<file>images/simulator/X12/right_btnL.png</file>
<file>images/simulator/X12/right_btnD.png</file>
<file>images/simulator/X12/right_btnR.png</file>
<file>images/simulator/X12/right_ent.png</file>
<file>images/simulator/X10/left.png</file>
<file>images/simulator/X10/right.png</file>
<file>images/simulator/X10/top.png</file>
<file>images/simulator/X10/bottom.png</file>
<file>images/simulator/X10/left_mdl.png</file>
<file>images/simulator/X10/left_page.png</file>
<file>images/simulator/X10/left_scrnsht.png</file>
<file>images/simulator/X10/left_rtn.png</file>
<file>images/simulator/X10/left_sys.png</file>
<file>images/simulator/X10/left_tele.png</file>
<file>images/simulator/X10/right_ent.png</file>
<file>images/simulator/9X/9xdb.png</file>
<file>images/simulator/9X/9xdl.png</file>
<file>images/simulator/9X/9xdr.png</file>
@@ -53,12 +106,6 @@
<file>images/simulator/9X/9xcursmin.png</file>
<file>images/simulator/9X/9xcursdown.png</file>
<file>images/simulator/9X/9xcursphoto.png</file>
<file>images/screenshot.png</file>
<file>images/splash.png</file>
<file>images/companion-title.png</file>
<file>images/maps.png</file>
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/simulator/Taranis/x9b0.png</file>
<file>images/simulator/Taranis/x9l0.png</file>
<file>images/simulator/Taranis/x9l1.png</file>
@@ -71,7 +118,36 @@
<file>images/simulator/Taranis/x9r3.png</file>
<file>images/simulator/Taranis/x9s0.png</file>
<file>images/simulator/Taranis/x9t0.png</file>
<file>images/taranison.png</file>
<file>images/simulator/X7/bottom.png</file>
<file>images/simulator/X7/left.png</file>
<file>images/simulator/X7/left_exit.png</file>
<file>images/simulator/X7/left_menu.png</file>
<file>images/simulator/X7/left_page.png</file>
<file>images/simulator/X7/left_scrnshot.png</file>
<file>images/simulator/X7/right.png</file>
<file>images/simulator/X7/right_ent.png</file>
<file>images/simulator/X7/top.png</file>
<file>images/simulator/X9E/bottom.png</file>
<file>images/simulator/X9E/left.png</file>
<file>images/simulator/X9E/left_exit.png</file>
<file>images/simulator/X9E/left_menu.png</file>
<file>images/simulator/X9E/left_page.png</file>
<file>images/simulator/X9E/left_scrnshot.png</file>
<file>images/simulator/X9E/right.png</file>
<file>images/simulator/X9E/right_enter.png</file>
<file>images/simulator/X9E/top.png</file>
<file>images/simulator/XLITE/bottom.png</file>
<file>images/simulator/XLITE/left.png</file>
<file>images/simulator/XLITE/left_scrnshot.png</file>
<file>images/simulator/XLITE/right.png</file>
<file>images/simulator/XLITE/right_ent.png</file>
<file>images/simulator/XLITE/top.png</file>
<file>images/simulator/XLITE/right_exit.png</file>
<file>images/simulator/XLITE/right_shift.png</file>
<file>images/simulator/XLITE/right_right.png</file>
<file>images/simulator/XLITE/right_left.png</file>
<file>images/simulator/XLITE/right_up.png</file>
<file>images/simulator/XLITE/right_down.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
@@ -169,6 +245,9 @@
<file>images/library/10702.png</file>
<file>images/library/10801.png</file>
<file>images/library/10802.png</file>
<file>themes/default/style.css</file>
<file>themes/default/style-osx.css</file>
<file>themes/default/modelprt.css</file>
<file>themes/monochrome/16/paintbrush.png</file>
<file>themes/monochrome/16/open.png</file>
<file>themes/monochrome/16/edit.png</file>
@@ -564,6 +643,7 @@
<file>themes/monoblue/16/contributors.png</file>
<file>themes/monoblue/16/stop.png</file>
<file>themes/monoblue/16/write_eeprom.png</file>
<file>themes/monoblue/16/sdsync.png</file>
<file>themes/monoblue/24/paintbrush.png</file>
<file>themes/monoblue/24/open.png</file>
<file>themes/monoblue/24/edit.png</file>
@@ -607,6 +687,7 @@
<file>themes/monoblue/24/contributors.png</file>
<file>themes/monoblue/24/stop.png</file>
<file>themes/monoblue/24/write_eeprom.png</file>
<file>themes/monoblue/24/sdsync.png</file>
<file>themes/monoblue/32/paintbrush.png</file>
<file>themes/monoblue/32/open.png</file>
<file>themes/monoblue/32/edit.png</file>
@@ -650,6 +731,7 @@
<file>themes/monoblue/32/contributors.png</file>
<file>themes/monoblue/32/stop.png</file>
<file>themes/monoblue/32/write_eeprom.png</file>
<file>themes/monoblue/32/sdsync.png</file>
<file>themes/monoblue/48/paintbrush.png</file>
<file>themes/monoblue/48/open.png</file>
<file>themes/monoblue/48/edit.png</file>
@@ -693,6 +775,7 @@
<file>themes/monoblue/48/contributors.png</file>
<file>themes/monoblue/48/stop.png</file>
<file>themes/monoblue/48/write_eeprom.png</file>
<file>themes/monoblue/48/sdsync.png</file>
<file>themes/monowhite/16/paintbrush.png</file>
<file>themes/monowhite/16/open.png</file>
<file>themes/monowhite/16/edit.png</file>
@@ -736,6 +819,7 @@
<file>themes/monowhite/16/contributors.png</file>
<file>themes/monowhite/16/stop.png</file>
<file>themes/monowhite/16/write_eeprom.png</file>
<file>themes/monowhite/16/sdsync.png</file>
<file>themes/monowhite/24/paintbrush.png</file>
<file>themes/monowhite/24/open.png</file>
<file>themes/monowhite/24/edit.png</file>
@@ -779,6 +863,7 @@
<file>themes/monowhite/24/contributors.png</file>
<file>themes/monowhite/24/stop.png</file>
<file>themes/monowhite/24/write_eeprom.png</file>
<file>themes/monowhite/24/sdsync.png</file>
<file>themes/monowhite/32/paintbrush.png</file>
<file>themes/monowhite/32/open.png</file>
<file>themes/monowhite/32/edit.png</file>
@@ -822,6 +907,7 @@
<file>themes/monowhite/32/contributors.png</file>
<file>themes/monowhite/32/stop.png</file>
<file>themes/monowhite/32/write_eeprom.png</file>
<file>themes/monowhite/32/sdsync.png</file>
<file>themes/monowhite/48/paintbrush.png</file>
<file>themes/monowhite/48/open.png</file>
<file>themes/monowhite/48/edit.png</file>
@@ -865,6 +951,7 @@
<file>themes/monowhite/48/contributors.png</file>
<file>themes/monowhite/48/stop.png</file>
<file>themes/monowhite/48/write_eeprom.png</file>
<file>themes/monowhite/48/sdsync.png</file>
<file>themes/yerico/16/paintbrush.png</file>
<file>themes/yerico/16/open.png</file>
<file>themes/yerico/16/edit.png</file>
+119 -62
View File
@@ -1,45 +1,66 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "comparedialog.h"
#include "ui_comparedialog.h"
#include "appdata.h"
#include "helpers.h"
#include "modelslist.h"
#include "styleeditdialog.h"
#include <QPrinter>
#include <QPrintDialog>
// #if !defined WIN32 && defined __GNUC__
// #include <unistd.h>
// #endif
class DragDropHeader {
public:
DragDropHeader():
general_settings(false),
models_count(0)
{
}
bool general_settings;
uint8_t models_count;
uint8_t models[C9X_MAX_MODELS];
};
//class DragDropHeader {
// public:
// DragDropHeader():
// general_settings(false),
// models_count(0)
// {
// }
// bool general_settings;
// uint8_t models_count;
// uint8_t models[CPN_MAX_MODELS];
//};
CompareDialog::CompareDialog(QWidget * parent, Firmware * firmware):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
multimodelprinter(firmware),
model1Valid(false),
model2Valid(false),
QDialog(parent, Qt::Window),
multimodelprinter(new MultiModelPrinter(firmware)),
ui(new Ui::CompareDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("compare.png"));
setAcceptDrops(true);
if (!g.compareWinGeo().isEmpty()) {
restoreGeometry(g.compareWinGeo());
}
}
//setDragDropOverwriteMode(true);
//setDropIndicatorShown(true);
// TODO scroll to top ... ui->textEdit->scrollToAnchor("1");
CompareDialog::~CompareDialog()
{
delete multimodelprinter;
delete ui;
}
void CompareDialog::dragMoveEvent(QDragMoveEvent * event)
{
if (event->mimeData()->hasFormat("application/x-companion")) {
if (event->mimeData()->hasFormat("application/x-companion-modeldata")) {
event->acceptProposedAction();
}
else {
@@ -49,8 +70,7 @@ void CompareDialog::dragMoveEvent(QDragMoveEvent * event)
void CompareDialog::dragEnterEvent(QDragEnterEvent * event)
{
// accept just text/uri-list mime format
if (event->mimeData()->hasFormat("application/x-companion")) {
if (event->mimeData()->hasFormat("application/x-companion-modeldata")) {
event->acceptProposedAction();
}
else {
@@ -63,55 +83,85 @@ void CompareDialog::dragLeaveEvent(QDragLeaveEvent * event)
event->accept();
}
bool CompareDialog::handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label)
bool CompareDialog::handleMimeData(const QMimeData * mimeData)
{
if (mimeData->hasFormat("application/x-companion")) {
QByteArray gmData = mimeData->data("application/x-companion");
DragDropHeader * header = (DragDropHeader *)gmData.data();
if (!header->general_settings) {
char * gData = gmData.data() + sizeof(DragDropHeader);
if (gData[0] == 'M') {
ModelData * modeltemp = (ModelData *)(gData + 1);
if (modeltemp->used) {
memcpy(&model, modeltemp, sizeof(ModelData));
QString name(model.name);
if (!name.isEmpty())
label->setText(name);
else
label->setText(tr("No name"));
return true;
}
}
}
QVector<ModelData> mList;
GeneralSettings gs;
if (!TreeModel::decodeMimeData(mimeData, &mList, &gs) || mList.isEmpty())
return false;
for (int i=0; i < mList.size(); ++i) {
GMData data;
data.model = mList[i];
data.gs = gs;
modelsList.append(data);
}
return false;
return true;
}
void CompareDialog::closeEvent(QCloseEvent * event)
{
g.compareWinGeo(saveGeometry());
}
void CompareDialog::dropEvent(QDropEvent *event)
{
QLabel * child = qobject_cast<QLabel*>(childAt(event->pos()));
if (!child) return;
if (child->objectName().contains("label_1")) {
model1Valid = handleDroppedModel(event->mimeData(), model1, ui->label_1);
}
else if (child->objectName().contains("label_2")) {
model2Valid = handleDroppedModel(event->mimeData(), model2, ui->label_2);
}
event->accept();
if (model1Valid && model2Valid) {
multimodelprinter.setModel(0, model1);
multimodelprinter.setModel(1, model2);
ui->textEdit->setHtml(multimodelprinter.print(ui->textEdit->document()));
if (handleMimeData(event->mimeData())) {
event->accept();
compare();
}
}
void CompareDialog::closeEvent(QCloseEvent *event)
void CompareDialog::compare()
{
QLayoutItem *child;
while ((child = ui->layout_modelNames->takeAt(0))) {
if (child->widget())
delete child->widget();
delete child;
}
multimodelprinter->clearModels();
ui->textEdit->clear();
for (int i=0; i < modelsList.size(); ++i) {
multimodelprinter->setModel(i, &modelsList[i].model, &modelsList[i].gs);
QString name(modelsList.at(i).model.name);
if (name.isEmpty())
name = tr("Unnamed Model %1").arg(i+1);
QWidget * hdr = new QWidget(this);
hdr->setLayout(new QHBoxLayout());
hdr->layout()->setContentsMargins(0, 0, 0, 0);
hdr->layout()->setSpacing(2);
QToolButton * btn = new QToolButton(hdr);
btn->setIcon(CompanionIcon("clear.png"));
btn->setProperty("index", i);
btn->setFixedSize(18, 18);
btn->setToolTip(tr("Click to remove this model."));
hdr->layout()->addWidget(btn);
QLabel * lbl = new QLabel(name, this);
lbl->setStyleSheet("font-weight: bold;");
hdr->layout()->addWidget(lbl);
connect(btn, &QToolButton::clicked, this, &CompareDialog::removeModelBtnClicked);
ui->layout_modelNames->addWidget(hdr);
}
if (modelsList.size())
ui->textEdit->setHtml(multimodelprinter->print(ui->textEdit->document()));
}
CompareDialog::~CompareDialog()
void CompareDialog::removeModel(int idx)
{
delete ui;
if (idx < modelsList.size()) {
modelsList.remove(idx);
compare();
}
}
void CompareDialog::removeModelBtnClicked()
{
if (sender() && sender()->property("index").isValid())
removeModel(sender()->property("index").toInt());
}
void CompareDialog::on_printButton_clicked()
@@ -140,3 +190,10 @@ void CompareDialog::on_printFileButton_clicked()
ui->textEdit->print(&printer);
}
}
void CompareDialog::on_styleButton_clicked()
{
StyleEditDialog *g = new StyleEditDialog(this, MODEL_PRINT_CSS);
if (g->exec() == QDialog::Accepted)
compare();
}
+67 -41
View File
@@ -1,41 +1,67 @@
#ifndef _COMPAREDIALOG_H
#define _COMPAREDIALOG_H
#include <QtWidgets>
#include "multimodelprinter.h"
namespace Ui {
class CompareDialog;
}
class CompareDialog : public QDialog
{
Q_OBJECT
public:
CompareDialog(QWidget *parent, Firmware * firmware);
~CompareDialog();
protected:
MultiModelPrinter multimodelprinter;
ModelData model1;
ModelData model2;
bool model1Valid;
bool model2Valid;
Ui::CompareDialog * ui;
protected slots:
void on_printButton_clicked();
void on_printFileButton_clicked();
protected:
void closeEvent(QCloseEvent * event);
bool handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label);
void dropEvent(QDropEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void printDiff();
};
#endif // _COMPAREDIALOG_H
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _COMPAREDIALOG_H_
#define _COMPAREDIALOG_H_
#include <QtWidgets>
#include "multimodelprinter.h"
namespace Ui {
class CompareDialog;
}
class CompareDialog : public QDialog
{
Q_OBJECT
public:
CompareDialog(QWidget *parent, Firmware * firmware);
~CompareDialog();
protected:
struct GMData {
ModelData model;
GeneralSettings gs;
};
MultiModelPrinter * multimodelprinter;
QVector<GMData> modelsList;
QMap<int, GMData> modelsMap;
Ui::CompareDialog * ui;
protected slots:
void removeModelBtnClicked();
void on_printButton_clicked();
void on_printFileButton_clicked();
void on_styleButton_clicked();
protected:
virtual void closeEvent(QCloseEvent * event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event);
bool handleMimeData(const QMimeData * mimeData);
void compare();
void removeModel(int idx);
};
#endif // _COMPAREDIALOG_H_
+39 -53
View File
@@ -29,63 +29,25 @@
<string>Compare Models</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_1">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color:green;</string>
</property>
<property name="text">
<string>Drag first model here</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color:red;</string>
</property>
<property name="text">
<string>Drag second model here</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QTextEdit" name="textEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>To compare models, drag and drop them anywhere in this window.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -106,6 +68,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="styleButton">
<property name="text">
<string>Style</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="printButton">
<property name="text">
@@ -122,11 +91,28 @@
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="layout_modelNames">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="companion.qrc"/>
</resources>
<resources/>
<connections>
<connection>
<sender>closeButton</sender>
+80 -38
View File
@@ -1,41 +1,83 @@
#ifndef _constants_h_
#define _constants_h_
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
enum BoardEnum {
BOARD_STOCK,
BOARD_M128,
BOARD_MEGA2560,
BOARD_GRUVIN9X,
BOARD_SKY9X,
BOARD_9XRPRO,
BOARD_AR9X,
BOARD_TARANIS,
BOARD_TARANIS_PLUS,
BOARD_TARANIS_X9E,
BOARD_FLAMENCO,
BOARD_HORUS
};
#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_
#define C9X_MAX_MODELS 60
#define C9X_MAX_TIMERS 3
#define C9X_MAX_FLIGHT_MODES 9
#define C9X_MAX_MIXERS 64
#define C9X_MAX_INPUTS 32
#define C9X_MAX_EXPOS 64
#define C9X_MAX_CURVES 32
#define C9X_MAX_POINTS 17
#define C9X_MAX_GVARS 9
#define C9X_MAX_ENCODERS 2
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 64 // number of custom switches
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
#define C9X_NUM_MODULES 2
#define NUM_STICKS 4
#define BOARD_9X_NUM_POTS 3
#define C9X_NUM_POTS 8
#define NUM_CAL_PPM 4
#define NUM_CYC 3
#define C9X_NUM_SWITCHES 32
#define C9X_NUM_KEYS 32
#include <QCoreApplication>
#endif
#define CPN_MAX_MODELS 60
#define CPN_MAX_TIMERS 3
#define CPN_MAX_FLIGHT_MODES 9
#define CPN_MAX_MIXERS 64
#define CPN_MAX_INPUTS 32
#define CPN_MAX_EXPOS 64
#define CPN_MAX_CURVES 32
#define CPN_MAX_POINTS 17
#define CPN_MAX_GVARS 9
#define CPN_MAX_ENCODERS 2 // rotary encoders
#define CPN_MAX_CHNOUT 32 // number of real output channels
#define CPN_MAX_LOGICAL_SWITCHES 64 // number of custom switches
#define CPN_MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
#define CPN_MAX_MODULES 2
#define CPN_MAX_STICKS Board::STICK_AXIS_COUNT
#define CPN_MAX_TRIMS Board::TRIM_AXIS_COUNT
#define CPN_MAX_TRIM_SW Board::TRIM_SW_COUNT
#define CPN_MAX_KNOBS 4
#define CPN_MAX_SLIDERS 4
#define CPN_MAX_POTS (CPN_MAX_KNOBS + CPN_MAX_SLIDERS)
#define CPN_MAX_CYC 3
#define CPN_MAX_SWITCHES 32
#define CPN_MAX_KEYS 32
#define CPN_MAX_MOUSE_ANALOGS 2
#define CPN_MAX_ANALOGS (CPN_MAX_STICKS + CPN_MAX_POTS + CPN_MAX_MOUSE_ANALOGS)
#define CPN_STR_APP_NAME QCoreApplication::translate("Companion", "OpenTX Companion")
#define CPN_STR_TTL_INFO QCoreApplication::translate("Companion", "Information") // shared Title Case words, eg. for a window title or section heading
#define CPN_STR_TTL_WARNING QCoreApplication::translate("Companion", "Warning")
#define CPN_STR_TTL_ERROR QCoreApplication::translate("Companion", "Error")
#define CPN_STR_TTL_CONFIRM QCoreApplication::translate("Companion", "Please Confirm")
#define CPN_STR_FILES QCoreApplication::translate("Companion", "files")
#define CPN_STR_RAD_MOD_SETTINGS QCoreApplication::translate("Companion", "Radio and Models settings")
#define HEX_FILES_FILTER "HEX " % CPN_STR_FILES % " (*.hex);;"
#define BIN_FILES_FILTER "BIN " % CPN_STR_FILES % " (*.bin);;"
#define DFU_FILES_FILTER "DFU " % CPN_STR_FILES % " (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE " % CPN_STR_FILES % " (*.eepe);;"
#define OTX_FILES_FILTER "OpenTX " % CPN_STR_FILES % " (*.otx);;"
#define EEPROM_FILES_FILTER CPN_STR_RAD_MOD_SETTINGS % " " % CPN_STR_FILES % " (*.otx *.eepe *.bin *.hex);;" % OTX_FILES_FILTER % EEPE_FILES_FILTER % BIN_FILES_FILTER % HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH " % CPN_STR_FILES % " (*.bin *.hex *.dfu);;" % BIN_FILES_FILTER % HEX_FILES_FILTER % DFU_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM " % CPN_STR_FILES % " (*.bin *.hex);;" % BIN_FILES_FILTER % HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
#define CPN_STR_APP_SETTINGS QCoreApplication::translate("Companion", "Application Settings")
#define CPN_STR_APP_SETTINGS_FILES CPN_STR_APP_SETTINGS % " " % CPN_STR_FILES
#define CPN_STR_APP_SETTINGS_FILTER CPN_STR_APP_SETTINGS_FILES % " (*.ini)"
#define CPN_STR_UNKNOWN_ITEM "???"
#define CPN_STR_SW_INDICATOR_UP QCoreApplication::translate("RawSwitch", "\xE2\x86\x91") // Switch up position indicator: Up arrow, or similar.
#define CPN_STR_SW_INDICATOR_DN QCoreApplication::translate("RawSwitch", "\xE2\x86\x93") // Switch down position indicator: Down arrow, or similar.
#define CPN_STR_SW_INDICATOR_NEUT QCoreApplication::translate("RawSwitch", "-") // Switch neutral (middle) position indicator.
#define CPN_STR_SW_INDICATOR_REV QCoreApplication::translate("RawSwitch", "!") // Switch reversed logic (NOT) indicator.
#endif // _CONSTANTS_H_
-23
View File
@@ -1,23 +0,0 @@
#ifndef CONTRIBUTORSDIALOG_H
#define CONTRIBUTORSDIALOG_H
#include <QDialog>
namespace Ui {
class HtmlDialog;
}
class ContributorsDialog : public QDialog
{
Q_OBJECT
public:
explicit ContributorsDialog(QWidget * parent = 0);
~ContributorsDialog();
private:
Ui::HtmlDialog * ui;
QString formatTable(const QString & title, const QStringList & names, int colums);
};
#endif // CONTRIBUTORSDIALOG_H
-45
View File
@@ -1,45 +0,0 @@
#include "converteeprom.h"
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include <QFile>
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmwareFilename)
{
Firmware *currentFirmware = GetCurrentFirmware();
FirmwareInterface firmware(firmwareFilename);
if (!firmware.isValid())
return false;
unsigned int version = firmware.getEEpromVersion();
unsigned int variant = firmware.getEEpromVariant();
QFile sourceFile(sourceEEprom);
int eeprom_size = sourceFile.size();
if (!eeprom_size)
return false;
if (!sourceFile.open(QIODevice::ReadOnly))
return false;
QByteArray eeprom(eeprom_size, 0);
long result = sourceFile.read(eeprom.data(), eeprom_size);
sourceFile.close();
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(ALL_OK)
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
return false;
}
QFile destinationFile(destinationEEprom);
if (!destinationFile.open(QIODevice::WriteOnly))
return false;
result = destinationFile.write(eeprom.constData(), eeprom_size);
destinationFile.close();
if (result != eeprom_size)
return false;
return true;
}
-8
View File
@@ -1,8 +0,0 @@
#ifndef CONVERTHEADER_H_
#define CONVERTHEADER_H_
#include <QString>
bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom, const QString &firmware);
#endif /* CONVERTHEADER_H_ */
@@ -1,8 +1,29 @@
#include "contributorsdialog.h"
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "creditsdialog.h"
#include "ui_htmldialog.h"
#include "helpers.h"
#include <QFile>
ContributorsDialog::ContributorsDialog(QWidget * parent):
CreditsDialog::CreditsDialog(QWidget * parent):
QDialog(parent),
ui(new Ui::HtmlDialog)
{
@@ -21,42 +42,8 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
"</head>"
"<body class=\"normal\">";
QFile credits(":/CREDITS.txt");
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
if (line.trimmed() == "")
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Main Developers"), names, 3));
names.clear();
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
names.append(line.trimmed());
}
str.append(formatTable(tr("Other contributors"), names, 3));
}
QFile donations(":/DONATIONS.txt");
if (donations.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
if (line.trimmed() == "")
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Companies and projects who have donated to OpenTX"), names, 3));
names.clear();
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
names.append(line);
}
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
foreach(CreditsSection section, readCredits()) {
str.append(formatTable(sectionTitle(section.title), section.names, 3));
}
str.append("<table><tr><td class=\"normal\">&nbsp;</td></tr>" \
@@ -66,9 +53,9 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
#if 0
QFile blacklist(":/BLACKLIST.txt");
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
QStringList names;
names << blacklist.readAll();
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
}
#endif
@@ -78,12 +65,45 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
ui->textEditor->setOpenExternalLinks(true);
}
ContributorsDialog::~ContributorsDialog()
CreditsDialog::~CreditsDialog()
{
delete ui;
}
QString ContributorsDialog::formatTable(const QString & title, const QStringList & names, int columns)
QList<CreditsDialog::CreditsSection> CreditsDialog::readCredits()
{
QFile credits(":/CREDITS.txt");
QList<CreditsSection> result;
if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
while (!credits.atEnd()) {
QByteArray line = credits.readLine().trimmed();
if (line.size() >= 2) {
if (line.startsWith("[") && line.endsWith("]")) {
result.push_back(CreditsSection(line.mid(1, line.size() - 2)));
} else {
result.back().addName(line);
}
}
}
}
return result;
}
QString CreditsDialog::sectionTitle(const QString & title)
{
if (title == "Main developers")
return tr("Main developers");
else if (title == "Translators")
return tr("Translators");
else if (title == "Companies and projects who have donated to OpenTX")
return tr("Companies and projects who have donated to OpenTX");
else if (title == "People who have donated to OpenTX")
return tr("People who have donated to OpenTX");
else
return tr("Other contributors");
}
QString CreditsDialog::formatTable(const QString & title, const QStringList & names, int columns)
{
const float cwidth = 100.0 / columns;
QString str = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>" \
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _CREDITSDIALOG_H_
#define _CREDITSDIALOG_H_
#include <QDialog>
namespace Ui {
class HtmlDialog;
}
class CreditsDialog : public QDialog
{
Q_OBJECT
class CreditsSection
{
public:
CreditsSection(const QString & title):
title(title)
{
}
void addName(const QString & name)
{
names.push_back(name);
}
QString title;
QStringList names;
};
public:
explicit CreditsDialog(QWidget * parent = 0);
~CreditsDialog();
private:
Ui::HtmlDialog * ui;
QList<CreditsSection> readCredits();
QString sectionTitle(const QString & title);
QString formatTable(const QString & title, const QStringList & names, int colums);
};
#endif // _CREDITSDIALOG_H_
@@ -1,38 +1,40 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "opentx.h"
#if defined(PCBSTD) && defined(VOICE)
volatile uint8_t LcdLock;
#define LCD_LOCK() LcdLock = 1
#define LCD_UNLOCK() LcdLock = 0
#else
#define LCD_LOCK()
#define LCD_UNLOCK()
#endif
#if defined(LCD_KS108)
#include "targets/9x/lcd_ks108_driver.cpp"
#elif defined(LCD_ST7920)
#include "targets/9x/lcd_st7920_driver.cpp"
#else
#include "targets/9x/lcd_default_driver.cpp"
#endif
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "customdebug.h"
Q_LOGGING_CATEGORY(eepromImport, "eeprom.import")
Q_LOGGING_CATEGORY(simulatorInterfaceLoader, "simulator.interface.loader")
void CustomDebug::setFilterRules()
{
QString rules;
rules.append("eeprom.import=");
#if defined(DEBUG_STORAGE_IMPORT)
rules.append("true\n");
#else
rules.append("false\n");
#endif
rules.append("simulator.interface.*=true\n");
QLoggingCategory::setFilterRules(rules);
}
+32 -10
View File
@@ -1,16 +1,38 @@
#ifndef customdebug_h
#define customdebug_h
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <QDebug>
#ifndef _CUSTOMDEBUG_H_
#define _CUSTOMDEBUG_H_
#include <QLoggingCategory>
// Controls the generation of debug output for EEPROM import
#if defined(DEBUG_MODEL_IMPORT)
inline QDebug eepromImportDebug() { return QDebug(QtDebugMsg); }
#else
#undef eepromImportDebug
inline QNoDebug eepromImportDebug() { return QNoDebug(); }
#endif
Q_DECLARE_LOGGING_CATEGORY(eepromImport) // "eeprom.import"
// Controls the generation of debug output of SimulatorLoader class
Q_DECLARE_LOGGING_CATEGORY(simulatorInterfaceLoader) // "simulator.interface.loader"
#endif
class CustomDebug
{
public:
static void setFilterRules();
};
#endif // _CUSTOMDEBUG_H_
+77 -62
View File
@@ -1,3 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "customizesplashdialog.h"
#include "ui_customizesplashdialog.h"
#include "flashfirmwaredialog.h"
@@ -29,11 +49,11 @@ void Side::markSourceButton()
void Side::copyImage( Side side )
{
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
imageLabel->setPixmap(*side.imageLabel->pixmap());
}
bool Side::displayImage( QString fileName, Source pictSource )
bool Side::displayImage(QString fileName, Source pictSource)
{
QImage image;
@@ -41,7 +61,7 @@ bool Side::displayImage( QString fileName, Source pictSource )
return false;
// Determine which picture format to use
if (pictSource == FW ){
if (pictSource == FW) {
FirmwareInterface firmware(fileName);
if (!firmware.hasSplash())
return false;
@@ -54,39 +74,36 @@ bool Side::displayImage( QString fileName, Source pictSource )
if (pictSource== PICT)
*format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X;
else if (pictSource == PROFILE)
*format = (g.profile[g.id()].fwType().contains("taranis")) ? LCDTARANIS : LCD9X;
*format = (g.profile[g.id()].fwType().contains("x9")) ? LCDTARANIS : LCD9X;
}
if (image.isNull()) {
return false;
}
// Load image
if (*format==LCDTARANIS) {
imageLabel->setPixmap( makePixMap( image, "taranis" ));
imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2);
}
else {
imageLabel->setPixmap( makePixMap( image, "9x" ));
imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2);
}
switch (pictSource){
case FW:
fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName));
*saveToFileName = fileName;
*source=FW;
break;
case PICT:
fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName));
*saveToFileName = fileName;
*source=PICT;
break;
case PROFILE:
fileNameEdit->setText(QObject::tr("Profile image"));
*saveToFileName = fileName;
*source=PROFILE;
break;
default:
break;
// Load image
QPixmap pixmap = makePixMap(image);
imageLabel->setPixmap(pixmap);
imageLabel->setFixedSize(pixmap.width()*2, pixmap.height()*2);
switch (pictSource) {
case FW:
fileNameEdit->setText(CustomizeSplashDialog::tr("FW: %1").arg(fileName));
*saveToFileName = fileName;
*source = FW;
break;
case PICT:
fileNameEdit->setText(CustomizeSplashDialog::tr("Pict: %1").arg(fileName));
*saveToFileName = fileName;
*source = PICT;
break;
case PROFILE:
fileNameEdit->setText(CustomizeSplashDialog::tr("Profile image"));
*saveToFileName = fileName;
*source = PROFILE;
break;
default:
break;
}
saveButton->setEnabled(true);
libraryButton->setEnabled(true);
@@ -133,17 +150,15 @@ bool Side::saveImage()
return true;
}
//*** customizeSplashDialog Class ***
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
CustomizeSplashDialog::CustomizeSplashDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::customizeSplashDialog)
ui(new Ui::CustomizeSplashDialog)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("paintbrush.png"));
ui->leftLibraryButton->setIcon(CompanionIcon("library.png"));
ui->rightLibraryButton->setIcon(CompanionIcon("library.png"));
left.imageLabel = ui->leftImageLabel;
right.imageLabel = ui->rightImageLabel;
left.fileNameEdit = ui->leftFileNameEdit;
@@ -154,7 +169,7 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
right.libraryButton = ui->rightLibraryButton;
left.invertButton = ui->leftInvertButton;
right.invertButton = ui->rightInvertButton;
left.loadFwButton = ui->leftLoadFwButton;
right.loadFwButton = ui->rightLoadFwButton;
left.loadPictButton = ui->leftLoadPictButton;
@@ -168,36 +183,36 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
resize(0,0);
}
customizeSplashDialog::~customizeSplashDialog()
CustomizeSplashDialog::~CustomizeSplashDialog()
{
delete ui;
}
void customizeSplashDialog::on_copyRightToLeftButton_clicked() {
void CustomizeSplashDialog::on_copyRightToLeftButton_clicked() {
left.copyImage(right);
}
void customizeSplashDialog::on_copyLeftToRightButton_clicked() {
void CustomizeSplashDialog::on_copyLeftToRightButton_clicked() {
right.copyImage(left);
}
void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
void customizeSplashDialog::loadFirmware(Side side)
void CustomizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
void CustomizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
void CustomizeSplashDialog::loadFirmware(Side side)
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, FW ))
QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName));
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Can not load embedded image from firmware file %1.").arg(fileName));
else
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
void customizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
void customizeSplashDialog::loadPicture(Side side)
void CustomizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
void CustomizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
void CustomizeSplashDialog::loadPicture(Side side)
{
QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
@@ -208,42 +223,42 @@ void customizeSplashDialog::loadPicture(Side side)
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PICT ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Cannot load the image file %1.").arg(fileName));
else
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
void customizeSplashDialog::loadProfile(Side side)
void CustomizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
void CustomizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
void CustomizeSplashDialog::loadProfile(Side side)
{
QString fileName=g.profile[g.id()].splashFile();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PROFILE ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load profile image %1.").arg(fileName));
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Cannot load profile image %1.").arg(fileName));
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
void customizeSplashDialog::libraryButton_clicked( Side side )
void CustomizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
void CustomizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
void CustomizeSplashDialog::libraryButton_clicked( Side side )
{
QString fileName;
SplashLibraryDialog *ld = new SplashLibraryDialog(this,&fileName);
ld->exec();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, UNDEFINED ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the library image %1.").arg(fileName));
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Cannot load the library image %1.").arg(fileName));
}
}
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
void customizeSplashDialog::saveButton_clicked( Side side )
void CustomizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
void CustomizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
void CustomizeSplashDialog::saveButton_clicked( Side side )
{
if (side.saveImage()){
QMessageBox::information(this, tr("File Saved"), tr("The image was saved to the file %1").arg(*side.saveToFileName));
@@ -255,9 +270,9 @@ void customizeSplashDialog::saveButton_clicked( Side side )
QMessageBox::critical(this, tr("File Save Error"), tr("Failed to write image to %1").arg(*side.saveToFileName));
}
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
void customizeSplashDialog::on_rightInvertButton_clicked(){invertButton_clicked(right);}
void customizeSplashDialog::invertButton_clicked(Side side)
void CustomizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
void CustomizeSplashDialog::on_rightInvertButton_clicked(){invertButton_clicked(right);}
void CustomizeSplashDialog::invertButton_clicked(Side side)
{
QImage image = side.imageLabel->pixmap()->toImage();
image.invertPixels();
+28 -8
View File
@@ -1,12 +1,32 @@
#ifndef CUSTOMIZESPLASHDIALOG_H
#define CUSTOMIZESPLASHDIALOG_H
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _CUSTOMIZESPLASHDIALOG_H_
#define _CUSTOMIZESPLASHDIALOG_H_
#include <QtWidgets>
#include "firmwareinterface.h"
namespace Ui
{
class customizeSplashDialog;
class CustomizeSplashDialog;
}
const int WIDTH_TARANIS = 212;
@@ -43,15 +63,15 @@ private:
LCDFormat *format;
};
class customizeSplashDialog : public QDialog
class CustomizeSplashDialog : public QDialog
{
Q_OBJECT
Side left;
Side right;
public:
explicit customizeSplashDialog(QWidget *parent = 0);
~customizeSplashDialog();
explicit CustomizeSplashDialog(QWidget *parent = 0);
~CustomizeSplashDialog();
private slots:
void on_leftLoadFwButton_clicked();
@@ -79,8 +99,8 @@ private:
void saveButton_clicked( Side );
void invertButton_clicked( Side );
Ui::customizeSplashDialog *ui;
Ui::CustomizeSplashDialog *ui;
enum sideEnum { LEFT, RIGHT };
};
#endif // CUSTOMIZESPLASHDIALOG_H
#endif // _CUSTOMIZESPLASHDIALOG_H_
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>customizeSplashDialog</class>
<widget class="QDialog" name="customizeSplashDialog">
<class>CustomizeSplashDialog</class>
<widget class="QDialog" name="CustomizeSplashDialog">
<property name="enabled">
<bool>true</bool>
</property>
+24
View File
@@ -0,0 +1,24 @@
set(datamodels_SRCS
rawitemdatamodels.cpp
rawitemfilteredmodel.cpp
)
set(datamodels_HDRS
rawitemdatamodels.h
rawitemfilteredmodel.h
)
qt5_wrap_cpp(datamodels_SRCS ${datamodels_HDRS})
add_library(datamodels ${datamodels_SRCS} ${datamodels_HDRS})
target_link_libraries(datamodels PRIVATE ${CPN_COMMON_LIB})
target_include_directories(datamodels
PRIVATE
"${CMAKE_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
"${COMPANION_SRC_DIRECTORY}"
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}"
)
@@ -0,0 +1,172 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "rawitemdatamodels.h"
#include "generalsettings.h"
#include "eeprominterface.h"
#include "modeldata.h"
RawSourceItemModel::RawSourceItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent) :
AbstractRawItemDataModel(generalSettings, modelData, parent)
{
const Boards board = Boards(getCurrentBoard());
Firmware * fw = getCurrentFirmware();
const int anasCount = CPN_MAX_STICKS + board.getCapability(Board::Pots) + board.getCapability(Board::Sliders) + board.getCapability(Board::MouseAnalogs);
addItems(SOURCE_TYPE_NONE, RawSource::NoneGroup, 1);
for (int i=0; i < fw->getCapability(LuaScripts); i++)
addItems(SOURCE_TYPE_LUA_OUTPUT, RawSource::ScriptsGroup, fw->getCapability(LuaOutputsPerScript), i * 16);
addItems(SOURCE_TYPE_VIRTUAL_INPUT, RawSource::InputsGroup, fw->getCapability(VirtualInputs));
addItems(SOURCE_TYPE_STICK, RawSource::SourcesGroup, anasCount);
addItems(SOURCE_TYPE_ROTARY_ENCODER, RawSource::SourcesGroup, fw->getCapability(RotaryEncoders));
addItems(SOURCE_TYPE_TRIM, RawSource::TrimsGroup, board.getCapability(Board::NumTrims));
addItems(SOURCE_TYPE_MAX, RawSource::SourcesGroup, 1);
addItems(SOURCE_TYPE_SWITCH, RawSource::SwitchesGroup, board.getCapability(Board::Switches));
addItems(SOURCE_TYPE_CUSTOM_SWITCH, RawSource::SwitchesGroup, fw->getCapability(LogicalSwitches));
addItems(SOURCE_TYPE_CYC, RawSource::SourcesGroup, CPN_MAX_CYC);
addItems(SOURCE_TYPE_PPM, RawSource::SourcesGroup, fw->getCapability(TrainerInputs));
addItems(SOURCE_TYPE_CH, RawSource::SourcesGroup, fw->getCapability(Outputs));
addItems(SOURCE_TYPE_SPECIAL, RawSource::TelemGroup, 5);
addItems(SOURCE_TYPE_TELEMETRY, RawSource::TelemGroup, CPN_MAX_SENSORS * 3);
addItems(SOURCE_TYPE_GVAR, RawSource::GVarsGroup, fw->getCapability(Gvars));
}
void RawSourceItemModel::setDynamicItemData(QStandardItem * item, const RawSource & src) const
{
Board::Type board = getCurrentBoard();
item->setText(src.toString(modelData, generalSettings, board));
item->setData(src.isAvailable(modelData, generalSettings, board), IsAvailableRole);
}
void RawSourceItemModel::addItems(const RawSourceType & type, const int group, const int count, const int start)
{
for (int i = start; i < start + count; i++) {
const RawSource src = RawSource(type, i);
QStandardItem * modelItem = new QStandardItem();
modelItem->setData(src.toValue(), ItemIdRole);
modelItem->setData(type, ItemTypeRole);
modelItem->setData(group, ItemFlagsRole);
setDynamicItemData(modelItem, src);
appendRow(modelItem);
}
}
void RawSourceItemModel::update() const
{
for (int i=0; i < rowCount(); ++i)
setDynamicItemData(item(i), RawSource(item(i)->data(ItemIdRole).toInt()));
}
//
// RawSwitchItemModel
//
RawSwitchItemModel::RawSwitchItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent) :
AbstractRawItemDataModel(generalSettings, modelData, parent)
{
Boards board = Boards(getCurrentBoard());
Firmware * fw = getCurrentFirmware();
// Descending switch direction: NOT (!) switches
addItems(SWITCH_TYPE_SENSOR, -CPN_MAX_SENSORS);
addItems(SWITCH_TYPE_TELEMETRY, -1);
addItems(SWITCH_TYPE_FLIGHT_MODE, -fw->getCapability(FlightModes));
addItems(SWITCH_TYPE_VIRTUAL, -fw->getCapability(LogicalSwitches));
addItems(SWITCH_TYPE_ROTARY_ENCODER, -fw->getCapability(RotaryEncoders));
addItems(SWITCH_TYPE_TRIM, -board.getCapability(Board::NumTrimSwitches));
addItems(SWITCH_TYPE_MULTIPOS_POT, -(board.getCapability(Board::MultiposPots) * board.getCapability(Board::MultiposPotsPositions)));
addItems(SWITCH_TYPE_SWITCH, -board.getCapability(Board::SwitchPositions));
// Ascending switch direction (including zero)
addItems(SWITCH_TYPE_TIMER_MODE, 5);
addItems(SWITCH_TYPE_NONE, 1);
addItems(SWITCH_TYPE_SWITCH, board.getCapability(Board::SwitchPositions));
addItems(SWITCH_TYPE_MULTIPOS_POT, board.getCapability(Board::MultiposPots) * board.getCapability(Board::MultiposPotsPositions));
addItems(SWITCH_TYPE_TRIM, board.getCapability(Board::NumTrimSwitches));
addItems(SWITCH_TYPE_ROTARY_ENCODER, fw->getCapability(RotaryEncoders));
addItems(SWITCH_TYPE_VIRTUAL, fw->getCapability(LogicalSwitches));
addItems(SWITCH_TYPE_FLIGHT_MODE, fw->getCapability(FlightModes));
addItems(SWITCH_TYPE_TELEMETRY, 1);
addItems(SWITCH_TYPE_SENSOR, CPN_MAX_SENSORS);
addItems(SWITCH_TYPE_ON, 1);
addItems(SWITCH_TYPE_ONE, 1);
}
void RawSwitchItemModel::setDynamicItemData(QStandardItem * item, const RawSwitch & rsw) const
{
const Board::Type board = getCurrentBoard();
item->setText(rsw.toString(board, generalSettings, modelData));
item->setData(rsw.isAvailable(modelData, generalSettings, board), IsAvailableRole);
}
void RawSwitchItemModel::addItems(const RawSwitchType & type, int count)
{
// Most RawSwitch() indices are one-based (vs. typical zero); these are exceptions to the rule:
const static QVector<int> rawSwitchIndexBaseZeroTypes = QVector<int>() << SWITCH_TYPE_NONE << SWITCH_TYPE_ON << SWITCH_TYPE_OFF << SWITCH_TYPE_TIMER_MODE;
// handle exceptions in RawSwitch() index values
const short rawIdxAdj = rawSwitchIndexBaseZeroTypes.contains(type) ? -1 : 0;
// determine cotext flags
int context = RawSwitch::AllSwitchContexts;
switch (type) {
case SWITCH_TYPE_FLIGHT_MODE:
context &= ~RawSwitch::MixesContext;
// fallthrough
case SWITCH_TYPE_VIRTUAL:
case SWITCH_TYPE_SENSOR:
context &= ~RawSwitch::GlobalFunctionsContext;
break;
case SWITCH_TYPE_TIMER_MODE:
context = RawSwitch::TimersContext;
break;
case SWITCH_TYPE_NONE:
context &= ~RawSwitch::TimersContext;
break;
case SWITCH_TYPE_ON:
case SWITCH_TYPE_ONE:
context = RawSwitch::SpecialFunctionsContext | RawSwitch::GlobalFunctionsContext;
break;
default:
break;
}
int i = (count < 0 ? count : 1);
count = (i < 0 ? 0 : count + i);
for ( ; i < count; ++i) {
RawSwitch rs(type, i + rawIdxAdj);
QStandardItem * modelItem = new QStandardItem();
modelItem->setData(rs.toValue(), ItemIdRole);
modelItem->setData(type, ItemTypeRole);
modelItem->setData(context, ItemFlagsRole);
setDynamicItemData(modelItem, rs);
appendRow(modelItem);
}
}
void RawSwitchItemModel::update() const
{
for (int i=0; i < rowCount(); ++i)
setDynamicItemData(item(i), RawSwitch(item(i)->data(ItemIdRole).toInt()));
}
@@ -0,0 +1,84 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef RAWITEMDATAMODELS_H
#define RAWITEMDATAMODELS_H
#include "rawsource.h"
#include "rawswitch.h"
#include <QStandardItemModel>
class GeneralSettings;
class ModelData;
class AbstractRawItemDataModel: public QStandardItemModel
{
Q_OBJECT
public:
enum DataRoles { ItemIdRole = Qt::UserRole, ItemTypeRole, ItemFlagsRole, IsAvailableRole };
Q_ENUM(DataRoles)
explicit AbstractRawItemDataModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent = nullptr) :
QStandardItemModel(parent),
generalSettings(generalSettings),
modelData(modelData)
{}
public slots:
virtual void update() const = 0;
protected:
const GeneralSettings * generalSettings;
const ModelData * modelData;
};
class RawSourceItemModel: public AbstractRawItemDataModel
{
Q_OBJECT
public:
explicit RawSourceItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent = nullptr);
public slots:
void update() const override;
protected:
void setDynamicItemData(QStandardItem * item, const RawSource & src) const;
void addItems(const RawSourceType & type, const int group, const int count, const int start = 0);
};
class RawSwitchItemModel: public AbstractRawItemDataModel
{
Q_OBJECT
public:
explicit RawSwitchItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent = nullptr);
public slots:
void update() const override;
protected:
void setDynamicItemData(QStandardItem * item, const RawSwitch & rsw) const;
void addItems(const RawSwitchType & type, int count);
};
#endif // RAWITEMDATAMODELS_H
@@ -0,0 +1,74 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "rawitemfilteredmodel.h"
#include "rawitemdatamodels.h"
RawItemFilteredModel::RawItemFilteredModel(QAbstractItemModel * sourceModel, int flags, QObject * parent) :
QSortFilterProxyModel(parent),
filterFlags(0)
{
setFilterRole(AbstractRawItemDataModel::IsAvailableRole);
setFilterKeyColumn(0);
setFilterFlags(flags);
setDynamicSortFilter(true);
setSourceModel(sourceModel);
}
void RawItemFilteredModel::setFilterFlags(int flags)
{
if (filterFlags != flags) {
filterFlags = flags;
invalidateFilter();
}
}
bool RawItemFilteredModel::filterAcceptsRow(int sourceRow, const QModelIndex & sourceParent) const
{
const QModelIndex & srcIdx = sourceModel()->index(sourceRow, 0, sourceParent);
if (!srcIdx.isValid() || !sourceModel()->data(srcIdx, filterRole()).toBool())
return false;
if (!filterFlags)
return true;
bool ok;
const int flags = sourceModel()->data(srcIdx, AbstractRawItemDataModel::ItemFlagsRole).toInt(&ok);
return (ok && (!flags || (filterFlags & flags)));
}
void RawItemFilteredModel::update() const
{
AbstractRawItemDataModel * model = qobject_cast<AbstractRawItemDataModel *>(sourceModel());
if (model)
model->update();
}
RawSourceFilterItemModel::RawSourceFilterItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, int flags, QObject * parent) :
RawItemFilteredModel(new RawSourceItemModel(generalSettings, modelData, parent), flags, parent)
{
}
RawSwitchFilterItemModel::RawSwitchFilterItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, int context, QObject * parent) :
RawItemFilteredModel(new RawSwitchItemModel(generalSettings, modelData, parent), context, parent)
{
}
@@ -0,0 +1,74 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef RAWITEMFILTEREDMODEL_H
#define RAWITEMFILTEREDMODEL_H
#include <QSortFilterProxyModel>
class GeneralSettings;
class ModelData;
class RawSourceItemModel;
class RawSwitchItemModel;
class RawItemFilteredModel: public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit RawItemFilteredModel(QAbstractItemModel * sourceModel, int flags, QObject * parent = nullptr);
explicit RawItemFilteredModel(QAbstractItemModel * sourceModel, QObject * parent = nullptr) : RawItemFilteredModel(sourceModel, 0, parent) {}
public slots:
void setFilterFlags(int flags);
void update() const;
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex & sourceParent) const override;
int filterFlags;
};
// The specialized "convenience" types below can go away once centralalized RawSource/RawSwitch item models are established.
// These proxy classes will automatically create a source model of the corresponding type.
class RawSwitchFilterItemModel: public RawItemFilteredModel
{
Q_OBJECT
public:
using RawItemFilteredModel::RawItemFilteredModel;
explicit RawSwitchFilterItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, int context, QObject * parent = nullptr);
};
class RawSourceFilterItemModel: public RawItemFilteredModel
{
Q_OBJECT
public:
using RawItemFilteredModel::RawItemFilteredModel;
explicit RawSourceFilterItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, int flags, QObject * parent = nullptr);
explicit RawSourceFilterItemModel(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent = nullptr) :
RawSourceFilterItemModel(generalSettings, modelData, 0, parent) {}
};
#endif // RAWITEMFILTEREDMODEL_H
+502
View File
@@ -0,0 +1,502 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "filesyncdialog.h"
#include "autobitsetcheckbox.h"
#include "autocheckbox.h"
#include "autocombobox.h"
#include "autolineedit.h"
#include "constants.h"
#include "helpers.h"
#include "progresswidget.h"
#include <QApplication>
#include <QComboBox>
#include <QCompleter>
#include <QCheckBox>
#include <QDir>
#include <QFileDialog>
#include <QFileSystemModel>
#include <QLayout>
#include <QLineEdit>
#include <QMenu>
#include <QSpinBox>
FileSyncDialog::FileSyncDialog(QWidget * parent, const SyncProcess::SyncOptions & syncOptions) :
QDialog(parent),
m_syncOptions(syncOptions),
m_running(false)
{
setWindowTitle(tr("Synchronize Files"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setSizeGripEnabled(true);
setupUi();
toggleExtraOptions(false);
validate();
updateRunningState();
}
void FileSyncDialog::reject()
{
// override close event via window system close or esc. key
if (m_running) {
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Are you sure you wish to abort the sync?")) == QMessageBox::No)
return;
emit stopSync();
// Force termination if the sync hasn't finished within 5s
QElapsedTimer tim;
tim.start();
while (!tim.hasExpired(5000) && m_running)
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 10);
if (m_running)
qWarning() << "Terminating thread while Sync process was still running.";
}
QDialog::reject();
}
// Create a widget with a line edit and folder select button and handles all interactions. Features autosuggest
// path hints while typing, invalid paths shown in red.
// This should probably be moved some place more reusable, esp. the QFileSystemModel.
static QWidget * folderSelectorWidget(QLineEdit * le, QWidget * parent)
{
static QFileSystemModel fileModel;
static bool init = false;
if (!init) {
init = true;
fileModel.setFilter(QDir::Dirs);
fileModel.setRootPath("/");
}
QWidget * fsw = new QWidget(parent);
//le = new QLineEdit(parent);
QCompleter * fsc = new QCompleter(fsw);
fsc->setModel(&fileModel);
//fsc->setCompletionMode(QCompleter::InlineCompletion);
le->setCompleter(fsc);
QToolButton * btn = new QToolButton(fsw);
btn->setIcon(CompanionIcon("open.png"));
QHBoxLayout * l = new QHBoxLayout(fsw);
l->setContentsMargins(0,0,0,0);
l->setSpacing(3);
l->addWidget(le);
l->addWidget(btn);
QObject::connect(btn, &QToolButton::clicked, [=]() {
QString dir = QFileDialog::getExistingDirectory(parent, fsw->property("fileDialogTitle").toString(), le->text(), 0);
if (!dir.isEmpty()) {
le->setText(QDir::toNativeSeparators(dir));
le->setFocus();
}
});
QObject::connect(le, &QLineEdit::textChanged, [=](const QString & text) {
if (QFile::exists(text))
le->setStyleSheet("");
else
le->setStyleSheet("QLineEdit {color: red;}");
});
return fsw;
}
void FileSyncDialog::setupUi()
{
const QString srcArw = CPN_STR_SW_INDICATOR_UP % " ";
const QString dstArw = CPN_STR_SW_INDICATOR_DN % " ";
int row = 0;
CompanionIcon playIcon("play.png");
playIcon.addImage("stop.png", QIcon::Normal, QIcon::On);
QLabel * lblSrc = new QLabel(tr("Source Folder:"), this);
AutoLineEdit * leSrc = new AutoLineEdit(this, true);
leSrc->setField(m_syncOptions.folderA);
leSrc->setText(QDir::toNativeSeparators(m_syncOptions.folderA));
QWidget * wdgSrc = folderSelectorWidget(leSrc, this);
QLabel * lblDst = new QLabel(tr("Destination Folder:"), this);
AutoLineEdit * leDst = new AutoLineEdit(this, true);
leDst->setField(m_syncOptions.folderB);
leDst->setText(QDir::toNativeSeparators(m_syncOptions.folderB));
QWidget * wdgDst = folderSelectorWidget(leDst, this);
AutoComboBox * syncDir = new AutoComboBox(this);
syncDir->addItem(tr("%1%2 Both directions, to destination folder first").arg(dstArw, srcArw), SyncProcess::SYNC_A2B_B2A);
syncDir->addItem(tr("%1%2 Both directions, to source folder first").arg(srcArw, dstArw), SyncProcess::SYNC_B2A_A2B);
syncDir->addItem(tr(" %1 Only from source folder to destination folder").arg(dstArw), SyncProcess::SYNC_A2B);
syncDir->addItem(tr(" %1 Only from destination folder to source folder").arg(srcArw), SyncProcess::SYNC_B2A);
syncDir->setCurrentIndex(-1); // we set the default option later
AutoComboBox * copyMode = new AutoComboBox(this);
copyMode->setToolTip(tr("How to handle overwriting files which already exist in the destination folder."));
copyMode->addItem(tr("Copy only if newer and different (compare contents)"), SyncProcess::OVERWR_NEWER_IF_DIFF);
copyMode->addItem(tr("Copy only if newer (do not compare contents)"), SyncProcess::OVERWR_NEWER_ALWAYS);
copyMode->addItem(tr("Copy only if different (ignore file time stamps)"), SyncProcess::OVERWR_IF_DIFF);
copyMode->addItem(tr("Always copy (force overwite existing files)"), SyncProcess::OVERWR_ALWAYS);
copyMode->setField(m_syncOptions.compareType);
QSpinBox * maxSize = new QSpinBox(this);
maxSize->setRange(0, 100 * 1024);
maxSize->setAccelerated(true);
maxSize->setSpecialValueText(tr("Any size"));
maxSize->setToolTip(tr("Skip files larger than this size. Enter zero for unlimited."));
maxSize->setGroupSeparatorShown(true);
maxSize->setValue(0); // we set the real default value later
AutoComboBox * logLevel = new AutoComboBox(this);
logLevel->setToolTip(tr("Minimum reporting level. Events of this type and of higher importance are shown.\n" \
"WARNING: High log rates may make the user interface temporarily unresponsive."));
logLevel->addItem(tr("Skipped"), QtDebugMsg);
logLevel->addItem(tr("Created"), QtInfoMsg);
logLevel->addItem(tr("Updated"), QtWarningMsg);
//logLevel->addItem(tr("Item Deleted"), QtCriticalMsg); // unused
logLevel->addItem(tr("Errors Only"), QtFatalMsg);
logLevel->setField(m_syncOptions.logLevel);
AutoBitsetCheckBox * testRun = new AutoBitsetCheckBox(m_syncOptions.flags, SyncProcess::OPT_DRY_RUN, tr("Test-run only"), this);
testRun->setToolTip(tr("Run as normal but do not actually copy anything. Useful for verifying results before real sync."));
// layout to hold size spinbox and checkbox option(s)
QHBoxLayout * hlay1 = new QHBoxLayout();
hlay1->addWidget(maxSize, 1);
hlay1->addWidget(testRun);
hlay1->addWidget(new QLabel(tr("Log Level:"), this));
hlay1->addWidget(logLevel);
// "extra" options
QLabel * lbFilter = new QLabel(tr("Filters:"), this);
lbFilter->setToolTip(tr("The \"Include\" filter will only copy files which match the pattern(s).\n" \
"The \"Exclude\" filter will skip files matching the filter pattern(s).\n" \
"The Include filter is evaluated first."));
AutoLineEdit * leFiltExc = new AutoLineEdit(this, true);
leFiltExc->setField(m_syncOptions.excludeFilter);
leFiltExc->setToolTip(tr("One or more file pattern(s) to exclude, separated by commas.\n" "Blank means exclude none. ?, *, and [...] wildcards accepted."));
AutoLineEdit * leFiltInc = new AutoLineEdit(this, true);
leFiltInc->setField(m_syncOptions.includeFilter);
leFiltInc->setToolTip(tr("One or more file pattern(s) to include, separated by commas.\n" "Blank means include all. ?, *, and [...] wildcards accepted."));
// layout to hold filter options
QHBoxLayout * filtLo = new QHBoxLayout();
filtLo->addWidget(new QLabel(tr("Include:"), this));
filtLo->addWidget(leFiltInc, 1);
filtLo->addWidget(new QLabel(tr("Exclude:"), this));
filtLo->addWidget(leFiltExc, 1);
// file options
QHBoxLayout * filOptsLo = new QHBoxLayout();
filOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.dirFilterFlags, QDir::CaseSensitive, tr("Case sensitive"), this));
filOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.dirFilterFlags, QDir::NoSymLinks, true, tr("Follow links"), this));
filOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.dirFilterFlags, QDir::Hidden, tr("Include hidden"), this));
// folder options
QHBoxLayout * dirOptsLo = new QHBoxLayout();
dirOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.flags, SyncProcess::OPT_RECURSIVE, tr("Recursive"), this));
dirOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.flags, SyncProcess::OPT_SKIP_DIR_LINKS, true, tr("Follow links"), this));
dirOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.dirFilterFlags, QDir::Dirs, true, tr("Skip empty"), this));
dirOptsLo->addWidget(new AutoBitsetCheckBox(m_syncOptions.dirFilterFlags, QDir::AllDirs, true, tr("Apply filters"), this));
// extra options container widget and layout
ui_extraOptions = new QWidget(this);
ui_extraOptions->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
QGridLayout * xOptsLay = new QGridLayout(ui_extraOptions);
xOptsLay->setContentsMargins(0, 0, 0, 0);
xOptsLay->addWidget(lbFilter, row, 0);
xOptsLay->addLayout(filtLo, row++, 1);
xOptsLay->addWidget(new QLabel(tr("Filter Options:"), this), row, 0);
xOptsLay->addLayout(filOptsLo, row++, 1);
xOptsLay->addWidget(new QLabel(tr("Folder Options:"), this), row, 0);
xOptsLay->addLayout(dirOptsLo, row++, 1);
// status label
ui_statusLabel = new QLabel(this);
// progress widget
ui_progress = new ProgressWidget(this);
ui_progress->setMinimumWidth(0);
ui_progress->setVisible(false);
// dialog buttons & menu
QMenu * optionsMenu = new QMenu(tr("Options"));
QAction * xtrasAct = optionsMenu->addAction(CompanionIcon("fuses.png"), tr("Show extra options"), this, &FileSyncDialog::toggleExtraOptions);
xtrasAct->setCheckable(true);
connect(this, &FileSyncDialog::extraOptionsToggled, xtrasAct, &QAction::setChecked);
optionsMenu->addAction(CompanionIcon("paintbrush.png"), tr("Reset to defaults"), this, &FileSyncDialog::resetOptions);
QToolButton * btnOpts = new QToolButton(this);
btnOpts->setDefaultAction(xtrasAct);
btnOpts->setMenu(optionsMenu);
btnOpts->setToolButtonStyle(Qt::ToolButtonIconOnly);
btnOpts->setPopupMode(QToolButton::MenuButtonPopup);
btnOpts->setToolTip(xtrasAct->text());
ui_btnStartStop = new QToolButton(this);
ui_btnStartStop->setCheckable(true);
ui_btnStartStop->setIcon(playIcon);
ui_btnStartStop->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
ui_btnClose = new QToolButton(this);
ui_btnClose->setText(tr("Close"));
ui_btnClose->setToolButtonStyle(Qt::ToolButtonTextOnly);
ui_btnClose->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding);
ui_buttonBox = new QDialogButtonBox(this);
ui_buttonBox->addButton(btnOpts, QDialogButtonBox::ActionRole);
ui_buttonBox->addButton(ui_btnStartStop, QDialogButtonBox::ActionRole);
ui_buttonBox->addButton(ui_btnClose, QDialogButtonBox::RejectRole);
// The options group box.
ui_optionsPanel = new QGroupBox(tr("Options"), this);
QGridLayout * optsLay = new QGridLayout(ui_optionsPanel);
row = 0;
optsLay->addWidget(lblSrc, row, 0);
optsLay->addWidget(wdgSrc, row++, 1);
optsLay->addWidget(lblDst, row, 0);
optsLay->addWidget(wdgDst, row++, 1);
optsLay->addWidget(new QLabel(tr("Sync. Direction:"), this), row, 0);
optsLay->addWidget(syncDir, row++, 1);
optsLay->addWidget(new QLabel(tr("Existing Files:"), this), row, 0);
optsLay->addWidget(copyMode, row++, 1);
optsLay->addWidget(new QLabel(tr("Max. File Size:"), this), row, 0);
optsLay->addLayout(hlay1, row++, 1);
optsLay->addWidget(ui_extraOptions, row, 0, 1, 2);
// layout to hold warning label and button box
QHBoxLayout * hlay2 = new QHBoxLayout();
hlay2->addWidget(ui_statusLabel, 1);
hlay2->addWidget(ui_buttonBox);
// Create main layout and add options, progress, buttons.
QVBoxLayout * dlgL = new QVBoxLayout(this);
dlgL->addWidget(ui_optionsPanel, 0, Qt::AlignTop);
dlgL->addLayout(hlay2);
dlgL->addWidget(ui_progress, 1);
// Connect all signal handlers
// source path
connect(leSrc, &AutoLineEdit::textChanged, this, &FileSyncDialog::validate);
// destination path
connect(leDst, &AutoLineEdit::textChanged, this, &FileSyncDialog::validate);
// function to dis/enable the OVERWR_ALWAYS option depending on sync direction
connect(syncDir, &AutoComboBox::currentDataChanged, [=](int dir) {
int idx = copyMode->findData(SyncProcess::OVERWR_ALWAYS);
int flg = (dir == SyncProcess::SYNC_A2B || dir == SyncProcess::SYNC_B2A) ? 33 : 0;
if (!flg && idx == copyMode->currentIndex())
copyMode->setCurrentIndex(copyMode->findData(SyncProcess::OVERWR_NEWER_IF_DIFF));
copyMode->setItemData(idx, flg, Qt::UserRole - 1);
});
// function to set magnitude of file size spinbox, KB or MB
connect(maxSize, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), [=](int value) {
const QSignalBlocker blocker(maxSize);
int multi = maxSize->property("multi").isValid() ? maxSize->property("multi").toInt() : 0;
if (value >= 10 * 1024 && multi != 1024 * 1024) {
// KB -> MB
multi = 1024 * 1024;
maxSize->setValue(value / 1024);
maxSize->setMaximum(100);
maxSize->setSingleStep(1);
maxSize->setSuffix(tr(" MB"));
}
else if ((value < 10 && multi != 1024) || !multi) {
// MB -> KB
if (multi)
value *= 1024;
multi = 1024;
if (value == 9 * 1024)
value += 1024 - 32; // avoid large jump when stepping from 10MB to 10,208KB
maxSize->setMaximum(100 * 1024);
maxSize->setValue(value);
maxSize->setSingleStep(32);
maxSize->setSuffix(tr(" KB"));
}
maxSize->setProperty("multi", multi);
m_syncOptions.maxFileSize = value * multi;
});
// we set these after connections are made because we want the signal processors to run
syncDir->setField(m_syncOptions.direction);
maxSize->setValue(m_syncOptions.maxFileSize / 1024);
// connect Reset action to all fields
for (AutoLineEdit * a : ui_optionsPanel->findChildren<AutoLineEdit *>())
connect(this, &FileSyncDialog::optionsWereReset, a, &AutoLineEdit::updateValue);
for (AutoComboBox * a : ui_optionsPanel->findChildren<AutoComboBox *>())
connect(this, &FileSyncDialog::optionsWereReset, a, &AutoComboBox::updateValue);
for (AutoBitsetCheckBox * a : ui_optionsPanel->findChildren<AutoBitsetCheckBox *>())
connect(this, &FileSyncDialog::optionsWereReset, a, &AutoBitsetCheckBox::updateValue);
connect(this, &FileSyncDialog::optionsWereReset, [=]() { maxSize->setValue(m_syncOptions.maxFileSize / 1024); });
// React to name changes for source and destination path labels
connect(this, &FileSyncDialog::folderNameAChanged, [=](const QString &text) {
lblSrc->setText(text % ":");
wdgSrc->setProperty("fileDialogTitle", text);
});
connect(this, &FileSyncDialog::folderNameBChanged, [=](const QString &text) {
lblDst->setText(text % ":");
wdgDst->setProperty("fileDialogTitle", text);
});
// button actions
connect(ui_btnStartStop, &QPushButton::clicked, this, &FileSyncDialog::toggleSync);
connect(ui_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(ui_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(ui_progress, &ProgressWidget::detailsToggled, this, &FileSyncDialog::adjustSizeDelayed);
}
void FileSyncDialog::toggleSync(bool)
{
if (m_running) {
setCursor(Qt::WaitCursor);
emit stopSync();
return;
}
ui_progress->clearDetails();
ui_progress->setInfo("");
SyncProcess * syncProcess = new SyncProcess(m_syncOptions);
// move sync process to separate thread, we only use signals/slots from here on...
QThread * syncThread = new QThread(this);
syncProcess->moveToThread(syncThread);
// ...and quite a few of them!
connect(this, &FileSyncDialog::startSync, syncProcess, &SyncProcess::run);
connect(this, &FileSyncDialog::stopSync, syncProcess, &SyncProcess::stop);
connect(syncProcess, &SyncProcess::started, this, &FileSyncDialog::onSyncStarted);
connect(syncProcess, &SyncProcess::finished, this, &FileSyncDialog::onSyncFinished);
connect(syncProcess, &SyncProcess::statusMessage, this, &FileSyncDialog::setStatusText);
connect(syncProcess, &SyncProcess::statusUpdate, this, &FileSyncDialog::onStatusUpdate);
connect(syncProcess, &SyncProcess::fileCountChanged, ui_progress, &ProgressWidget::setMaximum);
connect(syncProcess, &SyncProcess::progressMessage, ui_progress, &ProgressWidget::addMessage);
connect(syncProcess, &SyncProcess::finished, syncThread, &QThread::quit);
connect(syncThread, &QThread::finished, syncThread, &QThread::deleteLater);
connect(syncThread, &QThread::destroyed, syncProcess, &SyncProcess::deleteLater);
// go
syncThread->start(QThread::LowPriority);
emit startSync();
}
void FileSyncDialog::onSyncStarted()
{
m_running = true;
updateRunningState();
}
void FileSyncDialog::onSyncFinished()
{
m_running = false;
updateRunningState();
if (parentWidget())
QApplication::alert(parentWidget());
}
void FileSyncDialog::updateRunningState()
{
ui_btnStartStop->setChecked(m_running);
ui_optionsPanel->setEnabled(!m_running);
ui_btnClose->setEnabled(!m_running);
ui_btnStartStop->setText(m_running ? tr("Abort") : tr("Start"));
if (m_running) {
ui_progress->setVisible(true); // don't hide after run
}
else {
setCursor(Qt::ArrowCursor); // in case we set a wait cursor upon abort request
}
}
void FileSyncDialog::onStatusUpdate(const SyncProcess::SyncStatus & stat)
{
static const QString reportTemplate = tr("Total: <b>%1</b>; Created: <b>%2</b>; Updated: <b>%3</b>; Skipped: <b>%4</b>; Errors: <font color=%6><b>%5</b></font>;");
ui_progress->setInfo((stat.index < stat.count ? tr("Current: <b>%1</b> of ").arg(stat.index) : "") % reportTemplate.arg(stat.count).arg(stat.created).arg(stat.updated).arg(stat.skipped).arg(stat.errored).arg(stat.errored ? "red" : "black"));
ui_progress->setValue(stat.index);
}
void FileSyncDialog::setSyncOptions(const SyncProcess::SyncOptions & syncOptions)
{
m_syncOptions = syncOptions;
emit optionsWereReset();
}
void FileSyncDialog::resetOptions()
{
m_syncOptions.reset();
emit optionsWereReset();
}
void FileSyncDialog::toggleExtraOptions(bool show)
{
ui_extraOptions->setVisible(show);
if (!ui_progress->detailsVisible())
adjustSizeDelayed();
m_extraOptionsVisible = show;
emit extraOptionsToggled(show);
}
void FileSyncDialog::setFolderNameA(const QString & name)
{
if (m_folderNameA != name) {
m_folderNameA = name;
emit folderNameAChanged(name);
}
}
void FileSyncDialog::setFolderNameB(const QString & name)
{
if (m_folderNameB != name) {
m_folderNameB = name;
emit folderNameBChanged(name);
}
}
void FileSyncDialog::setStatusText(const QString & text, int type)
{
ui_statusLabel->setText(text);
ui_statusLabel->setStyleSheet(type != QtInfoMsg && type >= QtWarningMsg ? "QLabel { color: red; }:" : "");
}
bool FileSyncDialog::validate()
{
QString msg;
if (m_syncOptions.folderA.isEmpty() || !QFileInfo(m_syncOptions.folderA).exists())
msg = tr("Source folder not found.");
else if (m_syncOptions.folderB.isEmpty() || !QFileInfo(m_syncOptions.folderB).exists())
msg = tr("Destination folder not found.");
else if (QFileInfo(m_syncOptions.folderA).canonicalFilePath() == QFileInfo(m_syncOptions.folderB).canonicalFilePath())
msg = tr("Source and destination folders are the same.");
setStatusText(msg, QtCriticalMsg);
ui_btnStartStop->setEnabled(msg.isEmpty());
return msg.isEmpty();
}
void FileSyncDialog::adjustSizeDelayed()
{
QTimer::singleShot(0, [=]() { adjustSize(); });
}
+96
View File
@@ -0,0 +1,96 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef FILESYNCDIALOG_H
#define FILESYNCDIALOG_H
#include "process_sync.h"
#include <QDialog>
#include <QDialogButtonBox>
#include <QGroupBox>
#include <QLabel>
#include <QToolButton>
class ProgressWidget;
class FileSyncDialog : public QDialog
{
Q_OBJECT
Q_PROPERTY(SyncProcess::SyncOptions syncOptions READ syncOptions WRITE setSyncOptions RESET resetOptions NOTIFY optionsWereReset)
Q_PROPERTY(bool extraOptionsVisible READ extraOptionsVisible WRITE toggleExtraOptions NOTIFY extraOptionsToggled)
Q_PROPERTY(QString folderNameA READ folderNameA WRITE setFolderNameA NOTIFY folderNameAChanged)
Q_PROPERTY(QString folderNameB READ folderNameB WRITE setFolderNameB NOTIFY folderNameBChanged)
public:
FileSyncDialog(QWidget * parent = nullptr, const SyncProcess::SyncOptions & syncOptions = SyncProcess::SyncOptions());
inline SyncProcess::SyncOptions syncOptions() const { return m_syncOptions; }
void setSyncOptions(const SyncProcess::SyncOptions & syncOptions);
void resetOptions();
inline bool extraOptionsVisible() const { return m_extraOptionsVisible; }
void toggleExtraOptions(bool show);
inline QString folderNameA() const { return m_folderNameA; }
void setFolderNameA(const QString & name);
inline QString folderNameB() const { return m_folderNameB; }
void setFolderNameB(const QString & name);
public slots:
virtual void reject() override;
void setStatusText(const QString & text, int type = QtWarningMsg);
bool validate();
signals:
void startSync();
void stopSync();
void folderNameAChanged(const QString & name);
void folderNameBChanged(const QString & name);
void extraOptionsToggled(bool show);
void optionsWereReset();
private slots:
void setupUi();
void toggleSync(bool);
void onSyncStarted();
void onSyncFinished();
void updateRunningState();
void onStatusUpdate(const SyncProcess::SyncStatus & stat);
void adjustSizeDelayed();
private:
SyncProcess::SyncOptions m_syncOptions;
QString m_folderNameA;
QString m_folderNameB;
bool m_running;
bool m_extraOptionsVisible;
QGroupBox * ui_optionsPanel;
QWidget * ui_extraOptions;
ProgressWidget * ui_progress;
QDialogButtonBox * ui_buttonBox;
QToolButton * ui_btnStartStop;
QToolButton * ui_btnClose;
QLabel * ui_statusLabel;
};
#endif // FILESYNCDIALOG_H
+55 -22
View File
@@ -1,12 +1,36 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "downloaddialog.h"
#include "ui_downloaddialog.h"
#include <QTime>
#include "constants.h"
#include "helpers.h"
#include <QTime>
downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt):
QDialog(parent),
ui(new Ui::downloadDialog),
file(NULL)
reply(nullptr),
file(nullptr),
aborted(false)
{
ui->setupUi(this);
setWindowIcon(CompanionIcon("fwpreferences.png"));
@@ -21,7 +45,7 @@ downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt):
file = new QFile(tgt);
if (!file->open(QIODevice::WriteOnly)) {
QMessageBox::critical(this, "Companion",
QMessageBox::critical(this, CPN_STR_APP_NAME,
tr("Unable to save the file %1: %2.")
.arg(tgt).arg(file->errorString()));
QTimer::singleShot(0, this, SLOT(fileError()));
@@ -40,29 +64,38 @@ downloadDialog::~downloadDialog()
delete file;
}
void downloadDialog::reject()
{
if (reply && reply->isRunning()) {
aborted = true;
reply->abort(); // this will call QNetworkReply::finished()
return;
}
QDialog::reject();
}
void downloadDialog::httpFinished()
{
file->flush();
file->close();
file->flush();
file->close();
bool ok = true;
if (reply->error()) {
file->remove();
QMessageBox::information(this, tr("Companion"),
tr("Download failed: %1.")
.arg(reply->errorString()));
ok = false;
}
const bool ok = !(reply->error() || aborted);
if (!ok) {
file->remove();
if (!aborted)
QMessageBox::information(this, CPN_STR_APP_NAME, tr("Download failed: %1.").arg(reply->errorString()));
}
reply->deleteLater();
reply = 0;
delete file;
file = NULL;
reply->deleteLater();
reply = nullptr;
file->deleteLater();
file = nullptr;
if (ok)
accept();
else
reject();
if (ok)
accept();
else
reject();
}
void downloadDialog::httpReadyRead()
@@ -91,7 +124,7 @@ void downloadDialog::closeEvent( QCloseEvent * event)
// Delay closing 2 seconds to avoid unpleasant flashing download dialogs
QTime closeTime= QTime::currentTime().addSecs(2);
while( QTime::currentTime() < closeTime )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
event->accept();
}
+27 -4
View File
@@ -1,5 +1,25 @@
#ifndef DOWNLOADDIALOG_H
#define DOWNLOADDIALOG_H
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _DOWNLOADDIALOG_H_
#define _DOWNLOADDIALOG_H_
#include <QtWidgets>
#include <QNetworkAccessManager>
@@ -19,6 +39,9 @@ public:
explicit downloadDialog(QWidget *parent = 0, QString src = "", QString tgt = "");
~downloadDialog();
public slots:
virtual void reject() override;
private slots:
void fileError();
void httpFinished();
@@ -34,7 +57,7 @@ private:
QNetworkAccessManager qnam;
QNetworkReply *reply;
QFile *file;
bool aborted;
};
#endif // DOWNLOADDIALOG_H
#endif // _DOWNLOADDIALOG_H_
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+46
View File
@@ -0,0 +1,46 @@
set(firmwares_SRCS
boards.cpp
curvereference.cpp
customfunctiondata.cpp
eeprominterface.cpp
generalsettings.cpp
gvardata.cpp
io_data.cpp
logicalswitchdata.cpp
modeldata.cpp
moduledata.cpp
multiprotocols.cpp
radiodata.cpp
radiodataconversionstate.cpp
rawsource.cpp
rawswitch.cpp
sensordata.cpp
telem_data.cpp
er9x/er9xeeprom.cpp
er9x/er9xinterface.cpp
ersky9x/ersky9xeeprom.cpp
ersky9x/ersky9xinterface.cpp
opentx/opentxeeprom.cpp
opentx/opentxinterface.cpp
)
string(REPLACE ".cpp" ".h" firmwares_HDRS "${firmwares_SRCS}")
list(APPEND firmwares_HDRS
eepromimportexport.h
moduledata.h
)
add_library(firmwares ${firmwares_SRCS} ${firmwares_HDRS})
target_link_libraries(firmwares ${CPN_COMMON_LIB} Qt5::Core Qt5::Xml Qt5::Widgets)
target_include_directories(firmwares
PRIVATE
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/er9x"
"${CMAKE_CURRENT_LIST_DIR}/ersky9x"
"${CMAKE_CURRENT_LIST_DIR}/opentx"
)
+427
View File
@@ -0,0 +1,427 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "boards.h"
#include "macros.h"
// TODO remove all those constants
// Update: These are now all only used within this class.
// External access is only via getEEpromSize() and getFlashSize()
#define EESIZE_STOCK 2048
#define EESIZE_M128 4096
#define EESIZE_GRUVIN9X 4096
#define EESIZE_TARANIS (32*1024)
#define EESIZE_SKY9X (128*4096)
#define EESIZE_9XRPRO (128*4096)
#define EESIZE_MAX EESIZE_9XRPRO
// getFlashSize() (and these macros) is only used by radiointerface::getDfuArgs (perhaps can find a better way?)
#define FSIZE_STOCK (64*1024)
#define FSIZE_M128 (128*1024)
#define FSIZE_GRUVIN9X (256*1024)
#define FSIZE_TARANIS (512*1024)
#define FSIZE_SKY9X (256*1024)
#define FSIZE_9XRPRO (512*1024)
#define FSIZE_HORUS (2048*1024)
#define FSIZE_MAX FSIZE_HORUS
using namespace Board;
void Boards::setBoardType(const Type & board)
{
if (board >= BOARD_UNKNOWN && board < BOARD_ENUM_COUNT)
m_boardType = board;
else
m_boardType = BOARD_UNKNOWN;
}
uint32_t Boards::getFourCC(Type board)
{
switch (board) {
case BOARD_X12S:
return 0x3478746F;
case BOARD_X10:
return 0x3778746F;
case BOARD_TARANIS_XLITE:
return 0x3978746F;
case BOARD_TARANIS_X7:
return 0x3678746F;
case BOARD_TARANIS_X9E:
return 0x3578746F;
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
return 0x3378746F;
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
return 0x3278746F;
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return 0x3178746F;
default:
return 0;
}
}
const int Boards::getEEpromSize(Board::Type board)
{
switch (board) {
case BOARD_STOCK:
return EESIZE_STOCK;
case BOARD_M128:
return EESIZE_M128;
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return EESIZE_GRUVIN9X;
case BOARD_SKY9X:
return EESIZE_SKY9X;
case BOARD_9XRPRO:
case BOARD_AR9X:
return EESIZE_9XRPRO;
case BOARD_TARANIS_XLITE:
case BOARD_TARANIS_X7:
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
case BOARD_TARANIS_X9E:
return EESIZE_TARANIS;
case BOARD_UNKNOWN:
return EESIZE_MAX;
default:
return 0; // unlimited
}
}
const int Boards::getFlashSize(Type board)
{
switch (board) {
case BOARD_STOCK:
return FSIZE_STOCK;
case BOARD_M128:
return FSIZE_M128;
case BOARD_MEGA2560:
case BOARD_GRUVIN9X:
return FSIZE_GRUVIN9X;
case BOARD_SKY9X:
return FSIZE_SKY9X;
case BOARD_9XRPRO:
case BOARD_AR9X:
return FSIZE_9XRPRO;
case BOARD_TARANIS_XLITE:
case BOARD_TARANIS_X7:
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
case BOARD_TARANIS_X9E:
return FSIZE_TARANIS;
case BOARD_X12S:
case BOARD_X10:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
default:
return 0;
}
}
const SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
{
if (index < 0)
return {SWITCH_NOT_AVAILABLE, CPN_STR_UNKNOWN_ITEM};
if (IS_TARANIS_XLITE(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_2POS, "SC"},
{SWITCH_2POS, "SD"}
};
if (index < DIM(switches))
return switches[index];
}
if (IS_TARANIS_X7(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_2POS, "SF"},
{SWITCH_TOGGLE, "SH"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_HORUS_OR_TARANIS(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_2POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_TOGGLE, "SH"},
{SWITCH_3POS, "SI"},
{SWITCH_3POS, "SJ"},
{SWITCH_3POS, "SK"},
{SWITCH_3POS, "SL"},
{SWITCH_3POS, "SM"},
{SWITCH_3POS, "SN"},
{SWITCH_3POS, "SO"},
{SWITCH_3POS, "SP"},
{SWITCH_3POS, "SQ"},
{SWITCH_3POS, "SR"}
};
if (index < DIM(switches))
return switches[index];
}
else {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "3POS"},
{SWITCH_2POS, "THR"},
{SWITCH_2POS, "RUD"},
{SWITCH_2POS, "ELE"},
{SWITCH_2POS, "AIL"},
{SWITCH_2POS, "GEA"},
{SWITCH_TOGGLE, "TRN"}
};
if (index < DIM(switches))
return switches[index];
}
return {SWITCH_NOT_AVAILABLE, CPN_STR_UNKNOWN_ITEM};
}
const int Boards::getCapability(Board::Type board, Board::Capability capability)
{
switch (capability) {
case Sticks:
return 4;
case Pots:
if (IS_TARANIS_SMALL(board))
return 2;
else if (IS_TARANIS_X9E(board))
return 4;
else
return 3;
case FactoryInstalledPots:
if (IS_TARANIS_X9(board))
return 2;
else
return getCapability(board, Pots);
case Sliders:
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board))
return 2;
else
return 0;
case MouseAnalogs:
if (IS_HORUS_X12S(board))
return 2;
else
return 0;
case MaxAnalogs:
return getCapability(board, Board::Sticks) + getCapability(board, Board::Pots) + getCapability(board, Board::Sliders) + getCapability(board, Board::MouseAnalogs);
case MultiposPots:
return IS_HORUS_OR_TARANIS(board) ? 3 : 0;
case MultiposPotsPositions:
return IS_HORUS_OR_TARANIS(board) ? 6 : 0;
case Switches:
if (IS_TARANIS_X9E(board))
return 18;
else if (IS_TARANIS_X7(board))
return 6;
else if (IS_TARANIS_XLITE(board))
return 4;
else if (IS_HORUS_OR_TARANIS(board))
return 8;
else
return 7;
case FactoryInstalledSwitches:
if (IS_TARANIS_X9E(board))
return 8;
else
return getCapability(board, Switches);
case SwitchPositions:
if (IS_HORUS_OR_TARANIS(board))
return getCapability(board, Switches) * 3;
else
return 9;
case NumTrims:
if (IS_HORUS(board))
return 6;
else
return 4;
case NumTrimSwitches:
return getCapability(board, NumTrims) * 2;
}
return 0;
}
const QString Boards::getAxisName(int index)
{
const QString axes[] = {
tr("Left Horizontal"),
tr("Left Vertical"),
tr("Right Vertical"),
tr("Right Horizontal"),
tr("Aux. 1"),
tr("Aux. 2"),
};
if (index < (int)DIM(axes))
return axes[index];
else
return tr("Unknown");
}
const QString Boards::getAnalogInputName(Board::Type board, int index)
{
if (index < 0)
return CPN_STR_UNKNOWN_ITEM;
if (index < getBoardCapability(board, Board::Sticks)) {
const QString sticks[] = {
tr("Rud"),
tr("Ele"),
tr("Thr"),
tr("Ail")
};
return sticks[index];
}
index -= getCapability(board, Board::Sticks);
if (IS_9X(board) || IS_2560(board) || IS_SKY9X(board)) {
const QString pots[] = {
"P1",
"P2",
"P3"
};
if (index < DIM(pots))
return pots[index];
}
else if (IS_TARANIS_X9E(board)) {
const QString pots[] = {
"F1",
"F2",
"F3",
"F4",
"S1",
"S2",
"LS",
"RS"
};
if (index < DIM(pots))
return pots[index];
}
else if (IS_TARANIS(board)) {
const QString pots[] = {
"S1",
"S2",
"S3",
"LS",
"RS"
};
if (index < DIM(pots))
return pots[index];
}
else if (IS_HORUS_X12S(board)) {
const QString pots[] = {
"S1",
"6P",
"S2",
"L1",
"L2",
"LS",
"RS",
"JSx",
"JSy"
};
if (index < DIM(pots))
return pots[index];
}
else if (IS_HORUS_X10(board)) {
const QString pots[] = {
"S1",
"6P",
"S2",
"LS",
"RS"
};
if (index < DIM(pots))
return pots[index];
}
return CPN_STR_UNKNOWN_ITEM;
}
const bool Boards::isBoardCompatible(Type board1, Type board2)
{
return (getFourCC(board1) == getFourCC(board2));
}
const QString Boards::getBoardName(Board::Type board)
{
switch (board) {
case BOARD_STOCK:
return "9X";
case BOARD_M128:
return "9X128";
case BOARD_GRUVIN9X:
return "Gruvin9x";
case BOARD_MEGA2560:
return "MEGA2560";
case BOARD_TARANIS_X7:
return "Taranis X7/X7S";
case BOARD_TARANIS_XLITE:
return "Taranis X-Lite";
case BOARD_TARANIS_X9D:
return "Taranis X9D";
case BOARD_TARANIS_X9DP:
return "Taranis X9D+";
case BOARD_TARANIS_X9E:
return "Taranis X9E";
case BOARD_SKY9X:
return "Sky9x";
case BOARD_9XRPRO:
return "9XR-PRO";
case BOARD_AR9X:
return "AR9X";
case BOARD_X12S:
return "Horus X12S";
case BOARD_X10:
return "Horus X10/X10S";
default:
return tr("Unknown");
}
}
+206
View File
@@ -0,0 +1,206 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _BOARDS_H_
#define _BOARDS_H_
#include <QtCore>
#include <QObject>
#include <QString>
// TODO create a Board class with all these functions
namespace Board {
enum Type
{
BOARD_UNKNOWN = -1,
BOARD_STOCK = 0,
BOARD_M128,
BOARD_MEGA2560,
BOARD_GRUVIN9X,
BOARD_SKY9X,
BOARD_9XRPRO,
BOARD_AR9X,
BOARD_TARANIS_X7,
BOARD_TARANIS_X9D,
BOARD_TARANIS_X9DP,
BOARD_TARANIS_X9E,
BOARD_X12S,
BOARD_X10,
BOARD_TARANIS_XLITE,
BOARD_ENUM_COUNT
};
enum PotType
{
POT_NONE,
POT_WITH_DETENT,
POT_MULTIPOS_SWITCH,
POT_WITHOUT_DETENT
};
enum SliderType
{
SLIDER_NONE,
SLIDER_WITH_DETENT
};
enum SwitchType
{
SWITCH_NOT_AVAILABLE,
SWITCH_TOGGLE,
SWITCH_2POS,
SWITCH_3POS
};
enum StickAxes {
STICK_AXIS_LH = 0,
STICK_AXIS_LV,
STICK_AXIS_RV,
STICK_AXIS_RH,
STICK_AXIS_COUNT
};
enum TrimAxes {
TRIM_AXIS_LH = 0,
TRIM_AXIS_LV,
TRIM_AXIS_RV,
TRIM_AXIS_RH,
TRIM_AXIS_T5,
TRIM_AXIS_T6,
TRIM_AXIS_COUNT
};
enum TrimSwitches
{
TRIM_SW_LH_DEC,
TRIM_SW_LH_INC,
TRIM_SW_LV_DEC,
TRIM_SW_LV_INC,
TRIM_SW_RV_DEC,
TRIM_SW_RV_INC,
TRIM_SW_RH_DEC,
TRIM_SW_RH_INC,
TRIM_SW_T5_DEC,
TRIM_SW_T5_INC,
TRIM_SW_T6_DEC,
TRIM_SW_T6_INC,
TRIM_SW_COUNT
};
enum Capability {
Sticks,
Pots,
FactoryInstalledPots,
Sliders,
MouseAnalogs,
MaxAnalogs,
MultiposPots,
MultiposPotsPositions,
Switches,
SwitchPositions,
FactoryInstalledSwitches,
NumTrims,
NumTrimSwitches
};
struct SwitchInfo
{
SwitchType config;
QString name;
};
struct SwitchPosition {
SwitchPosition(unsigned int index, unsigned int position):
index(index),
position(position)
{
}
unsigned int index;
unsigned int position;
};
}
class Boards
{
Q_DECLARE_TR_FUNCTIONS(Boards)
public:
Boards(Board::Type board)
{
setBoardType(board);
}
void setBoardType(const Board::Type & board);
Board::Type getBoardType() const { return m_boardType; }
const uint32_t getFourCC() const { return getFourCC(m_boardType); }
const int getEEpromSize() const { return getEEpromSize(m_boardType); }
const int getFlashSize() const { return getFlashSize(m_boardType); }
const Board::SwitchInfo getSwitchInfo(int index) const { return getSwitchInfo(m_boardType, index); }
const int getCapability(Board::Capability capability) const { return getCapability(m_boardType, capability); }
const QString getAnalogInputName(int index) const { return getAnalogInputName(m_boardType, index); }
const bool isBoardCompatible(Board::Type board2) const { return isBoardCompatible(m_boardType, board2); }
static uint32_t getFourCC(Board::Type board);
static const int getEEpromSize(Board::Type board);
static const int getFlashSize(Board::Type board);
static const Board::SwitchInfo getSwitchInfo(Board::Type board, int index);
static const int getCapability(Board::Type board, Board::Capability capability);
static const QString getAxisName(int index);
static const QString getAnalogInputName(Board::Type board, int index);
static const bool isBoardCompatible(Board::Type board1, Board::Type board2);
static const QString getBoardName(Board::Type board);
protected:
Board::Type m_boardType;
};
// temporary aliases for transition period, use Boards class instead.
#define getBoardCapability(b__, c__) Boards::getCapability(b__, c__)
#define IS_9X(board) (board==Board::BOARD_STOCK || board==Board::BOARD_M128)
#define IS_STOCK(board) (board==Board::BOARD_STOCK)
#define IS_M128(board) (board==Board::BOARD_M128)
#define IS_2560(board) (board==Board::BOARD_GRUVIN9X || board==Board::BOARD_MEGA2560)
#define IS_SKY9X(board) (board==Board::BOARD_SKY9X || board==Board::BOARD_9XRPRO || board==Board::BOARD_AR9X)
#define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO)
#define IS_TARANIS_XLITE(board) (board==Board::BOARD_TARANIS_XLITE)
#define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
#define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
#define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP)
#define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
#define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
#define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board))
#define IS_TARANIS_SMALL(board) (board==Board::BOARD_TARANIS_X7 || board==Board::BOARD_TARANIS_XLITE)
#define IS_TARANIS_NOT_X9E(board) (IS_TARANIS(board) && !IS_TARANIS_X9E(board))
#define IS_HORUS_X12S(board) (board==Board::BOARD_X12S)
#define IS_HORUS_X10(board) (board==Board::BOARD_X10)
#define IS_HORUS(board) (IS_HORUS_X12S(board) || IS_HORUS_X10(board))
#define IS_HORUS_OR_TARANIS(board) (IS_HORUS(board) || IS_TARANIS(board))
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board))
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
#define HAS_LARGE_LCD(board) (IS_HORUS(board) || IS_TARANIS_X9(board))
#endif // _BOARDS_H_
@@ -0,0 +1,63 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "curvereference.h"
#include "helpers.h" // for Helpers::getAdjustmentString()
#include "radiodata.h" // for ModelData
QString CurveReference::toString(const ModelData * model, bool verbose) const
{
if (value == 0) {
return "----";
}
QString ret;
unsigned idx = abs(value) - 1;
switch(type) {
case CURVE_REF_DIFF:
ret = tr("Diff(%1)").arg(Helpers::getAdjustmentString(value, model));
break;
case CURVE_REF_EXPO:
ret = tr("Expo(%1)").arg(Helpers::getAdjustmentString(value, model));
break;
case CURVE_REF_FUNC:
ret = QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3);
if (verbose)
ret = tr("Function(%1)").arg(ret);
break;
default:
if (model)
ret = model->curves[idx].nameToString(idx);
else
ret = CurveData().nameToString(idx);
if (verbose)
ret = tr("Curve(%1)").arg(ret);
if (value < 0)
ret.prepend(CPN_STR_SW_INDICATOR_REV);
break;
}
return ret;
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef CURVEREFERENCE_H
#define CURVEREFERENCE_H
#include <QtCore>
class ModelData;
class CurveReference {
Q_DECLARE_TR_FUNCTIONS(CurveReference)
public:
enum CurveRefType {
CURVE_REF_DIFF,
CURVE_REF_EXPO,
CURVE_REF_FUNC,
CURVE_REF_CUSTOM
};
CurveReference() { clear(); }
CurveReference(CurveRefType type, int value):
type(type),
value(value)
{
}
void clear() { memset(this, 0, sizeof(CurveReference)); }
CurveRefType type;
int value;
QString toString(const ModelData * model = NULL, bool verbose = true) const;
};
#endif // CURVEREFERENCE_H
@@ -0,0 +1,264 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "customfunctiondata.h"
#include "eeprominterface.h"
#include "radiodata.h"
#include "radiodataconversionstate.h"
void CustomFunctionData::clear()
{
memset(reinterpret_cast<void *>(this), 0, sizeof(CustomFunctionData));
if (!getCurrentFirmware()->getCapability(SafetyChannelCustomFunction)) {
func = FuncTrainer;
}
}
bool CustomFunctionData::isEmpty() const
{
return (swtch.type == SWITCH_TYPE_NONE);
}
QString CustomFunctionData::nameToString(int index, bool globalContext) const
{
return RadioData::getElementName((globalContext ? tr("GF") : tr("SF")), index+1, 0, true);
}
QString CustomFunctionData::funcToString(const ModelData * model) const
{
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return tr("Trainer");
else if (func == FuncTrainerRUD)
return tr("Trainer RUD");
else if (func == FuncTrainerELE)
return tr("Trainer ELE");
else if (func == FuncTrainerTHR)
return tr("Trainer THR");
else if (func == FuncTrainerAIL)
return tr("Trainer AIL");
else if (func == FuncInstantTrim)
return tr("Instant Trim");
else if (func == FuncPlaySound)
return tr("Play Sound");
else if (func == FuncPlayHaptic)
return tr("Haptic");
else if (func == FuncReset)
return tr("Reset");
else if (func >= FuncSetTimer1 && func <= FuncSetTimer3)
return tr("Set Timer %1").arg(func-FuncSetTimer1+1);
else if (func == FuncVario)
return tr("Vario");
else if (func == FuncPlayPrompt)
return tr("Play Track");
else if (func == FuncPlayBoth)
return tr("Play Both");
else if (func == FuncPlayValue)
return tr("Play Value");
else if (func == FuncPlayScript)
return tr("Play Script");
else if (func == FuncLogs)
return tr("SD Logs");
else if (func == FuncVolume)
return tr("Volume");
else if (func == FuncBacklight)
return tr("Backlight");
else if (func == FuncScreenshot)
return tr("Screenshot");
else if (func == FuncBackgroundMusic)
return tr("Background Music");
else if (func == FuncBackgroundMusicPause)
return tr("Background Music Pause");
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast)
return tr("Adjust %1").arg(RawSource(SOURCE_TYPE_GVAR, func-FuncAdjustGV1).toString(model));
else if (func == FuncSetFailsafeInternalModule)
return tr("SetFailsafe Int. Module");
else if (func == FuncSetFailsafeExternalModule)
return tr("SetFailsafe Ext. Module");
else if (func == FuncRangeCheckInternalModule)
return tr("RangeCheck Int. Module");
else if (func == FuncRangeCheckExternalModule)
return tr("RangeCheck Ext. Module");
else if (func == FuncBindInternalModule)
return tr("Bind Int. Module");
else if (func == FuncBindExternalModule)
return 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(const ModelData * model, QComboBox * b, unsigned int value = 0)
{
int val = 0;
Firmware * firmware = Firmware::getCurrentVariant();
Board::Type board = firmware->getBoard();
b->addItem(tr("Timer1"), val++);
b->addItem(tr("Timer2"), val++);
if (IS_ARM(board)) {
b->addItem( tr("Timer3"), val++);
}
b->addItem(tr("Flight"), val++);
b->addItem(tr("Telemetry"), val++);
int reCount = firmware->getCapability(RotaryEncoders);
if (reCount == 1) {
b->addItem(tr("Rotary Encoder"), val++);
}
else if (reCount == 2) {
b->addItem(tr("REa"), val++);
b->addItem(tr("REb"), val++);
}
if ((int)value < b->count()) {
b->setCurrentIndex(value);
}
if (model && IS_ARM(board)) {
for (int i=0; i<CPN_MAX_SENSORS; ++i) {
if (model->sensorData[i].isAvailable()) {
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
b->addItem(item.toString(model), val+i);
if ((int)value == val+i) {
b->setCurrentIndex(b->count()-1);
}
}
}
}
}
void CustomFunctionData::populatePlaySoundParams(QStringList & qs)
{
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
}
void CustomFunctionData::populateHapticParams(QStringList & qs)
{
qs << "0" << "1" << "2" << "3";
}
QString CustomFunctionData::paramToString(const ModelData * model) const
{
QStringList qs;
if (func <= FuncInstantTrim) {
return QString("%1").arg(param);
}
else if (func == FuncLogs) {
return QString("%1").arg(param/10.0) + tr("s");
}
else if (func == FuncPlaySound) {
CustomFunctionData::populatePlaySoundParams(qs);
if (param>=0 && param<(int)qs.count())
return qs.at(param);
else
return tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func == FuncPlayHaptic) {
CustomFunctionData::populateHapticParams(qs);
if (param>=0 && param<(int)qs.count())
return qs.at(param);
else
return tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func == FuncReset) {
QComboBox cb;
CustomFunctionData::populateResetParams(model, &cb);
int pos = cb.findData(param);
if (pos >= 0)
return cb.itemText(pos);
else
return tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) {
RawSource item(param);
return item.toString(model);
}
else if (func == FuncPlayPrompt || func == FuncPlayBoth) {
if ( getCurrentFirmware()->getCapability(VoicesAsNumbers)) {
return QString("%1").arg(param);
}
else {
return paramarm;
}
}
else if (func >= FuncAdjustGV1 && func < FuncCount) {
switch (adjustMode) {
case FUNC_ADJUST_GVAR_CONSTANT:
return tr("Value ")+QString("%1").arg(param);
case FUNC_ADJUST_GVAR_SOURCE:
case FUNC_ADJUST_GVAR_GVAR:
return RawSource(param).toString();
case FUNC_ADJUST_GVAR_INCDEC:
float val;
QString unit;
if (IS_ARM(getCurrentBoard())) {
val = param * model->gvarData[func - FuncAdjustGV1].multiplierGet();
unit = model->gvarData[func - FuncAdjustGV1].unitToString();
}
else {
val = param;
unit = "";
}
return QString("Increment: %1%2").arg(val).arg(unit);
}
}
return "";
}
QString CustomFunctionData::repeatToString() const
{
if (repeatParam == -1) {
return tr("played once, not during startup");
}
else if (repeatParam == 0) {
return "";
}
else {
unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10;
return tr("repeat(%1s)").arg(step*repeatParam);
}
}
QString CustomFunctionData::enabledToString() const
{
if ((func >= FuncOverrideCH1 && func <= FuncOverrideCH32) ||
(func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) ||
(func == FuncReset) ||
(func >= FuncSetTimer1 && func <= FuncSetTimer2) ||
(func == FuncVolume) ||
(func == FuncBacklight) ||
(func <= FuncInstantTrim)) {
if (!enabled) {
return tr("DISABLED");
}
}
return "";
}
void CustomFunctionData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent(tr("CFN"), 8);
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
swtch.convert(cstate);
if (func == FuncVolume || func == FuncBacklight || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
}
}
@@ -0,0 +1,112 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef CUSTOMFUNCTIONDATA_H
#define CUSTOMFUNCTIONDATA_H
#include "boards.h"
#include "constants.h"
#include "rawswitch.h"
#include <QtCore>
#include <QComboBox>
class Firmware;
class ModelData;
class GeneralSettings;
class RadioDataConversionState;
enum AssignFunc {
FuncOverrideCH1 = 0,
FuncOverrideCH32 = FuncOverrideCH1+CPN_MAX_CHNOUT-1,
FuncTrainer,
FuncTrainerRUD,
FuncTrainerELE,
FuncTrainerTHR,
FuncTrainerAIL,
FuncInstantTrim,
FuncPlaySound,
FuncPlayHaptic,
FuncReset,
FuncSetTimer1,
FuncSetTimer2,
FuncSetTimer3,
FuncVario,
FuncPlayPrompt,
FuncPlayBoth,
FuncPlayValue,
FuncPlayScript,
FuncLogs,
FuncVolume,
FuncBacklight,
FuncScreenshot,
FuncBackgroundMusic,
FuncBackgroundMusicPause,
FuncAdjustGV1,
FuncAdjustGVLast = FuncAdjustGV1+CPN_MAX_GVARS-1,
FuncSetFailsafeInternalModule,
FuncSetFailsafeExternalModule,
FuncRangeCheckInternalModule,
FuncRangeCheckExternalModule,
FuncBindInternalModule,
FuncBindExternalModule,
FuncCount,
FuncReserve = -1
};
enum GVarAdjustModes
{
FUNC_ADJUST_GVAR_CONSTANT,
FUNC_ADJUST_GVAR_SOURCE,
FUNC_ADJUST_GVAR_GVAR,
FUNC_ADJUST_GVAR_INCDEC
};
class CustomFunctionData {
Q_DECLARE_TR_FUNCTIONS(CustomFunctionData)
public:
CustomFunctionData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch;
AssignFunc func;
int param;
char paramarm[10];
unsigned int enabled; // TODO perhaps not any more the right name
unsigned int adjustMode;
int repeatParam;
void clear();
bool isEmpty() const;
QString nameToString(int index, bool globalContext = false) const;
QString funcToString(const ModelData * model = NULL) const;
QString paramToString(const ModelData * model) const;
QString repeatToString() const;
QString enabledToString() const;
static void populateResetParams(const ModelData * model, QComboBox * b, unsigned int value);
static void populatePlaySoundParams(QStringList & qs);
static void populateHapticParams(QStringList & qs);
void convert(RadioDataConversionState & cstate);
};
#endif // CUSTOMFUNCTIONDATA_H
File diff suppressed because it is too large Load Diff
+185
View File
@@ -0,0 +1,185 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "eeprominterface.h"
#include "firmwares/opentx/opentxeeprom.h"
#include "firmwareinterface.h"
#include <QtCore>
#include <QMessageBox>
#include <bitset>
float ValToTim(int value)
{
return ((value < -109 ? 129+value : (value < 7 ? (113+value)*5 : (53+value)*10))/10.0);
}
int TimToVal(float value)
{
int temp;
if (value>60) {
temp=136+round((value-60));
}
else if (value>2) {
temp=20+round((value-2.0)*2.0);
}
else {
temp=round(value*10.0);
}
return (temp-129);
}
/*
* EEpromInterface globals
*/
// TODO: No globals
QList<EEPROMInterface *> eepromInterfaces;
void unregisterEEpromInterfaces()
{
foreach(EEPROMInterface * intf, eepromInterfaces) {
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
delete intf;
}
OpenTxEepromCleanup();
}
#if 0 // TODO: remove if unused, currently commented out in mdiChild.cpp
// TODO: No GUI here, e.g. return string list instead
void EEPROMInterface::showEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
{
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList errorsList;
errorsList << tr("Possible causes for this:");
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << tr("- Eeprom is from a newer version of OpenTX"); }
if (errors.test(NOT_OPENTX)) { errorsList << tr("- Eeprom is not from OpenTX"); }
if (errors.test(NOT_TH9X)) { errorsList << tr("- Eeprom is not from Th9X"); }
if (errors.test(NOT_GRUVIN9X)) { errorsList << tr("- Eeprom is not from Gruvin9X"); }
if (errors.test(NOT_ERSKY9X)) { errorsList << tr("- Eeprom is not from ErSky9X"); }
if (errors.test(NOT_ER9X)) { errorsList << tr("- Eeprom is not from Er9X"); }
if (errors.test(WRONG_SIZE)) { errorsList << tr("- Eeprom size is invalid"); }
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << tr("- Eeprom file system is invalid"); }
if (errors.test(UNKNOWN_BOARD)) { errorsList << tr("- Eeprom is from a unknown board"); }
if (errors.test(WRONG_BOARD)) { errorsList << tr("- Eeprom is from the wrong board"); }
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << tr("- Eeprom backup not supported"); }
if (errors.test(UNKNOWN_ERROR)) { errorsList << tr("- Something that couldn't be guessed, sorry"); }
if (errors.test(HAS_WARNINGS)) {
errorsList << tr("Warning:");
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << tr("- 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();
}
#endif
// TODO: No GUI here, e.g. return string list instead
void EEPROMInterface::showEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
{
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << tr("- 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 << tr("- Your eeprom is from an old version of OpenTX, upgrading!\n To keep your original file as a backup, please choose File -> Save As specifying a different name."); }
QMessageBox msgBox(parent);
msgBox.setWindowTitle(title);
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(tr("Warnings!"));
msgBox.setInformativeText(warningsList.join("\n"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
/*
* Firmware
*/
// static
QVector<Firmware *> Firmware::registeredFirmwares;
Firmware * Firmware::defaultVariant = NULL;
Firmware * Firmware::currentVariant = NULL;
// static
Firmware * Firmware::getFirmwareForId(const QString & id)
{
foreach(Firmware * firmware, registeredFirmwares) {
Firmware * result = firmware->getFirmwareVariant(id);
if (result) {
return result;
}
}
return defaultVariant;
}
unsigned int Firmware::getVariantNumber()
{
unsigned int result = 0;
const Firmware * base = getFirmwareBase();
QStringList options = id.mid(base->getId().length()+1).split("-", QString::SkipEmptyParts);
foreach(QString option, options) {
foreach(OptionsGroup group, base->opts) {
foreach(Option opt, group) {
if (opt.name == option) {
result += opt.variant;
}
}
}
}
return result;
}
void Firmware::addLanguage(const char * lang)
{
languages.push_back(lang);
}
//void Firmware::addTTSLanguage(const char * lang)
//{
// ttslanguages.push_back(lang);
//}
void Firmware::addOption(const char * option, const QString & tooltip, unsigned variant)
{
addOption(Option(option, tooltip, variant));
}
void Firmware::addOption(const Option & option)
{
addOptionsGroup({option});
}
void Firmware::addOptionsGroup(const OptionsGroup & options)
{
this->opts.append(options);
}
+424
View File
@@ -0,0 +1,424 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _EEPROMINTERFACE_H_
#define _EEPROMINTERFACE_H_
#include "boards.h"
#include "macros.h"
#include "radiodata.h"
#include "../../radio/src/definitions.h"
#include "simulatorinterface.h"
#include <QtCore>
#include <QStringList>
#include <QList>
#include <QDebug>
#include <iostream>
const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4},
{1, 3, 2, 4},
{4, 2, 3, 1},
{4, 3, 2, 1} };
enum Capability {
Models,
ModelName,
FlightModes,
FlightModesName,
FlightModesHaveFades,
Imperial,
Mixes,
Timers,
TimersName,
VoicesAsNumbers,
VoicesMaxLength,
MultiLangVoice,
ModelImage,
CustomFunctions,
SafetyChannelCustomFunction,
LogicalSwitches,
CustomAndSwitches,
HasNegAndSwitches,
LogicalSwitchesExt,
RotaryEncoders,
Outputs,
ChannelsName,
ExtraInputs,
TrimsRange,
ExtendedTrimsRange,
NumCurves,
NumCurvePoints,
OffsetWeight,
Simulation,
SoundMod,
SoundPitch,
MaxVolume,
MaxContrast,
MinContrast,
Haptic,
HasBeeper,
ModelTrainerEnable,
HasExpoNames,
HasNoExpo,
HasMixerNames,
HasCvNames,
HasPxxCountry,
HasPPMStart,
HasGeneralUnits,
HasFAIMode,
OptrexDisplay,
PPMExtCtrl,
PPMFrameLength,
Telemetry,
TelemetryUnits,
TelemetryBars,
Heli,
Gvars,
GvarsInCS,
GvarsAreNamed,
GvarsFlightModes,
GvarsName,
NoTelemetryProtocol,
TelemetryCustomScreens,
TelemetryCustomScreensFieldsPerLine,
TelemetryMaxMultiplier,
HasVario,
HasVarioSink,
HasFailsafe,
HasSoundMixer,
NumModules,
HasModuleR9MFlex,
HasModuleR9MMini,
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HastxCurrentCalibration,
HasVolume,
HasBrightness,
PerModelTimers,
SlowScale,
SlowRange,
PermTimers,
HasSDLogs,
CSFunc,
LcdWidth,
LcdHeight,
LcdDepth,
GetThrSwitch,
HasDisplayText,
HasTopLcd,
GlobalFunctions,
VirtualInputs,
InputsLength,
TrainerInputs,
RtcTime,
SportTelemetry,
LuaScripts,
LuaInputsPerScript,
LuaOutputsPerScript,
LimitsPer1000,
EnhancedCurves,
HasFasOffset,
HasMahPersistent,
SimulatorVariant,
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
HasBatMeterRange,
DangerousFunctions,
HasModelCategories
};
class EEPROMInterface
{
Q_DECLARE_TR_FUNCTIONS(EEPROMInterface)
public:
EEPROMInterface(Board::Type board):
board(board)
{
}
virtual ~EEPROMInterface() {}
inline Board::Type getBoard() { return board; }
virtual unsigned long load(RadioData &radioData, const uint8_t * eeprom, int size) = 0;
virtual unsigned long loadBackup(RadioData & radioData, const uint8_t * eeprom, int esize, int index) = 0;
virtual int save(uint8_t * eeprom, const RadioData & radioData, uint8_t version=0, uint32_t variant=0) = 0;
virtual int getSize(const ModelData &) = 0;
virtual int getSize(const GeneralSettings &) = 0;
//static void showEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
static void showEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
protected:
Board::Type board;
private:
EEPROMInterface();
};
/* EEPROM string conversion function (used only by er9xeeprom and ersky9xeeprom) */
inline void getEEPROMString(char *dst, const char *src, int size)
{
memcpy(dst, src, size);
dst[size] = '\0';
for (int i=size-1; i>=0; i--) {
if (dst[i] == ' ')
dst[i] = '\0';
else
break;
}
}
// (used only by er9xeeprom and ersky9xeeprom)
inline int applyStickMode(int stick, unsigned int mode)
{
if (mode == 0 || mode > 4) {
std::cerr << "Incorrect stick mode" << mode;
return stick;
}
if (stick >= 1 && stick <= 4)
return modn12x3[mode-1][stick-1];
else
return stick;
}
float ValToTim(int value);
int TimToVal(float value);
void registerEEpromInterfaces();
void unregisterEEpromInterfaces();
void registerOpenTxFirmwares();
void unregisterOpenTxFirmwares();
enum EepromLoadErrors {
ALL_OK,
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
};
class Firmware
{
Q_DECLARE_TR_FUNCTIONS(Firmware)
public:
struct Option {
const char * name = nullptr;
QString tooltip;
unsigned variant = 0;
explicit Option(const char * name, const QString & description, unsigned variant = 0) :
name(name), tooltip(description), variant(variant) { }
};
typedef QList<Option> OptionsGroup;
typedef QList<OptionsGroup> OptionsList;
explicit Firmware(const QString & id, const QString & name, Board::Type board) :
Firmware(nullptr, id, name, board)
{ }
explicit Firmware(Firmware * base, const QString & id, const QString & name, Board::Type board) :
id(id),
name(name),
board(board),
variantBase(0),
base(base),
eepromInterface(nullptr)
{ }
virtual ~Firmware() { }
inline const Firmware * getFirmwareBase() const
{
return base ? base : this;
}
virtual Firmware * getFirmwareVariant(const QString & id) { return NULL; }
unsigned int getVariantNumber();
virtual void addLanguage(const char * lang);
//virtual void addTTSLanguage(const char * lang);
virtual void addOption(const char * option, const QString & tooltip = QString(), unsigned variant = 0);
virtual void addOption(const Option & option);
virtual void addOptionsGroup(const OptionsGroup & options);
virtual QString getStampUrl() = 0;
virtual QString getReleaseNotesUrl() = 0;
virtual QString getFirmwareUrl() = 0;
Board::Type getBoard() const
{
return board;
}
void setEEpromInterface(EEPROMInterface * eeprom)
{
eepromInterface = eeprom;
}
EEPROMInterface * getEEpromInterface()
{
return eepromInterface;
}
QString getName() const
{
return name;
}
QString getId() const
{
return id;
}
QList<const char *> languageList() const
{
return languages;
}
OptionsList optionGroups() const
{
return opts;
}
virtual int getCapability(Capability) = 0;
virtual QString getAnalogInputName(unsigned int index) = 0;
virtual QTime getMaxTimerStart() = 0;
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
const int getFlashSize();
static Firmware * getFirmwareForId(const QString & id);
static QVector<Firmware *> getRegisteredFirmwares()
{
return registeredFirmwares;
}
static void addRegisteredFirmware(Firmware * fw)
{
registeredFirmwares.append(fw);
}
static Firmware * getDefaultVariant()
{
return defaultVariant;
}
static void setDefaultVariant(Firmware * value)
{
defaultVariant = value;
}
static Firmware * getCurrentVariant()
{
return currentVariant;
}
static void setCurrentVariant(Firmware * value)
{
currentVariant = value;
}
protected:
QString id;
QString name;
Board::Type board;
unsigned int variantBase;
Firmware * base;
EEPROMInterface * eepromInterface;
QList<const char *> languages;
//QList<const char *> ttslanguages;
OptionsList opts;
static QVector<Firmware *> registeredFirmwares;
static Firmware * defaultVariant;
static Firmware * currentVariant;
};
inline Firmware * getCurrentFirmware()
{
return Firmware::getCurrentVariant();
}
inline EEPROMInterface * getCurrentEEpromInterface()
{
return Firmware::getCurrentVariant()->getEEpromInterface();
}
inline Board::Type getCurrentBoard()
{
return Firmware::getCurrentVariant()->getBoard();
}
inline int divRoundClosest(const int n, const int d)
{
return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d);
}
inline int calcRESXto100(int x)
{
return divRoundClosest(x*100, 1024);
}
extern QList<EEPROMInterface *> eepromInterfaces;
#endif // _EEPROMINTERFACE_H_
+27 -17
View File
@@ -1,3 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <algorithm>
#include "er9xeeprom.h"
#include "helpers.h"
@@ -45,7 +65,7 @@ t_Er9xTrainerData::t_Er9xTrainerData()
t_Er9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
for (int i=0; i<CPN_MAX_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
@@ -61,26 +81,20 @@ Er9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
result.version = myVers;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
for (int i=0; i<CPN_MAX_STICKSnPOTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.currModelIndex = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.trainer = trainer;
result.blightinv=blightinv;
result.stickScroll=stickScroll;
result.crosstrim=crosstrim;
result.hideNameOnSplash=hideNameOnSplash;
result.enablePpmsim=enablePpmsim;
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
@@ -103,9 +117,6 @@ Er9xGeneral::operator GeneralSettings ()
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.disablePotScroll=(disablePotScroll==1);
result.disableBG=(disableBG==1);
result.frskyinternalalarm = frskyinternalalarm;
result.backlightMode = 0;
if (lightSw == 22) {
@@ -126,7 +137,6 @@ Er9xGeneral::operator GeneralSettings ()
result.speakerPitch = speakerPitch;
result.hapticStrength = hapticStrength - 3;
result.speakerMode = speakerMode;
result.switchWarningStates =switchWarningStates;
return result;
}
@@ -402,8 +412,8 @@ t_Er9xModelData::operator ModelData ()
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
for (int ch = 0; ch < 4 && e < CPN_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < CPN_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
@@ -426,7 +436,7 @@ t_Er9xModelData::operator ModelData ()
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
if (e < CPN_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
@@ -440,7 +450,7 @@ t_Er9xModelData::operator ModelData ()
}
}
for (int i=0; i<NUM_STICKS; i++)
for (int i=0; i<CPN_MAX_STICKS; i++)
c9x.flightModeData[0].trim[i] = trim[i];
for (int i=0; i<ER9X_MAX_CURVE5; i++) {
+16 -11
View File
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
* Copyright (C) OpenTX
*
* Based on th9x -> http://code.google.com/p/th9x/
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,10 +16,10 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef er9xeeprom_h
#define er9xeeprom_h
#ifndef _ER9XEEPROM_H_
#define _ER9XEEPROM_H_
#include <inttypes.h>
#include "eeprominterface.h"
@@ -29,7 +34,7 @@
#define ER9X_NUM_CHNOUT 16 //number of real outputchannels CH1-CH8
#define ER9X_NUM_CSW 12 //number of custom switches
#define NUM_STICKSnPOTS 7 //number of sticks and pots
#define CPN_MAX_STICKSnPOTS 7 //number of sticks and pots
#define ER9X_MAX_GVARS 7
#define ER9X_MAX_MODES 4
@@ -54,9 +59,9 @@ PACK(typedef struct t_Er9xTrainerData {
PACK(typedef struct t_Er9xGeneral {
uint8_t myVers;
int16_t calibMid[NUM_STICKSnPOTS];
int16_t calibSpanNeg[NUM_STICKSnPOTS];
int16_t calibSpanPos[NUM_STICKSnPOTS];
int16_t calibMid[CPN_MAX_STICKSnPOTS];
int16_t calibSpanNeg[CPN_MAX_STICKSnPOTS];
int16_t calibSpanPos[CPN_MAX_STICKSnPOTS];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
@@ -131,7 +136,7 @@ PACK(typedef struct t_Er9xLimitData {
#define MLTPX_REP 2
PACK(typedef struct t_Er9xMixData {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t destCh; // 1..CPN_MAX_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
@@ -257,4 +262,4 @@ PACK(typedef struct t_Er9xModelData {
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
}) Er9xModelData;
#endif
#endif // _ER9XEEPROM_H_
+69 -71
View File
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,15 +16,14 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <iostream>
#include "er9xinterface.h"
#include "er9xeeprom.h"
#include "simulator/er9xsimulator.h"
#include "file.h"
#include "appdata.h"
#include "rlefile.h"
// #include "appdata.h"
// #include <iostream>
#include <bitset>
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
@@ -28,8 +32,8 @@
#define FILE_MODEL(n) (1+n)
Er9xInterface::Er9xInterface():
EEPROMInterface(BOARD_STOCK),
efile(new RleFile())
EEPROMInterface(Board::BOARD_STOCK),
efile(new RleFile())
{
}
@@ -43,20 +47,6 @@ const char * Er9xInterface::getName()
return "Er9x";
}
const int Er9xInterface::getEEpromSize()
{
QString avrMCU = g.mcu();
if (avrMCU==QString("m128")) {
return 2*EESIZE_STOCK;
}
return EESIZE_STOCK;
}
const int Er9xInterface::getMaxModels()
{
return 16;
}
inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
{
for (int i=0; i<2; i++) {
@@ -89,23 +79,26 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
#if 0
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying er9x xml import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying er9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Er9xGeneral er9xGeneral;
memset(&er9xGeneral,0,sizeof(er9xGeneral));
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
if (!loadRadioSettingsDataXML(&doc, &er9xGeneral)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
} else {
radioData.generalSettings=er9xGeneral;
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
}
for(int i=0; i<getMaxModels(); i++)
{
else {
radioData.generalSettings=er9xGeneral;
dbg << "version " << (unsigned int)er9xGeneral.myVers << " ";
}
for (int i=0; i<getCapability(Models); i++) {
Er9xModelData er9xModel;
memset(&er9xModel,0,sizeof(er9xModel));
if(loadModelDataXML(&doc, &er9xModel, i)) {
@@ -113,43 +106,46 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
radioData.models[i] = er9xModel;
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
#endif
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying er9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != getEEpromSize()) {
std::cout << "wrong size\n";
if (size != Boards::getEEpromSize(Board::BOARD_STOCK)) {
dbg << "wrong size";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_STOCK)) {
dbg << "wrong file system";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Er9xGeneral er9xGeneral;
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
std::cout << "no\n";
dbg << "no";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)er9xGeneral.myVers << " ";
switch(er9xGeneral.myVers) {
case 3:
std::cout << "(old gruvin9x) ";
dbg << "(old gruvin9x) ";
case 4:
// case 5:
case 6:
@@ -159,21 +155,21 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
case 10:
break;
default:
std::cout << "not er9x\n";
dbg << "not er9x";
errors.set(NOT_ER9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = er9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
for (int i=0; i<getCapability(Models); i++) {
Er9xModelData er9xModel;
efile->openRd(FILE_MODEL(i));
if (!efile->readRlc1((uint8_t*)&er9xModel, sizeof(Er9xModelData))) {
@@ -182,29 +178,21 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
else {
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = er9xModel;
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Er9xInterface::loadBackup(RadioData &radioData, const uint8_t *eeprom, int esize, int index)
{
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)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Er9xInterface::getSize(const ModelData &model)
{
return 0;
@@ -230,11 +218,11 @@ int Er9xInterface::isAvailable(PulsesProtocol prot, int port)
void Er9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
{
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(value);
e.appendChild(t);
pe->appendChild(e);
QDomElement e = qdoc->createElement(name);
QDomText t = qdoc->createTextNode(name);
t.setNodeValue(value);
e.appendChild(t);
pe->appendChild(e);
}
void Er9xInterface::appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite)
@@ -276,15 +264,15 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
return md;
}
bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
bool Er9xInterface::loadRadioSettingsDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
{
//look for "GENERAL_DATA" tag
// look for "GENERAL_DATA" tag
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
if(gde.isNull()) // couldn't find
return false;
//load cdata into tgen
// load cdata into tgen
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
@@ -296,17 +284,17 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
}
n = n.nextSibling();
}
//check version?
// check version?
return true;
}
bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum)
{
//look for MODEL_DATA with modelNum attribute.
//if modelNum = -1 then just pick the first one
// look for MODEL_DATA with modelNum attribute.
// if modelNum = -1 then just pick the first one
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
//cycle through nodes to find correct model number
// cycle through nodes to find correct model number
QDomNode k = ndl.at(0);
if(modelNum>=0) {
while(!k.isNull()) {
@@ -317,11 +305,11 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
}
}
if(k.isNull()) // couldn't find
if (k.isNull()) // couldn't find
return false;
//load cdata into tgen
// load cdata into tgen
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
@@ -333,6 +321,16 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
}
n = n.nextSibling();
}
//check version?
// check version?
return true;
}
int Er9xInterface::getCapability(Capability capability)
{
switch (capability) {
case Models:
return 16;
default:
return 0;
}
}
+22 -14
View File
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
* Copyright (C) OpenTX
*
* Based on th9x -> http://code.google.com/p/th9x/
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,13 +16,15 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef er9x_interface_h
#define er9x_interface_h
#ifndef _ER9XINTERFACE_H_
#define _ER9XINTERFACE_H_
#include <QtXml>
#include "eeprominterface.h"
#include "er9xeeprom.h"
class RleFile;
class Er9xInterface : public EEPROMInterface
@@ -30,27 +37,28 @@ class Er9xInterface : public EEPROMInterface
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadBackup(RadioData &, const 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 save(uint8_t * eeprom, const RadioData & radioData, uint8_t version=0, uint32_t variant=0)
{
return 0;
}
virtual int getSize(const ModelData &);
virtual int getSize(const GeneralSettings &settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int getCapability(Capability capability);
protected:
RleFile *efile;
RleFile * efile;
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
@@ -63,10 +71,10 @@ class Er9xInterface : public EEPROMInterface
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 loadRadioSettingsDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
};
#endif
#endif // _ER9XINTERFACE_H_
@@ -1,15 +0,0 @@
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
add_custom_command(
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(er9x-simulator er9xsimulator.cpp)
@@ -1,224 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "firmwares/er9x/er9xsimulator.h"
#include "firmwares/er9x/er9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define TELEMETRY_FRSKY
#define PHASES
#undef min
#undef max
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#include <exception>
namespace Er9x {
#include "simpgmspace.h"
#include "er9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "simpgmspace.cpp"
#include "templates.cpp"
#include "frsky.cpp"
#include "audio.cpp"
uint8_t pxxFlag = 0;
int16_t g_anas[7];
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define TRIMS_GPIO_REG_LHL pind
#define TRIMS_GPIO_REG_LVD pind
#define TRIMS_GPIO_REG_RVU pind
#define TRIMS_GPIO_REG_RHL pind
#define TRIMS_GPIO_REG_LHR pind
#define TRIMS_GPIO_REG_LVU pind
#define TRIMS_GPIO_REG_RVD pind
#define TRIMS_GPIO_REG_RHR pind
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
#define TRIM_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
}
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin &= ~(mask); else pin |= (mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
switch (swtch) {
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
default:
break;
}
}
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin |= mask; else pin &= ~mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
}
}
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Er9x;
Er9xSimulator::Er9xSimulator(Er9xInterface * er9xInterface):
er9xInterface(er9xInterface)
{
}
bool Er9xSimulator::timer10ms()
{
AUDIO_DRIVER(); // the tone generator
AUDIO_HEARTBEAT(); // the queue processing
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Er9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::start(RadioData &radioData, bool tests)
{
er9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Er9xSimulator::stop()
{
StopMainThread();
}
void Er9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
outputs.beep = audio.busy();
}
void Er9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Er9xSimulator::setTrim(unsigned int idx, int value)
{
Er9x::setTrim(idx, value);
}
void Er9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Er9x::getTrims(trims.values);
}
const char * Er9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -1,70 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef er9x_simulator_h
#define er9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Er9xInterface;
class Er9xSimulator : public SimulatorInterface {
public:
Er9xSimulator(Er9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Er9xInterface * er9xInterface;
};
#endif
@@ -1,3 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <algorithm>
#include "helpers.h"
#include "ersky9xeeprom.h"
@@ -55,7 +75,7 @@ t_Ersky9xTrainerData::t_Ersky9xTrainerData()
t_Ersky9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
for (int i=0; i<CPN_MAX_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
@@ -73,13 +93,13 @@ Ersky9xGeneral::operator GeneralSettings ()
result.version = myVers;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
for (int i=0; i<CPN_MAX_STICKSnPOTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.currModelIndex = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
@@ -100,7 +120,6 @@ Ersky9xGeneral::operator GeneralSettings ()
result.trainer = trainer;
result.view = std::min((uint8_t)4, view);
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = disableSwitchWarning ? 0 : -1;
result.disableMemoryWarning = disableMemoryWarning;
switch (beeperVal) {
@@ -123,8 +142,6 @@ Ersky9xGeneral::operator GeneralSettings ()
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.disablePotScroll=(disablePotScroll==1);
result.disableBG=(disableBG==1);
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
@@ -132,7 +149,6 @@ Ersky9xGeneral::operator GeneralSettings ()
result.speakerPitch = speakerPitch;
result.hapticStrength = hapticStrength - 3;
result.speakerMode = speakerMode;
result.switchWarningStates = switchWarningStates;
result.speakerVolume = volume;
result.backlightBright = bright ;
result.txCurrentCalibration = current_calib;
@@ -530,8 +546,8 @@ t_Ersky9xModelData_v10::operator ModelData ()
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
for (int ch = 0; ch < 4 && e < CPN_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < CPN_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
@@ -554,7 +570,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
if (e < CPN_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
@@ -568,7 +584,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
}
for (int i=0; i<NUM_STICKS; i++)
for (int i=0; i<CPN_MAX_STICKS; i++)
c9x.flightModeData[0].trim[i] = trim[i];
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
@@ -645,8 +661,8 @@ t_Ersky9xModelData_v11::operator ModelData ()
// expoData
int e = 0;
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
for (int ch = 0; ch < 4 && e < CPN_MAX_EXPOS; ch++) {
for (int dr = 0, pos = 0; dr < 3 && e < CPN_MAX_EXPOS; dr++, pos++) {
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
dr = 2;
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
@@ -669,7 +685,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
else {
c9x.expoData[e].mode = 2;
if (e < C9X_MAX_EXPOS - 1) {
if (e < CPN_MAX_EXPOS - 1) {
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
@@ -683,7 +699,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
}
for (int i=0; i<NUM_STICKS; i++)
for (int i=0; i<CPN_MAX_STICKS; i++)
c9x.flightModeData[0].trim[i] = trim[i];
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
+17 -12
View File
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
* Copyright (C) OpenTX
*
* Based on th9x -> http://code.google.com/p/th9x/
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,10 +16,10 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ersky9xeeprom_h
#define ersky9xeeprom_h
#ifndef _ERSKY9XEEPROM_H_
#define _ERSKY9XEEPROM_H_
#include <inttypes.h>
#include "eeprominterface.h"
@@ -40,7 +45,7 @@ extern RawSwitch getEr9xTimerMode(int mode);
#define ERSKY9X_NUM_VOICE 8
#define ERSKY9X_MAX_GVARS 7
#define NUM_STICKSnPOTS 7 //number of sticks and pots
#define CPN_MAX_STICKSnPOTS 7 //number of sticks and pots
PACK(typedef struct t_Ersky9xTrainerMix {
uint8_t srcChn:3; //0-7 = ch1-8
@@ -62,9 +67,9 @@ PACK(typedef struct t_Ersky9xTrainerData {
PACK(typedef struct t_Ersky9xGeneral {
uint8_t myVers;
int16_t calibMid[NUM_STICKSnPOTS];
int16_t calibSpanNeg[NUM_STICKSnPOTS];
int16_t calibSpanPos[NUM_STICKSnPOTS];
int16_t calibMid[CPN_MAX_STICKSnPOTS];
int16_t calibSpanNeg[CPN_MAX_STICKSnPOTS];
int16_t calibSpanPos[CPN_MAX_STICKSnPOTS];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
@@ -143,7 +148,7 @@ PACK(typedef struct t_Ersky9xLimitData {
#define MLTPX_REP 2
PACK(typedef struct t_Ersky9xMixData_v10 {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t destCh; // 1..CPN_MAX_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
@@ -165,7 +170,7 @@ PACK(typedef struct t_Ersky9xMixData_v10 {
}) Ersky9xMixData_v10;
PACK(typedef struct t_Ersky9xMixData_v11 {
uint8_t destCh; // 1..C9X_NUM_CHNOUT
uint8_t destCh; // 1..CPN_MAX_CHNOUT
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
@@ -428,4 +433,4 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
t_Ersky9xModelData_v11() { memset(this, 0, sizeof(t_Ersky9xModelData_v11)); }
}) Ersky9xModelData_v11;
#endif
#endif // _ERSKY9XEEPROM_H_
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,14 +16,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <iostream>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "simulator/ersky9xsimulator.h"
#include "file.h"
#include "rlefile.h"
#include <iostream>
#include <bitset>
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
@@ -30,7 +34,7 @@
#define FILE_TMP (1+16)
Ersky9xInterface::Ersky9xInterface():
EEPROMInterface(BOARD_SKY9X),
EEPROMInterface(Board::BOARD_SKY9X),
efile(new RleFile())
{
}
@@ -45,16 +49,6 @@ const char * Ersky9xInterface::getName()
return "Ersky9x";
}
const int Ersky9xInterface::getEEpromSize()
{
return EESIZE_SKY9X;
}
const int Ersky9xInterface::getMaxModels()
{
return 20;
}
inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mode)
{
for (int i=0; i<2; i++) {
@@ -119,71 +113,77 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
}
#if 0
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::cout << "trying ersky9x xml import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying ersky9x xml import... ";
std::bitset<NUM_ERRORS> errors;
Ersky9xGeneral ersky9xGeneral;
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
if(!loadRadioSettingsDataXML(&doc, &ersky9xGeneral)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
else {
radioData.generalSettings=ersky9xGeneral;
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
}
for(int i=0; i<getMaxModels(); i++) {
for(int i=0; i<getCapability(Models); i++) {
if (ersky9xGeneral.myVers == 10) {
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
#endif
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
QDebug dbg = qDebug();
dbg.setAutoInsertSpaces(false);
dbg << "trying ersky9x import... ";
std::bitset<NUM_ERRORS> errors;
if (size != EESIZE_SKY9X) {
std::cout << "wrong size\n";
if (size != Boards::getEEpromSize(Board::BOARD_SKY9X)) {
dbg << "wrong size";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_SKY9X)) {
dbg << "wrong file system";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
Ersky9xGeneral ersky9xGeneral;
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
std::cout << "no\n";
dbg << "no";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
dbg << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
switch(ersky9xGeneral.myVers) {
case 10:
@@ -191,26 +191,26 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
case 11:
break;
default:
std::cout << "not ersky9x\n";
dbg << "not ersky9x";
errors.set(NOT_ERSKY9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
std::cout << "ko\n";
dbg << "ko";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
radioData.generalSettings = ersky9xGeneral;
for (int i=0; i<getMaxModels(); i++) {
for (int i=0; i<getCapability(Models); i++) {
uint8_t buffer[4096];
uint size;
memset(buffer,0,sizeof(buffer));
efile->openRd(FILE_MODEL(i));
// if (!efile->readRlc2((uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData))) {
size=efile->readRlc2(buffer, 4096);
size = efile->readRlc2(buffer, 4096);
if (!size) {
radioData.models[i].clear();
}
@@ -226,29 +226,21 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
radioData.models[i] = ersky9xModel;
}
}
}
}
std::cout << "ok\n";
dbg << "ok";
errors.set(ALL_OK);
return errors.to_ulong();
}
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, const uint8_t *eeprom, int esize, int index)
{
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)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Ersky9xInterface::getSize(const ModelData & model)
{
return 0;
@@ -320,15 +312,15 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
return md;
}
bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
bool Ersky9xInterface::loadRadioSettingsDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
{
//look for "GENERAL_DATA" tag
// look for "GENERAL_DATA" tag
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
if(gde.isNull()) // couldn't find
return false;
//load cdata into tgen
// load cdata into tgen
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
@@ -340,7 +332,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
}
n = n.nextSibling();
}
//check version?
// check version?
return true;
}
@@ -350,11 +342,11 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
T ersky9xModel;
memset(&ersky9xModel, 0, sizeof(ersky9xModel));
//look for MODEL_DATA with modelNum attribute.
// look for MODEL_DATA with modelNum attribute.
//if modelNum = -1 then just pick the first one
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
//cycle through nodes to find correct model number
// cycle through nodes to find correct model number
QDomNode k = ndl.at(0);
if (modelNum>=0) {
while(!k.isNull()) {
@@ -368,7 +360,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
if (k.isNull()) // couldn't find
return false;
//load cdata into tgen
// load cdata into tgen
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
while (!n.isNull()) {
if (n.isCDATASection()) {
@@ -385,3 +377,13 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
*model = ersky9xModel;
return true;
}
int Ersky9xInterface::getCapability(Capability capability)
{
switch (capability) {
case Models:
return 20;
default:
return 0;
}
}
@@ -1,7 +1,12 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,13 +16,15 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ersky9x_interface_h
#define ersky9x_interface_h
#ifndef _ERSKY9XINTERFACE_H_
#define _ERSKY9XINTERFACE_H_
#include <QtXml>
#include "eeprominterface.h"
#include "ersky9xeeprom.h"
class RleFile;
class Ersky9xInterface : public EEPROMInterface
@@ -30,27 +37,27 @@ class Ersky9xInterface : public EEPROMInterface
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
virtual unsigned long loadBackup(RadioData &, const uint8_t * eeprom, int esize, int index);
virtual int save(uint8_t * eeprom, const RadioData & radioData, uint8_t version=0, uint32_t variant=0)
{
return 0;
}
virtual int getSize(const ModelData &);
virtual int getSize(const GeneralSettings & settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
virtual int getCapability(Capability capability);
protected:
RleFile *efile;
RleFile * efile;
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
@@ -63,11 +70,11 @@ class Ersky9xInterface : public EEPROMInterface
QDomElement getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver); //parse out data to XML format
bool loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
bool loadRadioSettingsDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
template <class T>
bool loadModelDataXML(QDomDocument * qdoc, ModelData * model, int modelNum, int stickMode); // get data from XML
};
#endif
#endif // _ERSKY9XINTERFACE_H_
@@ -1,15 +0,0 @@
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
add_custom_command(
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(ersky9x-simulator ersky9xsimulator.cpp)
@@ -1,247 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "firmwares/ersky9x/ersky9xsimulator.h"
#include "firmwares/ersky9x/ersky9xinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
#define PCBSKY9X
#define PCBSKY
#define STAMP
#define TELEMETRY_FRSKY
#define FRSKY_HUB
#define WS_HOW_HIGH
#define TEMPLATES
#define HELI
#define HAPTIC
#define AUDIO
#define REVB
#define NUM_POTS 3
#define NUM_SLIDERS 0
#define SWSRC_SW1 DSW_SW1
#undef min
#undef max
#include <exception>
namespace Ersky9x {
#include "../ersky9x/timers.h"
#include "../ersky9x/ersky9x.cpp"
#include "../ersky9x/stamp.cpp"
#include "../ersky9x/menus.cpp"
#include "../ersky9x/pers.cpp"
#include "../ersky9x/file.cpp"
#include "../ersky9x/lcd.cpp"
#include "../ersky9x/drivers.cpp"
#include "../ersky9x/logicio.cpp"
#include "../ersky9x/timers.cpp"
#include "../ersky9x/simpgmspace.cpp"
#include "../ersky9x/templates.cpp"
#include "../ersky9x/frsky.cpp"
#include "../ersky9x/audio.cpp"
#include "../ersky9x/sound.cpp"
#include "../ersky9x/diskio.cpp"
#define isBacklightEnabled() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
//uint8_t pxxFlag = 0;
int16_t g_anas[7];
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 1500;
else
return g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trim[idx] = value;
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++)
values[i] = g_model.trim[i];
}
#define SWITCH_CASE(swtch, pin, mask) \
case swtch: \
if (state) pin |= (mask); else pin &= ~(mask); \
break;
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
case swtch: \
if (state < 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
if (state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
break;
void simuSetSwitch(uint8_t swtch, int8_t state)
{
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
switch (swtch) {
SWITCH_CASE(0, PIOC->PIO_PDSR, 1<<20)
SWITCH_CASE(1, PIOA->PIO_PDSR, 1<<15)
SWITCH_CASE(2, PIOC->PIO_PDSR, 1<<31)
SWITCH_3_CASE(3, PIOC->PIO_PDSR, PIOC->PIO_PDSR, 0x00004000, 0x00000800)
SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2)
SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16)
SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8)
default:
break;
}
}
#define KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
#define KEYS_GPIO_REG_EXIT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_UP PIOC->PIO_PDSR
#define KEYS_GPIO_REG_DOWN PIOC->PIO_PDSR
#define KEYS_GPIO_REG_RIGHT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_LEFT PIOC->PIO_PDSR
#define KEYS_GPIO_PIN_MENU 0x00000020
#define KEYS_GPIO_PIN_EXIT 0x01000000
#define KEYS_GPIO_PIN_UP 0x00000002
#define KEYS_GPIO_PIN_DOWN 0x00000020
#define KEYS_GPIO_PIN_RIGHT 0x00000010
#define KEYS_GPIO_PIN_LEFT 0x00000008
#define KEY_CASE(key, pin, mask) \
case key: \
if (state) pin &= ~mask; else pin |= mask;\
break;
void simuSetKey(uint8_t key, bool state)
{
switch (key) {
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
}
}
#define TRIMS_GPIO_REG_LHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LVD PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RVU PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LHR PIOB->PIO_PDSR
#define TRIMS_GPIO_REG_LVU PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RVD PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RHR PIOC->PIO_PDSR
#define PIN_TRIM_LH_L 0x00800000
#define PIN_TRIM_LV_DN 0x01000000
#define PIN_TRIM_RV_UP 0x00000002
#define PIN_TRIM_RH_L 0x00000001
#define PIN_TRIM_LH_R 0x00000010
#define PIN_TRIM_LV_UP 0x10000000
#define PIN_TRIM_RV_DN 0x00000400
#define PIN_TRIM_RH_R 0x00000200
#define TRIM_CASE KEY_CASE
void simuSetTrim(uint8_t trim, bool state)
{
switch (trim) {
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
}
}
}
using namespace Ersky9x;
Ersky9xSimulator::Ersky9xSimulator(Ersky9xInterface * ersky9xInterface):
ersky9xInterface(ersky9xInterface)
{
}
bool Ersky9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Ersky9xSimulator::getLcd()
{
return (::uint8_t *)simuLcdBuf;
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
{
ersky9xInterface->save(Ersky9x::eeprom, radioData);
StartEepromThread(NULL);
StartMainThread(tests);
}
void Ersky9xSimulator::stop()
{
StopMainThread();
StopEepromThread();
}
void Ersky9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Ersky9xSimulator::setTrim(unsigned int idx, int value)
{
Ersky9x::setTrim(idx, value);
}
void Ersky9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Ersky9x::getTrims(trims.values);
}
const char * Ersky9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -1,70 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ersky9x_simulator_h
#define ersky9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Ersky9xInterface;
class Ersky9xSimulator : public SimulatorInterface {
public:
Ersky9xSimulator(Ersky9xInterface *);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
virtual bool timer10ms();
virtual uint8_t * getLcd();
virtual bool lcdChanged(bool & lightEnable);
virtual void setValues(TxInputs &inputs);
virtual void getValues(TxOutputs &outputs);
virtual void setTrim(unsigned int idx, int value);
virtual void getTrims(Trims & trims);
virtual unsigned int getPhase() { return 0; }
virtual const char * getPhaseName(unsigned int phase) { return 0; }
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Ersky9xInterface * ersky9xInterface;
};
#endif
+353
View File
@@ -0,0 +1,353 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "generalsettings.h"
#include "appdata.h"
#include "eeprominterface.h"
#include "radiodataconversionstate.h"
const uint8_t chout_ar[] = { // First number is 0..23 -> template setup, Second is relevant channel out
1,2,3,4 , 1,2,4,3 , 1,3,2,4 , 1,3,4,2 , 1,4,2,3 , 1,4,3,2,
2,1,3,4 , 2,1,4,3 , 2,3,1,4 , 2,3,4,1 , 2,4,1,3 , 2,4,3,1,
3,1,2,4 , 3,1,4,2 , 3,2,1,4 , 3,2,4,1 , 3,4,1,2 , 3,4,2,1,
4,1,2,3 , 4,1,3,2 , 4,2,1,3 , 4,2,3,1 , 4,3,1,2 , 4,3,2,1
};
bool GeneralSettings::switchPositionAllowedTaranis(int index) const
{
if (index == 0)
return true;
div_t qr = div(abs(index)-1, 3);
if (index < 0 && switchConfig[qr.quot] != Board::SWITCH_3POS)
return false;
else if (qr.rem == 1)
return switchConfig[qr.quot] == Board::SWITCH_3POS;
else
return switchConfig[qr.quot] != Board::SWITCH_NOT_AVAILABLE;
}
bool GeneralSettings::switchSourceAllowedTaranis(int index) const
{
return switchConfig[index] != Board::SWITCH_NOT_AVAILABLE;
}
bool GeneralSettings::isPotAvailable(int index) const
{
if (index<0 || index>getBoardCapability(getCurrentBoard(), Board::Pots)) return false;
return potConfig[index] != Board::POT_NONE;
}
bool GeneralSettings::isSliderAvailable(int index) const
{
if (index<0 || index>getBoardCapability(getCurrentBoard(), Board::Sliders)) return false;
return sliderConfig[index] != Board::SLIDER_NONE;
}
GeneralSettings::GeneralSettings()
{
memset(this, 0, sizeof(GeneralSettings));
contrast = 25;
for (int i=0; i < CPN_MAX_ANALOGS; ++i) {
calibMid[i] = 0x200;
calibSpanNeg[i] = 0x180;
calibSpanPos[i] = 0x180;
}
Firmware * firmware = Firmware::getCurrentVariant();
Board::Type board = firmware->getBoard();
// vBatWarn is voltage in 100mV, vBatMin is in 100mV but with -9V offset, vBatMax has a -12V offset
vBatWarn = 90;
if (IS_TARANIS_X9E(board) || IS_HORUS_X12S(board)) {
// NI-MH 9.6V
vBatWarn = 87;
vBatMin = -5; //8,5V
vBatMax = -5; //11,5V
}
else if (IS_TARANIS_XLITE(board) || IS_HORUS_X10(board)) {
// Lipo 2S
vBatWarn = 66;
vBatMin = -23; // 6.7V
vBatMax = -37; // 8.3V
}
else if (IS_TARANIS(board)) {
// NI-MH 7.2V, X9D, X9D+ and X7
vBatWarn = 65;
vBatMin = -30; //6V
vBatMax = -40; //8V
}
setDefaultControlTypes(board);
backlightMode = 3; // keys and sticks
// backlightBright = 0; // 0 = 100%
if (IS_HORUS(board)) {
backlightOffBright = 20;
}
if (IS_ARM(board)) {
speakerVolume = 12;
}
if (IS_HORUS(board)) {
strcpy(bluetoothName, "Horus");
}
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board)) {
strcpy(bluetoothName, "Taranis");
}
templateSetup = g.profile[g.sessionId()].channelOrder();
stickMode = g.profile[g.sessionId()].defaultMode();
QString t_calib = g.profile[g.sessionId()].stickPotCalib();
int potsnum = getBoardCapability(getCurrentBoard(), Board::Pots);
if (!t_calib.isEmpty()) {
QString t_trainercalib=g.profile[g.sessionId()].trainerCalib();
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.sessionId()].txVoltageCalibration();
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.sessionId()].txCurrentCalibration();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.sessionId()].ppmMultiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.sessionId()].gsStickMode();
uint8_t t_vBatWarn=(uint8_t)g.profile[g.sessionId()].vBatWarn();
QString t_DisplaySet=g.profile[g.sessionId()].display();
QString t_BeeperSet=g.profile[g.sessionId()].beeper();
QString t_HapticSet=g.profile[g.sessionId()].haptic();
QString t_SpeakerSet=g.profile[g.sessionId()].speaker();
QString t_CountrySet=g.profile[g.sessionId()].countryCode();
if ((t_calib.length()==(CPN_MAX_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) {
QString Byte;
int16_t byte16;
bool ok;
for (int i=0; i<(CPN_MAX_STICKS+potsnum); i++) {
Byte=t_calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
calibMid[i]=byte16;
Byte=t_calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
calibSpanNeg[i]=byte16;
Byte=t_calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
calibSpanPos[i]=byte16;
}
for (int i=0; i<4; i++) {
Byte=t_trainercalib.mid(i*4,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
trainer.calib[i]=byte16;
}
txCurrentCalibration=t_txCurrentCalibration;
txVoltageCalibration=t_txVoltageCalibration;
vBatWarn=t_vBatWarn;
PPM_Multiplier=t_PPM_Multiplier;
stickMode = t_stickMode;
}
if ((t_DisplaySet.length()==6) && (t_BeeperSet.length()==4) && (t_HapticSet.length()==6) && (t_SpeakerSet.length()==6)) {
uint8_t byte8u;
int8_t byte8;
bool ok;
byte8=(int8_t)t_DisplaySet.mid(0,2).toInt(&ok,16);
if (ok)
optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)t_DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok)
contrast=byte8u;
byte8u=(uint8_t)t_DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok)
backlightBright=byte8u;
byte8=(int8_t)t_BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok)
beeperMode=(BeeperMode)byte8;
byte8=(int8_t)t_BeeperSet.mid(2,2).toInt(&ok,16);
if (ok)
beeperLength=byte8;
byte8=(int8_t)t_HapticSet.mid(0,2).toUInt(&ok,16);
if (ok)
hapticMode=(BeeperMode)byte8;
byte8=(int8_t)t_HapticSet.mid(2,2).toInt(&ok,16);
if (ok)
hapticStrength=byte8;
byte8=(int8_t)t_HapticSet.mid(4,2).toInt(&ok,16);
if (ok)
hapticLength=byte8;
byte8u=(uint8_t)t_SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok)
speakerMode=byte8u;
byte8u=(uint8_t)t_SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok)
speakerPitch=byte8u;
byte8u=(uint8_t)t_SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok)
speakerVolume=byte8u;
if (t_CountrySet.length()==6) {
byte8u=(uint8_t)t_CountrySet.mid(0,2).toUInt(&ok,16);
if (ok)
countryCode=byte8u;
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
if (ok)
imperial=byte8u;
QString chars = t_CountrySet.mid(4, 2);
ttsLanguage[0] = chars[0].toLatin1();
ttsLanguage[1] = chars[1].toLatin1();
}
}
}
strcpy(themeName, "default");
ThemeOptionData option1 = { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 };
memcpy(&themeOptionValue[0], option1, sizeof(ThemeOptionData));
ThemeOptionData option2 = { 0x03, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 };
memcpy(&themeOptionValue[1], option2, sizeof(ThemeOptionData));
}
void GeneralSettings::setDefaultControlTypes(Board::Type board)
{
for (int i=0; i<getBoardCapability(board, Board::FactoryInstalledSwitches); i++) {
switchConfig[i] = Boards::getSwitchInfo(board, i).config;
}
// TODO: move to Boards, like with switches
if (IS_HORUS(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_MULTIPOS_SWITCH;
potConfig[2] = Board::POT_WITH_DETENT;
}
else if (IS_TARANIS_XLITE(board)) {
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITHOUT_DETENT;
}
else if (IS_TARANIS_X7(board)) {
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITH_DETENT;
}
else if (IS_TARANIS(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_WITH_DETENT;
}
else {
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITHOUT_DETENT;
potConfig[2] = Board::POT_WITHOUT_DETENT;
}
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board)) {
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
sliderConfig[2] = Board::SLIDER_WITH_DETENT;
sliderConfig[3] = Board::SLIDER_WITH_DETENT;
}
else if (IS_TARANIS_X9(board) || IS_HORUS_X10(board)) {
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
}
}
int GeneralSettings::getDefaultStick(unsigned int channel) const
{
if (channel >= CPN_MAX_STICKS)
return -1;
else
return chout_ar[4*templateSetup + channel] - 1;
}
RawSource GeneralSettings::getDefaultSource(unsigned int channel) const
{
int stick = getDefaultStick(channel);
if (stick >= 0)
return RawSource(SOURCE_TYPE_STICK, stick);
else
return RawSource(SOURCE_TYPE_NONE);
}
int GeneralSettings::getDefaultChannel(unsigned int stick) const
{
for (int i=0; i<4; i++){
if (getDefaultStick(i) == (int)stick)
return i;
}
return -1;
}
void GeneralSettings::convert(RadioDataConversionState & cstate)
{
// Here we can add explicit conversions when moving from one board to another
cstate.setOrigin(tr("Radio Settings"));
setDefaultControlTypes(cstate.toType); // start with default switches/pots/sliders
// Try to intelligently copy any custom control names
// SE and SG are skipped on X7 board
if (IS_TARANIS_X7(cstate.toType)) {
if (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType)) {
strncpy(switchName[4], switchName[5], sizeof(switchName[4]));
strncpy(switchName[5], switchName[7], sizeof(switchName[5]));
}
}
else if (IS_TARANIS_X7(cstate.fromType)) {
if (IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) {
strncpy(switchName[5], switchName[4], sizeof(switchName[5]));
strncpy(switchName[7], switchName[5], sizeof(switchName[7]));
}
}
// LS and RS sliders are after 2 aux sliders on X12 and X9E
if ((IS_HORUS_X12S(cstate.toType) || IS_TARANIS_X9E(cstate.toType)) && !IS_HORUS_X12S(cstate.fromType) && !IS_TARANIS_X9E(cstate.fromType)) {
strncpy(sliderName[0], sliderName[2], sizeof(sliderName[0]));
strncpy(sliderName[1], sliderName[3], sizeof(sliderName[1]));
}
else if (!IS_TARANIS_X9E(cstate.toType) && !IS_HORUS_X12S(cstate.toType) && (IS_HORUS_X12S(cstate.fromType) || IS_TARANIS_X9E(cstate.fromType))) {
strncpy(sliderName[2], sliderName[0], sizeof(sliderName[2]));
strncpy(sliderName[3], sliderName[1], sizeof(sliderName[3]));
}
if (IS_HORUS(cstate.toType)) {
// 6P switch is only on Horus (by default)
if (cstate.fromBoard.getCapability(Board::FactoryInstalledPots) == 2) {
strncpy(potName[2], potName[1], sizeof(potName[2]));
potName[1][0] = '\0';
}
}
if (IS_TARANIS(cstate.toType)) {
// No S3 pot on Taranis boards by default
if (cstate.fromBoard.getCapability(Board::FactoryInstalledPots) > 2)
strncpy(potName[1], potName[2], sizeof(potName[1]));
contrast = qBound<int>(getCurrentFirmware()->getCapability(MinContrast), contrast, getCurrentFirmware()->getCapability(MaxContrast));
}
// TODO: Would be nice at this point to have GUI pause and ask the user to set up any custom hardware they have on the destination radio.
// Convert all global functions (do this after HW adjustments)
for (int i=0; i<CPN_MAX_SPECIAL_FUNCTIONS; i++) {
customFn[i].convert(cstate.withComponentIndex(i));
}
}
+177
View File
@@ -0,0 +1,177 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef GENERALSETTINGS_H
#define GENERALSETTINGS_H
#include "boards.h"
#include "constants.h"
#include "customfunctiondata.h"
#include "rawsource.h"
#include <QtCore>
class Firmware;
class ModelData;
class GeneralSettings;
class RadioDataConversionState;
enum UartModes {
UART_MODE_NONE,
UART_MODE_TELEMETRY_MIRROR,
UART_MODE_TELEMETRY,
UART_MODE_SBUS_TRAINER,
UART_MODE_DEBUG
};
class TrainerMix {
public:
TrainerMix() { clear(); }
unsigned int src; // 0-7 = ch1-8
RawSwitch swtch;
int weight;
unsigned int mode; // off, add-mode, subst-mode
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(TrainerMix)); }
};
class TrainerData {
public:
TrainerData() { clear(); }
int calib[4];
TrainerMix mix[4];
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(TrainerData)); }
};
class GeneralSettings {
Q_DECLARE_TR_FUNCTIONS(GeneralSettings)
public:
enum BeeperMode {
BEEPER_QUIET = -2,
BEEPER_ALARMS_ONLY = -1,
BEEPER_NOKEYS = 0,
BEEPER_ALL = 1
};
GeneralSettings();
void convert(RadioDataConversionState & cstate);
void setDefaultControlTypes(Board::Type board);
int getDefaultStick(unsigned int channel) const;
RawSource getDefaultSource(unsigned int channel) const;
int getDefaultChannel(unsigned int stick) const;
unsigned int version;
unsigned int variant;
int calibMid[CPN_MAX_ANALOGS];
int calibSpanNeg[CPN_MAX_ANALOGS];
int calibSpanPos[CPN_MAX_ANALOGS];
unsigned int currModelIndex;
char currModelFilename[16+1];
unsigned int contrast;
unsigned int vBatWarn;
int txVoltageCalibration;
int txCurrentCalibration;
int vBatMin;
int vBatMax;
int backlightMode;
TrainerData trainer;
unsigned int view; // main screen view // TODO enum
bool disableThrottleWarning;
bool fai;
bool disableMemoryWarning;
BeeperMode beeperMode;
bool disableAlarmWarning;
bool disableRssiPoweroffAlarm;
unsigned int usbMode;
BeeperMode hapticMode;
unsigned int stickMode; // TODO enum
int timezone;
bool adjustRTC;
bool optrexDisplay;
unsigned int inactivityTimer;
bool minuteBeep;
bool preBeep;
bool flashBeep;
unsigned int splashMode;
int splashDuration;
unsigned int backlightDelay;
unsigned int templateSetup; //RETA order according to chout_ar array
int PPM_Multiplier;
int hapticLength;
unsigned int reNavigation;
unsigned int stickReverse;
unsigned int speakerPitch;
int hapticStrength;
unsigned int speakerMode;
char ownerName[10+1];
int beeperLength;
unsigned int gpsFormat;
int speakerVolume;
unsigned int backlightBright;
unsigned int backlightOffBright;
int switchesDelay;
int temperatureCalib;
int temperatureWarn;
unsigned int mAhWarn;
unsigned int mAhUsed;
unsigned int globalTimer;
char bluetoothName[10+1];
unsigned int bluetoothBaudrate;
unsigned int bluetoothMode;
unsigned int sticksGain;
unsigned int rotarySteps;
unsigned int countryCode;
bool jitterFilter;
unsigned int imperial;
char ttsLanguage[2+1];
int beepVolume;
int wavVolume;
int varioVolume;
int varioPitch;
int varioRange;
int varioRepeat;
int backgroundVolume;
unsigned int mavbaud;
unsigned int switchUnlockStates;
unsigned int hw_uartMode; // UartModes
unsigned int backlightColor;
CustomFunctionData customFn[CPN_MAX_SPECIAL_FUNCTIONS];
char switchName[CPN_MAX_SWITCHES][3+1];
unsigned int switchConfig[CPN_MAX_SWITCHES];
char stickName[CPN_MAX_STICKS][3+1];
char potName[CPN_MAX_KNOBS][3+1];
unsigned int potConfig[CPN_MAX_KNOBS];
char sliderName[CPN_MAX_SLIDERS][3+1];
unsigned int sliderConfig[CPN_MAX_SLIDERS];
char themeName[8+1];
typedef uint8_t ThemeOptionData[8+1];
ThemeOptionData themeOptionValue[5];
bool switchPositionAllowedTaranis(int index) const;
bool switchSourceAllowedTaranis(int index) const;
bool isPotAvailable(int index) const;
bool isSliderAvailable(int index) const;
};
#endif // GENERALSETTINGS_H
@@ -1,729 +0,0 @@
#include <stdlib.h>
#include <algorithm>
#include "helpers.h"
#include "gruvin9xeeprom.h"
#include <QObject>
#define EEPROM_VER 106
extern void getEEPROMZString(char *dst, const char *src, int size);
RawSwitch gruvin9xToSwitch(int8_t sw)
{
if (sw == 0)
return RawSwitch(SWITCH_TYPE_NONE);
else if (sw <= 9)
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
else
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
}
t_Gruvin9xTrainerMix_v103::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.weight = (25 * studWeight) / 8;
c9x.mode = mode;
return c9x;
}
t_Gruvin9xTrainerMix_v104::operator TrainerMix()
{
TrainerMix c9x;
c9x.src = srcChn;
c9x.weight = studWeight;
c9x.mode = mode;
return c9x;
}
t_Gruvin9xTrainerData_v103::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
t_Gruvin9xTrainerData_v104::operator TrainerData ()
{
TrainerData c9x;
for (int i=0; i<NUM_STICKS; i++) {
c9x.calib[i] = calib[i];
c9x.mix[i] = mix[i];
}
return c9x;
}
Gruvin9xGeneral_v103::operator GeneralSettings ()
{
GeneralSettings result;
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
result.trainer = trainer;
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = switchWarning;
switch (beeperVal) {
case 0:
result.beeperMode = GeneralSettings::BEEPER_QUIET;
break;
case 1:
result.beeperMode = GeneralSettings::BEEPER_NOKEYS;
break;
default:
result.beeperMode = GeneralSettings::BEEPER_ALL;
result.beeperLength = beeperVal - 4;
break;
}
result.disableMemoryWarning = disableMemoryWarning;
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.enableTelemetryAlarm = enableTelemetryAlarm;
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
// TODO frskyRssiAlarms[2];
return result;
}
Gruvin9xGeneral_v104::operator GeneralSettings ()
{
GeneralSettings result;
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
result.calibMid[i] = calibMid[i];
result.calibSpanNeg[i] = calibSpanNeg[i];
result.calibSpanPos[i] = calibSpanPos[i];
}
result.currModel = currModel;
result.contrast = contrast;
result.vBatWarn = vBatWarn;
result.txVoltageCalibration = txVoltageCalibration;
result.backlightMode = 0;
if (lightSw == 22) {
result.backlightMode = 4;
}
else if (lightAutoOff) {
result.backlightMode |= 1;
result.backlightDelay = lightAutoOff;
}
result.trainer = trainer;
result.view = view;
result.disableThrottleWarning = disableThrottleWarning;
result.switchWarning = switchWarning;
result.beeperMode = (GeneralSettings::BeeperMode)beeperVal;
result.disableMemoryWarning = disableMemoryWarning;
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
result.splashMode = disableSplashScreen;
result.enableTelemetryAlarm = enableTelemetryAlarm;
result.templateSetup = templateSetup;
result.PPM_Multiplier = PPM_Multiplier;
// TODO frskyRssiAlarms[2];
return result;
}
t_Gruvin9xExpoData::t_Gruvin9xExpoData()
{
memset(this, 0, sizeof(t_Gruvin9xExpoData));
}
t_Gruvin9xExpoData::operator ExpoData ()
{
ExpoData c9x;
c9x.mode = mode;
c9x.chn = chn;
c9x.swtch = gruvin9xToSwitch(swtch);
if (negPhase) {
c9x.flightModes= 1 << (phase -1);
} else if (phase==0) {
c9x.flightModes=0;
} else {
c9x.flightModes=63;
c9x.flightModes &= ~(1 << (phase -1));
}
c9x.weight = weight;
if (expo) {
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
c9x.curve.value = expo;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
t_Gruvin9xLimitData::t_Gruvin9xLimitData()
{
memset(this, 0, sizeof(t_Gruvin9xLimitData));
}
t_Gruvin9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
}
t_Gruvin9xMixData::t_Gruvin9xMixData()
{
memset(this, 0, sizeof(t_Gruvin9xMixData));
}
t_Gruvin9xMixData::operator MixData ()
{
MixData c9x;
c9x.destCh = destCh;
c9x.weight = weight;
c9x.swtch = gruvin9xToSwitch(swtch);
if (srcRaw == 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
}
else if (srcRaw <= 7) {
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
}
else if (srcRaw == 8) {
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
}
else if (srcRaw == 9) {
if (swtch < 0) {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, -swtch - 1);
c9x.weight = -weight;
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch - 1);
}
if (mltpx != MLTPX_REP)
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
}
else if (srcRaw <= 12) {
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
}
else if (srcRaw <= 20) {
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
}
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.sOffset = sOffset;
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
RawSource gruvin9xToSource(int8_t value)
{
if (value == 0) {
return RawSource(SOURCE_TYPE_NONE);
}
else if (value <= 7) {
return RawSource(SOURCE_TYPE_STICK, value - 1);
}
else if (value == 8) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value == 9) {
return RawSource(SOURCE_TYPE_MAX);
}
else if (value <= 12) {
return RawSource(SOURCE_TYPE_CYC, value-10);
}
else if (value <= 20) {
return RawSource(SOURCE_TYPE_PPM, value-13);
}
else if (value <= 36) {
return RawSource(SOURCE_TYPE_CH, value-21);
}
else {
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
}
}
Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
{
LogicalSwitchData c9x;
c9x.func = func;
c9x.val1 = v1;
c9x.val2 = v2;
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
c9x.val1 = gruvin9xToSource(v1).toValue();
}
if (c9x.func >= LS_FN_EQUAL) {
c9x.val2 = gruvin9xToSource(v2).toValue();
}
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
c9x.val1 = gruvin9xToSwitch(v1).toValue();
c9x.val2 = gruvin9xToSwitch(v2).toValue();
}
return c9x;
}
Gruvin9xCustomFunctionData::operator CustomFunctionData ()
{
CustomFunctionData c9x;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
return c9x;
}
t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
{
memset(this, 0, sizeof(t_Gruvin9xSwashRingData));
}
t_Gruvin9xSwashRingData::operator SwashRingData ()
{
SwashRingData c9x;
c9x.elevatorWeight = invertELE ? -100 : 100;
c9x.aileronWeight = invertAIL ? -100 : 100;
c9x.collectiveWeight = invertCOL ? -100 : 100;
c9x.type = type;
c9x.collectiveSource = gruvin9xToSource(collectiveSource);
c9x.value = value;
return c9x;
}
t_Gruvin9xFlightModeData_v102::operator FlightModeData ()
{
FlightModeData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = trim[i];
c9x.swtch = gruvin9xToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
return c9x;
}
t_Gruvin9xFlightModeData_v106::operator FlightModeData ()
{
FlightModeData c9x;
for (int i=0; i<NUM_STICKS; i++)
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
c9x.swtch = gruvin9xToSwitch(swtch);
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.fadeIn = fadeIn;
c9x.fadeOut = fadeOut;
return c9x;
}
extern RawSwitch getEr9xTimerMode(int mode);
t_Gruvin9xTimerData::operator TimerData ()
{
TimerData c9x;
c9x.mode = getEr9xTimerMode(mode);
c9x.val = val;
return c9x;
}
t_Gruvin9xFrSkyChannelData::t_Gruvin9xFrSkyChannelData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyChannelData));
}
t_Gruvin9xFrSkyChannelData::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
c9x.ratio = ratio;
c9x.alarms[0].value = alarms_value[0];
c9x.alarms[0].level = alarms_level & 3;
c9x.alarms[0].greater = alarms_greater & 1;
c9x.alarms[1].value = alarms_value[1];
c9x.alarms[1].level = (alarms_level >> 2) & 3;
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
c9x.type = type;
return c9x;
}
t_Gruvin9xFrSkyData::t_Gruvin9xFrSkyData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyData));
}
t_Gruvin9xFrSkyData::operator FrSkyData ()
{
FrSkyData c9x;
c9x.channels[0] = channels[0];
c9x.channels[1] = channels[1];
return c9x;
}
t_Gruvin9xModelData_v102::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.flightModeData[i] = flightModeData[i];
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v103::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
c9x.flightModeData[i] = flightModeData[i];
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v105::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (flightModeData[i].trim[j] > 125) {
c9x.flightModeData[i].trimRef[j] = 0;
c9x.flightModeData[i].trim[j] = 0;
}
else if (flightModeData[i].trim[j] < -125) {
c9x.flightModeData[i].trimRef[j] = 129 + flightModeData[i].trim[j];
if (c9x.flightModeData[i].trimRef[j] >= i)
c9x.flightModeData[i].trimRef[j] += 1;
c9x.flightModeData[i].trim[j] = 0;
}
else {
c9x.flightModeData[i].trim[j] += subtrim[j];
}
}
}
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
t_Gruvin9xModelData_v106::operator ModelData ()
{
ModelData c9x;
c9x.used = true;
getEEPROMZString(c9x.name, name, sizeof(name));
c9x.timers[0] = timer1;
c9x.timers[1] = timer2;
switch(protocol) {
case 1:
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
break;
case 2:
c9x.moduleData[0].protocol = PULSES_DSM2;
break;
case 3:
c9x.moduleData[0].protocol = PULSES_SILV_A;
break;
case 4:
c9x.moduleData[0].protocol = PULSES_SILV_B;
break;
case 5:
c9x.moduleData[0].protocol = PULSES_SILV_C;
break;
case 6:
c9x.moduleData[0].protocol = PULSES_CTP1009;
break;
default:
c9x.moduleData[0].protocol = PULSES_PPM;
break;
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppm.delay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppm.pulsePol = pulsePol;
c9x.extendedLimits = extendedLimits;
c9x.extendedTrims = extendedTrims;
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
c9x.flightModeData[i] = flightModeData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (c9x.flightModeData[i].trim[j] > 500) {
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
if (c9x.flightModeData[i].trimRef[j] >= i)
c9x.flightModeData[i].trimRef[j] += 1;
c9x.flightModeData[i].trim[j] = 0;
}
}
}
for (int i=0; i<G9X_MAX_MIXERS; i++)
c9x.mixData[i] = mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
c9x.limitData[i] = limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
c9x.curves[i].points[j].y = curves5[i][j];
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
}
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
return c9x;
}
@@ -1,421 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef gruvin9xeeprom_h
#define gruvin9xeeprom_h
#include <inttypes.h>
#include "eeprominterface.h"
#define GR9X_MAX_CSFUNC 13
PACK(typedef struct t_Gruvin9xTrainerMix_v103 {
uint8_t srcChn:3; //0-7 = ch1-8
int8_t swtch:5;
int8_t studWeight:6;
uint8_t mode:2; //off,add-mode,subst-mode
operator TrainerMix();
t_Gruvin9xTrainerMix_v103() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v103)); }
}) Gruvin9xTrainerMix_v103; //
PACK(typedef struct t_Gruvin9xTrainerMix_v104 {
uint8_t srcChn:6; // 0-7 = ch1-8
uint8_t mode:2; // off,add-mode,subst-mode
int8_t studWeight;
operator TrainerMix();
t_Gruvin9xTrainerMix_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v104)); }
}) Gruvin9xTrainerMix_v104; //
PACK(typedef struct t_Gruvin9xTrainerData_v103 {
int16_t calib[4];
Gruvin9xTrainerMix_v103 mix[4];
operator TrainerData();
}) Gruvin9xTrainerData_v103;
PACK(typedef struct t_Gruvin9xTrainerData_v104 {
int16_t calib[4];
Gruvin9xTrainerMix_v104 mix[4];
operator TrainerData();
t_Gruvin9xTrainerData_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerData_v104)); }
}) Gruvin9xTrainerData_v104;
PACK(typedef struct t_Gruvin9xFrSkyRSSIAlarm {
uint8_t level:2;
int8_t value:6;
}) Gruvin9xFrSkyRSSIAlarm;
PACK(typedef struct t_Gruvin9xGeneral_v103 {
uint8_t myVers;
int16_t calibMid[7];
int16_t calibSpanNeg[7];
int16_t calibSpanPos[7];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t lightSw;
Gruvin9xTrainerData_v103 trainer;
uint8_t view; //index of subview in main scrren
uint8_t disableThrottleWarning:1;
int8_t switchWarning:2; // -1=down, 0=off, 1=up
uint8_t beeperVal:3;
uint8_t disableMemoryWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
uint8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
uint8_t spare:2;
uint8_t filterInput;
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
operator GeneralSettings();
t_Gruvin9xGeneral_v103() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v103)); }
}) Gruvin9xGeneral_v103;
PACK(typedef struct t_Gruvin9xGeneral_v104 {
uint8_t myVers;
int16_t calibMid[7];
int16_t calibSpanNeg[7];
int16_t calibSpanPos[7];
uint16_t chkSum;
uint8_t currModel; //0..15
uint8_t contrast;
uint8_t vBatWarn;
int8_t txVoltageCalibration;
int8_t lightSw;
Gruvin9xTrainerData_v104 trainer;
uint8_t view; //index of subview in main scrren
uint8_t disableThrottleWarning:1;
int8_t switchWarning:2; // -1=down, 0=off, 1=up
uint8_t beeperVal:3;
uint8_t disableMemoryWarning:1;
uint8_t disableAlarmWarning:1;
uint8_t stickMode;
uint8_t inactivityTimer;
uint8_t throttleReversed:1;
uint8_t minuteBeep:1;
uint8_t preBeep:1;
uint8_t flashBeep:1;
uint8_t disableSplashScreen:1;
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
uint8_t spare:2;
uint8_t filterInput;
uint8_t lightAutoOff;
uint8_t templateSetup; //RETA order according to chout_ar array
int8_t PPM_Multiplier;
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
operator GeneralSettings();
t_Gruvin9xGeneral_v104() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v104)); }
}) Gruvin9xGeneral_v104;
typedef Gruvin9xGeneral_v104 Gruvin9xGeneral;
// eeprom modelspec
PACK(typedef struct t_Gruvin9xExpoData {
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
uint8_t chn:2;
uint8_t curve:4; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
int8_t swtch:5;
uint8_t phase:3; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
uint8_t negPhase:1;
uint8_t weight:7;
int8_t expo;
operator ExpoData();
t_Gruvin9xExpoData();
}) Gruvin9xExpoData;
PACK(typedef struct t_Gruvin9xLimitData {
int8_t min;
int8_t max;
bool revert;
int16_t offset;
operator LimitData();
t_Gruvin9xLimitData();
}) Gruvin9xLimitData;
#define MLTPX_ADD 0
#define MLTPX_MUL 1
#define MLTPX_REP 2
PACK(typedef struct t_Gruvin9xMixData {
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
uint8_t mixWarn:3; // mixer warning
uint8_t srcRaw; //
int8_t weight;
int8_t swtch;
uint8_t curve; // 0=symmetrisch, 1=no neg, 2=no pos
uint8_t delayUp:4;
uint8_t delayDown:4;
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
uint8_t speedDown:4; // 0 nichts
uint8_t carryTrim:1;
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
int8_t sOffset;
operator MixData();
t_Gruvin9xMixData();
}) Gruvin9xMixData;
PACK(typedef struct t_Gruvin9xLogicalSwitchData { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func;
operator LogicalSwitchData();
t_Gruvin9xLogicalSwitchData() { memset(this, 0, sizeof(t_Gruvin9xLogicalSwitchData)); }
}) Gruvin9xLogicalSwitchData;
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
int8_t swtch;
int8_t val;
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xCustomFunctionData { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator CustomFunctionData();
t_Gruvin9xCustomFunctionData() { memset(this, 0, sizeof(t_Gruvin9xCustomFunctionData)); }
}) Gruvin9xCustomFunctionData;
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
// 0.01v steps from 0 to 40.95V. Ex. 6.60 Volts = 660. 40.95V = 4095
uint16_t type:4; // channel display unit (0=volts, 1=raw, 2-15=reserverd.)
uint8_t alarms_value[2]; // raw sample values 0..255
uint8_t alarms_level:4; // two pairs of 2bits. none=0, yel=1, org=2, red=3
uint8_t alarms_greater:2; // two alarms, 1 bit each. 0=LT(<), 1=GT(>)
uint8_t spare:2;
uint8_t barMin; // minimum for bar display (raw ADC value)
uint8_t barMax; // ditto for max display (would G:NOT usually = ratio)
operator FrSkyChannelData();
t_Gruvin9xFrSkyChannelData();
}) Gruvin9xFrSkyChannelData;
PACK(typedef struct t_Gruvin9xFrSkyData {
Gruvin9xFrSkyChannelData channels[2];
operator FrSkyData();
t_Gruvin9xFrSkyData();
}) Gruvin9xFrSkyData;
PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
uint8_t invertELE:1;
uint8_t invertAIL:1;
uint8_t invertCOL:1;
uint8_t type:5;
uint8_t collectiveSource;
uint8_t value;
operator SwashRingData();
t_Gruvin9xSwashRingData();
}) Gruvin9xSwashRingData;
PACK(typedef struct t_Gruvin9xFlightModeData_v102 {
int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator FlightModeData();
t_Gruvin9xFlightModeData_v102() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v102)); }
}) Gruvin9xFlightModeData_v102;
PACK(typedef struct t_Gruvin9xFlightModeData_v106 {
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
int8_t swtch; // swtch of phase[0] is not used
char name[6];
uint8_t fadeIn:4;
uint8_t fadeOut:4;
operator FlightModeData();
t_Gruvin9xFlightModeData_v106() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v106)); }
}) Gruvin9xFlightModeData_v106;
PACK(typedef struct t_Gruvin9xTimerData {
int8_t mode:7; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
uint8_t dir:1; // 0=>Count Down, 1=>Count Up
uint16_t val;
operator TimerData();
t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); }
}) Gruvin9xTimerData;
#define G9X_MAX_FLIGHT_MODES 5
#define G9X_MAX_MIXERS 32
#define G9X_MAX_EXPOS 14
#define G9X_MAX_CURVE5 8
#define G9X_MAX_CURVE9 8
#define G9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
#define G9X_NUM_CSW 12 // number of custom switches
#define G9X_NUM_FSW 12 // number of functions assigned to switches
// TODO
PACK(typedef struct t_Gruvin9xModelData_v102 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v102() { memset(this, 0, sizeof(t_Gruvin9xModelData_v102)); }
}) Gruvin9xModelData_v102;
PACK(typedef struct t_Gruvin9xModelData_v103 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v103() { memset(this, 0, sizeof(t_Gruvin9xModelData_v103)); }
}) Gruvin9xModelData_v103;
PACK(typedef struct t_Gruvin9xModelData_v105 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
int8_t ppmNCH:3;
uint8_t thrTrim:1; // Enable Throttle Trim
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t trimInc:3; // Trim Increments
uint8_t spare1:1;
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
int16_t subtrim[NUM_STICKS];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v105() { memset(this, 0, sizeof(t_Gruvin9xModelData_v105)); }
}) Gruvin9xModelData_v105;
PACK(typedef struct t_Gruvin9xModelData_v106 {
char name[10]; // 10 must be first for eeLoadModelName
Gruvin9xTimerData timer1;
uint8_t protocol:3;
uint8_t thrTrim:1; // Enable Throttle Trim
int8_t ppmNCH:4;
uint8_t trimInc:3; // Trim Increments
uint8_t thrExpo:1; // Enable Throttle Expo
uint8_t pulsePol:1;
uint8_t extendedLimits:1;
uint8_t extendedTrims:1;
uint8_t spare2:1;
int8_t ppmDelay;
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
Gruvin9xTimerData timer2;
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
operator ModelData();
t_Gruvin9xModelData_v106() { memset(this, 0, sizeof(t_Gruvin9xModelData_v106)); }
}) Gruvin9xModelData_v106;
typedef Gruvin9xModelData_v106 Gruvin9xModelData;
#endif
@@ -1,252 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <iostream>
#include "gruvin9xinterface.h"
#include "gruvin9xeeprom.h"
#include "file.h"
#include "appdata.h"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
#define FILE_GENERAL 0
#define FILE_MODEL(n) (1+n)
Gruvin9xInterface::Gruvin9xInterface(BoardEnum board):
EEPROMInterface(board),
efile(new RleFile())
{
}
Gruvin9xInterface::~Gruvin9xInterface()
{
delete efile;
}
const char * Gruvin9xInterface::getName()
{
if (board == BOARD_STOCK)
return "Gruvin9x";
else
return "Gruvin9x v4";
}
const int Gruvin9xInterface::getEEpromSize()
{
if (board == BOARD_STOCK) {
QString avrMCU = g.mcu();
if (avrMCU==QString("m128")) {
return EESIZE_STOCK*2;
}
return EESIZE_STOCK;
} else {
return EESIZE_GRUVIN9X;
}
}
const int Gruvin9xInterface::getMaxModels()
{
return 16;
}
template <class T>
void Gruvin9xInterface::loadModel(ModelData &model, unsigned int stickMode, int version)
{
T _model;
if ((version == 2 && efile->readRlc2((uint8_t*)&_model, sizeof(T))) ||
(version == 1 && efile->readRlc1((uint8_t*)&_model, sizeof(T)))) {
model = _model;
if (stickMode) {
applyStickModeToModel(model, stickMode);
}
}
else {
model.clear();
}
}
template <class T>
bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
{
T _settings;
if ((version == 2 && efile->readRlc2((uint8_t*)&_settings, sizeof(T))) ||
(version == 1 && efile->readRlc1((uint8_t*)&_settings, sizeof(T)))) {
settings = _settings;
return true;
}
std::cerr << "error when loading general settings";
return false;
}
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{
std::bitset<NUM_ERRORS> errors;
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
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";
errors.set(WRONG_SIZE);
return errors.to_ulong();
}
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
errors.set(WRONG_FILE_SYSTEM);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
uint8_t version;
if (efile->readRlc2(&version, 1) != 1) {
std::cout << "no\n";
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";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << "version " << (unsigned int)version << " ";
switch(version) {
case 5:
case 100:
case 101:
case 102:
case 103:
case 104:
case 105:
// subtrims(16bits) + function switches added
case 106:
// trims(10bits), no subtrims
break;
default:
std::cout << "not gruvin9x\n";
errors.set(NOT_GRUVIN9X);
return errors.to_ulong();
}
efile->openRd(FILE_GENERAL);
if (version == 5) {
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)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else if (version <= 106) {
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
else {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
for (int i=0; i<getMaxModels(); i++) {
efile->openRd(FILE_MODEL(i));
if (version == 5) {
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1, 1);
}
else if (version < 103) {
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 103) {
loadModel<Gruvin9xModelData_v103>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 105) {
loadModel<Gruvin9xModelData_v105>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else if (version == 106) {
loadModel<Gruvin9xModelData_v106>(radioData.models[i], radioData.generalSettings.stickMode+1);
}
else {
std::cout << "ko\n";
errors.set(UNKNOWN_ERROR);
return errors.to_ulong();
}
}
std::cout << "ok\n";
errors.set(ALL_OK);
return errors.to_ulong();
}
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{
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)
{
std::cout << "NO!\n";
// TODO an error
return 0;
}
int Gruvin9xInterface::getSize(const ModelData & model)
{
return 0;
}
int Gruvin9xInterface::getSize(const GeneralSettings & settings)
{
return 0;
}
int Gruvin9xInterface::isAvailable(PulsesProtocol proto, int port)
{
switch (proto) {
case PULSES_PPM:
case PULSES_SILV_A:
case PULSES_SILV_B:
case PULSES_SILV_C:
case PULSES_CTP1009:
case PULSES_DSM2:
return 1;
default:
return 0;
}
}
@@ -1,65 +0,0 @@
/*
* Author - Bertrand Songis <bsongis@gmail.com>
*
* Based on th9x -> http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef gruvin9x_interface_h
#define gruvin9x_interface_h
#include "eeprominterface.h"
class RleFile;
class Gruvin9xInterface : public EEPROMInterface
{
public:
Gruvin9xInterface(BoardEnum board);
virtual ~Gruvin9xInterface();
virtual const char * getName();
virtual const int getEEpromSize();
virtual const int getMaxModels();
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
virtual int getSize(const ModelData &);
virtual int getSize(const GeneralSettings & settings);
virtual int isAvailable(PulsesProtocol proto, int port=0);
protected:
template <class T>
void loadModel(ModelData &model, unsigned int stickMode=0, int version=2);
template <class T>
bool loadGeneral(GeneralSettings &settings, int version=2);
RleFile *efile;
};
#endif
+92
View File
@@ -0,0 +1,92 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "gvardata.h"
#include "radiodata.h"
QString GVarData::unitToString() const
{
switch (unit) {
case GVAR_UNIT_NUMBER:
return tr("");
case GVAR_UNIT_PERCENT:
return tr("%");
default:
return tr("?"); // highlight unknown value
}
}
QString GVarData::precToString() const
{
switch (prec) {
case GVAR_PREC_MUL10:
return tr("0._");
case GVAR_PREC_MUL1:
return tr("0.0");
default:
return tr("?.?"); // highlight unknown value
}
}
QString GVarData::nameToString(int index) const
{
return RadioData::getElementName(tr("GV"), index + 1, name);
}
int GVarData::multiplierSet()
{
return (prec == 0 ? 1 : 10);
}
float GVarData::multiplierGet() const
{
return (prec == 0 ? 1 : 0.1);
}
void GVarData::setMin(float val)
{
min = (val * multiplierSet()) - GVAR_MIN_VALUE;
}
void GVarData::setMax(float val)
{
max = GVAR_MAX_VALUE - (val * multiplierSet());
}
int GVarData::getMin() const
{
return GVAR_MIN_VALUE + min;
}
int GVarData::getMax() const
{
return GVAR_MAX_VALUE - max;
}
float GVarData::getMinPrec() const
{
return getMin() * multiplierGet();
}
float GVarData::getMaxPrec() const
{
return getMax() * multiplierGet();
}
+68
View File
@@ -0,0 +1,68 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef GVARDATA_H
#define GVARDATA_H
#include <QtCore>
#define GVAR_NAME_LEN 3
#define GVAR_MAX_VALUE 1024
#define GVAR_MIN_VALUE -GVAR_MAX_VALUE
class GVarData {
Q_DECLARE_TR_FUNCTIONS(GVarData)
public:
GVarData() { clear(); }
enum {
GVAR_UNIT_NUMBER,
GVAR_UNIT_PERCENT
};
enum {
GVAR_PREC_MUL10,
GVAR_PREC_MUL1
};
char name[GVAR_NAME_LEN+1];
int min;
int max;
bool popup;
unsigned int prec; // 0 0._ 1 0.0
unsigned int unit; // 0 _ 1 %
void clear() {memset(this, 0, sizeof(GVarData)); }
QString unitToString() const;
QString precToString() const;
QString nameToString(int index) const;
int multiplierSet();
float multiplierGet() const;
void setMin(float val);
void setMax(float val);
int getMin() const;
int getMax() const;
float getMinPrec() const;
float getMaxPrec() const;
};
#endif // GVARDATA_H
+147
View File
@@ -0,0 +1,147 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "io_data.h"
#include "radiodata.h" // for RadioData::getElementName
#include "radiodataconversionstate.h"
/*
* ExpoData
*/
void ExpoData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent(tr("INP"), 3);
cstate.setSubComp(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, chn).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % tr(" (@%1)").arg(cstate.subCompIdx));
srcRaw.convert(cstate);
swtch.convert(cstate);
}
/*
* MixData
*/
void MixData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent(tr("MIX"), 4);
cstate.setSubComp(RawSource(SOURCE_TYPE_CH, destCh-1).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % tr(" (@%1)").arg(cstate.subCompIdx));
srcRaw.convert(cstate);
swtch.convert(cstate);
}
/*
* LimitData
*/
QString LimitData::minToString() const
{
return QString::number((qreal)min/10);
}
QString LimitData::maxToString() const
{
return QString::number((qreal)max/10);
}
QString LimitData::revertToString() const
{
return revert ? tr("INV") : tr("NOR");
}
QString LimitData::nameToString(int index) const
{
return RadioData::getElementName(tr("CH"), index + 1, name);
}
QString LimitData::offsetToString() const
{
return QString::number((qreal)offset/10, 'f', 1);
}
void LimitData::clear()
{
memset(reinterpret_cast<void *>(this), 0, sizeof(LimitData));
min = -1000;
max = +1000;
}
/*
* CurveData
*/
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 CurveData::nameToString(const int idx) const
{
return RadioData::getElementName(tr("CV"), idx + 1, name);
}
/*
* FlightModeData
*/
void FlightModeData::clear(const int phase)
{
memset(reinterpret_cast<void *>(this), 0, sizeof(FlightModeData));
if (phase != 0) {
for (int idx=0; idx<CPN_MAX_GVARS; idx++) {
gvars[idx] = 1025;
}
for (int idx=0; idx<CPN_MAX_ENCODERS; idx++) {
rotaryEncoders[idx] = 1025;
}
}
}
QString FlightModeData::nameToString(int index) const
{
return RadioData::getElementName(tr("FM"), index, name); // names are zero-based, FM0, FM1, etc
}
void FlightModeData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent("FMD", 2);
cstate.setSubComp(nameToString(cstate.subCompIdx));
swtch.convert(cstate);
}
+179
View File
@@ -0,0 +1,179 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef IO_DATA_H
#define IO_DATA_H
#include "constants.h"
#include "curvereference.h"
#include "rawsource.h"
#include "rawswitch.h"
#include <QtCore>
class RadioDataConversionState;
enum InputMode {
INPUT_MODE_NONE,
INPUT_MODE_POS,
INPUT_MODE_NEG,
INPUT_MODE_BOTH
};
class ExpoData {
Q_DECLARE_TR_FUNCTIONS(ExpoData)
public:
ExpoData() { clear(); }
RawSource srcRaw;
unsigned int scale;
unsigned int mode; // InputMode
unsigned int chn;
RawSwitch swtch;
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
int weight;
int offset;
CurveReference curve;
int carryTrim;
char name[10+1];
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(ExpoData)); }
void convert(RadioDataConversionState & cstate);
};
enum MltpxValue {
MLTPX_ADD=0,
MLTPX_MUL=1,
MLTPX_REP=2
};
#define MIXDATA_NAME_LEN 10
class MixData {
Q_DECLARE_TR_FUNCTIONS(MixData)
public:
MixData() { clear(); }
void convert(RadioDataConversionState & cstate);
unsigned int destCh; // 1..CPN_MAX_CHNOUT
RawSource srcRaw;
int weight;
RawSwitch swtch;
CurveReference curve; //0=symmetrisch
unsigned int delayUp;
unsigned int delayDown;
unsigned int speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
unsigned int speedDown; // 0 nichts
int carryTrim;
bool noExpo;
MltpxValue mltpx; // multiplex method 0=+ 1=* 2=replace
unsigned int mixWarn; // mixer warning
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
int sOffset;
char name[MIXDATA_NAME_LEN+1];
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(MixData)); }
};
class LimitData {
Q_DECLARE_TR_FUNCTIONS(LimitData)
public:
LimitData() { clear(); }
int min;
int max;
bool revert;
int offset;
int ppmCenter;
bool symetrical;
char name[6+1];
CurveReference curve;
QString minToString() const;
QString maxToString() const;
QString offsetToString() const;
QString revertToString() const;
QString nameToString(int index) const;
void clear();
};
class CurvePoint {
public:
int8_t x;
int8_t y;
};
class CurveData {
Q_DECLARE_TR_FUNCTIONS(CurveData)
public:
enum CurveType {
CURVE_TYPE_STANDARD,
CURVE_TYPE_CUSTOM,
CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM
};
CurveData();
void clear(int count);
bool isEmpty() const;
QString nameToString(const int idx) const;
CurveType type;
bool smooth;
int count;
CurvePoint points[CPN_MAX_POINTS];
char name[6+1];
};
class FlightModeData {
Q_DECLARE_TR_FUNCTIONS(FlightModeData)
public:
FlightModeData() { clear(0); }
int trimMode[CPN_MAX_TRIMS];
int trimRef[CPN_MAX_TRIMS];
int trim[CPN_MAX_TRIMS];
RawSwitch swtch;
char name[10+1];
unsigned int fadeIn;
unsigned int fadeOut;
int rotaryEncoders[CPN_MAX_ENCODERS];
int gvars[CPN_MAX_GVARS];
void clear(const int phase);
QString nameToString(int index) const;
void convert(RadioDataConversionState & cstate);
};
class SwashRingData {
Q_DECLARE_TR_FUNCTIONS(SwashRingData)
public:
SwashRingData() { clear(); }
int elevatorWeight;
int aileronWeight;
int collectiveWeight;
unsigned int type;
RawSource collectiveSource;
RawSource aileronSource;
RawSource elevatorSource;
unsigned int value;
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(SwashRingData)); }
};
#endif // IO_DATA_H
@@ -0,0 +1,143 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "logicalswitchdata.h"
#include "radiodata.h"
#include "radiodataconversionstate.h"
#include "rawsource.h"
#include "rawswitch.h"
bool LogicalSwitchData::isEmpty() const
{
return (func == 0);
}
CSFunctionFamily LogicalSwitchData::getFunctionFamily() const
{
if (func == LS_FN_EDGE)
return LS_FAMILY_EDGE;
else if (func == LS_FN_TIMER)
return LS_FAMILY_TIMER;
else if (func == LS_FN_STICKY)
return LS_FAMILY_STICKY;
else if (func < LS_FN_AND || func > LS_FN_ELESS)
return LS_FAMILY_VOFS;
else if (func < LS_FN_EQUAL)
return LS_FAMILY_VBOOL;
else
return LS_FAMILY_VCOMP;
}
unsigned int LogicalSwitchData::getRangeFlags() const
{
int f = 0;
if (func == LS_FN_DPOS || func == LS_FN_DAPOS)
f |= RANGE_DELTA_FUNCTION;
if (func == LS_FN_DAPOS || func == LS_FN_APOS || func == LS_FN_ANEG)
f |= RANGE_ABS_FUNCTION;
return f;
}
QString LogicalSwitchData::funcToString() const
{
switch (func) {
case LS_FN_OFF:
return tr("---");
case LS_FN_VPOS:
return tr("a>x");
case LS_FN_VNEG:
return tr("a<x");
case LS_FN_APOS:
return tr("|a|>x");
case LS_FN_ANEG:
return tr("|a|<x");
case LS_FN_AND:
return tr("AND");
case LS_FN_OR:
return tr("OR");
case LS_FN_XOR:
return tr("XOR");
case LS_FN_EQUAL:
return tr("a=b");
case LS_FN_NEQUAL:
return tr("a!=b");
case LS_FN_GREATER:
return tr("a>b");
case LS_FN_LESS:
return tr("a<b");
case LS_FN_EGREATER:
return tr("a>=b");
case LS_FN_ELESS:
return tr("a<=b");
case LS_FN_DPOS:
return tr("d>=x");
case LS_FN_DAPOS:
return tr("|d|>=x");
case LS_FN_VEQUAL:
return tr("a=x");
case LS_FN_VALMOSTEQUAL:
return tr("a~x");
case LS_FN_TIMER:
return tr("Timer");
case LS_FN_STICKY:
return tr("Sticky");
case LS_FN_EDGE:
return tr("Edge");
default:
return tr("Unknown");
}
}
QString LogicalSwitchData::nameToString(int index) const
{
return RadioData::getElementName(tr("L"), index + 1, NULL, true);
}
void LogicalSwitchData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent(tr("LSW"), 7);
cstate.setSubComp(RawSwitch(SWITCH_TYPE_VIRTUAL, cstate.subCompIdx + 1).toString(cstate.fromType, cstate.fromGS(), cstate.fromModel()));
CSFunctionFamily family = getFunctionFamily();
switch(family) {
case LS_FAMILY_VOFS:
val1 = RawSource(val1).convert(cstate.withComponentField("V1")).toValue();
break;
case LS_FAMILY_STICKY:
case LS_FAMILY_VBOOL:
val1 = RawSwitch(val1).convert(cstate.withComponentField("V1")).toValue();
val2 = RawSwitch(val2).convert(cstate.withComponentField("V2")).toValue();
break;
case LS_FAMILY_EDGE:
val1 = RawSwitch(val1).convert(cstate.withComponentField("V1")).toValue();
break;
case LS_FAMILY_VCOMP:
val1 = RawSource(val1).convert(cstate.withComponentField("V1")).toValue();
val2 = RawSource(val2).convert(cstate.withComponentField("V2")).toValue();
break;
default:
break;
}
andsw = RawSwitch(andsw).convert(cstate.withComponentField("AND")).toValue();
}
@@ -0,0 +1,89 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef LOGICALSWITCHDATA_H
#define LOGICALSWITCHDATA_H
#include <QtCore>
class RadioDataConversionState;
enum CSFunction {
LS_FN_OFF,
LS_FN_VPOS,
LS_FN_VNEG,
LS_FN_APOS,
LS_FN_ANEG,
LS_FN_AND,
LS_FN_OR,
LS_FN_XOR,
LS_FN_EQUAL,
LS_FN_NEQUAL,
LS_FN_GREATER,
LS_FN_LESS,
LS_FN_EGREATER,
LS_FN_ELESS,
LS_FN_DPOS,
LS_FN_DAPOS,
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
LS_FN_VALMOSTEQUAL,
LS_FN_TIMER,
LS_FN_STICKY,
LS_FN_EDGE,
// later ... LS_FN_RANGE,
LS_FN_MAX
};
enum CSFunctionFamily {
LS_FAMILY_VOFS,
LS_FAMILY_VBOOL,
LS_FAMILY_VCOMP,
LS_FAMILY_TIMER,
LS_FAMILY_STICKY,
LS_FAMILY_EDGE,
};
class LogicalSwitchData {
Q_DECLARE_TR_FUNCTIONS(LogicalSwitchData)
public:
LogicalSwitchData(unsigned int func=0)
{
clear();
this->func = func;
}
unsigned int func;
int val1;
int val2;
int val3;
unsigned int delay;
unsigned int duration;
int andsw;
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
bool isEmpty() const;
CSFunctionFamily getFunctionFamily() const;
unsigned int getRangeFlags() const;
QString funcToString() const;
QString nameToString(int index) const;
void convert(RadioDataConversionState & cstate);
};
#endif // LOGICALSWITCHDATA_H
+444
View File
@@ -0,0 +1,444 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "modeldata.h"
#include "eeprominterface.h"
#include "generalsettings.h"
#include "macros.h"
#include "radiodataconversionstate.h"
QString removeAccents(const QString & str)
{
// UTF-8 ASCII Table
static const QHash<QString, QVariant> map = {
{"a", QRegularExpression("[áâãàä]")},
{"A", QRegularExpression("[ÁÂÃÀÄ]")},
{"e", QRegularExpression("[éèêě]")},
{"E", QRegularExpression("[ÉÈÊĚ]")},
{"o", QRegularExpression("[óôõö]")},
{"O", QRegularExpression("[ÓÔÕÖ]")},
{"u", QRegularExpression("[úü]")},
{"U", QRegularExpression("[ÚÜ]")},
{"i", "í"}, {"I", "Í"},
{"c", "ç"}, {"C", "Ç"},
{"y", "ý"}, {"Y", "Ý"},
{"s", "š"}, {"S", "Š"},
{"r", "ř"}, {"R", "Ř"}
};
QString result(str);
for (QHash<QString, QVariant>::const_iterator it = map.cbegin(), en = map.cend(); it != en; ++it) {
if (it.value().canConvert<QRegularExpression>())
result.replace(it.value().toRegularExpression(), it.key());
else
result.replace(it.value().toString(), it.key());
}
return result;
}
/*
* TimerData
*/
void TimerData::convert(RadioDataConversionState & cstate)
{
cstate.setComponent(tr("TMR"), 1);
cstate.setSubComp(tr("Timer %1").arg(cstate.subCompIdx + 1));
mode.convert(cstate);
}
/*
* ModelData
*/
ModelData::ModelData()
{
clear();
}
ModelData::ModelData(const ModelData & src)
{
*this = src;
}
ModelData & ModelData::operator = (const ModelData & src)
{
memcpy(reinterpret_cast<void *>(this), &src, sizeof(ModelData));
return *this;
}
ExpoData * ModelData::insertInput(const int idx)
{
memmove(&expoData[idx+1], &expoData[idx], (CPN_MAX_EXPOS-(idx+1))*sizeof(ExpoData));
expoData[idx].clear();
return &expoData[idx];
}
bool ModelData::isInputValid(const unsigned int idx) const
{
for (int i=0; i<CPN_MAX_EXPOS; i++) {
const ExpoData * expo = &expoData[i];
if (expo->mode == 0) break;
if (expo->chn == idx)
return true;
}
return false;
}
bool ModelData::hasExpos(uint8_t inputIdx) const
{
for (int i=0; i<CPN_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<CPN_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<CPN_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<CPN_MAX_MIXERS; i++) {
const MixData * md = &mixData[i];
if ((int)md->destCh == channel+1) {
result << md;
}
}
return result;
}
void ModelData::removeInput(const int idx, bool clearName)
{
unsigned int chn = expoData[idx].chn;
memmove(&expoData[idx], &expoData[idx+1], (CPN_MAX_EXPOS-(idx+1))*sizeof(ExpoData));
expoData[CPN_MAX_EXPOS-1].clear();
//also remove input name if removing last line for this input
if (clearName && !expos(chn).size())
inputNames[chn][0] = 0;
}
void ModelData::clearInputs()
{
for (int i=0; i<CPN_MAX_EXPOS; i++)
expoData[i].clear();
//clear all input names
if (getCurrentFirmware()->getCapability(VirtualInputs)) {
for (int i=0; i<CPN_MAX_INPUTS; i++) {
inputNames[i][0] = 0;
}
}
}
void ModelData::clearMixes()
{
for (int i=0; i<CPN_MAX_MIXERS; i++)
mixData[i].clear();
}
void ModelData::clear()
{
memset(reinterpret_cast<void *>(this), 0, sizeof(ModelData));
modelIndex = -1; // an invalid index, this is managed by the TreeView data model
moduleData[0].protocol = PULSES_OFF;
moduleData[1].protocol = PULSES_OFF;
moduleData[0].channelsCount = 8;
moduleData[1].channelsStart = 0;
moduleData[1].channelsCount = 8;
moduleData[0].ppm.delay = 300;
moduleData[1].ppm.delay = 300;
moduleData[2].ppm.delay = 300; // Trainer PPM
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear(i);
}
for (int i=0; i<CPN_MAX_GVARS; i++) {
gvarData[i].clear();
}
clearInputs();
clearMixes();
for (int i=0; i<CPN_MAX_CHNOUT; i++)
limitData[i].clear();
for (int i=0; i<CPN_MAX_STICKS; i++)
expoData[i].clear();
for (int i=0; i<CPN_MAX_LOGICAL_SWITCHES; i++)
logicalSw[i].clear();
for (int i=0; i<CPN_MAX_SPECIAL_FUNCTIONS; i++)
customFn[i].clear();
for (int i=0; i<CPN_MAX_CURVES; i++)
curves[i].clear(5);
for (int i=0; i<CPN_MAX_TIMERS; i++)
timers[i].clear();
swashRingData.clear();
frsky.clear();
rssiAlarms.clear();
for (int i=0; i<CPN_MAX_SENSORS; i++)
sensorData[i].clear();
static const uint8_t blob[] = { 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x32, 0x50, 0x31, 0x00, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x6d, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
memcpy(customScreenData[0], blob, sizeof(blob));
}
bool ModelData::isEmpty() const
{
return !used;
}
void ModelData::setDefaultInputs(const GeneralSettings & settings)
{
Board::Type board = getCurrentBoard();
if (IS_ARM(board)) {
for (int i=0; i<CPN_MAX_STICKS; i++) {
ExpoData * expo = &expoData[i];
expo->chn = i;
expo->mode = INPUT_MODE_BOTH;
expo->srcRaw = settings.getDefaultSource(i);
expo->weight = 100;
strncpy(inputNames[i], removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i])-1);
}
}
}
void ModelData::setDefaultMixes(const GeneralSettings & settings)
{
Board::Type board = getCurrentBoard();
if (IS_ARM(board)) {
setDefaultInputs(settings);
}
for (int i=0; i<CPN_MAX_STICKS; i++) {
MixData * mix = &mixData[i];
mix->destCh = i+1;
mix->weight = 100;
if (IS_ARM(board)) {
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
}
else {
mix->srcRaw = RawSource(SOURCE_TYPE_STICK, i);
}
}
}
void ModelData::setDefaultValues(unsigned int id, const GeneralSettings & settings)
{
clear();
used = true;
sprintf(name, "MODEL%02d", id+1);
for (int i=0; i<CPN_MAX_MODULES; i++) {
moduleData[i].modelId = id+1;
}
setDefaultMixes(settings);
}
int ModelData::getTrimValue(int phaseIdx, int trimIdx)
{
int result = 0;
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
FlightModeData & phase = flightModeData[phaseIdx];
if (phase.trimMode[trimIdx] < 0) {
return result;
}
else {
if (phase.trimRef[trimIdx] == phaseIdx || phaseIdx == 0) {
return result + phase.trim[trimIdx];
}
else {
phaseIdx = phase.trimRef[trimIdx];
if (phase.trimMode[trimIdx] != 0)
result += phase.trim[trimIdx];
}
}
}
return 0;
}
bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
{
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
}
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
{
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>GVAR_MAX_VALUE && i<CPN_MAX_FLIGHT_MODES; i++) {
int nextPhase = idx - GVAR_MAX_VALUE - 1;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
idx = flightModeData[phaseIdx].gvars[gvarIdx];
}
return idx;
}
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
{
for (uint8_t i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
FlightModeData & phase = flightModeData[phaseIdx];
int mode = phase.trimMode[trimIdx];
int p = phase.trimRef[trimIdx];
int & trim = phase.trim[trimIdx];
if (mode < 0)
return;
if (p == phaseIdx || phaseIdx == 0) {
trim = value;
break;;
}
else if (mode == 0) {
phaseIdx = p;
}
else {
trim = value - getTrimValue(p, trimIdx);
if (trim < -500)
trim = -500;
if (trim > 500)
trim = 500;
break;
}
}
}
void ModelData::removeGlobalVar(int & var)
{
if (var >= 126 && var <= 130)
var = flightModeData[0].gvars[var-126];
else if (var <= -126 && var >= -130)
var = - flightModeData[0].gvars[-126-var];
}
ModelData ModelData::removeGlobalVars()
{
ModelData result = *this;
for (int i=0; i<CPN_MAX_MIXERS; i++) {
removeGlobalVar(mixData[i].weight);
removeGlobalVar(mixData[i].curve.value);
removeGlobalVar(mixData[i].sOffset);
}
for (int i=0; i<CPN_MAX_EXPOS; i++) {
removeGlobalVar(expoData[i].weight);
removeGlobalVar(expoData[i].curve.value);
}
return result;
}
int ModelData::getChannelsMax(bool forceExtendedLimits) const
{
if (forceExtendedLimits || extendedLimits)
return IS_HORUS_OR_TARANIS(getCurrentBoard()) ? 150 : 125;
else
return 100;
}
bool ModelData::isAvailable(const RawSwitch & swtch) const
{
unsigned index = abs(swtch.index) - 1;
if (swtch.type == SWITCH_TYPE_VIRTUAL) {
return logicalSw[index].func != LS_FN_OFF;
}
else if (swtch.type == SWITCH_TYPE_FLIGHT_MODE) {
return index == 0 || flightModeData[index].swtch.type != SWITCH_TYPE_NONE;
}
else if (swtch.type == SWITCH_TYPE_SENSOR) {
return strlen(sensorData[index].label) > 0;
}
else {
return true;
}
}
float ModelData::getGVarFieldValuePrec(int phaseIdx, int gvarIdx)
{
return getGVarFieldValue(phaseIdx, gvarIdx) * gvarData[gvarIdx].multiplierGet();
}
void ModelData::convert(RadioDataConversionState & cstate)
{
// Here we can add explicit conversions when moving from one board to another
QString origin = QString(name);
if (origin.isEmpty())
origin = QString::number(cstate.modelIdx+1);
cstate.setOrigin(tr("Model: ") % origin);
cstate.setComponent("SET", 0);
if (thrTraceSrc && (int)thrTraceSrc < cstate.fromBoard.getCapability(Board::Pots) + cstate.fromBoard.getCapability(Board::Sliders)) {
cstate.setSubComp(tr("Throttle Source"));
thrTraceSrc = RawSource(SOURCE_TYPE_STICK, (int)thrTraceSrc + 3).convert(cstate).index - 3;
}
for (int i=0; i<CPN_MAX_TIMERS; i++) {
timers[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_MIXERS; i++) {
mixData[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_EXPOS; i++) {
expoData[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_LOGICAL_SWITCHES; i++) {
logicalSw[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_SPECIAL_FUNCTIONS; i++) {
customFn[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
flightModeData[i].convert(cstate.withComponentIndex(i));
}
for (int i=0; i<CPN_MAX_MODULES; i++) {
moduleData[i].convert(cstate.withComponentIndex(i));
}
}
+232
View File
@@ -0,0 +1,232 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MODELDATA_H
#define MODELDATA_H
#include "constants.h"
#include "customfunctiondata.h"
#include "gvardata.h"
#include "io_data.h"
#include "logicalswitchdata.h"
#include "moduledata.h"
#include "sensordata.h"
#include "telem_data.h"
#include <QtCore>
class GeneralSettings;
class RadioDataConversionState;
#define CHAR_FOR_NAMES " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."
#define CHAR_FOR_NAMES_REGEX "[ A-Za-z0-9_.-,]*"
class RSSIAlarmData {
public:
RSSIAlarmData() { clear(); }
unsigned int level[2]; // AVR Only
int warning;
int critical;
bool disabled;
void clear() {
this->level[0] = 2;
this->level[1] = 3;
this->warning = 45;
this->critical = 42;
this->disabled = false;
}
};
#define TIMER_NAME_LEN 8
class TimerData {
Q_DECLARE_TR_FUNCTIONS(TimerData)
public:
enum CountDownMode {
COUNTDOWN_SILENT,
COUNTDOWN_BEEPS,
COUNTDOWN_VOICE,
COUNTDOWN_HAPTIC
};
TimerData() { clear(); }
RawSwitch mode;
char name[TIMER_NAME_LEN+1];
bool minuteBeep;
unsigned int countdownBeep;
unsigned int val;
unsigned int persistent;
int pvalue;
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
void convert(RadioDataConversionState & cstate);
};
#define CPN_MAX_SCRIPTS 9
#define CPN_MAX_SCRIPT_INPUTS 10
class ScriptData {
public:
ScriptData() { clear(); }
char filename[10+1];
char name[10+1];
int inputs[CPN_MAX_SCRIPT_INPUTS];
void clear() { memset(reinterpret_cast<void *>(this), 0, sizeof(ScriptData)); }
};
/*
* TODO ...
*/
#if 0
class CustomScreenOptionData {
public:
};
class CustomScreenZoneData {
public:
char widgetName[10+1];
WidgetOptionData widgetOptions[5];
};
class CustomScreenData {
public:
CustomScreenData();
char layoutName[10+1];
CustomScreenZoneData zones[];
CustomScreenOptionData options[];
};
#else
typedef char CustomScreenData[610+1];
typedef char TopbarData[216+1];
#endif
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 ModelData {
Q_DECLARE_TR_FUNCTIONS(ModelData)
public:
ModelData();
ModelData(const ModelData & src);
ModelData & operator = (const ModelData & src);
void convert(RadioDataConversionState & cstate);
ExpoData * insertInput(const int idx);
void removeInput(const int idx, bool clearName = true);
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;
int category;
char name[15+1];
char filename[16+1];
int modelIndex; // Companion only, temporary index position managed by data model.
TimerData timers[CPN_MAX_TIMERS];
bool noGlobalFunctions;
bool thrTrim; // Enable Throttle Trim
int trimInc; // Trim Increments
unsigned int trimsDisplay;
bool disableThrottleWarning;
unsigned int beepANACenter; // 1<<0->A1.. 1<<6->A7
bool extendedLimits; // TODO xml
bool extendedTrims;
bool throttleReversed;
FlightModeData flightModeData[CPN_MAX_FLIGHT_MODES];
MixData mixData[CPN_MAX_MIXERS];
LimitData limitData[CPN_MAX_CHNOUT];
char inputNames[CPN_MAX_INPUTS][4+1];
ExpoData expoData[CPN_MAX_EXPOS];
CurveData curves[CPN_MAX_CURVES];
LogicalSwitchData logicalSw[CPN_MAX_LOGICAL_SWITCHES];
CustomFunctionData customFn[CPN_MAX_SPECIAL_FUNCTIONS];
SwashRingData swashRingData;
unsigned int thrTraceSrc;
uint64_t switchWarningStates;
unsigned int switchWarningEnable;
unsigned int potsWarningMode;
bool potsWarningEnabled[CPN_MAX_POTS];
int potPosition[CPN_MAX_POTS];
bool displayChecklist;
GVarData gvarData[CPN_MAX_GVARS];
MavlinkData mavlink;
unsigned int telemetryProtocol;
FrSkyData frsky;
RSSIAlarmData rssiAlarms;
char bitmap[10+1];
unsigned int trainerMode; // TrainerMode
ModuleData moduleData[CPN_MAX_MODULES+1/*trainer*/];
ScriptData scriptData[CPN_MAX_SCRIPTS];
SensorData sensorData[CPN_MAX_SENSORS];
unsigned int toplcdTimer;
CustomScreenData customScreenData[5];
TopbarData topbarData;
void clear();
bool isEmpty() const;
void setDefaultInputs(const GeneralSettings & settings);
void setDefaultMixes(const GeneralSettings & settings);
void setDefaultValues(unsigned int id, const GeneralSettings & settings);
int getTrimValue(int phaseIdx, int trimIdx);
void setTrimValue(int phaseIdx, int trimIdx, int value);
bool isGVarLinked(int phaseIdx, int gvarIdx);
int getGVarFieldValue(int phaseIdx, int gvarIdx);
float getGVarFieldValuePrec(int phaseIdx, int gvarIdx);
ModelData removeGlobalVars();
void clearMixes();
void clearInputs();
int getChannelsMax(bool forceExtendedLimits=false) const;
bool isAvailable(const RawSwitch & swtch) const;
protected:
void removeGlobalVar(int & var);
};
#endif // MODELDATA_H
+128
View File
@@ -0,0 +1,128 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "moduledata.h"
#include "eeprominterface.h"
#include "multiprotocols.h"
#include "radiodataconversionstate.h"
void ModuleData::convert(RadioDataConversionState & cstate)
{
if (protocol == PULSES_PXX_R9M && (IS_TARANIS_XLITE(cstate.fromType) || IS_TARANIS_XLITE(cstate.toType))) {
clear();
}
}
QString ModuleData::rfProtocolToString() const
{
switch (protocol) {
case PULSES_MULTIMODULE:
return Multiprotocols::protocolToString((int)multi.rfProtocol, multi.customProto);
default:
return CPN_STR_UNKNOWN_ITEM;
}
}
QString ModuleData::subTypeToString(int type) const
{
static const char * strings[] = {
"FCC",
"EU",
"868MHz",
"915MHz"
};
if (type < 0)
type = subType;
switch (protocol) {
case PULSES_MULTIMODULE:
return Multiprotocols::subTypeToString(multi.customProto ? MM_RF_CUSTOM_SELECTED : (int)multi.rfProtocol, (unsigned)type);
case PULSES_PXX_R9M:
return CHECK_IN_ARRAY(strings, type);
default:
return CPN_STR_UNKNOWN_ITEM;
}
}
QString ModuleData::powerValueToString(Firmware * fw) const
{
const QStringList & strRef = powerValueStrings(subType, fw);
// EU module with telemetry can only be < 100/200mW.
if (pxx.sport_out && subType == MODULE_SUBTYPE_R9M_EU && pxx.power > 1)
return CPN_STR_UNKNOWN_ITEM;
return strRef.value(pxx.power, CPN_STR_UNKNOWN_ITEM);
}
// static
QString ModuleData::indexToString(int index, Firmware * fw)
{
if (index < 0)
return tr("Trainer Port");
if (fw->getCapability(NumModules) > 1) {
if (IS_HORUS_OR_TARANIS(fw->getBoard()))
return index == 0 ? tr("Internal Radio System") : tr("External Radio Module");
if (index > 0)
return tr("Extra Radio System");
}
return tr("Radio System");
}
// static
QString ModuleData::protocolToString(unsigned protocol)
{
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",
"Crossfire",
"DIY Multiprotocol Module",
"FrSky R9M Module",
"SBUS output at VBat"
};
return CHECK_IN_ARRAY(strings, protocol);
}
// static
QStringList ModuleData::powerValueStrings(int subType, Firmware * fw)
{
static const QStringList strings[] = {
{ tr("10mW - 16CH"), tr("100mW - 16CH"), tr("500mW - 16CH"), tr("Auto <= 1W - 16CH") }, // full-size FCC
{ tr("25mW - 8CH"), tr("25mW - 16CH"), tr("200mW - 16CH (no telemetry)"), tr("500mW - 16CH (no telemetry)") }, // full-size EU
{ tr("100mW - 16CH") }, // mini FCC
{ tr("25mW - 8CH"), tr("25mW - 16CH"), tr("100mW - 16CH (no telemetry)") } // mini EU
};
int strIdx = 0;
if (subType == MODULE_SUBTYPE_R9M_EU)
strIdx += 1;
if (fw->getCapability(HasModuleR9MMini))
strIdx += 2;
return strings[strIdx];
}
+170
View File
@@ -0,0 +1,170 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MODULEDATA_H
#define MODULEDATA_H
#include "constants.h"
#include <QtCore>
class Firmware;
class RadioDataConversionState;
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_MULTIMODULE,
PULSES_PXX_R9M,
PULSES_SBUS,
PULSES_PROTOCOL_LAST
};
enum MultiModuleRFProtocols {
MM_RF_PROTO_FLYSKY=0,
MM_RF_PROTO_FIRST=MM_RF_PROTO_FLYSKY,
MM_RF_PROTO_HUBSAN,
MM_RF_PROTO_FRSKY,
MM_RF_PROTO_HISKY,
MM_RF_PROTO_V2X2,
MM_RF_PROTO_DSM2,
MM_RF_PROTO_DEVO,
MM_RF_PROTO_YD717,
MM_RF_PROTO_KN,
MM_RF_PROTO_SYMAX,
MM_RF_PROTO_SLT,
MM_RF_PROTO_CX10,
MM_RF_PROTO_CG023,
MM_RF_PROTO_BAYANG,
MM_RF_PROTO_ESky,
MM_RF_PROTO_MT99XX,
MM_RF_PROTO_MJXQ,
MM_RF_PROTO_SHENQI,
MM_RF_PROTO_FY326,
MM_RF_PROTO_SFHSS,
MM_RF_PROTO_J6PRO,
MM_RF_PROTO_FQ777,
MM_RF_PROTO_ASSAN,
MM_RF_PROTO_HONTAI,
MM_RF_PROTO_OLRS,
MM_RF_PROTO_FS_AFHDS2A,
MM_RF_PROTO_Q2X2,
MM_RF_PROTO_WK_2X01,
MM_RF_PROTO_Q303,
MM_RF_PROTO_GW008,
MM_RF_PROTO_DM002,
MM_RF_PROTO_CABELL,
MM_RF_PROTO_ESKY150,
MM_RF_PROTO_H83D,
MM_RF_PROTO_CORONA,
MM_RF_PROTO_CFLIE,
MM_RF_PROTO_HITEC,
MM_RF_PROTO_WFLY,
MM_RF_PROTO_BUGS,
MM_RF_PROTO_BUGS_MINI,
MM_RF_PROTO_TRAXXAS,
MM_RF_PROTO_NCC1701,
MM_RF_PROTO_E01X,
MM_RF_PROTO_V911S,
MM_RF_PROTO_GD00X,
MM_RF_PROTO_LAST = MM_RF_PROTO_GD00X
};
enum TrainerProtocol {
TRAINER_MASTER_JACK,
TRAINER_SLAVE_JACK,
TRAINER_MASTER_SBUS_MODULE,
TRAINER_MASTER_CPPM_MODULE,
TRAINER_MASTER_SBUS_BATT_COMPARTMENT
};
enum R9MSubTypes {
MODULE_SUBTYPE_R9M_FCC,
MODULE_SUBTYPE_R9M_EU,
MODULE_SUBTYPE_R9M_EUPLUS,
MODULE_SUBTYPE_R9M_AUPLUS,
MODULE_SUBTYPE_R9M_LAST=MODULE_SUBTYPE_R9M_AUPLUS
};
class ModuleData {
Q_DECLARE_TR_FUNCTIONS(ModuleData)
public:
ModuleData() { clear(); }
unsigned int modelId;
int protocol;
unsigned int subType;
bool invertedSerial;
unsigned int channelsStart;
int channelsCount; // 0=8 channels
unsigned int failsafeMode;
int failsafeChannels[CPN_MAX_CHNOUT];
struct {
int delay;
bool pulsePol; // false = positive
bool outputType; // false = open drain, true = push pull
int frameLength;
} ppm;
struct {
unsigned int rfProtocol;
bool autoBindMode;
bool lowPowerMode;
bool customProto;
int optionValue;
} multi;
struct {
int power; // 0 10 mW, 1 100 mW, 2 500 mW, 3 1W
bool receiver_telem_off; // false = receiver telem enabled
bool receiver_channel_9_16; // false = pwm out 1-8, true 9-16
bool external_antenna; // false = internal antenna, true = external antenna
bool sport_out;
} pxx;
void clear() { memset(this, 0, sizeof(ModuleData)); }
void convert(RadioDataConversionState & cstate);
QString polarityToString() const { return ppm.pulsePol ? tr("Positive") : tr("Negative"); }
QString rfProtocolToString() const;
QString subTypeToString(int type = -1) const;
QString powerValueToString(Firmware * fw) const;
static QString indexToString(int index, Firmware * fw);
static QString protocolToString(unsigned protocol);
static QStringList powerValueStrings(int subType, Firmware * fw);
};
#endif // MODULEDATA_H
+154
View File
@@ -0,0 +1,154 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <QObject>
#include "multiprotocols.h"
#include "radiodata.h"
#define STR_MULTI_SUBTYPE QT_TRANSLATE_NOOP("Multiprotocols", "Subtype")
#define STR_MULTI_VIDFREQ QT_TRANSLATE_NOOP("Multiprotocols", "Video TX frequency")
#define STR_MULTI_RFTUNE QT_TRANSLATE_NOOP("Multiprotocols", "CC2500 frequency fine tune")
#define STR_MULTI_TELEMETRY QT_TRANSLATE_NOOP("Multiprotocols", "Telemetry")
#define STR_MULTI_RFPOWER QT_TRANSLATE_NOOP("Multiprotocols", "Radio output power")
#define STR_MULTI_SERVOFREQ QT_TRANSLATE_NOOP("Multiprotocols", "Servo output frequency")
#define STR_MULTI_OPTION QT_TRANSLATE_NOOP("Multiprotocols", "Option value")
#define STR_MULTI_DEFAULT QT_TRANSLATE_NOOP("Multiprotocols", "DEFAULT")
static const QStringList STR_SUBTYPE_CUSTOM ({
STR_MULTI_SUBTYPE " 0", STR_MULTI_SUBTYPE " 1", STR_MULTI_SUBTYPE " 2", STR_MULTI_SUBTYPE " 3",
STR_MULTI_SUBTYPE " 4", STR_MULTI_SUBTYPE " 5", STR_MULTI_SUBTYPE " 6", STR_MULTI_SUBTYPE " 7"
});
static const QStringList STR_SUBTYPE_FLYSKY {"Standard", "V9x9", "V6x6", "V912", "CX20"};
static const QStringList STR_SUBTYPE_HUBSAN {"H107", "H301", "H501"};
static const QStringList STR_SUBTYPE_FRSKY {"D16", "D8", "D16 8ch", "V8", "D16 EU-LBT", "D16 EU-LBT 8ch"};
static const QStringList STR_SUBTYPE_HISKY {"Standard", "HK310"};
static const QStringList STR_SUBTYPE_V2X2 {"Standard", "JXD506"};
static const QStringList STR_SUBTYPE_DSM {"DSM2 22ms", "DSM2 11ms", "DSMX 22ms", "DSMX 11ms"};
static const QStringList STR_SUBTYPE_YD717 {"Standard", "Skywalker", "Syma X4", "XINXUN", "NIHUI"};
static const QStringList STR_SUBTYPE_KN {"WLtoys", "FeiLun"};
static const QStringList STR_SUBTYPE_SYMAX {"Standard", "Syma X5C"};
static const QStringList STR_SUBTYPE_SLT {"V1 (6 Channel)", "V2 (8 Channel)", "Q100", "Q200", "MR100"};
static const QStringList STR_SUBTYPE_CX10 {"Green", "Blue", "DM007", "-", "JC3015a", "JC3015b", "MK33041"};
static const QStringList STR_SUBTYPE_CG023 {"Standard", "YD829"};
static const QStringList STR_SUBTYPE_BAYANG {"Standard", "H8S3D", "X16 AH", "IRDRONE"};
static const QStringList STR_SUBTYPE_MT99 {"MT99", "H7", "YZ", "LS", "FY805"};
static const QStringList STR_SUBTYPE_MJXQ {"WLH08", "X600", "X800", "H26D", "E010", "H26WH"};
static const QStringList STR_SUBTYPE_FY326 {"Standard", "FY319"};
static const QStringList STR_SUBTYPE_HONTAI {"Standard", "JJRC X1", "X5C1 Clone", "FQ777_951"};
static const QStringList STR_SUBTYPE_AFHDS2A {"PWM and IBUS", "PPM and IBUS", "PWM and SBUS", "PPM and SBUS"};
static const QStringList STR_SUBTYPE_Q2X2 {"Q222", "Q242", "Q282"};
static const QStringList STR_SUBTYPE_WK2x01 {"WK2801", "WK2401", "W6_5_1", "W6_6_1", "W6_HEL", "W6_HEL_I"};
static const QStringList STR_SUBTYPE_Q303 {"Standard", "CX35", "CX10D", "CX10WD"};
static const QStringList STR_SUBTYPE_CABELL {"Cabell V3", "Cab V3 Telem", "-", "-", "-", "-", "Set FailSafe", "Unbind"};
static const QStringList STR_SUBTYPE_H83D {"H8 Mini 3D", "H20H", "H20 Mini", "H30 Mini"};
static const QStringList STR_SUBTYPE_CORONA {"V1", "V2", "Flydream V3"};
static const QStringList STR_SUBTYPE_HITEC {"Optima", "Optima Hub Telem", "Minima"};
static const QStringList STR_SUBTYPE_E01X {"E012", "E015"};
static const QStringList NO_SUBTYPE {STR_MULTI_DEFAULT};
// Table is designed to be shared with gui_common_arm.cpp
const Multiprotocols multiProtocols {
{MM_RF_PROTO_FLYSKY, 4, false, STR_SUBTYPE_FLYSKY, nullptr},
{MM_RF_PROTO_HUBSAN, 2, false, STR_SUBTYPE_HUBSAN, STR_MULTI_VIDFREQ},
{MM_RF_PROTO_FRSKY, 5, false, STR_SUBTYPE_FRSKY, STR_MULTI_RFTUNE},
{MM_RF_PROTO_HISKY, 1, false, STR_SUBTYPE_HISKY, nullptr},
{MM_RF_PROTO_V2X2, 1, false, STR_SUBTYPE_V2X2, nullptr},
{MM_RF_PROTO_DSM2, 3, false, STR_SUBTYPE_DSM, nullptr},
{MM_RF_PROTO_YD717, 4, false, STR_SUBTYPE_YD717, nullptr},
{MM_RF_PROTO_KN, 1, false, STR_SUBTYPE_KN, nullptr},
{MM_RF_PROTO_SYMAX, 1, false, STR_SUBTYPE_SYMAX, nullptr},
{MM_RF_PROTO_SLT, 4, false, STR_SUBTYPE_SLT, nullptr},
{MM_RF_PROTO_CX10, 6, false, STR_SUBTYPE_CX10, nullptr},
{MM_RF_PROTO_CG023, 1, false, STR_SUBTYPE_CG023, nullptr},
{MM_RF_PROTO_BAYANG, 3, false, STR_SUBTYPE_BAYANG, STR_MULTI_TELEMETRY},
{MM_RF_PROTO_MT99XX, 4, false, STR_SUBTYPE_MT99, nullptr},
{MM_RF_PROTO_MJXQ, 5, false, STR_SUBTYPE_MJXQ, nullptr},
{MM_RF_PROTO_FY326, 1, false, STR_SUBTYPE_FY326, nullptr},
{MM_RF_PROTO_SFHSS, 0, true, NO_SUBTYPE, STR_MULTI_RFTUNE},
{MM_RF_PROTO_HONTAI, 3, false, STR_SUBTYPE_HONTAI, nullptr},
{MM_RF_PROTO_OLRS, 0, false, NO_SUBTYPE, STR_MULTI_RFPOWER},
{MM_RF_PROTO_FS_AFHDS2A, 3, true, STR_SUBTYPE_AFHDS2A, STR_MULTI_SERVOFREQ},
{MM_RF_PROTO_Q2X2, 2, false, STR_SUBTYPE_Q2X2, nullptr},
{MM_RF_PROTO_WK_2X01, 5, false, STR_SUBTYPE_WK2x01, nullptr},
{MM_RF_PROTO_Q303, 3, false, STR_SUBTYPE_Q303, nullptr},
{MM_RF_PROTO_CABELL, 7, false, STR_SUBTYPE_CABELL, STR_MULTI_OPTION},
{MM_RF_PROTO_H83D, 3, false, STR_SUBTYPE_H83D, nullptr},
{MM_RF_PROTO_CORONA, 2, false, STR_SUBTYPE_CORONA, STR_MULTI_RFTUNE},
{MM_RF_PROTO_HITEC, 2, false, STR_SUBTYPE_HITEC, STR_MULTI_RFTUNE},
{MM_RF_PROTO_E01X, 1, false, STR_SUBTYPE_E01X, nullptr},
{MM_RF_CUSTOM_SELECTED, 7, true, STR_SUBTYPE_CUSTOM, STR_MULTI_OPTION},
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
{ 0xfe, 0, false, NO_SUBTYPE, nullptr}
};
int Multiprotocols::MultiProtocolDefinition::getOptionMin() const {
if (optionsstr == STR_MULTI_RFPOWER)
return -1;
else if (optionsstr == STR_MULTI_SERVOFREQ)
return 0;
else
return -128;
}
int Multiprotocols::MultiProtocolDefinition::getOptionMax() const {
if (optionsstr == STR_MULTI_RFPOWER)
return 7;
else if (optionsstr == STR_MULTI_SERVOFREQ)
return 70;
else
return 127;
}
const Multiprotocols::MultiProtocolDefinition & Multiprotocols::getProtocol(int protocol) const {
for (const Multiprotocols::MultiProtocolDefinition & proto: protocols)
if (proto.protocol == protocol)
return proto;
// Protocol not found, return the default (last) proto
Q_ASSERT(protocols.rbegin()->protocol == 0xfe);
return *protocols.rbegin();
}
// static
QString Multiprotocols::protocolToString(int protocol, bool custom)
{
static const QStringList strings({
"FlySky", "Hubsan", "FrSky", "Hisky", "V2x2", "DSM", "Devo", "YD717", "KN", "SymaX", "SLT", "CX10", "CG023",
"Bayang", "ESky", "MT99XX", "MJXQ", "Shenqi", "FY326", "SFHSS", "J6 PRO","FQ777","Assan","Hontai","Open LRS",
"FlySky AFHDS2A", "Q2x2", "Walkera", "Q303", "GW008", "DM002", "Cabell", "ESky 150", "H8 3D", "Corona", "CFlie",
"Hitec", "Wfly", "Bugs", "Bugs Mini", "Traxxas", "NCC-1701-A", "E01X", "V911S", "GD00X"
});
if (protocol == MM_RF_CUSTOM_SELECTED || custom)
return tr("Custom - proto %1)").arg(protocol);
else
return strings.value(protocol, CPN_STR_UNKNOWN_ITEM);
}
// static
QString Multiprotocols::subTypeToString(int protocol, unsigned subType)
{
return tr(qPrintable(multiProtocols.getProtocol(protocol).subTypeStrings.value(subType, CPN_STR_UNKNOWN_ITEM)));
}

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