From bbe7b526624e10119dee98aeee798b578716605f Mon Sep 17 00:00:00 2001 From: Mikayla Date: Mon, 11 Mar 2024 16:35:06 +0000 Subject: [PATCH] bugfixes and cleanup --- coordinator/configure.lua | 10 +++++----- coordinator/coordinator.lua | 1 + pocket/configure.lua | 2 +- reactor-plc/configure.lua | 11 ++++++----- rtu/configure.lua | 10 +++++----- supervisor/configure.lua | 10 +++++----- supervisor/panel/components/pdg_entry.lua | 4 ++-- supervisor/panel/components/rtu_entry.lua | 4 ++-- supervisor/panel/style.lua | 2 +- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/coordinator/configure.lua b/coordinator/configure.lua index 6e16757..b2576c5 100644 --- a/coordinator/configure.lua +++ b/coordinator/configure.lua @@ -174,7 +174,7 @@ local fields = { { "AuthKey", "Facility Auth Key" , ""}, { "LogMode", "Log Mode", log.MODE.APPEND }, { "LogPath", "Log Path", "/log.txt" }, - { "LogDebug","Log Debug Messages", false }, + { "LogDebug", "Log Debug Messages", false }, { "MainTheme", "Main UI Theme", themes.UI_THEME.SMOOTH_STONE }, { "FrontPanelTheme", "Front Panel Theme", themes.FP_THEME.SANDSTONE }, { "ColorMode", "Color Mode", themes.COLOR_MODE.STANDARD } @@ -366,8 +366,8 @@ local function config_view(display) local function jump_color() tool_ctl.jumped_to_color = true - tool_ctl.color_next.hide() - tool_ctl.color_apply.show(true) + tool_ctl.color_next.hide(true) + tool_ctl.color_apply.show() main_pane.set_value(8) end @@ -830,7 +830,7 @@ local function config_view(display) TextBox{parent=clr_cfg,x=1,y=2,height=1,text=" Color Configuration",fg_bg=cpair(colors.black,colors.magenta)} TextBox{parent=clr_c_1,x=1,y=1,height=2,text="Here you can select the color themes for the different UI displays."} - TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access color blind assistive options.",fg_bg=g_lg_fg_bg} + TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access colorblind assistive options.",fg_bg=g_lg_fg_bg} TextBox{parent=clr_c_1,x=1,y=7,height=1,text="Main UI Theme"} local main_theme = RadioButton{parent=clr_c_1,x=1,y=8,default=ini_cfg.MainTheme,options=themes.UI_THEME_NAMES,callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.magenta} @@ -910,7 +910,7 @@ local function config_view(display) tool_ctl.color_next = PushButton{parent=clr_c_1,x=44,y=14,text="Next \x1a",callback=submit_colors,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} tool_ctl.color_apply = PushButton{parent=clr_c_1,x=43,y=14,min_width=7,text="Apply",callback=submit_colors,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_apply.hide() + tool_ctl.color_apply.hide(true) local function c_go_home() main_pane.set_value(1) diff --git a/coordinator/coordinator.lua b/coordinator/coordinator.lua index 61b854b..85387b4 100644 --- a/coordinator/coordinator.lua +++ b/coordinator/coordinator.lua @@ -93,6 +93,7 @@ function coordinator.load_config() cfv.assert_type_int(config.LogMode) cfv.assert_range(config.LogMode, 0, 1) cfv.assert_type_str(config.LogPath) + cfv.assert_type_bool(config.LogDebug) cfv.assert_type_int(config.MainTheme) cfv.assert_range(config.MainTheme, 1, 2) diff --git a/pocket/configure.lua b/pocket/configure.lua index 6c0f728..908ea4c 100644 --- a/pocket/configure.lua +++ b/pocket/configure.lua @@ -112,7 +112,7 @@ local fields = { { "AuthKey", "Facility Auth Key" , ""}, { "LogMode", "Log Mode", log.MODE.APPEND }, { "LogPath", "Log Path", "/log.txt" }, - { "LogDebug","Log Debug Messages", false } + { "LogDebug", "Log Debug Messages", false } } -- load data from the settings file diff --git a/reactor-plc/configure.lua b/reactor-plc/configure.lua index 80ef86c..5676a91 100644 --- a/reactor-plc/configure.lua +++ b/reactor-plc/configure.lua @@ -134,7 +134,7 @@ local fields = { { "AuthKey", "Facility Auth Key" , ""}, { "LogMode", "Log Mode", log.MODE.APPEND }, { "LogPath", "Log Path", "/log.txt" }, - { "LogDebug","Log Debug Messages", false }, + { "LogDebug", "Log Debug Messages", false }, { "FrontPanelTheme", "Front Panel Theme", 1 }, { "ColorMode", "Color Mode", 1 } } @@ -222,8 +222,8 @@ local function config_view(display) local function jump_color() tool_ctl.jumped_to_color = true - tool_ctl.color_next.hide() - tool_ctl.color_apply.show(true) + tool_ctl.color_next.hide(true) + tool_ctl.color_apply.show() main_pane.set_value(5) end @@ -470,7 +470,7 @@ local function config_view(display) TextBox{parent=clr_cfg,x=1,y=2,height=1,text=" Color Configuration",fg_bg=cpair(colors.black,colors.magenta)} TextBox{parent=clr_c_1,x=1,y=1,height=2,text="Here you can select the color theme for the front panel."} - TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access color blind assistive options.",fg_bg=g_lg_fg_bg} + TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access colorblind assistive options.",fg_bg=g_lg_fg_bg} TextBox{parent=clr_c_1,x=1,y=7,height=1,text="Front Panel Theme"} local fp_theme = RadioButton{parent=clr_c_1,x=1,y=8,default=ini_cfg.FrontPanelTheme,options={"Sandstone","Basalt"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.magenta} @@ -545,7 +545,7 @@ local function config_view(display) tool_ctl.color_next = PushButton{parent=clr_c_1,x=44,y=14,text="Next \x1a",callback=submit_colors,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} tool_ctl.color_apply = PushButton{parent=clr_c_1,x=43,y=14,min_width=7,text="Apply",callback=submit_colors,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_apply.hide() + tool_ctl.color_apply.hide(true) local function c_go_home() main_pane.set_value(1) @@ -639,6 +639,7 @@ local function config_view(display) main_pane.set_value(1) plc_pane.set_value(1) net_pane.set_value(1) + clr_pane.set_value(1) sum_pane.set_value(1) end diff --git a/rtu/configure.lua b/rtu/configure.lua index cfda26d..acc419f 100644 --- a/rtu/configure.lua +++ b/rtu/configure.lua @@ -208,7 +208,7 @@ local fields = { { "AuthKey", "Facility Auth Key", "" }, { "LogMode", "Log Mode", log.MODE.APPEND }, { "LogPath", "Log Path", "/log.txt" }, - { "LogDebug","Log Debug Messages", false }, + { "LogDebug", "Log Debug Messages", false }, { "FrontPanelTheme", "Front Panel Theme", 1 }, { "ColorMode", "Color Mode", 1 } } @@ -328,8 +328,8 @@ local function config_view(display) local function jump_color() tool_ctl.jumped_to_color = true - tool_ctl.color_next.hide() - tool_ctl.color_apply.show(true) + tool_ctl.color_next.hide(true) + tool_ctl.color_apply.show() main_pane.set_value(5) end @@ -525,7 +525,7 @@ local function config_view(display) TextBox{parent=clr_cfg,x=1,y=2,height=1,text=" Color Configuration",fg_bg=cpair(colors.black,colors.magenta)} TextBox{parent=clr_c_1,x=1,y=1,height=2,text="Here you can select the color theme for the front panel."} - TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access color blind assistive options.",fg_bg=g_lg_fg_bg} + TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access colorblind assistive options.",fg_bg=g_lg_fg_bg} TextBox{parent=clr_c_1,x=1,y=7,height=1,text="Front Panel Theme"} local fp_theme = RadioButton{parent=clr_c_1,x=1,y=8,default=ini_cfg.FrontPanelTheme,options={"Sandstone","Basalt"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.magenta} @@ -601,7 +601,7 @@ local function config_view(display) tool_ctl.color_next = PushButton{parent=clr_c_1,x=44,y=14,text="Next \x1a",callback=submit_colors,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} tool_ctl.color_apply = PushButton{parent=clr_c_1,x=43,y=14,min_width=7,text="Apply",callback=submit_colors,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_apply.hide() + tool_ctl.color_apply.hide(true) TextBox{parent=clr_c_3,x=1,y=1,height=1,text="Settings saved!"} PushButton{parent=clr_c_3,x=1,y=14,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=cpair(colors.white,colors.gray)} diff --git a/supervisor/configure.lua b/supervisor/configure.lua index 0b63519..2f7bcd6 100644 --- a/supervisor/configure.lua +++ b/supervisor/configure.lua @@ -145,7 +145,7 @@ local fields = { { "AuthKey", "Facility Auth Key" , ""}, { "LogMode", "Log Mode", log.MODE.APPEND }, { "LogPath", "Log Path", "/log.txt" }, - { "LogDebug","Log Debug Messages", false }, + { "LogDebug", "Log Debug Messages", false }, { "FrontPanelTheme", "Front Panel Theme", 1 }, { "ColorMode", "Color Mode", 1 } } @@ -212,8 +212,8 @@ local function config_view(display) local function jump_color() tool_ctl.jumped_to_color = true - tool_ctl.color_next.hide() - tool_ctl.color_apply.show(true) + tool_ctl.color_next.hide(true) + tool_ctl.color_apply.show() main_pane.set_value(5) end @@ -769,7 +769,7 @@ local function config_view(display) TextBox{parent=clr_cfg,x=1,y=2,height=1,text=" Color Configuration",fg_bg=cpair(colors.black,colors.magenta)} TextBox{parent=clr_c_1,x=1,y=1,height=2,text="Here you can select the color theme for the front panel."} - TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access color blind assistive options.",fg_bg=g_lg_fg_bg} + TextBox{parent=clr_c_1,x=1,y=4,height=2,text="Click 'Accessibility' below to access colorblind assistive options.",fg_bg=g_lg_fg_bg} TextBox{parent=clr_c_1,x=1,y=7,height=1,text="Front Panel Theme"} local fp_theme = RadioButton{parent=clr_c_1,x=1,y=8,default=ini_cfg.FrontPanelTheme,options={"Sandstone","Basalt"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.magenta} @@ -844,7 +844,7 @@ local function config_view(display) tool_ctl.color_next = PushButton{parent=clr_c_1,x=44,y=14,text="Next \x1a",callback=submit_colors,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} tool_ctl.color_apply = PushButton{parent=clr_c_1,x=43,y=14,min_width=7,text="Apply",callback=submit_colors,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_apply.hide() + tool_ctl.color_apply.hide(true) local function c_go_home() main_pane.set_value(1) diff --git a/supervisor/panel/components/pdg_entry.lua b/supervisor/panel/components/pdg_entry.lua index 740bb37..5bee335 100644 --- a/supervisor/panel/components/pdg_entry.lua +++ b/supervisor/panel/components/pdg_entry.lua @@ -17,14 +17,14 @@ local ALIGN = core.ALIGN local cpair = core.cpair -local label_fg = style.fp.label_fg - -- create a pocket diagnostics list entry ---@param parent graphics_element parent ---@param id integer PDG session ID local function init(parent, id) local s_hi_box = style.theme.highlight_box + local label_fg = style.fp.label_fg + -- root div local root = Div{parent=parent,x=2,y=2,height=4,width=parent.get_width()-2,hidden=true} local entry = Div{parent=root,x=2,y=1,height=3,fg_bg=style.theme.highlight_box_bright} diff --git a/supervisor/panel/components/rtu_entry.lua b/supervisor/panel/components/rtu_entry.lua index e09a048..03c4c62 100644 --- a/supervisor/panel/components/rtu_entry.lua +++ b/supervisor/panel/components/rtu_entry.lua @@ -17,14 +17,14 @@ local ALIGN = core.ALIGN local cpair = core.cpair -local label_fg = style.fp.label_fg - -- create an RTU list entry ---@param parent graphics_element parent ---@param id integer RTU session ID local function init(parent, id) local s_hi_box = style.theme.highlight_box + local label_fg = style.fp.label_fg + -- root div local root = Div{parent=parent,x=2,y=2,height=4,width=parent.get_width()-2,hidden=true} local entry = Div{parent=root,x=2,y=1,height=3,fg_bg=style.theme.highlight_box_bright} diff --git a/supervisor/panel/style.lua b/supervisor/panel/style.lua index e3f1138..efcc9b7 100644 --- a/supervisor/panel/style.lua +++ b/supervisor/panel/style.lua @@ -10,7 +10,7 @@ local style = {} local cpair = core.cpair -style.theme = themes.basalt +style.theme = themes.sandstone style.fp = themes.get_fp_style(style.theme) style.ind_grn = cpair(colors.green, colors.green_off)