From 5848c2ac1a3898b19803c9524407f6d9f9089bc7 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Wed, 12 Jun 2024 20:22:41 -0400 Subject: [PATCH] test code for debugging --- pocket/iocontrol.lua | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/pocket/iocontrol.lua b/pocket/iocontrol.lua index f48ce25..669891b 100644 --- a/pocket/iocontrol.lua +++ b/pocket/iocontrol.lua @@ -862,10 +862,31 @@ function iocontrol.record_unit_data(data) local ecam = {} -- aviation reference :) back to VATSIM I go... - local function red(text) return { text = text, color = colors.red } end + -- local function red(text) return { text = text, color = colors.red } end local function white(text) return { text = text, color = colors.white } end local function blue(text) return { text = text, color = colors.blue } end + -- unit.reactor_data.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 + -- } + + -- if unit.reactor_data.rps_status then + -- for k, v in pairs(unit.alarms) do + -- unit.alarms[k] = ALARM_STATE.TRIPPED + -- end + -- end + if tripped(unit.alarms[ALARM.ContainmentBreach]) then local items = { white("REACTOR MELTDOWN"), blue("DON HAZMAT SUIT") } table.insert(ecam, { color = colors.red, text = "CONTAINMENT BREACH", help = "ContainmentBreach", items = items }) @@ -928,6 +949,10 @@ function iocontrol.record_unit_data(data) local items = {} local stat = unit.reactor_data.rps_status + -- for k, _ in pairs(stat) do + -- stat[k] = true + -- end + local function insert(cond, key, text, color) if cond[key] then table.insert(items, { text = text, help = key, color = color }) end end table.insert(items, white("REACTOR SCRAMMED")) @@ -953,6 +978,15 @@ function iocontrol.record_unit_data(data) local items = {} local annunc = unit.annunciator + -- for k, v in pairs(annunc) do + -- if type(v) == "boolean" then annunc[k] = true end + -- if type(v) == "table" then + -- for a, _ in pairs(v) do + -- v[a] = true + -- end + -- end + -- end + local function insert(cond, key, text, color) if cond == true or (type(cond) == "table" and cond[key]) then table.insert(items, { text = text, help = key, color = color }) end end