* Lua array indexes start at 1
* LUA model.setFlightMode: use array index to compute trim index
This allows for providing an incomplete table like this:
```
-- Disable T5 & T6 on FM0
modes = {}
modes[5] = 31
modes[6] = 31
t = {}
t["trimsModes"] = modes
model.setFlightMode(0, t)
```
* Remove warning & cleanup
* Fix trim value constraints in model.setFlightMode()
* Moved getFieldInfo and getValue up right after related functions
* Modified getValue to return a valid status, so Lua can see if it got zero because of invalid source id
* Added new getSourceValue Lua function per Issue #781
Also added alias getSourceInfo for getFieldInfo
* Updated according to comment https://github.com/EdgeTX/edgetx/pull/2175#issuecomment-1245605114
* Replaced isFresh() by !isOld() as requested in https://github.com/EdgeTX/edgetx/pull/2316#issuecomment-1246759370
* Clean up `lua_pushtablenil` - tables cannot hold nil values
* Changed isFresh() to !isOld() ... AGAIN
* Return both `!isOld()` and `isFresh()`
* Return nil for all values if the item does not exist
* Return 0 instead of pushing three nil values
* Update documentation
* Special Function to set main screen (#2135)
* chore: Add new SF to LUA constants list
* Companion support
* Formatting
* get rid of magic number
* Add function to get the number of custom screens
* Change screen numbering from 0-based to 1-based.
* Allow SetScreen custom function for Color LCD only
* add range protection
* cleanup
* yet, range protection once again
* fix: paintSpecialFunctionLine can't alter SF param data
* Fix screen initialization in companion
* move screen switching to the UI
* Trigger view change from guiMain()
* chore: Change "SET" to "Set" for consistency
* fix: Somehow missed extra comma in `TW`
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
* First build
* Fix X9
* Update api_general.cpp
* Update translations.h
* clean up translations
* fix: B&W option handling, remove magic numbers, cleanup
- Remove references to invertRotary, change to RotEncDir or similar
- Add compatabilty importing to companion, firmware
- Rename Lua API call
- Move magic numbers to enum
- Improve B&W option handling so it doesn't apply changes while in menu
* chore: yaml regen
* fix: Add missing guards for X9D/X9D+
* fix: Wrong enum name in simu
* fix(cpn): Use correct names for UI elements
* fix: Translations
* fix: Allow `rotEncMode` in all yaml due to x9d var
Of the three X9D variants, the X9D+2019 is the only one that
has a rotary encoder as standard. However, as the base config
file is for the X9D, this meant it wasn't reading or writing the
config value. Rather than add a seperate config file for it for
a single variable, simple to just allow it across all targets.
* fix: Companion string, change colorlcd to `Choice`
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
* transferred respective OpenTX updates to HoTT telemetry
* integrated LUA function flushAudio from OpenTx
* sensor names moved to “untranslated.h”
reverted *.h.txt to original mainline content
removed leading "Z" in sensor name defines
`getfieldInfo` can now also take a source index as argument. Plus it was modified to also handle "telem1+" etc.
New functions `getSourceIndex(sourceName)` and `getSourceName(sourceIndex)` were added, which use the names shown on the
screen instead of the special names table used by `getFieldInfo` and `getValue`.
Indices are the same for all of the functions, so `getValue(sourceIndex)` also works with indices from `getSourceIndex`.
New iterator functions `sources([first[, last]])` and `switches([first[, last]])` for getting ranges of sources and switches.
`getPhysicalSwitches` was removed, as I consider the iterator function to be a better solution.
[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
* 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
* 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
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.