Skip to content

Commit

Permalink
#535 added startup button to configurators
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaylaFischler committed Nov 9, 2024
1 parent 764638c commit 8439e02
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 21 deletions.
15 changes: 12 additions & 3 deletions coordinator/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray,colors.white)
local tool_ctl = {
sv_cool_conf = nil, ---@type [ integer, integer ][] list of boiler & turbine counts

launch_startup = false,
start_fail = 0,
fail_message = "",
has_config = false,
Expand Down Expand Up @@ -236,9 +237,17 @@ local function config_view(display)
main_pane.set_value(8)
end

local function startup()
tool_ctl.launch_startup = true
exit()
end

PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=cpair(colors.lightGray,colors.white)}
PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(10)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=cpair(colors.lightGray,colors.white)}
PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(10)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

if tool_ctl.start_fail ~= 0 then start_btn.disable() end

if not tool_ctl.has_config then
tool_ctl.view_cfg.disable()
Expand Down Expand Up @@ -372,7 +381,7 @@ function configurator.configure(start_code, message)
println("configurator error: " .. error)
end

return status, error
return status, error, tool_ctl.launch_startup
end

return configurator
2 changes: 1 addition & 1 deletion coordinator/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder")
local threads = require("coordinator.threads")

local COORDINATOR_VERSION = "v1.5.14"
local COORDINATOR_VERSION = "v1.5.15"

local CHUNK_LOAD_DELAY_S = 30.0

Expand Down
13 changes: 11 additions & 2 deletions pocket/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white)

---@class _pkt_cfg_tool_ctl
local tool_ctl = {
launch_startup = false,
ask_config = false,
has_config = false,
viewing_config = false,
Expand Down Expand Up @@ -162,8 +163,16 @@ local function config_view(display)

if not tool_ctl.has_config then tool_ctl.view_cfg.disable() end

local function startup()
tool_ctl.launch_startup = true
exit()
end

PushButton{parent=main_page,x=2,y=18,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg}
PushButton{parent=main_page,x=14,y=18,min_width=12,text="Change Log",callback=function()main_pane.set_value(6)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
local start_btn = PushButton{parent=main_page,x=17,y=18,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=2,y=y_start+4,min_width=12,text="Change Log",callback=function()main_pane.set_value(6)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

if tool_ctl.ask_config then start_btn.disable() end

--#endregion

Expand Down Expand Up @@ -254,7 +263,7 @@ function configurator.configure(ask_config)
println("configurator error: " .. error)
end

return status, error
return status, error, tool_ctl.launch_startup
end

return configurator
2 changes: 1 addition & 1 deletion pocket/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local pocket = require("pocket.pocket")
local renderer = require("pocket.renderer")
local threads = require("pocket.threads")

local POCKET_VERSION = "v0.12.8-alpha"
local POCKET_VERSION = "v0.12.9-alpha"

local println = util.println
local println_ts = util.println_ts
Expand Down
17 changes: 13 additions & 4 deletions reactor-plc/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white)

---@class _plc_cfg_tool_ctl
local tool_ctl = {
launch_startup = false,
ask_config = false,
has_config = false,
viewing_config = false,
Expand Down Expand Up @@ -184,10 +185,18 @@ local function config_view(display)
main_pane.set_value(5)
end

local function startup()
tool_ctl.launch_startup = true
exit()
end

PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg}
PushButton{parent=main_page,x=10,y=17,min_width=12,text="Self-Check",callback=function()main_pane.set_value(8)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=y_start,min_width=12,text="Self-Check",callback=function()main_pane.set_value(8)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start+2,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=y_start+4,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

if tool_ctl.ask_config then start_btn.disable() end

if not tool_ctl.has_config then
tool_ctl.view_cfg.disable()
Expand Down Expand Up @@ -293,7 +302,7 @@ function configurator.configure(ask_config)
println("configurator error: " .. error)
end

return status, error
return status, error, tool_ctl.launch_startup
end

return configurator
2 changes: 1 addition & 1 deletion reactor-plc/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.12"
local R_PLC_VERSION = "v1.8.13"

local println = util.println
local println_ts = util.println_ts
Expand Down
15 changes: 12 additions & 3 deletions rtu/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white)

---@class _rtu_cfg_tool_ctl
local tool_ctl = {
launch_startup = false,
ask_config = false,
has_config = false,
viewing_config = false,
Expand Down Expand Up @@ -218,9 +219,17 @@ local function config_view(display)
main_pane.set_value(5)
end

local function startup()
tool_ctl.launch_startup = true
exit()
end

PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

if tool_ctl.ask_config then start_btn.disable() end

if not tool_ctl.has_config then
tool_ctl.view_gw_cfg.disable()
Expand Down Expand Up @@ -346,7 +355,7 @@ function configurator.configure(ask_config)
println("configurator error: " .. error)
end

return status, error
return status, error, tool_ctl.launch_startup
end

return configurator
2 changes: 1 addition & 1 deletion rtu/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.14"
local RTU_VERSION = "v1.10.15"

local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_HW_STATE = databus.RTU_HW_STATE
Expand Down
2 changes: 1 addition & 1 deletion startup.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local BOOTLOADER_VERSION = "1.1"
local BOOTLOADER_VERSION = "1.2"

print("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION)
print("BOOT> SCANNING FOR APPLICATIONS...")
Expand Down
15 changes: 12 additions & 3 deletions supervisor/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white)

---@class _svr_cfg_tool_ctl
local tool_ctl = {
launch_startup = false,
ask_config = false,
has_config = false,
viewing_config = false,
Expand Down Expand Up @@ -201,9 +202,17 @@ local function config_view(display)
main_pane.set_value(5)
end

local function startup()
tool_ctl.launch_startup = true
exit()
end

PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

if tool_ctl.ask_config then start_btn.disable() end

if not tool_ctl.has_config then
tool_ctl.view_cfg.disable()
Expand Down Expand Up @@ -308,7 +317,7 @@ function configurator.configure(ask_config)
println("configurator error: " .. error)
end

return status, error
return status, error, tool_ctl.launch_startup
end

return configurator
2 changes: 1 addition & 1 deletion supervisor/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor")

local svsessions = require("supervisor.session.svsessions")

local SUPERVISOR_VERSION = "v1.5.14"
local SUPERVISOR_VERSION = "v1.5.15"

local println = util.println
local println_ts = util.println_ts
Expand Down

0 comments on commit 8439e02

Please sign in to comment.