#226 updated PLC/RTU front panels to use new mouse events

This commit is contained in:
Mikayla 2023-05-10 19:21:54 +00:00
parent 2c2f936232
commit 3a0d677c16
6 changed files with 12 additions and 12 deletions

View File

@ -70,9 +70,9 @@ end
function renderer.ui_ready() return ui.display ~= nil end
-- handle a mouse event
---@param event mouse_interaction
---@param event mouse_interaction|nil
function renderer.handle_mouse(event)
if ui.display ~= nil then
if ui.display ~= nil and event ~= nil then
ui.display.handle_mouse(event)
end
end

View File

@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.1.17"
local R_PLC_VERSION = "v1.2.0"
local println = util.println
local println_ts = util.println_ts

View File

@ -257,9 +257,9 @@ function threads.thread__main(smem, init)
-- update indicators
databus.tx_hw_status(plc_state)
elseif event == "mouse_click" then
-- handle a monitor touch event
renderer.handle_mouse(core.events.click(param1, param2, param3))
elseif event == "mouse_click" or event == "mouse_up" or event == "mouse_drag" or event == "mouse_scroll" then
-- handle a mouse event
renderer.handle_mouse(core.events.new_mouse_event(event, param1, param2, param3))
elseif event == "clock_start" then
-- start loop clock
loop_clock.start()

View File

@ -71,9 +71,9 @@ end
function renderer.ui_ready() return ui.display ~= nil end
-- handle a mouse event
---@param event mouse_interaction
---@param event mouse_interaction|nil
function renderer.handle_mouse(event)
if ui.display ~= nil then
if ui.display ~= nil and event ~= nil then
ui.display.handle_mouse(event)
end
end

View File

@ -28,7 +28,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v1.0.5"
local RTU_VERSION = "v1.1.0"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE

View File

@ -229,9 +229,9 @@ function threads.thread__main(smem)
end
end
end
elseif event == "mouse_click" then
-- handle a monitor touch event
renderer.handle_mouse(core.events.click(param1, param2, param3))
elseif event == "mouse_click" or event == "mouse_up" or event == "mouse_drag" or event == "mouse_scroll" then
-- handle a mouse event
renderer.handle_mouse(core.events.new_mouse_event(event, param1, param2, param3))
end
-- check for termination request