mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
34 lines
705 B
Lua
34 lines
705 B
Lua
|
-- #REQUIRES rtu.lua
|
||
|
|
||
|
function imatrix_rtu(imatrix)
|
||
|
local self = {
|
||
|
rtu = rtu_init(),
|
||
|
imatrix = imatrix
|
||
|
}
|
||
|
|
||
|
local rtu_interface = function ()
|
||
|
return self.rtu
|
||
|
end
|
||
|
|
||
|
-- discrete inputs --
|
||
|
-- none
|
||
|
|
||
|
-- coils --
|
||
|
-- none
|
||
|
|
||
|
-- input registers --
|
||
|
-- build properties
|
||
|
self.rtu.connect_input_reg(self.imatrix.getTotalMaxEnergy)
|
||
|
-- containers
|
||
|
self.rtu.connect_input_reg(self.imatrix.getTotalEnergy)
|
||
|
self.rtu.connect_input_reg(self.imatrix.getTotalEnergyNeeded)
|
||
|
self.rtu.connect_input_reg(self.imatrix.getTotalEnergyFilledPercentage)
|
||
|
|
||
|
-- holding registers --
|
||
|
-- none
|
||
|
|
||
|
return {
|
||
|
rtu_interface = rtu_interface
|
||
|
}
|
||
|
end
|