Compare commits

...

701 Commits

Author SHA1 Message Date
mhotar 2a0b34146f Czech translations (Companion) 2015-01-11 22:16:13 +01:00
Bertrand Songis b13598d788 Merge pull request #1993 from opentx/MicheleVilla/C9X_IT_Translation
Italian translation in progress
2015-01-11 16:40:46 +01:00
MicheleVilla 4a59b9032b Italian translation in progress 2015-01-11 16:38:16 +01:00
Bertrand Songis 47a7b9f08b Update DONATIONS.txt 2015-01-11 13:00:31 +01:00
MicheleVilla 22a2b6f325 Italian translation in progress 2015-01-11 09:44:10 +01:00
Andre Bernet 84fe66bc82 Companion french translations 2015-01-10 20:00:41 +04:00
bsongis 89db641a9c Fixes #1992 2015-01-10 11:10:01 +01:00
Bertrand Songis 81001f9e24 Update releasenotes.txt
Missing tags
2015-01-10 08:55:10 +01:00
Bertrand Songis a731fb4a29 Update releasenotes.txt 2015-01-09 21:50:09 +01:00
bsongis d0e2caba46 #1942 - Test inverted as requested by the majority ;) 2015-01-09 21:45:32 +01:00
Damjan Adamic 10e71abe4d Release notes updated 2015-01-09 20:54:34 +01:00
Damjan Adamic 10b1836a31 Fixes #1987: gtests for lcd_line() 2015-01-09 19:25:43 +01:00
Bertrand Songis 2860d842dd Merge pull request #1989 from opentx/projectkk2glider/issue_1987
Projectkk2glider/issue 1987
2015-01-09 18:59:28 +01:00
Damjan Adamic a18a79bcba Fixes #1987: missing bitmap for gtests 2015-01-09 18:38:16 +01:00
Damjan Adamic 6d46d52bfd Fixes #1987: bmpLoad() last column not loaded for some bitmap widths, gtests added 2015-01-09 18:33:17 +01:00
bsongis 729f68f33f #1732 - First code review. Nothing obvious found except a buffer
overflow
2015-01-09 17:12:41 +01:00
bsongis 59966a1e40 Fixes #1775 - Review and tests needed 2015-01-09 15:49:59 +01:00
bsongis caf0c42cac Fixes #1942 - Review needed, thanks! If it works it could be used in
some other places.
2015-01-09 15:12:37 +01:00
Damjan Adamic dc295c8cb4 Fixes #1981: Edge function INSTANT bug for V1>2s 2015-01-09 14:26:39 +01:00
Damjan Adamic 641187c3af Re #1987: first pixel not drawn by Lua lcd.drawLine() 2015-01-09 13:56:44 +01:00
bsongis 026b0f141e Fixes #1876 - Popup displayed when flavour from previous firmware exists
and is not compatible with the current flavour. Fortunately FrSky always
inserted a flavour in their radios, so it works. Tested on my Taranis+ I
would appreciate someone else tests on a standard Taranis, thanks!
2015-01-09 12:22:48 +01:00
Bertrand Songis d28c1417c7 Update DONATIONS.txt 2015-01-09 08:50:32 +01:00
Damjan Adamic f37092efd0 Bootloader now uses NANO setting from the main Makefile 2015-01-08 08:26:36 +01:00
Bertrand Songis d95518c91e Merge pull request #1984 from kh90909/pwm-bl-fix
Tested fix for PWM_BACKLIGHT on ATmega2561 MCUs
2015-01-08 07:44:18 +01:00
Ken ed4465d78f Tested fix for PWM_BACKLIGHT on ATmega2561 MCUs
The functionality of timer0 and timer2 are switched between ATmega64/128
and 641/1281/2561. When compiled for ATmega2561, this commit sets up timer0
in the same way as timer2 on ATmega64/128 (phase correct PWM, clk/64 count
rate, inverted if SP22 is defined).

The previous quick fix had a typo in the initialization of TCCR0B (0b111 is
an invalid value for the clock select bits CS2:0). It also did not respect
the SP22 define which indicates the PWM must be inverted. Smartieparts
v2.2 or later programmer boards have an inverted backlight driver. Finally,
it is unnecessary to set DDB7 as it is already set in boardInit() (line
101).
2015-01-08 00:52:21 -05:00
Bertrand Songis b7de352e83 Merge pull request #1978 from davxlw/davxlw_lcd_putsCenter
Little lcd_putsCenter correction
2015-01-07 07:07:07 +01:00
davxlw 42aa3ca4ba Little lcd_putsCenter correction, still doesn't take the different characters
sizes into account...
2015-01-06 17:06:51 +01:00
Bertrand Songis f4afe50c32 Merge pull request #1974 from adriano65/Correction01_#1895
Issue #1935 - added Mavlink 115200 Baud speed - to test
2015-01-06 07:33:33 +01:00
adriano65 8726fe1329 Issue #1935 - added Mavlink 115200 Baud speed - to test 2015-01-06 01:18:35 +01:00
mhotar 2fc2c58338 Merge branch 'master' of https://github.com/opentx/opentx 2015-01-05 23:04:23 +01:00
mhotar f44a744a09 Czech translations 2015-01-05 23:02:51 +01:00
Bertrand Songis b0b29b57fe Update DONATIONS.txt 2015-01-05 22:51:37 +01:00
Bertrand Songis 9f70a5baaf Merge pull request #1971 from adriano65/Correction01_#1895
Correction to "compilation error on 9XR with MAVLINK extension"
2015-01-05 06:42:34 +01:00
adriano65 38c8b95fd7 Correction to "compilation error on 9XR with MAVLINK extension" 2015-01-05 00:17:36 +01:00
bsongis bc0969181e Quick fix for #1970 - I don't have any 2561 for testing, I let you test
and fix if needed!
2015-01-04 23:39:29 +01:00
Damjan Adamic 16bdd1ae93 Re #1489, #1270, Re #1466: Allow only one instance of new dialogs, enable telemetryInterrupt10ms() call 2015-01-04 20:20:30 +01:00
bsongis 15eb56908c Fixes #1961 2015-01-04 17:14:35 +01:00
bsongis e74ab6f15b Fixes #1793 - cp won't work on some Linux distributions 2015-01-04 15:42:23 +01:00
Bertrand Songis 7bf73ac365 Update DONATIONS.txt 2015-01-04 10:00:29 +01:00
Damjan Adamic a5d14f631f Re #457: AUDIO_FILENAME_MAXLEN to small 2015-01-03 12:52:26 +01:00
Damjan Adamic 5947054e3b Release notes updated 2015-01-03 11:09:15 +01:00
Damjan Adamic 8255a84571 Re #1489: windows build didn't like the redefiniton of callback function 2015-01-03 07:04:14 +01:00
Bertrand Songis 91fdbd17c0 Update DONATIONS.txt 2015-01-02 23:07:39 +01:00
Bertrand Songis c3ece1f12f Merge pull request #1967 from opentx/projectkk2glider/companion_simulator_extensions
Projectkk2glider/companion simulator extensions
2015-01-02 20:01:12 +01:00
Damjan Adamic beb93fdf5f Re #1466, #1489, #1270: added missing delete on close 2015-01-02 19:29:00 +01:00
Damjan Adamic 5d60f776ad Re #1270: trainer for Sky9x 2015-01-02 19:29:00 +01:00
Damjan Adamic 07f238b974 Re #1489: TRACE() output intercepted and shown in Companion (shortcut F6) 2015-01-02 19:29:00 +01:00
Damjan Adamic c916bb38d0 Re #1270: simple Trainer Simulator (shortcut F5)
Re #1466: small fixes to Telemetry simulator
2015-01-02 19:28:59 +01:00
Damjan Adamic a1ceb4a4f3 Re #1466: Telemetry simulator opening moved to class SimulatorDialog 2015-01-02 19:09:51 +01:00
Damjan Adamic 263d2cf201 Re #1466: Very simple telemetry (or receiver) simulation for Taranis. Simulates RSSI, SWR, A1 and A2. Uses F4 key as a open shortcut. 2015-01-02 19:09:51 +01:00
bsongis 482d7e0335 Bug introduced in commit c8eba005d3 2015-01-02 12:20:57 +01:00
bsongis 4f323d980f VC++ Compilation error for #1965 2015-01-02 08:13:55 +01:00
Bertrand Songis eb7b662ff2 Update DONATIONS.txt 2015-01-02 08:08:50 +01:00
bsongis 689dacf577 Fixes #1965 2015-01-01 21:24:25 +01:00
bsongis 8762e46dbb Fixes #1960 2015-01-01 20:16:00 +01:00
bsongis c8eba005d3 Fixes #1940 - Also adds a "stops" feature in checkIncDec that could be
useful in a next future
2015-01-01 19:52:41 +01:00
bsongis 34a1b2eeca Warnings removed 2015-01-01 19:47:36 +01:00
bsongis 2ae475a9e8 #1876 - Companion now recognizes the radio type from the binary file 2015-01-01 13:17:22 +01:00
bsongis 5413619846 #1876 - Radio identifier added inside the firmware - it will help
Companion to recognize the radio type and avoid to flash a wrong
firmware.
2015-01-01 11:31:57 +01:00
Damjan Adamic 9bc7ed52d4 Re #1963: fixes the case of power switch fast OFF->ON sequence. 2015-01-01 09:29:15 +01:00
Damjan Adamic 1de327e386 Fixes #1964 and possibly #1963: TIM13 was used by bootloader and delays.c, lcdInitFinish() was missing from lcdSetRefVolt(), simplified LCD init interface for Taranis, delaysInit() was missing from Bootloader (ported 7b19afa96f from next branch) 2014-12-31 19:34:15 +01:00
Bertrand Songis 039d084228 Update DONATIONS.txt 2014-12-31 11:19:44 +01:00
Bertrand Songis b7aab8b64f Merge pull request #1957 from opentx/projectkk2glider/botloader_nano_lib
Projectkk2glider/botloader nano lib
2014-12-29 20:33:19 +01:00
Damjan Adamic cffd5aa2bc Default changed to link with nano lib (NANO=YES), reduces opentx size from 340040 to 323056 bytes 2014-12-27 12:49:20 +01:00
Damjan Adamic 01d9445a49 Using nano lib reduces bootloader size for Taranis from 31880 to 31004 bytes. 2014-12-27 12:38:10 +01:00
Bertrand Songis 9c2f9b8b78 Update DONATIONS.txt 2014-12-23 07:32:59 +01:00
Bertrand Songis 4ab58cb559 Update DONATIONS.txt 2014-12-22 21:08:55 +01:00
Damjan Adamic 1804bcd133 Fixes #1927: THt persistent timer running after model load (with Throttle at -100%) 2014-12-21 20:25:18 +01:00
Bertrand Songis 4b8d9a5549 Merge pull request #1948 from opentx/projectkk2glider/issue1937_ppm_polarity
Re #1937: reverse polarity on external CPPM output (Taranis all)
2014-12-21 00:11:53 +01:00
Bertrand Songis 7426bfafc0 Merge pull request #1947 from opentx/projectkk2glider/issue1800_center_beep_for_noexisting_pot
Fixes #1800: suppress center beep for non-existing pots
2014-12-21 00:11:20 +01:00
Damjan Adamic c9e66c9502 Re #1937: reverse polarity on external CPPM output (Taranis all) 2014-12-20 20:42:33 +01:00
Bertrand Songis bb57632121 Update DONATIONS.txt 2014-12-20 20:18:40 +01:00
Damjan Adamic aa739f394c Fixes #1800: suppress center beep for non-existing pots 2014-12-20 19:41:46 +01:00
Damjan Adamic 2ecbd8e6a9 Turn on back-light in LCD_BL_Config() for REVPLUS (normal Taranis already did this) 2014-12-20 18:58:46 +01:00
Bertrand Songis edabaed304 Update DONATIONS.txt 2014-12-20 09:34:58 +01:00
bsongis 75fd4378fe LCD bugfix on EEPROM alerts. No more Splash if splash disabled 2014-12-18 19:03:52 +01:00
bsongis bf60fd2631 Fixes #1918 2014-12-16 21:55:01 +01:00
Bertrand Songis 8e06e4b8a3 Merge pull request #1936 from opentx/projectkk2glider/issue1919_gvars_invert_take_two
Fixes #1919: Shortcuts keys for inverting values don't work correctly wi...
2014-12-15 23:50:28 +01:00
Bertrand Songis 62f3f71bb3 Update DONATIONS.txt 2014-12-15 23:17:26 +01:00
Damjan Adamic 64227a2cb6 Re #1919: disabled DBLKEYS for !ARM 2014-12-15 21:41:46 +01:00
Bertrand Songis d911220697 Merge pull request #1933 from opentx/projectkk2glider/issue1909_tab_order_2
Projectkk2glider/issue1909 tab order 2
2014-12-15 18:39:05 +01:00
Damjan Adamic 001f53efe3 Fixes #1919: Shortcuts keys for inverting values don't work correctly with GVs 2014-12-15 15:54:46 +01:00
Damjan Adamic 1161647908 Re #1909: tabs fixed for Model Edit -> Setup tab 2014-12-14 16:01:10 +01:00
Damjan Adamic b54afa04e6 Re #1909: tabs fixed for Radio Profile firmware options 2014-12-14 15:30:31 +01:00
Damjan Adamic bfeda24dcd Re #1835: fix for negative trim index 2014-12-14 14:15:56 +01:00
Damjan Adamic ef6b36526d Fixed #1835: Issue with heli swash plate mixing (notrim) 2014-12-14 12:42:05 +01:00
Damjan Adamic 67990ea9a3 Fixes #1869: Google Earth additional fields exported as strings, support for variable number of columns 2014-12-14 10:00:31 +01:00
Bertrand Songis 446da70fb1 Merge pull request #1929 from opentx/projectkk2glider/issue1926_smlsize_fixes
Re #1926: SMLSIZE last line drawn, gtests expanded with LCD character ov...
2014-12-13 22:01:58 +01:00
Damjan Adamic 9e3c90dcd9 Re #1926: SMLSIZE last line drawn, gtests expanded with LCD character overlapped test 2014-12-13 21:24:22 +01:00
Damjan Adamic ef3bf78085 Re #1926: Fixed SMLSIZE gtests 2014-12-13 20:44:47 +01:00
Bertrand Songis 3118970cf4 Merge pull request #1928 from opentx/projectkk2glider/issue1926_display_glitches
Fixes #1926: Little display glitches
2014-12-13 20:21:39 +01:00
Damjan Adamic b9d951919e Fixes #1926: Little display glitches 2014-12-13 20:19:35 +01:00
bsongis 28d95f9844 Target addframeworks fixed as discussed in #1482 - untested 2014-12-12 23:11:06 +01:00
bsongis ed583e704f Fixes #1923 2014-12-12 18:14:32 +01:00
Bertrand Songis aba2e31ce2 Update DONATIONS.txt 2014-12-12 17:53:59 +01:00
Bertrand Songis be27447196 Fixes #1921 2014-12-12 07:19:11 +01:00
Bertrand Songis 2cc47a9146 Merge pull request #1920 from opentx/projectkk2glider/issue1909_tab_order
Fixes #1909: tab order in Companion dialogs
2014-12-11 22:18:53 +01:00
Damjan Adamic a86ec3bcb0 Fixes #1909: tab order in Companion dialogs 2014-12-11 19:31:29 +01:00
bsongis 1c45019403 Fixes #1915 2014-12-11 18:50:38 +01:00
Bertrand Songis 8f10e8e212 Update DONATIONS.txt 2014-12-10 19:03:40 +01:00
bsongis 704f1c95cc Fixes #1908 2014-12-09 21:37:11 +01:00
bsongis f50d94bded 2.0.14 preparation 2014-12-09 20:31:38 +01:00
bsongis 7a7371d651 MAVLINK adaptation for Sky9x and 9XRPRO - Closes #1895 2014-12-09 19:39:00 +01:00
Bertrand Songis be071767c7 Merge pull request #1877 from opentx/projectkk2glider/issue1875_lcd_low_temp
Fixes #1875 and #1849: implemented LCD initialization for low temperatures
2014-12-09 19:02:31 +01:00
bsongis 7f31bde6d0 Fixes #1903 2014-12-08 22:56:52 +01:00
bsongis 108109b579 Fixes #1905 2014-12-08 19:44:58 +01:00
Bertrand Songis ceff3262f9 Update DONATIONS.txt 2014-12-08 19:30:12 +01:00
Damjan Adamic bc31b7d3dd Re #1875 and #1849: the delay for Taranis Plus reduced to 300ms 2014-12-03 20:36:22 +01:00
Bertrand Songis bd8371892d Update DONATIONS.txt 2014-12-02 07:08:23 +01:00
Bertrand Songis 5cfcc27fb4 Update DONATIONS.txt 2014-11-27 18:25:57 +01:00
Damjan Adamic 8f07439943 Fixes #1875 and #1849: implemented LCD initialization for low temperatures. Initialization skipped in case of watchdog reset or boot-loader exit. 2014-11-26 21:04:00 +01:00
Damjan Adamic c052ff26c7 Fixes #1874: Wrong clock configuration for CoOS on Taranis 2014-11-26 17:33:01 +01:00
Bertrand Songis 5dd3af7d3c Update DONATIONS.txt 2014-11-26 07:53:42 +01:00
bsongis 5b9f0dd6a9 Nighly builds were broken (previous syntax was chosen for VC++
compilation!). Anyhow we shouldn't need this trick any more.
2014-11-25 07:11:21 +01:00
Bertrand Songis 7e2b78f2b5 Update DONATIONS.txt 2014-11-24 07:58:01 +01:00
Damjan Adamic b9e2635ec1 Corrected optimization level for sky9x DAC_IRQHandler() (was left in -O2 after that function) 2014-11-23 20:26:44 +01:00
Bertrand Songis caede92d09 Update DONATIONS.txt 2014-11-23 09:41:07 +01:00
bsongis e62651ac14 Fixes #1861 2014-11-22 19:07:39 +01:00
bsongis 643d45e4c0 Fixes #1867 2014-11-22 14:34:32 +01:00
Bertrand Songis a2e930d6a3 Update DONATIONS.txt 2014-11-22 07:14:41 +01:00
Damjan Adamic 9342be9e48 Debian package maintainer changed to Bertrand Songis <bsongis-nosp@m-gmail.com> 2014-11-21 22:06:39 +01:00
Damjan Adamic 125923d7d6 45-taranis.rules renamed to 45-companion-taranis.rules to solve the clash with the same file name from Companion9x debian package 2014-11-21 22:02:33 +01:00
Bertrand Songis fbdb328c6a Update DONATIONS.txt 2014-11-21 20:15:42 +01:00
Bertrand Songis 6c17e1efc8 Update DONATIONS.txt 2014-11-21 18:07:32 +01:00
Bertrand Songis 6273fb7e7c Update DONATIONS.txt 2014-11-21 07:59:12 +01:00
Bertrand Songis f6cc9067d8 Update DONATIONS.txt 2014-11-21 07:09:49 +01:00
Bertrand Songis 8ce5d38093 Update DONATIONS.txt 2014-11-21 00:16:05 +01:00
Bertrand Songis 9397c470da Update DONATIONS.txt 2014-11-20 23:54:16 +01:00
Bertrand Songis c8b3ea7f36 Update DONATIONS.txt 2014-11-20 23:10:48 +01:00
Bertrand Songis 3a55f85ef1 Update DONATIONS.txt 2014-11-20 22:11:00 +01:00
Bertrand Songis f5889dc912 Update DONATIONS.txt 2014-11-20 21:55:55 +01:00
Bertrand Songis f12b8a50ec Update DONATIONS.txt 2014-11-20 21:36:53 +01:00
Bertrand Songis b561967d3e Update DONATIONS.txt 2014-11-20 20:32:07 +01:00
bsongis b359aa12ba Fixes #1834
Fixes #1848
2014-11-19 22:35:35 +01:00
bsongis 5f81444ccb Release notes updated 2014-11-19 21:59:18 +01:00
bsongis e8aba51edb Fixes #1852 2014-11-19 20:27:57 +01:00
bsongis 6393f10ae4 Fixes #1851 2014-11-19 19:47:38 +01:00
bsongis 8a16b63b31 Mutex lock check added as suggested by projectkk2glider 2014-11-19 19:40:45 +01:00
bsongis a5d334b11d No more -O2 on all platforms 2014-11-19 07:12:13 +01:00
bsongis b51060f8f8 unexpectedShutdown sentinel removed 2014-11-18 23:29:27 +01:00
Bertrand Songis 0db8fc5ab2 Update DONATIONS.txt 2014-11-18 23:08:37 +01:00
bsongis 1c696c28fd ioMutex removed 2014-11-18 07:52:15 +01:00
bsongis f29d2074c1 openocd config file added 2014-11-18 00:30:01 +01:00
bsongis c12bc7326c Those ; are a little bit dangerous 2014-11-18 00:30:01 +01:00
Damjan Adamic 6365292bfe Updated release notes 2014-11-17 21:05:43 +01:00
bsongis d74bdef2ea Release notes updated (please update if I missed anything) 2014-11-17 19:06:50 +01:00
Bertrand Songis 884698c7f7 Update DONATIONS.txt 2014-11-17 07:37:25 +01:00
Damjan Adamic 1454764987 Enabled more complier warnings and removed one for Taranis. Other targets still have some warnings. 2014-11-15 11:43:52 +01:00
Bertrand Songis fb35ff098d Merge pull request #1843 from opentx/projectkk2glider/bmpload_fixes
Fixed bmpLoad():
2014-11-15 10:09:58 +01:00
bsongis 681064b11c Cosmetics 2014-11-15 10:09:33 +01:00
bsongis 87ebf0b90a Fixes #1834 - I will confirm with the JTAG that it is a compiler bug
later
2014-11-15 08:36:26 +01:00
Bertrand Songis 1f63108753 Update DONATIONS.txt 2014-11-14 19:57:52 +01:00
Damjan Adamic 649fffa439 Fixed bmpLoad():
* added gtests
 * fixed various memory leaks
 * fixed wrong display of images with width < 8
 * fixed wrong display of images with odd width and/or height
