Compare commits

...

658 Commits

Author SHA1 Message Date
Arne Schwabe 1599e85820 Implement AUtobind and low power modes 2016-03-15 18:57:40 +01:00
Arne Schwabe cc89285a4c fix opt 2016-03-15 00:39:04 +01:00
Arne Schwabe 79792dfd7b Implement auto bind and low power settings 2016-03-15 00:25:42 +01:00
Arne Schwabe e4f00e867f Implement specifying a custom protocol for the multi module
This is useful if OpenTX firmware is older than the multi module firmware and the protocol in question is not yet in the protocol list of the OpenTX firmware.
2016-03-15 00:24:31 +01:00
Arne Schwabe 250730789c Multi module support for Taranis
Reuse some of the DSM2 routines to avoid code duplication.

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

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

PATCH v3: Fix myeeprom.h, include option value in menu.
2016-03-15 00:22:44 +01:00
Bertrand Songis 0807edfc20 TTS prompts (en / fr) updated 2016-03-14 22:52:12 +01:00
Bertrand Songis 5c107aeece [Horus] Compilation with the StatsTraces screen was KO 2016-03-14 22:38:25 +01:00
Bertrand Songis 050c1b5a7f [Horus] Wrong timer displayed 2016-03-14 22:37:28 +01:00
Bertrand Songis e9bcb05a93 CRLF removed 2016-03-14 22:30:46 +01:00
Bertrand Songis 691f4aa0ae Horus is flashed with dfu-util in Companion 2016-03-14 22:23:22 +01:00
Bertrand Songis 0045d8bcc8 Dead code removed 2016-03-14 21:57:15 +01:00
Bertrand Songis 7adccc23dc [Horus] Stats menu refactoring 2016-03-14 21:57:15 +01:00
Andre Bernet 13657587b1 Installer cleanup 2016-03-14 22:34:47 +04:00
Bertrand Songis ccb4db4c70 [Horus] Draft for stats menu 2016-03-14 18:56:55 +01:00
Bertrand Songis b6e8b73589 Sky9x simulator should now be OK 2016-03-14 18:55:56 +01:00
Bertrand Songis 88ca7fcc68 Link error in Sky9x / 9XRPRO simulators 2016-03-14 07:04:50 +01:00
Bertrand Songis 3f3af01cca Wrong simulator started in Companion for Taranis Plus / X9E 2016-03-13 23:34:20 +01:00
Bertrand Songis 7ec2c2c5a9 Merge pull request #3358 from opentx/projectkk2glider/issue_3344_lua_language
Fixes #3344: radio and voice language returned in Lua getGeneralSetti…
2016-03-13 19:29:40 +01:00
Damjan Adamic 92c208c003 Fixes #3350: sync dialog new line was not translated 2016-03-13 19:23:00 +01:00
Damjan Adamic a1e0b550fd Re #3344: doc update 2016-03-13 18:34:29 +01:00
Damjan Adamic d5db9b7410 Fixes #3344: radio and voice language returned in Lua getGeneralSettings() 2016-03-13 18:26:08 +01:00
Bertrand Songis 129b46ed2b Some more DLLs, now it works! 2016-03-12 22:51:52 +01:00
Bertrand Songis 7f3dbd0b57 Missing DLLs 2016-03-12 22:04:31 +01:00
Bertrand Songis 6443c49285 Try to have everything compiling in the same time! 2016-03-12 20:52:03 +01:00
Bertrand Songis 9fa354779c Suffix added to the Windows compile script 2016-03-12 20:46:17 +01:00
Damjan Adamic 3134b601d4 Re #3340: emergency mode is working, model settings survive WDT reset 2016-03-12 19:38:53 +01:00
Damjan Adamic b5c59368ca Compilation fix 2016-03-12 19:29:08 +01:00
Damjan Adamic a575709088 Horus power loop fixed if power button is held pressed. 2016-03-12 19:23:15 +01:00
Bertrand Songis a0132fc4e7 More simulators in Companion 2016-03-12 19:20:31 +01:00
Bertrand Songis ddac3ea5e0 More simulators in Companion 2016-03-12 19:18:32 +01:00
Bertrand Songis f4174e6756 Windows compilation script added to git 2016-03-12 18:58:32 +01:00
Bertrand Songis 958c51b374 VC++ simu DLL compilation fixes 2016-03-12 18:31:27 +01:00
Bertrand Songis 8d1121dcc1 Make Companion optional (in case we don't have Qt5 installed) 2016-03-12 12:17:12 +01:00
Bertrand Songis 47f949c491 Make Companion optional (in case we don't have Qt5 installed) 2016-03-12 11:56:15 +01:00
Bertrand Songis 5790716a0b [Horus] Memory overflow check added in compress / uncompress methods to BACKUP RAM 2016-03-12 10:21:43 +01:00
Damjan Adamic c141554fc1 CLI fixes 2016-03-12 07:03:50 +01:00
Bertrand Songis 560a297680 [Horus] Freeze when selecting an empty models category 2016-03-11 22:55:31 +01:00
Bertrand Songis b86f45e15b Thread delays also used in simu 2016-03-11 22:45:01 +01:00
Bertrand Songis 80bc6f2d1a Date / Time on simu now right (and less warnings given by Valgrind) 2016-03-11 22:24:26 +01:00
Bertrand Songis 2b39d703a1 Compilation fix 2016-03-11 21:54:29 +01:00
Damjan Adamic 03988a3a62 Emergency mode now working 2016-03-11 21:24:09 +01:00
Bertrand Songis 5b7853029c Warning fixed 2016-03-11 20:24:47 +01:00
Bertrand Songis 4daf15869b Simulators refactoring 2016-03-11 20:24:27 +01:00
mhotar ba736a6a64 horus stats icons 2016-03-11 18:40:31 +01:00
Bertrand Songis 086204aed5 Fixes #3344 2016-03-11 18:29:00 +01:00
Bertrand Songis 44d4e93ad1 [Taranis] EEPROM savings 2016-03-11 18:22:16 +01:00
Bertrand Songis 2e57549982 Simu threads now correctly stopped 2016-03-11 18:16:53 +01:00
Bertrand Songis 946c17770a Fixes #3347 2016-03-11 18:09:31 +01:00
Bertrand Songis eb9e6d3c80 Fixes #3342 2016-03-11 18:07:40 +01:00
Bertrand Songis e1a865650f Cosmetics 2016-03-11 18:04:08 +01:00
Bertrand Songis 3d3e077fae Merge pull request #3349 from craftandtheory/next
[Taranis] fixed placement of decimal point in SMLSIZE font
2016-03-11 07:08:02 +01:00
floaledm 13f33e38f8 [Taranis] fixed placement of decimal point in SMLSIZE font 2016-03-10 17:24:03 -06:00
Bertrand Songis e0d5989bef Now a GCC compilation fix ... 2016-03-10 22:47:34 +01:00
Bertrand Songis 41a6e7c4ab Visual C++ compilation fixes 2016-03-10 22:39:51 +01:00
Bertrand Songis 64cd872055 [SPORT] Sensor switches + Telemetry switch 2016-03-10 21:16:45 +01:00
Bertrand Songis 0341b9ffce [SPORT] Alarm added when a servo is in overload or a sensor is disconnected 2016-03-10 20:22:26 +01:00
Bertrand Songis 75e613331b Audio sound removed (for EEPROM format) 2016-03-10 18:51:02 +01:00
Bertrand Songis c521fce20b Default options for widgets / layouts / themes now OK on VC++ 2016-03-10 18:42:04 +01:00
Bertrand Songis 62df9831d8 Warnings removed 2016-03-10 18:40:15 +01:00
Bertrand Songis 051ec88bee [Taranis] Curve names can now only be 3 chars long 2016-03-10 18:39:38 +01:00
Bertrand Songis f1f6bbfc24 [Taranis] EEPROM import/export fixes 2016-03-10 18:38:53 +01:00
Bertrand Songis 02fdede06b Merge pull request #3346 from opentx/bsongis/switch_to_qt5
Move to Qt5 and Qt5Multimedia
2016-03-10 07:26:41 +01:00
Bertrand Songis aec2170e7e Move to Qt5 and Qt5Multimedia 2016-03-10 07:12:44 +01:00
Bertrand Songis d7a9710a9c Compilation fix 2016-03-09 21:17:35 +01:00
Bertrand Songis d4be000ccc Commit tests may now me executed from everywhere (not always inside sources) 2016-03-09 21:01:26 +01:00
Bertrand Songis be531b77f0 Commit tests may now me executed from everywhere (not always inside sources) 2016-03-09 20:34:34 +01:00
Bertrand Songis 9263dde231 Compilation fix 2016-03-09 20:32:46 +01:00
Bertrand Songis 473e69b3c3 [Horus] Emergency mode + some simu refactoring to avoid duplicated code 2016-03-09 19:22:27 +01:00
Bertrand Songis 10d0c56b08 [Horus] TODO added 2016-03-09 19:14:51 +01:00
Bertrand Songis c68e91c004 [Horus] Missing initialization when loading BACKUP RAM 2016-03-09 19:03:26 +01:00
Bertrand Songis e11eb2480e [Horus] Timer added in models list 2016-03-09 19:02:28 +01:00
Bertrand Songis 6b318e1383 [Horus] Cosmetics in popups 2016-03-09 19:00:30 +01:00
Bertrand Songis 382e4d2d4b [Horus] Freeze in Model Custom Scripts menu 2016-03-09 18:58:11 +01:00
Bertrand Songis 3b2524dcbb [Horus] Cosmetics 2016-03-09 18:57:18 +01:00
Bertrand Songis f75fedcb0d [Horus] Model selection screen refactoring 2016-03-09 07:06:51 +01:00
Bertrand Songis 797b4d9f1e Merge pull request #3341 from opentx/projectkk2glider/horus_reboot_and_external_module
Projectkk2glider/horus reboot and external module
2016-03-07 21:21:34 +01:00
Damjan Adamic 77d892a5de Horus:
* Fixed peripheral frequency.
 * Enabled external module driver: None and PPM protocols working. PPM timing and polarity verified.
2016-03-07 20:42:49 +01:00
Damjan Adamic 0b163ba067 CLI fixes 2016-03-07 20:41:37 +01:00
Damjan Adamic 4ebca98cdf Re #3340: Watchdog still disabled on Horus, but use -DWATCHDOG_DISABLED=OFF to enable it. Radio currently resets if WDT is enabled, because external module functions are not yet implemented. After the radio is stable default for WATCHDOG_DISABLED will be set to OFF 2016-03-07 20:09:25 +01:00
Damjan Adamic 1147db45a4 Re #3340: Cleanup
Re #3340: Software reboot tested and working on Horus
2016-03-07 20:05:12 +01:00
Damjan Adamic 4a6a20a2aa Re #3340: startup_stm32f40_41xxx.s file moved into targets directory in order to be able to customize it for each radio. 2016-03-07 20:04:09 +01:00
Bertrand Songis 7e0c78e2b7 Lua lcd.drawLine was not OK when (x1=x2 and y1>y2) or (y1=y2 and x1>x2) 2016-03-07 18:54:00 +01:00
Bertrand Songis 7cfb1b24a1 Lua lcd.drawLine was not OK when (x1=x2 and y1>y2) or (y1=y2 and x1>x2) 2016-03-06 13:35:08 +01:00
Bertrand Songis 0615fa780c PCB=TARANIS instead of PCB=HORUS for the default value 2016-03-06 13:24:03 +01:00
Bertrand Songis e43afd8001 [Horus] Compilation fix 2016-03-05 17:12:36 +01:00
Bertrand Songis 04966868eb [Horus] Ram backup write should be working now. Still needs to be tested with a restore on WDT 2016-03-05 16:34:23 +01:00
Bertrand Songis 52ebba3802 [Horus] Ram backup continued (RLC methods added) 2016-03-05 15:54:58 +01:00
Bertrand Songis 3b8c5bbeb1 Code formatting 2016-03-05 15:44:42 +01:00
Bertrand Songis 8e2c280e4a Script for code generation for model/radio structure copy is now OK 2016-03-05 12:42:19 +01:00
Bertrand Songis e0544e2d1e Test code enabled only in SIMU mode 2016-03-05 11:44:07 +01:00
Bertrand Songis f76a368497 Warning removed 2016-03-05 10:02:03 +01:00
Bertrand Songis 0c5f5695cc MSVC errors 2016-03-05 09:58:38 +01:00
Bertrand Songis 863272bc52 MSVC errors 2016-03-05 08:59:28 +01:00
Bertrand Songis 15912854e8 Warnings removed 2016-03-05 08:53:16 +01:00
Bertrand Songis ad33bff31c Warning removed 2016-03-05 08:42:55 +01:00
Bertrand Songis b8195e1372 New packages needed on Travis 2016-03-05 08:36:34 +01:00
Bertrand Songis 97a8dc33be New packages needed on Travis 2016-03-05 08:31:50 +01:00
Bertrand Songis ff4f914d34 New packages needed on Travis 2016-03-05 08:09:21 +01:00
Bertrand Songis 4104efbb17 Compilation fix 2016-03-05 08:07:04 +01:00
Bertrand Songis a7d0816ac7 Merge pull request #3326 from opentx/bsongis/passthrough_sport_to_lua
Bsongis/passthrough sport to lua
2016-03-05 00:27:13 +01:00
Bertrand Songis 7cf66c56c2 [Taranis] Infinite loop when drawing horizontal lines with a negative width 2016-03-05 00:22:18 +01:00
Bertrand Songis 55f71f053b myeeprom.h splitted into dataconstants.h and datastructs.h 2016-03-04 23:54:35 +01:00
Andre Bernet 7a45b3f71b Sync Companion voice language list with radio (fix #3338) 2016-03-03 10:53:54 +04:00
Andre Bernet 4ef981e914 Hungarian TTS fixes by hori64 2016-03-03 10:38:25 +04:00
Bertrand Songis 338c34427e [Taranis] Wizard moved to the sdcard/taranis directory 2016-03-03 07:22:24 +01:00
Bertrand Songis f41ac20051 Compilation fix 2016-03-02 23:37:01 +01:00
Bertrand Songis dee5a510f5 Compilation fix 2016-03-02 19:57:50 +01:00
Bertrand Songis 917b114b49 CMake LUA variable is now a string (YES/NO/NO_MODEL_SCRIPTS) 2016-03-02 19:44:49 +01:00
Bertrand Songis 2a5ab33d67 Compilation fix 2016-03-02 18:58:31 +01:00
Bertrand Songis 59b457650a [Horus] Cosmetics 2016-03-02 18:38:11 +01:00
Bertrand Songis 72a15318be [Horus] Transparency in the busy picto 2016-03-02 18:19:35 +01:00
Bertrand Songis 3e1d87d5b3 [Horus] Use of SD buffers in RAM instead of CCM for loading bitmaps (they may only be loaded from the main thread now) 2016-03-02 07:33:31 +01:00
Bertrand Songis b5f6618238 [Horus] UI continued 2016-03-01 23:47:11 +01:00
Bertrand Songis 23e597fffe [Horus] Memory leak 2016-03-01 19:59:32 +01:00
Bertrand Songis 2f9ae3750d [Horus] Cosmetics 2016-03-01 19:57:08 +01:00
Bertrand Songis dcc9dcbe99 [Horus] Screens Setup bugfixes 2016-03-01 19:54:55 +01:00
Bertrand Songis bfd2e2c538 [Horus] Warning removed 2016-03-01 19:53:23 +01:00
Bertrand Songis 638648a0a4 Cosmetics 2016-03-01 19:46:28 +01:00
Bertrand Songis d6c7b63f90 [9X] Warning fixed 2016-03-01 19:44:10 +01:00
Bertrand Songis 9f29003553 [Horus] Cosmetics 2016-03-01 19:15:12 +01:00
Bertrand Songis 4b4522f2ee [Horus] Bitmaps in SD Manager now truncated when too large 2016-03-01 19:12:45 +01:00
Bertrand Songis 54343be57e [Horus] Cosmetics 2016-03-01 19:07:11 +01:00
Bertrand Songis d449075a54 [9X] Warning fixed 2016-03-01 19:03:20 +01:00
Bertrand Songis 9a615adff7 [Horus] Revert to BMP bitmaps instead of PNG. It uses far less CPU 2016-03-01 19:01:31 +01:00
Damjan Adamic 8427e6ed04 Variables that are filled from SD card moved to RAM 2016-02-29 23:24:09 +01:00
Damjan Adamic c5e8dcff38 DMA used when reading/writing from SD card to SDRAM 2016-02-29 23:07:24 +01:00
Bertrand Songis d7909e7dbc [Horus] Menu model select continued 2016-02-29 22:18:16 +01:00
Bertrand Songis 1fd1e141f2 [Horus] More bitmaps on SD. PNG format used instead of BMP. And yes it's a bad idea given the resources we have. 2016-02-29 22:17:47 +01:00
Damjan Adamic f65e42833e SD read speed tests added to CLI 2016-02-29 22:14:45 +01:00
Bertrand Songis cc4e28857d [Horus] Memory leak at each model load 2016-02-29 19:24:32 +01:00
Bertrand Songis 52a52fdb8a Memory leak in the simu (thanks Valgrind) 2016-02-29 19:20:56 +01:00
Damjan Adamic 19f392131c Fixes #3329: playDuration() second parameter is now really optional 2016-02-29 19:11:45 +01:00
Damjan Adamic fb3dd1303c Fixes #3328: docs updated 2016-02-29 19:11:28 +01:00
Bertrand Songis c6a04394c5 Invalid read fixed (thanks Valgrind) 2016-02-29 19:03:47 +01:00
Bertrand Songis 301cd0538b Changes in stb lib to avoid returning alpha bitmaps when no pixel has alpha 2016-02-29 18:41:35 +01:00
Bertrand Songis d28c71db86 Double test removed 2016-02-28 21:57:10 +01:00
Bertrand Songis 56fb01a958 Lua telemetryPush function now added 2016-02-28 21:21:48 +01:00
Damjan Adamic 5e96d02120 Transparent bitmaps supported/displayed in SD browser. BitmapBuffer: fixed wrong free() when using external data buffer. 2016-02-28 21:08:45 +01:00
Bertrand Songis 9a23c3fcc6 Merge pull request #3327 from opentx/projectkk2glider/new_jitter_filter_for_next2
Projectkk2glider/new jitter filter for next2
2016-02-28 19:58:45 +01:00
Bertrand Songis fe901dabdf luaRegister function removed 2016-02-28 19:55:20 +01:00
Bertrand Songis 806d547ced DMA used for ARGB4444 bitmaps 2016-02-28 19:37:50 +01:00
Bertrand Songis a495885472 Shift in bitmaps (and mem overflow I suppose) 2016-02-28 19:36:49 +01:00
Bertrand Songis 946fda5705 Less traces! 2016-02-28 18:38:41 +01:00
Damjan Adamic cefc78dbe8 Re #3167: Code cleanup, old bitmap loading code removed, now stb_image used exclusively. Malloc traces disabled. 2016-02-28 18:16:16 +01:00
Damjan Adamic 6acfabeaf0 Improvement of Horus ADC driver, the cross-talk between A4 and A5 was excessive. The ADC chip used supports only low impedance sources, so the time between MUX change and ADC sampling had to be bigger. 2016-02-28 17:58:19 +01:00
Damjan Adamic 9a40830f8a Re #3233: Better ADC jitter filter: using inverted formula and scaled input value for jitter filter, gives better result for small changes 2016-02-28 17:58:13 +01:00
Damjan Adamic 3004a61695 Show analog jitter measuring results and multipos calibration in CLI 2016-02-28 17:56:05 +01:00
Bertrand Songis 3660101e37 Cosmetics 2016-02-28 13:32:42 +01:00
Bertrand Songis acb7f1e17f Compilation fix 2016-02-28 12:17:20 +01:00
Bertrand Songis 75e1bead3f S.PORT to Lua telemetry passthrough
The Fifo is created with ```telemetryRegister``` and elements (ID + Value) are taken from the Fifo with ```telemetryPop```
Not tested at all. Just for review / discussion
2016-02-28 11:56:54 +01:00
Bertrand Songis 81a7a554c3 Languages support was broken 2016-02-27 23:53:26 +01:00
Bertrand Songis c5c92c012b Merge pull request #3324 from opentx/projectkk2glider/issue_3167_stb_image_fixes_for_horus
Projectkk2glider/issue 3167 stb image fixes for horus
2016-02-27 22:53:47 +01:00
Bertrand Songis 5f951abc15 Revert of my latest commit 2016-02-27 19:11:58 +01:00
Damjan Adamic 017f64a7a4 meminfo cli command added (memory allocator statistics from mallinfo()) 2016-02-27 18:07:23 +01:00
Damjan Adamic dfde65f397 Re #3167: Using stb library to load images 2016-02-27 17:33:27 +01:00
Damjan Adamic bdb50052ba Re #3167: Stb library modifed to reduce its stack usage. 2016-02-27 17:33:27 +01:00
Damjan Adamic 5cc8f41bce Re #3167: Update to new stb_image.h library v 2.10 (commit 30015ef464) 2016-02-27 17:33:11 +01:00
Bertrand Songis 08cb4550f6 Cosmetics 2016-02-27 15:38:23 +01:00
Bertrand Songis 4c342a1883 [Horus] Compilation fix 2016-02-26 15:50:06 +01:00
Bertrand Songis de96f607e2 [Horus] Last LCD change was commited by mistake 2016-02-26 14:45:56 +01:00
Bertrand Songis 927c511556 Compilation fix 2016-02-26 14:41:59 +01:00
Bertrand Songis 95fe7ad197 Cosmetics 2016-02-26 14:37:44 +01:00
Bertrand Songis 1b93340319 [Taranis] Sticks bitmap was not right 2016-02-26 14:30:09 +01:00
Bertrand Songis ca0e58e923 [X9E] Option added to allow the usage of HORUS sticks 2016-02-26 13:56:46 +01:00
Bertrand Songis 43b8ee361b [X9E] Option added to allow the usage of HORUS sticks 2016-02-26 13:55:09 +01:00
Bertrand Songis ee533c7950 Temporary compilation fix for VC++ 2016-02-26 13:33:50 +01:00
Bertrand Songis 2b9242fac2 [Horus] GUI continued 2016-02-25 23:14:58 +01:00
Damjan Adamic 83887f1532 Cmake PCB and USB options converted to STRING type 2016-02-25 14:58:38 +01:00
Bertrand Songis 1734ca6919 /radio/sdcard directory added to the repo 2016-02-24 22:31:19 +01:00
Bertrand Songis f299a5bfdf [Horus] White is now the default color for the Default theme. Is it good? 2016-02-21 21:05:34 +01:00
Bertrand Songis 95201db642 [Horus] Cosmetics for the LED 2016-02-21 20:00:00 +01:00
Bertrand Songis 103fea7b98 Compilation fixes 2016-02-21 19:35:30 +01:00
Bertrand Songis 358badfed9 [Horus] Bitmaps dynamic load 2016-02-21 18:25:52 +01:00
Bertrand Songis 63713578fe [Horus] LED off when drawing the SLEEP bitmap on shutdown 2016-02-21 15:16:52 +01:00
Andre Bernet 22a8a5cc80 [Horus] Fix LED off 2016-02-21 17:39:07 +04:00
Bertrand Songis 5827b0fd6c Compilation fix on X9E 2016-02-21 11:17:48 +01:00
Bertrand Songis cfe1a3777f Fixes #3307 2016-02-21 10:25:42 +01:00
Bertrand Songis d5396f8377 [Horus] Compilation fix 2016-02-21 10:13:37 +01:00
Bertrand Songis dcf7cd2c65 [RedundancyBus] Fields renamed (not PowerBox anymore) 2016-02-21 10:00:01 +01:00
Bertrand Songis 71e54b3072 [Horus] Heap now moved to the SDRAM. Around 7.5MB available, without any speed issue :) 2016-02-21 09:21:17 +01:00
Bertrand Songis fdca5a11b0 [Horus] Compilation fix 2016-02-21 09:07:43 +01:00
Bertrand Songis 8223cd907d [Horus] Another 40K saved for Lua 2016-02-21 08:58:29 +01:00
Bertrand Songis c2f8ef83c7 [Horus] Unused code 2016-02-21 08:55:02 +01:00
Bertrand Songis 7fceed4f5f [Horus] Another 64K saved for Lua 2016-02-20 19:42:55 +01:00
Bertrand Songis 2519df3b59 [Horus] Cosmetics 2016-02-20 19:40:02 +01:00
Bertrand Songis 6e30373f86 [Horus] Changes were applied to Taranis by mistake 2016-02-20 19:28:47 +01:00
Bertrand Songis b29d8c50ba [Horus] Cosmetics 2016-02-20 19:24:51 +01:00
Bertrand Songis fe3efb9483 [Horus] Cosmetics 2016-02-20 19:15:22 +01:00
Bertrand Songis f926b85611 [Horus] 64K more for Lua 2016-02-20 17:36:18 +01:00
Bertrand Songis 401f0f2a4f Cosmetics 2016-02-20 17:34:47 +01:00
Bertrand Songis 701d02ba8e [Horus] New bitmaps for popups 2016-02-20 17:12:30 +01:00
Bertrand Songis 67a599e0b9 [CLI] reboot command added 2016-02-20 16:55:05 +01:00
Bertrand Songis 0f4f49b64e [CLI] reboot command added 2016-02-20 15:05:19 +01:00
Bertrand Songis 84bf31f908 Compilation error 2016-02-19 07:13:53 +01:00
Bertrand Songis 1d9056fe8d Update .travis.yml 2016-02-18 23:46:17 +01:00
Bertrand Songis 5c175bfd7f Update .travis.yml 2016-02-18 23:31:37 +01:00
Bertrand Songis b74a3987c0 Update .travis.yml 2016-02-18 23:07:42 +01:00
Bertrand Songis d1be1b4ea0 [Horus] Widgets can be written in Lua 2016-02-18 22:10:27 +01:00
Bertrand Songis 01ef176173 [Horus] Cosmetics 2016-02-17 20:31:42 +01:00
Bertrand Songis 3e0a314307 [Horus] Preparation for the SCRIPTS/WIDGETS and SCRIPTS/LAYOUTS Lua scripts 2016-02-17 20:30:30 +01:00
Bertrand Songis 6622324483 [Horus] Transparency missing in alert boxes on real radio 2016-02-17 20:29:42 +01:00
Bertrand Songis 286a865d30 [Horus] Cosmetics 2016-02-17 20:27:40 +01:00
mhotar 5d72bbdc90 horus masks 1-8 for mainviews 2016-02-17 20:21:57 +01:00
Bertrand Songis a44d0ddc14 Compilation fix 2016-02-17 07:01:51 +01:00
Bertrand Songis 97ef3fa916 [Horus] Widget selection new design by Martin 2016-02-16 22:59:47 +01:00
Bertrand Songis f9f7ddd639 [Horus] Alert Box new design by Martin 2016-02-16 22:07:33 +01:00
Bertrand Songis 33910c8721 [Horus] UI continued 2016-02-16 20:45:25 +01:00
Bertrand Songis e72a049683 [Horus] Cosmetics 2016-02-16 18:59:45 +01:00
Bertrand Songis f7fafc0948 [Horus] New Lua LCD functions 2016-02-16 18:57:51 +01:00
Bertrand Songis 1d867a0daa [Horus] Lua constants names can go up to 32 chars 2016-02-16 18:54:07 +01:00
Bertrand Songis 3c56ea0122 [Horus] HORUS compilation removed from the Makefile. CMake is now mandatory 2016-02-16 18:52:35 +01:00
Bertrand Songis 6db97c573b [Horus] Array initialization when loading a bitmap fails 2016-02-16 18:51:37 +01:00
Bertrand Songis 5853ac635f [Horus] More constants exported to the Lua interface 2016-02-16 18:49:41 +01:00
mhotar fad9710012 horus images to alpha 2016-02-16 17:19:35 +01:00
Damjan Adamic 9abeb15360 Fixes #3256: Spanish TTS correction for hundreds 2016-02-15 22:17:10 +01:00
Damjan Adamic 29b8b2685c Fixes #3285: only first 32 input lines (out of 64) were accessible in Lua 2016-02-15 21:50:57 +01:00
Bertrand Songis 79a5f65a2c [Horus] UI continued 2016-02-15 21:28:31 +01:00
Andre Bernet c07e965542 No more XercesC 2016-02-15 23:50:10 +04:00
Andre Bernet 9e4f9bb7ed No more XercesC 2016-02-15 23:28:24 +04:00
JivaroFAD 32f278ee3f MEGA2560 audio=no fix 2016-02-14 21:01:06 +01:00
Andre Bernet 860409de29 [Horus] UI fixes 2016-02-12 12:21:33 +04:00
Bertrand Songis 48081db9f6 [Horus] Compilation fixes 2016-02-11 23:34:07 +01:00
Bertrand Songis 02f06706c2 [Horus] Themes introduction 2016-02-11 22:58:43 +01:00
Bertrand Songis 1da4df143c [Horus] Travis OK? 2016-02-10 17:16:45 +01:00
Bertrand Songis 6ce34c511c [Horus] Last commit broke the UI :( 2016-02-10 17:00:55 +01:00
Bertrand Songis 27fe5c198f [Horus] Warnings fixed 2016-02-10 14:55:00 +01:00
Bertrand Songis cd821116c5 [Horus] UI Refactoring 2016-02-10 14:38:14 +01:00
Bertrand Songis 65fc20ddde [Horus] Martin's design for buttons 2016-02-09 23:08:47 +01:00
Bertrand Songis 2037c33ce1 [Horus] Martin's design to choose the layout 2016-02-09 23:08:47 +01:00
JivaroFAD 2e76be5b0b Mega2560 audio compilation allowed 2016-02-09 20:07:37 +01:00
JivaroFAD cdcf64e38c Mega2560 audio correction 2016-02-09 19:39:15 +01:00
Andre Bernet fd1181dc09 VC++ compilation 2016-02-09 02:07:22 +04:00
Andre Bernet c7bd968586 Fix annoying space and newline in date constant on windows requiring manual fix each time 2016-02-09 01:22:23 +04:00
Bertrand Songis 11cc82a7ac [Horus] UI bugfix 2016-02-08 21:41:13 +01:00
Bertrand Songis 1ba6a56641 Travis compilation fix 2016-02-08 21:20:59 +01:00
Bertrand Songis 366c286e73 [Horus] UI continued 2016-02-08 20:56:02 +01:00
Andre Bernet afddad9396 Taranis main view adjustments for 3-char switch names (fix #3278) 2016-02-07 15:45:47 +04:00
Andre Bernet 110c5da1e7 Joystick now supports 24 buttons (ch9-32) (fix #3268) 2016-02-06 09:34:12 +04:00
Bertrand Songis fda4cac1ed [Horus] 2016-02-01 20:45:56 +01:00
Andre Bernet 7d0f5a9d9b Store control types and names in profile (fix #3260) 2016-01-31 12:21:18 +01:00
Bertrand Songis e64866244d Compilation fix 2016-01-31 11:40:27 +01:00
Bertrand Songis 1c38ccaa12 New menu to configure the user custom screens 2016-01-31 11:35:25 +01:00
Bertrand Songis 40ae1879e8 VC++ compilation fix 2016-01-31 11:34:07 +01:00
Bertrand Songis 979a86f24e Companion crash when opening a new model fixed 2016-01-31 00:22:03 +01:00
Andre Bernet 992897a5a7 Import/export handling was broken for Average formula telemetry sensors (Fix #3262) 2016-01-30 23:06:48 +01:00
Andre Bernet 8733915634 Fix 2.2 nightly updates 2016-01-30 22:47:56 +01:00
Bertrand Songis 643e449f52 Calibration modified 2016-01-30 13:54:52 +01:00
Bertrand Songis c36acc5372 SPORT_FILE_LOG renamed to LOG_TELEMETRY. And logs are now stored in telemetry.log 2016-01-30 12:58:00 +01:00
Bertrand Songis 3913a36aeb Crossfire again @400000 bauds 2016-01-30 12:14:35 +01:00
Bertrand Songis 2a4bc2cf6a Fixes #2022 2016-01-30 11:23:34 +01:00
Bertrand Songis fe865dfdae Cosmetics 2016-01-30 11:14:43 +01:00
Bertrand Songis 45cdfac22b Cosmetics 2016-01-30 10:17:28 +01:00
Bertrand Songis c07a2d338a Try to update gcc-avr on Travis and fix compilation failure 2016-01-30 00:40:29 +01:00
Bertrand Songis 16a37db86f Try to update gcc-avr on Travis and fix compilation failure 2016-01-30 00:37:35 +01:00
Bertrand Songis 695e05c713 Try to update gcc-avr on Travis and fix compilation failure 2016-01-30 00:36:32 +01:00
Bertrand Songis 29eafb4fba Try to update gcc-avr on Travis and fix compilation failure 2016-01-30 00:29:05 +01:00
Bertrand Songis 7599d22c83 Try to update gcc-avr on Travis and fix compilation failure 2016-01-30 00:00:49 +01:00
Bertrand Songis 027f442079 Update README.md 2016-01-29 23:59:03 +01:00
Bertrand Songis 56fd1e8039 Try to update gcc-avr on Travis and fix compilation failure 2016-01-29 23:57:00 +01:00
Bertrand Songis 0e1ab00ed3 Try to update gcc-avr on Travis and fix compilation failure 2016-01-29 23:54:35 +01:00
Bertrand Songis 7ebebb312a Fixes #3255 2016-01-29 16:11:51 +01:00
Bertrand Songis 364bf6ac23 Commit tests should be OK now 2016-01-29 14:27:27 +01:00
Bertrand Songis b7e4a3c63b [Horus] A few TODOs fixed (some sprintf removed) 2016-01-28 23:12:26 +01:00
Bertrand Songis d6c17a7ead Compilation failure 2016-01-28 06:53:13 +01:00
Bertrand Songis 3854e05f26 [Horus] Missing bitmaps 2016-01-27 23:03:33 +01:00
Bertrand Songis 087e606021 [Horus] Horus downloads now enabled 2016-01-27 22:29:03 +01:00
Bertrand Songis 4c8789106d [Horus] Button widget added (still not finished) 2016-01-27 22:17:51 +01:00
Bertrand Songis 5ff4d8829a Compilation failure 2016-01-27 07:09:15 +01:00
Bertrand Songis a313d541dc Compilation failure 2016-01-27 07:01:36 +01:00
Bertrand Songis a8300715a9 [Horus] View main - Timer bitmap added 2016-01-26 21:51:04 +01:00
Bertrand Songis d118acdf20 [Horus] Batt range added in Radio Setup 2016-01-26 21:48:27 +01:00
Bertrand Songis 9f60e3c909 [Horus] Hardware menu added to the simulator 2016-01-26 06:45:59 +01:00
Bertrand Songis 9d7e38aeff Missing bitmaps added 2016-01-25 22:38:42 +01:00
Bertrand Songis 5c71d74aab [Horus] Hardware menu added. Calibration menu moved to the Hardware menu 2016-01-25 22:11:25 +01:00
Damjan Adamic e738293a52 Fixes #3248: offset was missing in inputs display 2016-01-25 20:22:06 +01:00
Bertrand Songis 870002ab79 [Horus] Calibration bitmaps 2016-01-25 18:58:44 +01:00
Bertrand Songis 07d62e39db [Horus] Rotary encoder initialization now good 2016-01-25 18:40:21 +01:00
Bertrand Songis 48365f36a5 [Horus] Slider a little bit modified 2016-01-25 07:29:36 +01:00
Bertrand Songis b43d336978 Missing bitmaps 2016-01-25 06:44:05 +01:00
Bertrand Songis e5ae58d4d7 Calibration bitmaps by Martin 2016-01-24 22:36:11 +01:00
Bertrand Songis b141203bc1 [Horus] Slider with Martin's design 2016-01-24 22:30:46 +01:00
Bertrand Songis 16eaa0347d Bitmaps moved 2016-01-24 22:29:25 +01:00
Bertrand Songis c0c7968fc4 [Horus] Pots and sliders now correct in the main view 2016-01-24 20:54:02 +01:00
mhotar e1463b99e6 Horus button and slider bitmaps 2016-01-24 12:27:59 +01:00
Bertrand Songis e8318cd8de Mike's bootloader moved to GitHub 2016-01-24 09:21:12 +01:00
Bertrand Songis 0eb71cb4f2 [Horus] Red LED on error. Blue LED otherwise 2016-01-22 23:05:00 +01:00
Bertrand Songis c5f3010295 [Taranis] Cosmetics 2016-01-22 22:37:29 +01:00
Bertrand Songis 641b6a321a [Horus] Internal module and Telemetry now OK. Trainer modes (as Taranis) added 2016-01-22 22:37:06 +01:00
Bertrand Songis a42b63ff34 [Horus] Missing telemetry code 2016-01-22 22:14:51 +01:00
Bertrand Songis d2ec99513c [Horus] Missing pulses code 2016-01-22 22:07:37 +01:00
Bertrand Songis 8eb3480acc [Horus] Remaining trace removed 2016-01-22 22:04:34 +01:00
Bertrand Songis c9ae964428 [Horus] Haptic now OK 2016-01-20 21:40:53 +01:00
Bertrand Songis c51a85f376 [Horus] Mixer volumes range again [-2:+2]. Could be improved later. 2016-01-20 20:05:28 +01:00
Bertrand Songis 6c54374ed8 [Horus] VS1053B Volume added. No ticks at all compared to Taranis! 2016-01-20 19:52:14 +01:00
Bertrand Songis da76106465 Cosmetics 2016-01-20 15:19:53 +01:00
Bertrand Songis 3b3555df48 Travis should be happy now 2016-01-20 15:18:08 +01:00
Bertrand Songis c8ae36997e Simu always compiled in debug mode (-g) 2016-01-20 15:16:40 +01:00
Bertrand Songis 30bf6f7530 [Horus] Segfault in popups displaying file lists 2016-01-20 15:15:51 +01:00
Bertrand Songis 1786d998f8 [Horus] MP3 driver now OK. Still the volume to add 2016-01-20 13:44:07 +01:00
Bertrand Songis 708ef3bc98 Firmware compilation under mingw32 is now OK (tested for Horus) 2016-01-19 20:16:07 +01:00
Damjan Adamic 4aa6bd12ca Fixes #3233: Added ADC jitter measurement (use MEASURE_JITTER=YES to enable), Added ADC jitter filter (use JITTER_FILTER=No to disable) (ported from master) 2016-01-19 17:13:11 +01:00
Bertrand Songis c46c1f887a [Horus] MP3 driver. The sound is completely distorded (why?), but the background noise is not there 2016-01-18 23:26:23 +01:00
Damjan Adamic a8172e3588 Fixes #2639: ADC crosstalk on X9E fixed, sample time was not set for the right channels, sample time also needed to be increased 2016-01-18 20:45:31 +01:00
Andre Bernet 91341fa759 Companion looking for custom scripts at the wrong place (fix #3237) 2016-01-18 14:41:44 +01:00
Bertrand Songis 0bad169008 GUI simplification. Needs to be reviewed, but it is better on Horus like this 2016-01-17 23:29:38 +01:00
Bertrand Songis aa7c320821 [Horus] Shutdown noise removed 2016-01-17 22:44:07 +01:00
Bertrand Songis 5c67e20fa5 [Horus] Makefile updated 2016-01-17 22:00:56 +01:00
Bertrand Songis aa62f0d6f1 [Horus] Not sure it's good. But the 10ms timer goes at the right speed and audio is good (but still very noisy!) 2016-01-17 21:42:11 +01:00
Bertrand Songis c86ace9976 [Horus] Audio now OK. PI9 needed to be set as INPUT 2016-01-17 21:41:14 +01:00
Bertrand Songis b11d45dbb5 [Horus] Shutdown animation fixed 2016-01-17 21:38:42 +01:00
Bertrand Songis 50b76183da XSD and Xerces not needed anymore (they were not used) 2016-01-16 15:37:15 +01:00
Bertrand Songis 1a7fb12f15 Compilation fix 2016-01-16 11:20:44 +01:00
Bertrand Songis cbfdf9b9f5 Compilation fix 2016-01-16 11:10:36 +01:00
Bertrand Songis 3f7b289ebe [Horus] Shutdown animation now OK 2016-01-16 11:00:42 +01:00
Damjan Adamic 295491f965 Header files stamp.h and location.h now generated in build directory 2016-01-15 20:26:08 +01:00
Damjan Adamic 16f465b147 Hours simu build now uses the same config as firmware build 2016-01-15 19:39:16 +01:00
Bertrand Songis c91511565e [Horus] MP3 driver extracted from FrSky drivers. I would like to have the sine test wave OK. Still nothing for now 2016-01-15 17:30:54 +01:00
Bertrand Songis b6759d5434 [Horus] Compilation fix 2016-01-15 12:42:37 +01:00
Bertrand Songis 1771a47637 [Horus] Debug variable added for the audio buffer count. This one is incremented correctly. 2016-01-15 12:23:55 +01:00
Bertrand Songis 677995205d [Horus] I2C audio pot is removed in latest board! 2016-01-15 11:16:24 +01:00
Bertrand Songis a6a71b8650 Google tests should be OK 2016-01-15 10:36:20 +01:00
Bertrand Songis ab4efe89cc Compilation error 2016-01-15 09:09:19 +01:00
Bertrand Songis efb37a4419 Remarks from Damjan in e8aaa67450 taken into account 2016-01-15 08:44:45 +01:00
Bertrand Songis d85ee61cb3 Compilation error 2016-01-15 08:02:44 +01:00
Bertrand Songis eecdef3c5a VC++ compilation 2016-01-14 23:15:51 +01:00
Bertrand Songis a1883db889 Curve names used instead of CV<X> when available 2016-01-14 23:13:26 +01:00
Bertrand Songis 0dd15ebbab [Taranis] EEPROM v217 => v218 conversion fixes - The MENU and EXIT keys are now OK 2016-01-14 22:57:19 +01:00
Bertrand Songis 3ad57cf3ff VC++ compilation 2016-01-14 19:46:27 +01:00
Damjan Adamic f27c092ba4 Missing stuff from commit e8aaa67450 2016-01-14 19:23:56 +01:00
Bertrand Songis e8aaa67450 [Horus] GUI continued - #3159
[GVars] Refactoring continued - #3185
2016-01-14 07:41:30 +01:00
Andre Bernet 43b84385d8 Cosmetics 2016-01-12 11:31:34 +04:00
Andre Bernet 7fe39791ff Cosmetics 2016-01-12 11:23:58 +04:00
Damjan Adamic a3fac6049f Fixes #3207: proper sensor instance generation in Telemetry Simulator (ported from master #3213) 2016-01-11 18:58:41 +01:00
Damjan Adamic e3eb236e7b Nightly build fix: gmake target only availabe if gtests source is found 2016-01-11 18:42:37 +01:00
Andre Bernet a57053e390 RTC tooltip corrected (fix #3225) 2016-01-11 20:36:04 +04:00
Damjan Adamic f2362bb748 Fixes #3222 : Throttle Source combobox was populated multiple times (ported from master) 2016-01-10 21:52:47 +01:00
Damjan Adamic 8780535ff9 Fixes #3223: some lua fields were not exported (CPUARM) 2016-01-10 21:13:42 +01:00
Damjan Adamic 12af6a8a19 Travis using cmake for build tests 2016-01-10 20:43:19 +01:00
Damjan Adamic 7faa7c79bf Re #2939: additional test for EDGE logical switch 2016-01-10 18:52:42 +01:00
Damjan Adamic 0ac9998e6b Fixes #2939: Logical switch internal state was being reset by the AND switch, that affected its function (it looked like AND was applied before the EDGE processing, not after like it is done for other logical switch types). (ported from master branch) 2016-01-10 18:52:42 +01:00
Damjan Adamic a76fc4c88c Re #2939: gtests added to cmake 2016-01-10 18:43:33 +01:00
Bertrand Songis 26469b8627 [Horus] Cosmetics 2016-01-10 13:27:02 +01:00
martin ba4dd66891 horus startup/shutdown images 2016-01-10 12:41:47 +01:00
Bertrand Songis be67637ec6 [Horus] Compilation fix 2016-01-09 11:44:23 +01:00
Bertrand Songis 595a191be4 [Horus] Compilation fix 2016-01-09 11:19:01 +01:00
Bertrand Songis 1ff32c64f5 [Horus] Bitmaps must be word aligned! 2016-01-09 01:05:09 +01:00
Bertrand Songis 87f8ea516b Compilation fix 2016-01-08 23:34:57 +01:00
Bertrand Songis 86df9fee4a Compilation fix 2016-01-08 23:17:30 +01:00
Bertrand Songis bd7769e717 [Horus] Throttle stick interrupts the splash 2016-01-08 23:07:29 +01:00
Bertrand Songis c42696102a Cosmetics 2016-01-08 22:27:55 +01:00
Bertrand Songis 82a4ad4103 [Horus] Fixes. ADC + Switches + Trims + RTC OK 2016-01-08 22:21:26 +01:00
Bertrand Songis 685dece185 [Horus] Missing dependency 2016-01-08 16:49:20 +01:00
Bertrand Songis a43271c7a6 [Horus] First fixes on the real radio 2016-01-07 23:56:18 +01:00
Bertrand Songis bbe4e7d4c3 Fixes #3206 2016-01-06 23:29:20 +01:00
Bertrand Songis 3d9553d5f3 #3206 - Statistics view reworked 2016-01-06 23:12:02 +01:00
Bertrand Songis 5e02140ac7 [CMake] BOLD missing in Taranis compilation 2016-01-06 22:32:13 +01:00
Bertrand Songis d54525fe7a Cosmetics 2016-01-06 21:55:42 +01:00
Bertrand Songis 8a819dbed5 OpenTX copyright date updated to 2016 2016-01-06 21:54:15 +01:00
Damjan Adamic b4cffbcce1 nightly-22 updated 2016-01-04 22:34:23 +01:00
Damjan Adamic 9a5bd48712 More changes 2016-01-04 22:25:52 +01:00
Damjan Adamic d8bc752291 Revision fetched after the repository update.
Removed unused files.
Unification of nightly and release scripts
Code cosmetics
2016-01-04 22:25:52 +01:00
mhotar f6740c4583 CZ translation-minor update 2016-01-04 20:35:26 +01:00
Bertrand Songis 5f0bfc50e9 Merge pull request #3197 from opentx/projectkk2glider/issue_3167_image_support
Projectkk2glider/issue 3167 image support
2016-01-03 19:50:39 +01:00
Damjan Adamic f61bb941dc Read image using FatFs and disable stb-image stdio support 2016-01-03 18:49:21 +01:00
Damjan Adamic 0600122102 Small fixes 2016-01-03 18:05:18 +01:00
Damjan Adamic a4e6c90d1d Jenkins scripts latest state from the server 2016-01-03 16:58:24 +01:00
Damjan Adamic c5e0eb84b8 Fixes #3130: remove /lib paths from RPM (ported from master) 2016-01-03 16:52:55 +01:00
Damjan Adamic b045b979cd Fixes #2974: Hardware/Calibration tab split int two tabs: Calibration (using table widget, all calibration values shown) and Hardware (ported from master) 2016-01-03 12:21:38 +01:00
Bertrand Songis 93fde17526 Compilation fix 2016-01-03 11:56:25 +01:00
Bertrand Songis dc6d9aca3a Compilation fix 2016-01-03 11:44:07 +01:00
Bertrand Songis 77772287fe Sky9x added to CMakeLists.txt 2016-01-03 11:06:15 +01:00
Damjan Adamic bfd385115f Compilaton fix 2016-01-02 21:01:28 +01:00
Damjan Adamic d7112b5dd7 BMP also works (1bit bitmaps are not supported by stb-image library) 2016-01-02 20:48:28 +01:00
Damjan Adamic acaa77daab JPEG also works 2016-01-02 20:48:28 +01:00
Damjan Adamic 03c9b2c4a2 PNG loading works 2016-01-02 20:48:28 +01:00
Damjan Adamic 826eb2569c stb-image v2.08 library added (https://github.com/nothings/stb) 2016-01-02 20:48:28 +01:00
Damjan Adamic 8809a64d57 Fixed: same BMP was loaded over and over 2016-01-02 20:26:34 +01:00
Damjan Adamic 1b177ba8b8 Fixed: OpenTX Bootloader bin2lbm conversion error (last partial chunk was missing) 2015-12-28 21:45:37 +01:00
Bertrand Songis 450bd77f67 Merge pull request #3176 from opentx/dsbeach/next-issue3141-fx-key-to-reload-scripts
Next branch fixes #3141 Fx key to reload scripts
2015-12-27 20:56:46 +01:00
David S. Beach 3e409a0371 Next branch fixes #3141 Fx key to reload scripts 2015-12-27 11:53:29 -05:00
Bertrand Songis b778c5e469 Windows package fix 2015-12-27 10:21:25 +01:00
Damjan Adamic 86c5c31293 Fixes #3040: Application Setting 'Enable automatic backup before writing firmware' was not saved (ported from master) 2015-12-26 20:59:01 +01:00
Damjan Adamic 400a6c2034 Fixes #3146: fixed Fahrenheit temperature conversion error (if PREC was not 0) (ported from master) 2015-12-26 19:40:58 +01:00
Bertrand Songis 9db8005f71 [Horus] UI continued 2015-12-26 17:58:50 +01:00
Bertrand Songis ba2d03b3ad [Taranis] Navigation bug (was introduced in 2.2 refactoring) 2015-12-26 17:58:50 +01:00
Bertrand Songis e3281ddade [Companion] All binaries written at the root of the build directory to simplify things 2015-12-26 17:58:49 +01:00
Bertrand Songis a4343d8e8c [Taranis] It was impossible to select the [Range Check] button on LR12 in EU mode 2015-12-26 17:58:49 +01:00
Damjan Adamic 2518ed9a74 Fixes #3121: Companion telemetry sensors Ratio and Offset value increment/decrement ignores precision (ported from master) 2015-12-26 16:08:10 +01:00
projectkk2glider 117e28db16 Fixes #3156: Outputs Subtrim, Min and Max values rounding problem fixed (ported from master) 2015-12-26 16:08:04 +01:00
Damjan Adamic d734e3465d Fixes #3117: Telemetry sensor Ratio parameter rounding problem fixed (ported from master) 2015-12-26 16:08:03 +01:00
Bertrand Songis e9f23b2109 [Companion] stamp target removed 2015-12-25 12:31:20 +01:00
Bertrand Songis 2d9aa72c23 VC++ compilation 2015-12-24 15:16:02 +01:00
Bertrand Songis 49d8242faf VC++ compilation 2015-12-24 15:10:50 +01:00
Bertrand Songis c5c1475bc9 VC++ compilation 2015-12-24 14:50:09 +01:00
Bertrand Songis e01d5a31c1 VC++ compilation 2015-12-24 14:26:24 +01:00
Bertrand Songis c70236cbad VC++ compilation 2015-12-24 13:39:24 +01:00
Bertrand Songis 908fce110b VC++ compilation 2015-12-24 12:33:28 +01:00
Bertrand Songis b2b09b4b04 Update Jenkins compilation script 2015-12-24 11:16:34 +01:00
Bertrand Songis 4c8b760022 Update Jenkins compilation script 2015-12-24 11:12:51 +01:00
Bertrand Songis e41ef3fa5d Cosmetics 2015-12-24 11:03:14 +01:00
Bertrand Songis d5cbf57e1b VC++ compilation 2015-12-24 11:01:20 +01:00
Andre Bernet cc40d1e611 Revert "Better placement for companion build output"
This reverts commit d82cf058f7.
2015-12-24 10:11:59 +04:00
Andre Bernet 316d42b5b6 Mixers monitor option was missing 2015-12-24 10:09:10 +04:00
Andre Bernet d82cf058f7 Better placement for companion build output 2015-12-24 09:52:59 +04:00
Bertrand Songis 2df68d1579 VC++ compilation 2015-12-23 23:45:56 +01:00
Bertrand Songis 1e15b711bb Companion binaries and libs built into the same directory 2015-12-23 22:28:54 +01:00
Bertrand Songis 97d59cfa56 Copyright script applied to all sources in the radio directory 2015-12-23 19:57:13 +01:00
Bertrand Songis 0f1ccc993e Include guard script applied to all headers in the radio directory 2015-12-23 19:47:10 +01:00
Bertrand Songis b818c0df6b [Horus] Segfault when a curve goes out of the screen 2015-12-23 19:40:04 +01:00
Bertrand Songis 42473d6868 Target make flash added 2015-12-23 19:22:29 +01:00
Bertrand Songis 31d4340ce7 Merge pull request #3169 from opentx/bsongis/Switch_to_CMake
Switch to CMake
2015-12-23 19:16:39 +01:00
Bertrand Songis 2d4d6ffe48 [Taranis] Strange bug in bootloader fixed by changing the files order in link. TODO added to understand why... 2015-12-23 19:08:46 +01:00
Bertrand Songis 1a308b0a53 Horus board tested OK 2015-12-23 18:59:16 +01:00
Bertrand Songis d02d0f26db Switch to CMake - Taranis bootloader added. Tests done. 2015-12-23 18:39:02 +01:00
Bertrand Songis 356faefb6d Ignore list updated 2015-12-23 09:11:56 +01:00
Bertrand Songis 0c78c60dc9 Switch to CMake continued 2015-12-23 00:42:05 +01:00
Bertrand Songis 88841f63ca Switch to CMake 2015-12-21 23:43:18 +01:00
Bertrand Songis c8358d7e37 VC++ compilation fix 2015-12-21 09:08:20 +01:00
Bertrand Songis c819814d94 Merge pull request #3165 from opentx/projectkk2glider/crossfire_port_to_next
Projectkk2glider/crossfire port to next
2015-12-20 23:44:10 +01:00
Bertrand Songis bccea3594c Merge pull request #3166 from opentx/projectkk2glider/powerbox_port_to_next
Projectkk2glider/powerbox port to next
2015-12-20 23:43:29 +01:00
Bertrand Songis 05c29d320c [Powerbox] 0xOB20 field added. Radio translations 2015-12-20 17:21:34 +01:00
Bertrand Songis 7789fd0b38 [Powerbox sensor] First tests done. It remains the 0x0B20 to add 2015-12-20 17:21:27 +01:00
Bertrand Songis b00ef6a9b3 [S.PORT] Powerbox fields added 2015-12-20 17:21:16 +01:00
Bertrand Songis 739f19d450 Again 16 channels for Crossfire.
I hope they won't change their mind again
2015-12-20 17:13:04 +01:00
Bertrand Songis cc8bd03d8a Crossfire support added to Companion 2015-12-20 17:12:51 +01:00
Bertrand Songis 816b22fd9d Crossfire protocol now accepts 12 channels instead of 16 2015-12-20 17:11:21 +01:00
Bertrand Songis 0504e848ed Crossfire has 16 channels (fixed) 2015-12-20 17:11:10 +01:00
Bertrand Songis 5250f5eb4c Crossfire has 16 channels (fixed) 2015-12-20 17:10:51 +01:00
Damjan Adamic 91e80d446a #2894 - Crossfire (inverted serial) sent on S.PORT pin in the module bay (ported from master f7044a20ec)
16 channels sent every 2.5ms now @ 200KBauds with CRC
2015-12-20 17:10:32 +01:00
Damjan Adamic e8983250ca [Taranis] LR12 is now EU compatible (ported from master ce3d5dbac) 2015-12-20 16:54:18 +01:00
Damjan Adamic 493130504b Re #3160: fixed Windows compilation, help/warnings shown in a message box (they were not visible on Windows) (ported from master) 2015-12-19 19:33:25 +01:00
Damjan Adamic 0db5072bed Fixes #3160: command line options support added to standalone simulator (radio type and eeprom file) (ported from master) 2015-12-18 22:44:17 +01:00
Bertrand Songis cf4fa51019 cli command "set rtc" added
syntax: set rtc <year> <month> <day> <hour> <minute> <second>"
2015-12-16 22:27:09 +01:00
Bertrand Songis 8942115f33 Fixes #3150 2015-12-16 07:11:51 +01:00
Bertrand Songis d7cbd78edf Merge pull request #3153 from mikeller/mikeller/invert_serial_rx_next
Graft of 'invert_serial_rx' onto next.
2015-12-16 07:04:30 +01:00
mikeller 90a62b00f0 Fixed compile error when building simulator. 2015-12-15 19:39:01 +13:00
Michael Keller d165a22a54 Fixup from merge. 2015-12-15 12:06:16 +13:00
Michael Keller 1f59f04070 Merge branch 'mikeller/invert_serial_rx_next' of https://github.com/mikeller/opentx into mikeller/invert_serial_rx_next 2015-12-15 12:04:03 +13:00
mikeller 01fa6471c7 Graft of serial port inversion option onto 'next'. 2015-12-15 12:03:21 +13:00
Bertrand Songis a60522df18 Merge pull request #3149 from opentx/dsbeach/next-issue3147-telem-sim-aspd-as-knots
Changes to send ASpd as knots
2015-12-14 22:27:09 +01:00
Damjan Adamic 9e237c9e46 Re #3127 and #2921: getFlightMode() can now return specified flight mode data 2015-12-14 20:40:27 +01:00
David S. Beach 9a114c903c Changes to send ASpd as knots 2015-12-14 11:53:04 -05:00
mikeller 551ef10d6f Graft of serial port inversion option onto 'next'. 2015-12-15 02:08:16 +13:00
Andre Bernet 92704687cf Ignore list updated 2015-12-14 10:31:04 +04:00
Andre Bernet 3cab898225 Case change fix 2015-12-14 10:22:28 +04:00
Bertrand Songis e103d6fc24 Merge pull request #3144 from flacjacket/python2-3_next
Python 2/3 compatibility and PEP8 on next
2015-12-14 07:16:57 +01:00
Sean Vig 4bd90d79d0 Use with open(...) as ...: context managers
Instead of manually opening and closes file objects, use the context
manager that will properly handle opening and closing files for us, even
in the event of some error
2015-12-13 18:57:36 -06:00
Sean Vig 82c3230981 PEP8 and break up radio/util/tts.py
Break up tts.py so that each language configuration of system and custom
sounds is done in a separate file, also fixing PEP8 problems with
tts.py, mostly whitespace related
2015-12-13 18:55:03 -06:00
Sean Vig 5f698d2b17 PEP8 radio/util/translate.py
Remove unused imports, fix whitespace, fix undefined variable
2015-12-13 18:55:03 -06:00
Sean Vig 4bfcfd0fc8 PEP8 radio/util/taranisicons.py
Remove unused imports, fix whitespace, fix indentation
2015-12-13 18:55:02 -06:00
Sean Vig bcc7982b3b PEP8 radio/util/sportparse.py
Remove unused import, fix whitespace, indentation, and comments
2015-12-13 18:55:02 -06:00
Sean Vig 0743785126 PEP8 radio/util/sinus.py
Fix whitespace
2015-12-13 18:55:02 -06:00
Sean Vig 196dbb1d39 PEP8 radio/util/parse.py
Fix whitespace and indentation
2015-12-13 18:55:02 -06:00
Sean Vig fa0ded50fe PEP8 radio/util/luaexport.py
Fix indentation
2015-12-13 18:55:02 -06:00
Sean Vig 2968b25cfa PEP8 radio/util/include-guard.py
Split imports, fix whitespace
2015-12-13 18:55:02 -06:00
Sean Vig 39ee317190 PEP8 radio/util/img2lbm.py
Fix whitespace
2015-12-13 18:54:55 -06:00
Sean Vig 710482e821 PEP8 radio/util/font2png.py
Fix whitespace and indentations, remove semicolons
2015-12-13 18:39:02 -06:00
Sean Vig 73f9dac120 PEP8 radio/util/fat12.py
Fix indentation and whitespace
2015-12-13 18:32:54 -06:00
Sean Vig 7dcd96d258 PEP8 radio/util/dsm2.py
Fix indentation and whitespace
2015-12-13 18:32:54 -06:00
Sean Vig 9d13484291 PEP8 radio/util/copyright.py
Remove unused imports, fix whitespace, fix comments
2015-12-13 18:32:54 -06:00
Sean Vig be154140b3 PEP8 radio/util/codecs.py
Fix white space
2015-12-13 18:32:53 -06:00
Sean Vig 054952edcb PEP8 radio/util/capitalize.py
Split imports, fix indentation
2015-12-13 18:32:53 -06:00
Sean Vig 3d6533c88b PEP8 radio/util/bin2lbm.py
Fix indentation
2015-12-13 18:32:53 -06:00
Sean Vig a0f6b0e913 PEP8 radio/util/addtr.py
Split imports, fix indentation
2015-12-13 18:32:53 -06:00
Sean Vig 50d8e21533 PEP8 radio/util/add-issue-links.py
Remove unused imports, fix indentation
2015-12-13 18:32:53 -06:00
Sean Vig b8800ed30e Update Makefile to allow Python 3
We no longer must enforce Python 2, so let Python 3 be run if that is
the system Python
2015-12-13 18:31:50 -06:00
Sean Vig 5efa5d47d3 Use Python 2/3 compatible scripts
Almost entirely fixing print statements, but also a couple importing
changes, wrapped in try/excepts, and one case where dict.keys() not
being a list would be a problem.

Also reverts e41139a397

The real fix for #1907
2015-12-13 18:28:44 -06:00
Damjan Adamic b3d52e3525 Fixes #3061: some wizard lines were not visible anymore (warn users in changelog to copy new wizard to their SD cards) 2015-12-13 20:50:25 +01:00
Damjan Adamic aa2ca4f729 Fixes #3043: unit for Air speed sensor set to knots 2015-12-13 20:39:28 +01:00
Damjan Adamic 034221a78e Inputs were not exported as Lua fields 2015-12-13 19:30:36 +01:00
Bertrand Songis f63dcfb778 Merge pull request #3142 from opentx/dsbeach/next-issue2919-telemetry-sensors-simulator
Ported simulator enhancements to next
2015-12-13 18:43:07 +01:00
David S. Beach 3ebc6bb86c Ported simulator enhancements to next 2015-12-13 11:22:33 -05:00
Bertrand Songis b8ac51564e Compilation fix 2015-12-11 15:12:50 +01:00
Bertrand Songis 5554540630 Lowercase again in all directories to simplify things 2015-12-11 10:00:03 +01:00
Bertrand Songis 1edc1fe316 Compilation fix 2015-12-11 09:29:01 +01:00
Bertrand Songis 00100c0c86 Cosmetics 2015-12-10 23:44:56 +01:00
Andre Bernet 8bdce4e213 Support language-specific chars in notes 2015-12-09 12:00:30 +04:00
Andre Bernet 4edbfcb834 AR9X firmware flashing fallback was wrong 2015-12-08 11:27:51 +04:00
Damjan Adamic 9eeb2dd6a2 More layout changes (1366 ms with table layout) 2015-12-07 18:03:46 +01:00
Damjan Adamic 49016498a3 Resize policy back (586 ms with grid layout, 1347 ms with table layout) 2015-12-07 18:03:41 +01:00
Damjan Adamic e37dcabd95 timing code (796 ms with grid layout, 1394 ms with table layout) 2015-12-07 18:03:36 +01:00
Damjan Adamic 191e37f29c TableWidget only used if -D TABLE_LAYOUT=yes compile option is defined 2015-12-07 18:03:30 +01:00
Damjan Adamic 1dcc660f31 Fixes #2921: Lua getFlightMode() function added 2015-12-07 18:01:37 +01:00
Bertrand Songis 618dd279fc Merge branch 'next' of https://github.com/opentx/opentx into next 2015-12-06 23:12:00 +01:00
Bertrand Songis 13927800e2 Compilation fix 2015-12-06 23:11:42 +01:00
Bertrand Songis 384bfea9f9 Update README.md 2015-12-06 22:58:00 +01:00
Bertrand Songis 1e2130de53 [Horus] Lua model scripts added 2015-12-06 22:54:43 +01:00
Damjan Adamic 9d29b483c5 Lua export fixes ported from master
Cmake Horus font dependencies fixed
Jenkins build scripts added and fixed
2015-12-06 11:26:07 +01:00
Damjan Adamic 75c1f9f3f7 Compilation fix 2015-11-30 20:04:28 +01:00
Damjan Adamic af6ea012bb Lua documentation update 2015-11-30 18:53:33 +01:00
Damjan Adamic 5492c18a01 Lua exports fixes (ported from master 5d7cc79d):
* X9E fields were missing
 * inputs were missing
 * renamed X9E center sliders, which name collided with logical switches
2015-11-30 18:45:13 +01:00
Bertrand Songis fd554cf013 Merge pull request #3115 from HakanBastedt/HakanBastedt/More_Swedish_translation_issues_3113
Swedish translation now up-to-date and in sync with EN #3113
2015-11-28 22:49:32 +01:00
Håkan Båstedt 9bc63c7421 Fixed messed-up line breaks 2015-11-28 22:08:55 +01:00
Håkan Båstedt 5169892d39 Swedish translation now up-to-date and in sync with EN 2015-11-28 14:43:47 +01:00
Bertrand Songis bca9866675 [Horus] A few SD card / Models storage fixes 2015-11-27 21:33:02 +01:00
Bertrand Songis 787d2ffa92 [Horus] Freeze when invalid (or no) model bitmap 2015-11-26 22:59:06 +01:00
Damjan Adamic d2155ef089 Fixes for Windows build 2015-11-26 21:40:28 +01:00
Bertrand Songis f80a788754 Merge pull request #3112 from opentx/projectkk2glider/issue_2469_lua_keys_for_next_part2
Re #2469: part2: keys accesible to Lua telemetry scripts (Taranis only)
2015-11-26 21:19:39 +01:00
Bertrand Songis 7c1634c00d Horus simu compilation fix 2015-11-26 20:40:13 +01:00
Damjan Adamic 1cbd0ec4b4 Compilation fix for git ID (another try) 2015-11-26 20:33:05 +01:00
Damjan Adamic dc2d2e1f2e Compilation fix for git ID 2015-11-26 20:21:33 +01:00
Damjan Adamic 98d5966946 stamp.h should be PHONY target 2015-11-26 20:10:30 +01:00
Damjan Adamic f184e9bed3 Re #2469: part2: keys accesible to Lua telemetry scripts (Taranis only) (ported #3087 from master commits 3186a5d99..94d8b8b0e8d) 2015-11-26 19:40:32 +01:00
Bertrand Songis cbe244fc6c Fixes Horus compilation 2015-11-26 19:35:07 +01:00
Bertrand Songis f8201844d7 Merge pull request #3111 from opentx/projectkk2glider/issue_2469_lua_keys_for_next_part1
Re #2469: part1: Menu system renaming of variables and refactoring
2015-11-26 18:35:41 +01:00
Damjan Adamic 51b8f9b054 Re #2469: part1: Menu system renaming of variables and refactoring (ported #3087 from master commits 3186a5d99..94d8b8b0e8d) 2015-11-26 18:29:20 +01:00
Andre Bernet ab99740e1b Swedish TTS fixes by HakanBastedt 2015-11-26 13:07:41 +04:00
Bertrand Songis f19815ee26 Cosmetics 2015-11-25 23:15:29 +01:00
Bertrand Songis 84bd62bdce Merge pull request #3105 from opentx/projectkk2glider/lua_additions_for_next
Lua addition ported from master to next
2015-11-25 22:56:36 +01:00
Damjan Adamic efc57d4cf2 Spaces removed 2015-11-25 22:44:22 +01:00
Bertrand Songis d101a6d181 Compilation fix 2015-11-25 21:58:51 +01:00
Bertrand Songis 71f08998dd [Horus] No more errors in Lua interface compilation 2015-11-25 21:50:12 +01:00
Bertrand Songis 791b1173e3 Another couple of functions renamed
And nothing else this time!
2015-11-25 21:24:20 +01:00
Damjan Adamic 7538fcfb51 Git commit ID added to stamp
Fixes #2921: getValue() now also returns pilot position
Fixes #3062: Close any Lua open files when radio powers off
Fixes #3095: Lua string library added (only 6k bytes of flash used)
Re #3095: luaGetVersion() also returns version as numbers
(Ported from master 7ef790d3..4d0bd14ad and squashed into one commit)
2015-11-25 18:00:44 +01:00
Bertrand Songis 7e6dc610ac Compilation fix 2015-11-25 07:40:15 +01:00
Bertrand Songis 765ff269f9 Compilation fix 2015-11-24 22:48:16 +01:00
Bertrand Songis 01187e60c2 Some more LCD functions renamed 2015-11-24 22:09:22 +01:00
Damjan Adamic f92b71c0b8 RRe #2861: Use new TableLayout for Logical switches, Outputs and Special functions (ported from master 731faa8 and squashed into one commit) 2015-11-23 18:56:38 +01:00
Damjan Adamic edab80e6af A FAT12 dump script that got left behing in some old master branch (was used in #1793) 2015-11-22 18:11:49 +01:00
Damjan Adamic 18e36657f8 Re #3026: add Clear to the flight mode (context menu on the Name label) (ported from master b0d3ae26) 2015-11-22 18:11:29 +01:00
Bertrand Songis 683f6e22e2 [Horus] MODELSEL screen continued 2015-11-21 11:35:35 +01:00
Damjan Adamic 0db2013d24 Lua documentation update (ported from master 682fa5d) 2015-11-20 21:25:40 +01:00
Bertrand Songis 6f0de32ba8 [Horus] Menu CurveOne improved 2015-11-20 20:19:38 +01:00
Bertrand Songis 170a2b2612 Should fix the latest compilation error on Visual Studio 2015-11-19 19:52:52 +01:00
Damjan Adamic f05058252f mainmenu.lbm removed from Taranis. Cmake dependencies fixed. 2015-11-19 18:31:44 +01:00
Damjan Adamic 32d0e3890a Additonal stamp.h fixes 2015-11-19 18:16:58 +01:00
David S. Beach ee95c973e9 Fixes #3024: Companion 2.1 (windows) - Lua 'execute' fails in non-root directory (ported from master, re #3025) 2015-11-19 17:57:33 +01:00
dsbeach a1bb31b521 Modifications to luaCompileAndSave() - as scripts are loaded it will check for existing file <file>.lua.src and compile it to <file>.lua if found. (ported from master, re #3079) 2015-11-19 17:50:07 +01:00
Damjan Adamic e1cf90d6d4 Stamp fix 2015-11-19 15:48:19 +01:00
Damjan Adamic cc836a049b Re #3053: clean translations/*.h (original author griebd) 2015-11-19 15:45:41 +01:00
Michele d66b55707d Update it.h.txt (ported from master, re #3036) 2015-11-19 15:38:07 +01:00
Damjan Adamic fd73adc68b Cmake fixes 2015-11-19 00:02:15 +01:00
Bertrand Songis b7c09d703c [Horus] UI continued 2015-11-18 22:07:48 +01:00
Bertrand Songis 22a24d67c9 Cosmetics 2015-11-17 22:52:57 +01:00
Bertrand Songis 821cdff3e6 [Horus] Telemetry menu review 2015-11-17 22:51:36 +01:00
Bertrand Songis e979768445 [Horus] Menu calibration review 2015-11-17 22:51:36 +01:00
Bertrand Songis f238e4d737 Merge pull request #3081 from indavis/next
Update flasheepromdialog.ui, Fixed backupBeforeWrite toolTip.
2015-11-17 19:53:18 +01:00
indavis e3825ed542 Update flasheepromdialog.ui
Updating the backupBeforeWrite toolTip. It was incorrectly set to the checkFirmwareCompatibility text.
2015-11-17 02:15:32 -06:00
Damjan Adamic 788035b0e3 Lua documentation update 2015-11-16 22:46:07 +01:00
Damjan Adamic d1e9bf8e98 Lua documentation update 2015-11-16 19:52:59 +01:00
Bertrand Songis 86b5e36925 Merge pull request #3076 from opentx/Horus
Horus
2015-11-16 18:14:46 +01:00
Bertrand Songis 072204756c Indentation problem 2015-11-16 18:13:21 +01:00
Bertrand Songis e76478f27a [Horus] Merge of Telemetry menu 2015-11-16 18:08:58 +01:00
Damjan Adamic db4ac954ba Better makefile recipe for lua_exports.inc target 2015-11-16 10:22:12 +01:00
Damjan Adamic 6f230c4fc7 Fixed lua_exports.inc target 2015-11-16 07:20:08 +01:00
Bertrand Songis de733579d5 Merge remote-tracking branch 'origin/next' into Horus
# Conflicts:
#	companion/src/CMakeLists.txt
#	companion/src/firmwares/opentx/opentxinterface.cpp
#	companion/src/firmwares/opentx/simulator/CMakeLists.txt
#	companion/src/firmwares/opentx/stamp-opentx.h.in
#	radio/src/Makefile
#	radio/src/cli.cpp
#	radio/src/gui/Taranis/helpers.cpp
#	radio/src/gui/Taranis/lcd.cpp
#	radio/src/gui/Taranis/menu_model_setup.cpp
#	radio/src/gui/Taranis/view_main.cpp
#	radio/src/lua_api.cpp
#	radio/src/main_avr.cpp
#	radio/src/myeeprom.h
#	radio/src/opentx.cpp
#	radio/src/pulses/pxx_arm.cpp
#	radio/src/storage/eeprom_conversions.cpp
#	radio/src/targets/Horus/adc_driver.cpp
#	radio/src/targets/Horus/board_horus.cpp
#	radio/src/targets/Horus/board_horus.h
#	radio/src/targets/Horus/diskio.cpp
#	radio/src/targets/Horus/hal.h
#	radio/src/targets/Horus/haptic_driver.cpp
#	radio/src/targets/Horus/i2c_driver.cpp
#	radio/src/targets/Horus/keys_driver.cpp
#	radio/src/targets/Horus/lcd_driver.cpp
#	radio/src/targets/Horus/led_driver.cpp
#	radio/src/targets/Horus/pulses_driver.cpp
#	radio/src/targets/Horus/pwr_driver.c
#	radio/src/targets/Horus/sdio_sd.c
#	radio/src/targets/Horus/sdio_sd.h
#	radio/src/targets/Horus/serial2_driver.cpp
#	radio/src/targets/Horus/telemetry_driver.cpp
#	radio/src/targets/Horus/usb_conf.h
#	radio/src/targets/Horus/usbd_desc.c
#	radio/src/targets/Horus/usbd_storage_msd.cpp
2015-11-15 23:08:34 +01:00
Bertrand Songis d3915a78fd Fixes #2902 2015-11-15 20:02:20 +01:00
Bertrand Songis f8f5dde24e Horus drivers fixes 2015-11-15 20:02:20 +01:00
Bertrand Songis e76cebbc66 Horus drivers 2015-11-15 20:02:20 +01:00
Bertrand Songis 8ba13e5685 EEPROM v217->v218 conversions (on board + Companion) 2015-11-15 20:02:20 +01:00
Bertrand Songis 116dcf93e0 Fixes #2902 2015-11-15 20:02:20 +01:00
Bertrand Songis 18e128ef55 EEPROM structure changes to allow more switches (9bits instead of 8bits) 2015-11-15 20:02:20 +01:00
Bertrand Songis 11fe3d41f8 Version moved to 2.2.0 2015-11-15 20:02:20 +01:00
Bertrand Songis d0d7135db4 Merge pull request #3068 from opentx/projectkk2glider/lua_split_files
Projectkk2glider/lua split files
2015-11-15 19:44:48 +01:00
Bertrand Songis 1ce0b71c5c Merge pull request #3073 from opentx/projectkk2glider/issue_3071
Fixes #3071: wrong telemetry unit and precision was used for V2 in lo…
2015-11-15 19:41:45 +01:00
Damjan Adamic 109faf8989 Fixes #3071: wrong telemetry unit and precision was used for V2 in logical switches (radios with ARM CPU other than Taranis) 2015-11-15 17:58:10 +01:00
Damjan Adamic 754b875d81 Re #3054: Lua byte-code of every loaded script is dumped to a file if LUA_COMPILER=YES is defined (only for simu target. Original code author (dsbeach) 2015-11-15 16:32:12 +01:00
Damjan Adamic 2572ed0eba Removed unnecessary FILINFO 2015-11-15 16:20:32 +01:00
Bertrand Songis 404a1934c5 [Horus] GVARS Menu 2015-11-15 14:18:43 +01:00
Damjan Adamic feac6d000f Companion build fixed (stamp duplication removed) 2015-11-15 13:19:26 +01:00
Bertrand Songis 77ebe3caec Wrong address for updates 2015-11-15 12:54:29 +01:00
Bertrand Songis e71b53964b [Horus] For the moment no better solution for Windows :( 2015-11-15 12:52:36 +01:00
Damjan Adamic 4a60c8aa6e Lua exports moved to lua dir 2015-11-15 12:12:24 +01:00
Damjan Adamic d54f25ccba Lua api and interface lua_api.cpp moved to lua dir and split into several files 2015-11-15 12:05:53 +01:00
Bertrand Songis 2f03e2c4ad Update DONATIONS.txt 2015-11-15 10:03:54 +01:00
Damjan Adamic c92d88b664 Lua documentation update 2015-11-15 09:50:53 +01:00
Bertrand Songis 11cff7a63b [Horus] Mouse middle button used for [Enter] 2015-11-15 00:28:22 +01:00
Bertrand Songis 07ca8319ad [Horus] Simulator buttons modelized 2015-11-14 21:15:28 +01:00
Bertrand Songis 2f54e85421 VERSION_FAMILY dynamic string introduced 2015-11-14 19:17:34 +01:00
Bertrand Songis b666892da4 Merge pull request #3065 from opentx/projectkk2glider/autogen_lua_docs_2
Projectkk2glider/autogen lua docs 2
2015-11-14 18:47:18 +01:00
Bertrand Songis edf1dbc0b7 Windows compilation fix 2015-11-14 18:24:51 +01:00
Bertrand Songis 7f991ea7f9 Next compilation fixes 2015-11-14 18:02:54 +01:00
Bertrand Songis f0753fe51c Next compilation fixes 2015-11-14 17:55:08 +01:00
Bertrand Songis 7f4abd7c83 [Horus] Windows compilation errors 2015-11-14 17:50:52 +01:00
Bertrand Songis 52809b51b9 Update DONATIONS.txt 2015-11-14 17:20:11 +01:00
Bertrand Songis ed2f66aedd [Horus] UI continued 2015-11-14 17:19:20 +01:00
Damjan Adamic 1a399a649d Typos 2015-11-13 20:00:46 +01:00
Damjan Adamic 0f246d2f39 More docs 2015-11-13 19:48:32 +01:00
Damjan Adamic e5ef862729 Docs added 2015-11-13 18:50:43 +01:00
Damjan Adamic e6546af9b1 Fixes #2947: luaGetVersion() upgraded to also return the radio type.
Start of Lua API documentation that can be parsed with a custom script that generates gitbook documentation
2015-11-13 18:50:43 +01:00
Andre Bernet feb98816ec Hide switch field for FM0 2015-11-13 19:37:27 +04:00
Andre Bernet 71411fcb62 LR12 protocol actually doesn't support remote failsafe configuration 2015-11-13 19:26:34 +04:00
Damjan Adamic d5824f5719 Re #3043: Air speed unit typo corrected in parser 2015-11-13 00:19:08 +01:00
Bertrand Songis f32231cab2 [Horus] Small optimization 2015-11-12 22:22:31 +01:00
Bertrand Songis f875aec72b Update DONATIONS.txt 2015-11-12 19:29:25 +01:00
Bertrand Songis 1b7e62a1f0 Merge pull request #3060 from opentx/projectkk2glider/issue_3059_speed_conversions
Fixes #3059: added unit conversions from km/h
2015-11-12 18:53:02 +01:00
Damjan Adamic ef5746de11 Re #3043: added Air speed parser 2015-11-12 18:47:32 +01:00
Damjan Adamic 454a664d01 Re #3059: table lookup used for unit conversion, saved some 50 bytes of FLASH 2015-11-12 14:53:00 +01:00
Damjan Adamic 58edcc3af8 Fixes #3059: added unit conversions from km/h 2015-11-12 13:55:24 +01:00
Bertrand Songis 09846ca917 Update DONATIONS.txt 2015-11-11 21:43:12 +01:00
Bertrand Songis 2b2f34af29 Release note for 2.1.6 updated 2015-11-11 10:42:20 +01:00
Bertrand Songis a06d405a2c Update DONATIONS.txt 2015-11-11 10:26:55 +01:00
Bertrand Songis 429490eb86 Switch to 2.1.6 2015-11-11 10:24:58 +01:00
Bertrand Songis c73a8bac25 [Taranis X9E] Problem of impossible shutdown on some radios 2015-11-11 10:23:53 +01:00
Bertrand Songis 86f1363d0a [Horus] Compilation fix 2015-11-11 10:12:09 +01:00
Bertrand Songis c4d7feaa9b [Horus] Simulator graphics 2015-11-11 10:02:12 +01:00
Bertrand Songis 312c370162 [Horus] DMA2D more used. Some graphics are really faster. 2015-11-10 21:57:41 +01:00
Bertrand Songis a9603cbdb7 [Horus] More timings 2015-11-10 21:57:41 +01:00
Damjan Adamic f854442c79 Fixes #3047:
* negative altitude on top bar was displayed wrong (same bug affected vertical speed)
* add ability to select an altitude sensor with ft unit for top bar
* display actual sensor unit for top bar altitude
2015-11-10 18:01:42 +01:00
mhotar 922141fcf7 simulator slices 2015-11-09 23:29:49 +01:00
Bertrand Songis 34fef4fefe [Horus] Some LCD timings added in comments 2015-11-09 20:02:08 +01:00
Bertrand Songis d74092d6eb Compilation failure 2015-11-08 20:56:37 +01:00
Bertrand Songis 5445e506a6 Simulator bitmaps moved to different directories 2015-11-08 20:56:23 +01:00
Andre Bernet a1d44d4d9f Telemetry custom screen changes didn't emit modified signal (Fix #3029) 2015-11-07 21:14:48 +01:00
Andre Bernet cc2fcce559 Hide D8/LR12 in companion when eu firmware option is selected 2015-11-07 08:35:47 +01:00
Bertrand Songis 3a740907bb Analog_values renamed to adcValues 2015-11-06 18:46:37 +01:00
Bertrand Songis b1f5ea115c [Horus] ADC driver by Mike
+ new CLI command repeat <interval> <other command>
2015-11-06 18:40:35 +01:00
Bertrand Songis bca18f5938 Compilation fix 2015-11-03 21:36:22 +01:00
Bertrand Songis 62e6e30481 [Horus] Massstorage working now
Still a problem on Windows which doesn't want to format the SD card.
Also it seems I am not able to rename the card. It reminds me some issue
we already had on Taranis.
2015-11-03 21:02:28 +01:00
Bertrand Songis a556c50956 [Horus] Next round of screen changes + refactoring 2015-11-03 19:53:55 +01:00
Bertrand Songis 8f4c161dc0 [Horus] Massstorage (still not working) 2015-11-03 18:45:59 +01:00
martin a2c50ce2f8 font extra 15x17 2015-10-30 00:17:52 +01:00
Bertrand Songis 03fabd95ac [Horus] Model Selection menu started 2015-10-26 19:15:54 +01:00
Bertrand Songis 7e5374f31d Should fix Travis builds 2015-10-26 18:16:44 +01:00
Damjan Adamic 4605f9d61d Companion settings moved to 2.2 directory 2015-10-25 20:09:44 +01:00
Bertrand Songis fcb845a6b2 [Horus] Warning started. No transparency for now 2015-10-25 18:02:46 +01:00
Bertrand Songis 0e34c24d96 For Travis ... 2015-10-25 14:37:28 +01:00
martin 543123a169 asterisk 2015-10-25 02:55:11 +02:00
martin b96f882866 asterisk 2015-10-25 02:18:55 +02:00
martin f0039129e9 library icons 2015-10-25 00:04:44 +02:00
Bertrand Songis 9cd0cbf417 Test for the Travis server ... 2015-10-24 20:17:41 +02:00
Bertrand Songis 0673663427 [Horus] Simulator refactoring. This one should be nice :) 2015-10-24 19:47:44 +02:00
Bertrand Songis 6f774eb61a [Horus] Companion simulator 2015-10-24 16:08:29 +02:00
Bertrand Songis ab0272c16c [Horus] Refactoring continued 2015-10-24 11:27:34 +02:00
Bertrand Songis fb371cf5b7 [Horus] Continued ... 2015-10-22 20:18:55 +02:00
Bertrand Songis e18e6f9c41 [Horus] Refactoring continued 2015-10-22 20:04:54 +02:00
Bertrand Songis c8f77fceec [Horus] SD Storage started. UI continued.
+ Some boyscout work on LCD functions
2015-10-22 07:10:19 +02:00
mhotar d353f3c388 round scale image 2015-10-20 20:14:10 +02:00
mhotar cad1cc4432 timer graprics 2015-10-19 20:26:12 +02:00
Bertrand Songis 8a3de9184b [Horus] Main view continued 2015-10-17 11:12:35 +02:00
Bertrand Songis 4f5ce6b0f0 [Horus] Main view added 2015-10-16 23:09:26 +02:00
Bertrand Songis 719ecc8473 [Horus] A lot of GUI fixes 2015-10-16 17:26:42 +02:00
martin 76b5143dd4 some more Horus graprics 2015-10-15 22:21:01 +02:00
Bertrand Songis b458b79bed [Horus] make clean also cleans the font bitmap files 2015-10-14 23:47:52 +02:00
martin b3979d9fff reduced index size and icon spacing to fit all 12 icons 2015-10-14 23:47:52 +02:00
Bertrand Songis 8c337b721b [Horus] Now a fake main view 2015-10-14 23:47:52 +02:00
Bertrand Songis 7982c9d5c7 [Horus] Radio icons now displayed 2015-10-14 23:47:52 +02:00
Bertrand Songis 06c0ccf86a [Horus] Radio icons added 2015-10-14 23:47:52 +02:00
Bertrand Songis 8dc402d119 [Horus] Bitmaps definitions moved to a new file 2015-10-14 23:47:52 +02:00
Bertrand Songis 8c0f69746f Code simplification 2015-10-14 23:47:52 +02:00
martin 8f5b844e23 index cosmetics 2015-10-14 23:47:51 +02:00
Bertrand Songis df698e9ff2 Cosmetics 2015-10-14 23:47:51 +02:00
martin 907336722d index masks 2015-10-14 23:47:51 +02:00
Bertrand Songis e0fa546b10 Quick and dirty - I will rewrite this commit later 2015-10-14 23:47:51 +02:00
Bertrand Songis ddaf6237b9 Makefile fixes 2015-10-14 23:47:51 +02:00
Bertrand Songis ce2f7b61e9 New Horus masks added 2015-10-14 23:47:51 +02:00
Bertrand Songis e25115b104 Compilation fixes 2015-10-14 23:47:51 +02:00
Bertrand Songis c92909f7c5 A little bit code cleaning... 2015-10-14 23:47:51 +02:00
Bertrand Songis 2902ae1887 Horus simulator should now be OK 2015-10-14 23:47:51 +02:00
Bertrand Songis 34be811622 Horus drivers updated 2015-10-14 23:47:51 +02:00
Bertrand Songis aeed0e34a9 Horus bitmaps 2015-10-14 23:47:51 +02:00
Bertrand Songis c2dade2133 Horus fonts / bitmaps tools updated 2015-10-14 23:47:51 +02:00
Bertrand Songis 3d74f2b437 Horus drivers fixes 2015-10-14 23:47:27 +02:00
Bertrand Songis 78bcc4d582 Horus drivers 2015-10-14 23:47:26 +02:00
Bertrand Songis 1df45cbfc2 EEPROM v217->v218 conversions (on board + Companion) 2015-10-14 23:47:26 +02:00
Bertrand Songis 0bf2a204e2 Fixes #2902 2015-10-14 23:47:26 +02:00
Bertrand Songis d0f6c59b8a EEPROM structure changes to allow more switches (9bits instead of 8bits) 2015-10-14 23:47:26 +02:00
Bertrand Songis 3083269f30 Version moved to 2.2.0 2015-10-14 23:47:26 +02:00
1006 changed files with 111834 additions and 37750 deletions
+4
View File
@@ -1,3 +1,4 @@
/.idea/
/.*project
/.settings
/.autotools
@@ -6,3 +7,6 @@ radio/src/bootloader/bootloader_ramBoot*
*.lbm
*.o
/doc/
*.stamp
radio/src/lua/lua_fields_*.txt
radio/src/lua/lua_exports_*.txt
+13 -7
View File
@@ -1,14 +1,20 @@
language: cpp
before_install:
- sudo apt-get remove cmake cmake-data --yes
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo apt-get update
- sudo apt-get remove cmake cmake-data --yes
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
- sudo add-apt-repository ppa:beineri/opt-qt551 --yes
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-get update -qq
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
install:
- sudo apt-get install -y lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
- export CXX="g++-5" CC="gcc-5"
script:
- radio/util/commit-tests.sh
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
- ./radio/util/commit-tests.sh .
+40
View File
@@ -0,0 +1,40 @@
project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "2")
set(VERSION_REVISION "0")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
message(STATUS "OpenTX ${VERSION}")
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0023 OLD)
set(CMAKE_CXX_STANDARD 11)
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Qt5Widgets)
find_package(Qt5Xml)
find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport)
find_package(Qt5Multimedia)
include(Macros)
today(DATE)
now(TIME)
git_id(GIT_STR)
add_subdirectory(${RADIO_SRC_DIRECTORY})
if(Qt5Widgets_FOUND)
add_subdirectory(${COMPANION_SRC_DIRECTORY})
endif()
+6 -1
View File
@@ -837,7 +837,7 @@ Dietmar Drees
Bruce Jones
Adil Busaidy
Herman Hofman
Jean Paul Michel (monthly)
Jean Paul Michel
Peter McHenry
Julien lecoquierre
Jean-Marie Clay
@@ -845,3 +845,8 @@ Robert Nicoll
Dan Nixon
Ewald Moehring
Giovanni Carnesecchi
Paul Dumsday
Tadeusz Adamowski
Andrew Newton
Neil Horne
Kerstin Appelqvist
+3 -3
View File
@@ -1,9 +1,9 @@
##OpenTX 2.1 Branch
##OpenTX 2.2 Branch
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=master)](https://travis-ci.org/opentx/opentx)
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=next)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://gitter.im/opentx/opentx](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Donate using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
The ongoing development on 2.1.x is done in this branch.
The ongoing development on 2.2.x is done in this branch.
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
+22
View File
@@ -0,0 +1,22 @@
macro(add_bitmaps_target targetname filter width format)
file(GLOB bitmaps ${filter})
foreach(bitmap ${bitmaps})
get_filename_component(target ${bitmap} NAME_WE)
set(target ${target}.lbm)
add_custom_command(
OUTPUT ${target}
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
DEPENDS ${bitmap}
)
list(APPEND bitmaps_files ${target})
endforeach()
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
endmacro(add_bitmaps_target)
macro(add_truetype_font_target radio name font size bold)
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
add_custom_target(ttf_${radio}_${name}
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
endmacro(add_truetype_font_target)
@@ -4,25 +4,25 @@
# SDL_FOUND, if false, do not try to link to SDL
# SDL_INCLUDE_DIR, where to find SDL.h
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Modified by Eric Wing.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
@@ -46,14 +46,14 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/opt/csw/include
/opt/csw/include
/opt/include/SDL
/opt/include
C:/Programs/SDL/include
)
# I'm not sure if I should do a special casing for Apple. It is
# I'm not sure if I should do a special casing for Apple. It is
# unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?),
# But if they do ([Next|Open|GNU]Step?),
# do they want the -framework option also?
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
@@ -83,7 +83,7 @@ IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
FIND_LIBRARY(SDL_LIBRARY_TEMP
FIND_LIBRARY(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -93,13 +93,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib
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
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
PATHS
$ENV{SDLDIR}/lib
@@ -109,13 +109,12 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
/opt/local/lib
/opt/csw/lib
/opt/lib
C:/Programs/SDL/lib
)
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
@@ -136,14 +135,14 @@ IF(SDL_LIBRARY_TEMP)
ENDIF(SDLMAIN_LIBRARY)
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there. I think it has something to do
# with the CACHE STRING. Maybe somebody else knows how to fix this.
# The problem is mainly cosmetic, and not a functional issue.
IF(APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if Find the threads package
# and try using this line, so I'm just skipping it entirely for OS X.
@@ -162,4 +161,4 @@ IF(SDL_LIBRARY_TEMP)
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
+39
View File
@@ -0,0 +1,39 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "date not implemented")
set(${RESULT} 00.00.0000)
endif(WIN32)
endmacro(today)
macro(now RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "time not implemented")
set(${RESULT} 00:00:00)
endif(WIN32)
endmacro(now)
macro(git_id RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
else(WIN32)
message(SEND_ERROR "Git ID implemented")
set(${RESULT} 0)
endif(WIN32)
endmacro(git_id)
+8 -1
View File
@@ -1,3 +1,11 @@
<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>
</ul>
<h2>Version 2.1.5 / 2015-11-05</h2>
Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrSky's release of OpenTX 2.1.4
@@ -24,7 +32,6 @@ Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrS
</ul>
<h2>Version 2.1.3 / 2015-09-09</h2>
<ul>
+206 -285
View File
@@ -1,130 +1,81 @@
PROJECT( companion )
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(COMPANION_NAME "companion")
set(SIMULATOR_NAME "simulator")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(C9X_VERSION_MAJOR "2")
SET(C9X_VERSION_MINOR "1")
SET(C9X_VERSION_REVISION "5")
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
if(ALLOW_NIGHTLY_BUILDS)
add_definitions(-DALLOW_NIGHTLY_BUILDS)
endif(ALLOW_NIGHTLY_BUILDS)
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
MESSAGE(STATUS "OpenTX Companion ${C9X_VERSION}")
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)
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
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)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
add_definitions(-DJOYSTICKS)
add_definitions(-DSIMU_AUDIO)
else()
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(C9X_NAME_SUFFIX ${C9X_VERSION_MAJOR}${C9X_VERSION_MINOR})
SET(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
SET(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
SET( SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX} )
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(COMPANION_NAME "companion")
SET(SIMULATOR_NAME "simulator")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "Looking for QT lupdate ")
find_package(Lupdate)
if(LUPDATE_FOUND)
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
else()
message("QT lupdate not found!")
endif()
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)
add_definitions(-DQXT_STATIC)
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)
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /LD")
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
link_directories(C:/Programs/pthreads/Pre-built.2/lib/)
set(PTHREAD_LIBRARY pthreadVC2.lib)
else()
set(PTHREAD_LIBRARY pthread)
add_definitions(-Wall)
link_directories(/usr/local/lib)
endif()
MESSAGE( STATUS "Looking for XercesC " )
FIND_PACKAGE(XercesC)
IF ( XERCESC_FOUND )
INCLUDE_DIRECTORIES( ${XERCESC_INCLUDE_DIR} )
SET(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
ELSE()
MESSAGE( FATAL_ERROR "XercesC not found! Please set XercesC path ..." )
ENDIF()
MESSAGE( STATUS "Looking for Xsd " )
FIND_PACKAGE(Xsd)
IF ( XSD_FOUND )
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
ELSE()
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
ENDIF()
MESSAGE( STATUS "Looking for SDL " )
FIND_PACKAGE(Sdl)
IF ( SDL_FOUND )
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS( -DJOYSTICKS )
ADD_DEFINITIONS( -DSIMU_AUDIO )
ELSE()
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
ENDIF()
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
SET( QT_USE_QTNETWORK True )
SET( QT_USE_QTXML True )
INCLUDE( ${QT_USE_FILE} )
MESSAGE( STATUS "Looking for PHONON " )
FIND_PACKAGE(Phonon)
IF ( PHONON_FOUND )
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
ADD_DEFINITIONS( -DPHONON )
ELSE()
MESSAGE( "PHONON not found!" )
ENDIF()
MESSAGE( STATUS "Looking for QT lupdate " )
FIND_PACKAGE(Lupdate)
if( LUPDATE_FOUND )
MESSAGE( "QT lupdate: " ${LUPDATE_EXECUTABLE} )
ELSE()
MESSAGE( "QT lupdate not found!" )
ENDIF()
ADD_CUSTOM_COMMAND(
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
)
IF( MSVC )
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
LINK_DIRECTORIES( C:/Programs/pthreads/Pre-built.2/lib/ )
SET( PTHREAD_LIBRARY pthreadVC2.lib )
ELSE( )
SET( PTHREAD_LIBRARY pthread )
ADD_DEFINITIONS( -Wall )
LINK_DIRECTORIES( /usr/local/lib )
ENDIF( )
IF( MSVC )
MESSAGE( STATUS "Adding include C:/Programs/dirent/include for dirent.h" )
INCLUDE_DIRECTORIES( C:/programs/dirent/include )
ENDIF( )
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
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)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/../..
${PROJECT_SOURCE_DIR}/shared
${COMPANION_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/shared
${SIMU_SRC_DIRECTORY}
${XSD_INCLUDE_DIR}
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
)
add_subdirectory(shared)
add_subdirectory(modeledit)
add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(firmwares/opentx/simulator)
add_subdirectory(qcustomplot)
add_subdirectory(qxtcommandoptions)
set(common_SRCS
eeprominterface.cpp
@@ -143,11 +94,12 @@ set(common_SRCS
firmwares/opentx/opentxinterface.cpp
file.cpp
appdata.cpp
)
)
qt4_wrap_cpp(common_SRCS)
qt5_wrap_cpp(common_SRCS)
add_library(common ${common_SRCS})
qt5_use_modules(common Core Xml Widgets)
set(companion_SRCS
hexinterface.cpp
@@ -188,7 +140,7 @@ set(companion_SRCS
radionotfound.cpp
wizarddata.cpp
wizarddialog.cpp
)
)
set(companion_MOC_HDRS
apppreferencesdialog.h
@@ -220,7 +172,7 @@ set(companion_MOC_HDRS
wizarddialog.h
modelprinter.h
multimodelprinter.h
)
)
set(companion_UIS
mdichild.ui
@@ -240,80 +192,50 @@ set(companion_UIS
flashfirmwaredialog.ui
flasheepromdialog.ui
radionotfound.ui
)
)
set(companion_RCS
set(companion_RESOURCES
companion.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
)
MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 00.00.0000)
ENDIF (WIN32)
ENDMACRO (TODAY)
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
MACRO (NOW RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "time not implemented")
SET(${RESULT} 00:00:00)
ENDIF (WIN32)
ENDMACRO (NOW)
if(WIN32)
set(companion_SRCS ${companion_SRCS} icon.rc)
if(NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif()
endif()
TODAY(DATE)
NOW(TIME)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
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)
IF( WIN32 )
SET( companion_SRCS ${companion_SRCS} icon.rc )
IF ( NOT MSVC )
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
ENDIF( )
ENDIF( )
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})
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_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 )
if(APPLE)
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
else()
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
endif()
set( companion_SRCS ${companion_SRCS} )
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE( ${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
# OS X compiler no longer automatically includes /Library/Frameworks in search path
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
ELSE( )
ADD_EXECUTABLE( ${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ENDIF( )
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
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 ###############
@@ -321,160 +243,159 @@ set(simu_SRCS
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
)
)
set(simu_MOC_HDRS
modeledit/node.h
)
)
set( simu_SRCS ${simu_SRCS} )
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
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})
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
else()
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
endif()
target_link_libraries(${SIMULATOR_NAME} simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
# 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 ####################
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg )
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
# Linux specific code
SET(OperatingSystem "Linux")
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR} )
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
install(FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
install(FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
# Linux specific code
set(OperatingSystem "Linux")
else()
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
endif()
IF( WIN32 )
IF( MSVC )
SET(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
SET(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
ELSE( )
SET(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
SET(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
ENDIF( )
if(WIN32)
if(MSVC)
set(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
else()
set(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
set(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
endif()
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/simulator.nsi @ONLY)
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)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
find_program(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
"C:/Program Files (x86)/NSIS"
"C:/Programs/NSIS"
)
)
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion-windows.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion.nsi
COMMENT "Companion Windows NSIS Installer")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/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}/simulator-install.exe
COMMAND "${NSIS_EXE}" ARGS simulator.nsi
DEPENDS simulator opentx-simulators ${PROJECT_BINARY_DIR}/simulator.nsi
COMMENT "Simulator Windows NSIS Installer")
add_custom_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-windows.exe
DEPENDS ${PROJECT_BINARY_DIR}/simulator-windows.exe
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
SOURCES ${PROJECT_BINARY_DIR}/simulator.nsi
)
ENDIF( )
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()
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 ${XSD_INCLUDE_DIR}/.. companion.app/Contents/Frameworks/
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${COMPANION_NAME} )
add_custom_target(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( )
add_custom_target(makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks opentx-simulators-bundle)
endif()
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
IF( LUPDATE_FOUND )
ADD_CUSTOM_TARGET( translations
if(LUPDATE_FOUND)
add_custom_target(translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
)
ELSE()
ADD_CUSTOM_TARGET( translations
)
else()
add_custom_target(translations
COMMAND echo "Sorry, QT lupdate was not found."
)
ENDIF()
)
endif()
SET(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
# The file stripping is deliberately disabled, with the stripped file we get
# The file stripping is deliberately disabled, with the stripped file we get
# very poor trace-backs from the users when they report Companion crash
SET( CPACK_STRIP_FILES FALSE )
set(CPACK_STRIP_FILES FALSE)
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
set(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
SET(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
set(CPACK_DEBIAN_PACKAGE_VERSION ${VERSION})
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
else(DPKG_PROGRAM)
SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
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")
endif(DPKG_PROGRAM)
INCLUDE(CPack)
include(CPack)
+36 -2
View File
@@ -312,6 +312,8 @@ 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; }
@@ -342,6 +344,8 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
@@ -378,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
controlTypes ( rhs.controlTypes() );
controlNames ( rhs.controlNames() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
@@ -423,6 +429,8 @@ void Profile::initFwVariables()
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_controlTypes = "";
_controlNames = "";
_txCurrentCalibration = 0;
_gsStickMode = 0;
@@ -483,6 +491,8 @@ void Profile::flush()
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
@@ -595,6 +605,10 @@ void AppData::warningId (const int x) { store(x, _warningId,
// Constructor
AppData::AppData()
{
}
void AppData::init()
{
//Initialize the profiles
for (int i=0; i<MAX_PROFILES; i++)
@@ -604,8 +618,28 @@ AppData::AppData()
for (int i=0; i<MAX_JOYSTICKS; i++)
joystick[i].init( i );
// Copy existing 2.0.16 settings if present
QSettings settings(COMPANY, PRODUCT);
// Copy existing 2.1 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings21("OpenTX", "Companion 2.1");
QStringList keys = settings21.allKeys();
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
{
if (settings21.value(*i) != QString("") && settings21.value(*i) != QString("Start Menu Folder"))
{
settings.setValue(*i, settings21.value(*i));
}
}
//Reload profiles
for (int i=0; i<MAX_PROFILES; i++)
profile[i].init( i );
}
// Copy existing 2.0 settings if present
if (profile[0].name().isEmpty())
{
QSettings settings20("OpenTX", "Companion 2.0");
@@ -737,7 +771,7 @@ AppData::AppData()
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
getset( _enableBackup, "backupEnable" ,false );
getset( _enableBackup, "enableBackup" ,false );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
+8 -1
View File
@@ -25,7 +25,7 @@
#include <QSettings>
#define COMPANY "OpenTX"
#define PRODUCT "Companion 2.1"
#define PRODUCT "Companion 2.2"
#define MAX_PROFILES 15
#define MAX_JOYSTICKS 8
@@ -125,6 +125,8 @@ class Profile: protected CompStoreObj
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
QString _controlTypes;
QString _controlNames;
int _txCurrentCalibration;
int _gsStickMode;
int _ppmMultiplier;
@@ -156,6 +158,8 @@ class Profile: protected CompStoreObj
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
QString controlTypes() const;
QString controlNames() const;
int txCurrentCalibration() const;
int gsStickMode() const;
int ppmMultiplier() const;
@@ -186,6 +190,8 @@ class Profile: protected CompStoreObj
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void controlTypes (const QString);
void controlNames (const QString);
void txCurrentCalibration (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
@@ -378,6 +384,7 @@ class AppData: protected CompStoreObj
// Constructor
AppData();
void init();
};
extern AppData g;
+1 -6
View File
@@ -109,14 +109,9 @@ void AppPreferencesDialog::initSettings()
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
#if defined(ALLOW_NIGHTLY_BUILDS)
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
#else
ui->useCompanionNightlyBuilds->hide();
ui->useFirmwareNightlyBuilds->hide();
#endif
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
ui->showSplash->setChecked(g.showSplash());
ui->historySize->setValue(g.historySize());
+1 -2
View File
@@ -1,8 +1,7 @@
#ifndef BURNCONFIGDIALOG_H_
#define BURNCONFIGDIALOG_H_
#include <QDialog>
#include <QtGui>
#include <QtWidgets>
#define MEM_TYPE_EEPROM 1
#define MEM_TYPE_FLASH 2
+5 -2
View File
@@ -82,15 +82,18 @@ class MyProxyStyle : public QProxyStyle
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(companion);
QApplication app(argc, argv);
app.setApplicationName("OpenTX Companion");
app.setOrganizationName("OpenTX");
app.setOrganizationDomain("open-tx.org");
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
g.init();
QStringList strl = QApplication::arguments();
if (strl.contains("--version")) {
printf("%s\n", C9X_VERSION);
printf("%s\n", VERSION);
fflush(stdout);
exit(0);
}
@@ -106,7 +109,7 @@ int main(int argc, char *argv[])
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
uint32_t sdlFlags = 0;
+1 -1
View File
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Companion @C9X_VERSION@
Name=Companion @VERSION@
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=@COMPANION_NAME@
+61 -46
View File
@@ -1,43 +1,58 @@
<RCC>
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>images/customize.png</file>
<file>icon.png</file>
<file>../../CREDITS.txt</file>
<file>../../DONATIONS.txt</file>
<file>../releasenotes.txt</file>
<file>images/9xdb.png</file>
<file>images/9xdl.png</file>
<file>images/9xdr.png</file>
<file>images/9xdt.png</file>
<file>images/9xdb-bl.png</file>
<file>images/9xdl-bl.png</file>
<file>images/9xdr-bl.png</file>
<file>images/9xdt-bl.png</file>
<file>images/9xdb-gr.png</file>
<file>images/9xdl-gr.png</file>
<file>images/9xdr-gr.png</file>
<file>images/9xdt-gr.png</file>
<file>images/9xdb-or.png</file>
<file>images/9xdl-or.png</file>
<file>images/9xdr-or.png</file>
<file>images/9xdt-or.png</file>
<file>images/9xdb-yl.png</file>
<file>images/9xdl-yl.png</file>
<file>images/9xdr-yl.png</file>
<file>images/9xdt-yl.png</file>
<file>images/9xdb-rd.png</file>
<file>images/9xdl-rd.png</file>
<file>images/9xdr-rd.png</file>
<file>images/9xdt-rd.png</file>
<file>images/9xmenu.png</file>
<file>images/9xmenumenu.png</file>
<file>images/9xmenuexit.png</file>
<file>images/9xcurs.png</file>
<file>images/9xcursup.png</file>
<file>images/9xcursplus.png</file>
<file>images/9xcursmin.png</file>
<file>images/9xcursdown.png</file>
<file>images/9xcursphoto.png</file>
<file>images/simulator/Horus/middle.png</file>
<file>images/simulator/Horus/left.png</file>
<file>images/simulator/Horus/right.png</file>
<file>images/simulator/Horus/top.png</file>
<file>images/simulator/Horus/bottom.png</file>
<file>images/simulator/Horus/led.png</file>
<file>images/simulator/Horus/border-right.png</file>
<file>images/simulator/Horus/left_btn1.png</file>
<file>images/simulator/Horus/left_btn2.png</file>
<file>images/simulator/Horus/left_scrnsht.png</file>
<file>images/simulator/Horus/right_btnU.png</file>
<file>images/simulator/Horus/right_btnL.png</file>
<file>images/simulator/Horus/right_btnD.png</file>
<file>images/simulator/Horus/right_btnR.png</file>
<file>images/simulator/Horus/right_ent.png</file>
<file>images/simulator/9X/9xdb.png</file>
<file>images/simulator/9X/9xdl.png</file>
<file>images/simulator/9X/9xdr.png</file>
<file>images/simulator/9X/9xdt.png</file>
<file>images/simulator/9X/9xdb-bl.png</file>
<file>images/simulator/9X/9xdl-bl.png</file>
<file>images/simulator/9X/9xdr-bl.png</file>
<file>images/simulator/9X/9xdt-bl.png</file>
<file>images/simulator/9X/9xdb-gr.png</file>
<file>images/simulator/9X/9xdl-gr.png</file>
<file>images/simulator/9X/9xdr-gr.png</file>
<file>images/simulator/9X/9xdt-gr.png</file>
<file>images/simulator/9X/9xdb-or.png</file>
<file>images/simulator/9X/9xdl-or.png</file>
<file>images/simulator/9X/9xdr-or.png</file>
<file>images/simulator/9X/9xdt-or.png</file>
<file>images/simulator/9X/9xdb-yl.png</file>
<file>images/simulator/9X/9xdl-yl.png</file>
<file>images/simulator/9X/9xdr-yl.png</file>
<file>images/simulator/9X/9xdt-yl.png</file>
<file>images/simulator/9X/9xdb-rd.png</file>
<file>images/simulator/9X/9xdl-rd.png</file>
<file>images/simulator/9X/9xdr-rd.png</file>
<file>images/simulator/9X/9xdt-rd.png</file>
<file>images/simulator/9X/9xmenu.png</file>
<file>images/simulator/9X/9xmenumenu.png</file>
<file>images/simulator/9X/9xmenuexit.png</file>
<file>images/simulator/9X/9xcurs.png</file>
<file>images/simulator/9X/9xcursup.png</file>
<file>images/simulator/9X/9xcursplus.png</file>
<file>images/simulator/9X/9xcursmin.png</file>
<file>images/simulator/9X/9xcursdown.png</file>
<file>images/simulator/9X/9xcursphoto.png</file>
<file>images/screenshot.png</file>
<file>images/splash-9x.png</file>
<file>images/splash-9xrpro.png</file>
@@ -47,18 +62,18 @@
<file>images/maps.png</file>
<file>images/track.png</file>
<file>images/track0.png</file>
<file>images/x9b0.png</file>
<file>images/x9l0.png</file>
<file>images/x9l1.png</file>
<file>images/x9l2.png</file>
<file>images/x9l3.png</file>
<file>images/x9l4.png</file>
<file>images/x9r0.png</file>
<file>images/x9r1.png</file>
<file>images/x9r2.png</file>
<file>images/x9r3.png</file>
<file>images/x9s0.png</file>
<file>images/x9t0.png</file>
<file>images/simulator/Taranis/x9b0.png</file>
<file>images/simulator/Taranis/x9l0.png</file>
<file>images/simulator/Taranis/x9l1.png</file>
<file>images/simulator/Taranis/x9l2.png</file>
<file>images/simulator/Taranis/x9l3.png</file>
<file>images/simulator/Taranis/x9l4.png</file>
<file>images/simulator/Taranis/x9r0.png</file>
<file>images/simulator/Taranis/x9r1.png</file>
<file>images/simulator/Taranis/x9r2.png</file>
<file>images/simulator/Taranis/x9r3.png</file>
<file>images/simulator/Taranis/x9s0.png</file>
<file>images/simulator/Taranis/x9t0.png</file>
<file>images/taranison.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
+1 -2
View File
@@ -1,8 +1,7 @@
#ifndef _COMPAREDIALOG_H
#define _COMPAREDIALOG_H
#include <QDialog>
#include <QLabel>
#include <QtWidgets>
#include "multimodelprinter.h"
namespace Ui {
+4 -2
View File
@@ -11,7 +11,9 @@ enum BoardEnum {
BOARD_AR9X,
BOARD_TARANIS,
BOARD_TARANIS_PLUS,
BOARD_TARANIS_X9E
BOARD_TARANIS_X9E,
BOARD_FLAMENCO,
BOARD_HORUS
};
#define C9X_MAX_MODELS 60
@@ -25,7 +27,7 @@ enum BoardEnum {
#define C9X_MAX_GVARS 9
#define C9X_MAX_ENCODERS 2
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 32 // number of custom switches
#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
+1 -1
View File
@@ -27,7 +27,7 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
if (!errors.test(NO_ERROR)
if (!errors.test(ALL_OK)
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
return false;
}
+1 -2
View File
@@ -1,8 +1,7 @@
#ifndef CUSTOMIZESPLASHDIALOG_H
#define CUSTOMIZESPLASHDIALOG_H
#include <QtGui>
#include <QDialog>
#include <QtWidgets>
#include "firmwareinterface.h"
namespace Ui
-2
View File
@@ -1,7 +1,5 @@
#include "downloaddialog.h"
#include "ui_downloaddialog.h"
#include <QMessageBox>
#include <QtGui>
#include <QTime>
#include "helpers.h"
+1 -2
View File
@@ -1,13 +1,12 @@
#ifndef DOWNLOADDIALOG_H
#define DOWNLOADDIALOG_H
#include <QDialog>
#include <QtWidgets>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QFile>
namespace Ui {
class downloadDialog;
}
+10 -23
View File
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <list>
#include <float.h>
#include <QtWidgets>
#include "eeprominterface.h"
#include "firmwares/er9x/er9xinterface.h"
#include "firmwares/th9x/th9xinterface.h"
@@ -475,13 +476,6 @@ QString RawSource::toString(const ModelData * model) const
QObject::tr("ACC"), QObject::tr("GPS Time"),
};
static const QString logicalSwitches[] = {
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
QObject::tr("L31"), QObject::tr("L32")
};
if (index<0) {
return QObject::tr("----");
}
@@ -508,7 +502,7 @@ QString RawSource::toString(const ModelData * model) const
case SOURCE_TYPE_SWITCH:
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index));
case SOURCE_TYPE_CUSTOM_SWITCH:
return logicalSwitches[index];
return QObject::tr("L%1").arg(index+1);
case SOURCE_TYPE_CYC:
return QObject::tr("CYC%1").arg(index+1);
case SOURCE_TYPE_PPM:
@@ -590,13 +584,6 @@ QString RawSwitch::toString() const
SwitchUp('R'), QString::fromUtf8("SR-"), SwitchDn('R'),
};
static const QString logicalSwitches[] = {
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
QObject::tr("L31"), QObject::tr("L32")
};
static const QString flightModes[] = {
QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8")
};
@@ -634,7 +621,7 @@ QString RawSwitch::toString() const
else
return CHECK_IN_ARRAY(switches9X, index-1);
case SWITCH_TYPE_VIRTUAL:
return CHECK_IN_ARRAY(logicalSwitches, index-1);
return QObject::tr("L%1").arg(index);
case SWITCH_TYPE_MULTIPOS_POT:
return CHECK_IN_ARRAY(multiposPots, index-1);
case SWITCH_TYPE_TRIM:
@@ -1183,9 +1170,9 @@ GeneralSettings::GeneralSettings()
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
if (ok)
imperial=byte8u;
QString chars=t_CountrySet.mid(4,2);
ttsLanguage[0]=chars[0].toAscii();
ttsLanguage[1]=chars[1].toAscii();
QString chars = t_CountrySet.mid(4, 2);
ttsLanguage[0] = chars[0].toLatin1();
ttsLanguage[1] = chars[1].toLatin1();
}
}
}
@@ -1538,7 +1525,7 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
}
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
{
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
@@ -1699,7 +1686,7 @@ unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
if (result.test(NO_ERROR)) {
if (result.test(ALL_OK)) {
return result.to_ulong();
}
else {
@@ -1719,7 +1706,7 @@ unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
if (result.test(NO_ERROR)) {
if (result.test(ALL_OK)) {
return result.to_ulong();
}
else {
@@ -1740,7 +1727,7 @@ unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
if (result.test(NO_ERROR)) {
if (result.test(ALL_OK)) {
return result.to_ulong();
}
else {
+8 -5
View File
@@ -21,7 +21,7 @@
#include <QString>
#include <QStringList>
#include <QList>
#include <QtXml>
#include <QtXml> // This should be removed from here, and remove Xml dependency from all libs which don't need it.
#include <QComboBox>
#include <iostream>
#include <bitset>
@@ -46,7 +46,10 @@ QString getBoardName(BoardEnum board);
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
#define IS_TARANIS_X9E(board) (board==BOARD_TARANIS_X9E)
#define IS_ARM(board) (IS_TARANIS(board) || IS_SKY9X(board))
#define IS_HORUS(board) (board==BOARD_HORUS)
#define IS_FLAMENCO(board) (board==BOARD_FLAMENCO)
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4},
@@ -841,6 +844,7 @@ enum PulsesProtocol {
PULSES_PXX_XJT_D8,
PULSES_PXX_XJT_LR12,
PULSES_PXX_DJT,
PULSES_CROSSFIRE,
PULSES_PROTOCOL_LAST
};
@@ -1076,7 +1080,7 @@ class ModelData {
void setTrimValue(int phaseIdx, int trimIdx, int value);
bool isGVarLinked(int phaseIdx, int gvarIdx);
int getGVarValue(int phaseIdx, int gvarIdx);
int getGVarFieldValue(int phaseIdx, int gvarIdx);
ModelData removeGlobalVars();
@@ -1505,8 +1509,7 @@ void registerOpenTxFirmwares();
void unregisterOpenTxFirmwares();
enum EepromLoadErrors {
NO_ERROR,
ALL_OK,
UNKNOWN_ERROR,
UNSUPPORTED_NEWER_VERSION,
WRONG_SIZE,
+33 -6
View File
@@ -36,7 +36,6 @@ eepromFatHeader(NULL)
#define EEPROM_BLOCK_SIZE (4*1024)
#define EEPROM_MARK 0x84697771 /* thanks ;) */
#define EEPROM_ZONE_SIZE (8*1024)
#define EEPROM_BUFFER_SIZE 256
#define EEPROM_FAT_SIZE 128
#define EEPROM_MAX_ZONES (EEPROM_SIZE / EEPROM_ZONE_SIZE)
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
@@ -237,6 +236,9 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
unsigned int RleFile::EeFsGetFree()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = 0;
unsigned int i;
if (IS_ARM(board))
@@ -256,6 +258,9 @@ unsigned int RleFile::EeFsGetFree()
*/
void RleFile::EeFsFree(unsigned int blk)
{
if (IS_HORUS(board))
return;
unsigned int i = blk;
while (EeFsGetLink(i)) i = EeFsGetLink(i);
if (IS_ARM(board)) {
@@ -273,6 +278,8 @@ void RleFile::EeFsFree(unsigned int blk)
*/
unsigned int RleFile::EeFsAlloc()
{
if (IS_HORUS(board))
return 0;
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
if (IS_ARM(board))
@@ -286,12 +293,18 @@ unsigned int RleFile::EeFsAlloc()
unsigned int RleFile::size(unsigned int id)
{
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
if (IS_HORUS(board))
return 0;
else
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
}
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_SKY9X(board)) {
if (IS_HORUS(board)) {
return 1;
}
else if (IS_SKY9X(board)) {
if (eepromFatHeader) {
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
if (eepromFatHeader->files[i_fileId].exists) {
@@ -325,6 +338,9 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
len -= m_pos;
if (i_len > len) i_len = len;
@@ -345,6 +361,9 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
if (IS_HORUS(board))
return 0;
memset(buf, 0, i_len);
if (IS_SKY9X(board)) {
@@ -417,9 +436,11 @@ unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersi
dst.resize(0);
for( ; 1; ) {
for (int i=0; i<zeroes; i++)
dst.append((char)0);
zeroes = 0;
if (zeroes > 0) {
for (int i = 0; i < zeroes; i++)
dst.append((char) 0);
zeroes = 0;
}
if (len == 0)
return dst.size();
@@ -526,6 +547,9 @@ void RleFile::closeTrunc()
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
create(i_fileId, typ);
bool state0 = true;
uint8_t cnt = 0;
@@ -572,6 +596,9 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
*/
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
return 0;
if (IS_SKY9X(board)) {
openRd(i_fileId);
if (eepromFatHeader) {
@@ -114,7 +114,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -186,7 +186,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -261,7 +261,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
return gd;
}
@@ -271,7 +271,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
return md;
}
@@ -289,7 +289,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
const char * data = ba.data();
memcpy(tgen, data, sizeof(Er9xGeneral));
break;
@@ -326,7 +326,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
const char * data = ba.data();
memcpy(tmod, data, sizeof(Er9xModelData));
break;
@@ -172,8 +172,7 @@ bool Er9xSimulator::timer10ms()
uint8_t * Er9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
return (::uint8_t *)simuLcdBuf;
}
bool Er9xSimulator::lcdChanged(bool & lightEnable)
@@ -54,8 +54,14 @@ class Er9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Er9xInterface * er9xInterface;
@@ -152,7 +152,7 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -230,7 +230,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -305,7 +305,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
{
QDomElement gd = qdoc->createElement("GENERAL_DATA");
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
return gd;
}
@@ -315,7 +315,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
QDomElement md = qdoc->createElement("MODEL_DATA");
md.setAttribute("number", modelNum);
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
return md;
}
@@ -333,7 +333,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
const char * data = ba.data();
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
break;
@@ -373,7 +373,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
while (!n.isNull()) {
if (n.isCDATASection()) {
QString ds = n.toCDATASection().data();
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
const char * data = ba.data();
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
break;
@@ -194,8 +194,7 @@ bool Ersky9xSimulator::timer10ms()
uint8_t * Ersky9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
return (::uint8_t *)simuLcdBuf;
}
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
@@ -54,8 +54,14 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Ersky9xInterface * ersky9xInterface;
@@ -207,7 +207,7 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
+174 -77
View File
@@ -22,12 +22,13 @@
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_LOGICAL_SWITCHES(board, version) (IS_ARM(board) ? (version >= 218 ? 64 : 32) : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : 8)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
#define MAX_SENSORS(board, version) (32)
#define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8)
#define ROTENC_COUNT(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 218) ? 0 : 1) : (IS_2560(board) ? 2 : 0))
#define IS_AFTER_RELEASE_21_MARCH_2013(board, version) (version >= 214 || (!IS_ARM(board) && version >= 213))
#define IS_AFTER_RELEASE_23_MARCH_2013(board, version) (version >= 214 || (board==BOARD_STOCK && version >= 213))
@@ -100,7 +101,7 @@ class SwitchesConversionTable: public ConversionTable {
}
}
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -125,7 +126,7 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -182,7 +183,7 @@ class SwitchesConversionTable: public ConversionTable {
internalCache.push_back(element);
return element.table;
}
static void Cleanup()
static void Cleanup()
{
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
Cache element = *it;
@@ -263,7 +264,7 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
}
}
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
}
}
@@ -369,7 +370,7 @@ class SourcesConversionTable: public ConversionTable {
internalCache.push_back(element);
return element.table;
}
static void Cleanup()
static void Cleanup()
{
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
Cache element = *it;
@@ -383,7 +384,7 @@ std::list<SourcesConversionTable::Cache> SourcesConversionTable::internalCache;
void OpenTxEepromCleanup(void)
{
SourcesConversionTable::Cleanup();
SourcesConversionTable::Cleanup();
SwitchesConversionTable::Cleanup();
}
@@ -391,8 +392,8 @@ template <int N>
class SwitchField: public ConversionField< SignedField<N> > {
public:
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toAscii(),
QObject::tr("Switch ").toAscii()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toAscii()),
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
QObject::tr("Switch ").toLatin1()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toLatin1()),
sw(sw),
_switch(0)
{
@@ -407,14 +408,14 @@ class SwitchField: public ConversionField< SignedField<N> > {
_switch = sw.toValue();
ConversionField< SignedField<N> >::beforeExport();
}
virtual void afterImport()
{
ConversionField< SignedField<N> >::afterImport();
ConversionField< SignedField<N> >::afterImport();
sw = RawSwitch(_switch);
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< SignedField<N> >::internalField.getName()).arg(sw.toString());
}
}
protected:
RawSwitch & sw;
int _switch;
@@ -552,7 +553,7 @@ template <int N>
class SourceField: public ConversionField< UnsignedField<N> > {
public:
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())),
source(source),
_source(0)
@@ -568,13 +569,13 @@ class SourceField: public ConversionField< UnsignedField<N> > {
_source = source.toValue();
ConversionField< UnsignedField<N> >::beforeExport();
}
virtual void afterImport()
{
ConversionField< UnsignedField<N> >::afterImport();
ConversionField< UnsignedField<N> >::afterImport();
source = RawSource(_source);
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< UnsignedField<N> >::internalField.getName()).arg(source.toString());
}
}
protected:
RawSource & source;
@@ -783,7 +784,7 @@ class FlightModeField: public TransformedField {
index(index),
board(board),
version(version),
rotencCount(IS_ARM(board) ? 1 : (IS_2560(board) ? 2 : 0))
rotencCount(ROTENC_COUNT(board, version))
{
if (board == BOARD_STOCK || (board==BOARD_M128 && version>=215)) {
// On stock we use 10bits per trim
@@ -803,13 +804,21 @@ class FlightModeField: public TransformedField {
internalField.Append(new SignedField<16>(trimBase[i]));
}
}
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
if (IS_ARM(board) && version >= 218) {
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
internalField.Append(new SwitchField<9>(phase.swtch, board, version));
internalField.Append(new SpareBitsField<7>());
}
else {
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<10>(phase.name));
else
internalField.Append(new ZCharField<6>(phase.name));
}
if (IS_ARM(board) && version >= 214) {
internalField.Append(new UnsignedField<8>(phase.fadeIn));
internalField.Append(new UnsignedField<8>(phase.fadeOut));
@@ -922,7 +931,25 @@ class MixField: public TransformedField {
version(version),
model(model)
{
if (IS_TARANIS(board) && version >= 217) {
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new SignedField<11>(_weight));
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new SourceField<10>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
internalField.Append(new UnsignedField<2>(mix.mixWarn));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new SignedField<14>(_offset));
internalField.Append(new SwitchField<9>(mix.swtch, board, version));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new CurveReferenceField(mix.curve, board, version));
internalField.Append(new UnsignedField<8>(mix.delayUp));
internalField.Append(new UnsignedField<8>(mix.delayDown));
internalField.Append(new UnsignedField<8>(mix.speedUp));
internalField.Append(new UnsignedField<8>(mix.speedDown));
internalField.Append(new ZCharField<8>(mix.name));
}
else if (IS_TARANIS(board) && version >= 217) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<9>(mix.flightModes));
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
@@ -1190,7 +1217,21 @@ class InputField: public TransformedField {
board(board),
version(version)
{
if (IS_TARANIS(board) && version >= 217) {
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<5>(expo.chn, "Channel"));
internalField.Append(new SwitchField<9>(expo.swtch, board, version));
internalField.Append(new UnsignedField<9>(expo.flightModes));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
}
else if (IS_TARANIS(board) && version >= 217) {
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
@@ -1424,7 +1465,13 @@ class CurvesField: public TransformedField {
maxPoints(IS_ARM(board) ? 512 : 112-8)
{
for (int i=0; i<maxCurves; i++) {
if (IS_TARANIS(board) && version >= 216) {
if (IS_TARANIS(board) && version >= 218) {
internalField.Append(new UnsignedField<1>((unsigned int &)curves[i].type));
internalField.Append(new BoolField<1>(curves[i].smooth));
internalField.Append(new ConversionField< SignedField<6> >(curves[i].count, -5));
internalField.Append(new ZCharField<3>(curves[i].name));
}
else if (IS_TARANIS(board) && version >= 216) {
internalField.Append(new UnsignedField<3>((unsigned int &)curves[i].type));
internalField.Append(new BoolField<1>(curves[i].smooth));
internalField.Append(new SpareBitsField<4>());
@@ -1581,7 +1628,7 @@ class AndSwitchesConversionTable: public ConversionTable {
{
int val=0;
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
if (IS_TARANIS(board)) {
for (int i=1; i<=MAX_SWITCHES_POSITION(board, version); i++) {
int s = switchIndex(i, board, version);
@@ -1595,7 +1642,7 @@ class AndSwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -1606,7 +1653,7 @@ class AndSwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
}
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
@@ -1671,7 +1718,16 @@ class LogicalSwitchField: public TransformedField {
v2(0),
v3(0)
{
if (IS_ARM(board) && version >= 217) {
if (IS_ARM(board) && version >= 218) {
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
internalField.Append(new SignedField<10>(v1));
internalField.Append(new SignedField<10>(v3));
internalField.Append(new ConversionField< SignedField<9> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
internalField.Append(new SpareBitsField<1>()); // TODO extra switch mode
internalField.Append(new SpareBitsField<2>());
internalField.Append(new SignedField<16>(v2));
}
else if (IS_ARM(board) && version >= 217) {
internalField.Append(new ConversionField< UnsignedField<6> >(csw.func, &functionsConversionTable, "Function"));
internalField.Append(new SignedField<10>(v1));
internalField.Append(new SignedField<16>(v2));
@@ -1706,7 +1762,7 @@ class LogicalSwitchField: public TransformedField {
int scale = (version >= 216 ? 0 : 5);
internalField.Append(new ConversionField< UnsignedField<8> >(csw.delay, 0, scale));
internalField.Append(new ConversionField< UnsignedField<8> >(csw.duration, 0, scale));
if (version >= 214) {
if (version >= 214 && version <= 217) {
internalField.Append(new ConversionField< SignedField<8> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
}
}
@@ -1717,7 +1773,7 @@ class LogicalSwitchField: public TransformedField {
}
}
~LogicalSwitchField()
~LogicalSwitchField()
{
delete andswitchesConversionTable;
}
@@ -2029,8 +2085,14 @@ class ArmCustomFunctionField: public TransformedField {
{
memset(_param, 0, sizeof(_param));
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
if (version >= 218) {
internalField.Append(new SwitchField<9>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<7> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
}
else {
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
}
if (IS_TARANIS(board) && version >= 216)
internalField.Append(new CharField<8>(_param, false));
@@ -2057,7 +2119,7 @@ class ArmCustomFunctionField: public TransformedField {
if (fn.swtch.type != SWITCH_TYPE_NONE) {
_func = fn.func;
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
_active = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5));
else
_active = (fn.enabled ? 1 : 0);
@@ -2153,7 +2215,7 @@ class ArmCustomFunctionField: public TransformedField {
{
fn.func = (AssignFunc)_func;
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
fn.repeatParam = (version >= 216 ? _active : (_active*5));
else
fn.enabled = (_active & 0x01);
@@ -2170,7 +2232,7 @@ class ArmCustomFunctionField: public TransformedField {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
fn.param = (int16_t)(uint16_t)value;
}
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
fn.func = AssignFunc(fn.func + index);
@@ -2473,7 +2535,7 @@ class FrskyScreenField: public DataField {
else
numbers.Append(new SpareBitsField<4*8>());
}
if (IS_TARANIS(board) && version >= 217) {
script.Append(new CharField<8>(screen.body.script.filename));
script.Append(new SpareBitsField<16*8>());
@@ -2822,7 +2884,7 @@ class SensorField: public TransformedField {
_instance = sensor.formula;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
_param = (sensor.source) + (sensor.index << 8);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
_param = (sensor.gps) + (sensor.alt << 8);
@@ -2844,7 +2906,7 @@ class SensorField: public TransformedField {
sensor.formula = _instance;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
(sensor.source = _sources[0], sensor.index = _sources[1]);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
for (int i=0; i<4; ++i)
sensor.sources[i] = _sources[i];
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
@@ -2905,8 +2967,21 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
for (int i=0; i<MAX_TIMERS(board, version); i++) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
if (IS_ARM(board) && version >= 217) {
if (IS_ARM(board) && version >= 218) {
internalField.Append(new SwitchField<9>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<23>(modelData.timers[i].val));
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<3>());
if (IS_TARANIS(board))
internalField.Append(new ZCharField<8>(modelData.timers[i].name));
else
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
}
else if (IS_ARM(board) && version >= 217) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<24>(modelData.timers[i].val));
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
@@ -2919,6 +2994,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
}
else if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
@@ -2927,6 +3003,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
else if (afterrelease21March2013) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<12>(modelData.timers[i].val));
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
@@ -2940,6 +3017,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
}
else {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
@@ -2999,7 +3077,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
for (int i=0; i<MAX_EXPOS(board, version); i++)
internalField.Append(new InputField(modelData.expoData[i], board, version));
internalField.Append(new CurvesField(modelData.curves, board, version));
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++)
internalField.Append(new LogicalSwitchField(modelData.logicalSw[i], board, version, variant, &modelData));
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
if (IS_ARM(board))
@@ -3008,8 +3086,9 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new AvrCustomFunctionField(modelData.customFn[i], board, version, variant));
}
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++) {
internalField.Append(new FlightModeField(modelData.flightModeData[i], i, board, version));
}
if (!IS_ARM(board) || version < 216) {
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
@@ -3120,7 +3199,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
}
if (IS_TARANIS(board)) {
if (IS_TARANIS(board) && version < 218) {
for (int i=0; i<MAX_CURVES(board, version); i++) {
internalField.Append(new ZCharField<6>(modelData.curves[i].name));
}
@@ -3148,13 +3227,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
}
}
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++) {
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
}
}
if (IS_ARM(board) && version >= 217) {
for (int i=0; i<8; i++) {
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
@@ -3176,7 +3255,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board) && version >= 216) {
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
}
}
}
if (IS_ARM(board) && version == 216) {
@@ -3296,8 +3375,9 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
internalField.Append(new SignedField<8>(generalData.backlightMode));
for (int i=0; i<NUM_STICKS; i++)
for (int i=0; i<NUM_STICKS; i++) {
internalField.Append(new SignedField<16>(generalData.trainer.calib[i]));
}
for (int i=0; i<NUM_STICKS; i++) {
internalField.Append(new UnsignedField<6>(generalData.trainer.mix[i].src));
internalField.Append(new UnsignedField<2>(generalData.trainer.mix[i].mode));
@@ -3306,7 +3386,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<8>(generalData.view, 0, MAX_VIEWS(board)-1));
internalField.Append(new SpareBitsField<2>());
internalField.Append(new SpareBitsField<2>()); // TODO buzzerMode?
internalField.Append(new BoolField<1>(generalData.fai));
internalField.Append(new SignedField<2>((int &)generalData.beeperMode));
internalField.Append(new BoolField<1>(generalData.flashBeep));
@@ -3323,13 +3403,18 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
}
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
if (IS_9X(board) && version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
if (IS_9X(board)) {
if (version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
}
else {
internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
}
else {
internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
internalField.Append(new SpareBitsField<3>());
}
if (version >= 216 && IS_TARANIS(board))
internalField.Append(new SignedField<3>(generalData.splashDuration));
@@ -3342,20 +3427,19 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (IS_ARM(board))
internalField.Append(new SignedField<8>(generalData.switchesDelay));
else
internalField.Append(new SpareBitsField<8>());
internalField.Append(new SpareBitsField<8>()); // TODO blOffBright + blOnBright
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
internalField.Append(new SignedField<8>(generalData.hapticLength));
if (version < 216 || !IS_9X(board)) {
if (version < 216 || (version < 218 && !IS_9X(board)) || (!IS_9X(board) && !IS_TARANIS(board))) {
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
}
if (version >= 216 && !IS_TARANIS(board)) {
internalField.Append(new UnsignedField<4>(generalData.stickReverse));
internalField.Append(new SpareBitsField<4>());
internalField.Append(new UnsignedField<8>(generalData.stickReverse));
}
internalField.Append(new SignedField<3>(generalData.beeperLength));
@@ -3377,33 +3461,46 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
if (version < 218) internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
if (version < 218) internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
if (version < 218) internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
}
if (version >= 214) {
internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
internalField.Append(new UnsignedField<8>(generalData.countryCode));
internalField.Append(new UnsignedField<8>(generalData.imperial));
}
if (version >= 215) {
internalField.Append(new CharField<2>(generalData.ttsLanguage));
internalField.Append(new SignedField<8>(generalData.beepVolume));
internalField.Append(new SignedField<8>(generalData.wavVolume));
internalField.Append(new SignedField<8>(generalData.varioVolume));
if (version < 218) {
internalField.Append(new SignedField<8>(generalData.beepVolume));
internalField.Append(new SignedField<8>(generalData.wavVolume));
internalField.Append(new SignedField<8>(generalData.varioVolume));
}
else {
internalField.Append(new SignedField<4>(generalData.beepVolume));
internalField.Append(new SignedField<4>(generalData.wavVolume));
internalField.Append(new SignedField<4>(generalData.varioVolume));
internalField.Append(new SignedField<4>(generalData.backgroundVolume));
}
if (version >= 216) {
internalField.Append(new SignedField<8>(generalData.varioPitch));
internalField.Append(new SignedField<8>(generalData.varioRange));
internalField.Append(new SignedField<8>(generalData.varioRepeat));
}
internalField.Append(new SignedField<8>(generalData.backgroundVolume));
if (version < 218) internalField.Append(new SignedField<8>(generalData.backgroundVolume));
}
if (version >= 218) {
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
}
}
if (IS_TARANIS(board) && version >= 216) {
if (version >= 217) {
@@ -3429,11 +3526,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
}
if (IS_TARANIS_X9E(board))
internalField.Append(new SpareBitsField<64>());
internalField.Append(new SpareBitsField<64>()); // switchUnlockStates
else if (IS_TARANIS(board))
internalField.Append(new SpareBitsField<16>());
if (version >= 217) {
internalField.Append(new SpareBitsField<16>()); // switchUnlockStates
if (version == 217) {
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
}
@@ -81,6 +81,9 @@ class ProtocolsConversionTable: public ConversionTable
addConversion(PULSES_DSM2, val++);
addConversion(PULSES_DSMX, val++);
}
if (IS_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
}
}
};
@@ -23,8 +23,8 @@
#include "file.h"
#include "appdata.h"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/nightly/firmware"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/firmware"
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/nightly/firmware"
#define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2
@@ -75,6 +75,10 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for 9XR-PRO";
case BOARD_AR9X:
return "OpenTX for ar9x board / 9X";
case BOARD_FLAMENCO:
return "OpenTX for Flamenco experimental";
case BOARD_HORUS:
return "OpenTX for FrSky Horus";
default:
return "OpenTX for an unknown board";
}
@@ -98,6 +102,8 @@ const int OpenTxEepromInterface::getEEpromSize()
case BOARD_TARANIS:
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
case BOARD_FLAMENCO:
case BOARD_HORUS:
return EESIZE_TARANIS;
default:
return 0;
@@ -387,7 +393,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
}
}
std::cout << " ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -403,7 +409,9 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
version = 217;
case BOARD_FLAMENCO:
case BOARD_HORUS:
version = 218;
break;
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
@@ -636,7 +644,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
return id.contains("nooverridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 32;
return 64;
else
return 12;
case CustomAndSwitches:
@@ -824,9 +832,10 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
switch (proto) {
case PULSES_OFF:
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
return 1;
case PULSES_PXX_XJT_D8:
return id.contains("eu") ? 0 : 1;
case PULSES_PPM:
return id.contains("internalppm") ? 1 : 0;
default:
@@ -844,6 +853,7 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
case PULSES_CROSSFIRE:
return 1;
default:
return 0;
@@ -954,16 +964,16 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
// M128 revert because too much RAM used!
case 216:
// A lot of things (first github release)
return OLD_VERSION;
break;
case 217:
// 3 logical switches removed on M128 / gruvin9x boards
return OLD_VERSION;
case 218:
break;
default:
return NOT_OPENTX;
}
return NO_ERROR;
return ALL_OK;
}
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
@@ -1071,7 +1081,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
}
std::cout << " ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
@@ -1087,25 +1097,10 @@ QString OpenTxFirmware::getFirmwareBaseUrl()
QString OpenTxFirmware::getFirmwareUrl()
{
QString url = getFirmwareBaseUrl();
switch (board) {
case BOARD_STOCK:
case BOARD_M128:
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
break;
case BOARD_SKY9X:
case BOARD_AR9X:
case BOARD_9XRPRO:
case BOARD_TARANIS:
case BOARD_TARANIS_PLUS:
case BOARD_TARANIS_X9E:
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
break;
default:
url.clear();
break;
}
if (IS_ARM(board))
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
else
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
return url;
}
@@ -1330,7 +1325,7 @@ void registerOpenTxFirmwares()
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("sdcard", QObject::tr("Support for SD memory card"));
//firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
@@ -1428,10 +1423,19 @@ void registerOpenTxFirmwares()
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
firmware->addOption("horussticks", QObject::tr("Horus magnetic sticks"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Horus board */
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
current_firmware_variant = default_firmware_variant;
}
@@ -1,203 +0,0 @@
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
add_custom_target(about_lbm_9x
make lbm PCB=9X
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_target(about_lbm_taranis
make lbm PCB=TARANIS
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_target(commondeps
make stamp_header tra
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
add_custom_target(lua_exports
make PCB=TARANIS lua_exports.inc
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
set(OPENTX_SRC_FILES
opentxsimulator.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/firmwares/opentx
${RADIO_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}/fonts/std
${RADIO_SRC_DIRECTORY}/lua/src
${RADIO_SRC_DIRECTORY}/thirdparty
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs/option
${RADIO_SRC_DIRECTORY}/thirdparty/CoOS
${RADIO_SRC_DIRECTORY}/thirdparty/Lua/src
)
if(APPLE)
# OS X compiler no longer automatically includes /Library/Frameworks in search path
set(CMAKE_SHARED_LINKER_FLAGS -F/Library/Frameworks)
endif(APPLE)
if(DEFINED TRANSLATIONS)
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
endif()
set(COMMON_DEFINITIONS
${COMMON_DEFINITIONS}
SUFFIX="${SUFFIX}"
HELI
GVARS
FLIGHT_MODES
PPM_CENTER_ADJUSTABLE
PPM_LIMITS_SYMETRICAL
OVERRIDE_CHANNEL_FUNCTION
FAI_CHOICE
)
set(COMMON_LIBRARIES
${QT_LIBRARIES}
${PTHREAD_LIBRARY}
${SDL_LIBRARY}
)
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-ar9x${SUFFIX}-simulator about_lbm_9x commondeps)
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
set(OPENTX_LIBRARIES
opentx-9x${SUFFIX}-simulator
opentx-9xr${SUFFIX}-simulator
opentx-9x128${SUFFIX}-simulator
opentx-9xr128${SUFFIX}-simulator
opentx-gruvin9x${SUFFIX}-simulator
opentx-mega2560${SUFFIX}-simulator
opentx-sky9x${SUFFIX}-simulator
opentx-9xrpro${SUFFIX}-simulator
opentx-ar9x${SUFFIX}-simulator
opentx-taranis${SUFFIX}-simulator
opentx-taranisplus${SUFFIX}-simulator
opentx-taranisx9e${SUFFIX}-simulator
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# 9X with ATmega64
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR with ATmega64
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9X with ATmega128
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR with ATmega128
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Gruvin9x
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Mega2560
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560)
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Sky9x
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# 9XR-PRO
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# AR9X
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis standard
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis Plus
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
# Taranis X9E
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
add_custom_target(opentx-simulators
DEPENDS ${OPENTX_LIBRARIES}
)
if(APPLE)
set(SIMULATOR_BUNDLES)
foreach(_file ${OPENTX_LIBRARIES})
set(SIMULATOR_BUNDLE "${_file}-bundle")
add_custom_target(${SIMULATOR_BUNDLE}
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND pwd
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
DEPENDS ${_file}
)
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
endforeach()
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
endif(APPLE)
@@ -1,539 +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 "opentxsimulator.h"
#include <QDebug>
#include <stdio.h>
#include <exception>
#include <map>
#include <string>
#define COMPANION
#define SIMU
#define SIMU_EXCEPTIONS
#define GUI
#define SPLASH
#define FRSKY
#define FRSKY_HUB
#define GPS
#define VARIO
#define GAUGES
#define PPM_UNIT_PERCENT_PREC1
#define AUDIO
#define PXX
#define DSM2
#define DSM2_PPM
#define DBLKEYS
#define AUTOSWITCH
#define GRAPHICS
#define CURVES
#if defined(PCBTARANIS)
#define RTCLOCK
#define XCURVES
#define VIRTUALINPUTS
#define LUA
#define LUA_MODEL_SCRIPTS
#define LUAINPUTS
#else
#define BUZZER
#define TEMPLATES
#endif
#define BOLD_FONT
#define HAPTIC
#define THRTRACE
#if defined(CPUARM)
#define TIMERS 3
#else
#define TIMERS 2
#endif
#if defined(PCBSKY9X) && !defined(REVX)
#define ROTARY_ENCODERS 1
#elif defined(PCBGRUVIN9X)
#define ROTARY_ENCODERS 2
#endif
#if defined(CPUARM)
#define FRSKY_SPORT
#endif
#if defined (PCBTARANIS)
#define MIXERS_MONITOR
#endif
#undef min
#undef max
namespace NAMESPACE {
#if defined(CPUARM)
#include "radio/src/pulses/ppm_arm.cpp"
#include "radio/src/pulses/pxx_arm.cpp"
#include "radio/src/pulses/dsm2_arm.cpp"
#include "radio/src/main_arm.cpp"
#include "radio/src/pulses/pulses_arm.cpp"
#include "radio/src/tasks_arm.cpp"
#include "radio/src/audio_arm.cpp"
#include "radio/src/telemetry/telemetry.cpp"
#include "radio/src/telemetry/frsky_sport.cpp"
#include "radio/src/sbus.cpp"
#else
#include "radio/src/main_avr.cpp"
#include "radio/src/audio_avr.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
#endif
#include "radio/src/eeprom_common.cpp"
#if defined(EEPROM_RLC)
#include "radio/src/eeprom_rlc.cpp"
#else
#include "radio/src/eeprom_raw.cpp"
#endif
#if defined(PCBTARANIS) || defined(PCBSKY9X)
#include "radio/src/eeprom_conversions.cpp"
#endif
#include "radio/src/opentx.cpp"
#include "radio/src/debug.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#if defined(SDCARD)
#include "radio/src/sdcard.cpp"
#endif
#include "radio/src/timers.cpp"
#include "radio/src/stamp.cpp"
#include "radio/src/maths.cpp"
#include "radio/src/vario.cpp"
#include "radio/src/trainer_input.cpp"
#if defined(PCBTARANIS)
#include "radio/src/bmp.cpp"
#include "radio/src/gui/Taranis/fonts.cpp"
#include "radio/src/gui/Taranis/widgets.cpp"
#include "radio/src/gui/Taranis/navigation.cpp"
#include "radio/src/gui/Taranis/popups.cpp"
#include "radio/src/gui/Taranis/helpers.cpp"
#include "radio/src/gui/Taranis/menus.cpp"
#include "radio/src/gui/Taranis/menu_model.cpp"
#include "radio/src/gui/Taranis/menu_model_select.cpp"
#include "radio/src/gui/Taranis/menu_model_setup.cpp"
#include "radio/src/gui/Taranis/menu_model_heli.cpp"
#include "radio/src/gui/Taranis/menu_model_flightmodes.cpp"
#include "radio/src/gui/Taranis/menu_model_inputs_mixes.cpp"
#include "radio/src/gui/Taranis/menu_model_curves.cpp"
#include "radio/src/gui/Taranis/menu_model_logical_switches.cpp"
#include "radio/src/gui/Taranis/menu_model_custom_functions.cpp"
#include "radio/src/gui/Taranis/menu_model_custom_scripts.cpp"
#include "radio/src/gui/Taranis/menu_model_gvars.cpp"
#include "radio/src/gui/Taranis/menu_model_limits.cpp"
#include "radio/src/gui/Taranis/menu_model_telemetry.cpp"
#include "radio/src/gui/Taranis/menu_general.cpp"
#include "radio/src/gui/Taranis/menu_general_setup.cpp"
#include "radio/src/gui/Taranis/menu_general_sdmanager.cpp"
#include "radio/src/gui/Taranis/menu_general_trainer.cpp"
#include "radio/src/gui/Taranis/menu_general_version.cpp"
#include "radio/src/gui/Taranis/menu_general_diagkeys.cpp"
#include "radio/src/gui/Taranis/menu_general_diaganas.cpp"
#include "radio/src/gui/Taranis/menu_general_hardware.cpp"
#include "radio/src/gui/Taranis/menu_general_calib.cpp"
#include "radio/src/gui/Taranis/view_main.cpp"
#include "radio/src/gui/Taranis/view_statistics.cpp"
#include "radio/src/gui/Taranis/view_channels.cpp"
#include "radio/src/gui/Taranis/view_telemetry.cpp"
#include "radio/src/gui/Taranis/view_text.cpp"
#include "radio/src/gui/Taranis/view_about.cpp"
#include "radio/src/gui/Taranis/lcd.cpp"
#include "radio/src/gui/Taranis/splash.cpp"
#else
#include "radio/src/gui/9X/fonts.cpp"
#include "radio/src/gui/9X/widgets.cpp"
#include "radio/src/gui/9X/navigation.cpp"
#include "radio/src/gui/9X/popups.cpp"
#include "radio/src/gui/9X/helpers.cpp"
#include "radio/src/gui/9X/menus.cpp"
#include "radio/src/gui/9X/menu_model.cpp"
#include "radio/src/gui/9X/menu_model_select.cpp"
#include "radio/src/gui/9X/menu_model_setup.cpp"
#include "radio/src/gui/9X/menu_model_heli.cpp"
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
#include "radio/src/gui/9X/menu_model_curves.cpp"
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
#include "radio/src/gui/9X/menu_model_limits.cpp"
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
#include "radio/src/gui/9X/menu_model_templates.cpp"
#include "radio/src/gui/9X/menu_general.cpp"
#include "radio/src/gui/9X/menu_general_setup.cpp"
#if defined(SDCARD)
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
#include "radio/src/gui/9X/view_text.cpp"
#endif
#include "radio/src/gui/9X/menu_general_trainer.cpp"
#include "radio/src/gui/9X/menu_general_version.cpp"
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
#if defined(CPUARM)
#include "radio/src/gui/9X/menu_general_hardware.cpp"
#endif
#include "radio/src/gui/9X/menu_general_calib.cpp"
#include "radio/src/gui/9X/view_main.cpp"
#include "radio/src/gui/9X/view_statistics.cpp"
#include "radio/src/gui/9X/view_telemetry.cpp"
#if !defined(CPUM64)
#include "radio/src/gui/9X/view_about.cpp"
#endif
#include "radio/src/gui/9X/lcd.cpp"
#include "radio/src/gui/9X/splash.cpp"
#endif
#if !defined(VIRTUALINPUTS)
#include "radio/src/templates.cpp"
#endif
#if defined(SDCARD)
#include "radio/src/logs.cpp"
#endif
#if defined(RTCLOCK)
#include "radio/src/rtc.cpp"
#endif
#if defined(BUZZER)
#include "radio/src/buzzer.cpp"
#endif
#if defined(PCBTARANIS)
#include "radio/src/targets/taranis/board_taranis.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
#include "radio/src/targets/taranis/audio_driver.cpp"
#include "radio/src/targets/taranis/telemetry_driver.cpp"
#include "radio/src/targets/taranis/haptic_driver.cpp"
#if defined(REV9E)
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
#endif
#include "radio/src/targets/taranis/pulses_driver.cpp"
#include "radio/src/targets/taranis/rtc_driver.cpp"
#include "radio/src/targets/taranis/trainer_driver.cpp"
#include "radio/src/targets/taranis/serial2_driver.cpp"
#elif defined(PCBSKY9X)
#include "radio/src/targets/sky9x/board_sky9x.cpp"
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
#include "radio/src/targets/sky9x/pwr_driver.cpp"
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/targets/sky9x/audio_driver.cpp"
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
#include "radio/src/targets/sky9x/coproc_driver.cpp"
#include "radio/src/targets/sky9x/haptic_driver.cpp"
#include "radio/src/targets/sky9x/serial2_driver.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
#elif defined(PCBGRUVIN9X)
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
#include "radio/src/targets/gruvin9x/somo14d.cpp"
#elif defined(PCBMEGA2560)
#include "radio/src/targets/mega2560/board_mega2560.cpp"
#else
#include "radio/src/targets/stock/board_stock.cpp"
#endif
#include "radio/src/keys.cpp"
#include "radio/src/haptic.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/telemetry/frsky.cpp"
#if defined(CPUARM)
#include "radio/src/telemetry/frsky_d_arm.cpp"
#else
#include "radio/src/telemetry/frsky_d.cpp"
#endif
#include "radio/src/translations/tts_en.cpp"
#if defined(CPUARM)
#include "radio/src/translations/tts_cz.cpp"
#include "radio/src/translations/tts_de.cpp"
#include "radio/src/translations/tts_es.cpp"
#include "radio/src/translations/tts_fr.cpp"
#include "radio/src/translations/tts_hu.cpp"
#include "radio/src/translations/tts_it.cpp"
#include "radio/src/translations/tts_nl.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_se.cpp"
#include "radio/src/translations/tts_sk.cpp"
#endif
#if defined(LUA)
#include "radio/src/lua_api.cpp"
#include "radio/src/thirdparty/Lua/src/lapi.c"
#include "radio/src/thirdparty/Lua/src/lcode.c"
#include "radio/src/thirdparty/Lua/src/lctype.c"
#include "radio/src/thirdparty/Lua/src/ldebug.c"
#include "radio/src/thirdparty/Lua/src/ldo.c"
#include "radio/src/thirdparty/Lua/src/ldump.c"
#include "radio/src/thirdparty/Lua/src/lfunc.c"
#include "radio/src/thirdparty/Lua/src/lgc.c"
#include "radio/src/thirdparty/Lua/src/llex.c"
#include "radio/src/thirdparty/Lua/src/lmem.c"
#include "radio/src/thirdparty/Lua/src/lobject.c"
#include "radio/src/thirdparty/Lua/src/lopcodes.c"
#include "radio/src/thirdparty/Lua/src/lparser.c"
#include "radio/src/thirdparty/Lua/src/lstate.c"
#include "radio/src/thirdparty/Lua/src/lstring.c"
#include "radio/src/thirdparty/Lua/src/ltable.c"
#include "radio/src/thirdparty/Lua/src/lrotable.c"
#include "radio/src/thirdparty/Lua/src/ltm.c"
#include "radio/src/thirdparty/Lua/src/lundump.c"
#include "radio/src/thirdparty/Lua/src/lvm.c"
#include "radio/src/thirdparty/Lua/src/lzio.c"
#include "radio/src/thirdparty/Lua/src/lbaselib.c"
#include "radio/src/thirdparty/Lua/src/linit.c"
#include "radio/src/thirdparty/Lua/src/lmathlib.c"
#include "radio/src/thirdparty/Lua/src/lbitlib.c"
#include "radio/src/thirdparty/Lua/src/loadlib.c"
#include "radio/src/thirdparty/Lua/src/lauxlib.c"
#include "radio/src/thirdparty/Lua/src/ltablib.c"
#include "radio/src/thirdparty/Lua/src/lcorolib.c"
#include "radio/src/thirdparty/Lua/src/liolib.c"
#endif
int16_t g_anas[NUM_STICKS+NUM_POTS];
uint16_t anaIn(uint8_t chan)
{
return g_anas[chan];
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
}
uint8_t getStickMode()
{
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
#if defined(PCBTARANIS)
void resetTrims()
{
TRIMS_GPIO_REG_RVD |= TRIMS_GPIO_PIN_RVD;
TRIMS_GPIO_REG_RVU |= TRIMS_GPIO_PIN_RVU;
TRIMS_GPIO_REG_RHL |= TRIMS_GPIO_PIN_RHL;
TRIMS_GPIO_REG_RHR |= TRIMS_GPIO_PIN_RHR;
TRIMS_GPIO_REG_LVD |= TRIMS_GPIO_PIN_LVD;
TRIMS_GPIO_REG_LVU |= TRIMS_GPIO_PIN_LVU;
TRIMS_GPIO_REG_LHL |= TRIMS_GPIO_PIN_LHL;
TRIMS_GPIO_REG_LHR |= TRIMS_GPIO_PIN_LHR;
}
#endif
void delay_01us(::uint16_t nb)
{
}
OpenTxSimulator::OpenTxSimulator()
{
}
void OpenTxSimulator::setSdPath(const QString &sdPath)
{
#if defined(SDCARD)
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
#endif
}
void OpenTxSimulator::setVolumeGain(int value)
{
volumeGain = value;
}
bool OpenTxSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
::uint8_t * OpenTxSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
start((const char *)0, tests);
}
void OpenTxSimulator::start(const char * filename, bool tests)
{
#if defined(PCBSKY9X) && !defined(REVX)
g_rotenc[0] = 0;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] = 0;
g_rotenc[1] = 0;
#endif
StartEepromThread(filename);
StartAudioThread(volumeGain);
StartMainThread(tests);
}
void OpenTxSimulator::stop()
{
StopMainThread();
#if defined(CPUARM)
StopAudioThread();
#endif
StopEepromThread();
}
void OpenTxSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#define g_chans512 channelOutputs
#include "simulatorimport.h"
#if defined(PCBSKY9X)
outputs.beep = g_beepCnt;
g_beepCnt = 0;
#endif
}
void OpenTxSimulator::setValues(TxInputs &inputs)
{
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::setTrim(unsigned int idx, int value)
{
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
setTrimValue(phase, idx, value);
}
void OpenTxSimulator::getTrims(Trims & trims)
{
::uint8_t phase = getFlightMode();
trims.extended = hasExtendedTrims();
for (::uint8_t idx=0; idx<4; idx++) {
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
}
for (int i=0; i<2; i++) {
::uint8_t idx = NAMESPACE::modn12x3[4*getStickMode() + i];
::int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
}
}
void OpenTxSimulator::wheelEvent(int steps)
{
#if defined(REV9E)
if (steps == 255)
x9de_rotenc -= 2;
else
x9de_rotenc += 2;
#elif defined(PCBSKY9X) && !defined(REVX)
g_rotenc[0] += steps*4;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] += steps;
#endif
}
unsigned int OpenTxSimulator::getPhase()
{
return getFlightMode();
}
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
{
static char buff[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
return buff;
}
const char * OpenTxSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
{
#if defined(FRSKY_SPORT)
processSportPacket(data);
#endif
}
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
{
traceCallback = callback;
}
class OpenTxSimulatorFactory: public SimulatorFactory
{
public:
OpenTxSimulatorFactory()
{
}
virtual SimulatorInterface *create()
{
return new OpenTxSimulator();
}
virtual QString name()
{
return QString("opentx-" FLAVOUR SUFFIX);
}
virtual BoardEnum type()
{
#if defined(PCBTARANIS)
return BOARD_TARANIS;
#else
return BOARD_STOCK;
#endif
}
};
}
extern "C" DLLEXPORT SimulatorFactory *registerSimu()
{
return new NAMESPACE::OpenTxSimulatorFactory();
}
@@ -1,4 +0,0 @@
// Automatically generated file (CMake) - do not edit
#define DATE_STR "@DATE@"
#define TIME_STR "@TIME@"
#define VERS_STR "@C9X_VERSION@"
@@ -175,8 +175,7 @@ bool Th9xSimulator::timer10ms()
uint8_t * Th9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
return (::uint8_t *)simuLcdBuf;
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
@@ -123,7 +123,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
}
std::cout << "ok\n";
errors.set(NO_ERROR);
errors.set(ALL_OK);
return errors.to_ulong();
}
+2 -2
View File
@@ -126,7 +126,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
if (xmlOK) {
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
if (!errors.test(NO_ERROR)) {
if (!errors.test(ALL_OK)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
}
else {
@@ -162,7 +162,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
RadioData * radioData = new RadioData();
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
}
else {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef FLASHEEPROMDIALOG_H_
#define FLASHEEPROMDIALOG_H_
#include <QDialog>
#include <QtWidgets>
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
+1 -1
View File
@@ -110,7 +110,7 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Saves a dated copy of your eeprom to the backup folder you specified in the Companion settings before writing the current model to the radio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Backup before Write</string>
-1
View File
@@ -203,7 +203,6 @@ void FlashFirmwareDialog::on_useLibrarySplash_clicked()
void FlashFirmwareDialog::on_burnButton_clicked()
{
g.flashDir(QFileInfo(fwName).dir().absolutePath());
g.profile[g.id()].fwName(fwName);
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
g.backupOnFlash(ui->backupEEprom->isChecked());
+1 -2
View File
@@ -1,8 +1,7 @@
#ifndef FLASH_FIRMWARE_DIALOG_H
#define FLASH_FIRMWARE_DIALOG_H
#include <QtGui>
#include <QDialog>
#include <QtWidgets>
#include "eeprominterface.h"
#include "firmwareinterface.h"
#include "xmlinterface.h"
+7 -4
View File
@@ -4,13 +4,15 @@ set(generaledit_NAMES
generaledit
generalsetup
trainer
calibration
hardware
)
set(generaledit_SRCS
calibration.cpp
)
set(generaledit_HDRS
calibration.h
)
set(generaledit_UIS
@@ -22,7 +24,8 @@ foreach(name ${generaledit_NAMES})
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
endforeach()
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
add_library(generaledit ${generaledit_SRCS})
add_library(generaledit ${generaledit_SRCS})
qt5_use_modules(generaledit Widgets Xml Multimedia)
+74 -413
View File
@@ -1,429 +1,90 @@
#include <QVBoxLayout>
#include <QHeaderView>
#include <QSpinBox>
#include "calibration.h"
#include "ui_calibration.h"
void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard())) {
if (IS_TARANIS_X9E(firmware->getBoard())) {
enabled = true;
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
}
else if (index < 8) {
enabled = true;
}
}
if (enabled) {
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
if (threePos) type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
name->setField(generalSettings.switchName[index], 3, this);
type->setField(generalSettings.switchConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void CalibrationPanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
enabled = true;
}
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
enabled = true;
}
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
enabled = true;
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::POT_NONE);
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
name->setField(generalSettings.potName[index], 3, this);
type->setField(generalSettings.potConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void CalibrationPanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
type->setEnabled(false);
enabled = true;
}
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
enabled = true;
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
name->setField(generalSettings.sliderName[index], 3, this);
type->setField(generalSettings.sliderConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
ui(new Ui::Calibration)
GeneralPanel(parent, generalSettings, firmware)
{
ui->setupUi(this);
if (!firmware->getCapability(MultiposPots)) {
ui->potsTypeSeparator->hide();
tableWidget = new QTableWidget();
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(tableWidget);
layout->setContentsMargins(0, 0, 0, 0);
this->setLayout(layout);
tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
tableWidget->setColumnCount(3);
tableWidget->setShowGrid(false);
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
QStringList headerLabels;
headerLabels << QObject::tr("Negative span") << QObject::tr("Mid value") << QObject::tr("Positive span");
tableWidget->setHorizontalHeaderLabels(headerLabels);
int rows = NUM_STICKS + GetCurrentFirmware()->getCapability(Pots) + GetCurrentFirmware()->getCapability(Sliders);
tableWidget->setRowCount(rows);
for(int i = 0; i < rows; ++i) {
QTableWidgetItem *newItem = new QTableWidgetItem(AnalogString(i));
newItem->setTextAlignment(Qt::AlignLeft);
tableWidget->setVerticalHeaderItem(i, newItem);
for(int j = 0; j < 3; ++j) {
QSpinBox * newItem = new QSpinBox();
newItem->setMinimum(-9999);
newItem->setMaximum(9999);
newItem->setSingleStep(1);
newItem->setValue(getCalibrationValue(i, j));
newItem->setProperty("row", i);
newItem->setProperty("column", j);
tableWidget->setCellWidget(i, j, newItem);
connect(newItem, SIGNAL(valueChanged(int)), this, SLOT(onCellChanged(int)));
}
}
if (IS_TARANIS(firmware->getBoard())) {
ui->rudName->setField(generalSettings.stickName[0], 3, this);
ui->eleName->setField(generalSettings.stickName[1], 3, this);
ui->thrName->setField(generalSettings.stickName[2], 3, this);
ui->ailName->setField(generalSettings.stickName[3], 3, this);
}
else {
ui->rudLabel->hide();
ui->rudName->hide();
ui->eleLabel->hide();
ui->eleName->hide();
ui->thrLabel->hide();
ui->thrName->hide();
ui->ailLabel->hide();
ui->ailName->hide();
}
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
int potsCount = GetCurrentFirmware()->getCapability(Pots);
if (potsCount == 3) {
ui->ana8Neg->hide();
ui->ana8Mid->hide();
ui->ana8Pos->hide();
}
if (IS_TARANIS(firmware->getBoard())) {
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
}
else {
ui->serialPortMode->hide();
ui->serialPortLabel->hide();
}
if (!IS_SKY9X(firmware->getBoard())) {
ui->txCurrentCalibration->hide();
ui->txCurrentCalibrationLabel->hide();
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
}
else {
ui->bluetoothLabel->hide();
ui->bluetoothEnable->hide();
ui->bluetoothName->hide();
}
disableMouseScrolling();
setValues();
}
CalibrationPanel::~CalibrationPanel()
void CalibrationPanel::onCellChanged(int value)
{
delete ui;
}
QSpinBox * sb = qobject_cast<QSpinBox*>(sender());
int row = sb->property("row").toInt();
int column = sb->property("column").toInt();
/*void CalibrationPanel::update()
if (value != getCalibrationValue(row, column)) {
setCalibrationValue(row,column, value);
qDebug() << "CalibrationPanel::onCellChanged" << row << column << "to" << value;
emit modified();
}
}
int CalibrationPanel::getCalibrationValue(int row, int column)
{
switch(column) {
case 0:
return generalSettings.calibSpanNeg[row];
case 1:
return generalSettings.calibMid[row];
case 2:
return generalSettings.calibSpanPos[row];
}
return 0;
}
*/
void CalibrationPanel::on_PPM_MultiplierDSB_editingFinished()
void CalibrationPanel::setCalibrationValue(int row, int column, int value)
{
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
emit modified();
}
void CalibrationPanel::on_PPM1_editingFinished()
{
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
}
void CalibrationPanel::on_PPM2_editingFinished()
{
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
}
void CalibrationPanel::on_PPM3_editingFinished()
{
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
}
void CalibrationPanel::on_PPM4_editingFinished()
{
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
}
void CalibrationPanel::on_txCurrentCalibration_editingFinished()
{
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
emit modified();
}
void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
{
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
emit modified();
}
void CalibrationPanel::setValues()
{
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
ui->ana3Neg->setValue(generalSettings.calibSpanNeg[2]);
ui->ana4Neg->setValue(generalSettings.calibSpanNeg[3]);
ui->ana5Neg->setValue(generalSettings.calibSpanNeg[4]);
ui->ana6Neg->setValue(generalSettings.calibSpanNeg[5]);
ui->ana7Neg->setValue(generalSettings.calibSpanNeg[6]);
ui->ana8Neg->setValue(generalSettings.calibSpanNeg[7]);
ui->ana1Mid->setValue(generalSettings.calibMid[0]);
ui->ana2Mid->setValue(generalSettings.calibMid[1]);
ui->ana3Mid->setValue(generalSettings.calibMid[2]);
ui->ana4Mid->setValue(generalSettings.calibMid[3]);
ui->ana5Mid->setValue(generalSettings.calibMid[4]);
ui->ana6Mid->setValue(generalSettings.calibMid[5]);
ui->ana7Mid->setValue(generalSettings.calibMid[6]);
ui->ana8Mid->setValue(generalSettings.calibMid[7]);
ui->ana1Pos->setValue(generalSettings.calibSpanPos[0]);
ui->ana2Pos->setValue(generalSettings.calibSpanPos[1]);
ui->ana3Pos->setValue(generalSettings.calibSpanPos[2]);
ui->ana4Pos->setValue(generalSettings.calibSpanPos[3]);
ui->ana5Pos->setValue(generalSettings.calibSpanPos[4]);
ui->ana6Pos->setValue(generalSettings.calibSpanPos[5]);
ui->ana7Pos->setValue(generalSettings.calibSpanPos[6]);
ui->ana8Pos->setValue(generalSettings.calibSpanPos[7]);
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
}
void CalibrationPanel::on_txVoltageCalibration_editingFinished()
{
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
emit modified();
}
void CalibrationPanel::on_ana1Neg_editingFinished()
{
generalSettings.calibSpanNeg[0] = ui->ana1Neg->value();
emit modified();
}
void CalibrationPanel::on_ana2Neg_editingFinished()
{
generalSettings.calibSpanNeg[1] = ui->ana2Neg->value();
emit modified();
}
void CalibrationPanel::on_ana3Neg_editingFinished()
{
generalSettings.calibSpanNeg[2] = ui->ana3Neg->value();
emit modified();
}
void CalibrationPanel::on_ana4Neg_editingFinished()
{
generalSettings.calibSpanNeg[3] = ui->ana4Neg->value();
emit modified();
}
void CalibrationPanel::on_ana5Neg_editingFinished()
{
generalSettings.calibSpanNeg[4] = ui->ana5Neg->value();
emit modified();
}
void CalibrationPanel::on_ana6Neg_editingFinished()
{
generalSettings.calibSpanNeg[5] = ui->ana6Neg->value();
emit modified();
}
void CalibrationPanel::on_ana7Neg_editingFinished()
{
generalSettings.calibSpanNeg[6] = ui->ana7Neg->value();
emit modified();
}
void CalibrationPanel::on_ana8Neg_editingFinished()
{
generalSettings.calibSpanNeg[7] = ui->ana8Neg->value();
emit modified();
}
void CalibrationPanel::on_ana1Mid_editingFinished()
{
generalSettings.calibMid[0] = ui->ana1Mid->value();
emit modified();
}
void CalibrationPanel::on_ana2Mid_editingFinished()
{
generalSettings.calibMid[1] = ui->ana2Mid->value();
emit modified();
}
void CalibrationPanel::on_ana3Mid_editingFinished()
{
generalSettings.calibMid[2] = ui->ana3Mid->value();
emit modified();
}
void CalibrationPanel::on_ana4Mid_editingFinished()
{
generalSettings.calibMid[3] = ui->ana4Mid->value();
emit modified();
}
void CalibrationPanel::on_ana5Mid_editingFinished()
{
generalSettings.calibMid[4] = ui->ana5Mid->value();
emit modified();
}
void CalibrationPanel::on_ana6Mid_editingFinished()
{
generalSettings.calibMid[5] = ui->ana6Mid->value();
emit modified();
}
void CalibrationPanel::on_ana7Mid_editingFinished()
{
generalSettings.calibMid[6] = ui->ana7Mid->value();
emit modified();
}
void CalibrationPanel::on_ana8Mid_editingFinished()
{
generalSettings.calibMid[7] = ui->ana8Mid->value();
emit modified();
}
void CalibrationPanel::on_ana1Pos_editingFinished()
{
generalSettings.calibSpanPos[0] = ui->ana1Pos->value();
emit modified();
}
void CalibrationPanel::on_ana2Pos_editingFinished()
{
generalSettings.calibSpanPos[1] = ui->ana2Pos->value();
emit modified();
}
void CalibrationPanel::on_ana3Pos_editingFinished()
{
generalSettings.calibSpanPos[2] = ui->ana3Pos->value();
emit modified();
}
void CalibrationPanel::on_ana4Pos_editingFinished()
{
generalSettings.calibSpanPos[3] = ui->ana4Pos->value();
emit modified();
}
void CalibrationPanel::on_ana5Pos_editingFinished()
{
generalSettings.calibSpanPos[4] = ui->ana5Pos->value();
emit modified();
}
void CalibrationPanel::on_ana6Pos_editingFinished()
{
generalSettings.calibSpanPos[5] = ui->ana6Pos->value();
emit modified();
}
void CalibrationPanel::on_ana7Pos_editingFinished()
{
generalSettings.calibSpanPos[6] = ui->ana7Pos->value();
emit modified();
}
void CalibrationPanel::on_ana8Pos_editingFinished()
{
generalSettings.calibSpanPos[7] = ui->ana8Pos->value();
emit modified();
}
void CalibrationPanel::on_serialPortMode_currentIndexChanged(int index)
{
generalSettings.hw_uartMode = index;
emit modified();
switch(column) {
case 0:
generalSettings.calibSpanNeg[row] = value;
break;
case 1:
generalSettings.calibMid[row] = value;
break;
case 2:
generalSettings.calibSpanPos[row] = value;
break;
}
}
+6 -47
View File
@@ -1,6 +1,7 @@
#ifndef CALIBRATION_H
#define CALIBRATION_H
#include <QTableWidget>
#include "generaledit.h"
namespace Ui {
@@ -17,58 +18,16 @@ class CalibrationPanel : public GeneralPanel
public:
CalibrationPanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
virtual ~CalibrationPanel();
// virtual void update();
virtual ~CalibrationPanel() {};
private slots:
void on_txVoltageCalibration_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_PPM_MultiplierDSB_editingFinished();
void on_txCurrentCalibration_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_ana1Neg_editingFinished();
void on_ana2Neg_editingFinished();
void on_ana3Neg_editingFinished();
void on_ana4Neg_editingFinished();
void on_ana5Neg_editingFinished();
void on_ana6Neg_editingFinished();
void on_ana7Neg_editingFinished();
void on_ana8Neg_editingFinished();
void on_ana1Mid_editingFinished();
void on_ana2Mid_editingFinished();
void on_ana3Mid_editingFinished();
void on_ana4Mid_editingFinished();
void on_ana5Mid_editingFinished();
void on_ana6Mid_editingFinished();
void on_ana7Mid_editingFinished();
void on_ana8Mid_editingFinished();
void on_ana1Pos_editingFinished();
void on_ana2Pos_editingFinished();
void on_ana3Pos_editingFinished();
void on_ana4Pos_editingFinished();
void on_ana5Pos_editingFinished();
void on_ana6Pos_editingFinished();
void on_ana7Pos_editingFinished();
void on_ana8Pos_editingFinished();
void on_serialPortMode_currentIndexChanged(int index);
protected:
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos);
void onCellChanged(int value);
private:
Ui::Calibration *ui;
QTableWidget * tableWidget;
void setValues();
int getCalibrationValue(int row, int column);
void setCalibrationValue(int row, int column, int value);
};
#endif // CALIBRATION_H
+70 -8
View File
@@ -1,6 +1,3 @@
#include <QDateTime>
#include <QtGui>
#include <QScrollArea>
#include "generaledit.h"
#include "ui_generaledit.h"
#include "helpers.h"
@@ -8,6 +5,7 @@
#include "generalsetup.h"
#include "trainer.h"
#include "calibration.h"
#include "hardware.h"
#include "../modeledit/customfunctions.h"
#include "verticalscrollarea.h"
@@ -42,7 +40,8 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
}
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Hardware / Calibration"));
addTab(new HardwarePanel(this, generalSettings, firmware), tr("Hardware"));
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
ui->tabWidget->setCurrentIndex( g.generalEditTab() );
}
@@ -82,12 +81,15 @@ void GeneralEdit::on_calretrieve_PB_clicked()
{
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString calib=g.profile[profile_id].stickPotCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
int numSwPots=GetCurrentFirmware()->getCapability(Switches)+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
if (calib.isEmpty()) {
return;
}
else {
QString trainercalib = g.profile[profile_id].trainerCalib();
QString hwtypes = g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
@@ -134,6 +136,45 @@ void GeneralEdit::on_calretrieve_PB_clicked()
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
}
if (hwtypes.length()==numSwPots) {
QString Byte;
int16_t byte16;
QByteArray qba;
int16_t offset;
bool ok;
for (int i=0; i<NUM_STICKS; i++) {
qba = controlNames.mid(3*i,3).toLatin1();
strcpy(generalSettings.stickName[i], qba.data());
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
Byte=hwtypes.mid(i,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS),3).toLatin1();
if (ok)
generalSettings.switchConfig[i]=byte16;
strcpy(generalSettings.switchName[i], qba.data());
}
offset = GetCurrentFirmware()->getCapability(Switches);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
if (ok)
generalSettings.potConfig[i]=byte16;
strcpy(generalSettings.potName[i], qba.data());
}
offset += GetCurrentFirmware()->getCapability(Pots);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
if (ok)
generalSettings.sliderConfig[i]=byte16;
strcpy(generalSettings.sliderName[i], qba.data());
}
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
}
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
generalSettings.stickMode=GSStickMode;
uint8_t byte8u;
@@ -181,8 +222,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
if (ok)
generalSettings.imperial=byte8u;
chars=CountrySet.mid(4,2);
generalSettings.ttsLanguage[0]=chars[0].toAscii();
generalSettings.ttsLanguage[1]=chars[1].toAscii();
generalSettings.ttsLanguage[0]=chars[0].toLatin1();
generalSettings.ttsLanguage[1]=chars[1].toLatin1();
}
}
else {
@@ -198,13 +239,15 @@ void GeneralEdit::on_calstore_PB_clicked()
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString name=g.profile[profile_id].name();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
return;
}
else {
QString calib=g.profile[profile_id].stickPotCalib();
QString hwtypes=g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
if (!(calib.isEmpty())) {
int ret = QMessageBox::question(this, "Companion",
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
@@ -225,6 +268,25 @@ void GeneralEdit::on_calstore_PB_clicked()
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
}
g.profile[profile_id].trainerCalib( calib );
hwtypes.clear();
controlNames.clear();
for (int i=0; i<NUM_STICKS; i++) {
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.switchConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.switchName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.potConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.potName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
}
g.profile[profile_id].controlTypes( hwtypes );
g.profile[profile_id].controlNames( controlNames );
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef GENERALEDIT_H
#define GENERALEDIT_H
#include <QDialog>
#include <QtWidgets>
#include "eeprominterface.h"
#include "genericpanel.h"
+3 -4
View File
@@ -1,6 +1,5 @@
#include "generalsetup.h"
#include "ui_generalsetup.h"
#include <QMessageBox>
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
@@ -275,8 +274,8 @@ void GeneralSetupPanel::populateBacklightCB()
void GeneralSetupPanel::populateVoiceLangCB()
{
QComboBox * b = ui->voiceLang_CB;
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
QString strings[] = { QObject::tr("English"), QObject::tr("Dutch"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), QObject::tr("Hungarian"), NULL};
QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", "hu", NULL};
b->clear();
for (int i=0; strings[i]!=NULL; i++) {
@@ -316,7 +315,7 @@ void GeneralSetupPanel::on_voiceLang_CB_currentIndexChanged(int index)
if (!lock) {
QString code = ui->voiceLang_CB->itemData(index).toString();
for (int i=0; i<2; i++) {
generalSettings.ttsLanguage[i] = code.at(i).toAscii();
generalSettings.ttsLanguage[i] = code.at(i).toLatin1();
}
generalSettings.ttsLanguage[2] = '\0';
emit modified();
+1 -1
View File
@@ -658,7 +658,7 @@
<item>
<widget class="QCheckBox" name="adjustRTC">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
<string>Automatically adjust the radio's clock if a GPS is connected to telemetry.</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
+241
View File
@@ -0,0 +1,241 @@
#include "hardware.h"
#include "ui_hardware.h"
void HardwarePanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard())) {
if (IS_TARANIS_X9E(firmware->getBoard())) {
enabled = true;
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
}
else if (index < 8) {
enabled = true;
}
}
if (enabled) {
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
if (threePos) type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
name->setField(generalSettings.switchName[index], 3, this);
type->setField(generalSettings.switchConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void HardwarePanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
enabled = true;
}
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
enabled = true;
}
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
enabled = true;
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::POT_NONE);
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
name->setField(generalSettings.potName[index], 3, this);
type->setField(generalSettings.potConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
void HardwarePanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
{
bool enabled = false;
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
type->setEnabled(false);
enabled = true;
}
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
enabled = true;
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
}
if (enabled) {
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
name->setField(generalSettings.sliderName[index], 3, this);
type->setField(generalSettings.sliderConfig[index], this);
}
else {
label->hide();
name->hide();
type->hide();
}
}
HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
ui(new Ui::Hardware)
{
ui->setupUi(this);
if (IS_TARANIS(firmware->getBoard())) {
ui->rudName->setField(generalSettings.stickName[0], 3, this);
ui->eleName->setField(generalSettings.stickName[1], 3, this);
ui->thrName->setField(generalSettings.stickName[2], 3, this);
ui->ailName->setField(generalSettings.stickName[3], 3, this);
}
else {
ui->rudLabel->hide();
ui->rudName->hide();
ui->eleLabel->hide();
ui->eleName->hide();
ui->thrLabel->hide();
ui->thrName->hide();
ui->ailLabel->hide();
ui->ailName->hide();
}
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
if (IS_TARANIS(firmware->getBoard())) {
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
}
else {
ui->serialPortMode->hide();
ui->serialPortLabel->hide();
}
if (!IS_SKY9X(firmware->getBoard())) {
ui->txCurrentCalibration->hide();
ui->txCurrentCalibrationLabel->hide();
}
if (IS_TARANIS_X9E(firmware->getBoard())) {
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
}
else {
ui->bluetoothLabel->hide();
ui->bluetoothEnable->hide();
ui->bluetoothName->hide();
}
disableMouseScrolling();
setValues();
}
HardwarePanel::~HardwarePanel()
{
delete ui;
}
void HardwarePanel::on_PPM_MultiplierDSB_editingFinished()
{
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
emit modified();
}
void HardwarePanel::on_PPM1_editingFinished()
{
generalSettings.trainer.calib[0] = ui->PPM1->value();
emit modified();
}
void HardwarePanel::on_PPM2_editingFinished()
{
generalSettings.trainer.calib[1] = ui->PPM2->value();
emit modified();
}
void HardwarePanel::on_PPM3_editingFinished()
{
generalSettings.trainer.calib[2] = ui->PPM3->value();
emit modified();
}
void HardwarePanel::on_PPM4_editingFinished()
{
generalSettings.trainer.calib[3] = ui->PPM4->value();
emit modified();
}
void HardwarePanel::on_txCurrentHardware_editingFinished()
{
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
emit modified();
}
void HardwarePanel::on_bluetoothEnable_stateChanged(int)
{
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
emit modified();
}
void HardwarePanel::setValues()
{
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
}
void HardwarePanel::on_txVoltageHardware_editingFinished()
{
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
emit modified();
}
void HardwarePanel::on_serialPortMode_currentIndexChanged(int index)
{
generalSettings.hw_uartMode = index;
emit modified();
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef HARDWARE_H
#define HARDWARE_H
#include "generaledit.h"
namespace Ui {
class Hardware;
}
class QLabel;
class AutoLineEdit;
class AutoComboBox;
class HardwarePanel : public GeneralPanel
{
Q_OBJECT
public:
HardwarePanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
virtual ~HardwarePanel();
private slots:
void on_txVoltageHardware_editingFinished();
void on_PPM1_editingFinished();
void on_PPM2_editingFinished();
void on_PPM3_editingFinished();
void on_PPM4_editingFinished();
void on_PPM_MultiplierDSB_editingFinished();
void on_txCurrentHardware_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_serialPortMode_currentIndexChanged(int index);
protected:
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos);
private:
Ui::Hardware *ui;
void setValues();
};
#endif // HARDWARE_H
File diff suppressed because it is too large Load Diff
+100 -3
View File
@@ -12,6 +12,8 @@
#include "simulatorinterface.h"
#include "firmwareinterface.h"
Stopwatch gStopwatch("global");
const QColor colors[C9X_MAX_CURVES] = {
QColor(0,0,127),
QColor(0,127,0),
@@ -84,7 +86,7 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
{
memset(dest, 0, length+1);
if (b->currentText() != "----") {
strncpy(dest, b->currentText().toAscii(), length);
strncpy(dest, b->currentText().toLatin1(), length);
}
}
@@ -173,7 +175,7 @@ void GVarGroup::valuesChanged()
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
weight = round(dsb->value()/step);
}
}
@@ -788,7 +790,13 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
}
BoardEnum board = GetCurrentFirmware()->getBoard();
SimulatorDialog * sd;
if (IS_TARANIS(board)) {
if (board == BOARD_HORUS) {
sd = new SimulatorDialogHorus(parent, si, flags);
}
else if (board == BOARD_FLAMENCO) {
sd = new SimulatorDialogFlamenco(parent, si, flags);
}
else if (IS_TARANIS(board)) {
for (int i=0; i<GetCurrentFirmware()->getCapability(Pots); i++) {
if (radioData.generalSettings.isPotAvailable(i)) {
flags |= (SIMULATOR_FLAGS_S1 << i);
@@ -995,3 +1003,92 @@ QStringList extractLatLon(const QString & position)
}
return result;
}
TableLayout::TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels)
{
#if defined(TABLE_LAYOUT)
tableWidget = new QTableWidget(parent);
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(tableWidget);
layout->setContentsMargins(0, 0, 0, 0);
parent->setLayout(layout);
tableWidget->setRowCount(rowCount);
tableWidget->setColumnCount(headerLabels.size());
tableWidget->setShowGrid(false);
tableWidget->verticalHeader()->setVisible(false);
tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
tableWidget->setHorizontalHeaderLabels(headerLabels);
#else
gridWidget = new QGridLayout(parent);
int col = 0;
foreach(QString text, headerLabels) {
QLabel *label = new QLabel();
label->setFrameShape(QFrame::Panel);
label->setFrameShadow(QFrame::Raised);
label->setMidLineWidth(0);
label->setAlignment(Qt::AlignCenter);
label->setMargin(5);
label->setText(text);
// if (!minimize)
// label->setMinimumWidth(100);
gridWidget->addWidget(label, 0, col++);
}
#endif
}
void TableLayout::addWidget(int row, int column, QWidget * widget)
{
#if defined(TABLE_LAYOUT)
QHBoxLayout * layout = new QHBoxLayout(tableWidget);
layout->addWidget(widget);
addLayout(row, column, layout);
#else
gridWidget->addWidget(widget, row + 1, column);
#endif
}
void TableLayout::addLayout(int row, int column, QLayout * layout)
{
#if defined(TABLE_LAYOUT)
layout->setContentsMargins(1, 3, 1, 3);
QWidget * containerWidget = new QWidget(tableWidget);
containerWidget->setLayout(layout);
tableWidget->setCellWidget(row, column, containerWidget);
#else
gridWidget->addLayout(layout, row + 1, column);
#endif
}
void TableLayout::resizeColumnsToContents()
{
#if defined(TABLE_LAYOUT)
tableWidget->resizeColumnsToContents();
#else
#endif
}
void TableLayout::setColumnWidth(int col, int width)
{
#if defined(TABLE_LAYOUT)
tableWidget->setColumnWidth(col, width);
#else
#endif
}
void TableLayout::pushRowsUp(int row)
{
#if defined(TABLE_LAYOUT)
#else
// Push the rows up
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
gridWidget->addItem(spacer, row, 0);
#endif
// Push rows upward
// addDoubleSpring(gridLayout, 5, num_fsw+1);
}
+61 -1
View File
@@ -1,7 +1,11 @@
#ifndef HELPERS_H
#define HELPERS_H
#include <QtGui>
#include <QCheckBox>
#include <QSpinBox>
#include <QTableWidget>
#include <QGridLayout>
#include <QDebug>
#include "eeprominterface.h"
extern const QColor colors[C9X_MAX_CURVES];
@@ -201,4 +205,60 @@ private:
double toDecimalCoordinate(const QString & value);
QStringList extractLatLon(const QString & position);
class TableLayout
{
public:
TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels);
// ~TableLayout() ;
void addWidget(int row, int column, QWidget * widget);
void addLayout(int row, int column, QLayout * layout);
void resizeColumnsToContents();
void setColumnWidth(int col, int width);
void pushRowsUp(int row);
private:
#if defined(TABLE_LAYOUT)
QTableWidget * tableWidget;
#else
QGridLayout * gridWidget;
#endif
};
class Stopwatch
{
public:
Stopwatch(const QString & name) :
name(name), total(0) {
timer.start();
};
~Stopwatch() {};
void restart() {
total = 0;
timer.restart();
};
void report() {
qint64 elapsed = timer.restart();
total += elapsed;
qDebug() << name << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
};
void report(const QString & text) {
qint64 elapsed = timer.restart();
total += elapsed;
qDebug() << name << text << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
};
private:
QString name;
QElapsedTimer timer;
qint64 total;
};
extern Stopwatch gStopwatch;
#endif // HELPERS_H
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 2.2 MiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

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