Enhances power monitor computers to use the nano-map to show APC locations.

* In addition to showing APCs on a sensor'd powernet, the same APCs can be shown on the nano-ui map!
* Hover tooltip shows basic information on the APCs.
* Makes it easier to spacially understand where APCs are when you send people out to work on them.
This commit is contained in:
Leshana
2017-03-05 17:00:03 -05:00
parent 388d6785ec
commit b89897e8a2
5 changed files with 67 additions and 0 deletions

View File

@@ -29,6 +29,10 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 500, state = state)
// adding a template with the key "mapContent" enables the map ui functionality
ui.add_template("mapContent", "power_monitor_map_content.tmpl")
// adding a template with the key "mapHeader" replaces the map header content
ui.add_template("mapHeader", "power_monitor_map_header.tmpl")
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)

View File

@@ -163,6 +163,10 @@
// Cell Status
APC_entry["cell_charge"] = A.cell ? round(A.cell.percent()) : "NO CELL"
APC_entry["cell_status"] = A.cell ? chg[A.charging+1] : "N"
// Location
APC_entry["x"] = A.x
APC_entry["y"] = A.y
APC_entry["z"] = A.z
// Other info
APC_entry["total_load"] = reading_to_text(A.lastused_total)
// Hopefully removes those goddamn \improper s which are screwing up the UI