2014-11-12 19:45:00 +01:00
Bertrand Songis e3d08e9bab Update DONATIONS.txt 2014-11-12 07:08:06 +01:00
Bertrand Songis b4cc92b3f0 Update DONATIONS.txt 2014-11-11 20:35:17 +01:00
Bertrand Songis 9691d9f648 Update DONATIONS.txt 2014-11-11 09:04:08 +01:00
Damjan Adamic f02b9699d5 Re #1834 - fixed Companion simulator compilation for lastest FatFS 0.10c 2014-11-10 20:30:55 +01:00
bsongis b78556275b #1834 - Switch to lastest FatFS 0.10c 2014-11-10 18:53:37 +01:00
bsongis 1effa17204 #1834 ... In case we have negative indexes here ... 2014-11-09 22:53:24 +01:00
Damjan Adamic ff69164400 One more try for Windows Companion compile problem (lua_exports) 2014-11-09 21:08:18 +01:00
Damjan Adamic 86e8687d32 Possible solution for Windows Companion compile problem (lua_exports) 2014-11-09 20:44:09 +01:00
Damjan Adamic 85755312e4 Fixes #1839: Companion simulator Lua crash on Mac 2014-11-09 10:32:43 +01:00
Bertrand Songis f826d77f18 Merge pull request #1832 from opentx/projectkk2glider/issue_1783_for_master
Projectkk2glider/issue 1783 for master
2014-11-08 11:23:24 +01:00
bsongis 9dc4756789 In MixerDialog GVar checkbox for Curves was visible even when GVARS
disabled
2014-11-08 11:22:46 +01:00
Bertrand Songis afd04e0c44 Update DONATIONS.txt 2014-11-08 10:53:27 +01:00
Damjan Adamic d718ca03db This enables build of Companion on OS X
Remove the check for arm-gcc version when doing Companion build
2014-11-08 10:15:23 +01:00
Bertrand Songis ca4028cc7e Update DONATIONS.txt 2014-11-07 18:25:59 +01:00
Bertrand Songis 9c0b13eb6b Merge pull request #1827 from opentx/projectkk2glider/issue_1811_for_master
Fixes #1811: Companion 2.0.12 Gvar import error (for limits)
2014-11-03 23:56:42 +01:00
Damjan Adamic 5a10d85ee0 Re #1783: NOT curves removed from inputs (for non ARM platforms) 2014-11-03 22:15:05 +01:00
Damjan Adamic 2d80327ffd Re #1783: NOT curves exported incorrectly (for non ARM platforms) 2014-11-03 22:01:58 +01:00
Damjan Adamic 2a5ff5244f Re #1783: Companion shows too many curve types in input/mixer for 9x 2014-11-03 21:14:52 +01:00
Damjan Adamic 2ce1ec16fb Fixes #1811: Companion 2.0.12 Gvar import error (for limits) 2014-11-03 19:55:07 +01:00
Bertrand Songis 607a93b604 Update DONATIONS.txt 2014-11-03 18:36:57 +01:00
Bertrand Songis 75b7a0517b Merge pull request #1822 from opentx/projectkk2glider/issue_1731_for_master
Fixes #1731: Joystick calibration crash after channel assignment
2014-11-02 19:43:08 +01:00
Damjan Adamic cf54d28f35 Fixes #1731: Joystick calibration crash after channel assignment
also additional fixes to stick postion mapping
2014-11-02 18:58:06 +01:00
Bertrand Songis ffe8ee5a29 Update DONATIONS.txt 2014-11-02 18:06:42 +01:00
Bertrand Songis 552e3d468a Update DONATIONS.txt 2014-11-02 16:28:31 +01:00
Damjan Adamic 949369d6a8 Fixes #1815: Stick icons missing next to trim key states on switch diag page 2014-11-02 13:32:39 +01:00
Damjan Adamic 3b2cf5d738 Fixes #1737: virtual inputs not selectable in SF Volume and heli Collective Source 2014-11-02 12:52:45 +01:00
bsongis 5468bacad7 2.0.13 preparation 2014-11-02 11:07:47 +01:00
Bertrand Songis b8fea4d652 Merge pull request #1820 from opentx/projectkk2glider/issue_1818_for_master
Fixes #1818: added Lua model.resetTimer() function
2014-11-02 10:00:12 +01:00
Damjan Adamic 734480cc56 Fixes #1818: added Lua model.resetTimer() function 2014-11-02 09:26:36 +01:00
Bertrand Songis 30e0d441e4 Update DONATIONS.txt 2014-10-29 19:00:05 +01:00
bsongis 784238252a Simplification with a new #define. Also one test was inverted. 2014-10-28 18:07:46 +01:00
Andre Bernet 403a62478a Disable SWR if XJT version is 0xFF
Typo
2014-10-28 12:38:54 +04:00
bsongis c73ab26bc4 SWR readded to Taranis+ (when the hardware supports it) 2014-10-28 00:23:54 +01:00
bsongis c0783948e6 #1805 fixed 2014-10-26 15:57:00 +01:00
Damjan Adamic dc3ca96a2f Display message in case of Lua telemetry screen script error 2014-10-26 10:40:21 +01:00
Damjan Adamic 5664b4a141 Missing screenshots for previous commit 2014-10-25 20:04:16 +02:00
Damjan Adamic 7e18f53cbe Fixed buffer overflow in lcd_hlineStip() 2014-10-25 20:00:56 +02:00
Damjan Adamic 611e26d0bf Fixed buffer overflow in bmp_load() 2014-10-25 19:30:52 +02:00
bsongis ae7a36deeb A2- set to A2 if A2 > A2+ 2014-10-22 20:27:23 +02:00
bsongis 7c37277364 Little display problem for negative curves on 9X 2014-10-21 07:18:08 +02:00
bsongis 2230fbaa94 SWR added in the firmware as an option (SWR=YES) 2014-10-19 22:54:38 +02:00
bsongis 97bb1a4b4d Cosmetics 2014-10-19 22:54:38 +02:00
bsongis 82d385bcef SWR added for latest Taranis+ production 2014-10-19 22:54:38 +02:00
Bertrand Songis 34f9367e25 Update DONATIONS.txt 2014-10-19 18:46:19 +02:00
Bertrand Songis 205e510468 Update DONATIONS.txt 2014-10-19 09:55:22 +02:00
Andre Bernet 414a482ce4 Fix receiver number range (Fix #1790) 2014-10-17 22:44:57 +04:00
Damjan Adamic b24d071493 Bug in numbering of Lua multiple fields (only in generated documentation file, all numbers were too small by 1) 2014-10-16 18:26:42 +02:00
Bertrand Songis a50e2472e9 Update DONATIONS.txt 2014-10-15 21:33:41 +02:00
bsongis 29c95fd2a3 Cosmetics 2014-10-14 22:23:24 +02:00
Damjan Adamic c9875525a4 Re #1610:
* sport.log only active if SPORT_FILE_LOG=YES
* audio concurrent access fixes
* added IO mutex
* added Event Trace Buffer
* fixed SD card error
2014-10-14 22:14:36 +02:00
bsongis 6df7575ad8 Fixes #1785 2014-10-12 19:42:07 +02:00
bsongis 86c8d4a878 It was possible to have the Limits contextual menu displayed in
READ_ONLY mode
2014-10-11 21:47:12 +02:00
Bertrand Songis 6abc26c36a Update DONATIONS.txt 2014-10-10 19:25:08 +02:00
Bertrand Songis 966398426a Update DONATIONS.txt 2014-10-10 07:04:34 +02:00
mhotar d43a48f088 No special character in CZ names of Inputs.
Conflicts:
	radio/src/translations.cpp
	radio/src/translations.h
	radio/src/translations/cz.h.txt
2014-10-07 07:10:40 +02:00
mhotar 56b4698655 cz tts.py updated 2014-10-07 07:06:28 +02:00
Bertrand Songis 57f0c1b6f6 Update DONATIONS.txt 2014-10-06 21:14:51 +02:00
bsongis b89e16e627 Sky9x Coprocessor bug fix 2014-10-06 00:03:19 +02:00
bsongis 9e4e990d33 Sky9x binary was built with the bootloader present on disk (was not
removed by make clean). So 99% it was a Taranis bootloader.
2014-10-06 00:02:40 +02:00
bsongis a7c893607a Companion bug in model import fixed (after changing radio in the same
session)
2014-10-05 19:32:02 +02:00
Damjan Adamic e477183026 Fixes #1755 (on master branch): LUA get/setTimer(): inconsistent timer struct 2014-10-05 14:52:13 +02:00
bsongis a4698287f8 Note added to Companion: if you have a Taranis that has not had the
firmware upgraded to 2.0 then this version of Companion will not work
2014-10-03 16:36:42 +02:00
Damjan Adamic b035a8df64 Fixes #1657 (ported from next to master):
* corrected varioLimitCenterMin range
* removed varioLimitMinOff checkbox (it is not used anymore in any radio)
2014-10-01 19:38:56 +02:00
Damjan Adamic 223be49c5d Fixes #1696: fixed incorrect display of "<" and ">" characters (ported from next to master branch) 2014-10-01 19:30:13 +02:00
Bertrand Songis ac8312de36 Update DONATIONS.txt 2014-10-01 07:10:41 +02:00
Bertrand Songis 46a9151bcf Update DONATIONS.txt 2014-09-30 07:11:33 +02:00
Bertrand Songis 0e9536fea9 Update DONATIONS.txt 2014-09-28 22:01:22 +02:00
Bertrand Songis 64d86c4c74 Update DONATIONS.txt 2014-09-26 23:40:52 +02:00
Bertrand Songis 151a09149d Update DONATIONS.txt 2014-09-26 07:19:57 +02:00
Bertrand Songis fd53eba65f Update DONATIONS.txt 2014-09-25 10:36:31 +02:00
Bertrand Songis 393f599ecf Update DONATIONS.txt 2014-09-24 19:56:36 +02:00
bsongis 1fbb4effed Tests failure 2014-09-24 15:22:20 +02:00
Bertrand Songis fe95488a83 Update DONATIONS.txt 2014-09-24 14:52:04 +02:00
bsongis c9b9de2c99 Fixes #1630 - Thanks to projectkk2glider for his pull request #1738 - I
only added a google test
2014-09-24 10:04:18 +02:00
bsongis 3adc4c20a6 Automatic google tests fix 2014-09-24 09:24:02 +02:00
Bertrand Songis 227a886122 Update DONATIONS.txt 2014-09-24 07:24:38 +02:00
Bertrand Songis de625fde01 Update DONATIONS.txt 2014-09-23 08:27:32 +02:00
Bertrand Songis daad477250 Update DONATIONS.txt 2014-09-22 17:40:37 +02:00
Bertrand Songis 334a718a8a Update DONATIONS.txt 2014-09-22 10:33:37 +02:00
Bertrand Songis 5baaec1868 Update DONATIONS.txt 2014-09-20 19:01:31 +02:00
Bertrand Songis c2ad82eb35 Update DONATIONS.txt 2014-09-19 15:19:15 +02:00
Bertrand Songis c61c417f13 Update DONATIONS.txt 2014-09-19 12:58:46 +02:00
bsongis 98f156301a Fixes #1727 2014-09-18 08:35:12 +02:00
Bertrand Songis ef6fe0006e Update DONATIONS.txt 2014-09-17 23:35:57 +02:00
Bertrand Songis 23358c254c Update DONATIONS.txt 2014-09-17 15:53:33 +02:00
bsongis 6114245229 Release notes updated 2014-09-16 17:18:31 +02:00
Andre Bernet e76880cf26 French translations 2014-09-16 17:14:56 +02:00
bsongis f30dfa3365 Inversion of S3 on Taranis+ (S3 should be wired as S2) - Issue #1716 2014-09-16 17:14:47 +02:00
Andre Bernet f4aa92ec20 S2 inverted on T+ (Fix #1716) 2014-09-16 17:03:56 +02:00
Bertrand Songis 2640ca9fea Update DONATIONS.txt 2014-09-16 14:30:22 +02:00
bsongis f6a1420ce3 Version and release notes updated 2014-09-15 18:54:32 +02:00
bsongis 6c0f65411a Overflow on OverrideCHxx functions on ARM boards (range is now
-150:+150)
2014-09-15 18:41:25 +02:00
bsongis a7f1ace55b #1647 - bitmap set/get added to the Lua interpreter 2014-09-15 17:37:20 +02:00
bsongis b8dedd7940 #1647 - getCurve exported to the Lua interpreter 2014-09-15 17:32:45 +02:00
bsongis 2703118c56 Makefile typos from #1644 2014-09-15 12:24:09 +02:00
Bertrand Songis 8bfc7a497a Update DONATIONS.txt 2014-09-15 11:58:52 +02:00
bsongis 87870c24a5 Fixes #1709 2014-09-15 11:50:45 +02:00
bsongis 7610fb43d5 Fixes #1669 2014-09-15 11:28:46 +02:00
bsongis 0263784e65 MEGA2560 simu compilation now ok 2014-09-15 09:56:33 +02:00
Bertrand Songis 6f74624371 Update DONATIONS.txt 2014-09-14 22:45:37 +02:00
Bertrand Songis 1c721b3817 Update DONATIONS.txt 2014-09-14 17:51:22 +02:00
bsongis 67d97046bb Fixes #1656 - Throttle Source everywhere (english and french) 2014-09-14 14:56:12 +02:00
bsongis 19d9e6ab19 No THR warning when a new model is created / the wizard is called 2014-09-14 14:46:59 +02:00
bsongis 5d9883d47f Added NANO option in Makefile (default: NANO=NO) 2014-09-14 14:46:59 +02:00
bsongis bb5f1d7d79 Fixes #1715 2014-09-14 14:46:59 +02:00
bsongis 30087b4a3a This luaFree is not needed and could do a mess in RAM 2014-09-14 14:46:59 +02:00
Bertrand Songis 61aa01b9b3 Update DONATIONS.txt 2014-09-14 14:44:29 +02:00
mhotar 16e06cff70 CZ translations - Companion 2014-09-14 02:19:42 +02:00
mhotar 2073a1f033 CZ translations - Radio 2014-09-14 01:17:52 +02:00
bsongis 563b817b46 Fixes #1656 2014-09-13 18:15:28 +02:00
bsongis 8b540a66f6 Companion compilation failure (missing files) 2014-09-13 15:50:24 +02:00
bsongis b0b7657756 Version and release notes updated 2014-09-13 15:45:08 +02:00
bsongis 74d22b623f LTR patch (modified) applied. Saves around 8-10k RAM during the
interpreter initialization
2014-09-13 15:41:52 +02:00
bsongis bee01d9999 Tests added to avoid doing anything in the Lua interpreter after a Lua
Panic
2014-09-13 13:11:05 +02:00
Bertrand Songis d2055edf62 Merge pull request #1712 from opentx/mhotar/CZ_chars_in_Inputs
No special characters in edit fields for CZ language, but enabled in int...
2014-09-13 09:11:13 +02:00
mhotar c926ac557b No special characters in edit fields for CZ language, but enabled in internally defined strings.
It fixes autogenerated Input names.
2014-09-13 01:26:49 +02:00
bsongis 3e2092e32f Revert some last changes so that there is no problem with Lua 2014-09-13 01:03:24 +02:00
bsongis 21054ffc54 Fixes #1675 2014-09-12 12:36:48 +02:00
Bertrand Songis 350ece0b60 Update DONATIONS.txt 2014-09-12 10:24:34 +02:00
bsongis 01a103f2e6 Mega2560 target didn't compile 2014-09-12 07:47:06 +02:00
Bertrand Songis 2e8e439d27 Update DONATIONS.txt 2014-09-11 15:47:25 +02:00
Bertrand Songis 98e6a3dc21 Update DONATIONS.txt 2014-09-11 13:25:47 +02:00
Andre Bernet 3b324d076a Release notes updated 2014-09-10 20:41:00 +02:00
Andre Bernet 91c922d5fb Wording / French translations 2014-09-10 20:27:43 +02:00
Andre Bernet eac918c2da SG switch warning was unreachable on Taranis 2014-09-10 20:13:26 +02:00
Andre Bernet b5f9c0ec84 On Taranis S3 was only hidden when the cursor was in the pot positions line 2014-09-10 20:05:50 +02:00
bsongis d1f54b099b Compilation failure 2014-09-10 20:04:41 +02:00
bsongis 7b98ad55c0 #1692 - We flush the queue instead of stopping the audio (the TADA sound
is cut otherwise)
2014-09-10 19:56:46 +02:00
bsongis d2cb7cb3dd Fixes #1697 2014-09-10 19:28:55 +02:00
bsongis be190b8bb1 Support for Lua dump files removed 2014-09-10 16:19:34 +02:00
bsongis 4b2c02b2c5 The Lua Wizard was broken in 2.0.11 2014-09-10 15:35:06 +02:00
bsongis 142d3fee1a Small alignment problem in protocols on 9X/9XR 2014-09-10 12:12:16 +02:00
bsongis 6a5e938ead Fixes #1692 2014-09-10 12:11:53 +02:00
bsongis 2d9ae108ff Fixes #1566 2014-09-10 12:07:14 +02:00
bsongis bae84e4e8c Navigation bug in protocol selection (9X/9XR only) 2014-09-10 11:51:39 +02:00
bsongis f4944eefdb Fixes the neutral value for PXX as described in #1694 2014-09-10 11:51:00 +02:00
bsongis 5d598cc6a1 Version and release notes updated 2014-09-10 11:32:36 +02:00
bsongis 945808d69b Fixes #1695 2014-09-10 11:32:36 +02:00
Bertrand Songis dbe512e45a Update DONATIONS.txt 2014-09-10 10:58:32 +02:00
bsongis 11efb5121e Fixes #1690 2014-09-10 08:16:57 +02:00
Bertrand Songis f6274f38aa Update DONATIONS.txt 2014-09-09 21:58:17 +02:00
Bertrand Songis cd1f20b8a0 Update DONATIONS.txt 2014-09-09 10:41:57 +02:00
Bertrand Songis e61b931ddb Update DONATIONS.txt 2014-09-09 07:13:13 +02:00
Andre Bernet a7a9b61234 Typo in release notes 2014-09-08 23:01:04 +02:00
bsongis 5ee95673d1 Release notes updated 2014-09-08 22:25:10 +02:00
bsongis 98c5b5e7bd Little display bug in DEBUG page 2014-09-08 22:25:10 +02:00
Bertrand Songis 6d434c0bf9 Update DONATIONS.txt 2014-09-07 21:52:42 +02:00
Bertrand Songis ade7151796 Update DONATIONS.txt 2014-09-07 20:35:50 +02:00
Bertrand Songis a7cd1f9aa0 Update DONATIONS.txt 2014-09-07 11:24:59 +02:00
bsongis cb2c922542 DONATIONS.txt updated 2014-09-05 17:58:40 +02:00
bsongis 8159a559da Release notes updated 2014-09-05 17:20:24 +02:00
bsongis ed826d8c62 [Sky9x] Linker error (no newlib-nano needed, no _sbrk) 2014-09-05 17:17:43 +02:00
bsongis b57f5ab2ce Added DEBUG information (thanks again projectkk2glider!) 2014-09-05 17:03:01 +02:00
bsongis 8fbafa6f05 Fixes #1643 - Thanks to projectkk2glider for his help on this one 2014-09-05 16:23:55 +02:00
Damjan Adamic 9243a59426 Removed lua_fields.txt 2014-09-03 23:33:59 +02:00
Damjan Adamic ccf66831c7 Fixes #1666: fixed bootloader 2014-09-03 23:32:03 +02:00
Damjan Adamic 06792b5696 Fixes #1666: Missing constructor calls for static objects 2014-09-03 23:03:25 +02:00
bsongis 6d4d871849 Various Lua fixes (thanks projectkk2glider!) 2014-09-02 20:53:19 +02:00
bsongis 5a634a7991 Fixes #1656 2014-09-01 09:43:02 +02:00
bsongis 69e504212e Copy/Paste error on second serial port Rx 2014-08-31 22:45:36 +02:00
bsongis 03e049c360 Fixes #1658 2014-08-29 23:05:24 +02:00
bsongis 4ca893da1f Fixes #1655 2014-08-29 15:54:28 +02:00
bsongis 66670cf713 Fixes #1646 2014-08-29 11:53:20 +02:00
bsongis 271bb4a82e Version and release notes updated 2014-08-29 11:46:20 +02:00
bsongis e0eab648ef Fixes #1651 2014-08-28 21:54:33 +02:00
bsongis 3235f43db9 Companion part for #1646
Conflicts:
	companion/src/modeledit/logicalswitches.cpp
2014-08-28 16:42:31 +02:00
bsongis c12b0cfebe Fixes #1650 2014-08-28 15:26:08 +02:00
bsongis 3e590d44f0 Fixes #1646 2014-08-28 15:16:20 +02:00
bsongis 1f6d1799af Fixes #1643 - no more freeze but now I have to understand why we go over
4k there
2014-08-27 23:44:07 +02:00
bsongis 8c813a87c9 Fixes #1635 2014-08-27 23:14:59 +02:00
bsongis 5bdeedbd0e [9X] Display problem of the battery range 2014-08-27 20:44:38 +02:00
bsongis e33f4cf415 Compilation error 2014-08-27 20:44:22 +02:00
bsongis 61d745011a [9XR-PRO] Telemetry fix 2014-08-27 20:44:11 +02:00
bsongis 3e269a04ae lua_fields.txt removed from git as it is automatically generated 2014-08-27 12:25:43 +02:00
bsongis 341feaf78f Fixes #1621 2014-08-27 10:21:55 +02:00
bsongis 19ddf6fc23 [Companion] Servos limits are displayed in us if ppmus option selected 2014-08-26 16:55:58 +02:00
bsongis 9b4b0d3c83 Fixes #1596 2014-08-26 09:01:19 +02:00
bsongis dc1eebf40d RSSI initialization added in google tests 2014-08-25 11:51:15 +02:00
bsongis 752e13b9ab Fixes #1617 2014-08-25 11:39:34 +02:00
bsongis b988bec5bd Fixes #1636 2014-08-25 11:27:46 +02:00
Damjan Adamic 3c72afed20 Fixes #1622: Lua function script not called for SF >= 8 2014-08-25 11:11:06 +02:00
Damjan Adamic e7586f47c3 Re #1547: commit 5949be30fa disabled delay for STICKY (which was wrong) now disabled for EDGE 2014-08-25 10:45:40 +02:00
Bertrand Songis f126b149f0 Merge pull request #1642 from opentx/1641_rx_number_with_DSM
Receiver number wasn't showing up for DSM (Fix #1641)
2014-08-24 23:45:50 +02:00
Andre Bernet 6b15c0c985 Receiver number wasn't showing up for DSM (Fix #1641) 2014-08-24 10:29:36 +02:00
Damjan Adamic db85f39ebc Added generation of Lua fields documentation file: lua_fields.txt 2014-08-21 10:07:39 +02:00
bsongis dee1e4ce8d Fixes #1612 2014-08-16 11:17:45 +02:00
bsongis df96504a85 SWR hidden on Taranis+ 2014-08-15 17:20:35 +02:00
Kjell Kernen 0112a1e3e9 Changed description of the master branch. The text from the next branch had ended up here. 2014-08-14 10:44:04 +02:00
bsongis 36481471a3 Fixes #1595 2014-08-13 11:37:03 +02:00
Bertrand Songis dd08886f2c Update DONATIONS.txt 2014-08-10 19:20:33 +02:00
Bertrand Songis 76ef4b5948 Update DONATIONS.txt 2014-08-10 19:19:41 +02:00
Bertrand Songis eaa247f46d Update DONATIONS.txt 2014-08-08 22:44:53 +02:00
bsongis 3ada9f7cf5 Companion PrintDialog bugfixes 2014-08-08 18:08:42 +02:00
bsongis 10a5e4dc89 Fixes #1527 2014-08-08 17:05:12 +02:00
bsongis 50e4850745 Fixes #1580 2014-08-08 16:29:13 +02:00
bsongis a92de216ac Fixes #1585 2014-08-08 11:48:03 +02:00
bsongis 3f3708f0f1 Fixes #1546
// TODO check if the vario / background music are stopped correctly if
switching to a model which doesn't have these functions enabled
2014-08-08 11:19:04 +02:00
Bertrand Songis 72c433ce9d Update DONATIONS.txt 2014-08-06 20:58:31 +02:00
Damjan Adamic f123b69521 Fixes #1548: bad Swedish Cell translation 2014-08-05 20:35:16 +02:00
Bertrand Songis 80369f0e8f Update DONATIONS.txt 2014-08-05 10:56:27 +02:00
Kjell Kernen 8cd67bf31e Swedish OpenTX translation updated 2014-08-05 10:38:24 +02:00
Kjell Kernen 34ef060e16 Swedish Companion translation updated 2014-08-05 10:24:09 +02:00
Bertrand Songis 1f07f88dce Update DONATIONS.txt 2014-08-04 14:32:05 +02:00
Bertrand Songis 4db5bdd486 Update DONATIONS.txt 2014-08-04 12:03:46 +02:00
bsongis 05ac0682f0 Fixes #1583 2014-08-04 12:02:50 +02:00
bsongis f12c3072b5 Fixes #1579 2014-08-04 11:54:35 +02:00
bsongis 35aea83c89 Fixes #1582 2014-08-04 11:38:39 +02:00
bsongis cf9b5d05a8 Fixes #1568 2014-08-04 11:29:35 +02:00
bsongis d5393be5cb Fixes #1584 2014-08-04 11:20:07 +02:00
Bertrand Songis 10c9936fa0 Merge pull request #1586 from opentx/projectkk2glider/issue_1567
Projectkk2glider/issue 1567
2014-08-04 11:08:00 +02:00
Bertrand Songis 7a74d3ac85 Update DONATIONS.txt 2014-08-04 10:57:23 +02:00
bsongis 39edaff669 Problems with S3 on Taranis (not plus) 2014-08-04 10:19:31 +02:00
bsongis c5aed5f79b Companion MAC compilation fix 2014-08-04 10:01:32 +02:00
bsongis 9b07a77e14 #1566 Companion conversion issue when importing Logical Switches with a
stick as v1 or v2 in previous EEPROM
2014-08-04 10:01:32 +02:00
Bertrand Songis 380fe5e44d Update DONATIONS.txt 2014-08-04 09:58:11 +02:00
Damjan Adamic 8bd2c120d6 Re #1567: cleanup 2014-08-03 19:27:02 +02:00
Damjan Adamic 741ef45f3e Re #1567:
introduced generateProcessUniqueTempFileName() which is used everywhere we need temporary file
renamed unlink() into qunlink()
fixed missing deletion of curve pngs in print dialog
2014-08-03 19:21:46 +02:00
Damjan Adamic 4103adf75d Re #1567: introduced unlink() function that takes QString parameter 2014-08-03 18:03:13 +02:00
Damjan Adamic c0e612531d Re #1567: writeBackup(): added PID to temporary file name 2014-08-03 17:38:24 +02:00
Damjan Adamic 55cb5dce87 Re #1567: readEeprom():
* added PID to temporary file name
 * better error message
 * temporary file deletion
2014-08-03 17:38:24 +02:00
Bertrand Songis 12ba27247e Update DONATIONS.txt 2014-08-02 09:41:10 +02:00
Bertrand Songis 1e33e99655 Update DONATIONS.txt 2014-08-01 07:43:31 +02:00
Damjan Adamic 50acd1fd92 Expanded non regression tests for #1569 2014-07-31 20:23:11 +02:00
bsongis c3626225aa Non regression tests for #1569 2014-07-31 17:24:10 +02:00
Bertrand Songis b71a96ed55 Update DONATIONS.txt 2014-07-31 16:43:23 +02:00
Bertrand Songis d2fcd544d8 Merge pull request #1576 from opentx/projectkk2glider/dirty_hack_issue_1569
Projectkk2glider/dirty hack issue 1569
2014-07-31 16:06:55 +02:00
Damjan Adamic 50997721e2 Using anas instead for getValue 2014-07-31 15:57:50 +02:00
Damjan Adamic 828372ab29 Fix for the case of extended trims
Code cleanup
2014-07-31 15:47:32 +02:00
Damjan Adamic 21ae270c0e Fixes #1569 2014-07-31 15:08:37 +02:00
bsongis 1b2efd1121 Fixes #1572 2014-07-31 11:26:05 +02:00
bsongis 8d6a7c9495 Simu name fixed 2014-07-31 11:22:41 +02:00
bsongis 189becfbb2 Fixes #1569 2014-07-31 11:22:18 +02:00
Bertrand Songis 5a19e147fd Update DONATIONS.txt 2014-07-30 07:45:00 +02:00
Bertrand Songis 062f93ae38 Update DONATIONS.txt 2014-07-28 23:41:37 +02:00
bsongis 9861a08150 Fixes #1562 2014-07-28 21:02:42 +02:00
Bertrand Songis de15d0a5a4 Update DONATIONS.txt 2014-07-28 18:54:56 +02:00
Andre Bernet 1e77bb3c02 French translations 2014-07-27 18:40:16 +02:00
bsongis adadbe06ad Fixes #1559 2014-07-27 17:37:39 +02:00
Andre Bernet 92f2c48de9 French translation fix 2014-07-27 17:31:06 +02:00
Bertrand Songis 1d4fa2a8b0 Update DONATIONS.txt 2014-07-26 22:27:25 +02:00
Bertrand Songis 5493776b9c Update DONATIONS.txt 2014-07-26 19:48:32 +02:00
bsongis b166b77c3e New french TTS prompts 2014-07-26 19:47:40 +02:00
Bertrand Songis 0ecb978364 Update DONATIONS.txt 2014-07-26 19:14:46 +02:00
Bertrand Songis c8d792d3d8 Merge pull request #1556 from opentx/driver33/PL_TR
TR fixes
2014-07-26 12:24:22 +02:00
Jacek Drewniak e9663e40e2 TR fixes 2014-07-26 11:51:23 +02:00
bsongis a7e906dea9 All other Off are uppercase! 2014-07-25 23:30:19 +02:00
Bertrand Songis 685ab3d101 Update DONATIONS.txt 2014-07-25 22:25:49 +02:00
Bertrand Songis 77564d74a4 Merge pull request #1554 from opentx/MicheleVilla/IT_translation_FW
Update it.h.txt
2014-07-25 19:38:14 +02:00
Bertrand Songis a0142d65be Update DONATIONS.txt 2014-07-25 19:29:08 +02:00
bsongis 662bf15562 Fixes #1555 2014-07-25 19:28:08 +02:00
Bertrand Songis 79b928af56 Update DONATIONS.txt 2014-07-25 17:10:32 +02:00
Bertrand Songis 8c28f4bc48 Update DONATIONS.txt 2014-07-25 15:06:16 +02:00
bsongis 7a4d6c89a1 2.0.9 preparation 2014-07-25 12:05:34 +02:00
bsongis 38347becca Cosmetics 2014-07-25 12:05:34 +02:00
Michele 49036dbb40 Update it.h.txt
One change in Italian translation
2014-07-25 11:58:05 +02:00
Bertrand Songis abf36de157 Update DONATIONS.txt 2014-07-25 08:41:56 +02:00
bsongis 32afbf5a5a Fixes #1552 2014-07-25 08:39:41 +02:00
bsongis cba4a02cc1 Fixes #1551 2014-07-25 07:31:58 +02:00
bsongis 4062555605 FAI option tooltip updated (too many users select it without knowing
what it means)
2014-07-24 21:02:15 +02:00
bsongis 9cb38ce839 Companion default firmware is now OpenTX for Taranis 2014-07-24 20:51:31 +02:00
Bertrand Songis 905090ef09 Update DONATIONS.txt 2014-07-24 14:44:59 +02:00
Bertrand Songis 62e5820082 Update DONATIONS.txt 2014-07-24 12:07:18 +02:00
bsongis 2d21e16201 In Companion Wizard, Delta Wing has now 50% weight on elevons (as in
OpenTX Wizard)
2014-07-23 19:19:10 +02:00
bsongis 07303f4301 Taranis calibration better fix 2014-07-23 18:23:24 +02:00
bsongis 91228f803c snprintf undefined on VC++ 2014-07-23 18:02:46 +02:00
bsongis e5d7e1f7c2 Taranis calibration bug 2014-07-23 17:55:02 +02:00
bsongis 81573537eb Fixes #1549 2014-07-23 17:09:55 +02:00
bsongis 7a85328b86 #1549 (Firmware part) 2014-07-23 17:05:14 +02:00
bsongis fd84c62ff4 Dead code removed 2014-07-23 16:31:20 +02:00
bsongis 13e0b21656 The firmware should compile correctly on Windows now 2014-07-23 15:55:27 +02:00
bsongis 5949be30fa Fixes #1547 2014-07-23 15:46:51 +02:00
bsongis 0117c2da68 Fixes #1259 2014-07-23 15:15:26 +02:00
bsongis 943f70c599 OpenTX 2.0.8 preparation 2014-07-22 17:27:33 +02:00
Bertrand Songis 52a48fc4b1 Update DONATIONS.txt 2014-07-22 17:04:17 +02:00
Damjan Adamic 2712ffabb0 Re #1486: gtest improvements in Lua section 2014-07-22 11:39:36 +02:00
Bertrand Songis fa8c8a7094 Update DONATIONS.txt 2014-07-22 07:44:49 +02:00
bsongis 5907193571 Fixes #1543 2014-07-21 23:21:35 +02:00
bsongis 45abfb872f Fixes #1486 2014-07-21 22:25:55 +02:00
bsongis 4d5962b15b Fixes #1533 2014-07-21 20:41:57 +02:00
bsongis eea1c3a84c SAFETY renamed to OVERRIDE 2014-07-21 20:38:44 +02:00
bsongis deed7fc20f Curve index is correctly resetted when its type is changed 2014-07-21 20:23:56 +02:00
bsongis 62fca3f8b6 Fixes #1534 2014-07-21 20:09:39 +02:00
bsongis 9377e58407 Change Lua field name from vario-speed to vertical-speed 2014-07-21 19:22:40 +02:00
bsongis 9b53f69038 Fixes #1535 2014-07-21 19:15:24 +02:00
Bertrand Songis 3680149b52 Merge pull request #1529 from opentx/projectkk2glider/lua_constants_issue_1480
Projectkk2glider/lua constants issue 1480
2014-07-21 19:12:06 +02:00
Bertrand Songis 93faeeafbe Update DONATIONS.txt 2014-07-21 18:34:39 +02:00
Damjan Adamic 2d5d1cb357 Re #1480: couple corrections of field names 2014-07-21 12:04:08 +02:00
Damjan Adamic 2a5364dc8c Re #1480: wrong field.id for multiple fields 2014-07-21 11:51:30 +02:00
bsongis 7f47a4fe10 Fixes #1542 2014-07-20 18:51:24 +02:00
Bertrand Songis a0cc428228 Update DONATIONS.txt 2014-07-19 13:15:16 +02:00
Andre Bernet 61985f7d6a All companion translation files updated 2014-07-19 12:26:49 +02:00
Andre Bernet 3baf64f123 French translations 2014-07-19 12:26:10 +02:00
Andre Bernet 4fd40c154e Rename of "SafetyCH" to "OverrideCH" was not done in companion - UPDATE SERVER SCRIPT! 2014-07-19 12:22:32 +02:00
Andre Bernet 3c360618b9 nosafetych option was duplicated for 9x 2014-07-19 12:19:07 +02:00
Andre Bernet 1d96731ad5 Typo 2014-07-19 12:09:34 +02:00
Andre Bernet 9d1d31d26a lupdate-qt4 is just lupdate on Win 2014-07-19 12:09:04 +02:00
Bertrand Songis 0b52ccfaf1 Update DONATIONS.txt 2014-07-19 07:41:55 +02:00
bsongis 484566083e A little refactoring to avoid all the sprintf and too many string
comparaisons. Completely untested
2014-07-18 22:13:02 +02:00
Bertrand Songis 0f33dc6113 Update DONATIONS.txt 2014-07-18 18:49:59 +02:00
Damjan Adamic 7f3778fc3c Re #1480: units updated 2014-07-18 10:41:16 +02:00
Damjan Adamic 0a9dcc5ce6 Re #1480: added TELEM_MAX_ASPEED conversion in luaGetValueAndPush() 2014-07-18 10:41:16 +02:00
Damjan Adamic 2f01f139cc Re #1480: Cosmetics 2014-07-18 09:07:36 +02:00
Damjan Adamic fb3e615008 Fixes #1480: How to handle the increasing number of Lua constants 2014-07-18 08:59:38 +02:00
Bertrand Songis ce6d0807fa Update DONATIONS.txt 2014-07-17 23:14:29 +02:00
Bertrand Songis cab8f3db71 Update DONATIONS.txt 2014-07-17 08:53:18 +02:00
bsongis 399a8b2e35 Fixes #1517 2014-07-16 20:27:05 +02:00
bsongis 3d4a791940 Timers display bug on main view 2014-07-16 19:27:08 +02:00
bsongis 7373ce2cae Better fix for model backups import 2014-07-16 19:07:09 +02:00
Bertrand Songis 5da1e35efe Update DONATIONS.txt 2014-07-16 14:54:42 +02:00
bsongis fe5b7bee8c Fixes #1516 2014-07-16 14:53:36 +02:00
bsongis 2da1134796 Quick & dirty fix to allow open of backup models from Taranis 2014-07-16 14:52:46 +02:00
Damjan Adamic 83e47d9e35 Typo in german translation for "Änderungen" 2014-07-16 10:37:20 +02:00
Damjan Adamic f0c76efaf7 Re #1506 - FAS offest was limited to +-1.5A in Companion, now +-12A (same as radio) 2014-07-16 09:30:44 +02:00
Bertrand Songis 2fe7d856c3 Update DONATIONS.txt 2014-07-16 08:16:13 +02:00
bsongis a7c1f22b36 Missing reference screenshot for 128x64 Smlsize test 2014-07-15 23:47:20 +02:00
bsongis d92620919b SMLSIZE last row missing 2014-07-15 23:14:02 +02:00
Bertrand Songis 94bb21886b Update DONATIONS.txt 2014-07-15 23:13:17 +02:00
bsongis 5db98a3fef SMLSIZE last row missing 2014-07-15 23:03:48 +02:00
Bertrand Songis 763c7fbb7d Update DONATIONS.txt 2014-07-15 22:11:05 +02:00
bsongis b2d1a4ed22 Fixes #1506 - There was an EEPROM shift in vario settings ... 2014-07-15 16:04:26 +02:00
bsongis e7211065ab Function duplicated 2014-07-15 16:04:26 +02:00
bsongis 68b8b0e38f make clean didn't remove lbm files on Windows (because find doesn't work
correctly)
2014-07-15 16:04:26 +02:00
bsongis 644c833311 Inverted DBLSIZE was one row too big on Taranis 2014-07-15 16:04:26 +02:00
bsongis 30b1f62e99 Fonts improvement on 9XR-PRO / Sky9x 2014-07-15 16:04:26 +02:00
Bertrand Songis 03aa787c8e Update DONATIONS.txt 2014-07-15 14:01:51 +02:00
bsongis 79592d3b00 Fixes #1506 2014-07-15 13:27:05 +02:00
Bertrand Songis 7ed527a328 Update DONATIONS.txt 2014-07-15 13:15:09 +02:00
bsongis 3e0766f2bf Missing sticks reset in google tests (stick position reused in next
tests)
2014-07-15 09:19:22 +02:00
bsongis 71e7926045 Release notes updated #1508 2014-07-15 08:51:18 +02:00
bsongis 8c3d47deac Instant Trim automatic tests - Issue #1508 2014-07-15 08:49:55 +02:00
bsongis 197f31d5a1 Fixes #1508 - Needs another non regression test 2014-07-14 23:41:37 +02:00
Bertrand Songis 1a198c35ad Update DONATIONS.txt 2014-07-14 22:31:15 +02:00
Bertrand Songis 2934fc4d23 Merge pull request #1513 from opentx/projectkk2glider/issue_1510
Re #1510 - This might be a better warning message
2014-07-14 21:26:09 +02:00
Damjan Adamic 4ae9585080 Re #1510 - Added switches warning, better protocol warnings and limited display to max 10 warnings 2014-07-14 20:11:21 +02:00
Damjan Adamic 161016a02a Bad string "Write Backup from file to to Radio" fixed 2014-07-14 19:16:53 +02:00
Damjan Adamic 559bb83864 Re #1510 - This might be a better warning message 2014-07-14 19:13:39 +02:00
bsongis 9a37c3027e Release notes updated 2014-07-14 18:32:17 +02:00
bsongis 6548afcad3 Fixes #1510 - The warning is not very explicit, but at least it is there
...
2014-07-14 18:26:36 +02:00
bsongis ee31c51275 9XR-PRO / Sky9x compilation failure when BOLD=NO 2014-07-14 17:50:01 +02:00
bsongis 63aadad10c Preparation for 2.0.7 2014-07-14 08:11:02 +02:00
bsongis 30958a9a65 I forgot to include this in Companion. Should be ok in the Tx though 2014-07-14 01:42:42 +02:00
bsongis 995183bf22 Compilation error when no gauges 2014-07-14 01:06:54 +02:00
Bertrand Songis 99fedb081e Update DONATIONS.txt 2014-07-13 20:24:07 +02:00
Damjan Adamic cc934c3ac0 Gtest updated according to 28c900e3f7 hack 2014-07-13 15:44:00 +02:00
Damjan Adamic c1d789d004 Fixes #1494 2014-07-13 15:41:18 +02:00
Andre Bernet 4d945b5d95 DSM2=SERIAL was broken if EXT!=FRSKY (fix #1498) 2014-07-13 15:26:14 +02:00
Andre Bernet 28c900e3f7 Dirty hack to filter out bogus cell values from FLVSS... 2014-07-13 14:48:12 +02:00
Damjan Adamic b41ba50b53 Removed raw member that was introduced in commit 3f39352d95. Its role now plays last member of values[] array. Same RAM usage, reduced FLASH usage. 2014-07-13 14:44:42 +02:00
Damjan Adamic 2d22c18758 Added RAW_FRSKY_MINMAX() macro for access to the raw telemetry value and gtests for it 2014-07-13 14:35:15 +02:00
Damjan Adamic 8ce05b3284 Data from tow FLVSS sensors and parsing program for sport.log 2014-07-13 12:18:40 +02:00
bsongis 6d18820b53 Added a new test with real logs from FLVSS. It seems there is a bug on
the FLVSS :(
2014-07-11 23:53:36 +02:00
Bertrand Songis 58ed329ac2 Update DONATIONS.txt 2014-07-11 14:23:12 +02:00
bsongis 2e0858bc0c Whole Cells telemetry info not updated after Telemetry Reset 2014-07-11 12:22:54 +02:00
bsongis 7c9636c58c I try this for #1444, if needed we will revert 2014-07-11 11:40:42 +02:00
Bertrand Songis 9dbd1326da Update DONATIONS.txt 2014-07-11 10:29:24 +02:00
Damjan Adamic 4c82d12c1a Re #1481 - added gtests for SPort FAS sensor 2014-07-10 11:32:04 +02:00
Bertrand Songis 972685bc15 Merge pull request #1477 from opentx/projectkk2glider/cells_gtests
Tests and support for second FLVSS
2014-07-10 09:56:11 +02:00
bsongis 00f8b97ee4 Fixes #1478 2014-07-10 09:32:10 +02:00
bsongis 0b7bbbbdbd Fixes #1475 2014-07-10 09:04:33 +02:00
bsongis 47bc3e896c Fixes #1481 2014-07-10 08:08:33 +02:00
bsongis 904249b2dc Fixes #1478 2014-07-10 08:06:48 +02:00
Damjan Adamic 3700047d2c Re #1409 and #1444:
* added support for two FLVSS
* added gtests for FLVSS
2014-07-09 14:18:39 +02:00
Romolo Manfredini d44e851648 Fix problems with libpng 2014-07-09 13:04:51 +02:00
bsongis 1be75735be Fixes #1476 2014-07-09 09:53:04 +02:00
Bertrand Songis 7da72240a3 Update DONATIONS.txt 2014-07-09 00:17:18 +02:00
bsongis 9357c951f1 Fixes #1474 - I am not happy with this fix, but I don't want to modify
the font right now
2014-07-08 22:05:56 +02:00
Bertrand Songis 1afeb9f977 Merge pull request #1473 from opentx/MicheleVilla/FW_Translation
Update it.h.txt
2014-07-08 19:19:35 +02:00
Michele 000e55725c Update it.h.txt 2014-07-08 18:39:53 +02:00
bsongis 38e342b27b Cosmetics in the voltages screen. Cells, Cells-, Cell, Cell- tested, it
works.
2014-07-08 13:16:37 +02:00
bsongis 3e9064e2e2 2.0.6 preparation 2014-07-08 12:03:48 +02:00
bsongis 2d764e73fd Cosmetics 2014-07-08 11:39:27 +02:00
bsongis f8efcf420a 200 extra bytes used on 9x with FRSKY_HUB option. I return to previous
implementation. Only ARM boards will have the extra features.
2014-07-08 11:38:47 +02:00
bsongis cf546a2341 Refactoring FLVSS - only one sensor for now 2014-07-08 11:02:00 +02:00
Bertrand Songis 87a4f3526b Merge pull request #1465 from opentx/projectkk2glider/reimplementation_of_1443
Projectkk2glider/reimplementation of 1443
2014-07-08 08:26:32 +02:00
bsongis 6b49119af7 getValue(...) Lua identifiers more consistent 2014-07-08 08:04:05 +02:00
bsongis 4c6314331d The compilation server complains with pl language ... 2014-07-07 23:10:26 +02:00
Bertrand Songis 55ab067a0c Merge pull request #1468 from opentx/projectkk2glider/issue_1457
Projectkk2glider/issue 1457
2014-07-07 22:58:42 +02:00
bsongis 3fc18b1cf7 Fixes #1467 - Check your mixes on Sky9x / 9XR-PRO especially if you used
mix warnings!
2014-07-07 22:55:52 +02:00
bsongis f2f8419da1 I forgot to remove the persistent toggled handler 2014-07-07 21:45:51 +02:00
Damjan Adamic 365c2f9e34 Re #1457 - cleanup 2014-07-07 21:38:55 +02:00
bsongis 01fde3db27 Some TODOs removed 2014-07-07 20:56:40 +02:00
Damjan Adamic d743ed9645 Forgoten makefile for split gtests 2014-07-07 19:54:55 +02:00
Damjan Adamic dd67811638 Cosmetics 2014-07-07 19:49:18 +02:00
Damjan Adamic ebe4f6a365 Gtests split into several source files 2014-07-07 19:23:43 +02:00
Damjan Adamic b4e816b784 Re #1443 - Reverting back d675ab1578 with some improvements:
* when telemetry is not streaming all logical switches that involve telemetry value evaluate to FALSE (same as before the change in above commit)
* the duration and delay processing is now enabled for such logical switches (new functionality that was not present before above commit)
2014-07-07 19:18:18 +02:00
bsongis 2798fa7ba9 Fixes #1451 2014-07-07 18:03:48 +02:00
Damjan Adamic ee077a06e6 Re #1464 - added test: "L1 Vfas < 9.6 Delay (0.5s)" 2014-07-07 15:48:46 +02:00
Romolo Manfredini 8f73e9bde0 Fix warnings with libpng 2014-07-07 12:57:33 +02:00
Romolo Manfredini 45d8fca125 Merge origin/next into next 2014-07-07 12:38:13 +02:00
Romolo Manfredini 2bc6c1e754 Fix warnings with libpng 2014-07-07 12:37:10 +02:00
bsongis 39a0feae3b Fixes #1463 2014-07-07 12:19:28 +02:00
bsongis ad7da779c7 Curves in Mixes were not correctly restored on Companion for Sky9x
boards
2014-07-07 07:21:12 +02:00
bsongis 23cafa84f2 Fixes #1392 2014-07-06 23:37:13 +02:00
Damjan Adamic a20e5aee3b Re #1457 - added display of channels 17-32 to Companion simulator 2014-07-06 19:50:42 +02:00
bsongis fa3c50df8e Fixes #1458 2014-07-06 18:58:34 +02:00
bsongis 81eb9326eb Fixes #1461 2014-07-06 18:40:02 +02:00
bsongis 7c71d56383 Fixes #1451 2014-07-06 17:46:16 +02:00
Bertrand Songis 5109a2d7c1 Merge pull request #1460 from opentx/projectkk2glider/issue_1458
Fixes #1458 - Incorrect display of free mem on statistics page
2014-07-06 13:23:08 +02:00
bsongis 82cc799afe Fixes #1458 - 64k was hardcoded 2014-07-06 13:09:33 +02:00
Damjan Adamic 88bb28e3f1 Re #1458 - added gtest for big numbers (>uint16_t) 2014-07-06 09:25:38 +02:00
Damjan Adamic f4fdc233c0 Re #1458 - Forgoten files for new gtest 2014-07-06 09:14:20 +02:00
Damjan Adamic 7130e48089 Re #1458 - the cast is back, but cast to different type depending on platform. Gtest modernized. 2014-07-06 09:11:29 +02:00
Damjan Adamic ed094f89e8 Fixes #1458 - Incorrect display of free mem on statistics page
lcd_outdezNAtt() on ARM was casting values to uint16_t.
2014-07-06 08:49:35 +02:00
bsongis 58f81b193b PPM polarity was inverted in Companion PrintDialog and CompareDialog 2014-07-05 23:17:57 +02:00
Damjan Adamic 50122d4ee1 Bad indentation 2014-07-05 19:43:31 +02:00
bsongis f66388c1d3 LCD asynchronous refresh prepared for Taranis+ 2014-07-05 19:32:00 +02:00
Bertrand Songis 838190ce80 Merge pull request #1455 from opentx/projectkk2glider/issue_1440
Fixes #1440 - Logical switches state not reset after model load
2014-07-05 19:22:42 +02:00
Damjan Adamic 1bc04db9cd gtest only for Taranis (thanks Jenkins) 2014-07-05 19:20:56 +02:00
Damjan Adamic 30a68cf170 Fixes #1440 - Logical switches state not reset after model load:
* logical switches reset not called anymore when user selects "Reset Flight", but only after model load
* logical switches reset now includes a reset of switches state (set to false)
2014-07-05 19:11:16 +02:00
bsongis ec8c207631 Cosmetics 2014-07-05 19:07:32 +02:00
bsongis 9337080307 Hardware SPI used for the Taranis+ LCD. Thanks Mike! 2014-07-05 19:03:11 +02:00
bsongis 8200164797 LCD contrast was set before lcdInit on Taranis 2014-07-05 19:03:11 +02:00
Damjan Adamic 7d85d40f68 Fixes #1452 - Backlight simulation 2014-07-05 17:08:56 +02:00
bsongis 5d23135b0d DBLSIZE restrictions on 9x make the gtests fail 2014-07-05 15:46:26 +02:00
bsongis be6f1587ed Display problems on Sky9x 2014-07-05 15:37:49 +02:00
bsongis c184ddd996 Fixes #1447 - Needs tests 2014-07-05 11:32:22 +02:00
bsongis c903bbcb13 Issue #1428 - SafetyCH changed to OverrideCH on Taranis 2014-07-04 16:53:50 +02:00
Andre Bernet 9b008ded21 Merge pull request #1446 from opentx/bsongis/Taranis+_LCD_refactoring
Bsongis/taranis+ lcd refactoring
2014-07-04 15:33:35 +02:00
bsongis 6f79de6cae Fixes the grayscale inversion on Taranis (not Plus) 2014-07-04 15:20:36 +02:00
bsongis 711b54c98e Fixes #1436 - Be careful, there is a conversion on M128/gruvin9x boards,
L13, L14 and L15 are removed
2014-07-04 12:23:08 +02:00
bsongis 6876718d72 The top bar was a little bit too dark 2014-07-04 11:53:59 +02:00
bsongis 4ffb9f69c6 Taranis LCD functions refactoring 2014-07-04 11:53:29 +02:00
Bertrand Songis b8a6548686 Merge pull request #1442 from opentx/projectkk2glider/total_timer_fixes
Bug fix and refactoring of globalTimer
2014-07-04 11:23:00 +02:00
Damjan Adamic 8c010277c9 Renamed s_timeCumTot to sessionTimer 2014-07-04 11:09:30 +02:00
Bertrand Songis f30e3db1ef Merge pull request #1443 from opentx/projectkk2glider/telemetry_ls_duration_bug
Fixes a bug for case: telemetry values used in logical switches and they...
2014-07-04 10:19:15 +02:00
Damjan Adamic d675ab1578 Fixes a bug for case: telemetry values used in logical switches and they have a duration and/or delay set. 2014-07-03 20:50:31 +02:00
Damjan Adamic b6cbde48be Removed sessionTimer and replaced with existing s_timeCumTot.
Corrected bug when saving g_eeGeneral.globalTimer (missing reset of session timer and eeprom dirty)
2014-07-03 19:14:15 +02:00
Bertrand Songis 1fef79ce80 Update DONATIONS.txt 2014-07-03 14:07:56 +02:00
Bertrand Songis 4f03ae75c5 Merge pull request #1438 from opentx/driver13/PL_TR
translation fixes
2014-07-03 09:47:11 +02:00
Jacek Drewniak 34850fb73d translation fixes 2014-07-03 09:06:41 +02:00
Bertrand Songis ee05f7f80e Update DONATIONS.txt 2014-07-02 23:58:49 +02:00
bsongis 83614359aa Fixes #1434 2014-07-02 23:26:55 +02:00
bsongis 17a2865070 Fixes #1424 2014-07-02 21:50:25 +02:00
bsongis e3866fda45 Fixes #1395 2014-07-02 21:38:05 +02:00
bsongis 81ed325830 Fixes #1422 2014-07-02 17:49:15 +02:00
Bertrand Songis 36e78b9315 Merge pull request #1429 from opentx/projectkk2glider/frsky_refactoring
Projectkk2glider/frsky refactoring
2014-07-02 16:36:54 +02:00
bsongis 6716482ae4 Fixes #1428 2014-07-02 16:34:26 +02:00
Damjan Adamic 7e758ce7ad Wrong type corrected and cosmetic fixes 2014-07-02 16:08:31 +02:00
bsongis 63fe996ebc Fixes #1427 - M badly displayed when SMLSIZE font used 2014-07-02 15:28:34 +02:00
Damjan Adamic 038365e639 Introduced frskyCellVoltage_t type and united code with frskyUpdateCells() 2014-07-02 12:57:36 +02:00
bsongis c3aebfa239 Fixes #1425 2014-07-02 12:25:28 +02:00
Damjan Adamic e6370ebb2a United setting of cell voltage in frskySetCellVoltage() 2014-07-02 12:24:19 +02:00
bsongis 1e25e368d2 #1397 fix continued 2014-07-02 11:17:33 +02:00
Damjan Adamic 645350a1a2 Fixes #1397 - Refactored telemetry view page navigation, long PAGE key press now cycles in oposite direction 2014-07-02 11:17:33 +02:00
Bertrand Songis dd927e6761 Merge pull request #1423 from opentx/projectkk2glider/missing_minCell
Projectkk2glider/missing min cell
2014-07-02 09:50:57 +02:00
Damjan Adamic 713b2e2cf5 Added missing frskyData.hub.minCell update if using SPORT FLVS sensor 2014-07-02 09:41:25 +02:00
Damjan Adamic 7a02e57dcf Cells initialization in simulator 2014-07-02 09:40:30 +02:00
Bertrand Songis 724949b8fc Merge pull request #1417 from opentx/MicheleVilla/IT_TranslationFW
Update it.h.txt
2014-07-02 09:27:03 +02:00
bsongis 1f5295db9c Compilation problem (thanks Jenkins) 2014-07-01 23:08:54 +02:00
bsongis 72ef865c10 Prevents lines from wrapping when writing text 2014-07-01 22:53:28 +02:00
bsongis be0ebe833c Sleep a little bit more between read eeprom / flash / write eeprom on 9x
/ 9xr
2014-07-01 22:53:28 +02:00
bsongis 57b08fb064 Fixes #1362 2014-07-01 22:53:28 +02:00
bsongis 7162ab5399 Warning raised by Valgrind 2014-07-01 22:53:27 +02:00
Michele 4eb44837f3 Update it.h.txt
One change in Italian translation
2014-07-01 22:07:33 +02:00
Damjan Adamic 194a635800 Ups, forgot a bit of debugging code 2014-07-01 21:56:06 +02:00
Damjan Adamic e4314004a8 ACCURAT_THROTTLE_TIMER was lost when splitting code into mixers.cpp in 2fbd4ff13a 2014-07-01 21:53:56 +02:00
bsongis 74534b74c2 Fixes #1415 2014-07-01 19:02:34 +02:00
bsongis 59eb020eb1 getGeneralSettings(), lcd.getLastPos() and lcd.drawGauge() added 2014-07-01 18:06:37 +02:00
bsongis 1d1a815ef7 lcd.drawChannel(...) added. Possibility to write telemetry values using
different sizes
2014-07-01 17:36:39 +02:00
Bertrand Songis 4088abaafb Merge pull request #1413 from opentx/projectkk2glider/telemetry_enhancements
Unfiltered value used for writing into telemetry log
2014-07-01 16:01:03 +02:00
bsongis 9333f3778f The check on the BL size was wrong as it didn't take care of the
_bootStart() function size
2014-07-01 15:59:45 +02:00
Damjan Adamic 070a133cd5 Merge branch 'next-upstream' 2014-07-01 15:45:35 +02:00
Damjan Adamic 74f4f99280 Added regresion test for FrskyValueWithMin averaging algorithm 2014-07-01 15:40:12 +02:00
Damjan Adamic 66848156a8 Removed test code 2014-07-01 15:32:17 +02:00
bsongis 74dfd64e29 The background function is not anymore mandatory in Telemetry scripts 2014-07-01 14:45:39 +02:00
Bertrand Songis ef0b81cd2d Update DONATIONS.txt 2014-07-01 14:40:26 +02:00
bsongis 09842fe531 Telemetry "voltages" and "after flight" screens may be overriden by
telempw.lua and telemaf.lua
2014-07-01 12:10:17 +02:00
bsongis 3c93699f8f Ignore list updated 2014-07-01 11:39:44 +02:00
bsongis a9dd0d0dfb Taranis+ LCD driver a little bit improved 2014-07-01 11:39:01 +02:00
Bertrand Songis 013e6925dc Update DONATIONS.txt 2014-07-01 09:10:04 +02:00
bsongis 591ccfd25f Cosmetics 2014-07-01 08:06:22 +02:00
bsongis b0bdaf6b65 Warning removed 2014-07-01 08:06:22 +02:00
Bertrand Songis f77e6370cf Merge pull request #1412 from opentx/projectkk2glider/issue_1407
Fixes #1407 - Strange input interaction when Throttle trim idle only
2014-06-30 22:44:04 +02:00
Bertrand Songis ce70efa31d Update DONATIONS.txt 2014-06-30 22:31:39 +02:00
bsongis 3a7fe01950 Taranis+ LCD driver is now working! 2014-06-30 22:24:04 +02:00
Damjan Adamic 3f39352d95 Reduced the size of averaging buffer and introduced a raw (unfiltered) value. Averaged value is same as before, but one byte saved per class instance. Unfiltered value is used for writing into telemetry log. 2014-06-30 21:12:01 +02:00
Damjan Adamic d38c02f847 Fixes #1403 - "make clean PCB=TARANIS" deletes necessary source file 2014-06-30 17:58:05 +02:00
Bertrand Songis 2dddd76320 Fixes #1410 2014-06-30 17:57:28 +02:00
bsongis 391e6a867f It's easier to check gtests screenshots with the right filenames 2014-06-30 17:43:33 +02:00
bsongis 1df8b5f5c1 Fixes #1358 2014-06-30 17:43:33 +02:00
bsongis 6913c8e7e5 Cosmetics 2014-06-30 17:43:33 +02:00
bsongis aab03a2b9f BIGBIG font added 2014-06-30 17:43:33 +02:00
Damjan Adamic a83c6c8a0c Fixes #1408 - Move down in Inputs tab not working 2014-06-30 17:24:36 +02:00
Damjan Adamic b5cdd60367 Fixes #1407 - Strange input interaction when Throttle trim idle only 2014-06-30 17:03:59 +02:00
Bertrand Songis 5453ff5678 Update DONATIONS.txt 2014-06-30 17:00:09 +02:00
Bertrand Songis 7b69fb2f79 Update DONATIONS.txt 2014-06-30 16:12:46 +02:00
bsongis 19ac5d3038 New LCD tests added 2014-06-30 16:09:10 +02:00
bsongis 4b64862cf2 New automatic tests added for the LCD 2014-06-30 15:55:19 +02:00
bsongis f643f0be85 Mike's Taranis+ lcd driver 2014-06-30 12:08:01 +02:00
bsongis 0e0b1792e4 switchState function is not needed in the bootloader 2014-06-30 12:07:04 +02:00
bsongis f81c31510b Fixes #1385 2014-06-30 11:27:46 +02:00
bsongis 5c3bd1faf9 Fixes #1389 2014-06-30 11:17:16 +02:00
bsongis 90cf98465b No Telemetry tab in Companion when the firmware doesn't need it 2014-06-30 11:15:26 +02:00
bsongis 1dd47484d4 Stack alignment change doesn't compile on VC++ 2014-06-30 11:15:26 +02:00
Kjell Kernen bd4a85c6a7 Swedish Companion translation 2014-06-30 11:07:04 +02:00
Kjell Kernen b6520e2db6 Finnish Companion translation from Janne Huuskonen 2014-06-30 11:02:12 +02:00
Bertrand Songis 0ea114b219 Merge pull request #1400 from opentx/projectkk2glider/issue_1399
Fixes #1399 - Option to hide inv parameter effect in the channel monitor
2014-06-30 00:39:59 +02:00
Bertrand Songis e36f54eda5 Merge pull request #1401 from opentx/projectkk2glider/lua_stuff
Projectkk2glider/lua stuff
2014-06-30 00:26:41 +02:00
Bertrand Songis d983404656 Update DONATIONS.txt 2014-06-30 00:22:53 +02:00
Bertrand Songis 677b50d39c Update DONATIONS.txt 2014-06-30 00:21:48 +02:00
Damjan Adamic e5ae504bae Fixes #1394 - Taranis GPS Speed still 120km/h limited 2014-06-29 20:31:59 +02:00
Damjan Adamic ce302aae60 Fixes #1338 - Extend limits - Companion (scale bug) 2014-06-29 17:57:56 +02:00
Damjan Adamic b0869fccfc Re #1358 - defined PREC2 in Lua 2014-06-29 14:29:22 +02:00
Damjan Adamic 17ab12f7bf Added missing eeDirty(EE_MODEL) 2014-06-29 14:26:39 +02:00
Damjan Adamic 816f9ce8a0 Fixes #1388 -New Lua functions: model.getInfo() and model.setInfo() 2014-06-29 13:54:50 +02:00
Damjan Adamic 5fb41eb32f Fixes #1396 - Special functions, adjust GV1 Source CHxx not saved in .eepe file (on AVR platforms) 2014-06-29 13:08:28 +02:00
Damjan Adamic c687e20fff Fixes #1390 - hide switches !SHup, !SHdown, !SFup and !SFdown for Taranis 2014-06-29 12:43:34 +02:00
Damjan Adamic c5aa691467 Fixes #1399 - Option to hide inv parameter effect in the channel monitor 2014-06-29 12:00:29 +02:00
Andre Bernet a3d7c694ef Merge pull request #1391 from opentx/driver33/PL_TR
fixes
2014-06-27 23:58:19 +02:00
Jacek Drewniak 2c8b51c9d6 fixes 2014-06-27 23:27:43 +02:00
Andre Bernet a518a34055 String lengths corrected 2014-06-27 16:44:01 +02:00
Andre Bernet 4d3ca7e82e No DBLKEYS on 9XR-PRo 2014-06-27 16:41:30 +02:00
Andre Bernet 98c756a6d2 Remove orphan "tsticks" option 2014-06-27 16:37:11 +02:00
Andre Bernet 84d5c6c4b0 9XR-Pro in standalone simu 2014-06-27 16:28:27 +02:00
Damjan Adamic 935458caa4 No time on full EEPROM backup (reverted from commit e3b8e91a0a) 2014-06-27 08:48:53 +02:00
Bertrand Songis dcec97411e Update DONATIONS.txt 2014-06-27 07:11:16 +02:00
Andre Bernet 91032483c8 More stuff in release notes 2014-06-26 23:04:28 +02:00
Andre Bernet 9e40708f7c 2.0.5 preparation 2014-06-26 22:59:10 +02:00
Andre Bernet 54902a5a00 Lua telemetry screens had been shifted in d2df4af, and start screen still wasn't the intended one.
Now we've got lua first, custom second, then the voltage and end of flight default screens. Makes sense, so that the most potentially powerful type is first.
2014-06-26 18:54:27 +02:00
Andre Bernet 927a9b9f38 Merge pull request #1384 from opentx/MicheleVilla/IT_Translation_FW
Update it.h.txt
2014-06-26 15:58:16 +02:00
Michele bfdb3a9da7 Update it.h.txt
Small changes in Italian translation
2014-06-26 15:54:41 +02:00
Andre Bernet 63269ac35a Backlight Alarm parameter added in companion (fix #1123) 2014-06-26 15:20:29 +02:00
Andre Bernet 113deb6b75 Switch warning for SG wasn't reachable (fix #1371) 2014-06-26 14:41:52 +02:00
mhotar c48f4a51a6 No INVERS in FM string #1357 2014-06-26 13:51:54 +02:00
Andre Bernet 3cd2f709fc wget doesn't like https on win (#1378) 2014-06-26 13:28:20 +02:00
Andre Bernet d2df4af67d Telemetry screens order (Fix #1369) 2014-06-26 13:17:47 +02:00
Andre Bernet 67177aed42 Fix VC compilation for #1364 fix 2014-06-26 13:14:05 +02:00
Kjell Kernen 5879ca2fb6 Moved initialization of eeprom interfaces to before the first lines of active code to avoid future problems. 2014-06-26 12:56:16 +02:00
Kjell Kernen 77a7f13507 German OpenTX firmware translation from Helle 2014-06-26 12:04:56 +02:00
Bertrand Songis 2a794e2ae3 Merge pull request #1379 from opentx/projectkk2glider/issue_1364
Fixes #1364 - Stack alignment to 8 bytes
2014-06-26 11:50:54 +02:00
Bertrand Songis 090f659dca Merge pull request #1381 from opentx/dvogonen/issue_1360_Companion_crash
Fixes #1360
2014-06-26 11:49:41 +02:00
Bertrand Songis ca79fabdc7 Update DONATIONS.txt 2014-06-26 11:46:26 +02:00
Kjell Kernen 693f232f01 Fixes #1360 2014-06-26 11:39:43 +02:00
Damjan Adamic 8c33914cbb Fixes #1364 - Stack alignment to 8 bytes 2014-06-26 10:30:01 +02:00
bsongis a8e594e54c Fixes #1373 - I don't get why this was disable on the MAC, for sure
there was a reason
2014-06-26 07:51:53 +02:00
bsongis 17f7d90dbf Fixes #1374 2014-06-26 07:50:13 +02:00
Bertrand Songis 7ad3d5d317 Update DONATIONS.txt 2014-06-26 07:19:31 +02:00
bsongis 3d37b0d397 Lua bugfixes in getCustomFunction/setCustomFunction and
getLogicalSwitch/setLogicalSwitch
2014-06-26 07:16:43 +02:00
Andre Bernet e8fc7c4c89 Cnsp range was wrong 2014-06-25 21:58:52 +02:00
Damjan Adamic 405fd802d5 Re #1361 - Fixed 10000% bug 2014-06-25 09:02:23 +02:00
mhotar 5d1e9a1701 FM -translatable string 2014-06-25 00:40:20 +02:00
Bertrand Songis d09b85ddc4 Update DONATIONS.txt 2014-06-24 22:54:46 +02:00
mhotar a4aa0eb7c8 FM marks - fix INVERS surrounding 2014-06-24 22:07:43 +02:00
Bertrand Songis d105325dd7 Fixes #1359 2014-06-24 20:56:13 +02:00
bsongis 1fb9e57c62 Fixes #1357 2014-06-24 17:41:13 +02:00
Bertrand Songis 576d9d6d9d Update DONATIONS.txt 2014-06-24 17:20:36 +02:00
Bertrand Songis b7f3d1674d Update DONATIONS.txt 2014-06-24 17:13:07 +02:00
Bertrand Songis f7b009a9be Update DONATIONS.txt 2014-06-24 16:06:40 +02:00
490 changed files with 37732 additions and 28297 deletions
+180
View File
@@ -493,3 +493,183 @@ Heinrich Illig
Portstate Pty Ltd
Jens Hoffmann
Ricardo Santos
Jean-Francois Le Breton
Michael Deasy
Anindya Mukerjee
Emay Toha
Kamco Enterprises
Peter Mueller
Giovanni Trentini
Cecil Porter
Robert Canavan
Greg Higginbottom
Tim Walker
Thos. O'Meara Photography
Spis Ltd/TurboNote
Patricia Cox
Matthew Lukes
Sabine Witte
Phillip Perry
Beat Zurflueh
Russell Stutzman
Dietmar Drees
Kenneth Ward
Jens Lochmüller
Anthony Witham
Peter Hauke
Arizona Action Photos
Francis F Dale
Willie Swanepoel
Edward Hauser
Adilson Oliveira
Joseph Ordille
Michael Shellim
Teddie Holmes
Alexandre Rault
Eric Albin
Lukas Kliment
Bernard Philippe
Bernard Delpy
Didier Klein
Arnaldo Guedes
Cyberauto Systems
John Alsbrooks
John Kearney
Christopher Borden
Marc Virgilio Ricci
Frederick Davie
Jürgen Enders
Terrence Pitts
Thomas Sandner
Marco Coltorti
Harald Wilczak
Rodney Lorimor
Richard Davis
Stephen Palmer
Michael Napolitan
Joshua Bardwell
Fred Dawson
Jim Wagner
Peter Johnson
Fredrik Lewerth
Arvin Stenersen
Daniel Morgan
Roy Nixon
Joachim Blunck
Karl-Heinz Gansel
Monrovia Mountain Enterprises
Alessandro Villa
Jan-Åke Nilsson
Matthias Rei
DVR Solutions BV
Bertrand Condevaux Lanloy
Henri Mirra
Aurélien Planiol
Kevin Caldwell
Andrew Garello
Tomasz Maziarz
Russell Flack
Fernando Rimoldi
Greg Reid
Dietmar Drees
Holger Landwehr
Arno Loehdorf
Boon Sripattha
Patrik Åkerfeldt
Alonzo Fretwell
Renjith Chandrasekharan
Ruben Gomez Hernandez
Michael Gardner
Judith Green
Timo Ruppell
John Lipscomb
Norbert Wenke
Erik Frieberg
Raimo Ruotsalainen
Brian Harris
Sebastian Blüml
Efisio Maxia
Jeff Theobald
Anthony Rizzo
Rodney Huddleston
Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Michel Baily
Donald Burke
Ronald Donker
Fredie Singh
Patrizio Simoncini (monthly)
Harald Gabler
Michael Brown
Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Gordon Stahl
Christian Grandjean
Roger Bergevin
NorthSide
Sigmund Martinsen
Lionel Lafraise
Gisli Ofeigsson
The Gruvin9x Project
Manuel McLure
Fernando Rimoldi
Hiltenkamp Stephan
Sandeep Kishore Jain
Sebastien Charpentier
Greg Parker
Norman Maaß
Adriano Del Ben
Justin Poole
Kenneth Harrison
Eugene LaFaille
John O'Shaughnessy
Uwe Jordt
Stuart Olson
Frédéric Devillard
Cheung Leo
Peter Webster
Jean-Claude Bachetta
Delfin Perena
Sae-wook Yoon
Focus on Excellence
Jeffery Golias
Nick Milton
Paul Zasso
Reidar Johannes Lillebotn
Handley William
Luke Williams
Michael Shellim
Brian Spearing
Derek Foster
Pasi Pitkänen
Lexington S Morley
Jeff Roberson
Volkov Victor
Mike Perkins
Bryan Anderson
Daniel Garber
Pavel Stein
Ravi Gupta
Patrick Tuxbury
Mark Deverell
John Capell
Neil McVean
Matthew Elyash
Kerry Cochrell
Willem Aandewiel
Reg Bell
Jean Chenoz
Philippe Grand
Tauno Rautakorpi
Jeff Dillingham
Brad Kelley
Shaun Currier
Danilo Schiara
John Hennig
RK Custom Homes
James Houck
Piet Teekens
+3 -4
View File
@@ -1,8 +1,7 @@
##OpenTX Next Branch
##OpenTX Master Branch
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
You have found your way to the GitHub repository site for the OpenTX Master Branch. This code branch holds the source code for the latest stable release.
The stable release code is not here, it is in the master branch.
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
The ongoing development is not done in this branch. It is performed in the branch called next.
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
+85
View File
@@ -1,3 +1,88 @@
<h2>Version 2.0.14 / todo</h2>
<ul>
<li>OpenTX Companion and Companion9x can now be installed side by side on Linux</li>
<li>Improved TAB order in dialogs</li>
<li>Special Function <i>Start Logs</i> renamed to more appropriate <i>SD Logs</i></li>
<li>Improvements for MAC build</li>
<li>Fixes to Google Earth logs export</li>
<li>Firmware compatibility warning check added when flashing new firmware to radio</li>
<li>Fixed issue with Telemetry Type setting on 9XR-PRO</li>
<li>Added Telemetry simulator</li>
<li>Added Trainer simulator</li>
<li>Added Debug Output window</li>
<li>Various texts and translations corrections</li>
<li>Various small bug-fixes</li>
<li>More reliable method of writing EEPROM.BIN and FRIMWARE.BIN to radio</li>
<li>Fixed issue with Edge function INSTANT for V1>2s</li>
<li>Fixed buffer overflow in Joystick code</li>
</ul>
<h2>Version 2.0.13 / 2014-11-20</h2>
<ul>
<li>Too many curves shown on non ARM boards</li>
<li>Fixed vario limits</li>
<li>Fixes in compare dialog</li>
<li>Fixed receiver number range</li>
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
<li>Joystick calibration crash after channel assignment</li>
<li>Gvar import error for limits</li>
<li>Companion shows too many curve types in input/mixer for 9x</li>
<li>NOT curves removed from inputs (for non ARM platforms)</li>
<li>Companion again builds on OS X (Mac)</li>
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
<li>Companion didn't take care of PlayScript functions</li>
</ul>
<h2>Version 2.0.12 / 2014-09-15</h2>
<ul>
<li>Typos & Translations updated</li>
</ul>
<h2>Version 2.0.11 / 2014-09-10</h2>
<ul>
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
<li>Fix issue when a GVAR was used as Offset</li>
</ul>
<h2>Version 2.0.10 / 2014-09-08</h2>
<ul>
<li>Taranis is now the default board in General Settings</li>
<li>GVARS allowed in Limits min/max/offset</li>
<li>Limits displayed in us when ppmus option selected
</ul>
<h2>Version 2.0.8 / 2014-07-23</h2>
<ul>
<li>Compare dialog bugfixes</li>
<li>Curve index correctly resetted when type changed</li>
</ul>
<h2>Version 2.0.7</h2>
<ul>
<li>SafetyCH function was missing in simulator</li>
<li>EEPROM export warning when exporting logical switches > L12 on 9X128</li>
<li>FAS offset was not exported on 9X/9XR boards</li>
<li>Trims modes bugfix on non Taranis boards</li>
<li>It was impossible to open a backuped model from the Tx</li>
</ul>
<h2>Version 2.0.6</h2>
<ul>
<li>Fix Mix curves bug on Sky9x boards</li>
<li>Channels 17-32 are displayed in the simulator</li>
<li>Backlight simulation bugfix</li>
</ul>
<h2>Version 2.0.5</h2>
<ul>
<li>Fix crash on startup</li>
<li>Fix version number in simu</li>
<li>9XR-Pro now supported on Mac</li>
<li>Fix loss of settings in telemetry custom screens</li>
<li>Fix 10000% bug when using GVs in mixer weithg or offset</li>
<li>Fix Cnsp range in logical switches (up to 30000mAh)</li>
</ul>
<h2>Version 2.0.4</h2>
<ul>
<li>Sound should be ok on all platforms</li>
+27 -9
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "4" )
SET( C9X_VERSION_REVISION "14" )
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
@@ -87,6 +87,13 @@ add_custom_command(
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
COMMAND make PCB=TARANIS lua_exports.cpp
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/../..
@@ -112,6 +119,7 @@ set(common_SRCS
firmwares/ersky9x/ersky9xinterface.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
@@ -312,6 +320,7 @@ set(simu_SRCS
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
@@ -329,7 +338,11 @@ if(WIN32)
set(simu_SRCS ${simu_SRCS} icon.rc)
endif()
add_executable(simulator WIN32 ${simu_SRCS})
if(APPLE)
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
else()
add_executable(simulator WIN32 ${simu_SRCS})
endif()
if(SDL_FOUND)
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
@@ -351,7 +364,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
# Linux specific code
SET(OperatingSystem "Linux")
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -398,14 +411,13 @@ IF( APPLE )
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 ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
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 ${PROJECT_NAME} )
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
@@ -418,9 +430,15 @@ 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 )
ADD_CUSTOM_TARGET( translations
IF(WIN32)
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ELSE( )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ENDIF( )
SET(CPACK_PACKAGE_NAME "COMPANION")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
@@ -434,7 +452,7 @@ if(DPKG_PROGRAM)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-nosp@m-gmail.com>")
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})
+3
View File
@@ -499,6 +499,7 @@ QString AppData::snapshotDir() { return _snapshotDir; }
QString AppData::updatesDir() { return _updatesDir; }
bool AppData::enableBackup() { return _enableBackup; }
bool AppData::checkHardwareCompatibility() { return _checkHardwareCompatibility; }
bool AppData::backupOnFlash() { return _backupOnFlash; }
bool AppData::jsSupport() { return _jsSupport; }
bool AppData::maximized() { return _maximized; }
@@ -550,6 +551,7 @@ void AppData::updatesDir (const QString x) { store(x, _updatesDir,
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
void AppData::checkHardwareCompatibility(const bool x) { store(x, _checkHardwareCompatibility, "checkHardwareCompatibility");}
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
@@ -675,6 +677,7 @@ AppData::AppData()
getset( _updatesDir, "lastUpdatesDir" ,"" );
getset( _enableBackup, "backupEnable" ,false );
getset( _checkHardwareCompatibility, "checkHardwareCompatibility", true );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _jsSupport, "js_support" ,false );
getset( _maximized, "maximized" ,false );
+3
View File
@@ -226,6 +226,7 @@ class AppData: protected CompStoreObj
bool _enableBackup;
bool _backupOnFlash;
bool _checkHardwareCompatibility;
bool _maximized;
bool _jsSupport;
bool _showSplash;
@@ -278,6 +279,7 @@ class AppData: protected CompStoreObj
bool enableBackup();
bool backupOnFlash();
bool checkHardwareCompatibility();
bool jsSupport();
bool maximized();
bool showSplash();
@@ -329,6 +331,7 @@ class AppData: protected CompStoreObj
void enableBackup (const bool);
void backupOnFlash (const bool);
void checkHardwareCompatibility (const bool);
void maximized (const bool);
void jsSupport (const bool);
void showSplash (const bool);
+8 -2
View File
@@ -263,8 +263,9 @@ void AppPreferencesDialog::on_joystickChkB_clicked() {
}
}
void AppPreferencesDialog::on_joystickcalButton_clicked() {
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
void AppPreferencesDialog::on_joystickcalButton_clicked()
{
JoystickDialog *jd = new JoystickDialog(this, ui->joystickCB->currentIndex());
jd->exec();
}
#endif
@@ -434,6 +435,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
voice = NULL; // we will search for a voice checkbox
int index = 0;
QWidget * prevFocus = ui->voiceCombo;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
@@ -441,6 +443,9 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
optionsCheckBoxes.push_back(checkbox);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
if (prevFocus) {
QWidget::setTabOrder(prevFocus, checkbox);
}
}
QCheckBox *cb = optionsCheckBoxes.at(index++);
@@ -452,6 +457,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
if (opt.name == QString("voice")) {
voice = cb;
}
prevFocus = cb;
}
}
}
+17 -6
View File
@@ -1049,10 +1049,26 @@ Mode 4:
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>profileNameLE</tabstop>
<tabstop>removeProfileButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>langCombo</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>sdPath</tabstop>
<tabstop>sdPathButton</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>renameFirmware</tabstop>
<tabstop>burnFirmware</tabstop>
<tabstop>ge_lineedit</tabstop>
<tabstop>ge_pathButton</tabstop>
<tabstop>historySize</tabstop>
<tabstop>showSplash</tabstop>
<tabstop>modelWizard_CB</tabstop>
<tabstop>startupCheck_fw</tabstop>
<tabstop>startupCheck_companion9x</tabstop>
<tabstop>backupPath</tabstop>
@@ -1061,7 +1077,6 @@ Mode 4:
<tabstop>splashincludeCB</tabstop>
<tabstop>libraryPath</tabstop>
<tabstop>libraryPathButton</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>snapshotPath</tabstop>
<tabstop>snapshotPathButton</tabstop>
<tabstop>snapshotClipboardCKB</tabstop>
@@ -1070,11 +1085,7 @@ Mode 4:
<tabstop>joystickCB</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>renameFirmware</tabstop>
<tabstop>burnFirmware</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
+3 -3
View File
@@ -138,7 +138,7 @@ void avrOutputDialog::doCopy()
if (source.open(QIODevice::ReadOnly)) {
QFile dest(destFile);
if (dest.open(QIODevice::WriteOnly)) {
if (dest.open(QIODevice::ReadWrite)) {
addText(tr("Writing file: "));
for (int i=0; i<blocks; i++) {
int read = source.read(buf, BLKSIZE);
@@ -156,11 +156,11 @@ void avrOutputDialog::doCopy()
dest.close();
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.fileName() + ", " + tr("reason") + ": " + dest.errorString());
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.fileName() + ", " + tr("reason") + ": " + source.errorString());
}
source.close();
+2 -4
View File
@@ -354,10 +354,8 @@ void burnConfigDialog::restFuses(bool eeProtect)
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
else {
QString tempDir = QDir::tempPath();
QString tempFile;
QString lfuses;
tempFile = tempDir + "/ftemp.bin";
QString tempFile = generateProcessUniqueTempFileName("ftemp.bin");
QStringList argread;
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
@@ -376,7 +374,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
lfuses="lfuse:w:0x3F:m";
}
file.close();
unlink(tempFile.toAscii());
qunlink(tempFile);
}
else {
lfuses="lfuse:w:0x3F:m";
+9 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>531</width>
<height>335</height>
<height>422</height>
</rect>
</property>
<property name="sizePolicy">
@@ -817,6 +817,14 @@ Please only use this if you know what you are doing. There are no error checks
<tabstop>avrdude_port</tabstop>
<tabstop>avrArgs</tabstop>
<tabstop>pushButton_4</tabstop>
<tabstop>samba_location</tabstop>
<tabstop>sb_browse</tabstop>
<tabstop>arm_mcu</tabstop>
<tabstop>samba_port</tabstop>
<tabstop>dfu_location</tabstop>
<tabstop>dfu_browse</tabstop>
<tabstop>dfuArgs</tabstop>
<tabstop>advCtrChkB</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+6 -5
View File
@@ -42,6 +42,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->EEbackupCB->hide();
}
ui->checkFirmwareCB->setChecked(g.checkHardwareCompatibility());
}
else {
ui->FlashLoadButton->setText(tr("Browse for file"));
@@ -49,6 +50,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
ui->patchcalib_CB->hide();
ui->patchhw_CB->hide();
ui->EEpromCB->hide();
ui->checkFirmwareCB->hide();
ui->BurnFlashButton->setDisabled(true);
ui->FWFileName->clear();
ui->DateField->clear();
@@ -408,6 +410,7 @@ void burnDialog::on_useLibraryImageCB_clicked()
void burnDialog::on_BurnFlashButton_clicked()
{
if (hexType==FLASH_FILE_TYPE) {
g.checkHardwareCompatibility(ui->checkFirmwareCB->isChecked());
QString fileName=ui->FWFileName->text();
if (!fileName.isEmpty()) {
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
@@ -418,12 +421,11 @@ void burnDialog::on_BurnFlashButton_clicked()
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
}
if (!image.isNull()) {
QString tempDir = QDir::tempPath();
QString tempFile;
if (getFileType(fileName) == FILE_TYPE_HEX)
tempFile = tempDir + "/flash.hex";
tempFile = generateProcessUniqueTempFileName("flash.hex");
else
tempFile = tempDir + "/flash.bin";
tempFile = generateProcessUniqueTempFileName("flash.bin");
FlashInterface flash(fileName);
flash.setSplash(image);
if (flash.saveFlash(tempFile) > 0) {
@@ -556,8 +558,7 @@ void burnDialog::on_BurnFlashButton_clicked()
}
if (patch) {
QString tempDir = QDir::tempPath();
QString fileName = tempDir + "/temp.bin";
QString fileName = generateProcessUniqueTempFileName("temp.bin");
QFile file(fileName);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
+28 -11
View File
@@ -30,7 +30,7 @@
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="hs2">
@@ -76,6 +76,19 @@
</item>
</layout>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="5" column="0">
@@ -342,26 +355,29 @@
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QCheckBox" name="checkFirmwareCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
<property name="toolTip">
<string>Allows Companion to write to older version of the firmware</string>
</property>
</spacer>
<property name="text">
<string>Check Firmware compatibility</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>BurnFlashButton</tabstop>
<tabstop>FWFileName</tabstop>
<tabstop>FlashLoadButton</tabstop>
<tabstop>versionField</tabstop>
<tabstop>ModField</tabstop>
<tabstop>DateField</tabstop>
<tabstop>useProfileImageCB</tabstop>
<tabstop>useFwImageCB</tabstop>
<tabstop>useLibraryImageCB</tabstop>
@@ -371,6 +387,7 @@
<tabstop>patchhw_CB</tabstop>
<tabstop>EEpromCB</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>BurnFlashButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
+3 -3
View File
@@ -95,6 +95,9 @@ int main(int argc, char *argv[])
app.installTranslator(&qtTranslator);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
RegisterEepromInterfaces();
registerOpenTxFirmwares();
if (g.profile[g.id()].fwType().isEmpty()){
g.profile[g.id()].fwType(default_firmware_variant->getId());
@@ -110,9 +113,6 @@ int main(int argc, char *argv[])
QPixmap pixmap = QPixmap(splashScreen);
QSplashScreen *splash = new QSplashScreen(pixmap);
RegisterEepromInterfaces();
registerOpenTxFirmwares();
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
MainWindow *mainWin = new MainWindow();
+19 -34
View File
@@ -156,16 +156,12 @@ void CompareDialog::dropEvent(QDropEvent *event)
void CompareDialog::closeEvent(QCloseEvent *event)
{
QByteArray ba = curvefile5.toLatin1();
char *name = ba.data();
unlink(name);
ba = curvefile9.toLatin1();
name = ba.data();
unlink(name);
}
CompareDialog::~CompareDialog()
{
qunlink(curvefile5);
qunlink(curvefile9);
delete ui;
}
@@ -256,17 +252,14 @@ void CompareDialog::printSetup()
str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down
color=getColor1(getProtocol(g_model1),getProtocol(g_model2));
str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay,
color=getColor1(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
color=getColor1(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color));
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor1(g_model1->thrExpo,g_model2->thrExpo);
str.append(fv(tr("Throttle Expo"), g_model1->thrExpo ? tr("Enabled") : tr("Disabled"),color));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
color=getColor1(getTrimInc(g_model1),getTrimInc(g_model2));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model1),color));
color=getColor1(getCenterBeep(g_model1),getCenterBeep(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model1),color)); // specify which channels beep
color = getColor1(getCenterBeepStr(g_model1), getCenterBeepStr(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model1), color)); // specify which channels beep
str.append("</table></td>");
str.append("<td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">");
color=getColor2(g_model1->name,g_model2->name);
@@ -279,17 +272,14 @@ void CompareDialog::printSetup()
str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down
color=getColor2(getProtocol(g_model1),getProtocol(g_model2));
str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay,
color=getColor2(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
color=getColor2(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color));
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor2(g_model1->thrExpo,g_model2->thrExpo);
str.append(fv(tr("Throttle Expo"), g_model2->thrExpo ? tr("Enabled") : tr("Disabled"),color));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
color=getColor2(getTrimInc(g_model1),getTrimInc(g_model2));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model2),color));
color=getColor2(getCenterBeep(g_model1),getCenterBeep(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model2),color)); // specify which channels beep
color = getColor2(getCenterBeepStr(g_model1),getCenterBeepStr(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model2), color)); // specify which channels beep
str.append("</td></tr></table></td></tr></table>");
te->append(str);
}
@@ -506,11 +496,11 @@ void CompareDialog::printLimits()
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
}
color=getColor1(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
str.append(doTR(QString::number((qreal)g_model1->limitData[i].offset/10, 'f', 1),color));
str.append(doTR(g_model1->limitData[i].offsetToString(), color));
color=getColor1(g_model1->limitData[i].min,g_model2->limitData[i].min);
str.append(doTR(QString::number(g_model1->limitData[i].min),color));
str.append(doTR(g_model1->limitData[i].minToString(), color));
color=getColor1(g_model1->limitData[i].max,g_model2->limitData[i].max);
str.append(doTR(QString::number(g_model1->limitData[i].max),color));
str.append(doTR(g_model1->limitData[i].maxToString(), color));
color=getColor1(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
str.append(doTR(QString(g_model1->limitData[i].revert ? tr("INV") : tr("NOR")),color));
str.append("</tr>");
@@ -533,11 +523,11 @@ void CompareDialog::printLimits()
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
}
color=getColor2(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
str.append(doTR(QString::number((qreal)g_model2->limitData[i].offset/10, 'f', 1),color));
str.append(doTR(g_model2->limitData[i].offsetToString(), color));
color=getColor2(g_model1->limitData[i].min,g_model2->limitData[i].min);
str.append(doTR(QString::number(g_model2->limitData[i].min),color));
str.append(doTR(g_model2->limitData[i].minToString(), color));
color=getColor2(g_model1->limitData[i].max,g_model2->limitData[i].max);
str.append(doTR(QString::number(g_model2->limitData[i].max),color));
str.append(doTR(g_model2->limitData[i].maxToString(), color));
color=getColor2(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
str.append(doTR(QString(g_model2->limitData[i].revert ? tr("INV") : tr("NOR")),color));
str.append("</tr>");
@@ -807,7 +797,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
str += md->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
@@ -885,8 +875,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
// TODO if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
// TODO if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "&lt;").replace(">", "&gt;"));
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
@@ -1032,11 +1021,7 @@ void CompareDialog::printSwitches()
str.append("<tr>");
color=getColor1(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
if (i<9) {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
} else {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
}
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("L%1").arg(i+1)+QString("</b></td>"));
color=getColor2(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
str.append("</tr>");
+18 -5
View File
@@ -505,7 +505,7 @@ class ConversionTable {
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
for (std::list<ConversionTuple>::iterator it=exportTable.begin(); it!=exportTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.a) {
after = tuple.b;
@@ -520,7 +520,7 @@ class ConversionTable {
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
for (std::list<ConversionTuple>::iterator it=importTable.begin(); it!=importTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.b) {
after = tuple.a;
@@ -547,10 +547,23 @@ class ConversionTable {
void addConversion(const int a, const int b)
{
internalTable.push_back(ConversionTuple(a, b));
ConversionTuple conversion(a, b);
importTable.push_back(conversion);
exportTable.push_back(conversion);
}
std::list<ConversionTuple> internalTable;
void addImportConversion(const int a, const int b)
{
importTable.push_back(ConversionTuple(a, b));
}
void addExportConversion(const int a, const int b)
{
exportTable.push_back(ConversionTuple(a, b));
}
std::list<ConversionTuple> importTable;
std::list<ConversionTuple> exportTable;
};
template<class T>
@@ -648,7 +661,7 @@ class ConversionField: public TransformedField {
if (table->exportValue(_field, _field))
return;
if (!error.isEmpty())
EEPROMWarnings += error + "\n";
EEPROMWarnings.push_back(error);
}
if (shift) {
+53 -92
View File
@@ -12,7 +12,7 @@
#include "helpers.h"
#include "wizarddata.h"
QString EEPROMWarnings;
std::list<QString> EEPROMWarnings;
const char * switches9X[] = { "3POS", "THR", "RUD", "ELE", "AIL", "GEA", "TRN" };
const char * switchesX9D[] = { "SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH" };
@@ -186,6 +186,20 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
break;
case TELEMETRY_SOURCE_ASPEED:
case TELEMETRY_SOURCE_ASPEED_MAX:
result.decimals = 1;
result.step = singleprec ? 2.0 : 0.1;
result.max = singleprec ? (2*255) : 2000;
if (firmware->getCapability(Imperial) || settings.imperial) {
result.step *= 1.150779;
result.max *= 1.150779;
result.unit = QObject::tr("mph");
}
else {
result.step *= 1.852;
result.max *= 1.852;
result.unit = QObject::tr("km/h");
}
break;
case TELEMETRY_SOURCE_SPEED:
case TELEMETRY_SOURCE_SPEED_MAX:
result.step = singleprec ? 2 : 1;
@@ -242,7 +256,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
break;
case TELEMETRY_SOURCE_CONSUMPTION:
result.step = singleprec ? 100 : 1;
result.max = singleprec ? 25500 : 10000;
result.max = singleprec ? 25500 : 30000;
result.unit = QObject::tr("mAh");
break;
case TELEMETRY_SOURCE_POWER:
@@ -287,7 +301,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
break;
default:
result.max = (model.extendedLimits ? 125 : 100);
result.max = model.getChannelsMax(true);
result.min = -result.max;
break;
}
@@ -446,7 +460,7 @@ QString RawSwitch::toString()
};
static const QString timerModes[] = {
QObject::tr("OFF"), QObject::tr("ABS"),
QObject::tr("OFF"), QObject::tr("ON"),
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
};
@@ -698,98 +712,19 @@ QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettin
return result;
}
#if 0
QStringList FuncSwData::toStringList()
void FuncSwData::clear()
{
QStringList result;
QStringList qs;
result << swtch.toString();
result << funcToString();
if (func < FuncInstantTrim) {
result << QString("%1").arg(param);
memset(this, 0, sizeof(FuncSwData));
if (!GetCurrentFirmware()->getCapability(SafetyChannelCustomFunction)) {
func = FuncTrainer;
}
else if (func==FuncPlaySound) {
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func==FuncPlayHaptic) {
qs << "0" << "1" << "2" << "3";
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if (func==FuncReset) {
qs.append( QObject::tr("Timer1"));
qs.append( QObject::tr("Timer2"));
qs.append( QObject::tr("All"));
qs.append( QObject::tr("Telemetry"));
if (param>=0 && param<(int)qs.count())
result << qs.at(param);
else
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
}
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
RawSource item(param);
result << item.toString();
}
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
result << QString("%1").arg(param);
} else {
result << paramarm;
}
}
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
switch (adjustMode) {
case 0:
result << QObject::tr("Value ")+QString("%1").arg(param);
break;
case 1:
result << RawSource(param).toString();
break;
case 2:
result << RawSource(param).toString();
break;
case 3:
if (param==0) {
result << QObject::tr("Decr:")+QString(" -1");
}
else {
result << QObject::tr("Incr:")+QString(" +1");
}
break;
default:
break;
}
}
if (func==FuncPlaySound || func==FuncPlayHaptic || func==FuncPlayValue || func==FuncPlayPrompt || func==FuncPlayBoth || func==FuncBackgroundMusic) {
str.append(doTC(QString("%1").arg(g_model->funcSw[i].repeatParam),"green"));
} else {
str.append(doTC( "&nbsp;","green"));
}
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
str.append(doTC((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green"));
} else {
str.append(doTC( "---","green"));
}
return result;
}
#endif
QString FuncSwData::funcToString()
{
ModelData model;
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
return QObject::tr("Safety %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return QObject::tr("Trainer");
else if (func == FuncTrainerRUD)
@@ -818,8 +753,10 @@ QString FuncSwData::funcToString()
return QObject::tr("Play Both");
else if (func == FuncPlayValue)
return QObject::tr("Play Value");
else if (func == FuncPlayScript)
return QObject::tr("Play Script");
else if (func == FuncLogs)
return QObject::tr("Start Logs");
return QObject::tr("SD Logs");
else if (func == FuncVolume)
return QObject::tr("Volume");
else if (func == FuncBacklight)
@@ -916,6 +853,28 @@ QString FuncSwData::repeatToString()
}
}
QString LimitData::minToString()
{
return QString::number((qreal)min/10);
}
QString LimitData::maxToString()
{
return QString::number((qreal)max/10);
}
QString LimitData::offsetToString()
{
return QString::number((qreal)offset/10, 'f', 1);
}
void LimitData::clear()
{
memset(this, 0, sizeof(LimitData));
min = -1000;
max = +1000;
}
GeneralSettings::GeneralSettings()
{
memset(this, 0, sizeof(GeneralSettings));
@@ -1201,6 +1160,8 @@ void ModelData::clear()
expoData[i].clear();
for (int i=0; i<C9X_NUM_CSW; i++)
customSw[i].clear();
for (int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
funcSw[i].clear();
for (int i=0; i<C9X_MAX_CURVES; i++)
curves[i].clear(5);
for (int i=0; i<2; i++)
@@ -1350,9 +1311,9 @@ ModelData ModelData::removeGlobalVars()
return result;
}
int ModelData::getChannelsMax()
int ModelData::getChannelsMax(bool forceExtendedLimits) const
{
if (extendedLimits)
if (forceExtendedLimits || extendedLimits)
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
else
return 100;
+19 -10
View File
@@ -526,6 +526,8 @@ class GeneralSettings {
int temperatureCalib;
int temperatureWarn;
unsigned int mAhWarn;
unsigned int mAhUsed;
unsigned int globalTimer;
unsigned int btBaudrate;
unsigned int sticksGain;
unsigned int rotarySteps;
@@ -631,7 +633,10 @@ class LimitData {
bool symetrical;
char name[6+1];
CurveReference curve;
void clear() { memset(this, 0, sizeof(LimitData)); min = -1000; max = +1000; }
QString minToString();
QString maxToString();
QString offsetToString();
void clear();
};
enum MltpxValue {
@@ -722,8 +727,8 @@ class LogicalSwitchData { // Logical Switches data
};
enum AssignFunc {
FuncSafetyCh1 = 0,
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
FuncOverrideCH1 = 0,
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
FuncTrainer,
FuncTrainerRUD,
FuncTrainerELE,
@@ -739,6 +744,7 @@ enum AssignFunc {
FuncPlayPrompt,
FuncPlayBoth,
FuncPlayValue,
FuncPlayScript,
FuncLogs,
FuncVolume,
FuncBacklight,
@@ -752,7 +758,7 @@ enum AssignFunc {
class FuncSwData { // Function Switches data
public:
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch;
AssignFunc func;
int param;
@@ -760,7 +766,7 @@ class FuncSwData { // Function Switches data
unsigned int enabled; // TODO perhaps not any more the right name
unsigned int adjustMode;
int repeatParam;
void clear() { memset(this, 0, sizeof(FuncSwData)); }
void clear();
QString funcToString();
QString paramToString();
QString repeatToString();
@@ -916,9 +922,8 @@ class TimerData {
RawSwitch mode;
bool minuteBeep;
unsigned int countdownBeep;
bool dir; // 0=>Count Down, 1=>Count Up
unsigned int val;
bool persistent;
unsigned int persistent;
int pvalue;
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
};
@@ -954,6 +959,7 @@ class ModuleData {
bool ppmPulsePol; // false = positive
int ppmFrameLength;
void clear() { memset(this, 0, sizeof(ModuleData)); }
QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); }
};
#define C9X_MAX_SCRIPTS 7
@@ -982,7 +988,6 @@ class ModelData {
char name[12+1];
TimerData timers[2];
bool thrTrim; // Enable Throttle Trim
bool thrExpo; // Enable Throttle Expo
int trimInc; // Trim Increments
bool disableThrottleWarning;
@@ -1041,7 +1046,7 @@ class ModelData {
void clearMixes();
void clearInputs();
int getChannelsMax();
int getChannelsMax(bool forceExtendedLimits=false) const;
protected:
void removeGlobalVar(int & var);
@@ -1063,6 +1068,7 @@ enum Capability {
Timers,
TimeDivisions,
CustomFunctions,
SafetyChannelCustomFunction,
VoicesAsNumbers,
VoicesMaxLength,
ModelVoice,
@@ -1126,6 +1132,7 @@ enum Capability {
HasSoundMixer,
NumModules,
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HasCurrentCalibration,
HasVolume,
@@ -1152,6 +1159,8 @@ enum Capability {
MultiposPotsPositions,
SimulatorVariant,
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
};
class SimulatorInterface;
@@ -1196,7 +1205,7 @@ class EEPROMInterface
};
extern QString EEPROMWarnings;
extern std::list<QString> EEPROMWarnings;
/* EEPROM string conversion functions */
void setEEPROMString(char *dst, const char *src, int size);
+51
View File
@@ -344,6 +344,57 @@ unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
}
}
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion)
{
uint8_t *buf = (uint8_t *)src.data();
unsigned int len = src.size();
uint8_t zeroes = 0;
uint8_t bRlc = 0;
dst.resize(0);
for( ; 1; ) {
for (int i=0; i<zeroes; i++)
dst.append((char)0);
zeroes = 0;
if (len == 0)
return dst.size();
for (int i=0; i<bRlc; i++) {
dst.append(*buf++);
if (--len == 0)
return dst.size();
}
bRlc = *buf++;
--len;
if (!(bRlc & 0x7f)) {
qDebug() << "RLC decoding error!";
return 0;
}
if (rlcVersion == 2) {
if (bRlc&0x80){ // if contains high byte
zeroes = (bRlc>>4) & 0x07;
bRlc = bRlc & 0x0f;
}
else if (bRlc&0x40){
zeroes = bRlc & 0x3f;
bRlc = 0;
}
}
else {
if (bRlc&0x80){ // if contains high byte
zeroes = bRlc & 0x7f;
bRlc = 0;
}
}
}
return dst.size();
}
unsigned int RleFile::write1(uint8_t b)
{
return write(&b, 1);
+2
View File
@@ -146,4 +146,6 @@ public:
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
};
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion=2);
#endif
+2 -4
View File
@@ -138,8 +138,8 @@ t_Er9xLimitData::t_Er9xLimitData()
t_Er9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -358,7 +358,6 @@ t_Er9xModelData::operator ModelData ()
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
c9x.timers[0].dir = tmrDir;
c9x.timers[0].val = tmrVal;
switch(protocol) {
case 1:
@@ -377,7 +376,6 @@ t_Er9xModelData::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -54,6 +54,10 @@ class Er9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
protected:
Er9xInterface * er9xInterface;
@@ -147,8 +147,8 @@ t_Ersky9xLimitData::t_Ersky9xLimitData()
t_Ersky9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -489,7 +489,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
@@ -509,7 +508,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -607,7 +605,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
@@ -627,7 +624,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -54,6 +54,10 @@ class Ersky9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
protected:
Ersky9xInterface * ersky9xInterface;
@@ -201,8 +201,8 @@ t_Gruvin9xLimitData::t_Gruvin9xLimitData()
t_Gruvin9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -378,7 +378,6 @@ t_Gruvin9xTimerData::operator TimerData ()
TimerData c9x;
c9x.mode = getEr9xTimerMode(mode);
c9x.val = val;
c9x.dir = dir;
return c9x;
}
@@ -447,7 +446,6 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -518,7 +516,6 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -589,7 +586,6 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -680,7 +676,6 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -138,7 +138,6 @@ t_Open9xArmTimerData_v202::operator TimerData ()
*/
c9x.val = val;
c9x.persistent = false;
c9x.dir = (val == 0);
return c9x;
}
@@ -149,7 +148,7 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
c9x.chn = chn;
if (expo!=0 && curve!=0) {
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
}
else {
if (curve == 0) {
@@ -179,7 +178,7 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
c9x.chn = chn;
if (expo!=0 && curve!=0) {
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
}
else {
if (curve == 0) {
@@ -577,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncSafetyCh32) {
if (c9x.func <= FuncOverrideCH32) {
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
}
@@ -89,7 +89,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
c9x.mode = mode;
c9x.chn = chn;
if (expo!=0 && curve!=0) {
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX") + "\n";
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
}
else {
if (curve == 0) {
@@ -129,8 +129,8 @@ t_Open9xExpoData_v211::operator ExpoData ()
t_Open9xLimitData_v201::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -139,8 +139,8 @@ t_Open9xLimitData_v201::operator LimitData ()
t_Open9xLimitData_v211::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
c9x.symetrical=symetrical;
@@ -573,8 +573,8 @@ t_Open9xFuncSwData_v201::operator FuncSwData ()
}
enum Functions {
FUNC_SAFETY_CH1,
FUNC_SAFETY_CH16=FUNC_SAFETY_CH1+15,
FUNC_OVERRIDE_CH1,
FUNC_OVERRIDE_CH16=FUNC_OVERRIDE_CH1+15,
FUNC_TRAINER,
FUNC_TRAINER_RUD,
FUNC_TRAINER_ELE,
@@ -704,7 +704,6 @@ t_Open9xTimerData_v201::operator TimerData ()
// c9x.mode = TMRMODE_OFF;
c9x.val = val;
c9x.persistent = persistent;
c9x.dir = dir;
return c9x;
}
@@ -725,7 +724,6 @@ t_Open9xTimerData_v202::operator TimerData ()
*/
c9x.val = val;
c9x.persistent = false;
c9x.dir = (val == 0);
return c9x;
}
@@ -939,7 +937,6 @@ t_Open9xModelData_v201::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -48,6 +48,8 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3
@@ -76,9 +78,10 @@ namespace Open9xGruvin9x {
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -56,6 +56,11 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -48,6 +48,8 @@
#define FRSKY_STICKS
#define DSM2
#define DSM2_PPM
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "9x128"
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
@@ -77,9 +79,10 @@ namespace OpenTxM128 {
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -56,6 +56,11 @@ class OpenTxM128Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -50,10 +50,11 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES
#define FLAVOUR "9x"
#define NUM_POTS 3
#undef min
@@ -81,9 +82,10 @@ namespace OpenTxM64 {
#include "radio/src/gui/view_main.cpp"
#include "radio/src/gui/view_statistics.cpp"
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/telemetry/frsky.cpp"
#include "radio/src/telemetry/frsky_d.cpp"
#include "radio/src/templates.cpp"
@@ -55,6 +55,11 @@ class OpenTxM64Simulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void installTraceHook(void (*callback)(const char *)) {};
};
#endif
@@ -54,9 +54,10 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3
#define EEPROM_VARIANT 3
#define FLAVOUR "sky9x"
#undef min
#undef max
@@ -75,6 +76,7 @@ namespace Open9xSky9x {
#include "radio/src/eeprom_raw.cpp"
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/opentx.cpp"
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/mixer.cpp"
@@ -92,11 +94,12 @@ namespace Open9xSky9x {
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_default.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/targets/sky9x/keys_driver.cpp"
#include "radio/src/keys.cpp"
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#include "radio/src/templates.cpp"
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -256,3 +259,13 @@ const char * Open9xSky9xSimulator::getError()
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::setTrainerInput(unsigned int inputNumber, int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void Open9xSky9xSimulator::installTraceHook(void (*callback)(const char *)) {
::traceCallback = callback;
}
@@ -56,6 +56,11 @@ class Open9xSky9xSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
};
#endif
@@ -54,8 +54,9 @@
#define EEPROM_VARIANT 3
#define HAPTIC
#define REVPLUS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
#define FLAVOUR "taranis-plus"
#undef min
#undef max
@@ -78,6 +79,7 @@ inline int geteepromsize() {
#include "radio/src/eeprom_conversions.cpp"
#include "radio/src/eeprom_rlc.cpp"
#include "radio/src/opentx.cpp"
#include "radio/src/debug.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/curves.cpp"
@@ -99,7 +101,8 @@ inline int geteepromsize() {
#include "radio/src/gui/view_telemetry.cpp"
#include "radio/src/gui/view_text.cpp"
#include "radio/src/gui/view_about.cpp"
#include "radio/src/lcd.cpp"
#include "radio/src/lcd_common.cpp"
#include "radio/src/lcd_taranis.cpp"
#include "radio/src/logs.cpp"
#include "radio/src/rtc.cpp"
#include "radio/src/targets/taranis/keys_driver.cpp"
@@ -109,7 +112,7 @@ inline int geteepromsize() {
#include "radio/src/targets/taranis/haptic_driver.cpp"
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
#undef SDCARD
#include "radio/src/simpgmspace.cpp"
#include "radio/src/targets/simu/simpgmspace.cpp"
#define SDCARD
#include "radio/src/translations.cpp"
#include "radio/src/fonts.cpp"
@@ -147,6 +150,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/lrotable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
@@ -154,6 +158,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/lbitlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
@@ -293,3 +298,18 @@ const char * OpentxTaranisSimulator::getError()
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::sendTelemetry(uint8_t * data, unsigned int len)
{
frskySportProcessPacket(data);
}
void OpentxTaranisSimulator::setTrainerInput(unsigned int inputNumber, int16_t value)
{
#define SETTRAINER_IMPORT
#include "simulatorimport.h"
}
void OpentxTaranisSimulator::installTraceHook(void (*callback)(const char *)) {
::traceCallback = callback;
}
@@ -56,6 +56,11 @@ class OpentxTaranisSimulator : public SimulatorInterface {
virtual const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
virtual void installTraceHook(void (*callback)(const char *));
};
#endif
+163 -63
View File
@@ -19,7 +19,7 @@
#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) ? 15 : 12))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
@@ -40,11 +40,11 @@ inline int switchIndex(int i, BoardEnum board, unsigned int version)
class SwitchesConversionTable: public ConversionTable {
public:
SwitchesConversionTable(BoardEnum board, unsigned int version, unsigned long flags=0)
SwitchesConversionTable(BoardEnum board, unsigned int version, bool timer=false)
{
int val=0;
int offset=0;
if (flags & POPULATE_TIMER_MODES) {
if (timer) {
offset = 4;
for (int i=0; i<5; i++) {
addConversion(RawSwitch(SWITCH_TYPE_TIMER_MODE, i), val++);
@@ -56,8 +56,15 @@ class SwitchesConversionTable: public ConversionTable {
for (int i=1; i<=MAX_SWITCHES_POSITION(board); i++) {
int s = switchIndex(i, board, version);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val);
if (IS_TARANIS(board) && s>=21/*SHup/SHdown*/) {
addImportConversion(RawSwitch(SWITCH_TYPE_SWITCH, 21+22-s), -val+offset);
addExportConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
else {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
val++;
}
if (IS_TARANIS(board) && version >= 216) {
@@ -86,17 +93,15 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
if (!(flags & POPULATE_TIMER_MODES)) {
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
}
}
@@ -124,6 +129,16 @@ class SwitchesConversionTable: public ConversionTable {
ConversionTable::addConversion(sw.toValue(), b);
}
void addImportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addImportConversion(sw.toValue(), b);
}
void addExportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addExportConversion(sw.toValue(), b);
}
class Cache {
public:
Cache(BoardEnum board, unsigned int version, unsigned long flags, SwitchesConversionTable * table):
@@ -187,8 +202,8 @@ class SourcesConversionTable: public ConversionTable {
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++)
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
}
}
@@ -235,8 +250,9 @@ 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_CUSTOM_SWITCHES(board, version); i++) {
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
}
}
if (!afterrelease21March2013) {
@@ -369,7 +385,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), "Switch"),
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch",
"Switch "+ sw.toString()+" cannot be exported on this board!"),
sw(sw),
_switch(0)
{
@@ -503,7 +520,8 @@ 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), "Source"),
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
"Source", "Source "+ source.toString(ModelData())+" cannot be exported on this board!"),
source(source),
_source(0)
{
@@ -867,8 +885,8 @@ class MixField: public TransformedField {
internalField.Append(new SpareBitsField<8>());
}
else if (IS_ARM(board) && version >= 216) {
internalField.Append(new UnsignedField<4>(_destCh));
internalField.Append(new UnsignedField<4>(mix.mixWarn));
internalField.Append(new UnsignedField<5>(_destCh));
internalField.Append(new UnsignedField<3>(mix.mixWarn));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new BoolField<1>(_curveMode));
internalField.Append(new BoolField<1>(mix.noExpo));
@@ -973,7 +991,12 @@ class MixField: public TransformedField {
_destCh = mix.destCh - 1;
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
_curveMode = true;
_curveParam = 6 + mix.curve.value;
if (mix.curve.value > 0) {
_curveParam = 6 + mix.curve.value;
}
else {
_curveParam = mix.curve.value;
}
}
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
_curveMode = true;
@@ -1016,11 +1039,13 @@ class MixField: public TransformedField {
if (mix.srcRaw.type != SOURCE_TYPE_NONE) {
mix.destCh = _destCh + 1;
if (!IS_ARM(board) || version < 216) {
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else if (_curveParam < 0)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
else
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
@@ -1080,7 +1105,7 @@ class InputField: public TransformedField {
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
internalField.Append(new SpareBitsField<8>());
}
@@ -1133,7 +1158,11 @@ class InputField: public TransformedField {
virtual void beforeExport()
{
_weight = smallGvarToEEPROM(expo.weight);
_weight = smallGvarToEEPROM(expo.weight);
if (IS_TARANIS(board) && version >= 216) {
_offset = smallGvarToEEPROM(expo.offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
@@ -1166,6 +1195,10 @@ class InputField: public TransformedField {
expo.weight = smallGvarToC9x(_weight);
if (IS_TARANIS(board) && version >= 216) {
expo.offset = smallGvarToC9x(_offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
@@ -1183,24 +1216,65 @@ class InputField: public TransformedField {
unsigned int version;
bool _curveMode;
int _weight;
int _offset;
int _curveParam;
};
class LimitField: public StructField {
public:
template <int shift>
static int exportLimitValue(int value)
{
const int GV1 = 4096;
if (value > 10000) {
return -GV1 + value - 10001;
}
if (value < -10000) {
return GV1 + value + 10000;
}
return value + shift;
}
template <int shift>
static int importLimitValue(int value)
{
/* GVARS mapping on radio:
GV1 = -4096
GV9 = -4088
-GV1 = 4095
-GV9 = 4087
*/
const int GV1 = 4096;
if (value >= GV1) {
return 10001 + value - GV1;
}
if (value >= GV1-9) {
return -10000 + value - GV1;
}
if (value < -GV1) {
return -10000 + value + GV1 + 1;
}
if (value < -GV1+9) {
return 10000 + value + GV1 + 1;
}
return value - shift;
}
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
StructField("Limit")
{
if (IS_TARANIS(board) && version >= 216) {
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
Append(new SignedField<8>(limit.ppmCenter));
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
}
else {
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
}
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
Append(new BoolField<1>(limit.symetrical));
Append(new BoolField<1>(limit.revert));
if (HAS_LARGE_LCD(board)) {
@@ -1255,14 +1329,14 @@ class CurvesField: public TransformedField {
if (IS_TARANIS(board) && version >= 216) {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
if (offset > maxPoints) {
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
EEPROMWarnings.push_back(::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints));
break;
}
}
else {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
if (offset > maxPoints - 5 * maxCurves) {
EEPROMWarnings += ::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
EEPROMWarnings.push_back(::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints));
break;
}
_curves[i] = offset;
@@ -1544,9 +1618,25 @@ class LogicalSwitchField: public TransformedField {
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
RawSource val2(csw.val2);
if (val2.type == SOURCE_TYPE_STICK && val2.index < NUM_STICKS) {
csw.val2 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val2.index).toValue();
}
}
}
else if (csw.func != LS_FN_OFF) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
}
csw.val2 = v2;
RawSource val1(csw.val1);
if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) {
@@ -1677,7 +1767,10 @@ class CustomFunctionsConversionTable: public ConversionTable {
addConversion(FuncPlayValue, val++);
if (IS_ARM(board)) {
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
if (IS_TARANIS(board))
addConversion(FuncPlayScript, val++);
else
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncBackgroundMusic, val++);
addConversion(FuncBackgroundMusicPause, val++);
@@ -1799,10 +1892,10 @@ class ArmCustomFunctionField: public TransformedField {
else
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216) {
*((uint16_t *)_param) = fn.param;
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
}
else {
*((uint32_t *)_param) = fn.param;
@@ -1818,7 +1911,7 @@ class ArmCustomFunctionField: public TransformedField {
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
}
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(_param, fn.paramarm, sizeof(_param));
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
@@ -1881,7 +1974,7 @@ class ArmCustomFunctionField: public TransformedField {
value = *((uint32_t *)_param);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
}
@@ -1893,7 +1986,7 @@ class ArmCustomFunctionField: public TransformedField {
fn.func = AssignFunc(fn.func + index);
fn.param = value;
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
}
else if (fn.func == FuncVolume) {
@@ -1986,9 +2079,9 @@ class AvrCustomFunctionField: public TransformedField {
_param = fn.param;
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
_union_param = fn.func - FuncSafetyCh1;
_union_param = fn.func - FuncOverrideCH1;
else if (version >= 213)
_active += ((fn.func % 4) << 1);
}
@@ -2046,7 +2139,7 @@ class AvrCustomFunctionField: public TransformedField {
fn.enabled = (_active & 0x01);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
fn.func = AssignFunc(fn.func + _union_param);
else if (version >= 213)
@@ -2061,6 +2154,10 @@ class AvrCustomFunctionField: public TransformedField {
if (version >= 216) {
fn.func = AssignFunc(fn.func + (_union_param >> 2));
fn.adjustMode = (_union_param & 0x03);
if (fn.adjustMode == 1)
sourcesConversionTable->importValue(_param, (int &)fn.param);
else if (fn.adjustMode == 2)
fn.param = RawSource(SOURCE_TYPE_GVAR, _param).toValue();
}
else if (version >= 213) {
fn.adjustMode = ((_active >> 1) & 0x03);
@@ -2331,10 +2428,9 @@ class FrskyField: public StructField {
Append(new UnsignedField<3>(frsky.varioSource));
Append(new SignedField<5>(frsky.varioCenterMin));
Append(new ConversionField< UnsignedField<3> >(frsky.currentSource, &telemetryCurrentSourceConversionTable, "Current Source"));
Append(new SignedField<8>(frsky.varioCenterMax));
Append(new SignedField<5>(frsky.varioCenterMax));
if (version >= 216) {
// TODO int8_t fasOffset;
Append(new SpareBitsField<8>());
Append(new SignedField<8>(frsky.fasOffset));
}
}
}
@@ -2390,13 +2486,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
for (int i=0; i<O9X_MAX_TIMERS; i++) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, POPULATE_TIMER_MODES));
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
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));
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<4>());
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<3>());
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
else if (afterrelease21March2013) {
@@ -2404,7 +2500,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<1>());
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
@@ -2415,7 +2511,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
else {
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
if (HAS_PERSISTENT_TIMERS(board)) {
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<15>());
}
}
@@ -2424,7 +2520,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_ARM(board))
internalField.Append(new UnsignedField<3>(modelData.telemetryProtocol));
else
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this telemetry protocol")));
internalField.Append(new BoolField<1>(modelData.thrTrim));
@@ -2528,12 +2624,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_TARANIS(board)) {
modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new UnsignedField<8>(modelData.trainerMode));
}
else if (IS_ARM(board) && version >= 216) {
modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
}
if (IS_ARM(board) && version >= 215) {
@@ -2753,8 +2849,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new SpareBitsField<16>()); // mAhUsed
internalField.Append(new SpareBitsField<32>()); // globalTimer
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
@@ -2800,10 +2896,12 @@ void OpenTxGeneralData::beforeExport()
sum += generalData.calibSpanPos[i];
if (++count == 12) break;
}
for (int i=0; i<4; i++) {
potsType[i] = generalData.potsType[i];
if (i<2 && potsType[i] == 1)
potsType[i] = 0;
if (IS_TARANIS(board)) {
for (int i=0; i<4; i++) {
potsType[i] = generalData.potsType[i];
if (i<2 && potsType[i] == 1)
potsType[i] = 0;
}
}
}
else {
@@ -2817,9 +2915,11 @@ void OpenTxGeneralData::beforeExport()
void OpenTxGeneralData::afterImport()
{
for (int i=0; i<4; i++) {
generalData.potsType[i] = potsType[i];
if (i<2 && potsType[i] == 0)
generalData.potsType[i] = 1;
if (IS_TARANIS(board)) {
for (int i=0; i<4; i++) {
generalData.potsType[i] = potsType[i];
if (i<2 && potsType[i] == 0)
generalData.potsType[i] = 1;
}
}
}
@@ -163,8 +163,20 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &mode
}
else {
// load from SD Backup, size is stored in index
QByteArray eepromData((char *)data, index);
open9xModel.Import(eepromData);
QByteArray backupData((char *)data, index);
QByteArray modelData;
if (IS_SKY9X(board))
modelData = backupData;
else
importRlc(modelData, backupData);
if (modelData.size()) {
open9xModel.Import(modelData);
// open9xModel.Dump();
model.used = true;
}
else {
model.clear();
}
}
return true;
@@ -369,10 +381,10 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
break;
case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
version = 216;
version = 217;
break;
case BOARD_M128:
version = 216;
version = 217;
break;
case BOARD_STOCK:
version = 216;
@@ -402,10 +414,21 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
}
}
if (!EEPROMWarnings.isEmpty())
if (!EEPROMWarnings.empty()) {
QString msg;
int noErrorsToDisplay = std::min((int)EEPROMWarnings.size(),10);
for (int n = 0; n < noErrorsToDisplay; n++) {
msg += "-" + EEPROMWarnings.front() + "\n";
EEPROMWarnings.pop_front();
}
if (!EEPROMWarnings.empty()) {
msg = QObject::tr("(displaying only first 10 warnings)") + "\n" + msg;
}
EEPROMWarnings.clear();
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("EEPROM saved with these warnings:") + "\n- " + EEPROMWarnings.remove(EEPROMWarnings.length()-1, 1).replace("\n", "\n- "));
QObject::tr("EEPROM saved with these warnings:") + "\n" + msg);
}
return size;
}
@@ -556,11 +579,11 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 24;
else
return 16;
case SafetyChannelCustomFunction:
return id.contains("noovveridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 32;
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
return 15;
else
return 12;
case CustomAndSwitches:
@@ -621,7 +644,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
case HasCvNames:
return (IS_TARANIS(board) ? 1 : 0);
case Telemetry:
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
if (board == BOARD_GRUVIN9X || IS_ARM(board) || id.contains("frsky") || id.contains("telemetrez"))
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
else
return 0;
case TelemetryBars:
return 1;
case TelemetryCustomScreens:
@@ -637,7 +663,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
case TelemetryMaxMultiplier:
return (IS_ARM(board) ? 32 : 8);
case PPMCenter:
return 1;
return (IS_TARANIS(board) || id.contains("ppmca")) ? 1 : 0;
case PPMUnitMicroseconds:
return id.contains("ppmus") ? 1 : 0;
case SYMLimits:
return 1;
case OptrexDisplay:
@@ -704,6 +732,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 0;
case MavlinkTelemetry:
return id.contains("mavlink") ? 1 : 0;
case HasInputDiff:
case HasMixerExpo:
return (IS_ARM(board) ? true : false);
default:
return 0;
}
@@ -871,6 +902,9 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version)
case 216:
// A lot of things (first github release)
break;
case 217:
// 3 logical switches removed on M128 / gruvin9x boards
break;
default:
return false;
}
@@ -904,11 +938,32 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
{
std::cout << "trying " << getName() << " backup import...";
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0 || eeprom[3] != 0x30+board) {
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
std::cout << " no\n";
return false;
}
BoardEnum backupBoard = (BoardEnum)-1;
switch (eeprom[3]) {
case 0x33:
backupBoard = BOARD_TARANIS;
break;
case 0x32:
backupBoard = BOARD_SKY9X;
break;
case 0x31:
backupBoard = BOARD_GRUVIN9X;
break;
default:
std::cout << " unknown board\n";
return false;
}
if (backupBoard != board) {
std::cout << " not right board\n";
return false;
}
uint8_t version = eeprom[4];
uint8_t bcktype = eeprom[5];
uint16_t size = ((uint16_t)eeprom[7] << 8) + eeprom[6];
@@ -997,6 +1052,15 @@ SimulatorInterface * OpenTxFirmware::getSimulator()
}
}
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
{
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
firmware->addOption("nooverridech", QObject::tr("No OverrideCH functions available"));
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE (no telemetry) at field") }, { "faimode", QObject::tr("FAI MODE (no telemetry) always enabled") }, { NULL } };
firmware->addOptions(fai_options);
}
void registerOpenTxFirmwares()
{
OpenTxFirmware * openTx;
@@ -1004,7 +1068,6 @@ void registerOpenTxFirmwares()
Option ext_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
/* 9x board */
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK);
@@ -1020,7 +1083,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOptions(nav_options);
@@ -1031,7 +1093,6 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
@@ -1041,7 +1102,7 @@ void registerOpenTxFirmwares()
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9x board with M128 chip */
@@ -1058,7 +1119,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOptions(nav_options);
@@ -1069,11 +1129,10 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR board */
@@ -1090,7 +1149,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1099,7 +1157,6 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
@@ -1108,7 +1165,7 @@ void registerOpenTxFirmwares()
openTx->addOption("nogps", QObject::tr("No GPS support"));
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR board with M128 chip */
@@ -1125,7 +1182,6 @@ void registerOpenTxFirmwares()
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1134,11 +1190,10 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* Gruvin9x board */
@@ -1153,7 +1208,6 @@ void registerOpenTxFirmwares()
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
openTx->addOptions(dsm2_options);
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1163,21 +1217,18 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
openTx->addOption("imperial", QObject::tr("Imperial units"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
#ifndef __APPLE__
/* SKY9X board */
/* Sky9x board */
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
openTx->addOption("nofp", QObject::tr("No flight modes"));
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
@@ -1187,10 +1238,8 @@ void registerOpenTxFirmwares()
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* 9XR-Pro */
@@ -1200,22 +1249,17 @@ void registerOpenTxFirmwares()
openTx->addOption("nofp", QObject::tr("No flight modes"));
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
openTx->addOption("battgraph", QObject::tr("Battery graph"));
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
openTx->addOptions(fai_options);
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
#endif
/* Taranis board */
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
@@ -1223,9 +1267,8 @@ void registerOpenTxFirmwares()
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOptions(fai_options);
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
/* Taranis Plus board */
@@ -1233,12 +1276,11 @@ void registerOpenTxFirmwares()
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
openTx->addOptions(fai_options);
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
default_firmware_variant = GetFirmware("opentx-9x-heli-templates-en");
default_firmware_variant = GetFirmware("opentx-taranis-en");
current_firmware_variant = default_firmware_variant;
}
@@ -18,7 +18,6 @@
#include "eeprominterface.h"
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
class RleFile;
+3 -4
View File
@@ -124,8 +124,8 @@ t_Th9xLimitData::t_Th9xLimitData()
t_Th9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -197,7 +197,7 @@ int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
if (source.type == SOURCE_TYPE_STICK)
v1 = 1+source.index;
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("th9x on this board doesn't have Rotary Encoders") + "\n";
EEPROMWarnings.push_back(::QObject::tr("th9x on this board doesn't have Rotary Encoders"));
v1 = 5+source.index;
}
else if (source.type == SOURCE_TYPE_MAX)
@@ -272,7 +272,6 @@ t_Th9xModelData::operator ModelData ()
/*c9x.protocol = (Protocol)protocol;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncTrims2Offsets;
+45 -23
View File
@@ -67,6 +67,11 @@ FlashInterface::FlashInterface(QString fileName):
if (flash_size > 0) {
version = seekLabel(VERS_MARK);
if (version.startsWith("opentx-")) {
int index = version.lastIndexOf('-');
flavour = version.mid(0, index);
version = version.mid(index+1);
}
date = seekLabel(DATE_MARK);
time = seekLabel(TIME_MARK);
eepromId = seekLabel(EEPR_MARK);
@@ -94,7 +99,7 @@ QString FlashInterface::seekString(const QString & string)
if (start > 0) {
start += string.length();
int end = -1;
for (int i=start; i<start+20; i++) {
for (int i=start; i<start+50; i++) {
char c = flash.at(i);
if (c == '\0' || c == '\036') {
end = i;
@@ -219,21 +224,13 @@ bool FlashInterface::setSplash(const QImage & newsplash)
QColor color;
QByteArray splash;
if (splash_format == QImage::Format_Indexed8) {
unsigned int idx = 0;
for (unsigned int y=0; y<splash_height; y+=8) {
for (unsigned int x=0; x<splash_width; x++) {
unsigned int values[] = { 255, 255, 255, 255 };
for (unsigned int z=0; z<8; z++) {
if (y+z < splash_height) {
QRgb gray = qGray(newsplash.pixel(x, y+z));
for (unsigned int i=0; i<4; i++) {
if (gray & (1<<(4+i)))
values[i] -= 1 << z;
}
}
}
for (int i=0; i<4; i++)
b[idx++] = values[i];
for (unsigned int y=0; y<splash_height; y++) {
unsigned int idx = (y/2)*splash_width;
for (unsigned int x=0; x<splash_width; x++, idx++) {
QRgb gray = qGray(newsplash.pixel(x, y));
uint8_t z = ((255-gray)*15)/255;
if (y & 1) z <<= 4;
b[idx] |= z;
}
}
}
@@ -243,7 +240,7 @@ bool FlashInterface::setSplash(const QImage & newsplash)
for (uint y=0; y<splash_height; y++) {
for (uint x=0; x<splash_width; x++) {
color = QColor(blackNwhite.pixel(x,y));
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
b[splash_width*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
}
}
}
@@ -278,10 +275,10 @@ QImage FlashInterface::getSplash()
QImage image(splash_width, splash_height, QImage::Format_RGB888);
if (splash_offset > 0) {
for (unsigned int y=0; y<splash_height; y++) {
unsigned int idx = (y/8)*splash_width*4;
unsigned int mask = (1 << (y%8));
for (unsigned int x=0; x<splash_width; x++, idx+=4) {
unsigned int z = ((flash.at(splash_offset+idx) & mask) ? 0x1 : 0) + ((flash.at(splash_offset+idx+1) & mask) ? 0x2 : 0) + ((flash.at(splash_offset+idx+2) & mask) ? 0x4 : 0) + ((flash.at(splash_offset+idx+3) & mask) ? 0x8 : 0);
unsigned int idx = (y/2)*splash_width;
for (unsigned int x=0; x<splash_width; x++, idx++) {
uint8_t byte = flash.at(splash_offset+idx);
unsigned int z = (y & 1) ? (byte >> 4) : (byte & 0x0F);
z = 255-(z*255)/15;
QRgb rgb = qRgb(z, z, z);
image.setPixel(x, y, rgb);
@@ -293,9 +290,11 @@ QImage FlashInterface::getSplash()
else {
QImage image(splash_width, splash_height, QImage::Format_Mono);
if (splash_offset > 0) {
for (unsigned int y=0; y<splash_height; y++)
for(unsigned int x=0; x<splash_width; x++)
for (unsigned int y=0; y<splash_height; y++) {
for(unsigned int x=0; x<splash_width; x++) {
image.setPixel(x, y, (flash.at(splash_offset+(splash_width*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
}
}
}
return image;
}
@@ -311,6 +310,29 @@ bool FlashInterface::isValid()
return isValidFlag;
}
QString FlashInterface::getFlavour()
{
if (flavour == "opentx-x9dp")
return "opentx-taranis-plus";
else if (flavour == "opentx-x9d")
return "opentx-taranis";
else
return flavour;
}
bool FlashInterface::isHardwareCompatible(FlashInterface &previousFirmware)
{
QString newFlavour = getFlavour();
if (newFlavour.isEmpty())
return true;
QString previousFlavour = previousFirmware.getFlavour();
if (previousFlavour.isEmpty())
return true;
return (newFlavour == previousFlavour);
}
uint FlashInterface::saveFlash(QString fileName)
{
uint8_t binflash[MAX_FSIZE];
+3
View File
@@ -47,6 +47,7 @@ class FlashInterface
inline QString getDate() { return date; }
inline QString getTime() { return time; }
int getSize() { return flash_size; }
QString getFlavour();
inline QString getVersion() { return version; }
unsigned int getVersionId() { return versionId; }
inline int getEEpromVersion() { return eepromVersion; }
@@ -60,6 +61,7 @@ class FlashInterface
QImage::Format getSplashFormat();
uint saveFlash(QString fileName);
bool isValid();
bool isHardwareCompatible(FlashInterface &previousFirmware);
private:
QByteArray flash;
@@ -72,6 +74,7 @@ class FlashInterface
QString filename;
QString date;
QString time;
QString flavour;
QString version;
int versionId;
QString eepromId;
+5 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>416</width>
<height>153</height>
<height>154</height>
</rect>
</property>
<property name="sizePolicy">
@@ -177,6 +177,10 @@ May be different from firmware language</string>
</layout>
</widget>
<tabstops>
<tabstop>checkFWUpdates</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>voice_dnld</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+7
View File
@@ -316,6 +316,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->switchesDelay->hide();
ui->switchesDelayLabel->hide();
}
ui->blAlarm_ChkB->setChecked(g_eeGeneral.flashBeep);
disableMouseScrolling();
}
@@ -325,6 +326,12 @@ GeneralEdit::~GeneralEdit()
delete ui;
}
void GeneralEdit::on_blAlarm_ChkB_stateChanged()
{
g_eeGeneral.flashBeep = ui->blAlarm_ChkB->isChecked();
updateSettings();
}
void GeneralEdit::stickReverseEdited()
{
g_eeGeneral.stickReverse = ((int)ui->stickReverse1->isChecked()) | ((int)ui->stickReverse2->isChecked()<<1) | ((int)ui->stickReverse3->isChecked()<<2) | ((int)ui->stickReverse4->isChecked()<<3);
+1
View File
@@ -137,6 +137,7 @@ class GeneralEdit : public QDialog
void shrink();
void stickReverseEdited();
void on_switchesDelay_valueChanged();
void on_blAlarm_ChkB_stateChanged();
};
#endif // GENERALEDIT_H
+161 -57
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>804</width>
<width>879</width>
<height>912</height>
</rect>
</property>
@@ -113,17 +113,31 @@ These will be relevant for all models in the same EEPROM.</string>
<string>Setup</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0,0">
<item row="34" column="4">
<item row="34" column="3">
<widget class="QLabel" name="gpsFormatLabel">
<property name="text">
<string>GPS Coordinates</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="36" column="4">
<widget class="QComboBox" name="voiceLang_CB"/>
</item>
<item row="31" column="3">
<item row="33" column="3">
<widget class="QLabel" name="units_label">
<property name="text">
<string>Measurement Units</string>
</property>
</widget>
</item>
<item row="32" column="4">
<item row="34" column="4">
<widget class="QComboBox" name="gpsFormatCB">
<item>
<property name="text">
@@ -137,7 +151,7 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</widget>
</item>
<item row="33" column="4">
<item row="35" column="4">
<widget class="QSpinBox" name="timezoneSB">
<property name="minimum">
<number>-14</number>
@@ -150,28 +164,21 @@ These will be relevant for all models in the same EEPROM.</string>
</property>
</widget>
</item>
<item row="34" column="3">
<item row="36" column="3">
<widget class="QLabel" name="VoiceLang_label">
<property name="text">
<string>Voice Language</string>
</property>
</widget>
</item>
<item row="32" column="3">
<widget class="QLabel" name="gpsFormatLabel">
<property name="text">
<string>GPS Coordinates</string>
</property>
</widget>
</item>
<item row="33" column="3">
<item row="35" column="3">
<widget class="QLabel" name="label_timezone">
<property name="text">
<string>Timeshift from UTC</string>
</property>
</widget>
</item>
<item row="31" column="4">
<item row="33" column="4">
<widget class="QComboBox" name="units_CB">
<item>
<property name="text">
@@ -185,14 +192,14 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</widget>
</item>
<item row="29" column="3">
<item row="31" column="3">
<widget class="QLabel" name="countrycode_label">
<property name="text">
<string>Country Code</string>
</property>
</widget>
</item>
<item row="29" column="4">
<item row="31" column="4">
<widget class="QComboBox" name="countrycode_CB">
<item>
<property name="text">
@@ -256,14 +263,7 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="14" column="4">
<item row="16" column="4">
<layout class="QHBoxLayout" name="backlightColor_Layout">
<item>
<widget class="QLabel" name="backlightColor1_label">
@@ -275,7 +275,10 @@ These will be relevant for all models in the same EEPROM.</string>
<item>
<widget class="QSlider" name="backlightColor_SL">
<property name="maximum">
<number>100</number>
<number>20</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -298,7 +301,7 @@ These will be relevant for all models in the same EEPROM.</string>
</property>
</widget>
</item>
<item row="15" column="3">
<item row="17" column="3">
<widget class="QLabel" name="re_label">
<property name="text">
<string>RotEnc Navigation</string>
@@ -333,7 +336,7 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</widget>
</item>
<item row="27" column="0">
<item row="29" column="0">
<widget class="QLabel" name="ro_label">
<property name="text">
<string>Readonly Unlock</string>
@@ -343,7 +346,7 @@ These will be relevant for all models in the same EEPROM.</string>
</property>
</widget>
</item>
<item row="36" column="0" colspan="2">
<item row="38" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -426,7 +429,7 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</widget>
</item>
<item row="13" column="2">
<item row="14" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -526,7 +529,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="27" column="1" colspan="3">
<item row="29" column="1" colspan="3">
<layout class="QGridLayout" name="TaranisReadOnlyUnlock" rowstretch="0,0" columnstretch="0,0,0,0,0,0,0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
@@ -1199,7 +1202,7 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="13" column="3">
<item row="14" column="3">
<widget class="QLabel" name="label_BLBright">
<property name="text">
<string>Backlight Brightness</string>
@@ -1220,17 +1223,17 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="13" column="4">
<item row="14" column="4">
<widget class="QSpinBox" name="BLBright_SB">
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="15" column="4">
<item row="17" column="4">
<widget class="QComboBox" name="re_CB"/>
</item>
<item row="14" column="3">
<item row="16" column="3">
<widget class="QLabel" name="backlightColor_label">
<property name="text">
<string>Backlight color</string>
@@ -1272,7 +1275,7 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="17" column="1">
<widget class="QComboBox" name="mavbaud_CB">
<item>
<property name="text">
@@ -1374,7 +1377,7 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="16" column="1">
<widget class="QCheckBox" name="memwarnChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@@ -1409,7 +1412,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="15" column="0">
<item row="17" column="0">
<widget class="QLabel" name="mavbaud_label">
<property name="text">
<string>MAVLink Baud Rate</string>
@@ -1465,7 +1468,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="QCheckBox" name="alarmwarnChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -1579,14 +1582,14 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>&quot;No Sound&quot; Warning</string>
</property>
</widget>
</item>
<item row="14" column="0">
<item row="16" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Low Memory Warning</string>
@@ -1696,14 +1699,14 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="29" column="0">
<item row="31" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Stick Mode</string>
</property>
</widget>
</item>
<item row="31" column="0">
<item row="33" column="0">
<widget class="QLabel" name="stickReverseLB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -1716,7 +1719,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="32" column="0">
<item row="34" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -1729,14 +1732,14 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="33" column="0">
<item row="35" column="0">
<widget class="QLabel" name="label_faimode">
<property name="text">
<string>FAI Mode</string>
</property>
</widget>
</item>
<item row="29" column="1">
<item row="31" column="1">
<widget class="QComboBox" name="stickmodeCB">
<property name="toolTip">
<string/>
@@ -1790,7 +1793,7 @@ Mode 4:
</item>
</widget>
</item>
<item row="31" column="1">
<item row="33" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="stickReverse1">
@@ -1822,7 +1825,7 @@ Mode 4:
</item>
</layout>
</item>
<item row="32" column="1">
<item row="34" column="1">
<widget class="QComboBox" name="channelorderCB">
<property name="toolTip">
<string/>
@@ -1958,7 +1961,7 @@ Mode 4:
</item>
</widget>
</item>
<item row="33" column="1">
<item row="35" column="1">
<widget class="QCheckBox" name="faimode_CB">
<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>
@@ -1968,7 +1971,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="34" column="0">
<item row="36" column="0">
<widget class="QLabel" name="switchesDelayLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -1981,7 +1984,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="34" column="1">
<item row="36" column="1">
<widget class="QSpinBox" name="switchesDelay">
<property name="toolTip">
<string/>
@@ -1993,9 +1996,9 @@ Mode 4:
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;LCD Screen Contrast&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Values can be 20-45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Play Delay&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Values can be 0ms-300ms&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="suffix">
<string> ms</string>
@@ -2014,6 +2017,20 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QLabel" name="blAlarm_LB">
<property name="text">
<string>Backlight flash on alarm</string>
</property>
</widget>
</item>
<item row="13" column="4">
<widget class="QCheckBox" name="blAlarm_ChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTrainer">
@@ -3181,7 +3198,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3189,6 +3206,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
@@ -3222,7 +3244,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3230,6 +3252,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
@@ -3270,7 +3297,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3278,6 +3305,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
@@ -3316,6 +3348,58 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>beeperCB</tabstop>
<tabstop>beeperlenCB</tabstop>
<tabstop>hapticmodeCB</tabstop>
<tabstop>hapticLengthCB</tabstop>
<tabstop>hapticStrength</tabstop>
<tabstop>battwarningDSB</tabstop>
<tabstop>contrastSB</tabstop>
<tabstop>displayTypeCB</tabstop>
<tabstop>inactimerSB</tabstop>
<tabstop>splashScreenChkB</tabstop>
<tabstop>splashScreenDuration</tabstop>
<tabstop>alarmwarnChkB</tabstop>
<tabstop>memwarnChkB</tabstop>
<tabstop>mavbaud_CB</tabstop>
<tabstop>chkSA</tabstop>
<tabstop>chkSB</tabstop>
<tabstop>chkSC</tabstop>
<tabstop>chkSD</tabstop>
<tabstop>chkSE</tabstop>
<tabstop>chkSF</tabstop>
<tabstop>chkSG</tabstop>
<tabstop>chkSH</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>stickReverse1</tabstop>
<tabstop>stickReverse2</tabstop>
<tabstop>stickReverse3</tabstop>
<tabstop>stickReverse4</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>faimode_CB</tabstop>
<tabstop>switchesDelay</tabstop>
<tabstop>soundModeCB</tabstop>
<tabstop>speakerPitchSB</tabstop>
<tabstop>volume_SB</tabstop>
<tabstop>beepVolume_SL</tabstop>
<tabstop>wavVolume_SL</tabstop>
<tabstop>varioVolume_SL</tabstop>
<tabstop>bgVolume_SL</tabstop>
<tabstop>varioP0_SB</tabstop>
<tabstop>varioPMax_SB</tabstop>
<tabstop>varioR0_SB</tabstop>
<tabstop>backlightswCB</tabstop>
<tabstop>backlightautoSB</tabstop>
<tabstop>blAlarm_ChkB</tabstop>
<tabstop>BLBright_SB</tabstop>
<tabstop>backlightColor_SL</tabstop>
<tabstop>re_CB</tabstop>
<tabstop>countrycode_CB</tabstop>
<tabstop>units_CB</tabstop>
<tabstop>gpsFormatCB</tabstop>
<tabstop>timezoneSB</tabstop>
<tabstop>voiceLang_CB</tabstop>
<tabstop>trnMode_1</tabstop>
<tabstop>trnChn_1</tabstop>
<tabstop>trnWeight_1</tabstop>
@@ -3340,12 +3424,32 @@ p, li { white-space: pre-wrap; }
<tabstop>ana4Neg</tabstop>
<tabstop>ana4Mid</tabstop>
<tabstop>ana4Pos</tabstop>
<tabstop>pot1Type</tabstop>
<tabstop>pot2Type</tabstop>
<tabstop>pot3Type</tabstop>
<tabstop>serialPortMode</tabstop>
<tabstop>battCalibDSB</tabstop>
<tabstop>CurrentCalib_SB</tabstop>
<tabstop>PPM1</tabstop>
<tabstop>PPM2</tabstop>
<tabstop>PPM3</tabstop>
<tabstop>PPM4</tabstop>
<tabstop>PPM_MultiplierDSB</tabstop>
<tabstop>ana5Neg</tabstop>
<tabstop>ana5Mid</tabstop>
<tabstop>ana5Pos</tabstop>
<tabstop>ana6Neg</tabstop>
<tabstop>ana6Mid</tabstop>
<tabstop>ana6Pos</tabstop>
<tabstop>ana7Neg</tabstop>
<tabstop>ana7Mid</tabstop>
<tabstop>ana7Pos</tabstop>
<tabstop>ana8Neg</tabstop>
<tabstop>ana8Mid</tabstop>
<tabstop>ana8Pos</tabstop>
<tabstop>profile_CB</tabstop>
<tabstop>calretrieve_PB</tabstop>
<tabstop>calstore_PB</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
+185 -60
View File
@@ -1,4 +1,11 @@
#include <QtGui>
#if defined WIN32
#include <io.h>
#include <stdio.h>
#endif
#if !defined WIN32 && defined __GNUC__
#include <unistd.h>
#endif
#include "appdata.h"
#include "helpers.h"
#include "simulatordialog.h"
@@ -140,18 +147,18 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
}
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
sb(dynamic_cast<QSpinBox *>(weightSB)),
dsb(dynamic_cast<QDoubleSpinBox *>(weightSB)),
weightCB(weightCB),
weight(weight),
flags(flags),
lock(false)
step(step),
lock(true)
{
lock = true;
if (GetCurrentFirmware()->getCapability(Gvars)) {
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(weightCB, weight);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
@@ -163,21 +170,32 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
}
}
weightSB->setMinimum(mini);
weightSB->setMaximum(maxi);
int val;
if (weight>maxi || weight<mini) {
val = deflt;
weightGV->setChecked(true);
weightSB->hide();
weightCB->show();
}
else {
val = weight;
weightGV->setChecked(false);
weightSB->setValue(weight);
weightSB->show();
weightCB->hide();
}
if (sb) {
sb->setMinimum(mini);
sb->setMaximum(maxi);
sb->setValue(val);
}
else {
dsb->setMinimum(mini*step);
dsb->setMaximum(maxi*step);
dsb->setValue(val*step);
}
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
lock = false;
@@ -186,16 +204,23 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
void GVarGroup::gvarCBChanged(int state)
{
weightCB->setVisible(state);
weightSB->setVisible(!state);
if (weightSB)
weightSB->setVisible(!state);
else
weightSB->setVisible(!state);
valuesChanged();
}
void GVarGroup::valuesChanged()
{
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else
weight = weightSB->value();
if (!lock) {
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
}
}
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
@@ -209,14 +234,14 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
lock(false),
lastType(-1)
{
curveTypeCB->addItem(tr("Diff"));
curveTypeCB->addItem(tr("Expo"));
curveTypeCB->addItem(tr("Func"));
curveTypeCB->addItem(tr("Curve"));
if (!(flags & HIDE_DIFF)) curveTypeCB->addItem(tr("Diff"), 0);
if (!(flags & HIDE_EXPO)) curveTypeCB->addItem(tr("Expo"), 1);
curveTypeCB->addItem(tr("Func"), 2);
curveTypeCB->addItem(tr("Curve"), 3);
curveValueCB->setMaxVisibleItems(10);
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
@@ -228,10 +253,12 @@ void CurveGroup::update()
{
lock = true;
curveTypeCB->setCurrentIndex(curve.type);
int found = curveTypeCB->findData(curve.type);
if (found < 0) found = 0;
curveTypeCB->setCurrentIndex(found);
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
curveGVarCB->show();
curveGVarCB->setVisible(GetCurrentFirmware()->getCapability(Gvars));
if (curve.value > 100 || curve.value < -100) {
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
@@ -271,11 +298,13 @@ void CurveGroup::update()
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=-numcurves; i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
if (i == curve.value) {
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
}
}
}
curveValueCB->setCurrentIndex(curve.value+numcurves);
break;
}
default:
@@ -290,7 +319,7 @@ void CurveGroup::gvarCBChanged(int state)
{
if (!lock) {
if (state) {
curve.value = 10000; // TODO constant in EEpromInterface ...
curve.value = 10000+1; // TODO constant in EEpromInterface ...
}
else {
curve.value = 0; // TODO could be better
@@ -300,10 +329,33 @@ void CurveGroup::gvarCBChanged(int state)
}
}
void CurveGroup::typeChanged(int value)
{
if (!lock) {
int type = curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
switch (type) {
case 0:
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
break;
case 1:
curve = CurveReference(CurveReference::CURVE_REF_EXPO, 0);
break;
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, 0);
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, 0);
break;
}
update();
}
}
void CurveGroup::valuesChanged()
{
if (!lock) {
switch (curveTypeCB->currentIndex()) {
switch (curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt()) {
case 0:
case 1:
{
@@ -312,14 +364,14 @@ void CurveGroup::valuesChanged()
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
else
value = curveValueSB->value();
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
curve = CurveReference(curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
break;
}
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->itemData(curveValueCB->currentIndex()).toInt());
break;
}
@@ -349,13 +401,13 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
}
}
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context)
{
RawSwitch item;
b->clear();
if (attr & POPULATE_ONOFF) {
if (context != MixesContext) {
// !FMx
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<0; i++) {
@@ -364,14 +416,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
// !One
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// OFF
item = RawSwitch(SWITCH_TYPE_OFF);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=-GetCurrentFirmware()->getCapability(LogicalSwitches); i<0; i++) {
@@ -404,11 +448,15 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
for (int i=-GetCurrentFirmware()->getCapability(SwitchesPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
//hide up and down for !SH and !SF, because they are redundant (!SFup == SFdown)
if (item.toString().contains("H") || item.toString().contains("F")) continue;
}
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_TIMER_MODES) {
if (context == TimersContext) {
for (int i=0; i<5; i++) {
item = RawSwitch(SWITCH_TYPE_TIMER_MODE, i);
b->addItem(item.toString(), item.toValue());
@@ -455,7 +503,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_ONOFF) {
if (context == CustomFunctionsContext) {
// ON
item = RawSwitch(SWITCH_TYPE_ON);
b->addItem(item.toString(), item.toValue());
@@ -464,7 +512,10 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// FMx
}
// FMx
if (context != MixesContext) {
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=1; i<=GetCurrentFirmware()->getCapability(FlightModes); i++) {
item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i);
@@ -756,19 +807,35 @@ QString getFrSkySrc(int index)
QString getTrimInc(ModelData * g_model)
{
switch (g_model->trimInc) {
case (1): return QObject::tr("Extra Fine");
case (2): return QObject::tr("Fine");
case (3): return QObject::tr("Medium");
case (4): return QObject::tr("Coarse");
default: return QObject::tr("Exponential");
}
switch (g_model->trimInc) {
case -2:
return QObject::tr("Exponential");
case -1:
return QObject::tr("Extra Fine");
case 0:
return QObject::tr("Fine");
case 1:
return QObject::tr("Medium");
case 2:
return QObject::tr("Coarse");
default:
return QObject::tr("Unknown");
}
}
QString getTimerStr(TimerData & timer)
{
QString str = ", " + (timer.dir ? QObject::tr("Count Up") : QObject::tr("Count Down"));
return QObject::tr("%1:%2, ").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0')) + timer.mode.toString() + str;
QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0'));
result += QString(", ") + timer.mode.toString();
if (timer.persistent)
result += QObject::tr(", Persistent");
if (timer.minuteBeep)
result += QObject::tr(", MinuteBeep");
if (timer.countdownBeep == 1)
result += QObject::tr(", CountDown(Beeps)");
else if (timer.countdownBeep == 2)
result += QObject::tr(", CountDown(Voice)");
return result;
}
QString getProtocol(ModelData * g_model)
@@ -809,18 +876,37 @@ QString getPhasesStr(unsigned int phases, ModelData & model)
}
}
QString getCenterBeep(ModelData * g_model)
QString getCenterBeepStr(ModelData * g_model)
{
//RETA123
QStringList strl;
if(g_model->beepANACenter & 0x01) strl << QObject::tr("Rudder");
if(g_model->beepANACenter & 0x02) strl << QObject::tr("Elevator");
if(g_model->beepANACenter & 0x04) strl << QObject::tr("Throttle");
if(g_model->beepANACenter & 0x08) strl << QObject::tr("Aileron");
if(g_model->beepANACenter & 0x10) strl << "P1";
if(g_model->beepANACenter & 0x20) strl << "P2";
if(g_model->beepANACenter & 0x40) strl << "P3";
if(g_model->beepANACenter & 0x80) strl << "LS";
if (g_model->beepANACenter & 0x01)
strl << QObject::tr("Rudder");
if (g_model->beepANACenter & 0x02)
strl << QObject::tr("Elevator");
if (g_model->beepANACenter & 0x04)
strl << QObject::tr("Throttle");
if (g_model->beepANACenter & 0x08)
strl << QObject::tr("Aileron");
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
if (g_model->beepANACenter & 0x10)
strl << "S1";
if (g_model->beepANACenter & 0x20)
strl << "S2";
if (g_model->beepANACenter & 0x40)
strl << "S3";
if (g_model->beepANACenter & 0x80)
strl << "LS";
if (g_model->beepANACenter & 0x100)
strl << "RS";
}
else {
if (g_model->beepANACenter & 0x10)
strl << "P1";
if (g_model->beepANACenter & 0x20)
strl << "P2";
if (g_model->beepANACenter & 0x40)
strl << "P3";
}
return strl.join(", ");
}
@@ -938,3 +1024,42 @@ QString index2version(int index)
return QString();
}
}
int qunlink(const QString & fileName)
{
QByteArray ba = fileName.toLatin1();
return unlink(ba.constData());
}
QString generateProcessUniqueTempFileName(const QString & fileName)
{
QString sanitizedFileName = fileName;
sanitizedFileName.remove('/');
return QDir::tempPath() + QString("/%1-").arg(QCoreApplication::applicationPid()) + sanitizedFileName;
}
QString getSoundsPath(const GeneralSettings &generalSettings)
{
QString path = g.profile[g.id()].sdPath() + "/SOUNDS/";
QString lang = generalSettings.ttsLanguage;
if (lang.isEmpty())
lang = "en";
path.append(lang);
return path;
}
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen)
{
QSet<QString> result;
QDir dir(path);
if (dir.exists()) {
foreach (QString filename, dir.entryList(filter, QDir::Files)) {
QFileInfo file(filename);
QString name = file.completeBaseName();
if (name.length() <= maxLen) {
result.insert(name);
}
}
}
return result;
}
+29 -9
View File
@@ -6,7 +6,7 @@
extern const QColor colors[C9X_MAX_CURVES];
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
#define TMR_NUM_OPTION (TMRMODE_COUNT+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
//convert from mode 1 to mode generalSettings.stickMode
//NOTICE! => 1..4 -> 1..4
@@ -37,12 +37,12 @@ class CompanionIcon: public QIcon {
CompanionIcon(QString baseimage);
};
class GVarGroup : public QObject {
class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -50,13 +50,19 @@ class GVarGroup : public QObject {
protected:
QCheckBox *weightGV;
QSpinBox *weightSB;
QAbstractSpinBox *weightSB;
QSpinBox *sb;
QDoubleSpinBox *dsb;
QComboBox *weightCB;
int & weight;
const unsigned int flags;
double step;
bool lock;
};
#define HIDE_DIFF 0x01
#define HIDE_EXPO 0x02
#define HIDE_NEGATIVE_CURVES 0x04
class CurveGroup : public QObject {
Q_OBJECT
@@ -67,6 +73,7 @@ class CurveGroup : public QObject {
protected slots:
void gvarCBChanged(int);
void typeChanged(int);
void valuesChanged();
protected:
@@ -80,9 +87,15 @@ class CurveGroup : public QObject {
int lastType;
};
#define POPULATE_ONOFF 0x01
#define POPULATE_TIMER_MODES 0x02
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
enum SwitchContext
{
LogicalSwitchesContext,
CustomFunctionsContext,
TimersContext,
MixesContext
};
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context);
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
@@ -113,7 +126,7 @@ int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModelData * g_model);
QString getCenterBeep(ModelData * g_model);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */
QString getFrSkyAlarmType(int alarm);
@@ -138,4 +151,11 @@ class QTimeS : public QTime
int seconds() const { return hour()*3600 + minute()*60 + second(); };
};
int qunlink(const QString & fileName);
QString generateProcessUniqueTempFileName(const QString & fileName);
QString getSoundsPath(const GeneralSettings &generalSettings);
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
#endif // HELPERS_H
+20 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>685</width>
<height>418</height>
<height>432</height>
</rect>
</property>
<property name="sizePolicy">
@@ -441,6 +441,25 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>backLightColor</tabstop>
<tabstop>joystickCB</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>simuSW</tabstop>
<tabstop>snapshotPath</tabstop>
<tabstop>snapshotPathButton</tabstop>
<tabstop>snapshotClipboardCKB</tabstop>
<tabstop>libraryPath</tabstop>
<tabstop>libraryPathButton</tabstop>
<tabstop>splashincludeCB</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>splashLibraryButton</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>InvertPixels</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
+25 -43
View File
@@ -184,46 +184,33 @@ void logsDialog::on_mapsButton_clicked() {
int latcol=0, longcol=0, altcol=0, speedcol=0;
int itemSelected=0.;
bool rangeSelected=false;
enum fieldtype {
T_F,
I_F,
F_F,
G_F
};
ui->FieldsTW->setDisabled(true);
ui->logTable->setDisabled(true);
QString fields[]={"SWR","RSSI","A1","A2","GPS Date"\
,"GPS Time","Long","Lat","Course","GPS Speed","GPS Alt","Baro Alt"\
,"Vertical Speed","Temp1","Temp2","RPM","Fuel","Cell volts","Cell 1"\
,"Cell 2","Cell 3","Cell 4","Cell 5","Cell 6","Current","Consumption"\
,"Vfas","AccelX","AccelY","AccelZ","Rud","Ele","Thr","Ail"\
,"S1","S2","LS","RS","SA","SB","SC","SD","SE","SF","SG","SH"};
int fieldstype[]={I_F,I_F,F_F,F_F,T_F\
,T_F,G_F,G_F,F_F,G_F,G_F,F_F\
,F_F,F_F,F_F,I_F,I_F,F_F,F_F\
,F_F,F_F,F_F,F_F,F_F,F_F,F_F\
,F_F,F_F,F_F,F_F,I_F,I_F,I_F,I_F\
,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F};
QString gePath=g.gePath();
if (gePath.isEmpty() || !QFile(gePath).exists()) {
ui->FieldsTW->setDisabled(false);
ui->logTable->setDisabled(false);
return;
}
QSet<int> nondataCols;
for (int i=1; i<csvlog.at(0).count(); i++) {
//Long,Lat,Course,GPS Speed,GPS Alt
if (csvlog.at(0).at(i).contains("Long")) {
longcol=i;
nondataCols << i;
}
if (csvlog.at(0).at(i).contains("Lat")) {
latcol=i;
nondataCols << i;
}
if (csvlog.at(0).at(i).contains("GPS Alt")) {
altcol=i;
nondataCols << i;
}
if (csvlog.at(0).at(i).contains("GPS Speed")) {
speedcol=i;
nondataCols << i;
}
}
if (longcol==0 || latcol==0 || altcol==0) {
@@ -239,13 +226,13 @@ void logsDialog::on_mapsButton_clicked() {
itemSelected=n-1;
}
QString geFilename = QDir::tempPath() + "/track0.png";
if (QFile::exists(geFilename)) {
QFile::remove(geFilename);
QString geIconFilename = generateProcessUniqueTempFileName("track0.png");
if (QFile::exists(geIconFilename)) {
QFile::remove(geIconFilename);
}
QFile::copy(":/images/track0.png", geFilename);
QFile::copy(":/images/track0.png", geIconFilename);
geFilename = QDir::tempPath() + "/flight.kml";
QString geFilename = generateProcessUniqueTempFileName("flight.kml");
if (QFile::exists(geFilename)) {
QFile::remove(geFilename);
}
@@ -264,29 +251,21 @@ void logsDialog::on_mapsButton_clicked() {
QTextStream outputStream(&geFile);
outputStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\">\n";
outputStream << "\t<Document>\n\t\t<name>" << logFilename << "</name>\n";
outputStream << "\t\t<Style id=\"multiTrack_n\">\n\t\t\t<IconStyle>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << QDir::tempPath() << "/track0.png</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<Style id=\"multiTrack_n\">\n\t\t\t<IconStyle>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << geIconFilename << "</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<Style id=\"multiTrack_h\">\n\t\t\t<IconStyle>\n\t\t\t\t<scale>0</scale>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << QDir::tempPath() << "/track0.png</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>8</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<StyleMap id=\"multiTrack\">\n\t\t\t<Pair>\n\t\t\t\t<key>normal</key>\n\t\t\t\t<styleUrl>#multiTrack_n</styleUrl>\n\t\t\t</Pair>\n\t\t\t<Pair>\n\t\t\t\t<key>highlight</key>\n\t\t\t\t<styleUrl>#multiTrack_h</styleUrl>\n\t\t\t</Pair>\n\t\t</StyleMap>\n";
outputStream << "\t\t<Style id=\"lineStyle\">\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<Schema id=\"schema\">\n";
outputStream << "\t\t\t<gx:SimpleArrayField name=\"GPSSpeed\" type=\"float\">\n\t\t\t\t<displayName>GPS Speed</displayName>\n\t\t\t</gx:SimpleArrayField>\n";
// declare additional fields
for (int i=0; i<csvlog.at(0).count()-2; i++) {
if (ui->FieldsTW->item(0,i)->isSelected() && fieldstype[i]!=G_F ) {
outputStream << "\t\t\t<gx:SimpleArrayField name=\""<< fields[i].replace(" ","_") <<"\" ";
switch (fieldstype[i]) {
case T_F:
outputStream << "type=\"string\"";
break;
case I_F:
outputStream << "type=\"int\"";
break;
case F_F:
outputStream << "type=\"float\"";
break;
default:
break;
}
outputStream << ">\n\t\t\t\t<displayName>" << fields[i] << "</displayName>\n\t\t\t</gx:SimpleArrayField>\n";
if (ui->FieldsTW->item(0,i)->isSelected() && !nondataCols.contains(i+2)) {
QString origName = csvlog.at(0).at(i+2);
QString safeName = origName;
safeName.replace(" ","_");
outputStream << "\t\t\t<gx:SimpleArrayField name=\""<< safeName <<"\" ";
outputStream << "type=\"string\""; // additional fields have fixed type: string
outputStream << ">\n\t\t\t\t<displayName>" << origName << "</displayName>\n\t\t\t</gx:SimpleArrayField>\n";
}
}
outputStream << "\t\t</Schema>\n";
@@ -335,9 +314,12 @@ void logsDialog::on_mapsButton_clicked() {
}
}
outputStream << "\t\t\t\t\t\t\t</gx:SimpleArrayData>\n";
// add values for additional fields
for (int i=0; i<csvlog.at(0).count()-2; i++) {
if (ui->FieldsTW->item(0,i)->isSelected() && fieldstype[i]!= G_F ) {
outputStream << "\t\t\t\t\t\t\t<gx:SimpleArrayData name=\""<< fields[i].replace(" ","_") <<"\">\n";
if (ui->FieldsTW->item(0,i)->isSelected() && !nondataCols.contains(i+2)) {
QString safeName = csvlog.at(0).at(i+2);;
safeName.replace(" ","_");
outputStream << "\t\t\t\t\t\t\t<gx:SimpleArrayData name=\""<< safeName <<"\">\n";
for (int j=1; j<n; j++) {
if ((ui->logTable->item(j-1,1)->isSelected() &&rangeSelected) || !rangeSelected) {
outputStream << "\t\t\t\t\t\t\t\t<gx:value>"<< csvlog.at(j).at(i+2) <<"</gx:value>\n";
+11
View File
@@ -287,6 +287,17 @@
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>FileName_LE</tabstop>
<tabstop>fileOpen_BT</tabstop>
<tabstop>FieldsTW</tabstop>
<tabstop>ZoomX_ChkB</tabstop>
<tabstop>ZoomY_ChkB</tabstop>
<tabstop>Reset_PB</tabstop>
<tabstop>sessions_CB</tabstop>
<tabstop>logTable</tabstop>
<tabstop>mapsButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
+35 -22
View File
@@ -64,8 +64,8 @@
#include "helpers.h"
#include "appdata.h"
#include "radionotfound.h"
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
#ifdef __APPLE__
@@ -632,7 +632,6 @@ void MainWindow::loadProfile() //TODO Load all variables - Also HW!
int profnum=action->data().toInt();
g.id( profnum );
// TODO Get rid of this global variable - The profile.firmware is the real source
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
@@ -805,9 +804,9 @@ QStringList MainWindow::GetSambaArguments(const QString &tcl)
{
QStringList result;
QString tclFilename = QDir::tempPath() + "/temp.tcl";
QString tclFilename = generateProcessUniqueTempFileName("temp.tcl");
if (QFile::exists(tclFilename)) {
unlink(tclFilename.toAscii());
qunlink(tclFilename);
}
QFile tclFile(tclFilename);
if (!tclFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -947,21 +946,23 @@ QString MainWindow::FindMassstoragePath(QString filename)
void MainWindow::readEeprom()
{
QString tempDir = QDir::tempPath();
QString tempFile;
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_ARM(eepromInterface->getBoard()))
tempFile = tempDir + "/temp.bin";
tempFile = generateProcessUniqueTempFileName("temp.bin");
else
tempFile = tempDir + "/temp.hex";
tempFile += generateProcessUniqueTempFileName("temp.hex");
qDebug() << "MainWindow::readEeprom(): using temp file: " << tempFile;
if (readEepromFromRadio(tempFile, tr("Read Models and Settings From Radio"))) {
MdiChild *child = createMdiChild();
child->newFile();
child->loadFile(tempFile, false);
child->show();
qunlink(tempFile);
}
}
@@ -976,7 +977,7 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
file.remove();
}
g.flashDir(QFileInfo(filename).dir().absolutePath());
// g.flashDir(QFileInfo(filename).dir().absolutePath());
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = FindMassstoragePath("FIRMWARE.BIN");
@@ -1043,7 +1044,10 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
QFile file(filename);
if (file.exists()) {
file.remove();
if (!file.remove()) {
QMessageBox::warning(this, tr("Error"), tr("Could not delete temporary file: %1").arg(filename));
return false;
}
}
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
@@ -1166,13 +1170,11 @@ void MainWindow::writeBackup()
return;
}
int oldrev = getEpromVersion(fileName);
QString tempDir = QDir::tempPath();
QString tempFlash = tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!convertEEPROM(fileName, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?") ,
QMessageBox::Yes | QMessageBox::No);
@@ -1189,9 +1191,7 @@ void MainWindow::writeBackup()
}
fileName = restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
@@ -1303,10 +1303,22 @@ void MainWindow::writeFlash(QString fileToFlash)
if (IS_TARANIS(GetEepromInterface()->getBoard()))
backup=false;
if (!fileName.isEmpty()) {
if (g.checkHardwareCompatibility()) {
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmwareFromRadio(tempFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
return;
}
FlashInterface previousFlash(tempFlash);
FlashInterface newFlash(fileName);
if (!newFlash.isHardwareCompatible(previousFlash)) {
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
return;
}
}
g.backupOnFlash(backup);
if (backup) {
QString tempDir = QDir::tempPath();
QString backupFile = tempDir + "/backup.bin";
QString backupFile = generateProcessUniqueTempFileName("backup.bin");
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
@@ -1328,15 +1340,15 @@ void MainWindow::writeFlash(QString fileToFlash)
}
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
sleep(1);
sleep(2);
int res = writeFirmwareToRadio(fileName);
if (res) {
QString restoreFile = tempDir + "/restore.bin";
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile;
}
sleep(1);
sleep(2);
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
}
@@ -1362,6 +1374,7 @@ void MainWindow::writeFlash(QString fileToFlash)
QDateTime datetime;
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
sleep(2);
}
writeFirmwareToRadio(fileName);
@@ -1596,7 +1609,7 @@ void MainWindow::createActions()
writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Radio"), tr("Write Models and Settings to Radio"), SLOT(writeEeprom()));
readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Radio"), tr("Read Models and Settings from Radio"), SLOT(readEeprom()));
burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with the Radio"), SLOT(burnConfig()));
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to to Radio"), SLOT(writeBackup()));
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to Radio"), SLOT(writeBackup()));
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
+4 -7
View File
@@ -531,8 +531,7 @@ void MdiChild::writeEeprom() // write to Tx
}
QString stickCal=g.profile[g.id()].stickPotCalib();
burnConfigDialog bcd;
QString tempDir = QDir::tempPath();
QString tempFile = tempDir + "/temp.bin";
QString tempFile = generateProcessUniqueTempFileName("temp.bin");
saveFile(tempFile, false);
if(!QFileInfo(tempFile).exists()) {
QMessageBox::critical(this,tr("Error"), tr("Cannot write temporary file!"));
@@ -550,12 +549,12 @@ void MdiChild::writeEeprom() // write to Tx
return;
}
int oldrev=((MainWindow *)this->parent())->getEpromVersion(tempFile);
QString tempFlash=tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!((MainWindow *)this->parent())->readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, tr("Error"), tr("Cannot check eeprom compatibility! Continue anyway?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No)
@@ -571,9 +570,7 @@ void MdiChild::writeEeprom() // write to Tx
}
tempFile=restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
+78 -69
View File
@@ -1,4 +1,5 @@
#include "channels.h"
#include "helpers.h"
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
@@ -6,6 +7,70 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt):
firmware(firmware),
spinbox(new QDoubleSpinBox()),
value(value),
displayStep(0.1)
{
bool allowGVars = false;
int internalStep = 1;
spinbox->setProperty("index", row);
spinbox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spinbox->setAccelerated(true);
if (firmware->getCapability(PPMUnitMicroseconds)) {
displayStep = 0.512;
spinbox->setDecimals(1);
spinbox->setSuffix("us");
}
else {
spinbox->setDecimals(0);
spinbox->setSuffix("%");
}
if (IS_TARANIS(firmware->getBoard()) || deflt == 0 /*it's the offset*/) {
spinbox->setDecimals(1);
allowGVars = true;
}
else {
internalStep *= 10;
}
spinbox->setSingleStep(displayStep*internalStep);
QHBoxLayout * horizontalLayout = new QHBoxLayout();
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
horizontalLayout->addWidget(gv);
QComboBox * cb = new QComboBox();
horizontalLayout->addWidget(cb);
horizontalLayout->addWidget(spinbox);
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
}
LimitsGroup::~LimitsGroup()
{
delete gvarGroup;
}
void LimitsGroup::updateMinMax(int max)
{
if (spinbox->maximum() == 0) {
spinbox->setMinimum(-max*displayStep);
if (value < -max) {
value = -max;
}
}
if (spinbox->minimum() == 0) {
spinbox->setMaximum(max*displayStep);
if (value > max) {
value = max;
}
}
}
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings, firmware)
{
@@ -13,8 +78,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
bool minimize = false;
int col = 1;
if (firmware->getCapability(ChannelsName))
{
if (firmware->getCapability(ChannelsName)) {
minimize=true;
addLabel(gridLayout, tr("Name"), col++);
}
@@ -52,44 +116,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
}
// Channel offset
QDoubleSpinBox * offset = new QDoubleSpinBox(this);
offset->setProperty("index", i);
offset->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
offset->setAccelerated(true);
offset->setDecimals(1);
offset->setMinimum(-100);
offset->setSingleStep(0.1);
offset->setValue(float(model.limitData[i].offset) / 10);
connect(offset, SIGNAL(editingFinished()), this, SLOT(offsetEdited()));
gridLayout->addWidget(offset, i+1, col++, 1, 1);
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
// Channel min
QDoubleSpinBox * minSB = new QDoubleSpinBox(this);
minSB->setProperty("index", i);
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
minSB->setAccelerated(true);
minSB->setDecimals(1);
minSB->setMinimum(-model.getChannelsMax());
minSB->setSingleStep(0.1);
minSB->setMaximum(0);
minSB->setValue(float(model.limitData[i].min) / 10);
connect(minSB, SIGNAL(editingFinished()), this, SLOT(minEdited()));
gridLayout->addWidget(minSB, i+1, col++, 1, 1);
minSpins << minSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
// Channel max
QDoubleSpinBox * maxSB = new QDoubleSpinBox(this);
maxSB->setProperty("index", i);
maxSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
maxSB->setAccelerated(true);
maxSB->setDecimals(1);
maxSB->setMinimum(0);
maxSB->setSingleStep(0.1);
maxSB->setMaximum(model.getChannelsMax());
maxSB->setValue(float(model.limitData[i].max) / 10);
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
maxSpins << maxSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
@@ -117,6 +150,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
QSpinBox * center = new QSpinBox(this);
center->setProperty("index", i);
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
center->setSuffix("us");
center->setMinimum(1375);
center->setMaximum(1625);
center->setValue(1500);
@@ -134,6 +168,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
}
}
// Push the rows up
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
@@ -142,6 +177,9 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
Channels::~Channels()
{
foreach(LimitsGroup *group, limitsGroups) {
delete group;
}
}
void Channels::symlimitsEdited()
@@ -164,43 +202,14 @@ void Channels::nameEdited()
}
}
void Channels::offsetEdited()
{
QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(sender());
int index = dsb->property("index").toInt();
model.limitData[index].offset = round(dsb->value() * 10);
emit modified();
}
void Channels::minEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].min = round(sb->value() * 10);
emit modified();
}
void Channels::maxEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].max = round(sb->value() * 10);
emit modified();
}
void Channels::refreshExtendedLimits()
{
for (int i=0; i<firmware->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i];
minDSB->setMinimum(-model.getChannelsMax());
maxDSB->setMaximum(model.getChannelsMax());
int channelMax = model.getChannelsMax();
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
if ( model.limitData[i].min < -model.getChannelsMax() ) model.limitData[i].min = -model.getChannelsMax();
if ( model.limitData[i].max > +model.getChannelsMax() ) model.limitData[i].max = +model.getChannelsMax();
foreach(LimitsGroup *group, limitsGroups) {
group->updateMinMax(10*channelMax);
}
emit modified();
}
+19 -5
View File
@@ -4,6 +4,24 @@
#include "modelpanel.h"
#include <QSpinBox>
class GVarGroup;
class LimitsGroup
{
public:
LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt);
~LimitsGroup();
void updateMinMax(int max);
protected:
FirmwareInterface * firmware;
QDoubleSpinBox * spinbox;
GVarGroup * gvarGroup;
int & value;
double displayStep;
};
class Channels : public ModelPanel
{
Q_OBJECT
@@ -13,8 +31,7 @@ class Channels : public ModelPanel
~Channels();
private:
QVector<QDoubleSpinBox *> minSpins;
QVector<QDoubleSpinBox *> maxSpins;
QVector<LimitsGroup *> limitsGroups;
public slots:
void refreshExtendedLimits();
@@ -22,9 +39,6 @@ class Channels : public ModelPanel
private slots:
void symlimitsEdited();
void nameEdited();
void offsetEdited();
void minEdited();
void maxEdited();
void invEdited();
void curveEdited();
void ppmcenterEdited();
+8 -8
View File
@@ -147,6 +147,13 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
}
for (int i=0; i<C9X_MAX_POINTS; i++) {
spnx[i] = new QSpinBox(this);
spnx[i]->setProperty("index", i);
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spnx[i]->setAccelerated(true);
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spnx[i], i, 0, 1, 1);
spny[i] = new QSpinBox(this);
spny[i]->setProperty("index", i);
spny[i]->setMinimum(-100);
@@ -154,14 +161,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
spny[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spny[i]->setAccelerated(true);
connect(spny[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spny[i], i, 0, 1, 1);
spnx[i] = new QSpinBox(this);
spnx[i]->setProperty("index", i);
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spnx[i]->setAccelerated(true);
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1);
ui->pointsLayout->addWidget(spny[i], i, 1, 1, 1);
bool insert;
if (firmware->getCapability(EnhancedCurves)) {
+14
View File
@@ -339,6 +339,20 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>curvePreview</tabstop>
<tabstop>curvePoints</tabstop>
<tabstop>curveCustom</tabstop>
<tabstop>curveSmooth</tabstop>
<tabstop>curveName</tabstop>
<tabstop>curveType</tabstop>
<tabstop>curveCoeff</tabstop>
<tabstop>yMin</tabstop>
<tabstop>yMid</tabstop>
<tabstop>yMax</tabstop>
<tabstop>curveSide</tabstop>
<tabstop>curveApply</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+54 -38
View File
@@ -69,36 +69,29 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
int num_fsw = firmware->getCapability(CustomFunctions);
if (!firmware->getCapability(VoicesAsNumbers)) {
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
QString temp = model.funcSw[i].paramarm;
if (!temp.isEmpty()) {
if (!paramarmList.contains(temp)) {
paramarmList.append(temp);
}
tracksSet.insert(temp);
}
}
}
qDebug() << tracksSet;
}
QString path = g.profile[g.id()].sdPath();
path.append("/SOUNDS/");
QString lang = generalSettings.ttsLanguage;
if (lang.isEmpty())
lang="en";
path.append(lang);
QDir qd(path);
int vml= firmware->getCapability(VoicesMaxLength);
if (qd.exists()) {
QStringList filters;
filters << "*.wav" << "*.WAV";
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
QFileInfo fi(file);
QString temp=fi.completeBaseName();
if (!paramarmList.contains(temp) && temp.length()<=vml) {
paramarmList.append(temp);
if (IS_TARANIS(firmware->getBoard())) {
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayScript) {
QString temp = model.funcSw[i].paramarm;
if (!temp.isEmpty()) {
scriptsSet.insert(temp);
}
}
}
qDebug() << scriptsSet;
}
CompanionIcon playIcon("play.png");
@@ -124,7 +117,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
// The function
fswtchFunc[i] = new QComboBox(this);
fswtchFunc[i]->setProperty("index", i);
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
gridLayout->addWidget(fswtchFunc[i], i+1, 2);
QHBoxLayout *paramLayout = new QHBoxLayout();
@@ -292,10 +285,20 @@ void CustomFunctionsPanel::customFunctionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
}
void CustomFunctionsPanel::functionEdited()
{
if (!lock) {
lock = true;
int index = sender()->property("index").toInt();
fswtchParamArmT[index]->setCurrentIndex(0);
refreshCustomFunction(index, true);
emit modified();
lock = false;
}
@@ -318,11 +321,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
int index = fswtchFunc[i]->currentIndex();
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
int channelsMax = model.getChannelsMax(true);
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
fswtchParam[i]->setMinimum(-channelsMax);
fswtchParam[i]->setMaximum(channelsMax);
if (modified) {
model.funcSw[i].param = fswtchParam[i]->value();
}
@@ -437,11 +441,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
else {
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
}
}
@@ -457,6 +459,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
}
else if (index==FuncPlaySound) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
@@ -469,6 +472,19 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncPlayScript) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml = 8/*TODO*/;
if (fswtchParamArmT[i]->currentText() != "----") {
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, scriptsSet);
}
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
@@ -506,11 +522,10 @@ void CustomFunctionsPanel::update()
lock = true;
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
}
refreshCustomFunction(i);
}
@@ -527,11 +542,10 @@ void CustomFunctionsPanel::fswPaste()
FuncSwData *fsw = &model.funcSw[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.funcSw[selectedFunction].paramarm, paramarmList);
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();
@@ -543,7 +557,7 @@ void CustomFunctionsPanel::fswDelete()
model.funcSw[selectedFunction].clear();
// TODO update switch and func
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;
@@ -590,7 +604,9 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
b->clear();
for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
if (((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
((i==FuncPlayScript && !IS_TARANIS(firmware->getBoard()))) ||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
@@ -615,14 +631,14 @@ void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
b->setCurrentIndex(value);
}
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList)
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> &paramsList)
{
b->clear();
b->addItem("----");
bool added = false;
QString currentvalue(value);
foreach ( QString entry, paramsList ) {
foreach (QString entry, paramsList) {
b->addItem(entry);
if (entry==currentvalue) {
b->setCurrentIndex(b->count()-1);
@@ -668,7 +684,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
b->setCurrentIndex(value);
}
else if (function==FuncVolume) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS);
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS);
}
else if (function==FuncPlayValue) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT);
+4 -2
View File
@@ -43,6 +43,7 @@ class CustomFunctionsPanel : public ModelPanel
private slots:
void customFunctionEdited();
void functionEdited();
void fsw_customContextMenuRequested(QPoint pos);
void refreshCustomFunction(int index, bool modified=false);
void onChildModified();
@@ -59,10 +60,11 @@ class CustomFunctionsPanel : public ModelPanel
void populateFuncCB(QComboBox *b, unsigned int value);
void populateGVmodeCB(QComboBox *b, unsigned int value);
void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0);
void populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList);
void populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> & paramsList);
bool initialized;
QStringList paramarmList;
QSet<QString> tracksSet;
QSet<QString> scriptsSet;
int phononCurrent;
QComboBox * fswtchSwtch[C9X_MAX_CUSTOM_FUNCTIONS];
QComboBox * fswtchFunc[C9X_MAX_CUSTOM_FUNCTIONS];
+2 -2
View File
@@ -31,9 +31,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings);
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
ui->sideCB->setCurrentIndex(ed->mode-1);
+5 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>381</width>
<height>414</height>
<width>389</width>
<height>488</height>
</rect>
</property>
<property name="sizePolicy">
@@ -481,6 +481,9 @@ If blank then the input is considered to be &quot;ON&quot; all the time.</string
<tabstop>weightGV</tabstop>
<tabstop>weightSB</tabstop>
<tabstop>weightCB</tabstop>
<tabstop>offsetGV</tabstop>
<tabstop>offsetSB</tabstop>
<tabstop>offsetCB</tabstop>
<tabstop>curveTypeCB</tabstop>
<tabstop>curveGVarCB</tabstop>
<tabstop>curveValueCB</tabstop>
+18
View File
@@ -457,6 +457,24 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>name</tabstop>
<tabstop>fadeIn</tabstop>
<tabstop>swtch</tabstop>
<tabstop>fadeOut</tabstop>
<tabstop>trim2Use</tabstop>
<tabstop>trim2Value</tabstop>
<tabstop>trim1Use</tabstop>
<tabstop>trim1Value</tabstop>
<tabstop>trim3Use</tabstop>
<tabstop>trim3Value</tabstop>
<tabstop>trim4Use</tabstop>
<tabstop>trim4Value</tabstop>
<tabstop>trim2Slider</tabstop>
<tabstop>trim3Slider</tabstop>
<tabstop>trim1Slider</tabstop>
<tabstop>trim4Slider</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+26 -9
View File
@@ -30,7 +30,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
// Phase switch
if (phaseIdx > 0) {
populateSwitchCB(ui->swtch, phase.swtch, generalSettings);
populateSwitchCB(ui->swtch, phase.swtch, generalSettings, MixesContext);
connect(ui->swtch, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseSwitch_currentIndexChanged(int)));
}
else {
@@ -63,19 +63,25 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value;
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider;
BoardEnum board = firmware->getBoard();
for (int i=0; i<4; i++) {
trimsLabel[i]->setText(labels[CONVERT_MODE(i+1)-1]);
QComboBox * cb = trimsUse[i];
cb->setProperty("index", i);
cb->addItem(QObject::tr("Trim disabled"), -1);
if (IS_TARANIS(board)) {
cb->addItem(QObject::tr("Trim disabled"), -1);
}
for (int m=0; m<modesCount; m++) {
if (m == phaseIdx) {
cb->addItem(QObject::tr("Own Trim"), m*2);
}
else if (phaseIdx > 0) {
cb->addItem(QObject::tr("Use Trim from Flight mode %1").arg(m), m*2);
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
if (IS_TARANIS(board)) {
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
}
}
}
connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseTrimUse_currentIndexChanged(int)));
@@ -157,7 +163,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
gvLayout->addWidget(gvValues[i], i, col++, 1, 1);
// Popups
if (IS_TARANIS(GetEepromInterface()->getBoard()) && (phaseIdx == 0)) {
if (IS_TARANIS(board) && phaseIdx == 0) {
gvPopups[i] = new QCheckBox(ui->gvGB);
gvPopups[i]->setProperty("index", i);
gvPopups[i]->setText(tr("Popup enabled"));
@@ -270,7 +276,11 @@ void FlightModePanel::trimUpdate(unsigned int trim)
trimsSlider[trim]->setEnabled(false);
}
else {
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
BoardEnum board = firmware->getBoard();
if (IS_TARANIS(board))
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
else
trimsUse[trim]->setCurrentIndex(phase.trimRef[chn]);
trimsValue[trim]->setEnabled(true);
trimsSlider[trim]->setEnabled(true);
}
@@ -305,10 +315,10 @@ void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
int gvar = comboBox->property("index").toInt();
if (index == 0) {
phase.gvars[gvar]=0;
phase.gvars[gvar] = 0;
}
else {
phase.gvars[gvar] = 1024+index+(index>phaseIdx?1:0);
phase.gvars[gvar] = 1024 + index;
}
update();
emit modified();
@@ -364,8 +374,15 @@ void FlightModePanel::phaseTrimUse_currentIndexChanged(int index)
phase.trim[chn] = 0;
}
else {
phase.trimMode[chn] = data % 2;
phase.trimRef[chn] = data / 2;
BoardEnum board = firmware->getBoard();
if (IS_TARANIS(board)) {
phase.trimMode[chn] = data % 2;
phase.trimRef[chn] = data / 2;
}
else {
phase.trimMode[chn] = 0;
phase.trimRef[chn] = data / 2;
}
phase.trim[chn] = 0;
}
trimUpdate(trim);
+1 -1
View File
@@ -28,7 +28,7 @@ void HeliPanel::update()
lock = true;
ui->swashTypeCB->setCurrentIndex(model.swashRingData.type);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->swashRingValSB->setValue(model.swashRingData.value);
ui->swashInvertELE->setChecked(model.swashRingData.invertELE);
ui->swashInvertAIL->setChecked(model.swashRingData.invertAIL);
+22 -16
View File
@@ -7,6 +7,10 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
ModelPanel(parent, model, generalSettings, firmware),
expoInserted(false)
{
inputsCount = firmware->getCapability(VirtualInputs);
if (inputsCount == 0)
inputsCount = NUM_STICKS;
QGridLayout * exposLayout = new QGridLayout(this);
ExposlistWidget = new MixersList(this, true);
@@ -47,10 +51,6 @@ void InputsPanel::update()
{
lock = true;
int inputsCount = firmware->getCapability(VirtualInputs);
if (inputsCount == 0)
inputsCount = NUM_STICKS;
// curDest -> destination channel
// i -> mixer number
QByteArray qba;
@@ -174,7 +174,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
}
}
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->curve.value) str += " " + md->curve.toString();
QString phasesStr = getPhasesStr(md->phases, model);
if (!phasesStr.isEmpty()) str += " " + phasesStr;
@@ -446,6 +446,7 @@ void InputsPanel::expolistWidget_KeyPress(QKeyEvent *event)
int InputsPanel::gm_moveExpo(int idx, bool dir) //true=inc=down false=dec=up
{
if(idx>C9X_MAX_EXPOS || (idx==C9X_MAX_EXPOS && dir)) return idx;
int tdx = dir ? idx+1 : idx-1;
@@ -456,22 +457,27 @@ int InputsPanel::gm_moveExpo(int idx, bool dir) //true=inc=down false=dec=up
if (!dir && tdx<0 && src.chn>0) {
src.chn--;
return idx;
} else if (!dir && tdx<0) {
}
else if (!dir && tdx<0) {
return idx;
}
if(memcmp(&src,&temp,sizeof(ExpoData))==0) return idx;
bool tgtempty=(memcmp(&tgt,&temp,sizeof(ExpoData))==0 ? 1:0);
if(tgt.chn!=src.chn || tgtempty) {
if ((dir) && (src.chn<(NUM_STICKS-1))) src.chn++;
if ((!dir) && (src.chn>0)) src.chn--;
return idx;
if (memcmp(&src, &temp, sizeof(ExpoData)) == 0) {
return idx;
}
//flip between idx and tgt
memcpy(&temp,&src,sizeof(ExpoData));
memcpy(&src,&tgt,sizeof(ExpoData));
memcpy(&tgt,&temp,sizeof(ExpoData));
bool tgtempty = (memcmp(&tgt, &temp, sizeof(ExpoData)) == 0);
if (tgt.chn!=src.chn || tgtempty) {
if ((dir) && (src.chn<unsigned(inputsCount-1))) src.chn++;
if ((!dir) && (src.chn>0)) src.chn--;
return idx;
}
// flip between idx and tgt
memcpy(&temp, &src, sizeof(ExpoData));
memcpy(&src, &tgt, sizeof(ExpoData));
memcpy(&tgt, &temp, sizeof(ExpoData));
return tdx;
}
+1
View File
@@ -34,6 +34,7 @@ class InputsPanel : public ModelPanel
bool expoInserted;
MixersList *ExposlistWidget;
bool firstLine;
int inputsCount;
int getExpoIndex(unsigned int dch);
bool gm_insertExpo(int idx);
+57 -37
View File
@@ -11,6 +11,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
ModelPanel(parent, model, generalSettings, firmware),
selectedSwitch(0)
{
int channelsMax = model.getChannelsMax(true);
QGridLayout * gridLayout = new QGridLayout(this);
int col = 1;
@@ -48,8 +50,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
cswitchSource1[i]->setVisible(false);
cswitchValue[i] = new QDoubleSpinBox(this);
cswitchValue[i]->setMaximum(125);
cswitchValue[i]->setMinimum(-125);
cswitchValue[i]->setMaximum(channelsMax);
cswitchValue[i]->setMinimum(-channelsMax);
cswitchValue[i]->setAccelerated(true);
cswitchValue[i]->setDecimals(0);
cswitchValue[i]->setProperty("index", i);
@@ -66,8 +68,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchSource2[i]->setVisible(false);
cswitchOffset[i] = new QDoubleSpinBox(this);
cswitchOffset[i]->setProperty("index",i);
cswitchOffset[i]->setMaximum(125);
cswitchOffset[i]->setMinimum(-125);
cswitchOffset[i]->setMaximum(channelsMax);
cswitchOffset[i]->setMinimum(-channelsMax);
cswitchOffset[i]->setAccelerated(true);
cswitchOffset[i]->setDecimals(0);
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -75,8 +77,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
v2Layout->addWidget(cswitchOffset[i]);
cswitchOffset2[i] = new QDoubleSpinBox(this);
cswitchOffset2[i]->setProperty("index",i);
cswitchOffset2[i]->setMaximum(125);
cswitchOffset2[i]->setMinimum(-125);
cswitchOffset2[i]->setMaximum(channelsMax);
cswitchOffset2[i]->setMinimum(-channelsMax);
cswitchOffset2[i]->setAccelerated(true);
cswitchOffset2[i]->setDecimals(0);
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -167,16 +169,20 @@ void LogicalSwitchesPanel::andEdited(int value)
void LogicalSwitchesPanel::durationEdited(double duration)
{
int index = sender()->property("index").toInt();
model.customSw[index].duration = (uint8_t)round(duration*10);
emit modified();
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].duration = (uint8_t)round(duration*10);
emit modified();
}
}
void LogicalSwitchesPanel::delayEdited(double delay)
{
int index = sender()->property("index").toInt();
model.customSw[index].delay = (uint8_t)round(delay*10);
emit modified();
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].delay = (uint8_t)round(delay*10);
emit modified();
}
}
void LogicalSwitchesPanel::edited()
@@ -184,30 +190,35 @@ void LogicalSwitchesPanel::edited()
if (!lock) {
lock = true;
int i = sender()->property("index").toInt();
int newFunc = csw[i]->itemData(csw[i]->currentIndex()).toInt();
bool chAr = (model.customSw[i].getFunctionFamily() != LogicalSwitchData(newFunc).getFunctionFamily());
model.customSw[i].func = newFunc;
if (chAr) {
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_TIMER) {
CSFunctionFamily oldFuncFamily = model.customSw[i].getFunctionFamily();
model.customSw[i].func = csw[i]->itemData(csw[i]->currentIndex()).toInt();
CSFunctionFamily newFuncFamily = model.customSw[i].getFunctionFamily();
if (oldFuncFamily != newFuncFamily) {
if (newFuncFamily == LS_FAMILY_TIMER) {
model.customSw[i].val1 = -119;
model.customSw[i].val2 = -119;
}
else if (model.customSw[i].getFunctionFamily() == LS_FAMILY_STAY) {
else if (newFuncFamily == LS_FAMILY_STAY) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = -129;
model.customSw[i].val3 = 0;
}
else if (newFuncFamily == LS_FAMILY_STICKY) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
model.customSw[i].delay = 0;
}
else {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
}
model.customSw[i].andsw = 0;
setSwitchWidgetVisibility(i);
}
RawSource source;
switch (model.customSw[i].getFunctionFamily())
switch (newFuncFamily)
{
case LS_FAMILY_VOFS:
{
@@ -229,6 +240,7 @@ void LogicalSwitchesPanel::edited()
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
break;
case LS_FAMILY_STAY:
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (sender() == cswitchOffset[i]) {
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
@@ -236,10 +248,12 @@ void LogicalSwitchesPanel::edited()
else {
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
}
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix("(release)");
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
default:
@@ -264,7 +278,6 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
else
sb->setSingleStep(0.1);
sb->setValue(value);
sb->setSuffix("");
}
#define SOURCE1_VISIBLE 0x1
@@ -273,12 +286,13 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
#define VALUE2_VISIBLE 0x8
#define VALUE3_VISIBLE 0x10
#define VALUE_TO_VISIBLE 0x20
#define DELAY_ENABLED 0x40
void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
{
lock = true;
unsigned int mask = 0;
unsigned int mask = DELAY_ENABLED;
RawSource source = RawSource(model.customSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
@@ -308,20 +322,25 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
}
break;
case LS_FAMILY_VBOOL:
case LS_FAMILY_STICKY:
// no break
case LS_FAMILY_VBOOL:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings);
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings, LogicalSwitchesContext);
break;
case LS_FAMILY_STAY:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
mask &= ~DELAY_ENABLED;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix(tr("(release)"));
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
case LS_FAMILY_VCOMP:
@@ -342,6 +361,11 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchOffset[i]->setVisible(mask & VALUE2_VISIBLE);
cswitchOffset2[i]->setVisible(mask & VALUE3_VISIBLE);
cswitchTOffset[i]->setVisible(mask & VALUE_TO_VISIBLE);
if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDelay[i]->setEnabled(mask & DELAY_ENABLED);
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
}
lock = false;
}
@@ -392,7 +416,7 @@ void LogicalSwitchesPanel::populateCSWCB(QComboBox *b, int value)
void LogicalSwitchesPanel::populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
{
if (IS_ARM(firmware->getBoard())) {
populateSwitchCB(b, value, generalSettings, POPULATE_ONOFF);
populateSwitchCB(b, value, generalSettings, LogicalSwitchesContext);
}
else {
RawSwitch item;
@@ -425,10 +449,6 @@ void LogicalSwitchesPanel::updateLine(int i)
setSwitchWidgetVisibility(i);
lock = true;
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
}
lock = false;
}
+2 -2
View File
@@ -26,7 +26,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
ui->MixDR_CB->setChecked(md->noExpo==0);
@@ -76,7 +76,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
}
}
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings);
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings, MixesContext);
ui->warningCB->setCurrentIndex(md->mixWarn);
ui->mltpxCB->setCurrentIndex(md->mltpx);
int scale=firmware->getCapability(SlowScale);
+39 -6
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>434</height>
<width>412</width>
<height>541</height>
</rect>
</property>
<property name="sizePolicy">
@@ -67,7 +67,7 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -96,7 +96,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -125,7 +125,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -148,7 +148,7 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay ans Slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Delay and slow&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;These values control the speed and delay of the output of the mix. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
@@ -611,6 +611,39 @@ If blank then the mix is considered to be &quot;ON&quot; all the time.</string>
</item>
</layout>
</widget>
<tabstops>
<tabstop>mixerName</tabstop>
<tabstop>sourceCB</tabstop>
<tabstop>weightGV</tabstop>
<tabstop>weightCB</tabstop>
<tabstop>weightSB</tabstop>
<tabstop>offsetGV</tabstop>
<tabstop>offsetCB</tabstop>
<tabstop>offsetSB</tabstop>
<tabstop>curveTypeCB</tabstop>
<tabstop>curveGVarCB</tabstop>
<tabstop>curveValueCB</tabstop>
<tabstop>curveValueSB</tabstop>
<tabstop>trimCB</tabstop>
<tabstop>MixDR_CB</tabstop>
<tabstop>cb_FP0</tabstop>
<tabstop>cb_FP1</tabstop>
<tabstop>cb_FP2</tabstop>
<tabstop>cb_FP3</tabstop>
<tabstop>cb_FP4</tabstop>
<tabstop>cb_FP5</tabstop>
<tabstop>cb_FP6</tabstop>
<tabstop>cb_FP7</tabstop>
<tabstop>cb_FP8</tabstop>
<tabstop>switchesCB</tabstop>
<tabstop>warningCB</tabstop>
<tabstop>mltpxCB</tabstop>
<tabstop>delayUpSB</tabstop>
<tabstop>slowUpSB</tabstop>
<tabstop>delayDownSB</tabstop>
<tabstop>slowDownSB</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../companion.qrc"/>
</resources>
+18
View File
@@ -122,6 +122,15 @@ qreal Node::getX()
return 0;
}
void Node::setX(qreal newX)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setX(rect.left() + (newX+1) * rect.width()/2);
}
}
qreal Node::getY()
{
if(scene())
@@ -132,6 +141,15 @@ qreal Node::getY()
return 0;
}
void Node::setY(qreal newY)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setY(rect.top() + (newY+1) * rect.height()/2);
}
}
QList<Edge *> Node::edges() const
{
return edgeList;
+2
View File
@@ -72,6 +72,8 @@ class Node : public QGraphicsObject
int getBallSize() {return ballSize;}
qreal getX();
qreal getY();
void setX(qreal newX);
void setY(qreal newX);
void setCenteringX(bool val) {centerX = val;}
void setCenteringY(bool val) {centerY = val;}
+52 -29
View File
@@ -5,7 +5,7 @@
#include "helpers.h"
#include "appdata.h"
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware):
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus):
ModelPanel(parent, model, generalSettings, firmware),
timer(timer),
ui(new Ui::Timer)
@@ -15,7 +15,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
lock = true;
// Mode
populateSwitchCB(ui->mode, timer.mode, generalSettings, POPULATE_TIMER_MODES);
populateSwitchCB(ui->mode, timer.mode, generalSettings, TimersContext);
if (!firmware->getCapability(PermTimers)) {
ui->persistent->hide();
@@ -25,10 +25,21 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
ui->countdownBeep->setField(&timer.countdownBeep, this);
ui->countdownBeep->addItem(tr("Silent"), 0);
ui->countdownBeep->addItem(tr("Beeps"), 1);
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard()))
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard())) {
ui->countdownBeep->addItem(tr("Voice"), 2);
}
ui->persistent->setField(&timer.persistent, this);
ui->persistent->addItem(tr("Not persistent"), 0);
ui->persistent->addItem(tr("Persistent (flight)"), 1);
ui->persistent->addItem(tr("Persistent (manual reset)"), 2);
disableMouseScrolling();
QWidget::setTabOrder(prevFocus, ui->value);
QWidget::setTabOrder(ui->value, ui->mode);
QWidget::setTabOrder(ui->mode, ui->countdownBeep);
QWidget::setTabOrder(ui->countdownBeep, ui->minuteBeep);
QWidget::setTabOrder(ui->minuteBeep, ui->persistent);
lock = false;
}
@@ -55,13 +66,17 @@ void TimerPanel::update()
pvalue -= hours * 3600;
int minutes = pvalue / 60;
int seconds = pvalue % 60;
ui->persistent->setChecked(timer.persistent);
ui->persistentValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(seconds, 2, 10, QLatin1Char('0')));
}
ui->minuteBeep->setChecked(timer.minuteBeep);
}
QWidget * TimerPanel::getLastFocus()
{
return ui->persistent;
}
void TimerPanel::on_value_editingFinished()
{
timer.val = ui->value->time().minute()*60 + ui->value->time().second();
@@ -76,12 +91,6 @@ void TimerPanel::on_mode_currentIndexChanged(int index)
}
}
void TimerPanel::on_persistent_toggled(bool checked)
{
timer.persistent = checked;
emit modified();
}
void TimerPanel::on_minuteBeep_toggled(bool checked)
{
timer.minuteBeep = checked;
@@ -180,6 +189,7 @@ void ModulePanel::update()
{
unsigned int mask = 0;
Protocol protocol = (Protocol)module.protocol;
unsigned int max_rx_num = 63;
if (moduleIdx >= 0) {
mask |= MASK_PROTOCOL;
@@ -196,6 +206,7 @@ void ModulePanel::update()
case DSMX:
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
module.channelsCount = 6;
max_rx_num = 20;
break;
case PPM:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
@@ -211,8 +222,9 @@ void ModulePanel::update()
ui->label_protocol->setVisible(mask & MASK_PROTOCOL);
ui->protocol->setVisible(mask & MASK_PROTOCOL);
ui->label_rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->label_rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setMaximum(max_rx_num);
ui->rxNumber->setValue(model.modelId);
ui->label_channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
ui->channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
@@ -345,23 +357,6 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->name->setMaxLength(IS_TARANIS(firmware->getBoard()) ? 12 : 10);
for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
for (int i=0; i<firmware->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
}
if (firmware->getCapability(ModelImage)) {
QStringList items;
items.append("");
@@ -408,12 +403,21 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->modelImage_label->hide();
ui->imagePreview->hide();
}
QWidget *prevFocus = ui->image;
for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware, prevFocus);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
prevFocus = timers[i]->getLastFocus();
}
if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide();
}
// Beep Center checkboxes
prevFocus = ui->displayText;
int analogs = 4 + firmware->getCapability(Pots);
for (int i=0; i<analogs+firmware->getCapability(RotaryEncoders); i++) {
QCheckBox * checkbox = new QCheckBox(this);
@@ -425,6 +429,8 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
checkbox->hide();
}
QWidget::setTabOrder(prevFocus, checkbox);
prevFocus = checkbox;
}
// Startup switches warnings
@@ -461,10 +467,14 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
connect(cb, SIGNAL(toggled(bool)), this, SLOT(startupSwitchToggled(bool)));
startupSwitchesSliders << slider;
startupSwitchesCheckboxes << cb;
QWidget::setTabOrder(prevFocus, slider);
QWidget::setTabOrder(slider, cb);
prevFocus = cb;
}
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, firmware->getCapability(Switches));
// Pot warnings
prevFocus = ui->potWarningMode;
if (IS_TARANIS(firmware->getBoard())) {
for (int i=0; i<firmware->getCapability(Pots); i++) {
QCheckBox * cb = new QCheckBox(this);
@@ -476,6 +486,8 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==2) {
cb->hide();
}
QWidget::setTabOrder(prevFocus, cb);
prevFocus = cb;
}
}
else {
@@ -483,6 +495,17 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
ui->potWarningMode->hide();
}
for (int i=0; i<firmware->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
}
disableMouseScrolling();
lock = false;
+2 -2
View File
@@ -20,15 +20,15 @@ class TimerPanel : public ModelPanel
Q_OBJECT
public:
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware);
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus);
virtual ~TimerPanel();
virtual void update();
QWidget * getLastFocus();
private slots:
void on_mode_currentIndexChanged(int index);
void on_value_editingFinished();
void on_persistent_toggled(bool checked);
void on_minuteBeep_toggled(bool checked);
private:
+13
View File
@@ -532,6 +532,19 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</item>
</layout>
</widget>
<tabstops>
<tabstop>name</tabstop>
<tabstop>image</tabstop>
<tabstop>throttleSource</tabstop>
<tabstop>throttleTrim</tabstop>
<tabstop>throttleWarning</tabstop>
<tabstop>throttleReverse</tabstop>
<tabstop>trimIncrement</tabstop>
<tabstop>extendedLimits</tabstop>
<tabstop>extendedTrims</tabstop>
<tabstop>displayText</tabstop>
<tabstop>potWarningMode</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+14 -3
View File
@@ -507,16 +507,16 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>125</number>
<number>63</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
<number>0</number>
</property>
</widget>
</item>
@@ -541,6 +541,17 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>trainerMode</tabstop>
<tabstop>protocol</tabstop>
<tabstop>channelsStart</tabstop>
<tabstop>channelsCount</tabstop>
<tabstop>ppmFrameLength</tabstop>
<tabstop>ppmPolarity</tabstop>
<tabstop>ppmDelay</tabstop>
<tabstop>failsafeMode</tabstop>
<tabstop>rxNumber</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+1 -5
View File
@@ -51,11 +51,7 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="persistent">
<property name="text">
<string>Persistent</string>
</property>
</widget>
<widget class="QUnsignedAutoComboBox" name="persistent"/>
</item>
<item>
<widget class="QLabel" name="persistentValue">
+56 -67
View File
@@ -28,7 +28,7 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, Mod
update();
ui->UnitCB->setCurrentIndex(analog.type);
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!IS_TARANIS(firmware->getBoard())) {
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
@@ -198,12 +198,14 @@ void TelemetryAnalog::on_CalibSB_editingFinished()
}
if (alarm2value<calib) {
alarm2value=calib;
} else if (alarm2value>(ratio+calib)) {
}
else if (alarm2value>(ratio+calib)) {
alarm2value=ratio+calib;
}
analog.alarms[0].value=round(((alarm1value-calib)*255)/ratio);
analog.alarms[1].value=round(((alarm2value-calib)*255)/ratio);
} else {
}
else {
analog.offset=0;
analog.alarms[0].value=0;
analog.alarms[1].value=0;
@@ -332,7 +334,6 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int value, bool last, int hubproto)
{
int telem_hub[] = {0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,2,2,1,1,1,1,1,1};
b->clear();
b->addItem(RawSource(SOURCE_TYPE_NONE, 0).toString(model));
@@ -340,24 +341,14 @@ void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int
for (unsigned int i = 0; i < (last ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_DISPLAY_COUNT); i++) {
b->addItem(RawSource(SOURCE_TYPE_TELEMETRY, i).toString(model));
if (!firmware->isTelemetrySourceAvailable(i)) {
//disable item
// disable item
QModelIndex index = b->model()->index(i+1, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
if (!(i>=sizeof(telem_hub)/sizeof(int) || telem_hub[i]==0 || ((telem_hub[i]>=hubproto) && hubproto!=0))) {
QModelIndex index = b->model()->index(i, 0);
QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1);
}
}
if (value>=sizeof(telem_hub)/sizeof(int))
b->setCurrentIndex(0);
else if (telem_hub[value]==0 || ((telem_hub[value]>=hubproto) && hubproto!=0)) {
b->setCurrentIndex(value);
}
b->setCurrentIndex(value);
b->setMaxVisibleItems(10);
}
@@ -445,9 +436,11 @@ void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
void TelemetryCustomScreen::customFieldChanged(int value)
{
int index = sender()->property("index").toInt();
screen.body.lines[index/256].source[index%256] = value;
emit modified();
if (!lock) {
int index = sender()->property("index").toInt();
screen.body.lines[index/256].source[index%256] = value;
emit modified();
}
}
void TelemetryCustomScreen::barSourceChanged(int index)
@@ -495,14 +488,6 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
model.frsky.usrProto = 1;
}
if (IS_ARM(firmware->getBoard())) {
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
}
else {
ui->telemetryProtocolLabel->hide();
ui->telemetryProtocol->hide();
}
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
ui->A1Layout->addWidget(analogs[0]);
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
@@ -511,7 +496,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
ui->A2Layout->addWidget(analogs[1]);
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
if (IS_ARM(GetEepromInterface()->getBoard())) {
if (IS_ARM(firmware->getBoard())) {
analogs[2] = new TelemetryAnalog(this, model.frsky.channels[2], model, generalSettings, firmware);
ui->A3Layout->addWidget(analogs[2]);
connect(analogs[2], SIGNAL(modified()), this, SLOT(onAnalogModified()));
@@ -531,7 +516,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
telemetryCustomScreens[i] = tab;
}
if (IS_ARM(GetEepromInterface()->getBoard())) {
if (IS_ARM(firmware->getBoard())) {
ui->bladesCount->setMinimum(1);
ui->bladesCount->setMaximum(128);
}
@@ -546,15 +531,41 @@ TelemetryPanel::~TelemetryPanel()
delete ui;
}
void TelemetryPanel::update()
{
if (IS_TARANIS(firmware->getBoard())) {
if (model.moduleData[0].protocol == OFF && model.moduleData[1].protocol == PPM) {
ui->telemetryProtocol->setEnabled(true);
}
else {
ui->telemetryProtocol->setEnabled(false);
ui->telemetryProtocol->setCurrentIndex(0);
}
}
}
void TelemetryPanel::setup()
{
QString firmware_id = g.profile[g.id()].fwType();
lock = true;
if (IS_ARM(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
if (IS_9XRPRO(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
}
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
}
else {
ui->telemetryProtocolLabel->hide();
ui->telemetryProtocol->hide();
}
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!IS_TARANIS(firmware->getBoard())) {
ui->rssiAlarm1CB->setCurrentIndex(model.frsky.rssiAlarms[0].level);
ui->rssiAlarm2CB->setCurrentIndex(model.frsky.rssiAlarms[1].level);
}
@@ -582,7 +593,6 @@ void TelemetryPanel::setup()
int varioCap = firmware->getCapability(HasVario);
if (!varioCap) {
ui->varioLimitMax_DSB->hide();
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->varioLimitCenterMax_DSB->hide();
@@ -596,7 +606,6 @@ void TelemetryPanel::setup()
}
else {
if (!firmware->getCapability(HasVarioSink)) {
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->VarioLabel_1->hide();
@@ -605,15 +614,7 @@ void TelemetryPanel::setup()
ui->varioLimitMin_DSB->setValue(model.frsky.varioMin-10);
ui->varioLimitMax_DSB->setValue(model.frsky.varioMax+10);
ui->varioLimitCenterMax_DSB->setValue((model.frsky.varioCenterMax/10.0)+0.5);
if (model.frsky.varioCenterMin==-16) {
ui->varioLimitMinOff_ChkB->setChecked(true);
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
else {
ui->varioLimitMinOff_ChkB->setChecked(false);
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->altimetryGB->setVisible(firmware->getCapability(HasAltitudeSel) || firmware->getCapability(HasVario)),
@@ -708,8 +709,10 @@ void TelemetryPanel::populateCurrentSource()
void TelemetryPanel::on_telemetryProtocol_currentIndexChanged(int index)
{
model.telemetryProtocol = index;
emit modified();
if (!lock) {
model.telemetryProtocol = index;
emit modified();
}
}
void TelemetryPanel::onAnalogModified()
@@ -719,16 +722,20 @@ void TelemetryPanel::onAnalogModified()
void TelemetryPanel::on_bladesCount_editingFinished()
{
model.frsky.blades = ui->bladesCount->value();
emit modified();
if (!lock) {
model.frsky.blades = ui->bladesCount->value();
emit modified();
}
}
void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
{
model.frsky.usrProto = index;
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
telemetryCustomScreens[i]->update();
emit modified();
if (!lock) {
model.frsky.usrProto = index;
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
telemetryCustomScreens[i]->update();
emit modified();
}
}
void TelemetryPanel::on_rssiAlarm1CB_currentIndexChanged(int index)
@@ -790,24 +797,6 @@ void TelemetryPanel::on_varioLimitCenterMin_DSB_editingFinished()
}
}
void TelemetryPanel::on_varioLimitMinOff_ChkB_toggled(bool checked)
{
if (!lock) {
model.frsky.varioCenterMin = -16;
if (!checked) {
lock=true;
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setEnabled(true);
lock=false;
}
else {
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
emit modified();
}
}
void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
{
if (!lock) {
+1 -1
View File
@@ -81,6 +81,7 @@ class TelemetryPanel : public ModelPanel
public:
TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~TelemetryPanel();
virtual void update();
private slots:
void on_telemetryProtocol_currentIndexChanged(int index);
@@ -96,7 +97,6 @@ class TelemetryPanel : public ModelPanel
void on_varioLimitMin_DSB_editingFinished();
void on_varioLimitMax_DSB_editingFinished();
void on_varioLimitCenterMin_DSB_editingFinished();
void on_varioLimitMinOff_ChkB_toggled(bool checked);
void on_varioLimitCenterMax_DSB_editingFinished();
void on_fasOffset_DSB_editingFinished();
void on_mahCount_SB_editingFinished();
+27 -28
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>850</width>
<height>457</height>
<height>521</height>
</rect>
</property>
<property name="windowTitle">
@@ -46,16 +46,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>FrSky S.PORT</string>
</property>
</item>
<item>
<property name="text">
<string>FrSky D</string>
</property>
</item>
</widget>
</item>
</layout>
@@ -291,10 +281,10 @@
<number>1</number>
</property>
<property name="minimum">
<double>-2.000000000000000</double>
<double>-2.100000000000000</double>
</property>
<property name="maximum">
<double>0.000000000000000</double>
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
@@ -373,19 +363,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="varioLimitMinOff_ChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Off</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="VarioLabel_2">
<property name="sizePolicy">
@@ -668,10 +645,10 @@
<number>1</number>
</property>
<property name="minimum">
<double>-1.500000000000000</double>
<double>-12.000000000000000</double>
</property>
<property name="maximum">
<double>1.500000000000000</double>
<double>12.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
@@ -1028,6 +1005,28 @@
<header>qautocombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>telemetryProtocol</tabstop>
<tabstop>rssiAlarm1CB</tabstop>
<tabstop>rssiAlarm1SB</tabstop>
<tabstop>rssiAlarm2CB</tabstop>
<tabstop>rssiAlarm2SB</tabstop>
<tabstop>varioSourceCB</tabstop>
<tabstop>varioLimitMin_DSB</tabstop>
<tabstop>varioLimitCenterMin_DSB</tabstop>
<tabstop>varioLimitCenterMax_DSB</tabstop>
<tabstop>varioLimitMax_DSB</tabstop>
<tabstop>AltitudeGPS_ChkB</tabstop>
<tabstop>AltitudeToolbar_ChkB</tabstop>
<tabstop>frskyProtoCB</tabstop>
<tabstop>fasOffset_DSB</tabstop>
<tabstop>mahCount_SB</tabstop>
<tabstop>mahCount_ChkB</tabstop>
<tabstop>frskyVoltCB</tabstop>
<tabstop>frskyCurrentCB</tabstop>
<tabstop>bladesCount</tabstop>
<tabstop>customScreens</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+12 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>276</width>
<height>118</height>
<height>138</height>
</rect>
</property>
<property name="windowTitle">
@@ -325,6 +325,17 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>UnitCB</tabstop>
<tabstop>RatioSB</tabstop>
<tabstop>CalibSB</tabstop>
<tabstop>alarm1LevelCB</tabstop>
<tabstop>alarm1GreaterCB</tabstop>
<tabstop>alarm1ValueSB</tabstop>
<tabstop>alarm2LevelCB</tabstop>
<tabstop>alarm2GreaterCB</tabstop>
<tabstop>alarm2ValueSB</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+77 -8
View File
@@ -1625,22 +1625,91 @@ May be different from firmware language</string>
</layout>
</widget>
<tabstops>
<tabstop>InvertPixels</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>showSplash</tabstop>
<tabstop>startupCheck_companion9x</tabstop>
<tabstop>startupCheck_fw</tabstop>
<tabstop>historySize</tabstop>
<tabstop>wizardEnable_ChkB</tabstop>
<tabstop>backupPath</tabstop>
<tabstop>backupPathButton</tabstop>
<tabstop>backupEnable</tabstop>
<tabstop>ge_lineedit</tabstop>
<tabstop>ge_pathButton</tabstop>
<tabstop>SplashFileName</tabstop>
<tabstop>splashLibraryButton</tabstop>
<tabstop>SplashSelect</tabstop>
<tabstop>splashincludeCB</tabstop>
<tabstop>libraryPath</tabstop>
<tabstop>libraryPathButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>optionCheckBox_1</tabstop>
<tabstop>optionCheckBox_2</tabstop>
<tabstop>checkFWUpdates</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>InvertPixels</tabstop>
<tabstop>clearImageButton</tabstop>
<tabstop>backLightColor</tabstop>
<tabstop>simuSW</tabstop>
<tabstop>joystickChkB</tabstop>
<tabstop>joystickCB</tabstop>
<tabstop>joystickcalButton</tabstop>
<tabstop>snapshotClipboardCKB</tabstop>
<tabstop>snapshotPath</tabstop>
<tabstop>snapshotPathButton</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>langCombo</tabstop>
<tabstop>fw_dnld</tabstop>
<tabstop>sdPath</tabstop>
<tabstop>sdPathButton</tabstop>
<tabstop>voiceCombo</tabstop>
<tabstop>voice_dnld</tabstop>
<tabstop>optionCheckBox_1</tabstop>
<tabstop>optionCheckBox_2</tabstop>
<tabstop>optionCheckBox_3</tabstop>
<tabstop>optionCheckBox_4</tabstop>
<tabstop>optionCheckBox_5</tabstop>
<tabstop>optionCheckBox_6</tabstop>
<tabstop>optionCheckBox_7</tabstop>
<tabstop>optionCheckBox_8</tabstop>
<tabstop>optionCheckBox_9</tabstop>
<tabstop>optionCheckBox_10</tabstop>
<tabstop>optionCheckBox_11</tabstop>
<tabstop>optionCheckBox_12</tabstop>
<tabstop>optionCheckBox_13</tabstop>
<tabstop>optionCheckBox_14</tabstop>
<tabstop>optionCheckBox_15</tabstop>
<tabstop>optionCheckBox_16</tabstop>
<tabstop>optionCheckBox_17</tabstop>
<tabstop>optionCheckBox_18</tabstop>
<tabstop>optionCheckBox_19</tabstop>
<tabstop>optionCheckBox_20</tabstop>
<tabstop>optionCheckBox_21</tabstop>
<tabstop>optionCheckBox_22</tabstop>
<tabstop>optionCheckBox_23</tabstop>
<tabstop>optionCheckBox_24</tabstop>
<tabstop>optionCheckBox_25</tabstop>
<tabstop>optionCheckBox_26</tabstop>
<tabstop>optionCheckBox_27</tabstop>
<tabstop>optionCheckBox_28</tabstop>
<tabstop>optionCheckBox_29</tabstop>
<tabstop>optionCheckBox_30</tabstop>
<tabstop>optionCheckBox_31</tabstop>
<tabstop>optionCheckBox_32</tabstop>
<tabstop>optionCheckBox_33</tabstop>
<tabstop>optionCheckBox_34</tabstop>
<tabstop>optionCheckBox_35</tabstop>
<tabstop>optionCheckBox_36</tabstop>
<tabstop>optionCheckBox_37</tabstop>
<tabstop>optionCheckBox_38</tabstop>
<tabstop>optionCheckBox_39</tabstop>
<tabstop>optionCheckBox_40</tabstop>
<tabstop>optionCheckBox_41</tabstop>
<tabstop>optionCheckBox_42</tabstop>
<tabstop>checkFWUpdates</tabstop>
<tabstop>renameFirmware</tabstop>
<tabstop>burnFirmware</tabstop>
<tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop>
<tabstop>ProfSlot_SB</tabstop>
<tabstop>ProfName_LE</tabstop>
<tabstop>ProfSave_PB</tabstop>
<tabstop>import_PB</tabstop>
<tabstop>export_PB</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
+14 -22
View File
@@ -31,12 +31,12 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
te->clear();
QString modelname=g_model->name;
if (modelname.isEmpty()) {
curvefile5=QString("%1/curve5.png").arg(qd->tempPath());
curvefile9=QString("%1/curve9.png").arg(qd->tempPath());
curvefile5=generateProcessUniqueTempFileName("curve5.png");
curvefile9=generateProcessUniqueTempFileName("curve9.png");
}
else {
curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname);
curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname);
curvefile5=generateProcessUniqueTempFileName(QString("%1-curve5.png").arg(modelname));
curvefile9=generateProcessUniqueTempFileName(QString("%1-curve9.png").arg(modelname));
}
printSetup();
if (gvars) {
@@ -60,19 +60,14 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
void PrintDialog::closeEvent(QCloseEvent *event)
{
if (printfilename.isEmpty()) {
QByteArray ba = curvefile5.toLatin1();
char *name = ba.data();
unlink(name);
ba = curvefile9.toLatin1();
name = ba.data();
unlink(name);
}
}
PrintDialog::~PrintDialog()
{
delete ui;
// notice PrintDialog::closeEvent() is not called if user clicks on Close button
qunlink(curvefile5);
qunlink(curvefile9);
delete ui;
}
QString doTC(const QString s, const QString color="", bool bold=false)
@@ -119,12 +114,10 @@ void PrintDialog::printSetup()
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS"));
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString()));
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled")));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model)));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep
str.append("</td></tr></table></td>");
if (!gvars) {
str.append("<td width=\"380\">");
@@ -340,7 +333,6 @@ void PrintDialog::printMixes()
if (firmware->getCapability(HasNoExpo) && md->noExpo) str += " " + Qt::escape(tr("No DR/Expo"));
if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset)));
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
int scale = firmware->getCapability(SlowScale);
if (scale == 0)
@@ -379,22 +371,22 @@ void PrintDialog::printLimits()
if (firmware->getCapability(HasChNames)) {
str.append("<tr><td><b>"+tr("Name")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(g_model->limitData[i].name,"green"));
str.append(doTR(g_model->limitData[i].name, "green"));
}
}
str.append("<tr><td><b>"+tr("Offset")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green"));
str.append(doTR(g_model->limitData[i].offsetToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Min")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green"));
str.append(doTR(g_model->limitData[i].minToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Max")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green"));
str.append(doTR(g_model->limitData[i].maxToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Invert")+"</b></td>");
+1 -1
View File
@@ -37,7 +37,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-family:'arial,sans-serif'; font-size:13px; font-style:italic; color:#222222; background-color:#ffffff;&quot;&gt;Note: if you have a Taranis that has not had the firmware upgraded to 2.0 then this version of Companion will not work.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
+9
View File
@@ -1,10 +1,16 @@
set(simulation_SRCS
simulatordialog.cpp
telemetrysimu.cpp
trainersimu.cpp
debugoutput.cpp
)
set(simulation_UIS
simulatordialog-9x.ui
simulatordialog-taranis.ui
telemetrysimu.ui
trainersimu.ui
debugoutput.ui
)
set(simulation_HDRS
@@ -14,6 +20,9 @@ set(simulation_HDRS
xcursorwidget.h
xmenuwidget.h
myslider.h
telemetrysimu.h
trainersimu.h
debugoutput.h
)
if(SDL_FOUND)
+43
View File
@@ -0,0 +1,43 @@
#include <QtGui>
#include <stdint.h>
#include "debugoutput.h"
#include "ui_debugoutput.h"
DebugOutput::DebugOutput(QWidget * parent):
QDialog(parent),
ui(new Ui::DebugOutput)
{
ui->setupUi(this);
#ifdef __APPLE__
QFont newFont("Courier", 13);
ui->Output->setFont(newFont);
ui->Output->setAttribute(Qt::WA_MacNormalSize);
#endif
#if defined WIN32 || !defined __GNUC__
QFont newFont("Courier", 9);
ui->Output->setFont(newFont);
#endif
}
DebugOutput::~DebugOutput()
{
delete ui;
}
void DebugOutput::traceCallback(const QString & text)
{
// ui->Output->appendPlainText(text);
QTextCursor cursor(ui->Output->textCursor());
// is the scrollbar at the end?
bool atEnd = (ui->Output->verticalScrollBar()->value() == ui->Output->verticalScrollBar()->maximum());
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
cursor.insertText(text);
if (atEnd) {
ui->Output->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
}
}
+32
View File
@@ -0,0 +1,32 @@
#ifndef debugoutput_h
#define debugoutput_h
#include <QDialog>
#include "simulatorinterface.h"
namespace Ui {
class DebugOutput;
}
class DebugOutput : public QDialog
{
Q_OBJECT
public:
explicit DebugOutput(QWidget * parent);
virtual ~DebugOutput();
void traceCallback(const QString & text);
protected:
private:
Ui::DebugOutput * ui;
private slots:
};
#endif
+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DebugOutput</class>
<widget class="QDialog" name="DebugOutput">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>711</width>
<height>470</height>
</rect>
</property>
<property name="windowTitle">
<string>Debug Output</string>
</property>
<property name="windowIcon">
<iconset resource="../companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPlainTextEdit" name="Output">
<property name="font">
<font>
<family>Courier New</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../companion.qrc"/>
</resources>
<connections/>
</ui>
+21 -13
View File
@@ -62,8 +62,7 @@ void Joystick::processEvents()
SDL_JoystickUpdate();
int i;
for (i = 0; i < numAxes; i++) {
for (int i = 0; i < numAxes; i++) {
Sint16 moved = SDL_JoystickGetAxis(joystick, i);
if ( abs(moved) >= deadzones[i] ) {
if ( (moved != axes[i]) ) {
@@ -72,46 +71,55 @@ void Joystick::processEvents()
emit axisValueChanged(i, moved);
axes[i] = moved;
axisRepeatTimers[i].restart();
} else if (autoRepeat && moved != 0) {
}
else if (autoRepeat && moved != 0) {
if ( axisRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
emit axisValueChanged(i, moved);
axes[i] = moved;
}
} else
}
else
axisRepeatTimers[i].restart();
} else
}
else {
emit axisValueChanged(i, 0);
}
}
for (i = 0; i < numButtons; i++) {
for (int i = 0; i < numButtons; i++) {
Uint8 changed = SDL_JoystickGetButton(joystick, i);
if ( (changed != buttons[i]) ) {
emit buttonValueChanged(i, (bool) changed);
buttons[i] = changed;
buttonRepeatTimers[i].restart();
} else if (autoRepeat && changed != 0) {
}
else if (autoRepeat && changed != 0) {
if ( buttonRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
emit buttonValueChanged(i, (bool) changed);
buttons[i] = changed;
}
} else
}
else {
buttonRepeatTimers[i].restart();
}
}
for (i = 0; i < numHats; i++) {
for (int i = 0; i < numHats; i++) {
Uint8 changed = SDL_JoystickGetHat(joystick, i);
if ( (changed != hats[i]) ) {
emit hatValueChanged(i, changed);
hats[i] = changed;
hatRepeatTimers[i].restart();
} else if (autoRepeat && changed != 0) {
}
else if (autoRepeat && changed != 0) {
if ( hatRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
emit hatValueChanged(i, changed);
hats[i] = changed;
}
} else
}
else {
hatRepeatTimers[i].restart();
}
}
for (i = 0; i < numTrackballs; i++) {
for (int i = 0; i < numTrackballs; i++) {
int dx, dy;
SDL_JoystickGetBall(joystick, i, &dx, &dy);
if ( dx != 0 || dy != 0 )
+37 -40
View File
@@ -3,21 +3,16 @@
#include "appdata.h"
#include <QtGui>
joystickDialog::joystickDialog(QWidget *parent, int stick) :
JoystickDialog::JoystickDialog(QWidget *parent, int stick) :
QDialog(parent),
ui(new Ui::joystickDialog) {
ui(new Ui::JoystickDialog)
{
ui->setupUi(this);
int jscaltmp[8][3] = {
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767},
{32767, 0, -32767}
};
memcpy(jscal, jscaltmp, sizeof (jscal));
for (int i=0; i<8; ++i) {
jscal[i][0] = 32767;
jscal[i][1] = 0;
jscal[i][2] = -32767;
}
ui->okButton->setDisabled(true);
ui->howtoLabel->setText(tr("Move sticks and pots in every direction making full movement\nPress next when finished"));
step = 0;
@@ -32,23 +27,24 @@ ui(new Ui::joystickDialog) {
connect(joystick, SIGNAL(axisValueChanged(int, int)), this, SLOT(onjoystickAxisValueChanged(int, int)));
}
joystickDialog::~joystickDialog() {
JoystickDialog::~JoystickDialog()
{
delete ui;
}
void joystickDialog::joystickOpen(int stick) {
void JoystickDialog::joystickOpen(int stick)
{
if (stick == -1) {
this->close();
return;
}
joystick = new Joystick(this, 1, false, 0);
int numAxes=std::min(joystick->numAxes,8);
int numAxes = std::min(joystick->numAxes, 8);
if (joystick) {
joystick->open(stick);
for (int j=0; j<numAxes; j++) {
joystick->sensitivities[j] = 0;
joystick->deadzones[j]=20;
joystick->sensitivities[j] = 0;
joystick->deadzones[j] = 20;
}
}
else {
@@ -57,27 +53,25 @@ void joystickDialog::joystickOpen(int stick) {
}
}
void joystickDialog::onjoystickAxisValueChanged(int axis, int value) {
void JoystickDialog::onjoystickAxisValueChanged(int axis, int value)
{
if (value > jscal[axis][2]) {
jscal[axis][2] = value;
}
if (value < jscal[axis][0]) {
jscal[axis][0] = value;
}
QSlider * sl[]= {ui->Ch_1, ui->Ch_2, ui->Ch_3, ui->Ch_4, ui->Ch_5, ui->Ch_6, ui->Ch_7, ui->Ch_8};
QCheckBox * ib[]={ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
if (ib[axis]->isChecked()) {
sl[axis]->setInvertedAppearance(true);
} else {
sl[axis]->setInvertedAppearance(false);
}
QSlider * sl[] = {ui->Ch_1, ui->Ch_2, ui->Ch_3, ui->Ch_4, ui->Ch_5, ui->Ch_6, ui->Ch_7, ui->Ch_8};
QCheckBox * ib[] = {ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
sl[axis]->setInvertedAppearance(ib[axis]->isChecked());
sl[axis]->setMinimum(jscal[axis][0]);
sl[axis]->setMaximum(jscal[axis][2]);
sl[axis]->setValue(value);
}
void joystickDialog::on_nextButton_clicked() {
int numAxes=std::min(joystick->numAxes,8);
void JoystickDialog::on_nextButton_clicked()
{
int numAxes = std::min(joystick->numAxes,8);
switch (step) {
case 0:
ui->howtoLabel->setText(tr("Place sticks and pots in middle position.\nPress next when done"));
@@ -85,11 +79,11 @@ void joystickDialog::on_nextButton_clicked() {
break;
case 1:
for (int i=0; i<numAxes; i++) {
jscal[i][1]=0;
for (int j=0; j<100;j++) {
jscal[i][1]+=joystick->getAxisValue(i);
jscal[i][1] = 0;
for (int j=0; j<100; j++) {
jscal[i][1] += joystick->getAxisValue(i);
}
jscal[i][1]/=100;
jscal[i][1] /= 100;
}
ui->howtoLabel->setText(tr("Map joystick channels to controls using comboboxes.\nPress next when done"));
step++;
@@ -110,20 +104,22 @@ void joystickDialog::on_nextButton_clicked() {
}
}
void joystickDialog::on_cancelButton_clicked() {
void JoystickDialog::on_cancelButton_clicked()
{
joystick->close();
this->close();
}
void joystickDialog::on_okButton_clicked() {
int sticks[8]={0,0,0,0,0,0,0,0};
void JoystickDialog::on_okButton_clicked()
{
int sticks[8] = {0,0,0,0,0,0,0,0};
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
sticks[cb->currentIndex()]++;
}
bool duplicated=false;
for (int i=1; i<8;i++) {
if (sticks[i]>1) {
duplicated=true;
duplicated = true;
}
}
if (duplicated) {
@@ -131,14 +127,15 @@ void joystickDialog::on_okButton_clicked() {
return;
}
joystick->close();
for (int i=0; i<8;i++) {
for (int i=0; i<8; i++) {
g.joystick[i].remove();
}
QCheckBox * ib[]={ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
int axe=cb->objectName().mid(cb->objectName().lastIndexOf("_")+1).toInt()-1;
int stick=cb->currentIndex();
if (stick > 0) {
int stick=cb->currentIndex() - 1;
qDebug() << "joystick mapping " << cb->objectName() <<"axe:" << axe << "stick:" << stick;
if (stick >= 0) {
g.joystick[stick].stick_axe( axe );
g.joystick[stick].stick_max( jscal[axe][2] );
g.joystick[stick].stick_med( jscal[axe][1] );
+5 -5
View File
@@ -5,23 +5,23 @@
#include <QDialog>
namespace Ui {
class joystickDialog;
class JoystickDialog;
}
class joystickDialog : public QDialog
class JoystickDialog : public QDialog
{
Q_OBJECT
public:
explicit joystickDialog(QWidget *parent = 0, int stick=-1);
~joystickDialog();
explicit JoystickDialog(QWidget *parent = 0, int stick=-1);
~JoystickDialog();
Joystick *joystick;
public slots:
void onjoystickAxisValueChanged(int axis, int value);
private:
Ui::joystickDialog *ui;
Ui::JoystickDialog *ui;
void joystickOpen(int stick);
int jscal[8][3];
int step;
+33 -4
View File
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>joystickDialog</class>
<widget class="QDialog" name="joystickDialog">
<class>JoystickDialog</class>
<widget class="QDialog" name="JoystickDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>301</height>
<width>505</width>
<height>398</height>
</rect>
</property>
<property name="sizePolicy">
@@ -908,6 +908,35 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>Ch_1</tabstop>
<tabstop>ChInv_1</tabstop>
<tabstop>jsmapCB_1</tabstop>
<tabstop>Ch_2</tabstop>
<tabstop>ChInv_2</tabstop>
<tabstop>jsmapCB_2</tabstop>
<tabstop>Ch_3</tabstop>
<tabstop>ChInv_3</tabstop>
<tabstop>jsmapCB_3</tabstop>
<tabstop>Ch_4</tabstop>
<tabstop>ChInv_4</tabstop>
<tabstop>jsmapCB_4</tabstop>
<tabstop>Ch_5</tabstop>
<tabstop>ChInv_5</tabstop>
<tabstop>jsmapCB_5</tabstop>
<tabstop>Ch_6</tabstop>
<tabstop>ChInv_6</tabstop>
<tabstop>jsmapCB_6</tabstop>
<tabstop>Ch_7</tabstop>
<tabstop>ChInv_7</tabstop>
<tabstop>jsmapCB_7</tabstop>
<tabstop>Ch_8</tabstop>
<tabstop>ChInv_8</tabstop>
<tabstop>jsmapCB_8</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>nextButton</tabstop>
<tabstop>okButton</tabstop>
</tabstops>
<resources>
<include location="companion.qrc"/>
</resources>
+15 -13
View File
@@ -59,16 +59,18 @@ class lcdWidget : public QWidget {
QPixmap buffer(2*lcdWidth, 2*lcdHeight);
QPainter p(&buffer);
doPaint(p);
bool toclipboard=g.snapToClpbrd();
QApplication::clipboard()->setPixmap( buffer );
if (!toclipboard) {
QString Path=g.snapshotDir();
if (Path.isEmpty() || !QDir(Path).exists()) {
Path=".";
bool toclipboard = g.snapToClpbrd();
if (toclipboard) {
QApplication::clipboard()->setPixmap( buffer );
}
else {
QString path = g.snapshotDir();
if (path.isEmpty() || !QDir(path).exists()) {
path = ".";
}
Path.append(QDir::separator()+fileName);
qDebug() << "Screenshot" << Path;
buffer.toImage().save(Path);
path.append(QDir::separator() + fileName);
qDebug() << "Screenshot" << path;
buffer.toImage().save(path);
}
}
@@ -120,18 +122,18 @@ class lcdWidget : public QWidget {
}
unsigned int previousDepth = 0xFF;
const int planSize = (lcdWidth * ((lcdHeight+7) / 8));
for (int y=0; y<lcdHeight; y++) {
unsigned int idx = (y/8)*lcdWidth;
unsigned int idx = (y*lcdDepth/8)*lcdWidth;
unsigned int mask = (1 << (y%8));
for (int x=0; x<lcdWidth; x++, idx++) {
if (lcdDepth == 1) {
if (lcdBuf[idx] & mask)
if (lcdBuf[idx] & mask) {
p.drawRect(2*x, 2*y, 1, 1);
}
}
else {
unsigned int z = (((lcdBuf[idx] & mask) ? 0x1 : 0) + ((lcdBuf[planSize+idx] & mask) ? 0x2 : 0) + ((lcdBuf[2*planSize+idx] & mask) ? 0x4 : 0) + ((lcdBuf[3*planSize+idx] & mask) ? 0x8 : 0));
unsigned int z = (y & 1) ? (lcdBuf[idx] >> 4) : (lcdBuf[idx] & 0x0F);
if (z) {
if (z != previousDepth) {
previousDepth = z;
+14 -1
View File
@@ -1232,7 +1232,7 @@ QPushButton:checked {
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="simu">
<attribute name="title">
@@ -1440,6 +1440,19 @@ QPushButton:checked {
</item>
</layout>
</widget>
<widget class="QWidget" name="outputs2">
<attribute name="title">
<string>Outputs2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QGridLayout" name="logicalSwitchesLayout2"/>
</item>
<item>
<layout class="QGridLayout" name="channelsLayout2"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Gvars</string>
@@ -70,7 +70,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="simu">
<attribute name="title">
@@ -240,6 +240,19 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="outputs2">
<attribute name="title">
<string>Outputs2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="logicalSwitchesLayout2"/>
</item>
<item>
<layout class="QGridLayout" name="channelsLayout2"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="misc">
<attribute name="title">
<string>Gvars</string>
@@ -1681,6 +1694,43 @@ QPushButton:checked {
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>switchF</tabstop>
<tabstop>dialP_3</tabstop>
<tabstop>switchE</tabstop>
<tabstop>switchA</tabstop>
<tabstop>switchB</tabstop>
<tabstop>dialP_1</tabstop>
<tabstop>dialP_2</tabstop>
<tabstop>switchC</tabstop>
<tabstop>switchD</tabstop>
<tabstop>switchG</tabstop>
<tabstop>dialP_4</tabstop>
<tabstop>switchH</tabstop>
<tabstop>holdLeftY</tabstop>
<tabstop>FixLeftY</tabstop>
<tabstop>FixLeftX</tabstop>
<tabstop>holdLeftX</tabstop>
<tabstop>leftStick</tabstop>
<tabstop>trimHL_L</tabstop>
<tabstop>trimHLeft</tabstop>
<tabstop>trimHL_R</tabstop>
<tabstop>trimVL_D</tabstop>
<tabstop>trimVLeft</tabstop>
<tabstop>trimVL_U</tabstop>
<tabstop>trimVR_U</tabstop>
<tabstop>trimVRight</tabstop>
<tabstop>trimVR_D</tabstop>
<tabstop>trimHR_L</tabstop>
<tabstop>trimHRight</tabstop>
<tabstop>trimHR_R</tabstop>
<tabstop>rightStick</tabstop>
<tabstop>holdRightY</tabstop>
<tabstop>FixRightY</tabstop>
<tabstop>FixRightX</tabstop>
<tabstop>holdRightX</tabstop>
</tabstops>
<resources>
<include location="../companion.qrc"/>
</resources>
+172 -56
View File
@@ -9,6 +9,42 @@
#define RESX 1024
int SimulatorDialog::screenshotIdx = 0;
SimulatorDialog * traceCallbackInstance = 0;
void traceCb(const char * text) {
// divert C callback into simulator instance
if (traceCallbackInstance) {
traceCallbackInstance->traceCallback(text);
}
}
void SimulatorDialog::traceCallback(const char * text)
{
// this function is called from other threads
traceMutex.lock();
// limit the size of list
if (traceList.size() < 1000) {
traceList.append(QString(text));
}
traceMutex.unlock();
}
void SimulatorDialog::updateDebugOutput()
{
traceMutex.lock();
while (!traceList.isEmpty()) {
QString text = traceList.takeFirst();
traceBuffer.append(text);
// limit the size of traceBuffer
if (traceBuffer.size() > 10*1024) {
traceBuffer.remove(0, 1*1024);
}
if (DebugOut) {
DebugOut->traceCallback(QString(text));
}
}
traceMutex.unlock();
}
SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
QDialog(parent),
@@ -19,10 +55,19 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
simulator(NULL),
lastPhase(-1),
beepVal(0),
TelemetrySimu(0),
TrainerSimu(0),
DebugOut(0),
buttonPressed(0),
trimPressed (TRIM_NONE),
middleButtonPressed(false)
{
//shorcut for telemetry simulator
// new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_T), this, SLOT(openTelemetrySimulator()));
new QShortcut(QKeySequence(Qt::Key_F4), this, SLOT(openTelemetrySimulator()));
new QShortcut(QKeySequence(Qt::Key_F5), this, SLOT(openTrainerSimulator()));
new QShortcut(QKeySequence(Qt::Key_F6), this, SLOT(openDebugOutput()));
traceCallbackInstance = this;
}
uint32_t SimulatorDialog9X::switchstatus = 0;
@@ -37,6 +82,9 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags):
initUi<Ui::SimulatorDialog9X>(ui);
// install simulator TRACE hook
simulator->installTraceHook(traceCb);
backLight = g.backLight();
if (backLight > 4) backLight = 0;
switch (backLight) {
@@ -109,6 +157,10 @@ SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int fl
lcdDepth = 4;
initUi<Ui::SimulatorDialogTaranis>(ui);
// install simulator TRACE hook
simulator->installTraceHook(traceCb);
dialP_4 = ui->dialP_4;
ui->lcd->setBackgroundColor(47, 123, 227);
@@ -154,6 +206,7 @@ SimulatorDialogTaranis::~SimulatorDialogTaranis()
SimulatorDialog::~SimulatorDialog()
{
traceCallbackInstance = 0;
delete timer;
delete simulator;
}
@@ -215,6 +268,49 @@ void SimulatorDialog::onTrimReleased()
trimPressed = TRIM_NONE;
}
void SimulatorDialog::openTelemetrySimulator()
{
// allow only one instance
if (TelemetrySimu == 0) {
TelemetrySimu = new TelemetrySimulator(this, simulator);
TelemetrySimu->show();
}
else if (!TelemetrySimu->isVisible()) {
TelemetrySimu->show();
}
}
void SimulatorDialog::openTrainerSimulator()
{
// allow only one instance
if (TrainerSimu == 0) {
TrainerSimu = new TrainerSimulator(this, simulator);
TrainerSimu->show();
}
else if (!TrainerSimu->isVisible()) {
TrainerSimu->show();
}
}
void SimulatorDialog::openDebugOutput()
{
// allow only one instance, but install signal handler to catch dialog destruction just in case
if (DebugOut == 0) {
DebugOut = new DebugOutput(this);
QObject::connect(DebugOut, SIGNAL(destroyed()), this, SLOT(onDebugOutputClose()));
DebugOut->traceCallback(traceBuffer);
DebugOut->show();
}
else if (!DebugOut->isVisible()) {
DebugOut->show();
}
}
void SimulatorDialog::onDebugOutputClose()
{
DebugOut = 0;
}
void SimulatorDialog::keyPressEvent (QKeyEvent *event)
{
switch (event->key()) {
@@ -282,9 +378,6 @@ void SimulatorDialog::initUi(T * ui)
trimHRight = ui->trimHRight;
trimVRight = ui->trimVRight;
tabWidget = ui->tabWidget;
logicalSwitchesLayout = ui->logicalSwitchesLayout;
channelsLayout = ui->channelsLayout;
gvarsLayout = ui->gvarsLayout;
leftXPerc = ui->leftXPerc;
leftYPerc = ui->leftYPerc;
rightXPerc = ui->rightXPerc;
@@ -301,7 +394,7 @@ void SimulatorDialog::initUi(T * ui)
for (int j=0; j<8; j++){
int axe = g.joystick[j].stick_axe();
if (axe>=0 && axe<8) {
jsmap[axe]=j;
jsmap[axe]=j+1;
jscal[axe][0] = g.joystick[j].stick_min();
jscal[axe][1] = g.joystick[j].stick_med();
jscal[axe][2] = g.joystick[j].stick_max();
@@ -356,14 +449,28 @@ void SimulatorDialog::initUi(T * ui)
setTrims();
int outputs = std::min(16, GetCurrentFirmware()->getCapability(Outputs));
int outputs = std::min(32,GetCurrentFirmware()->getCapability(Outputs));
if (outputs <= 16) {
// hide second Outputs tab
tabWidget->removeTab(tabWidget->indexOf(ui->outputs2));
}
else {
tabWidget->setTabText(tabWidget->indexOf(ui->outputs), tr("Outputs") + QString(" 1-%1").arg(16));
tabWidget->setTabText(tabWidget->indexOf(ui->outputs2), tr("Outputs") + QString(" 17-%1").arg(outputs));
}
for (int i=0; i<outputs; i++) {
int column = i / (outputs/2);
int line = i % (outputs/2);
QGridLayout * outputTab = ui->channelsLayout;
int column = i / (std::min(16,outputs)/2);
int line = i % (std::min(16,outputs)/2);
if (i >= 16 ) {
outputTab = ui->channelsLayout2;
column = (i-16) / (std::min(16,outputs-16)/2);
line = (i-16) % (std::min(16,outputs-16)/2);
}
QLabel * label = new QLabel(tabWidget);
ModelData model;
label->setText(RawSource(SOURCE_TYPE_CH, i).toString(model));
channelsLayout->addWidget(label, line, column == 0 ? 0 : 5, 1, 1);
outputTab->addWidget(label, line, column == 0 ? 0 : 5, 1, 1);
QSlider * slider = new QSlider(tabWidget);
slider->setEnabled(false);
@@ -389,30 +496,24 @@ void SimulatorDialog::initUi(T * ui)
slider->setInvertedAppearance(false);
slider->setTickPosition(QSlider::TicksBelow);
channelSliders << slider;
channelsLayout->addWidget(slider, line, column == 0 ? 1 : 4, 1, 1);
outputTab->addWidget(slider, line, column == 0 ? 1 : 4, 1, 1);
QLabel * value = new QLabel(tabWidget);
value->setMinimumSize(QSize(50, 0));
value->setAlignment(Qt::AlignCenter);
channelValues << value;
channelsLayout->addWidget(value, line, column == 0 ? 2 : 3, 1, 1);
outputTab->addWidget(value, line, column == 0 ? 2 : 3, 1, 1);
}
int switches = GetCurrentFirmware()->getCapability(LogicalSwitches);
for (int i=0; i<switches; i++) {
QFrame * swtch = new QFrame(tabWidget);
swtch->setAutoFillBackground(true);
swtch->setFrameShape(QFrame::Panel);
swtch->setFrameShadow(QFrame::Raised);
swtch->setLineWidth(2);
QVBoxLayout * layout = new QVBoxLayout(swtch);
layout->setContentsMargins(2, 2, 2, 2);
QLabel * label = new QLabel(swtch);
label->setText(RawSwitch(SWITCH_TYPE_VIRTUAL, i+1).toString());
label->setAlignment(Qt::AlignCenter);
logicalSwitchLabels << label;
layout->addWidget(label);
logicalSwitchesLayout->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
QFrame * swtch = createLogicalSwitch(tabWidget, i, logicalSwitchLabels);
ui->logicalSwitchesLayout->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
if (outputs > 16) {
// repeat logical switches on second outputs tab
swtch = createLogicalSwitch(tabWidget, i, logicalSwitchLabels2);
ui->logicalSwitchesLayout2->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
}
}
int fmodes = GetCurrentFirmware()->getCapability(FlightModes);
@@ -421,16 +522,16 @@ void SimulatorDialog::initUi(T * ui)
for (int fm=0; fm<fmodes; fm++) {
QLabel * label = new QLabel(tabWidget);
label->setText(QString("FM%1").arg(fm));
gvarsLayout->addWidget(label, 0, fm+1);
ui->gvarsLayout->addWidget(label, 0, fm+1);
}
for (int i=0; i<gvars; i++) {
QLabel * label = new QLabel(tabWidget);
label->setText(QString("GV%1").arg(i+1));
gvarsLayout->addWidget(label, i+1, 0);
ui->gvarsLayout->addWidget(label, i+1, 0);
for (int fm=0; fm<fmodes; fm++) {
QLabel * value = new QLabel(tabWidget);
gvarValues << value;
gvarsLayout->addWidget(value, i+1, fm+1);
ui->gvarsLayout->addWidget(value, i+1, fm+1);
}
}
}
@@ -443,6 +544,23 @@ void SimulatorDialog::initUi(T * ui)
}
}
QFrame * SimulatorDialog::createLogicalSwitch(QWidget * parent, int switchNo, QVector<QLabel *> & labels)
{
QFrame * swtch = new QFrame(parent);
swtch->setAutoFillBackground(true);
swtch->setFrameShape(QFrame::Panel);
swtch->setFrameShadow(QFrame::Raised);
swtch->setLineWidth(2);
QVBoxLayout * layout = new QVBoxLayout(swtch);
layout->setContentsMargins(2, 2, 2, 2);
QLabel * label = new QLabel(swtch);
label->setText(RawSwitch(SWITCH_TYPE_VIRTUAL, switchNo+1).toString());
label->setAlignment(Qt::AlignCenter);
labels << label;
layout->addWidget(label);
return swtch;
}
void SimulatorDialog::onButtonPressed(int value)
{
if (value == Qt::Key_Print) {
@@ -537,6 +655,8 @@ void SimulatorDialog::onTimerEvent()
QApplication::beep();
}
}
updateDebugOutput();
}
void SimulatorDialog::centerSticks()
@@ -814,9 +934,11 @@ void SimulatorDialog::setValues()
Trims trims;
simulator->getTrims(trims);
for (int i=0; i<std::min(16, GetCurrentFirmware()->getCapability(Outputs)); i++) {
channelSliders[i]->setValue(chVal(outputs.chans[i]));
channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1));
for (int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
if (i < channelSliders.size()) {
channelSliders[i]->setValue(chVal(outputs.chans[i]));
channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1));
}
}
leftXPerc->setText(QString("X %1%").arg((qreal)nodeLeft->getX()*100+trims.values[0]/5, 2, 'f', 0));
@@ -830,6 +952,9 @@ void SimulatorDialog::setValues()
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
logicalSwitchLabels[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF);
if (!logicalSwitchLabels2.isEmpty()) {
logicalSwitchLabels2[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF);
}
}
for (unsigned int gv=0; gv<numGvars; gv++) {
@@ -944,8 +1069,8 @@ void SimulatorDialog::on_FixRightY_clicked(bool checked)
void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
{
int stick;
if (axis>=0 && axis<=8) {
stick=jsmap[axis];
if (axis>=0 && axis<8) {
stick = jsmap[axis];
int stickval;
if (value>jscal[axis][1]) {
if ((jscal[axis][2]-jscal[axis][1])==0)
@@ -960,37 +1085,28 @@ void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
if (jscal[axis][3]==1) {
stickval*=-1;
}
if (stick==1 || stick==2) {
float currX=nodeRight->getX();
float currY=nodeRight->getY();
if (stick==1 ) {
nodeRight->setPos(currX*100-10,-stickval*100/1024-10);
}
if (stick==2) {
nodeRight->setPos(stickval*100/1024-10,currY*100-10);
}
}
else if (stick==3 || stick==4) {
float currX=nodeLeft->getX();
float currY=nodeLeft->getY();
if (stick==3) {
nodeLeft->setPos(currX*100-10,-stickval*100/1024-10);
}
if (stick==4) {
nodeLeft->setPos(stickval*100/1024-10,currY*100-10);
}
}
if (stick==5) {
if (stick==1 ) {
nodeRight->setY(-stickval/1024.0);
}
else if (stick==2) {
nodeRight->setX(stickval/1024.0);
}
else if (stick==3) {
nodeLeft->setY(-stickval/1024.0);
}
else if (stick==4) {
nodeLeft->setX(stickval/1024.0);
}
else if (stick==5) {
dialP_1->setValue(stickval);
}
if (stick==6) {
else if (stick==6) {
dialP_2->setValue(stickval);
}
if (stick==7) {
else if (stick==7) {
dialP_3->setValue(stickval);
}
if (stick==8 && dialP_4) {
else if (stick==8 && dialP_4) {
dialP_4->setValue(stickval);
}
}
+18 -3
View File
@@ -4,6 +4,9 @@
#include <QDialog>
#include "modeledit/node.h"
#include "eeprominterface.h"
#include "telemetrysimu.h"
#include "trainersimu.h"
#include "debugoutput.h"
#ifdef JOYSTICKS
#include "joystick.h"
@@ -38,6 +41,7 @@ class SimulatorDialog : public QDialog
void start(const char * filename);
void start(QByteArray & eeprom);
virtual void traceCallback(const char * text);
protected:
template <class T> void initUi(T * ui);
@@ -51,10 +55,8 @@ class SimulatorDialog : public QDialog
mySlider * trimHLeft, * trimVLeft, * trimHRight, * trimVRight;
QLabel * leftXPerc, * rightXPerc, * leftYPerc, * rightYPerc;
QTabWidget * tabWidget;
QGridLayout * logicalSwitchesLayout;
QGridLayout * channelsLayout;
QGridLayout * gvarsLayout;
QVector<QLabel *> logicalSwitchLabels;
QVector<QLabel *> logicalSwitchLabels2;
QVector<QSlider *> channelSliders;
QVector<QLabel *> channelValues;
QVector<QLabel *> gvarValues;
@@ -91,11 +93,20 @@ class SimulatorDialog : public QDialog
int getValue(qint8 i);
bool getSwitch(int swtch, bool nc, qint8 level=0);
void setTrims();
QFrame * createLogicalSwitch(QWidget * parent, int switchNo, QVector<QLabel *> & labels);
int beepVal;
int lcdWidth;
int lcdDepth;
TelemetrySimulator * TelemetrySimu;
TrainerSimulator * TrainerSimu;
DebugOutput * DebugOut;
QString traceBuffer;
QMutex traceMutex;
QList<QString> traceList;
void updateDebugOutput();
protected:
virtual void closeEvent(QCloseEvent *);
@@ -126,6 +137,10 @@ class SimulatorDialog : public QDialog
void onTimerEvent();
void onTrimPressed();
void onTrimReleased();
void openTelemetrySimulator();
void openTrainerSimulator();
void openDebugOutput();
void onDebugOutputClose();
#ifdef JOYSTICKS
void onjoystickAxisValueChanged(int axis, int value);
@@ -97,4 +97,9 @@ return lcd_buf;
return main_thread_error;
#endif
#ifdef SETTRAINER_IMPORT
#undef SETTRAINER_IMPORT
ppmInValid = 100;
g_ppmIns[inputNumber] = LIMIT<int16_t>(-512, value, 512);
#endif
@@ -80,6 +80,11 @@ class SimulatorInterface {
virtual const char * getError() = 0;
virtual void sendTelemetry(uint8_t * data, unsigned int len) = 0;
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) = 0;
virtual void installTraceHook(void (*callback)(const char *)) = 0;
};
#endif
@@ -0,0 +1,91 @@
#include <stdint.h>
#include "telemetrysimu.h"
#include "ui_telemetrysimu.h"
#include "radio/src/telemetry/frsky.h"
TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator):
QDialog(parent),
ui(new Ui::TelemetrySimulator),
simulator(simulator)
{
ui->setupUi(this);
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(onTimerEvent()));
timer->start(100);
}
TelemetrySimulator::~TelemetrySimulator()
{
timer->stop();
delete ui;
}
void TelemetrySimulator::onTimerEvent()
{
if (ui->Simulate->isChecked()) {
generateTelemetryFrame();
}
}
void TelemetrySimulator::closeEvent(QCloseEvent *event)
{
ui->Simulate->setChecked(false);
event->accept();
}
void setSportPacketCrc(uint8_t * packet)
{
short crc = 0;
for (int i=1; i<FRSKY_SPORT_PACKET_SIZE-1; i++) {
crc += packet[i]; //0-1FF
crc += crc >> 8; //0-100
crc &= 0x00ff;
crc += crc >> 8; //0-0FF
crc &= 0x00ff;
}
packet[FRSKY_SPORT_PACKET_SIZE-1] = 0xFF - (crc & 0x00ff);
//TRACE("crc set: %x", packet[FRSKY_SPORT_PACKET_SIZE-1]);
}
void generateSportPacket(uint8_t * packet, uint8_t dataId, uint8_t prim, uint16_t appId, uint32_t data)
{
packet[0] = dataId;
packet[1] = prim;
*((uint16_t *)(packet+2)) = appId;
*((int32_t *)(packet+4)) = data;
setSportPacketCrc(packet);
}
void TelemetrySimulator::generateTelemetryFrame()
{
static int item = 0;
uint8_t buffer[FRSKY_SPORT_PACKET_SIZE];
switch(item++) {
case 0:
generateSportPacket(buffer, 1, DATA_FRAME, RSSI_ID, LIMIT<uint32_t>(0, ui->Rssi->text().toInt(), 0xFF));
break;
case 1:
generateSportPacket(buffer, 1, DATA_FRAME, XJT_VERSION_ID, 11);
break;
case 2:
generateSportPacket(buffer, 1, DATA_FRAME, SWR_ID, LIMIT<uint32_t>(0, ui->Swr->text().toInt(), 0xFF));
break;
case 3:
generateSportPacket(buffer, 1, DATA_FRAME, ADC1_ID, LIMIT<uint32_t>(0, ui->A1->text().toInt(), 0xFF));
break;
case 4:
generateSportPacket(buffer, 1, DATA_FRAME, ADC2_ID, LIMIT<uint32_t>(0, ui->A2->text().toInt(), 0xFF));
break;
default:
item = 0;
return;
}
simulator->sendTelemetry(buffer, 9);
}

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