2022-05-12 19:36:27 +00:00
|
|
|
local rtu = require("rtu.rtu")
|
2022-01-25 19:51:33 +00:00
|
|
|
|
2022-05-04 17:37:01 +00:00
|
|
|
local boiler_rtu = {}
|
|
|
|
|
2022-05-12 19:36:27 +00:00
|
|
|
-- create new boiler (mek 10.0) device
|
|
|
|
---@param boiler table
|
2022-05-04 17:37:01 +00:00
|
|
|
boiler_rtu.new = function (boiler)
|
2022-01-25 19:51:33 +00:00
|
|
|
local self = {
|
2022-05-04 17:37:01 +00:00
|
|
|
rtu = rtu.init_unit(),
|
2022-01-25 19:51:33 +00:00
|
|
|
boiler = boiler
|
|
|
|
}
|
|
|
|
|
|
|
|
-- discrete inputs --
|
|
|
|
-- none
|
|
|
|
|
|
|
|
-- coils --
|
|
|
|
-- none
|
|
|
|
|
|
|
|
-- input registers --
|
|
|
|
-- build properties
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getBoilCapacity)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getSteamCapacity)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getWaterCapacity)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getHeatedCoolantCapacity)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getCooledCoolantCapacity)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getSuperheaters)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getMaxBoilRate)
|
|
|
|
-- current state
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getTemperature)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getBoilRate)
|
|
|
|
-- tanks
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getSteam)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getSteamNeeded)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getSteamFilledPercentage)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getWater)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getWaterNeeded)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getWaterFilledPercentage)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getHeatedCoolant)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getHeatedCoolantNeeded)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getHeatedCoolantFilledPercentage)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getCooledCoolant)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getCooledCoolantNeeded)
|
|
|
|
self.rtu.connect_input_reg(self.boiler.getCooledCoolantFilledPercentage)
|
|
|
|
|
|
|
|
-- holding registers --
|
|
|
|
-- none
|
|
|
|
|
2022-05-12 19:36:27 +00:00
|
|
|
return self.rtu.interface()
|
2022-01-25 19:51:33 +00:00
|
|
|
end
|
2022-05-04 17:37:01 +00:00
|
|
|
|
|
|
|
return boiler_rtu
|