Commit Graph
474 Commits
Author SHA1 Message Date
jfrickmann 5fd78ce0d7 Updated libopenui 2021-08-26 10:49:45 -04:00
jfrickmannandRaphael Coeffic 468a322f61 Updated documentation for Lua functions, mainly related to color 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 9d878b71ce Improved color handling in Lua
LCD flags can now hold either a theme color index or a RGB value. Hence, values from lcd.RGB() and literal colors like e.g. RED, WHITE etc. can be used interchangeably with theme colors and CUSTOM_COLOR.
Also redesigned drawText, drawNumber and drawTimer, so they now use a common function to implement the party tricks with BLINK and INVERS flags.
2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 57e455d343 Made all flags optional and updated documentation 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 3ae5f032fc Fixed a bug in lcd.drawLine function 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic d0e4b767d3 Converted literal colors to indices that can be used everywhere.
Also modified lcd.setColor function so it accepts either RGB or index color as new color. That way, literal colors work as before.
2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 8fb260d2b2 Fixed Lua function drawPoint and default color
I had deleted the default color, now it is back again. Lua drawPoint color did not work, it does now. Some style updates to the Lua code where several different names were used for variables holding flags.
2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 23ee5d933c Added back Lua constants for old style them colors 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 95b87db3e0 Did a scripted search and replace to replace 40 existing theme colors with 11 new theme colors. 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 302fcef465 Added OS theme colors as suggested by JimB40 in #506
Amend: trying if tests will pass when I move the new color indices to then end of the enum.
2021-08-22 19:33:03 +02:00
jfrickmann 8e4e2cceea Fix for issue #537
The function luaResume(...) assumes that it is called alternatingly in the background and the foreground.
But on color LCD radios it is only called in the foreground by standalone and tools script, so it got stuck waiting for a foreground call.
2021-08-03 20:57:16 -04:00
Raphael Coeffic 56542bf7e8 Some fixes for simu 2021-07-31 17:31:50 +02:00
jfrickmannandRaphael Coeffic 6e37d11710 Added a lua function lcd.sizeText(text[, flags])
Gets the width and height (incl. vertical offset) of text on the LCD with flags applied.
2021-07-31 07:59:08 +02:00
jfrickmannandRaphael Coeffic bf656ffd7b Added event buffer to LuaWidget
Since Lua only runs at 10 Hz and the GUI at a higher frequency, events sometimes are skipped unless we store them in a buffer.
This buffer is only two slots, but can be expanded by changing EVENT_BUFFER_SIZE.
2021-07-31 07:54:17 +02:00
Raphael CoefficandGitHub 6e9b09b548 Merge pull request #494 from EdgeTX/nv14-build
NV14 Support and Build
2021-07-27 09:39:03 +02:00
jfrickmann d4e02dbc22 Accumulate (slideX, slideY) with touch slide events.
Apparently, onTouchSlide gets called more frequently, and hence we miss some of the sliding if we do not accumulate between calls to Lua.
2021-07-26 21:34:38 -04:00
richardclliandGitHub f12e9d4599 Merge pull request #501 from EdgeTX/main
Merge from main
2021-07-26 10:50:32 +08:00
jfrickmann da94cc64ff Merge branch 'VCENTER' into Everything 2021-07-24 17:32:48 -04:00
jfrickmann 1fc59ce31a Merged LuaScriptPreemption 2021-07-24 17:32:41 -04:00
richardclliandGitHub d9d4591008 Merge pull request #495 from EdgeTX/main
Merge from main
2021-07-24 00:23:37 +08:00
jfrickmann 5671838864 Cleaned up code for Mixer/Custom/Model scripts and added compiler directives 2021-07-22 15:11:12 -04:00
jfrickmann dcac3cb9da Fixed Lua error messages in standalone and telemetry scripts - again. There is still a problem that the call to POPUP_WARNING in displayLuaError does not return and the gui goes dark on colorlcd. Could it be long jump? 2021-07-22 14:56:23 -04:00
jfrickmann c76532f33a Fixed Lua error messages in standalone and telemetry scripts. TODO: If a standalone script errors in init() on COLORLCD it just quits without showing error. Is that because it calls luaError from luaExec() in radio_tools.cpp instead of from luaTask() in standalone_lua.cpp? 2021-07-22 14:51:44 -04:00
jfrickmann c62aac7bde Lua task preempts long running scripts instead of killing them
Ported to EdgeTX from https://github.com/opentx/opentx/pull/8194
2021-07-22 14:41:53 -04:00
jfrickmann 296acc6558 Code polishing 2021-07-22 08:03:48 -04:00
jfrickmann fd05bcab19 One swipe at a time
Added a timeout so we do not get a swipe storm during slide events
2021-07-22 08:03:28 -04:00
jfrickmann 61602d525b Improved swipe-onomics 2021-07-22 08:03:09 -04:00
jfrickmann 8b90754e95 Only one EVT_TOUCH_FIRST at a time 2021-07-22 08:02:53 -04:00
jfrickmann 0b9fd82074 Added touch events to Lua widgets 2021-07-22 08:02:33 -04:00
jfrickmann e1066af88c Added LuaWidget::onEvent(event) and LuaWidget::event to capture key events to be passed to the Lua widgets. 2021-07-22 08:01:29 -04:00
jfrickmann e3fb2ac6ea Added key event to fullscreen Lua widget 2021-07-22 08:01:08 -04:00
jfrickmann 2e129af9f1 Added VCENTER to lcd flags
Only for COLORLCD
2021-07-21 19:53:13 -04:00
Raphael Coeffic 6d11fa8033 [lua] Fix sensor max and min matching
Resolves #442
2021-07-14 08:45:00 +02:00
richardclliandGitHub 2222ee75e8 Merge pull request #373 from EdgeTX/2.4
Merge from 2.4
2021-06-30 15:14:08 +08:00
Richard Li fe532f32fe Some more fixes. 2021-06-30 15:10:45 +08:00
Peter FeerickandRaphael Coeffic edbec9f35e Updated getVersion luadoc and example output
Finished updated lua docs for getVersion() api change,
verified functionality and grabbed simulator output,
removed magic string and used a define instead.
2021-06-26 06:36:35 +02:00
PeterandRaphael Coeffic 74222fe74d Lua scripts can detect EdgeTX via getVersion
Add a sixth parameter to getVersion so that scripts 
can detect whether running on EdgeTX or OpenTX. 

