#207 pocket turbine view
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
local cc_strings = require("cc.strings")
|
||||
|
||||
local const = require("scada-common.constants")
|
||||
|
||||
local math = math
|
||||
local string = string
|
||||
local table = table
|
||||
@@ -368,7 +370,7 @@ end
|
||||
|
||||
--#endregion
|
||||
|
||||
--#region MEKANISM POWER
|
||||
--#region MEKANISM MATH
|
||||
|
||||
-- convert Joules to FE
|
||||
---@nodiscard
|
||||
@@ -434,6 +436,22 @@ function util.power_format(fe, combine_label, format)
|
||||
end
|
||||
end
|
||||
|
||||
-- compute Mekanism's rotation rate for a turbine
|
||||
---@nodiscard
|
||||
---@param turbine turbinev_session_db turbine data
|
||||
function util.turbine_rotation(turbine)
|
||||
local build = turbine.build
|
||||
|
||||
local inner_vol = build.steam_cap / const.mek.TURBINE_GAS_PER_TANK
|
||||
local disp_rate = (build.dispersers * const.mek.TURBINE_DISPERSER_FLOW) * inner_vol
|
||||
local vent_rate = build.vents * const.mek.TURBINE_VENT_FLOW
|
||||
|
||||
local max_rate = math.min(disp_rate, vent_rate)
|
||||
local flow = math.min(max_rate, turbine.tanks.steam.amount)
|
||||
|
||||
return (flow * (turbine.tanks.steam.amount / build.steam_cap)) / max_rate
|
||||
end
|
||||
|
||||
--#endregion
|
||||
|
||||
--#region UTILITY CLASSES
|
||||
|
||||
Reference in New Issue
Block a user