Skip to content

Commit

Permalink
Merge pull request #547 from MikaylaFischler/devel
Browse files Browse the repository at this point in the history
2024.09.08 Release
  • Loading branch information
MikaylaFischler authored Sep 12, 2024
2 parents 07406ca + fb56634 commit 8e19418
Show file tree
Hide file tree
Showing 40 changed files with 1,325 additions and 319 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.1
uses: actions/checkout@v4
- name: Luacheck
uses: lunarmodules/luacheck@v1.1.0
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Setup Python
uses: actions/setup-python@v3.1.3
uses: actions/setup-python@v5
with:
python-version: '3.10'
# Generate manifest + shields files for main branch
- name: Checkout main
id: checkout-main
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'main'
clean: false
Expand All @@ -54,7 +56,7 @@ jobs:
- name: Checkout devel
id: checkout-devel
if: success() || failure()
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'devel'
clean: false
Expand All @@ -69,11 +71,11 @@ jobs:
- name: Upload artifacts
id: upload-artifacts
if: ${{ (success() || failure()) && (steps.manifest-main.outcome == 'success' || steps.manifest-latest.outcome == 'success' || steps.manifest-devel.outcome == 'success') }}
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload manifest JSON
path: 'deploy/'
- name: Deploy to GitHub Pages
if: ${{ (success() || failure()) && steps.upload-artifacts.outcome == 'success' }}
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
3 changes: 1 addition & 2 deletions coordinator/configure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ local MGMT_TYPE = comms.MGMT_TYPE

local cpair = core.cpair

local LEFT = core.ALIGN.LEFT
local CENTER = core.ALIGN.CENTER
local RIGHT = core.ALIGN.RIGHT

Expand Down Expand Up @@ -1401,7 +1400,7 @@ local function config_view(display)

local textbox
if height > 1 then
textbox = TextBox{parent=line,x=1,y=2,text=val,height=height-1,alignment=LEFT}
textbox = TextBox{parent=line,x=1,y=2,text=val,height=height-1}
else
textbox = TextBox{parent=line,x=label_w+1,y=1,text=val,alignment=RIGHT}
end
Expand Down
25 changes: 11 additions & 14 deletions coordinator/coordinator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ function coordinator.comms(version, nic, sv_watchdog)

-- attempt connection establishment
local function _send_establish()
self.sv_r_seq_num = nil
_send_sv(PROTOCOL.SCADA_MGMT, MGMT_TYPE.ESTABLISH, { comms.version, version, DEVICE_TYPE.CRD })
end

Expand Down Expand Up @@ -386,7 +387,7 @@ function coordinator.comms(version, nic, sv_watchdog)
end