i.e. `local ver, radio, maj, minor, rev, osname = getVersion()`
2021-06-26 06:36:35 +02:00
richardclliandGitHub 2f54a629a2 Merge pull request #289 from EdgeTX/2.4
Merge from 2.4 bug fixes
2021-06-21 15:45:44 +08:00
Raphael Coeffic 9ecccef315 Call LuaWidget background() if widget is not painted
Resolves #222
2021-06-19 17:47:47 +02:00
Raphael Coeffic d10563d08b Fixed more zchar / string copy errors
Resolves #224
2021-06-16 18:00:42 +02:00
Raphael Coeffic 60517df349 Removed necessity for lcd allowance in lcd.setColor() and lcd.getColor() 2021-06-15 16:24:54 +02:00
Raphael Coeffic b8511a2b22 Fix lcd.RGB()
It does not require access to lcd, so let's not check that.
2021-06-15 16:19:43 +02:00
yaapu 1f62bab4f1 colorlcd: lua fix INVERS+RIGHT in drawText, drawNumber 2021-06-14 08:07:31 +00:00
yaapu 29966c53ff colorlcd: fix for BOLD font h/v offsets, fix for lcd.clear() 2021-06-12 22:05:07 +00:00
yaapu e5bb4d3fb7 colorlcd: fix for drawNumber INVERS and text vertical and horizontal offsets 2021-06-12 10:25:57 +00:00
Raphael Coeffic 78915daf95 Fixed memory leak: widget factories need to be deleted
in opentxClose()
2021-06-12 07:38:31 +02:00
Raphael Coeffic c37bc91475 Unregister LUA widgets when the factory is destoyed
Resolves #183
2021-06-12 07:38:30 +02:00
Richard Li cc92f25046 Fixed NV14 build, added flysky build script and target in build-gh.sh 2021-06-09 16:10:45 +08:00
Raphael Coeffic 247ac2a524 Fixes 2021-06-09 09:30:18 +02:00
Raphael Coeffic b0fb80b264 ZChar nightmare / take 2 2021-06-09 09:24:48 +02:00