diff --git a/initenv.lua b/initenv.lua index 05ad4f6..035d84e 100644 --- a/initenv.lua +++ b/initenv.lua @@ -2,9 +2,7 @@ return { -- initialize booted environment init_env = function () local _require, _env = require("cc.require"), setmetatable({}, { __index = _ENV }) - -- overwrite require/package globals require, package = _require.make(_env, "/") - -- reset terminal term.clear(); term.setCursorPos(1, 1) end } diff --git a/rtu/configure.lua b/rtu/configure.lua index 296c91c..3c8a621 100644 --- a/rtu/configure.lua +++ b/rtu/configure.lua @@ -698,6 +698,7 @@ local function config_view(display) tool_ctl.p_idx.set_max(2) tool_ctl.p_unit.reposition(44, 4) tool_ctl.p_unit.enable() + tool_ctl.p_unit.show() tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_end.hide(true) tool_ctl.p_desc.reposition(1, 7) @@ -710,6 +711,7 @@ local function config_view(display) tool_ctl.p_idx.set_max(3) tool_ctl.p_unit.reposition(45, 4) tool_ctl.p_unit.enable() + tool_ctl.p_unit.show() tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_end.hide(true) tool_ctl.p_desc.reposition(1, 7) @@ -719,6 +721,7 @@ local function config_view(display) tool_ctl.p_prompt.set_value("This SNA is for reactor unit # .") tool_ctl.p_unit.reposition(31, 4) tool_ctl.p_unit.enable() + tool_ctl.p_unit.show() tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_end.hide(true) tool_ctl.p_desc_ext.set_value("Before adding lots of SNAs: multiply the \"PEAK\" rate on the flow monitor (after connecting at least 1 SNA) by 10 to get the mB/t of waste that they can process. Enough SNAs to provide 2x to 3x of your max burn rate should be a good margin to catch up after night or cloudy weather. Too many devices (such as SNAs) on one RTU can cause lag.") @@ -732,6 +735,8 @@ local function config_view(display) tool_ctl.p_idx.redraw() tool_ctl.p_idx.set_max(4) tool_ctl.p_unit.reposition(18, 6) + tool_ctl.p_unit.enable() + tool_ctl.p_unit.show() if tool_ctl.p_assign_btn.get_value() == 1 then tool_ctl.p_idx.enable() @@ -754,6 +759,8 @@ local function config_view(display) tool_ctl.p_idx.redraw() tool_ctl.p_idx.set_max(99) tool_ctl.p_unit.reposition(18, 6) + tool_ctl.p_unit.enable() + tool_ctl.p_unit.show() if tool_ctl.p_assign_btn.get_value() == 1 then tool_ctl.p_unit.disable() else tool_ctl.p_unit.enable() end tool_ctl.p_desc.reposition(1, 8) tool_ctl.p_desc.set_value("You can connect more than one environment detector for a particular unit or the facility. In that case, the maximum radiation reading from those assigned to that particular unit or the facility will be used for alarms and display.") diff --git a/rtu/startup.lua b/rtu/startup.lua index 759363a..10c2169 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -31,7 +31,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.7.3" +local RTU_VERSION = "v1.7.4" local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE diff --git a/scada-common/util.lua b/scada-common/util.lua index 8257a2d..d386bd3 100644 --- a/scada-common/util.lua +++ b/scada-common/util.lua @@ -16,13 +16,13 @@ local type = type local t_concat = table.concat local t_insert = table.insert -local t_unpack = table.unpack +local t_pack = table.pack ---@class util local util = {} -- scada-common version -util.version = "1.1.9" +util.version = "1.1.10" util.TICK_TIME_S = 0.05 util.TICK_TIME_MS = 50 @@ -104,17 +104,13 @@ end ---@return table lines function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end --- luacheck: no unused args - -- concatenation with built-in to string ---@nodiscard ---@vararg any ---@return string ----@diagnostic disable-next-line: unused-vararg function util.concat(...) - local strings = {} ----@diagnostic disable-next-line: undefined-field - for i = 1, arg.n do strings[i] = util.strval(arg[i]) end + local args, strings = t_pack(...), {} + for i = 1, args.n do strings[i] = util.strval(args[i]) end return t_concat(strings) end @@ -125,10 +121,7 @@ util.c = util.concat ---@nodiscard ---@param format string ---@vararg any ----@diagnostic disable-next-line: unused-vararg -function util.sprintf(format, ...) return string.format(format, t_unpack(arg)) end - --- luacheck: unused args +function util.sprintf(format, ...) return string.format(format, ...) end -- format a number string with commas as the thousands separator
-- subtracts from spaces at the start if present for each comma used