#141 setting unit limits with coordinator
This commit is contained in:
@@ -145,12 +145,18 @@ function coordinator.new_session(id, in_queue, out_queue, facility)
|
||||
|
||||
for i = 1, #self.units do
|
||||
local unit = self.units[i] ---@type reactor_unit
|
||||
|
||||
local auto_ctl = {
|
||||
unit.get_control_inf().lim_br10 / 10
|
||||
}
|
||||
|
||||
status[unit.get_id()] = {
|
||||
unit.get_reactor_status(),
|
||||
unit.get_rtu_statuses(),
|
||||
unit.get_annunciator(),
|
||||
unit.get_alarms(),
|
||||
unit.get_state()
|
||||
unit.get_state(),
|
||||
auto_ctl
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -301,6 +301,7 @@ function unit.new(for_reactor, num_boilers, num_turbines)
|
||||
local public = {}
|
||||
|
||||
-- ADD/LINK DEVICES --
|
||||
--#region
|
||||
|
||||
-- link the PLC
|
||||
---@param plc_session plc_session_struct
|
||||
@@ -365,7 +366,10 @@ function unit.new(for_reactor, num_boilers, num_turbines)
|
||||
util.filter_table(self.redstone, function (s) return s.get_session_id() ~= session end)
|
||||
end
|
||||
|
||||
--#endregion
|
||||
|
||||
-- AUTO CONTROL --
|
||||
--#region
|
||||
|
||||
-- engage automatic control
|
||||
function public.a_engage()
|
||||
@@ -410,6 +414,8 @@ function unit.new(for_reactor, num_boilers, num_turbines)
|
||||
end
|
||||
end
|
||||
|
||||
--#endregion
|
||||
|
||||
-- UPDATE SESSION --
|
||||
|
||||
-- update (iterate) this unit
|
||||
@@ -501,7 +507,7 @@ function unit.new(for_reactor, num_boilers, num_turbines)
|
||||
-- set the automatic control max burn rate for this unit
|
||||
---@param limit number burn rate limit for auto control
|
||||
function public.set_burn_limit(limit)
|
||||
if limit >= 0 then
|
||||
if limit > 0 then
|
||||
self.db.control.lim_br10 = math.floor(limit * 10)
|
||||
|
||||
if self.plc_i ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user