Power monitor update

This commit is contained in:
Markolie
2015-08-23 23:58:38 +02:00
parent a53451c243
commit 93c52de1f9
7 changed files with 59 additions and 38 deletions
+3 -3
View File
@@ -18,10 +18,10 @@ var/global/datum/repository/apc/apc_repository = new()
var/obj/machinery/power/apc/A = term.master
L += A
var/list/Status = list(0,0,1,1) // Status: off, auto-off, on, auto-on
var/list/chg = list(0,1,1) // Charging: no, charging, full
var/list/Status = list("Off","AOff","On","AOn") // Status: off, auto-off, on, auto-on
var/list/chg = list("N","C","F") // Charging: no, charging, full
for(var/obj/machinery/power/apc/A in L)
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : -1, "CellStatus" = A.cell ? chg[A.charging+1] : 0)
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : "M", "CellStatus" = A.cell ? chg[A.charging+1] : "M", "Load" = round(A.lastused_total,1))
cache_entry.timestamp = world.time + 5 SECONDS
cache_entry.data = apcData