use TXN_TAGS for consistency

This commit is contained in:
Mikayla Fischler
2022-06-04 11:17:54 -04:00
parent 5cba8ff9f1
commit 1242c5a81c
6 changed files with 11 additions and 11 deletions

View File

@ -123,7 +123,7 @@ function boiler.new(session_id, unit_id, advert, out_queue)
self.db.build.superheaters = m_pkt.data[6] self.db.build.superheaters = m_pkt.data[6]
self.db.build.max_boil_rate = m_pkt.data[7] self.db.build.max_boil_rate = m_pkt.data[7]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (boiler.build)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.STATE then elseif txn_type == TXN_TYPES.STATE then
-- state response -- state response
@ -132,7 +132,7 @@ function boiler.new(session_id, unit_id, advert, out_queue)
self.db.state.temperature = m_pkt.data[1] self.db.state.temperature = m_pkt.data[1]
self.db.state.boil_rate = m_pkt.data[2] self.db.state.boil_rate = m_pkt.data[2]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (boiler.state)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.TANKS then elseif txn_type == TXN_TYPES.TANKS then
-- tanks response -- tanks response

View File

@ -87,7 +87,7 @@ function emachine.new(session_id, unit_id, advert, out_queue)
if m_pkt.length == 1 then if m_pkt.length == 1 then
self.db.build.max_energy = m_pkt.data[1] self.db.build.max_energy = m_pkt.data[1]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (emachine.build)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.STORAGE then elseif txn_type == TXN_TYPES.STORAGE then
-- storage response -- storage response
@ -96,7 +96,7 @@ function emachine.new(session_id, unit_id, advert, out_queue)
self.db.storage.energy_need = m_pkt.data[2] self.db.storage.energy_need = m_pkt.data[2]
self.db.storage.energy_fill = m_pkt.data[3] self.db.storage.energy_fill = m_pkt.data[3]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (emachine.storage)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == nil then elseif txn_type == nil then
log.error(log_tag .. "unknown transaction reply") log.error(log_tag .. "unknown transaction reply")

View File

@ -71,7 +71,7 @@ function envd.new(session_id, unit_id, advert, out_queue)
self.db.radiation = m_pkt.data[1] self.db.radiation = m_pkt.data[1]
self.db.radiation_raw = m_pkt.data[2] self.db.radiation_raw = m_pkt.data[2]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (envd.radiation)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == nil then elseif txn_type == nil then
log.error(log_tag .. "unknown transaction reply") log.error(log_tag .. "unknown transaction reply")

View File

@ -149,7 +149,7 @@ function redstone.new(session_id, unit_id, advert, out_queue)
self.db[channel] = value self.db[channel] = value
end end
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (redstone.di_read)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.INPUT_REG_READ then elseif txn_type == TXN_TYPES.INPUT_REG_READ then
-- input register read response -- input register read response
@ -160,7 +160,7 @@ function redstone.new(session_id, unit_id, advert, out_queue)
self.db[channel] = value self.db[channel] = value
end end
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (redstone.input_reg_read)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.COIL_WRITE or txn_type == TXN_TYPES.HOLD_REG_WRITE then elseif txn_type == TXN_TYPES.COIL_WRITE or txn_type == TXN_TYPES.HOLD_REG_WRITE then
-- successful acknowledgement -- successful acknowledgement

View File

@ -120,7 +120,7 @@ function turbine.new(session_id, unit_id, advert, out_queue)
self.db.build.max_production = m_pkt.data[8] self.db.build.max_production = m_pkt.data[8]
self.db.build.max_water_output = m_pkt.data[9] self.db.build.max_water_output = m_pkt.data[9]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (turbine.build)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.STATE then elseif txn_type == TXN_TYPES.STATE then
-- state response -- state response
@ -130,7 +130,7 @@ function turbine.new(session_id, unit_id, advert, out_queue)
self.db.state.steam_input_rate = m_pkt.data[3] self.db.state.steam_input_rate = m_pkt.data[3]
self.db.state.dumping_mode = m_pkt.data[4] self.db.state.dumping_mode = m_pkt.data[4]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (turbine.state)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == TXN_TYPES.TANKS then elseif txn_type == TXN_TYPES.TANKS then
-- tanks response -- tanks response
@ -139,7 +139,7 @@ function turbine.new(session_id, unit_id, advert, out_queue)
self.db.tanks.steam_need = m_pkt.data[2] self.db.tanks.steam_need = m_pkt.data[2]
self.db.tanks.steam_fill = m_pkt.data[3] self.db.tanks.steam_fill = m_pkt.data[3]
else else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (turbine.tanks)") log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end end
elseif txn_type == nil then elseif txn_type == nil then
log.error(log_tag .. "unknown transaction reply") log.error(log_tag .. "unknown transaction reply")

View File

@ -13,7 +13,7 @@ local svsessions = require("supervisor.session.svsessions")
local config = require("supervisor.config") local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor") local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "beta-v0.4.5" local SUPERVISOR_VERSION = "beta-v0.4.6"
local print = util.print local print = util.print
local println = util.println local println = util.println