Compare commits

...

4 Commits

Author SHA1 Message Date
Mikayla
9f7e3bc282 Merge pull request #383 from MikaylaFischler/devel
2023.11.28 Beta Hotfix
2023-11-28 20:35:56 -05:00
Mikayla Fischler
4ec060ba24 #378 fixed unit input not being re-shown on RTU configurator 2023-11-28 18:05:07 -05:00
Mikayla
b1f1753a8d Merge pull request #379 from MikaylaFischler/377-compatibility-fixes-for-lua-5.2
#377 switched to using ... for vararg
2023-11-28 17:54:36 -05:00
Mikayla Fischler
94a62f8c31 #377 switched to using ... for vararg 2023-11-27 19:32:52 -05:00
4 changed files with 13 additions and 15 deletions

View File

@@ -2,9 +2,7 @@ return {
-- initialize booted environment -- initialize booted environment
init_env = function () init_env = function ()
local _require, _env = require("cc.require"), setmetatable({}, { __index = _ENV }) local _require, _env = require("cc.require"), setmetatable({}, { __index = _ENV })
-- overwrite require/package globals
require, package = _require.make(_env, "/") require, package = _require.make(_env, "/")
-- reset terminal
term.clear(); term.setCursorPos(1, 1) term.clear(); term.setCursorPos(1, 1)
end end
} }

View File

@@ -698,6 +698,7 @@ local function config_view(display)
tool_ctl.p_idx.set_max(2) tool_ctl.p_idx.set_max(2)
tool_ctl.p_unit.reposition(44, 4) tool_ctl.p_unit.reposition(44, 4)
tool_ctl.p_unit.enable() tool_ctl.p_unit.enable()
tool_ctl.p_unit.show()
tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_btn.hide(true)
tool_ctl.p_assign_end.hide(true) tool_ctl.p_assign_end.hide(true)
tool_ctl.p_desc.reposition(1, 7) 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_idx.set_max(3)
tool_ctl.p_unit.reposition(45, 4) tool_ctl.p_unit.reposition(45, 4)
tool_ctl.p_unit.enable() tool_ctl.p_unit.enable()
tool_ctl.p_unit.show()
tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_btn.hide(true)
tool_ctl.p_assign_end.hide(true) tool_ctl.p_assign_end.hide(true)
tool_ctl.p_desc.reposition(1, 7) 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_prompt.set_value("This SNA is for reactor unit # .")
tool_ctl.p_unit.reposition(31, 4) tool_ctl.p_unit.reposition(31, 4)
tool_ctl.p_unit.enable() tool_ctl.p_unit.enable()
tool_ctl.p_unit.show()
tool_ctl.p_assign_btn.hide(true) tool_ctl.p_assign_btn.hide(true)
tool_ctl.p_assign_end.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.") 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.redraw()
tool_ctl.p_idx.set_max(4) tool_ctl.p_idx.set_max(4)
tool_ctl.p_unit.reposition(18, 6) 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 if tool_ctl.p_assign_btn.get_value() == 1 then
tool_ctl.p_idx.enable() tool_ctl.p_idx.enable()
@@ -754,6 +759,8 @@ local function config_view(display)
tool_ctl.p_idx.redraw() tool_ctl.p_idx.redraw()
tool_ctl.p_idx.set_max(99) tool_ctl.p_idx.set_max(99)
tool_ctl.p_unit.reposition(18, 6) 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 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.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.") 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.")

View File

@@ -31,7 +31,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.7.3" local RTU_VERSION = "v1.7.4"
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

View File

@@ -16,13 +16,13 @@ local type = type
local t_concat = table.concat local t_concat = table.concat
local t_insert = table.insert local t_insert = table.insert
local t_unpack = table.unpack local t_pack = table.pack
---@class util ---@class util
local util = {} local util = {}
-- scada-common version -- scada-common version
util.version = "1.1.9" util.version = "1.1.10"
util.TICK_TIME_S = 0.05 util.TICK_TIME_S = 0.05
util.TICK_TIME_MS = 50 util.TICK_TIME_MS = 50
@@ -104,17 +104,13 @@ end
---@return table lines ---@return table lines
function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end
-- luacheck: no unused args
-- concatenation with built-in to string -- concatenation with built-in to string
---@nodiscard ---@nodiscard
---@vararg any ---@vararg any
---@return string ---@return string
---@diagnostic disable-next-line: unused-vararg
function util.concat(...) function util.concat(...)
local strings = {} local args, strings = t_pack(...), {}
---@diagnostic disable-next-line: undefined-field for i = 1, args.n do strings[i] = util.strval(args[i]) end
for i = 1, arg.n do strings[i] = util.strval(arg[i]) end
return t_concat(strings) return t_concat(strings)
end end
@@ -125,10 +121,7 @@ util.c = util.concat
---@nodiscard ---@nodiscard
---@param format string ---@param format string
---@vararg any ---@vararg any
---@diagnostic disable-next-line: unused-vararg function util.sprintf(format, ...) return string.format(format, ...) end
function util.sprintf(format, ...) return string.format(format, t_unpack(arg)) end
-- luacheck: unused args
-- format a number string with commas as the thousands separator<br> -- format a number string with commas as the thousands separator<br>
-- subtracts from spaces at the start if present for each comma used -- subtracts from spaces at the start if present for each comma used