Akce

Lua skripty OpenTx2: Porovnání verzí

Z Wiki OpenTX

Řádek 9: Řádek 9:
 
====Speciálním použitím Lua skriptu je průvodce nastavením modelu.====
 
====Speciálním použitím Lua skriptu je průvodce nastavením modelu.====
  
Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen.
+
Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen.<br>
  
I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua.
+
I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua.<br>
  
Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard.
+
Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard.<br>
  
One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories).  
+
One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories).<br>
  
Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card:
+
Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card:<br>
/SCRIPTS/
+
/SCRIPTS/<br>
/SCRIPTS/MIXES/
+
/SCRIPTS/MIXES/<br>
/SCRIPTS/FUNCTIONS/
+
/SCRIPTS/FUNCTIONS/<br>
/SCRIPTS/WIZARD/
+
/SCRIPTS/WIZARD/<br>
  
In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis):
+
In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis):<br>
/SCRIPTS/<MODELNAME>/telemXX.lua
+
/SCRIPTS/<MODELNAME>/telemXX.lua<br>
  
And in OpenTX 2.0.5 you will put your templates scripts here:
+
And in OpenTX 2.0.5 you will put your templates scripts here:<br>
/SCRIPTS/TEMPLATES/
+
/SCRIPTS/TEMPLATES/<br>
  
 
Enjoy!
 
Enjoy!
 
Bertrand
 
Bertrand

Verze z 18. 6. 2014, 19:55

Opentx 2.x přináší novinku v podobě možnosti skriptování v jazyce Lua.

Skripty Lua jsou jekési miniaplikace, které mohou doplnit funkčnost rádia o nevídané funkce. Jejich výhodou je jejich modulárnost. Nejsou součástí firmware, ale zpouští se přímo z SD karty. Mohou fungovat v několika režimech:

  • jednorázový skript, který provede nějakou operaci a poté se ukončí
  • skript který funguje neustále na pozadí

Speciálním použitím Lua skriptu je průvodce nastavením modelu.

Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen.

I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua.

Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard.

One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories).

Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card:
/SCRIPTS/
/SCRIPTS/MIXES/
/SCRIPTS/FUNCTIONS/
/SCRIPTS/WIZARD/

In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis):
/SCRIPTS/<MODELNAME>/telemXX.lua

And in OpenTX 2.0.5 you will put your templates scripts here:
/SCRIPTS/TEMPLATES/

Enjoy! Bertrand