Commit Graph
521 Commits
Author SHA1 Message Date
rotormanandRaphael Coeffic 89517d8bd8 Use ETX instead of OTX (also as a file extension). 2021-12-31 10:53:08 +01:00
Jesper FrickmannandGitHub d37b3e4051 [lua] Fix Lua Mixer index issue (#1312)
* Bug with the index of Mixer script input/output data

* Missed a #if defined(COLORLCD)
2021-12-30 19:37:23 +10:00
3djcandRaphael Coeffic d31482c18b Introduce T-pro and function switches handling 2021-12-17 17:07:48 +01:00
3djcandRaphael Coeffic 6735a42b08 Radiomaster Zorro
Port of opentx/opentx#8791
2021-12-17 15:17:48 +01:00
jfrickmannandPeter Feerick 85bd9d16ea Added Lua constants for logical switch and special/custom functions 2021-12-15 12:24:58 +10:00
jfrickmannandPeter Feerick a66e78fea8 Fixed string option for Lua widgets 2021-12-14 20:12:12 +10:00
jfrickmannandPeter Feerick a9c5365ccb Truncate Mixer Lua script input and output names to 6 chars 2021-12-13 14:51:47 +10:00
jfrickmannandRisto 14f72e1d82 Added new Lua API functions for switches
getSwitchId(positionName)
getSwitchName(switchId)
getSwitchValue(switchId)
getPhysicalSwitches()
2021-12-01 18:41:04 +01:00
Peter FeerickandPeter Feerick 9401e00253 Add missing newline at EOF 2021-11-29 12:00:50 +10:00
jfrickmannandPeter Feerick 81cb94a4bf Added string constants to the read-only tables in Lua 2021-11-29 12:00:50 +10:00
Jesper FrickmannandGitHub a09e318e64 [Lua] Add setStickySwitch and getLogicalSwitchValue (#1056)
[Lua] Add setStickySwitch and getLogicalSwitchValue (#1056)
* Adds setStickySwitch to set the value of a stick logical switch
* Adds getLogicalSwitchValue to get the value of a logical switch by index
2021-11-29 12:48:01 +11:00
jfrickmannandPeter Feerick d4b8717575 Added zone.absx and zone.absy to give position of a Lua widget on the screen 2021-11-27 18:18:44 +10:00
Peter FeerickandGitHub a05cc887b9 Add touch to Standalone Lua scripts (#1082)
Touch events to Standalone Lua scripts
2021-11-25 10:49:44 +10:00
Peter FeerickandGitHub 362a8e435f Add filename to lua model.getInfo() (#1132)
* Add filename to lua `model.getInfo()`

* Make `getModelNumberStr()` globally available

* Move variable extern

* Move constexpr to header, remove externs

* Perhaps .cpp should include its OWN header
2021-11-25 10:38:51 +11:00
Raphael CoefficandRaphael Coeffic 5e3c20b258 Push some dirty hack to give internal CRSF a higher prio
This allows for BF scripts to run on internal CRSF.
2021-11-21 11:18:35 +01:00
Raphael CoefficandRaphael Coeffic 043c1e6a2d Fixed pushing CRSF telem packets to internal module 2021-11-21 11:18:35 +01:00
jfrickmann ce7b408445 Add touch to Standalone Lua scripts 2021-11-19 08:01:28 -05:00
jfrickmann df153b4b1f memset() -> memclear() 2021-11-18 19:51:01 -05:00
Jesper FrickmannandGitHub f1baa383ae Fix standalone Lua script screen flicker and improve error messages (#982)
* Relax assumptions about when Lua is called in foreground and background

* Start Lua cycle timer both in foreground and background
Do not assume that background/foreground alternates

* Lua is called at every Standalone GUI cycle instead of 5 Hz
Since Lua preempts every 50 ms or so, the GUI should remain responsive.

* In standalone script, only call Lua once per GUI cycle, to avoid messing up buffer handling.

* Revamped error reporting for Standalone and Telemetry Lua scripts

* Font size for Lua error is reduced from XL to L on color if LCD_W < LCD_H

* In drawTextLines, also possible linebreaks for opening brackets.

* Smaller font for error message on tall color screen

* Make titlebar height match font size on narrow LCD
2021-11-15 12:57:14 +11:00
Jesper FrickmannandGitHub 30780d82ec [lua] Add shared memory variables which can be accessed from Lua widgets and other Lua scripts (#1018)
* Issue #132
Added 16 shared memory variables which can be accessed bot from Lua widgets and other Lua scripts.

* Notice Only available on radios with color display
2021-11-13 16:10:33 +11:00
Raphael Coeffic 69c017091a More stringified values 2021-11-10 11:07:01 +01:00
Raphael Coeffic d2ddb2e535 Fix compilation error 2021-11-10 11:06:59 +01:00
Peter FeerickandGitHub 3ad98bacf4 [NV14] Use trim hats to emulate key events when standalone lua script running (#985)
* Preliminary trims as keys for lua
Largely based on open-flysky implementation

* Add `isLuaStandaloneRunning()`

* Add more virtual events

* Tweak virtual events further

* Finish remapping keys to virtual events

* Move some virtuals to right trim hat

* Add missing "defined"

* Revert to common EVT_VIRTUAL_MENU mapping

* Make keys/trims reset backlight like other radios
2021-11-09 12:50:20 +11:00
eshifriandGitHub 4e571c1325 Improvements to time and timer display #911 (#912)
* Fix time display #911

* move TIMEHOUR definition

* change time format

* Refactoring

* rename

* remove unncessary code

* Change hour/minute format

* pack TimerDisplayOptions structure
2021-10-25 12:36:16 +11:00
Jesper FrickmannandGitHub ecf386e71f Fix certain Lua script errors hanging the GUI (#899)
* Fixed a bug where a standalone Lua script w/o a run function will hang the GUI on non-color radios

* Prevent Lua standalone window from opening if Lua failed on load

* Fixed scroll down key in TX12 simulator
Copied key definitions from TX16S

* Fixed the Lua error trying to call nil value when no scripts are loaded.

* I messed up in the previous commit; now it does not freeze and it does not call nil.
2021-10-15 12:03:23 +11:00
jfrickmannandPeter Feerick b316a11bba Per discussion on Discord
https://discord.com/channels/839849772864503828/842693696629899274/894878085210574889
2021-10-06 11:42:05 +11:00
rotormanandRisto fc2142ec78 Changed uniformly to EdgeTX boiler plate (also added boiler for files that were missing it). 2021-10-02 14:22:01 +02:00
Raphael Coeffic a17a02c541 Compute SDKROOT and use it 2021-09-16 12:05:41 +02:00
Jesper FrickmannandGitHub 8d04b5112d Add tap count support to simulator (#719)
* Removed unused #define
* Added touchState.tapCount for double taps etc. to simulator
2021-09-14 16:30:39 +10:00
jfrickmann dcd5db38f9 Set error message if script fails in create() function 2021-09-11 13:36:10 -04:00
jfrickmann 98ed28db09 Added Lua function lcd.exitFullScreen() 2021-09-11 09:00:20 -04:00
jfrickmann ca478dccba Removed unused function exec() 2021-09-11 07:35:48 -04:00
Peter FeerickandGitHub 3778ed26dd Merge pull request #703 from jfrickmann/DoubleTap
Double tap
2021-09-11 11:28:07 +10:00
jfrickmann 935bd403ee Add tapCount to touchState in Lua widgets 2021-09-10 17:14:37 -04:00
jfrickmann c0e25bfbff Modify Lua function lcd.RGB(...)
Now it can take *either* (r, g, b) as before *or* one single argument between 0 and 0xFFFFFF.
2021-09-09 16:51:03 -04:00
jfrickmann 1e505d4029 Do not apply (x,y) offsets! 2021-09-04 15:55:14 -04:00
jfrickmann e15b9636fa Implemented BLINK, INVERSE and SHADOWED
Also updated documentation
2021-09-04 07:15:02 -04:00
jfrickmann b100d9a164 Add Lua function lcd.drawTextLines(...) drawing text across multiple lines inside bounding box 2021-09-02 14:33:14 -04:00
Jesper FrickmannandGitHub cea723c56e Do not reload bitmps during theme update, unless reload argument is true (#661)
* Do not reload bitmps during theme update, unless reload argument is true
Trying to optimize speed for theme color changes.
FlySky is not optimized yet.

* Do not update theme from Lua lcd.setColor(CUSTOM_COLOR, x)
Some widgets like e.g. Timer2 constantly change CUSTOM_COLOR, and this seems to slow down things

* Lua function lcd.setColor() only updates if color is changed
To avoid that scripts calling lcd.setColor() repeatedly trash performance
2021-09-01 11:10:52 +10:00
Raphael CoefficandGitHub bbea8795a6 Merge pull request #630 from Riwan2/lua-fs-ops2
Added LUA file system operations
2021-08-31 06:27:12 +02:00
Peter FeerickandGitHub 4ad5cc0ab5 Merge pull request #651 from jfrickmann/FixMissingColors
Fix missing colors
2021-08-30 20:46:40 +10:00
jfrickmann f8eb2adab0 Show error message in Lua widgets instead of "disabled"
Also a new function drawTextLines(...) in draw_functions that splits a string over multiple lines
2021-08-29 18:22:31 -04:00
jfrickmann 5b3db33f03 Translate color option to create() function call
Forgot that in PR #646
2021-08-28 10:29:41 -04:00
jfrickmann 1af65969ed Color options for Lua widget get translated to Lua color flags
To support new color encoding in Lua widgets
2021-08-27 22:21:37 -04:00
jfrickmann 5fd78ce0d7 Updated libopenui 2021-08-26 10:49:45 -04:00
Riwan 5f10f8c1f6 update headers and luadoc "introduced in" 2021-08-24 11:48:24 +02:00
Riwan c1d8ae531a moving include api_filesystem 2021-08-24 10:24:47 +02:00
Riwan ec1c1ec345 Added LUA file system operations 2021-08-23 14:39:49 +02: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