Die gesamte Betriebszeit dreht sich UI (0 ° / 90 ° / 180 ° / 270 °), Handheld, vertikal montierte Schrank sind anwendbar. Ein Lua-Set für alle Haltungen, exklusiv in der DX-Serie.
1. Lua steuert die Rotation
set_lcd_rotate(angle) -- angle: 0~3 (0=0°,1=90°,2=180°,3=270°)
function on_init()
local angle = get_uint16(VT_RW, 0x0001) -- 从Flash读旋转方向
angle = (angle < 0 or angle > 3) and 0 or angle
set_lcd_rotate(angle)
set_uint16(VT_LW, 0x8888, angle)
end
function on_update(slave,vtype,addr)
if vtype == VT_LW and addr == 0x8888 then
local val = get_uint16(VT_LW, 0x8888)
set_uint16(VT_RW, 0x0001, val) -- 存旋转方向
set_lcd_rotate(val)
end
end
2. Multidirectional-Datei erzeugen
Das Bildschirm-Projekt (0 ° / 180 °) wird zweimal kompiliert: 0 ° behält den Standardwert image. bin / project. bin; 180 ° umbenannt in image180. bin / project180. bin in private. Vertikal Bildschirm-Projekt (90 ° / 270 °) erzeugt ähnlich image90 / image270 in private. Das private-Verzeichnis enthält schließlich 8 Kerndateien, die beim Start 0 ° laden und die entsprechenden Bin automatisch laden.


Aus dem VisualHMI-Entwicklungsdokument von Guangzhou Dacai Technology (hmi-doc.gz-dc.com) und anderen technischen Tutorials "Bildschirmdrehung", das Urheberrecht liegt bei Dacai Technology.
Antwort veröffentlichen