mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
alignment and fixed has_build bugs
This commit is contained in:
parent
dcb517d1cb
commit
07574aa116
@ -122,6 +122,7 @@ function boiler.new(session_id, unit_id, advert, out_queue)
|
||||
self.db.build.ccoolant_cap = m_pkt.data[5]
|
||||
self.db.build.superheaters = m_pkt.data[6]
|
||||
self.db.build.max_boil_rate = m_pkt.data[7]
|
||||
self.has_build = true
|
||||
else
|
||||
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
|
||||
end
|
||||
@ -163,7 +164,7 @@ function boiler.new(session_id, unit_id, advert, out_queue)
|
||||
-- update this runner
|
||||
---@param time_now integer milliseconds
|
||||
function public.update(time_now)
|
||||
if not self.periodics.has_build and self.periodics.next_build_req <= time_now then
|
||||
if not self.has_build and self.periodics.next_build_req <= time_now then
|
||||
_request_build()
|
||||
self.periodics.next_build_req = time_now + PERIODICS.BUILD
|
||||
end
|
||||
|
@ -86,6 +86,7 @@ function emachine.new(session_id, unit_id, advert, out_queue)
|
||||
-- build response
|
||||
if m_pkt.length == 1 then
|
||||
self.db.build.max_energy = m_pkt.data[1]
|
||||
self.has_build = true
|
||||
else
|
||||
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
|
||||
end
|
||||
|
@ -83,7 +83,7 @@ function envd.new(session_id, unit_id, advert, out_queue)
|
||||
-- update this runner
|
||||
---@param time_now integer milliseconds
|
||||
function public.update(time_now)
|
||||
if not self.has_build and self.periodics.next_rad_req <= time_now then
|
||||
if self.periodics.next_rad_req <= time_now then
|
||||
_request_radiation()
|
||||
self.periodics.next_rad_req = time_now + PERIODICS.RAD
|
||||
end
|
||||
|
@ -119,6 +119,7 @@ function turbine.new(session_id, unit_id, advert, out_queue)
|
||||
self.db.build.max_flow_rate = m_pkt.data[7]
|
||||
self.db.build.max_production = m_pkt.data[8]
|
||||
self.db.build.max_water_output = m_pkt.data[9]
|
||||
self.has_build = true
|
||||
else
|
||||
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user