mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
HASPmota solidify server-side (#20938)
This commit is contained in:
parent
f488ef922a
commit
4d7036db3b
10
.github/workflows/Tasmota_build_devel.yml
vendored
10
.github/workflows/Tasmota_build_devel.yml
vendored
@ -46,10 +46,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd lib/libesp32_lvgl/lv_binding_berry
|
cd lib/libesp32_lvgl/lv_binding_berry
|
||||||
../../libesp32/berry/berry -s -g solidify_all.be
|
../../libesp32/berry/berry -s -g solidify_all.be
|
||||||
|
- name: HASPmota Berry Code
|
||||||
|
run: |
|
||||||
|
cd lib/libesp32_lvgl/lv_haspmota
|
||||||
|
../../libesp32/berry/berry -s -g solidify_all.be
|
||||||
- uses: jason2866/upload-artifact@v2.0.3
|
- uses: jason2866/upload-artifact@v2.0.3
|
||||||
with:
|
with:
|
||||||
name: '["berry_tasmota", "berry_matter", "berry_animate", "berry_lvgl", "berry_header"]'
|
name: '["berry_tasmota", "berry_matter", "berry_animate", "berry_lvgl", "berry_haspmota", "berry_header"]'
|
||||||
path: '["./lib/libesp32/berry_tasmota/src/solidify", "./lib/libesp32/berry_matter/src/solidify", "./lib/libesp32/berry_animate/src/solidify", "./lib/libesp32_lvgl/lv_binding_berry/src/solidify", "./lib/libesp32/berry/generate"]'
|
path: '["./lib/libesp32/berry_tasmota/src/solidify", "./lib/libesp32/berry_matter/src/solidify", "./lib/libesp32/berry_animate/src/solidify", "./lib/libesp32_lvgl/lv_binding_berry/src/solidify", "./lib/libesp32_lvgl/lv_haspmota/src/solidify", "./lib/libesp32/berry/generate"]'
|
||||||
|
|
||||||
push_solidified:
|
push_solidified:
|
||||||
needs: be_solidify
|
needs: be_solidify
|
||||||
@ -69,12 +73,14 @@ jobs:
|
|||||||
berry_matter
|
berry_matter
|
||||||
berry_animate
|
berry_animate
|
||||||
berry_lvgl
|
berry_lvgl
|
||||||
|
berry_haspmota
|
||||||
berry_header
|
berry_header
|
||||||
path: |
|
path: |
|
||||||
./lib/libesp32/berry_tasmota/src/solidify
|
./lib/libesp32/berry_tasmota/src/solidify
|
||||||
./lib/libesp32/berry_matter/src/solidify
|
./lib/libesp32/berry_matter/src/solidify
|
||||||
./lib/libesp32/berry_animate/src/solidify
|
./lib/libesp32/berry_animate/src/solidify
|
||||||
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
||||||
|
./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
||||||
./lib/libesp32/berry/generate
|
./lib/libesp32/berry/generate
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
|
@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- LVGL optimize fonts and add icons (#20880)
|
- LVGL optimize fonts and add icons (#20880)
|
||||||
- LVGL improved readability of montserrat-10 (#20900)
|
- LVGL improved readability of montserrat-10 (#20900)
|
||||||
- HASPmota moved to a distinct library `lv_haspmota`
|
- HASPmota moved to a distinct library `lv_haspmota`
|
||||||
|
- HASPmota solidify server-side
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Berry bug when parsing ternary operator (#20839)
|
- Berry bug when parsing ternary operator (#20839)
|
||||||
|
99
lib/libesp32_lvgl/lv_haspmota/solidify_all.be
Executable file
99
lib/libesp32_lvgl/lv_haspmota/solidify_all.be
Executable file
@ -0,0 +1,99 @@
|
|||||||
|
#!/usr/bin/env -S ../../libesp32/berry/berry -s -g
|
||||||
|
#
|
||||||
|
# Berry solidify files
|
||||||
|
|
||||||
|
import os
|
||||||
|
import global
|
||||||
|
import solidify
|
||||||
|
import string as string2
|
||||||
|
import re
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path().push('src/embedded') # allow to import from src/embedded
|
||||||
|
|
||||||
|
# globals that need to exist to make compilation succeed
|
||||||
|
var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state,udp,tcpclientasync,"
|
||||||
|
"lv_clock,lv_clock_icon,lv_signal_arcs,lv_signal_bars,lv_wifi_arcs_icon,lv_wifi_arcs,"
|
||||||
|
"lv_wifi_bars_icon,lv_wifi_bars,"
|
||||||
|
"_lvgl,"
|
||||||
|
"int64"
|
||||||
|
|
||||||
|
for g:string2.split(globs, ",")
|
||||||
|
global.(g) = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
var prefix_dir = "src/embedded/"
|
||||||
|
var prefix_out = "src/solidify/"
|
||||||
|
|
||||||
|
def sort(l)
|
||||||
|
# insertion sort
|
||||||
|
for i:1..size(l)-1
|
||||||
|
var k = l[i]
|
||||||
|
var j = i
|
||||||
|
while (j > 0) && (l[j-1] > k)
|
||||||
|
l[j] = l[j-1]
|
||||||
|
j -= 1
|
||||||
|
end
|
||||||
|
l[j] = k
|
||||||
|
end
|
||||||
|
return l
|
||||||
|
end
|
||||||
|
|
||||||
|
def clean_directory(dir)
|
||||||
|
var file_list = os.listdir(dir)
|
||||||
|
for f : file_list
|
||||||
|
if f[0] == '.' continue end # ignore files starting with `.`
|
||||||
|
os.remove(dir + f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
var pattern = "#@\\s*solidify:([A-Za-z0-9_.,]+)"
|
||||||
|
|
||||||
|
def parse_file(fname, prefix_out)
|
||||||
|
print("Parsing: ", fname)
|
||||||
|
var f = open(prefix_dir + fname)
|
||||||
|
var src = f.read()
|
||||||
|
f.close()
|
||||||
|
# try to compile
|
||||||
|
var compiled = compile(src)
|
||||||
|
compiled() # run the compile code to instanciate the classes and modules
|
||||||
|
# output solidified
|
||||||
|
var fname_h = string2.split(fname, '.be')[0] + '.h' # take whatever is before the first '.be'
|
||||||
|
var fout = open(prefix_out + "solidified_" + fname_h, "w")
|
||||||
|
fout.write(f"/* Solidification of {fname_h} */\n")
|
||||||
|
fout.write("/********************************************************************\\\n")
|
||||||
|
fout.write("* Generated code, don't edit *\n")
|
||||||
|
fout.write("\\********************************************************************/\n")
|
||||||
|
fout.write('#include "be_constobj.h"\n')
|
||||||
|
|
||||||
|
var directives = re.searchall(pattern, src)
|
||||||
|
# print(directives)
|
||||||
|
|
||||||
|
for directive : directives
|
||||||
|
var object_list = string2.split(directive[1], ',')
|
||||||
|
var object_name = object_list[0]
|
||||||
|
var weak = (object_list.find('weak') != nil) # do we solidify with weak strings?
|
||||||
|
var o = global
|
||||||
|
var cl_name = nil
|
||||||
|
var obj_name = nil
|
||||||
|
for subname : string2.split(object_name, '.')
|
||||||
|
o = o.(subname)
|
||||||
|
cl_name = obj_name
|
||||||
|
obj_name = subname
|
||||||
|
end
|
||||||
|
solidify.dump(o, weak, fout, cl_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
fout.write("/********************************************************************/\n")
|
||||||
|
fout.write("/* End of solidification */\n")
|
||||||
|
fout.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
clean_directory(prefix_out)
|
||||||
|
|
||||||
|
var src_file_list = os.listdir(prefix_dir)
|
||||||
|
src_file_list = sort(src_file_list)
|
||||||
|
for src_file : src_file_list
|
||||||
|
if src_file[0] == '.' continue end
|
||||||
|
parse_file(src_file, prefix_out)
|
||||||
|
end
|
@ -1,2 +1,38 @@
|
|||||||
|
/********************************************************************
|
||||||
|
* Tasmota HASPmota solidified
|
||||||
|
*******************************************************************/
|
||||||
|
#include "be_constobj.h"
|
||||||
|
|
||||||
#include "solidify/be_lv_haspmota_solidified.h"
|
#ifdef USE_LVGL
|
||||||
|
#ifdef USE_LVGL_HASPMOTA
|
||||||
|
|
||||||
|
extern const bclass be_class_lv_page;
|
||||||
|
extern const bclass be_class_lv_obj;
|
||||||
|
extern const bclass be_class_lv_scr;
|
||||||
|
extern const bclass be_class_lv_btn;
|
||||||
|
extern const bclass be_class_lv_switch;
|
||||||
|
extern const bclass be_class_lv_checkbox;
|
||||||
|
extern const bclass be_class_lv_label;
|
||||||
|
extern const bclass be_class_lv_spinner;
|
||||||
|
extern const bclass be_class_lv_line;
|
||||||
|
extern const bclass be_class_lv_img;
|
||||||
|
extern const bclass be_class_lv_roller;
|
||||||
|
extern const bclass be_class_lv_btnmatrix;
|
||||||
|
extern const bclass be_class_lv_bar;
|
||||||
|
extern const bclass be_class_lv_slider;
|
||||||
|
extern const bclass be_class_lv_arc;
|
||||||
|
extern const bclass be_class_lv_led;
|
||||||
|
extern const bclass be_class_lv_dropdown;
|
||||||
|
extern const bclass be_class_lv_scale;
|
||||||
|
extern const bclass be_class_lv_qrcode;
|
||||||
|
extern const bclass be_class_lv_chart;
|
||||||
|
extern const bclass be_class_lv_spangroup;
|
||||||
|
extern const bclass be_class_lv_span;
|
||||||
|
extern const bclass be_class_lv_button;
|
||||||
|
extern const bclass be_class_lv_image;
|
||||||
|
extern const bclass be_class_lv_buttonmatrix;
|
||||||
|
|
||||||
|
#include "solidify/solidified_lv_haspmota.h"
|
||||||
|
|
||||||
|
#endif // USE_LVGL_HASPMOTA
|
||||||
|
#endif // USE_LVGL
|
||||||
|
23
lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_0_module.be
Normal file
23
lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_0_module.be
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# LVGL prepare for lv_haspmota solidification
|
||||||
|
# mock `lv` module
|
||||||
|
|
||||||
|
lv = module('lv')
|
||||||
|
|
||||||
|
import global
|
||||||
|
tasmota = nil
|
||||||
|
|
||||||
|
var classes = [
|
||||||
|
"page", "obj", "scr",
|
||||||
|
"btn", "switch", "checkbox",
|
||||||
|
"label", "spinner", "line", "img", "roller", "btnmatrix",
|
||||||
|
"bar", "slider", "arc", "textarea", "led", "dropdown",
|
||||||
|
"scale",
|
||||||
|
"qrcode", "chart", "spangroup", "span",
|
||||||
|
# new internal names
|
||||||
|
"button", "image", "buttonmatrix",
|
||||||
|
]
|
||||||
|
|
||||||
|
for cl: classes
|
||||||
|
var s = f"class lv_{cl} end lv.{cl} = lv_{cl}"
|
||||||
|
compile(s)()
|
||||||
|
end
|
@ -6,15 +6,7 @@
|
|||||||
#
|
#
|
||||||
# rm haspmota.tapp; zip -j -0 haspmota.tapp haspmota_core/*
|
# rm haspmota.tapp; zip -j -0 haspmota.tapp haspmota_core/*
|
||||||
#################################################################################
|
#################################################################################
|
||||||
# How to solidify (needs an ESP32 with PSRAM)
|
|
||||||
#-
|
|
||||||
|
|
||||||
import path
|
|
||||||
path.remove("haspmota.bec")
|
|
||||||
load('haspmota.be')
|
|
||||||
global.solidify_haspmota()
|
|
||||||
|
|
||||||
-#
|
|
||||||
var haspmota = module("haspmota")
|
var haspmota = module("haspmota")
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -23,6 +15,7 @@ var haspmota = module("haspmota")
|
|||||||
# Allows to map either a `lv_obj` for LVGL or arbitrary object
|
# Allows to map either a `lv_obj` for LVGL or arbitrary object
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#@ solidify:lvh_root,weak
|
||||||
class lvh_root
|
class lvh_root
|
||||||
static var _lv_class = nil # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses
|
static var _lv_class = nil # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses
|
||||||
|
|
||||||
@ -506,6 +499,7 @@ end
|
|||||||
# Adds specific virtual members used by HASPmota
|
# Adds specific virtual members used by HASPmota
|
||||||
#################################################################################
|
#################################################################################
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#@ solidify:lvh_obj,weak
|
||||||
class lvh_obj : lvh_root
|
class lvh_obj : lvh_root
|
||||||
static var _lv_class = lv.obj # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses
|
static var _lv_class = lv.obj # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses
|
||||||
static var _lv_part2_selector # selector for secondary part (like knob of arc)
|
static var _lv_part2_selector # selector for secondary part (like knob of arc)
|
||||||
@ -1050,6 +1044,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# label
|
# label
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_label,weak
|
||||||
class lvh_label : lvh_obj
|
class lvh_label : lvh_obj
|
||||||
static var _lv_class = lv.label
|
static var _lv_class = lv.label
|
||||||
# label do not need a sub-label
|
# label do not need a sub-label
|
||||||
@ -1062,6 +1057,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# arc
|
# arc
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_arc,weak
|
||||||
class lvh_arc : lvh_obj
|
class lvh_arc : lvh_obj
|
||||||
static var _lv_class = lv.arc
|
static var _lv_class = lv.arc
|
||||||
static var _lv_part2_selector = lv.PART_KNOB
|
static var _lv_part2_selector = lv.PART_KNOB
|
||||||
@ -1141,6 +1137,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# switch
|
# switch
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_switch,weak
|
||||||
class lvh_switch : lvh_obj
|
class lvh_switch : lvh_obj
|
||||||
static var _lv_class = lv.switch
|
static var _lv_class = lv.switch
|
||||||
static var _lv_part2_selector = lv.PART_KNOB
|
static var _lv_part2_selector = lv.PART_KNOB
|
||||||
@ -1157,6 +1154,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# spinner
|
# spinner
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_spinner,weak
|
||||||
class lvh_spinner : lvh_arc
|
class lvh_spinner : lvh_arc
|
||||||
static var _lv_class = lv.spinner
|
static var _lv_class = lv.spinner
|
||||||
var _speed, _angle
|
var _speed, _angle
|
||||||
@ -1183,6 +1181,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# img
|
# img
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_img,weak
|
||||||
class lvh_img : lvh_obj
|
class lvh_img : lvh_obj
|
||||||
static var _lv_class = lv.image
|
static var _lv_class = lv.image
|
||||||
var _raw # used to store raw image in RAM
|
var _raw # used to store raw image in RAM
|
||||||
@ -1234,6 +1233,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# qrcode
|
# qrcode
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_qrcode,weak
|
||||||
class lvh_qrcode : lvh_obj
|
class lvh_qrcode : lvh_obj
|
||||||
static var _lv_class = lv.qrcode
|
static var _lv_class = lv.qrcode
|
||||||
var qr_text # any change needs the text to be update again
|
var qr_text # any change needs the text to be update again
|
||||||
@ -1271,6 +1271,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# slider
|
# slider
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_slider,weak
|
||||||
class lvh_slider : lvh_obj
|
class lvh_slider : lvh_obj
|
||||||
static var _lv_class = lv.slider
|
static var _lv_class = lv.slider
|
||||||
|
|
||||||
@ -1295,6 +1296,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# roller
|
# roller
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_roller,weak
|
||||||
class lvh_roller : lvh_obj
|
class lvh_roller : lvh_obj
|
||||||
static var _lv_class = lv.roller
|
static var _lv_class = lv.roller
|
||||||
|
|
||||||
@ -1328,6 +1330,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# led
|
# led
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_led,weak
|
||||||
class lvh_led : lvh_obj
|
class lvh_led : lvh_obj
|
||||||
static var _lv_class = lv.led
|
static var _lv_class = lv.led
|
||||||
|
|
||||||
@ -1351,6 +1354,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# dropdown
|
# dropdown
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_dropdown,weak
|
||||||
class lvh_dropdown : lvh_obj
|
class lvh_dropdown : lvh_obj
|
||||||
static var _lv_class = lv.dropdown
|
static var _lv_class = lv.dropdown
|
||||||
static var _dir = [ lv.DIR_BOTTOM, lv.DIR_TOP, lv.DIR_LEFT, lv.DIR_RIGHT ] # 0 = down, 1 = up, 2 = left, 3 = right
|
static var _dir = [ lv.DIR_BOTTOM, lv.DIR_TOP, lv.DIR_LEFT, lv.DIR_RIGHT ] # 0 = down, 1 = up, 2 = left, 3 = right
|
||||||
@ -1419,6 +1423,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# bar
|
# bar
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_bar,weak
|
||||||
class lvh_bar : lvh_obj
|
class lvh_bar : lvh_obj
|
||||||
static var _lv_class = lv.bar
|
static var _lv_class = lv.bar
|
||||||
|
|
||||||
@ -1443,6 +1448,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# scale
|
# scale
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_scale,weak
|
||||||
class lvh_scale : lvh_obj
|
class lvh_scale : lvh_obj
|
||||||
static var _lv_class = lv.scale
|
static var _lv_class = lv.scale
|
||||||
var _options # need to keep the reference alive to avoid GC
|
var _options # need to keep the reference alive to avoid GC
|
||||||
@ -1478,6 +1484,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# spangroup
|
# spangroup
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_spangroup,weak
|
||||||
class lvh_spangroup : lvh_obj
|
class lvh_spangroup : lvh_obj
|
||||||
static var _lv_class = lv.spangroup
|
static var _lv_class = lv.spangroup
|
||||||
# label do not need a sub-label
|
# label do not need a sub-label
|
||||||
@ -1495,6 +1502,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# span
|
# span
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_span,weak
|
||||||
class lvh_span : lvh_root
|
class lvh_span : lvh_root
|
||||||
static var _lv_class = nil
|
static var _lv_class = nil
|
||||||
# label do not need a sub-label
|
# label do not need a sub-label
|
||||||
@ -1609,6 +1617,7 @@ end
|
|||||||
# Special case for lv.chart
|
# Special case for lv.chart
|
||||||
# Adapted to getting values one after the other
|
# Adapted to getting values one after the other
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#@ solidify:lvh_chart,weak
|
||||||
class lvh_chart : lvh_obj
|
class lvh_chart : lvh_obj
|
||||||
static var _lv_class = lv.chart
|
static var _lv_class = lv.chart
|
||||||
# ser1/ser2 contains the first/second series of data
|
# ser1/ser2 contains the first/second series of data
|
||||||
@ -1682,6 +1691,7 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# line
|
# line
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_line,weak
|
||||||
class lvh_line : lvh_obj
|
class lvh_line : lvh_obj
|
||||||
static var _lv_class = lv.line
|
static var _lv_class = lv.line
|
||||||
var _lv_points # needs to save to avoid garbage collection
|
var _lv_points # needs to save to avoid garbage collection
|
||||||
@ -1709,8 +1719,9 @@ end
|
|||||||
#====================================================================
|
#====================================================================
|
||||||
# btnmatrix
|
# btnmatrix
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
#@ solidify:lvh_btnmatrix,weak
|
||||||
class lvh_btnmatrix : lvh_obj
|
class lvh_btnmatrix : lvh_obj
|
||||||
static var _lv_class = lv.btnmatrix
|
static var _lv_class = lv.buttonmatrix
|
||||||
var _options # need to keep the reference alive to avoid GC
|
var _options # need to keep the reference alive to avoid GC
|
||||||
var _options_arr # need to keep the reference alive to avoid GC
|
var _options_arr # need to keep the reference alive to avoid GC
|
||||||
|
|
||||||
@ -1734,10 +1745,13 @@ end
|
|||||||
# and doesn't have any specific behavior
|
# and doesn't have any specific behavior
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
class lvh_btn : lvh_obj static var _lv_class = lv.btn end
|
#@ solidify:lvh_btn,weak
|
||||||
|
class lvh_btn : lvh_obj static var _lv_class = lv.button end
|
||||||
|
#@ solidify:lvh_checkbox,weak
|
||||||
class lvh_checkbox : lvh_obj static var _lv_class = lv.checkbox end
|
class lvh_checkbox : lvh_obj static var _lv_class = lv.checkbox end
|
||||||
# class lvh_textarea : lvh_obj static var _lv_class = lv.textarea end
|
# class lvh_textarea : lvh_obj static var _lv_class = lv.textarea end
|
||||||
# special case for scr (which is actually lv_obj)
|
# special case for scr (which is actually lv_obj)
|
||||||
|
#@ solidify:lvh_scr,weak
|
||||||
class lvh_scr : lvh_obj static var _lv_class = nil end # no class for screen
|
class lvh_scr : lvh_obj static var _lv_class = nil end # no class for screen
|
||||||
|
|
||||||
|
|
||||||
@ -1748,6 +1762,7 @@ class lvh_scr : lvh_obj static var _lv_class = nil end # n
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
#
|
#
|
||||||
# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false)
|
# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false)
|
||||||
|
#@ solidify:lvh_page,weak
|
||||||
class lvh_page
|
class lvh_page
|
||||||
var _obj_id # (map) of `lvh_obj` objects by id numbers
|
var _obj_id # (map) of `lvh_obj` objects by id numbers
|
||||||
var _page_id # (int) id number of this page
|
var _page_id # (int) id number of this page
|
||||||
@ -2401,56 +2416,6 @@ haspmota.init = def (m) # `init(m)` is called during first `import haspm
|
|||||||
return oh()
|
return oh()
|
||||||
end
|
end
|
||||||
|
|
||||||
#################################################################################
|
#@ solidify:haspmota,weak
|
||||||
# Solidify
|
|
||||||
#################################################################################
|
|
||||||
def solidify_haspmota()
|
|
||||||
import path
|
|
||||||
path.remove("haspmota.bec")
|
|
||||||
import solidify
|
|
||||||
import introspect
|
|
||||||
|
|
||||||
var classes = [
|
|
||||||
"root",
|
|
||||||
"page", "obj", "scr",
|
|
||||||
"btn", "switch", "checkbox",
|
|
||||||
"label", "spinner", "line", "img", "roller", "btnmatrix",
|
|
||||||
"bar", "slider", "arc", #- "textarea", -# "led", "dropdown",
|
|
||||||
"scale",
|
|
||||||
"qrcode", "chart", "spangroup", "span",
|
|
||||||
# new internal names
|
|
||||||
"button", "image", "buttonmatrix",
|
|
||||||
]
|
|
||||||
var f = open("be_lv_haspmota_solidified.h", "w")
|
|
||||||
f.write(
|
|
||||||
'/********************************************************************\n'
|
|
||||||
' * Tasmota HASPmota solidified\n'
|
|
||||||
' *******************************************************************/\n'
|
|
||||||
'#include "be_constobj.h"\n'
|
|
||||||
'\n'
|
|
||||||
'#ifdef USE_LVGL\n'
|
|
||||||
'#ifdef USE_LVGL_HASPMOTA\n'
|
|
||||||
'\n'
|
|
||||||
)
|
|
||||||
for c:classes
|
|
||||||
f.write(f'extern const bclass be_class_lv_{c};\n')
|
|
||||||
end
|
|
||||||
|
|
||||||
for c:classes
|
|
||||||
if introspect.contains(haspmota.HASPmota, "lvh_"+c)
|
|
||||||
solidify.dump(haspmota.HASPmota.("lvh_"+c), true, f)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
solidify.dump(haspmota, true, f)
|
|
||||||
|
|
||||||
f.write(
|
|
||||||
'\n'
|
|
||||||
'#endif // USE_LVGL_HASPMOTA\n'
|
|
||||||
'#endif // USE_LVGL\n'
|
|
||||||
)
|
|
||||||
f.close()
|
|
||||||
print("Ok")
|
|
||||||
end
|
|
||||||
|
|
||||||
global.haspmota = haspmota
|
global.haspmota = haspmota
|
||||||
return haspmota
|
return haspmota
|
@ -0,0 +1,7 @@
|
|||||||
|
/* Solidification of lv_0_module.h */
|
||||||
|
/********************************************************************\
|
||||||
|
* Generated code, don't edit *
|
||||||
|
\********************************************************************/
|
||||||
|
#include "be_constobj.h"
|
||||||
|
/********************************************************************/
|
||||||
|
/* End of solidification */
|
@ -0,0 +1,7 @@
|
|||||||
|
/* Solidification of lv_1_constants.h */
|
||||||
|
/********************************************************************\
|
||||||
|
* Generated code, don't edit *
|
||||||
|
\********************************************************************/
|
||||||
|
#include "be_constobj.h"
|
||||||
|
/********************************************************************/
|
||||||
|
/* End of solidification */
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user