mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
commit
a14ffea6f0
@ -20,7 +20,7 @@ local sounder = require("coordinator.sounder")
|
|||||||
|
|
||||||
local apisessions = require("coordinator.session.apisessions")
|
local apisessions = require("coordinator.session.apisessions")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v0.15.1"
|
local COORDINATOR_VERSION = "v0.15.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -177,15 +177,24 @@ function element.new(args)
|
|||||||
self.bounds.y2 = self.position.y + f.h - 1
|
self.bounds.y2 = self.position.y + f.h - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check if a coordinate is within the bounds of this element
|
-- check if a coordinate relative to the parent is within the bounds of this element
|
||||||
---@param x integer
|
---@param x integer
|
||||||
---@param y integer
|
---@param y integer
|
||||||
function protected.in_bounds(x, y)
|
function protected.in_window_bounds(x, y)
|
||||||
local in_x = x >= self.bounds.x1 and x <= self.bounds.x2
|
local in_x = x >= self.bounds.x1 and x <= self.bounds.x2
|
||||||
local in_y = y >= self.bounds.y1 and y <= self.bounds.y2
|
local in_y = y >= self.bounds.y1 and y <= self.bounds.y2
|
||||||
return in_x and in_y
|
return in_x and in_y
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- check if a coordinate relative to this window is within the bounds of this element
|
||||||
|
---@param x integer
|
||||||
|
---@param y integer
|
||||||
|
function protected.in_frame_bounds(x, y)
|
||||||
|
local in_x = x >= 1 and x <= protected.frame.w
|
||||||
|
local in_y = y >= 1 and y <= protected.frame.h
|
||||||
|
return in_x and in_y
|
||||||
|
end
|
||||||
|
|
||||||
-- luacheck: push ignore
|
-- luacheck: push ignore
|
||||||
---@diagnostic disable: unused-local, unused-vararg
|
---@diagnostic disable: unused-local, unused-vararg
|
||||||
|
|
||||||
@ -503,7 +512,7 @@ function element.new(args)
|
|||||||
function public.handle_mouse(event)
|
function public.handle_mouse(event)
|
||||||
local x_ini, y_ini = event.initial.x, event.initial.y
|
local x_ini, y_ini = event.initial.x, event.initial.y
|
||||||
|
|
||||||
local ini_in = protected.in_bounds(x_ini, y_ini)
|
local ini_in = protected.in_window_bounds(x_ini, y_ini)
|
||||||
|
|
||||||
if ini_in then
|
if ini_in then
|
||||||
local event_T = core.events.mouse_transposed(event, self.position.x, self.position.y)
|
local event_T = core.events.mouse_transposed(event, self.position.x, self.position.y)
|
||||||
|
@ -84,7 +84,7 @@ local function push_button(args)
|
|||||||
show_pressed()
|
show_pressed()
|
||||||
elseif event.type == CLICK_TYPE.UP then
|
elseif event.type == CLICK_TYPE.UP then
|
||||||
show_unpressed()
|
show_unpressed()
|
||||||
if e.in_bounds(event.current.x, event.current.y) then
|
if e.in_frame_bounds(event.current.x, event.current.y) then
|
||||||
args.callback()
|
args.callback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -93,7 +93,7 @@ local function sidebar(args)
|
|||||||
elseif event.type == CLICK_TYPE.DOWN then
|
elseif event.type == CLICK_TYPE.DOWN then
|
||||||
draw(true, cur_idx)
|
draw(true, cur_idx)
|
||||||
elseif event.type == CLICK_TYPE.UP then
|
elseif event.type == CLICK_TYPE.UP then
|
||||||
if cur_idx == ini_idx and e.in_bounds(event.current.x, event.current.y) then
|
if cur_idx == ini_idx and e.in_frame_bounds(event.current.x, event.current.y) then
|
||||||
e.value = cur_idx
|
e.value = cur_idx
|
||||||
draw(false)
|
draw(false)
|
||||||
args.callback(e.value)
|
args.callback(e.value)
|
||||||
|
@ -17,7 +17,7 @@ local coreio = require("pocket.coreio")
|
|||||||
local pocket = require("pocket.pocket")
|
local pocket = require("pocket.pocket")
|
||||||
local renderer = require("pocket.renderer")
|
local renderer = require("pocket.renderer")
|
||||||
|
|
||||||
local POCKET_VERSION = "alpha-v0.3.1"
|
local POCKET_VERSION = "alpha-v0.3.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
|
|||||||
local renderer = require("reactor-plc.renderer")
|
local renderer = require("reactor-plc.renderer")
|
||||||
local threads = require("reactor-plc.threads")
|
local threads = require("reactor-plc.threads")
|
||||||
|
|
||||||
local R_PLC_VERSION = "v1.3.1"
|
local R_PLC_VERSION = "v1.3.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -28,7 +28,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
|
|||||||
local sps_rtu = require("rtu.dev.sps_rtu")
|
local sps_rtu = require("rtu.dev.sps_rtu")
|
||||||
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||||
|
|
||||||
local RTU_VERSION = "v1.2.1"
|
local RTU_VERSION = "v1.2.2"
|
||||||
|
|
||||||
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
||||||
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE
|
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user