fixes for control app data updating

This commit is contained in:
Mikayla Fischler
2024-10-03 22:56:38 -04:00
parent 60c4cc2f80
commit 6a04354964
7 changed files with 84 additions and 75 deletions

View File

@@ -127,6 +127,83 @@ function types.new_zero_coordinate() return { x = 0, y = 0, z = 0 } end
---@field reactor integer
---@field rsio IO_PORT[]|nil
-- create a new reactor database
---@nodiscard
function types.new_reactor_db()
---@class reactor_db
local db = {
auto_ack_token = 0,
last_status_update = 0,
control_state = false,
no_reactor = false,
formed = false,
rps_tripped = false,
rps_trip_cause = "ok", ---@type rps_trip_cause
max_op_temp_H2O = 1200,
max_op_temp_Na = 1200,
---@class rps_status
rps_status = {
high_dmg = false,
high_temp = false,
low_cool = false,
ex_waste = false,
ex_hcool = false,
no_fuel = false,
fault = false,
timeout = false,
manual = false,
automatic = false,
sys_fail = false,
force_dis = false
},
---@class mek_status
mek_status = {
heating_rate = 0.0,
status = false,
burn_rate = 0.0,
act_burn_rate = 0.0,
temp = 0.0,
damage = 0.0,
boil_eff = 0.0,
env_loss = 0.0,
fuel = 0,
fuel_need = 0,
fuel_fill = 0.0,
waste = 0,
waste_need = 0,
waste_fill = 0.0,
ccool_type = types.FLUID.EMPTY_GAS, ---@type fluid
ccool_amnt = 0,
ccool_need = 0,
ccool_fill = 0.0,
hcool_type = types.FLUID.EMPTY_GAS, ---@type fluid
hcool_amnt = 0,
hcool_need = 0,
hcool_fill = 0.0
},
---@class mek_struct
mek_struct = {
length = 0,
width = 0,
height = 0,
min_pos = types.new_zero_coordinate(),
max_pos = types.new_zero_coordinate(),
heat_cap = 0,
fuel_asm = 0,
fuel_sa = 0,
fuel_cap = 0,
waste_cap = 0,
ccool_cap = 0,
hcool_cap = 0,
max_burn = 0.0
}
}
return db
end
--#endregion
-- ALIASES --

View File

@@ -24,7 +24,7 @@ local t_pack = table.pack
local util = {}
-- scada-common version
util.version = "1.4.5"
util.version = "1.4.6"
util.TICK_TIME_S = 0.05
util.TICK_TIME_MS = 50