-- send the auto process control configuration with a start command
---@param auto_cfg coord_auto_config configuration
---@param auto_cfg sys_auto_config configuration
function public.send_auto_start(auto_cfg)
_send_sv(PROTOCOL.SCADA_CRDN, CRDN_TYPE.FAC_CMD, {
FAC_COMMAND.START, auto_cfg.mode, auto_cfg.burn_target, auto_cfg.charge_target, auto_cfg.gen_target, auto_cfg.limits
Expand Down Expand Up @@ -575,7 +576,7 @@ function coordinator.comms(version, nic, sv_watchdog)
local ack = packet.data[2] == true

if cmd == FAC_COMMAND.SCRAM_ALL then
iocontrol.get_db().facility.scram_ack(ack)
process.fac_ack(cmd, ack)
elseif cmd == FAC_COMMAND.STOP then
iocontrol.get_db().facility.stop_ack(ack)
elseif cmd == FAC_COMMAND.START then
Expand All @@ -585,11 +586,13 @@ function coordinator.comms(version, nic, sv_watchdog)
log.debug("SCADA_CRDN process start (with configuration) ack echo packet length mismatch")
end
elseif cmd == FAC_COMMAND.ACK_ALL_ALARMS then
iocontrol.get_db().facility.ack_alarms_ack(ack)
process.fac_ack(cmd, ack)
elseif cmd == FAC_COMMAND.SET_WASTE_MODE then
process.waste_ack_handle(packet.data[2])
elseif cmd == FAC_COMMAND.SET_PU_FB then
process.pu_fb_ack_handle(packet.data[2])
elseif cmd == FAC_COMMAND.SET_SPS_LP then
process.sps_lp_ack_handle(packet.data[2])
else
log.debug(util.c("received facility command ack with unknown command ", cmd))
end
Expand Down Expand Up @@ -624,21 +627,15 @@ function coordinator.comms(version, nic, sv_watchdog)

if unit ~= nil then
if cmd == UNIT_COMMAND.SCRAM then
unit.scram_ack(ack)
process.unit_ack(unit_id, cmd, ack)
elseif cmd == UNIT_COMMAND.START then
unit.start_ack(ack)
process.unit_ack(unit_id, cmd, ack)
elseif cmd == UNIT_COMMAND.RESET_RPS then
unit.reset_rps_ack(ack)
elseif cmd == UNIT_COMMAND.SET_BURN then
unit.set_burn_ack(ack)
elseif cmd == UNIT_COMMAND.SET_WASTE then
unit.set_waste_ack(ack)
process.unit_ack(unit_id, cmd, ack)
elseif cmd == UNIT_COMMAND.ACK_ALL_ALARMS then
unit.ack_alarms_ack(ack)
elseif cmd == UNIT_COMMAND.SET_GROUP then
-- UI will be updated to display current group if changed successfully
process.unit_ack(unit_id, cmd, ack)
else
log.debug(util.c("received unit command ack with unknown command ", cmd))
log.debug(util.c("received unsupported unit command ack for command ", cmd))
end
else
log.debug(util.c("received unit command ack with unknown unit ", unit_id))
Expand Down
25 changes: 9 additions & 16 deletions coordinator/iocontrol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ function iocontrol.init(conf, comms, temp_scale, energy_scale)
save_cfg_ack = __generic_ack,
start_ack = __generic_ack,
stop_ack = __generic_ack,
scram_ack = __generic_ack,
ack_alarms_ack = __generic_ack,

alarm_tones = { false, false, false, false, false, false, false, false },

Expand Down Expand Up @@ -184,24 +182,17 @@ function iocontrol.init(conf, comms, temp_scale, energy_scale)
turbine_flow_stable = false,

-- auto control group
a_group = 0,
a_group = types.AUTO_GROUP.MANUAL,

start = function () process.start(i) end,
scram = function () process.scram(i) end,
reset_rps = function () process.reset_rps(i) end,
ack_alarms = function () process.ack_all_alarms(i) end,
start = function () io.process.start(i) end,
scram = function () io.process.scram(i) end,
reset_rps = function () io.process.reset_rps(i) end,
ack_alarms = function () io.process.ack_all_alarms(i) end,
set_burn = function (rate) process.set_rate(i, rate) end, ---@param rate number burn rate
set_waste = function (mode) process.set_unit_waste(i, mode) end, ---@param mode WASTE_MODE waste processing mode

set_group = function (grp) process.set_group(i, grp) end, ---@param grp integer|0 group ID or 0 for manual

start_ack = __generic_ack,
scram_ack = __generic_ack,
reset_rps_ack = __generic_ack,
ack_alarms_ack = __generic_ack,
set_burn_ack = __generic_ack,
set_waste_ack = __generic_ack,

alarm_callbacks = {
c_breach = { ack = function () ack(1) end, reset = function () reset(1) end },
radiation = { ack = function () ack(2) end, reset = function () reset(2) end },
Expand Down Expand Up @@ -281,6 +272,9 @@ function iocontrol.init(conf, comms, temp_scale, energy_scale)

-- pass IO control here since it can't be require'd due to a require loop
process.init(io, comms)

-- coordinator's process handle
io.process = process.create_handle()
end

--#region Front Panel PSIL
Expand Down Expand Up @@ -575,11 +569,10 @@ function iocontrol.update_facility_status(status)
local group_map = ctl_status[14]

if (type(group_map) == "table") and (#group_map == fac.num_units) then
local names = { "Manual", "Primary", "Secondary", "Tertiary", "Backup" }
for i = 1, #group_map do
io.units[i].a_group = group_map[i]
io.units[i].unit_ps.publish("auto_group_id", group_map[i])
io.units[i].unit_ps.publish("auto_group", names[group_map[i] + 1])
io.units[i].unit_ps.publish("auto_group", types.AUTO_GROUP_NAMES[group_map[i] + 1])
end
end

Expand Down
Loading

0 comments on commit 8e19418

Please sign in to comment.