mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
commit
13a8435f6c
@ -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.16.0"
|
local COORDINATOR_VERSION = "v0.16.1"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -60,7 +60,9 @@ local element = {}
|
|||||||
-- a base graphics element, should not be created on its own
|
-- a base graphics element, should not be created on its own
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@param args graphics_args arguments
|
---@param args graphics_args arguments
|
||||||
function element.new(args)
|
---@param child_offset_x? integer mouse event offset x
|
||||||
|
---@param child_offset_y? integer mouse event offset y
|
||||||
|
function element.new(args, child_offset_x, child_offset_y)
|
||||||
local self = {
|
local self = {
|
||||||
id = nil, ---@type element_id|nil
|
id = nil, ---@type element_id|nil
|
||||||
elem_type = debug.getinfo(2).name,
|
elem_type = debug.getinfo(2).name,
|
||||||
@ -101,8 +103,10 @@ function element.new(args)
|
|||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
-- prepare the template
|
-- prepare the template
|
||||||
|
---@param offset_x integer x offset for mouse events
|
||||||
|
---@param offset_y integer y offset for mouse events
|
||||||
---@param next_y integer next line if no y was provided
|
---@param next_y integer next line if no y was provided
|
||||||
function protected.prepare_template(next_y)
|
function protected.prepare_template(offset_x, offset_y, next_y)
|
||||||
-- get frame coordinates/size
|
-- get frame coordinates/size
|
||||||
if args.gframe ~= nil then
|
if args.gframe ~= nil then
|
||||||
protected.frame.x = args.gframe.x
|
protected.frame.x = args.gframe.x
|
||||||
@ -150,7 +154,11 @@ function element.new(args)
|
|||||||
-- record position
|
-- record position
|
||||||
self.position.x, self.position.y = protected.window.getPosition()
|
self.position.x, self.position.y = protected.window.getPosition()
|
||||||
|
|
||||||
-- calculate bounds
|
-- shift per parent child offset
|
||||||
|
self.position.x = self.position.x + offset_x
|
||||||
|
self.position.y = self.position.y + offset_y
|
||||||
|
|
||||||
|
-- calculate mouse event bounds
|
||||||
self.bounds.x1 = self.position.x
|
self.bounds.x1 = self.position.x
|
||||||
self.bounds.x2 = self.position.x + f.w - 1
|
self.bounds.x2 = self.position.x + f.w - 1
|
||||||
self.bounds.y1 = self.position.y
|
self.bounds.y1 = self.position.y
|
||||||
@ -283,7 +291,7 @@ function element.new(args)
|
|||||||
-- prepare the template
|
-- prepare the template
|
||||||
if args.parent == nil then
|
if args.parent == nil then
|
||||||
self.id = args.id or "__ROOT__"
|
self.id = args.id or "__ROOT__"
|
||||||
protected.prepare_template(1)
|
protected.prepare_template(0, 0, 1)
|
||||||
else
|
else
|
||||||
self.id = args.parent.__add_child(args.id, protected)
|
self.id = args.parent.__add_child(args.id, protected)
|
||||||
end
|
end
|
||||||
@ -337,7 +345,7 @@ function element.new(args)
|
|||||||
---@param child graphics_base
|
---@param child graphics_base
|
||||||
---@return integer|string key
|
---@return integer|string key
|
||||||
function public.__add_child(key, child)
|
function public.__add_child(key, child)
|
||||||
child.prepare_template(self.next_y)
|
child.prepare_template(child_offset_x or 0, child_offset_y or 0, self.next_y)
|
||||||
|
|
||||||
self.next_y = child.frame.y + child.frame.h
|
self.next_y = child.frame.y + child.frame.h
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ local function rectangle(args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- create new graphics element base object
|
-- create new graphics element base object
|
||||||
local e = element.new(args)
|
local e = element.new(args, offset_x, offset_y)
|
||||||
|
|
||||||
-- create content window for child elements
|
-- create content window for child elements
|
||||||
e.content_window = window.create(e.window, 1 + offset_x, 1 + offset_y, e.frame.w - (2 * offset_x), e.frame.h - (2 * offset_y))
|
e.content_window = window.create(e.window, 1 + offset_x, 1 + offset_y, e.frame.w - (2 * offset_x), e.frame.h - (2 * offset_y))
|
||||||
|
File diff suppressed because one or more lines are too long
@ -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.4.4"
|
local POCKET_VERSION = "alpha-v0.4.5"
|
||||||
|
|
||||||
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.4.5"
|
local R_PLC_VERSION = "v1.4.6"
|
||||||
|
|
||||||
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.3.5"
|
local RTU_VERSION = "v1.3.6"
|
||||||
|
|
||||||
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
|
||||||
|
@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor")
|
|||||||
|
|
||||||
local svsessions = require("supervisor.session.svsessions")
|
local svsessions = require("supervisor.session.svsessions")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "v0.17.5"
|
local SUPERVISOR_VERSION = "v0.17.6"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
Loading…
Reference in New Issue
Block a user