#616 added pellet color option to the coordinator
This commit is contained in:
parent
ee868eb607
commit
48ec973695
@ -234,16 +234,19 @@ function hmi.create(tool_ctl, main_pane, cfg_sys, divs, style)
|
|||||||
|
|
||||||
TextBox{parent=crd_cfg,x=1,y=2,text=" Coordinator UI Configuration",fg_bg=cpair(colors.black,colors.lime)}
|
TextBox{parent=crd_cfg,x=1,y=2,text=" Coordinator UI Configuration",fg_bg=cpair(colors.black,colors.lime)}
|
||||||
|
|
||||||
TextBox{parent=crd_c_1,x=1,y=1,height=3,text="Configure the UI interface options below if you wish to customize formats."}
|
TextBox{parent=crd_c_1,x=1,y=1,height=2,text="You can customize the UI with the interface options below."}
|
||||||
|
|
||||||
TextBox{parent=crd_c_1,x=1,y=4,text="Clock Time Format"}
|
TextBox{parent=crd_c_1,x=1,y=4,text="Clock Time Format"}
|
||||||
tool_ctl.clock_fmt = RadioButton{parent=crd_c_1,x=1,y=5,default=util.trinary(ini_cfg.Time24Hour,1,2),options={"24-Hour","12-Hour"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
tool_ctl.clock_fmt = RadioButton{parent=crd_c_1,x=1,y=5,default=util.trinary(ini_cfg.Time24Hour,1,2),options={"24-Hour","12-Hour"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
||||||
|
|
||||||
|
TextBox{parent=crd_c_1,x=20,y=4,text="Po/Pu Pellet Color"}
|
||||||
|
tool_ctl.pellet_color = RadioButton{parent=crd_c_1,x=20,y=5,default=util.trinary(ini_cfg.GreenPuPellet,1,2),options={"Green Pu/Cyan Po","Cyan Pu/Green Po (Mek 10.4+)"},callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
||||||
|
|
||||||
TextBox{parent=crd_c_1,x=1,y=8,text="Temperature Scale"}
|
TextBox{parent=crd_c_1,x=1,y=8,text="Temperature Scale"}
|
||||||
tool_ctl.temp_scale = RadioButton{parent=crd_c_1,x=1,y=9,default=ini_cfg.TempScale,options=types.TEMP_SCALE_NAMES,callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
tool_ctl.temp_scale = RadioButton{parent=crd_c_1,x=1,y=9,default=ini_cfg.TempScale,options=types.TEMP_SCALE_NAMES,callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
||||||
|
|
||||||
TextBox{parent=crd_c_1,x=24,y=8,text="Energy Scale"}
|
TextBox{parent=crd_c_1,x=20,y=8,text="Energy Scale"}
|
||||||
tool_ctl.energy_scale = RadioButton{parent=crd_c_1,x=24,y=9,default=ini_cfg.EnergyScale,options=types.ENERGY_SCALE_NAMES,callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
tool_ctl.energy_scale = RadioButton{parent=crd_c_1,x=20,y=9,default=ini_cfg.EnergyScale,options=types.ENERGY_SCALE_NAMES,callback=function()end,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.lime}
|
||||||
|
|
||||||
local function submit_ui_opts()
|
local function submit_ui_opts()
|
||||||
tmp_cfg.Time24Hour = tool_ctl.clock_fmt.get_value() == 1
|
tmp_cfg.Time24Hour = tool_ctl.clock_fmt.get_value() == 1
|
||||||
|
|||||||
@ -528,6 +528,8 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, ext, style)
|
|||||||
|
|
||||||
if f[1] == "AuthKey" then val = string.rep("*", string.len(val))
|
if f[1] == "AuthKey" then val = string.rep("*", string.len(val))
|
||||||
elseif f[1] == "LogMode" then val = util.trinary(raw == log.MODE.APPEND, "append", "replace")
|
elseif f[1] == "LogMode" then val = util.trinary(raw == log.MODE.APPEND, "append", "replace")
|
||||||
|
elseif f[1] == "GreenPuPellet" then
|
||||||
|
val = tri(raw, "Green Pu/Cyan Po", "Cyan Pu/Green Po")
|
||||||
elseif f[1] == "TempScale" then
|
elseif f[1] == "TempScale" then
|
||||||
val = util.strval(types.TEMP_SCALE_NAMES[raw])
|
val = util.strval(types.TEMP_SCALE_NAMES[raw])
|
||||||
elseif f[1] == "EnergyScale" then
|
elseif f[1] == "EnergyScale" then
|
||||||
|
|||||||
@ -35,7 +35,8 @@ local changes = {
|
|||||||
{ "v1.2.4", { "Added temperature scale options" } },
|
{ "v1.2.4", { "Added temperature scale options" } },
|
||||||
{ "v1.2.12", { "Added main UI theme", "Added front panel UI theme", "Added color accessibility modes" } },
|
{ "v1.2.12", { "Added main UI theme", "Added front panel UI theme", "Added color accessibility modes" } },
|
||||||
{ "v1.3.3", { "Added standard with black off state color mode", "Added blue indicator color modes" } },
|
{ "v1.3.3", { "Added standard with black off state color mode", "Added blue indicator color modes" } },
|
||||||
{ "v1.5.1", { "Added energy scale options" } }
|
{ "v1.5.1", { "Added energy scale options" } },
|
||||||
|
{ "v1.6.13", { "Added option for Po/Pu pellet green/cyan pairing" } }
|
||||||
}
|
}
|
||||||
|
|
||||||
---@class crd_configurator
|
---@class crd_configurator
|
||||||
@ -95,6 +96,7 @@ local tmp_cfg = {
|
|||||||
UnitCount = 1,
|
UnitCount = 1,
|
||||||
SpeakerVolume = 1.0,
|
SpeakerVolume = 1.0,
|
||||||
Time24Hour = true,
|
Time24Hour = true,
|
||||||
|
GreenPuPellet = false,
|
||||||
TempScale = 1, ---@type TEMP_SCALE
|
TempScale = 1, ---@type TEMP_SCALE
|
||||||
EnergyScale = 1, ---@type ENERGY_SCALE
|
EnergyScale = 1, ---@type ENERGY_SCALE
|
||||||
DisableFlowView = false,
|
DisableFlowView = false,
|
||||||
@ -129,6 +131,7 @@ local fields = {
|
|||||||
{ "UnitDisplays", "Unit Monitors", {} },
|
{ "UnitDisplays", "Unit Monitors", {} },
|
||||||
{ "SpeakerVolume", "Speaker Volume", 1.0 },
|
{ "SpeakerVolume", "Speaker Volume", 1.0 },
|
||||||
{ "Time24Hour", "Use 24-hour Time Format", true },
|
{ "Time24Hour", "Use 24-hour Time Format", true },
|
||||||
|
{ "GreenPuPellet", "Pellet Colors", false },
|
||||||
{ "TempScale", "Temperature Scale", types.TEMP_SCALE.KELVIN },
|
{ "TempScale", "Temperature Scale", types.TEMP_SCALE.KELVIN },
|
||||||
{ "EnergyScale", "Energy Scale", types.ENERGY_SCALE.FE },
|
{ "EnergyScale", "Energy Scale", types.ENERGY_SCALE.FE },
|
||||||
{ "DisableFlowView", "Disable Flow Monitor (legacy, discouraged)", false },
|
{ "DisableFlowView", "Disable Flow Monitor (legacy, discouraged)", false },
|
||||||
|
|||||||
@ -38,6 +38,7 @@ function coordinator.load_config()
|
|||||||
config.UnitCount = settings.get("UnitCount")
|
config.UnitCount = settings.get("UnitCount")
|
||||||
config.SpeakerVolume = settings.get("SpeakerVolume")
|
config.SpeakerVolume = settings.get("SpeakerVolume")
|
||||||
config.Time24Hour = settings.get("Time24Hour")
|
config.Time24Hour = settings.get("Time24Hour")
|
||||||
|
config.GreenPuPellet = settings.get("GreenPuPellet")
|
||||||
config.TempScale = settings.get("TempScale")
|
config.TempScale = settings.get("TempScale")
|
||||||
config.EnergyScale = settings.get("EnergyScale")
|
config.EnergyScale = settings.get("EnergyScale")
|
||||||
|
|
||||||
@ -67,6 +68,7 @@ function coordinator.load_config()
|
|||||||
cfv.assert_type_int(config.UnitCount)
|
cfv.assert_type_int(config.UnitCount)
|
||||||
cfv.assert_range(config.UnitCount, 1, 4)
|
cfv.assert_range(config.UnitCount, 1, 4)
|
||||||
cfv.assert_type_bool(config.Time24Hour)
|
cfv.assert_type_bool(config.Time24Hour)
|
||||||
|
cfv.assert_type_bool(config.GreenPuPellet)
|
||||||
cfv.assert_type_int(config.TempScale)
|
cfv.assert_type_int(config.TempScale)
|
||||||
cfv.assert_range(config.TempScale, 1, 4)
|
cfv.assert_range(config.TempScale, 1, 4)
|
||||||
cfv.assert_type_int(config.EnergyScale)
|
cfv.assert_type_int(config.EnergyScale)
|
||||||
|
|||||||
@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
|
|||||||
local sounder = require("coordinator.sounder")
|
local sounder = require("coordinator.sounder")
|
||||||
local threads = require("coordinator.threads")
|
local threads = require("coordinator.threads")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v1.6.12"
|
local COORDINATOR_VERSION = "v1.6.13"
|
||||||
|
|
||||||
local CHUNK_LOAD_DELAY_S = 30.0
|
local CHUNK_LOAD_DELAY_S = 30.0
|
||||||
|
|
||||||
|
|||||||
@ -2,16 +2,20 @@
|
|||||||
-- Graphics Style Options
|
-- Graphics Style Options
|
||||||
--
|
--
|
||||||
|
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
local core = require("graphics.core")
|
local core = require("graphics.core")
|
||||||
local themes = require("graphics.themes")
|
local themes = require("graphics.themes")
|
||||||
|
|
||||||
|
local coordinator = require("coordinator.coordinator")
|
||||||
|
|
||||||
---@class crd_style
|
---@class crd_style
|
||||||
local style = {}
|
local style = {}
|
||||||
|
|
||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
|
|
||||||
|
local config = coordinator.config
|
||||||
|
|
||||||
-- front panel styling
|
-- front panel styling
|
||||||
|
|
||||||
style.fp_theme = themes.sandstone
|
style.fp_theme = themes.sandstone
|
||||||
@ -223,16 +227,19 @@ style.sps = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local pu_color = util.trinary(config.GreenPuPellet, colors.green, colors.cyan)
|
||||||
|
local po_color = util.trinary(config.GreenPuPellet, colors.cyan, colors.green)
|
||||||
|
|
||||||
style.waste = {
|
style.waste = {
|
||||||
-- auto waste processing states
|
-- auto waste processing states
|
||||||
states = {
|
states = {
|
||||||
{ color = cpair(colors.black, colors.green), text = "PLUTONIUM" },
|
{ color = cpair(colors.black, pu_color), text = "PLUTONIUM" },
|
||||||
{ color = cpair(colors.black, colors.cyan), text = "POLONIUM" },
|
{ color = cpair(colors.black, po_color), text = "POLONIUM" },
|
||||||
{ color = cpair(colors.black, colors.purple), text = "ANTI MATTER" }
|
{ color = cpair(colors.black, colors.purple), text = "ANTI MATTER" }
|
||||||
},
|
},
|
||||||
states_abbrv = {
|
states_abbrv = {
|
||||||
{ color = cpair(colors.black, colors.green), text = "Pu" },
|
{ color = cpair(colors.black, pu_color), text = "Pu" },
|
||||||
{ color = cpair(colors.black, colors.cyan), text = "Po" },
|
{ color = cpair(colors.black, po_color), text = "Po" },
|
||||||
{ color = cpair(colors.black, colors.purple), text = "AM" }
|
{ color = cpair(colors.black, colors.purple), text = "AM" }
|
||||||
},
|
},
|
||||||
-- process radio button options
|
-- process radio button options
|
||||||
@ -240,8 +247,8 @@ style.waste = {
|
|||||||
-- unit waste selection
|
-- unit waste selection
|
||||||
unit_opts = {
|
unit_opts = {
|
||||||
{ text = "Auto", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.white, colors.gray) },
|
{ text = "Auto", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.white, colors.gray) },
|
||||||
{ text = "Pu", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, colors.green) },
|
{ text = "Pu", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, pu_color) },
|
||||||
{ text = "Po", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, colors.cyan) },
|
{ text = "Po", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, po_color) },
|
||||||
{ text = "AM", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, colors.purple) }
|
{ text = "AM", fg_bg = cpair(colors.black, colors.lightGray), active_fg_bg = cpair(colors.black, colors.purple) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user