#80 mek 10.1+ support for reactor plc
This commit is contained in:
@@ -344,6 +344,8 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
|
|||||||
-- variable reactor status information, excluding heating rate
|
-- variable reactor status information, excluding heating rate
|
||||||
---@return table data_table, boolean faulted
|
---@return table data_table, boolean faulted
|
||||||
local function _reactor_status()
|
local function _reactor_status()
|
||||||
|
local fuel = nil
|
||||||
|
local waste = nil
|
||||||
local coolant = nil
|
local coolant = nil
|
||||||
local hcoolant = nil
|
local hcoolant = nil
|
||||||
|
|
||||||
@@ -375,9 +377,9 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
|
|||||||
function () data_table[5] = self.reactor.getDamagePercent() end,
|
function () data_table[5] = self.reactor.getDamagePercent() end,
|
||||||
function () data_table[6] = self.reactor.getBoilEfficiency() end,
|
function () data_table[6] = self.reactor.getBoilEfficiency() end,
|
||||||
function () data_table[7] = self.reactor.getEnvironmentalLoss() end,
|
function () data_table[7] = self.reactor.getEnvironmentalLoss() end,
|
||||||
function () data_table[8] = self.reactor.getFuel() end,
|
function () fuel = self.reactor.getFuel() end,
|
||||||
function () data_table[9] = self.reactor.getFuelFilledPercentage() end,
|
function () data_table[9] = self.reactor.getFuelFilledPercentage() end,
|
||||||
function () data_table[10] = self.reactor.getWaste() end,
|
function () waste = self.reactor.getWaste() end,
|
||||||
function () data_table[11] = self.reactor.getWasteFilledPercentage() end,
|
function () data_table[11] = self.reactor.getWasteFilledPercentage() end,
|
||||||
function () coolant = self.reactor.getCoolant() end,
|
function () coolant = self.reactor.getCoolant() end,
|
||||||
function () data_table[14] = self.reactor.getCoolantFilledPercentage() end,
|
function () data_table[14] = self.reactor.getCoolantFilledPercentage() end,
|
||||||
@@ -387,6 +389,18 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
|
|||||||
|
|
||||||
parallel.waitForAll(table.unpack(tasks))
|
parallel.waitForAll(table.unpack(tasks))
|
||||||
|
|
||||||
|
if type(fuel) == "table" then
|
||||||
|
data_table[8] = fuel.amount
|
||||||
|
elseif type(fuel) == "number" then
|
||||||
|
data_table[8] = fuel
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(waste) == "table" then
|
||||||
|
data_table[10] = waste.amount
|
||||||
|
elseif type(waste) == "number" then
|
||||||
|
data_table[10] = waste
|
||||||
|
end
|
||||||
|
|
||||||
if coolant ~= nil then
|
if coolant ~= nil then
|
||||||
data_table[12] = coolant.name
|
data_table[12] = coolant.name
|
||||||
data_table[13] = coolant.amount
|
data_table[13] = coolant.amount
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ local config = require("reactor-plc.config")
|
|||||||
local plc = require("reactor-plc.plc")
|
local plc = require("reactor-plc.plc")
|
||||||
local threads = require("reactor-plc.threads")
|
local threads = require("reactor-plc.threads")
|
||||||
|
|
||||||
local R_PLC_VERSION = "beta-v0.7.7"
|
local R_PLC_VERSION = "beta-v0.8.0"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
|||||||
Reference in New Issue
Block a user