From 2a85a438ba18dcbcecd9b37ccbe6f5b3cb6d7e6a Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Fri, 29 Dec 2023 14:33:22 -0500 Subject: [PATCH] #396 connection timeouts can now have a fractional part --- reactor-plc/configure.lua | 19 ++++++++++--------- reactor-plc/startup.lua | 2 +- rtu/configure.lua | 16 +++++++++------- rtu/startup.lua | 2 +- supervisor/configure.lua | 8 ++++---- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/reactor-plc/configure.lua b/reactor-plc/configure.lua index 7b5ab4c..4e423be 100644 --- a/reactor-plc/configure.lua +++ b/reactor-plc/configure.lua @@ -34,7 +34,8 @@ local RIGHT = core.ALIGN.RIGHT -- changes to the config data/format to let the user know local changes = { - {"v1.6.2", { "AuthKey minimum length is now 8 (if set)" } } + {"v1.6.2", { "AuthKey minimum length is now 8 (if set)" } }, + {"v1.6.8", { "ConnTimeout can now have a fractional part" } } } ---@class plc_configurator @@ -92,13 +93,13 @@ local tmp_cfg = { Networked = false, UnitID = 0, EmerCoolEnable = false, - EmerCoolSide = nil, - EmerCoolColor = nil, - SVR_Channel = nil, - PLC_Channel = nil, - ConnTimeout = nil, - TrustedRange = nil, - AuthKey = nil, + EmerCoolSide = nil, ---@type string|nil + EmerCoolColor = nil, ---@type color|nil + SVR_Channel = nil, ---@type integer + PLC_Channel = nil, ---@type integer + ConnTimeout = nil, ---@type number + TrustedRange = nil, ---@type number + AuthKey = nil, ---@type string|nil LogMode = 0, LogPath = "", LogDebug = false, @@ -332,7 +333,7 @@ local function config_view(display) PushButton{parent=net_c_1,x=44,y=14,text="Next \x1a",callback=submit_channels,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} TextBox{parent=net_c_2,x=1,y=1,height=1,text="Connection Timeout"} - local timeout = NumberField{parent=net_c_2,x=1,y=2,width=7,default=ini_cfg.ConnTimeout,min=2,max=25,fg_bg=bw_fg_bg} + local timeout = NumberField{parent=net_c_2,x=1,y=2,width=7,default=ini_cfg.ConnTimeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=9,y=2,height=2,text="seconds (default 5)",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_2,x=1,y=3,height=4,text="You generally do not want or need to modify this. On slow servers, you can increase this to make the system wait longer before assuming a disconnection.",fg_bg=g_lg_fg_bg} diff --git a/reactor-plc/startup.lua b/reactor-plc/startup.lua index c33a780..803fe99 100644 --- a/reactor-plc/startup.lua +++ b/reactor-plc/startup.lua @@ -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.6.7" +local R_PLC_VERSION = "v1.6.8" local println = util.println local println_ts = util.println_ts diff --git a/rtu/configure.lua b/rtu/configure.lua index 9bdb5ee..bee0ed6 100644 --- a/rtu/configure.lua +++ b/rtu/configure.lua @@ -72,7 +72,9 @@ assert(#PORT_DESC == rsio.NUM_PORTS) assert(#PORT_DSGN == rsio.NUM_PORTS) -- changes to the config data/format to let the user know -local changes = {} +local changes = { + {"v1.7.9", { "ConnTimeout can now have a fractional part" } } +} ---@class rtu_rs_definition ---@field unit integer|nil @@ -172,11 +174,11 @@ local tmp_cfg = { SpeakerVolume = 1.0, Peripherals = {}, Redstone = {}, - SVR_Channel = nil, - RTU_Channel = nil, - ConnTimeout = nil, - TrustedRange = nil, - AuthKey = nil, + SVR_Channel = nil, ---@type integer + RTU_Channel = nil, ---@type integer + ConnTimeout = nil, ---@type number + TrustedRange = nil, ---@type number + AuthKey = nil, ---@type string|nil LogMode = 0, LogPath = "", LogDebug = false @@ -394,7 +396,7 @@ local function config_view(display) PushButton{parent=net_c_1,x=44,y=14,text="Next \x1a",callback=submit_channels,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} TextBox{parent=net_c_2,x=1,y=1,height=1,text="Connection Timeout"} - local timeout = NumberField{parent=net_c_2,x=1,y=2,width=7,default=ini_cfg.ConnTimeout,min=2,max=25,fg_bg=bw_fg_bg} + local timeout = NumberField{parent=net_c_2,x=1,y=2,width=7,default=ini_cfg.ConnTimeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=9,y=2,height=2,text="seconds (default 5)",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_2,x=1,y=3,height=4,text="You generally do not want or need to modify this. On slow servers, you can increase this to make the system wait longer before assuming a disconnection.",fg_bg=g_lg_fg_bg} diff --git a/rtu/startup.lua b/rtu/startup.lua index 63a9165..1b25859 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.8" +local RTU_VERSION = "v1.7.9" local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE diff --git a/supervisor/configure.lua b/supervisor/configure.lua index c7fe5f2..f3c0c5d 100644 --- a/supervisor/configure.lua +++ b/supervisor/configure.lua @@ -624,16 +624,16 @@ local function config_view(display) TextBox{parent=net_c_2,x=1,y=3,height=4,text="You generally should not need to modify these. On slow servers, you can try to increase this to make the system wait longer before assuming a disconnection. The default for all is 5 seconds.",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_2,x=1,y=8,height=1,width=11,text="PLC Timeout"} - local plc_timeout = NumberField{parent=net_c_2,x=21,y=8,width=7,default=ini_cfg.PLC_Timeout,min=2,max=25,fg_bg=bw_fg_bg} + local plc_timeout = NumberField{parent=net_c_2,x=21,y=8,width=7,default=ini_cfg.PLC_Timeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=1,y=9,height=1,width=19,text="RTU Gateway Timeout"} - local rtu_timeout = NumberField{parent=net_c_2,x=21,y=9,width=7,default=ini_cfg.RTU_Timeout,min=2,max=25,fg_bg=bw_fg_bg} + local rtu_timeout = NumberField{parent=net_c_2,x=21,y=9,width=7,default=ini_cfg.RTU_Timeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=1,y=10,height=1,width=19,text="Coordinator Timeout"} - local crd_timeout = NumberField{parent=net_c_2,x=21,y=10,width=7,default=ini_cfg.CRD_Timeout,min=2,max=25,fg_bg=bw_fg_bg} + local crd_timeout = NumberField{parent=net_c_2,x=21,y=10,width=7,default=ini_cfg.CRD_Timeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=1,y=11,height=1,width=14,text="Pocket Timeout"} - local pkt_timeout = NumberField{parent=net_c_2,x=21,y=11,width=7,default=ini_cfg.PKT_Timeout,min=2,max=25,fg_bg=bw_fg_bg} + local pkt_timeout = NumberField{parent=net_c_2,x=21,y=11,width=7,default=ini_cfg.PKT_Timeout,min=2,max=25,max_digits=6,allow_decimal=true,fg_bg=bw_fg_bg} TextBox{parent=net_c_2,x=29,y=8,height=4,width=7,text="seconds\nseconds\nseconds\nseconds",fg_bg=g_lg_fg_bg}