mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-08-03 18:06:04 -04:00
Adjusting getMultiblockStatusUsecase
Returning status outside of a table Using `isWorkAllowed` instead of an unexistent method
This commit is contained in:
parent
92c70b3e23
commit
f1d77a7eee
@ -1,6 +1,5 @@
|
|||||||
-- Import section
|
-- Import section
|
||||||
Machine = require("data.datasource.machine")
|
Machine = require("data.datasource.machine")
|
||||||
Alarm = require("api.sound.alarm")
|
|
||||||
--
|
--
|
||||||
|
|
||||||
local function exec(address, name)
|
local function exec(address, name)
|
||||||
@ -9,7 +8,7 @@ local function exec(address, name)
|
|||||||
local problems = multiblock:getNumberOfProblems()
|
local problems = multiblock:getNumberOfProblems()
|
||||||
|
|
||||||
local state = {}
|
local state = {}
|
||||||
if multiblock:isMachineEnabled() then
|
if multiblock:isWorkAllowed() then
|
||||||
if multiblock:hasWork() then
|
if multiblock:hasWork() then
|
||||||
state = Machine.states.ON
|
state = Machine.states.ON
|
||||||
else
|
else
|
||||||
@ -24,12 +23,10 @@ local function exec(address, name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local totalProgress = multiblock:getProgress()
|
local totalProgress = multiblock:getProgress()
|
||||||
local maxProgress = totalProgress.maximum
|
|
||||||
local progress = totalProgress.current
|
|
||||||
|
|
||||||
status[multiblock.name] = {
|
status = {
|
||||||
progress = progress,
|
progress = totalProgress.current,
|
||||||
maxProgress = maxProgress,
|
maxProgress = totalProgress.maximum,
|
||||||
problems = problems,
|
problems = problems,
|
||||||
probablyUses = multiblock:getEnergyUsage(),
|
probablyUses = multiblock:getEnergyUsage(),
|
||||||
efficiencyPercentage = multiblock:getEfficiencyPercentage(),
|
efficiencyPercentage = multiblock:getEfficiencyPercentage(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user