mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 11:34:19 +01:00
Nano UI for Air Alarms
This commit is contained in:
@@ -5,16 +5,37 @@
|
||||
/obj/machinery/computer/atmoscontrol
|
||||
name = "\improper Central Atmospherics Computer"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer_generic"
|
||||
icon_state = "tank"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
|
||||
var/obj/machinery/alarm/current
|
||||
var/list/filter=null
|
||||
var/overridden = 0 //not set yet, can't think of a good way to do it
|
||||
req_access = list(access_ce)
|
||||
req_one_access = list(access_ce)
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/atmoscontrol/xeno
|
||||
name = "\improper Xenobiology Atmospherics Computer"
|
||||
filter=list(
|
||||
/area/toxins/xenobiology/specimen_1,
|
||||
/area/toxins/xenobiology/specimen_2,
|
||||
/area/toxins/xenobiology/specimen_3,
|
||||
/area/toxins/xenobiology/specimen_4,
|
||||
/area/toxins/xenobiology/specimen_5,
|
||||
/area/toxins/xenobiology/specimen_6)
|
||||
req_one_access = list(access_xenobiology,access_ce)
|
||||
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/gas_chamber
|
||||
name = "\improper Gas Chamber Atmospherics Computer"
|
||||
filter=list(
|
||||
/area/security/gas_chamber)
|
||||
req_one_access = list(access_ce,access_hos)
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_paw(var/mob/user as mob)
|
||||
@@ -35,7 +56,9 @@
|
||||
if(current)
|
||||
dat += specific()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in machines)
|
||||
for(var/obj/machinery/alarm/alarm in sortAtom(machines))
|
||||
if(!is_in_filter(alarm.alarm_area.type))
|
||||
continue // NO ACCESS 4 U
|
||||
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
|
||||
switch(max(alarm.danger_level, alarm.alarm_area.atmosalm))
|
||||
if (0)
|
||||
@@ -57,11 +80,16 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/is_in_filter(var/typepath)
|
||||
if(!filter) return 1 // YEP. TOTALLY.
|
||||
return typepath in filter
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/specific()
|
||||
if(!current)
|
||||
return ""
|
||||
var/dat = "<h3>[current.name]</h3><hr>"
|
||||
dat += current.return_status()
|
||||
//dat += current.return_status()
|
||||
if(current.remote_control || overridden)
|
||||
dat += "<hr>[return_controls()]"
|
||||
return dat
|
||||
@@ -84,10 +112,19 @@
|
||||
"co2_scrub",
|
||||
"tox_scrub",
|
||||
"n2o_scrub",
|
||||
"o2_scrub",
|
||||
"panic_siphon",
|
||||
"scrubbing"
|
||||
)
|
||||
current.send_signal(device_id, list (href_list["command"] = text2num(href_list["val"])))
|
||||
var/val
|
||||
if(href_list["val"])
|
||||
val=text2num(href_list["val"])
|
||||
else
|
||||
var/newval = input("Enter new value") as num|null
|
||||
if(isnull(newval))
|
||||
return
|
||||
val = newval
|
||||
current.send_signal(device_id, list (href_list["command"] = val))
|
||||
spawn(3)
|
||||
src.updateUsrDialog()
|
||||
//if("adjust_threshold") //was a good idea but required very wide window
|
||||
@@ -184,6 +221,26 @@
|
||||
spawn(5)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["preset"])
|
||||
current.preset = text2num(href_list["preset"])
|
||||
current.apply_preset()
|
||||
spawn(5)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["temperature"])
|
||||
var/list/selected = current.TLV["temperature"]
|
||||
var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE)
|
||||
var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE)
|
||||
var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature]C and [max_temperature]C)", "Thermostat Controls") as num|null
|
||||
if(input_temperature==null)
|
||||
return
|
||||
if(input_temperature > max_temperature || input_temperature < min_temperature)
|
||||
usr << "Temperature must be between [min_temperature]C and [max_temperature]C"
|
||||
else
|
||||
current.target_temperature = input_temperature + T0C
|
||||
return
|
||||
updateUsrDialog()
|
||||
|
||||
//copypasta from alarm code, changed to work with this without derping hard
|
||||
@@ -192,13 +249,14 @@
|
||||
var/label=replacetext(uppertext(code),"2","<sub>2</sub>")
|
||||
if(code=="tox")
|
||||
label="Plasma"
|
||||
return "<A href='?src=\ref[current];id_tag=[id_tag];command=[code]_scrub;val=[!data["filter_"+code]]' class='scrub[data["filter_"+code]]'>[label]</A>"
|
||||
return "<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=[code]_scrub;val=[!data["filter_"+code]]' class='scrub[data["filter_"+code]]'>[label]</A>"
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/return_controls()
|
||||
var/output = ""//"<B>[alarm_zone] Air [name]</B><HR>"
|
||||
|
||||
switch(current.screen)
|
||||
if (AALARM_SCREEN_MAIN)
|
||||
output += "<table width=\"100%\"><td align=\"center\"><b>Thermostat:</b><br><a href='?src=\ref[src];alarm=\ref[current];temperature=1'>[current.target_temperature - T0C]C</a></td></table>"
|
||||
if(current.alarm_area.atmosalm)
|
||||
output += {"<a href='?src=\ref[src];alarm=\ref[current];atmos_reset=1'>Reset - Atmospheric Alarm</a><hr>"}
|
||||
else
|
||||
@@ -216,7 +274,7 @@
|
||||
else
|
||||
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
|
||||
|
||||
output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];alarm=\ref[current];atmos_unlock=[current.alarm_area.air_doors_activated]'>[current.alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
|
||||
//output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];alarm=\ref[current];atmos_unlock=[current.alarm_area.air_doors_activated]'>[current.alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
|
||||
if (AALARM_SCREEN_VENT)
|
||||
var/sensor_data = ""
|
||||
if(current.alarm_area.air_vent_names.len)
|
||||
@@ -314,21 +372,21 @@ siphoning
|
||||
output += {"<li><A href='?src=\ref[src];alarm=\ref[current];mode=[m]'><b>[modes[m]]</b></A> (selected)</li>"}
|
||||
else
|
||||
output += {"<li><A href='?src=\ref[src];alarm=\ref[current];mode=[m]'>[modes[m]]</A></li>"}
|
||||
output += {"</ul>
|
||||
<hr><br><b>Sensor presets:</b><br><i>(Note, this only sets sensors, air supplied to vents must still be changed.)</i><ul>"}
|
||||
var/list/presets = list(
|
||||
AALARM_PRESET_HUMAN = "Human - Checks for Oxygen and Nitrogen",\
|
||||
AALARM_PRESET_VOX = "Vox - Checks for Nitrogen only",\
|
||||
AALARM_PRESET_SERVER = "Coldroom - For server rooms and freezers")
|
||||
for(var/p=1;p<=presets.len;p++)
|
||||
if (current.preset==p)
|
||||
output += "<li><A href='?src=\ref[src];alarm=\ref[current];preset=[p]'><b>[presets[p]]</b></A> (selected)</li>"
|
||||
else
|
||||
output += "<li><A href='?src=\ref[src];alarm=\ref[current];preset=[p]'>[presets[p]]</A></li>"
|
||||
output += "</ul>"
|
||||
if (AALARM_SCREEN_SENSORS)
|
||||
output += {"
|
||||
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
|
||||
<hr><br><b>Sensor presets:</b><br><i>(Note, this only sets sensors, air supplied to vents must still be changed.)</i><ul>"}
|
||||
var/list/presets = list(
|
||||
AALARM_PRESET_HUMAN = "Human - Checks for Oxygen and Nitrogen",\
|
||||
AALARM_PRESET_VOX = "Vox - Checks for Nitrogen only",\
|
||||
AALARM_PRESET_SERVER = "Coldroom - For server rooms and freezers")
|
||||
for(var/p=1;p<=presets.len;p++)
|
||||
if (current.preset==p)
|
||||
output += "<li><A href='?src=\ref[current];preset=[p]'><b>[presets[p]]</b></A> (selected)</li>"
|
||||
else
|
||||
output += "<li><A href='?src=\ref[current];preset=[p]'>[presets[p]]</A></li>"
|
||||
output += {"</ul>
|
||||
<b>Alarm thresholds:</b><br>
|
||||
Partial pressure for gases
|
||||
<style>/* some CSS woodoo here. Does not work perfect in ie6 but who cares? */
|
||||
@@ -367,8 +425,11 @@ table tr:first-child th:first-child { border: none;}
|
||||
output += "<TR><th>Temperature</th>"
|
||||
for (var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
output += "</table>"
|
||||
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Mini\atmos_control.dm:357: output += "</TR>"
|
||||
output += {"</TR>
|
||||
</table>"}
|
||||
// END AUTOFIX
|
||||
return output
|
||||
//---END COPYPASTA----
|
||||
|
||||
+214
-41
@@ -87,6 +87,10 @@
|
||||
var/AAlarmwires = 31
|
||||
var/shorted = 0
|
||||
|
||||
// Waiting on a device to respond.
|
||||
// Specifies an id_tag. NULL means we aren't waiting.
|
||||
var/waiting_on_device=null
|
||||
|
||||
var/mode = AALARM_MODE_SCRUBBING
|
||||
var/preset = AALARM_PRESET_HUMAN
|
||||
var/screen = AALARM_SCREEN_MAIN
|
||||
@@ -108,36 +112,39 @@
|
||||
..()
|
||||
req_access = list(access_rd, access_atmospherics, access_engine_equip)
|
||||
preset = AALARM_PRESET_SERVER
|
||||
apply_preset()
|
||||
apply_preset(1)
|
||||
|
||||
|
||||
/obj/machinery/alarm/vox/New()
|
||||
..()
|
||||
req_access = list()
|
||||
preset = AALARM_PRESET_VOX
|
||||
apply_preset()
|
||||
apply_preset(1)
|
||||
|
||||
/obj/machinery/alarm/proc/apply_preset()
|
||||
/obj/machinery/alarm/proc/apply_preset(var/no_cycle_after=0)
|
||||
|
||||
TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
|
||||
TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
|
||||
TLV["nitrogen"] = list(-1, -1, -1, -1) // Partial pressure, kpa
|
||||
TLV["carbon_dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa
|
||||
TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa
|
||||
TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */
|
||||
TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K
|
||||
TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */
|
||||
TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K
|
||||
target_temperature = T0C+20
|
||||
switch(preset)
|
||||
if(AALARM_PRESET_VOX) // Same as usual, but without oxygen.
|
||||
TLV["oxygen"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["oxygen"] = list(-1.0, -1.0, 1, 5) // Partial pressure, kpa
|
||||
if(AALARM_PRESET_SERVER) // Cold as fuck.
|
||||
TLV["oxygen"] = list(-1.0, -1.0,-1.0,-1.0) // Partial pressure, kpa
|
||||
TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa
|
||||
TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa
|
||||
TLV["pressure"] = list(0,ONE_ATMOSPHERE*0.10,ONE_ATMOSPHERE*1.40,ONE_ATMOSPHERE*1.60) /* kpa */
|
||||
TLV["temperature"] = list(20, 40, 140, 160) // K
|
||||
TLV["oxygen"] = list(-1.0, -1.0,-1.0,-1.0) // Partial pressure, kpa
|
||||
TLV["carbon_dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa
|
||||
TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa
|
||||
TLV["pressure"] = list(0,ONE_ATMOSPHERE*0.10,ONE_ATMOSPHERE*1.40,ONE_ATMOSPHERE*1.60) /* kpa */
|
||||
TLV["temperature"] = list(20, 40, 140, 160) // K
|
||||
target_temperature = 90
|
||||
mode = AALARM_MODE_CYCLE
|
||||
apply_mode()
|
||||
if(!no_cycle_after)
|
||||
mode = AALARM_MODE_CYCLE
|
||||
apply_mode()
|
||||
|
||||
|
||||
/obj/machinery/alarm/New(var/loc, var/dir, var/building = 0)
|
||||
@@ -172,7 +179,8 @@
|
||||
|
||||
// breathable air according to human/Life()
|
||||
TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
|
||||
TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["nitrogen"] = list(-1, -1, -1, -1) // Partial pressure, kpa
|
||||
TLV["carbon_dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
|
||||
TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa
|
||||
TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa
|
||||
TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */
|
||||
@@ -233,7 +241,6 @@
|
||||
|
||||
var/old_level = danger_level
|
||||
danger_level = overall_danger_level()
|
||||
|
||||
if(danger_level < old_level)
|
||||
danger_averted_confidence++
|
||||
// Only change danger level if:
|
||||
@@ -260,7 +267,6 @@
|
||||
remote_control = 0
|
||||
if(RCON_YES)
|
||||
remote_control = 1
|
||||
|
||||
if(screen == AALARM_SCREEN_MAIN)
|
||||
updateDialog()
|
||||
return
|
||||
@@ -279,7 +285,8 @@
|
||||
|
||||
var/pressure_dangerlevel = get_danger_level(environment_pressure, TLV["pressure"])
|
||||
var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, TLV["oxygen"])
|
||||
var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, TLV["carbon dioxide"])
|
||||
var/nitrogen_dangerlevel = get_danger_level(environment.nitrogen*partial_pressure, TLV["nitrogen"])
|
||||
var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, TLV["carbon_dioxide"])
|
||||
var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, TLV["plasma"])
|
||||
var/temperature_dangerlevel = get_danger_level(environment.temperature, TLV["temperature"])
|
||||
var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, TLV["other"])
|
||||
@@ -288,6 +295,7 @@
|
||||
pressure_dangerlevel,
|
||||
oxygen_dangerlevel,
|
||||
co2_dangerlevel,
|
||||
nitrogen_dangerlevel,
|
||||
plasma_dangerlevel,
|
||||
other_dangerlevel,
|
||||
temperature_dangerlevel
|
||||
@@ -349,10 +357,16 @@
|
||||
var/dev_type = signal.data["device"]
|
||||
if(!(id_tag in alarm_area.air_scrub_names) && !(id_tag in alarm_area.air_vent_names))
|
||||
register_env_machine(id_tag, dev_type)
|
||||
var/got_update=0
|
||||
if(dev_type == "AScr")
|
||||
alarm_area.air_scrub_info[id_tag] = signal.data
|
||||
got_update=1
|
||||
else if(dev_type == "AVP")
|
||||
alarm_area.air_vent_info[id_tag] = signal.data
|
||||
got_update=1
|
||||
if(got_update && waiting_on_device==id_tag)
|
||||
updateUsrDialog()
|
||||
waiting_on_device=null
|
||||
|
||||
/obj/machinery/alarm/proc/register_env_machine(var/m_id, var/device_type)
|
||||
var/new_name
|
||||
@@ -668,7 +682,14 @@
|
||||
///////////////
|
||||
|
||||
/obj/machinery/alarm/attack_ai(mob/user)
|
||||
return interact(user)
|
||||
src.add_hiddenprint(user)
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/machinery/alarm/attack_robot(mob/user)
|
||||
// if(isMoMMI(user) && wiresexposed)
|
||||
// return interact(user)
|
||||
// else
|
||||
return attack_ai(user)
|
||||
|
||||
/obj/machinery/alarm/attack_hand(mob/user)
|
||||
. = ..()
|
||||
@@ -676,6 +697,140 @@
|
||||
return
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/alarm/proc/ui_air_status()
|
||||
var/turf/location = get_turf(src)
|
||||
var/datum/gas_mixture/environment = location.return_air()
|
||||
var/total = environment.oxygen + environment.carbon_dioxide + environment.toxins + environment.nitrogen
|
||||
if(total==0)
|
||||
return null
|
||||
|
||||
var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
|
||||
|
||||
var/list/current_settings = TLV["pressure"]
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings)
|
||||
|
||||
current_settings = TLV["oxygen"]
|
||||
var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings)
|
||||
var/oxygen_percent = round(environment.oxygen / total * 100, 2)
|
||||
|
||||
current_settings = TLV["nitrogen"]
|
||||
var/nitrogen_dangerlevel = get_danger_level(environment.nitrogen*partial_pressure, current_settings)
|
||||
var/nitrogen_percent = round(environment.nitrogen / total * 100, 2)
|
||||
|
||||
current_settings = TLV["carbon_dioxide"]
|
||||
var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings)
|
||||
var/co2_percent = round(environment.carbon_dioxide / total * 100, 2)
|
||||
|
||||
current_settings = TLV["plasma"]
|
||||
var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings)
|
||||
var/plasma_percent = round(environment.toxins / total * 100, 2)
|
||||
|
||||
current_settings = TLV["other"]
|
||||
var/other_moles = 0.0
|
||||
for(var/datum/gas/G in environment.trace_gases)
|
||||
other_moles+=G.moles
|
||||
var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings)
|
||||
|
||||
current_settings = TLV["temperature"]
|
||||
var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings)
|
||||
|
||||
|
||||
var/data[0]
|
||||
data["pressure"]=environment_pressure
|
||||
data["temperature"]=environment.temperature
|
||||
data["temperature_c"]=round(environment.temperature - T0C, 0.1)
|
||||
|
||||
var/percentages[0]
|
||||
percentages["oxygen"]=oxygen_percent
|
||||
percentages["nitrogen"]=nitrogen_percent
|
||||
percentages["co2"]=co2_percent
|
||||
percentages["plasma"]=plasma_percent
|
||||
percentages["other"]=other_moles
|
||||
data["contents"]=percentages
|
||||
|
||||
var/danger[0]
|
||||
danger["pressure"]=pressure_dangerlevel
|
||||
danger["temperature"]=temperature_dangerlevel
|
||||
danger["oxygen"]=oxygen_dangerlevel
|
||||
danger["nitrogen"]=nitrogen_dangerlevel
|
||||
danger["co2"]=co2_dangerlevel
|
||||
danger["plasma"]=plasma_dangerlevel
|
||||
danger["other"]=other_dangerlevel
|
||||
danger["overall"]=max(pressure_dangerlevel,oxygen_dangerlevel,nitrogen_dangerlevel,co2_dangerlevel,plasma_dangerlevel,other_dangerlevel,temperature_dangerlevel)
|
||||
data["danger"]=danger
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
if(user.stat)
|
||||
return
|
||||
var/data[0]
|
||||
data["air"]=ui_air_status()
|
||||
data["sensors"]=TLV
|
||||
data["locked"]=(!(istype(user, /mob/living/silicon)) && locked)
|
||||
data["rcon"]=rcon_setting
|
||||
data["target_temp"] = target_temperature - T0C
|
||||
data["atmos_alarm"] = alarm_area.atmosalm
|
||||
data["modes"] = list(
|
||||
AALARM_MODE_SCRUBBING = list("name"="Filtering","desc"="Scrubs out contaminants"),\
|
||||
AALARM_MODE_REPLACEMENT = list("name"="Replace Air","desc"="Siphons out air while replacing"),\
|
||||
AALARM_MODE_PANIC = list("name"="Panic","desc"="Siphons air out of the room"),\
|
||||
AALARM_MODE_CYCLE = list("name"="Cycle","desc"="Siphons air before replacing"),\
|
||||
AALARM_MODE_FILL = list("name"="Fill","desc"="Shuts off scrubbers and opens vents"),\
|
||||
AALARM_MODE_OFF = list("name"="Off","desc"="Shuts off vents and scrubbers"))
|
||||
data["mode"]=mode
|
||||
data["presets"]=list(
|
||||
AALARM_PRESET_HUMAN = list("name"="Human","desc"="Checks for Oxygen and Nitrogen"),\
|
||||
AALARM_PRESET_VOX = list("name"="Vox","desc"="Checks for Nitrogen only"),\
|
||||
AALARM_PRESET_SERVER = list("name"="Coldroom","desc"="For server rooms and freezers"))
|
||||
data["preset"]=preset
|
||||
data["screen"]=screen
|
||||
|
||||
var/list/vents=list()
|
||||
if(alarm_area.air_vent_names.len)
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
var/vent_info[0]
|
||||
var/long_name = alarm_area.air_vent_names[id_tag]
|
||||
var/list/vent_data = alarm_area.air_vent_info[id_tag]
|
||||
if(!vent_data)
|
||||
continue
|
||||
vent_info["id_tag"]=id_tag
|
||||
vent_info["name"]=long_name
|
||||
vent_info += vent_data
|
||||
vents+=list(vent_info)
|
||||
data["vents"]=vents
|
||||
|
||||
var/list/scrubbers=list()
|
||||
if(alarm_area.air_scrub_names.len)
|
||||
for(var/id_tag in alarm_area.air_scrub_names)
|
||||
var/long_name = alarm_area.air_scrub_names[id_tag]
|
||||
var/list/scrubber_data = alarm_area.air_scrub_info[id_tag]
|
||||
if(!scrubber_data)
|
||||
continue
|
||||
scrubber_data["id_tag"]=id_tag
|
||||
scrubber_data["name"]=long_name
|
||||
scrubbers+=list(scrubber_data)
|
||||
data["scrubbers"]=scrubbers
|
||||
|
||||
if (!ui) // no ui has been passed, so we'll search for one
|
||||
{
|
||||
ui = nanomanager.get_open_ui(user, src, ui_key)
|
||||
}
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new one
|
||||
ui = new(user, src, ui_key, "air_alarm.tmpl", name, 550, 410)
|
||||
// When the UI is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
// Auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
else
|
||||
// The UI is already open so push the new data to it
|
||||
ui.push_data(data)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/alarm/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
@@ -719,13 +874,11 @@
|
||||
t1 += text("<p><a href='?src=\ref[src];close2=1'>Close</a></p></body></html>")
|
||||
user << browse(t1, "window=AAlarmwires")
|
||||
onclose(user, "AAlarmwires")
|
||||
|
||||
if(!shorted)
|
||||
user << browse(return_text(user),"window=air_alarm")
|
||||
onclose(user, "air_alarm")
|
||||
ui_interact(user)
|
||||
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/machinery/alarm/proc/return_text(mob/user)
|
||||
if(!(istype(user, /mob/living/silicon)) && locked)
|
||||
return "<html><head><title>\The [src]</title></head><body>[return_status()]<hr>[rcon_text()]<hr><i>(Swipe ID card to unlock interface)</i></body></html>"
|
||||
@@ -762,7 +915,7 @@
|
||||
var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings)
|
||||
var/oxygen_percent = round(environment.oxygen / total * 100, 2)
|
||||
|
||||
current_settings = TLV["carbon dioxide"]
|
||||
current_settings = TLV["carbon_dioxide"]
|
||||
var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings)
|
||||
var/co2_percent = round(environment.carbon_dioxide / total * 100, 2)
|
||||
|
||||
@@ -950,22 +1103,22 @@ siphoning
|
||||
output += "<li><A href='?src=\ref[src];mode=[m]'><b>[modes[m]]</b></A> (selected)</li>"
|
||||
else
|
||||
output += "<li><A href='?src=\ref[src];mode=[m]'>[modes[m]]</A></li>"
|
||||
output += "</ul>"
|
||||
|
||||
if (AALARM_SCREEN_SENSORS)
|
||||
output += {"
|
||||
<a href='?src=\ref[src];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
|
||||
output += {"</ul>
|
||||
<hr><br><b>Sensor presets:</b><br><i>(Note, this only sets sensors, air supplied to vents must still be changed.)</i><ul>"}
|
||||
var/list/presets = list(
|
||||
AALARM_PRESET_HUMAN = "Human - Checks for Oxygen and Nitrogen",\
|
||||
AALARM_PRESET_VOX = "Vox - Checks for Nitrogen only",\
|
||||
AALARM_PRESET_SERVER = "Coldroom - For server rooms and freezers")
|
||||
AALARM_PRESET_VOX = "Vox - Checks for Nitrogen only",\
|
||||
AALARM_PRESET_SERVER = "Coldroom - For server rooms and freezers")
|
||||
for(var/p=1;p<=presets.len;p++)
|
||||
if (preset==p)
|
||||
output += "<li><A href='?src=\ref[src];preset=[p]'><b>[presets[p]]</b></A> (selected)</li>"
|
||||
else
|
||||
output += "<li><A href='?src=\ref[src];preset=[p]'>[presets[p]]</A></li>"
|
||||
output += {"</ul>
|
||||
output += "</ul>"
|
||||
|
||||
if (AALARM_SCREEN_SENSORS)
|
||||
output += {"
|
||||
<a href='?src=\ref[src];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
|
||||
<b>Alarm thresholds:</b><br>
|
||||
Partial pressure for gases
|
||||
<style>/* some CSS woodoo here. Does not work perfect in ie6 but who cares? */
|
||||
@@ -981,7 +1134,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
"}
|
||||
var/list/gases = list(
|
||||
"oxygen" = "O<sub>2</sub>",
|
||||
"carbon dioxide" = "CO<sub>2</sub>",
|
||||
"carbon_dioxide" = "CO<sub>2</sub>",
|
||||
"plasma" = "Toxin",
|
||||
"other" = "Other",)
|
||||
|
||||
@@ -1006,6 +1159,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
output += "</TR></table>"
|
||||
|
||||
return output
|
||||
*/
|
||||
|
||||
/obj/machinery/alarm/Topic(href, href_list)
|
||||
var/changed=0
|
||||
@@ -1024,6 +1178,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
|
||||
//testing(href)
|
||||
if(href_list["command"])
|
||||
var/device_id = href_list["id_tag"]
|
||||
switch(href_list["command"])
|
||||
@@ -1037,9 +1192,23 @@ table tr:first-child th:first-child { border: none;}
|
||||
"o2_scrub",
|
||||
"panic_siphon",
|
||||
"scrubbing")
|
||||
var/val
|
||||
if(href_list["val"])
|
||||
val=text2num(href_list["val"])
|
||||
else
|
||||
var/newval = input("Enter new value") as num|null
|
||||
if(isnull(newval))
|
||||
return
|
||||
if(href_list["command"]=="set_external_pressure")
|
||||
if(newval>1000+ONE_ATMOSPHERE)
|
||||
newval = 1000+ONE_ATMOSPHERE
|
||||
if(newval<0)
|
||||
newval = 0
|
||||
val = newval
|
||||
|
||||
send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]) ) )
|
||||
changed=1
|
||||
send_signal(device_id, list(href_list["command"] = val ) )
|
||||
changed=0 // We wait for the device to reply.
|
||||
waiting_on_device=device_id
|
||||
|
||||
if("set_threshold")
|
||||
var/env = href_list["env"]
|
||||
@@ -1096,15 +1265,16 @@ table tr:first-child th:first-child { border: none;}
|
||||
var/prevscreen=screen
|
||||
screen = text2num(href_list["screen"])
|
||||
changed=(prevscreen!=screen)
|
||||
/* Unused
|
||||
|
||||
/* Unused
|
||||
if(href_list["atmos_unlock"])
|
||||
switch(href_list["atmos_unlock"])
|
||||
if("0")
|
||||
air_doors_close(1)
|
||||
if("1")
|
||||
air_doors_open(1)
|
||||
changed=1
|
||||
*/
|
||||
changed=1
|
||||
*/
|
||||
|
||||
if(href_list["atmos_alarm"])
|
||||
if (alarm_area.atmosalert(2))
|
||||
@@ -1133,6 +1303,8 @@ table tr:first-child th:first-child { border: none;}
|
||||
var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE)
|
||||
var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE)
|
||||
var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature]C and [max_temperature]C)", "Thermostat Controls") as num|null
|
||||
if(input_temperature==null)
|
||||
return
|
||||
if(!input_temperature || input_temperature > max_temperature || input_temperature < min_temperature)
|
||||
usr << "Temperature must be between [min_temperature]C and [max_temperature]C"
|
||||
else
|
||||
@@ -1165,7 +1337,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
return
|
||||
else
|
||||
pulse(t1)
|
||||
changed=1
|
||||
changed=1
|
||||
if(changed)
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -1372,6 +1544,7 @@ FIRE ALARM
|
||||
return
|
||||
|
||||
/obj/machinery/firealarm/attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/firealarm/bullet_act(BLAH)
|
||||
|
||||
@@ -11,7 +11,7 @@ nanoui is used to open and update nano browser uis
|
||||
#define STATUS_UPDATE 1 // ORANGE Visability
|
||||
#define STATUS_DISABLED 0 // RED Visability
|
||||
|
||||
/datum/nanoui
|
||||
/datum/nanoui
|
||||
// the user who opened this ui
|
||||
var/mob/user
|
||||
// the object this ui "belongs" to
|
||||
@@ -180,7 +180,7 @@ nanoui is used to open and update nano browser uis
|
||||
data["ui"] = list(
|
||||
"status" = status,
|
||||
"user" = list("name" = user.name)
|
||||
)
|
||||
)
|
||||
return data
|
||||
|
||||
/**
|
||||
@@ -348,7 +348,11 @@ nanoui is used to open and update nano browser uis
|
||||
if (width && height)
|
||||
window_size = "size=[width]x[height];"
|
||||
update_status(0)
|
||||
user << browse(get_html(), "window=[window_id];[window_size][window_options]")
|
||||
var/html=get_html()
|
||||
var/f = file("nano/debug.html")
|
||||
fdel(f)
|
||||
f << html
|
||||
user << browse(html, "window=[window_id];[window_size][window_options]")
|
||||
on_close_winset()
|
||||
//onclose(user, window_id)
|
||||
nanomanager.ui_opened(src)
|
||||
|
||||
+206
-194
@@ -1,346 +1,342 @@
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: #ffffff;
|
||||
line-height: 170%;
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
background: #272727 url(uiBackground.png) 50% 0 repeat-x;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: #ffffff;
|
||||
line-height: 170%;
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
background: #272727 url(uiBackground.png) 50% 0 repeat-x;
|
||||
}
|
||||
hr {
|
||||
background-color: #40628a;
|
||||
height: 1px;
|
||||
background-color: #40628a;
|
||||
height: 1px;
|
||||
}
|
||||
.link, .linkOn, .linkOff, .selected, .disabled {
|
||||
float: left;
|
||||
min-width: 40px;
|
||||
height: 16px;
|
||||
min-width: 40px;
|
||||
height: 16px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
background: #40628a;
|
||||
border: 1px solid #161616;
|
||||
padding: 0px 4px 4px 4px;
|
||||
margin: 0 2px 2px 0;
|
||||
cursor:default;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
background: #40628a;
|
||||
border: 1px solid #161616;
|
||||
padding: 0px 4px 4px 4px;
|
||||
margin: 0 2px 2px 0;
|
||||
cursor: default;
|
||||
}
|
||||
.hasIcon {
|
||||
padding: 0px 4px 4px 0px;
|
||||
padding: 0px 4px 4px 0px;
|
||||
}
|
||||
|
||||
a:hover, .linkActive:hover {
|
||||
background: #507aac;
|
||||
background: #507aac;
|
||||
}
|
||||
.linkPending, .linkPending:hover {
|
||||
color: #ffffff;
|
||||
background: #507aac;
|
||||
color: #ffffff;
|
||||
background: #507aac;
|
||||
}
|
||||
a.white, a.white:link, a.white:visited, a.white:active {
|
||||
color: #40628a;
|
||||
text-decoration: none;
|
||||
background: #ffffff;
|
||||
border: 1px solid #161616;
|
||||
padding: 1px 4px 1px 4px;
|
||||
margin: 0 2px 0 0;
|
||||
cursor:default;
|
||||
color: #40628a;
|
||||
text-decoration: none;
|
||||
background: #ffffff;
|
||||
border: 1px solid #161616;
|
||||
padding: 1px 4px 1px 4px;
|
||||
margin: 0 2px 0 0;
|
||||
cursor: default;
|
||||
}
|
||||
a.white:hover {
|
||||
color: #ffffff;
|
||||
background: #40628a;
|
||||
color: #ffffff;
|
||||
background: #40628a;
|
||||
}
|
||||
.linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover, .selected, a.selected:link, a.selected:visited, a.selected:active, a.selected:hover {
|
||||
color: #ffffff;
|
||||
background: #2f943c;
|
||||
color: #ffffff;
|
||||
background: #2f943c;
|
||||
}
|
||||
.linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover, .disabled, a.disabled:link, a.disabled:visited, a.disabled:active, a.disabled:hover {
|
||||
color: #ffffff;
|
||||
background: #999999;
|
||||
border-color: #666666;
|
||||
color: #ffffff;
|
||||
background: #999999;
|
||||
border-color: #666666;
|
||||
}
|
||||
a.icon, .linkOn.icon, .linkOff.icon, .selected.icon, .disabled.icon {
|
||||
position: relative;
|
||||
padding: 1px 4px 2px 20px;
|
||||
position: relative;
|
||||
padding: 1px 4px 2px 20px;
|
||||
}
|
||||
a.icon img, .linkOn.icon img, .linkOff.icon img, .selected.icon img, .disabled.icon img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
ul {
|
||||
padding: 4px 0 0 10px;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
padding: 4px 0 0 10px;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
li {
|
||||
padding: 0 0 2px 0;
|
||||
padding: 0 0 2px 0;
|
||||
}
|
||||
img, a img {
|
||||
border-style:none;
|
||||
border-style: none;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0;
|
||||
padding: 12px 0 6px 0;
|
||||
color: #517087;
|
||||
clear: both;
|
||||
margin: 0;
|
||||
padding: 12px 0 6px 0;
|
||||
color: #517087;
|
||||
clear: both;
|
||||
}
|
||||
h1 {
|
||||
font-size: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
h3 {
|
||||
font-size: 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
h4 {
|
||||
font-size: 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
#uiWrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#uiTitleWrapper {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
height: 30px;
|
||||
}
|
||||
#uiTitle {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 44px;
|
||||
width: 66%;
|
||||
overflow: hidden;
|
||||
color: #E9C183;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 44px;
|
||||
width: 66%;
|
||||
overflow: hidden;
|
||||
color: #E9C183;
|
||||
font-size: 16px;
|
||||
}
|
||||
#uiTitle.icon {
|
||||
padding: 6px 8px 6px 42px;
|
||||
background-position: 2px 50%;
|
||||
background-repeat: no-repeat;
|
||||
padding: 6px 8px 6px 42px;
|
||||
background-position: 2px 50%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#uiTitleFluff {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 12px;
|
||||
width: 42px;
|
||||
height: 24px;
|
||||
background: url(uiTitleFluff.png) 50% 50% no-repeat;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 12px;
|
||||
width: 42px;
|
||||
height: 24px;
|
||||
background: url(uiTitleFluff.png) 50% 50% no-repeat;
|
||||
}
|
||||
#uiStatusIcon {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 12px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 12px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
#uiContent {
|
||||
clear: both;
|
||||
padding: 8px;
|
||||
clear: both;
|
||||
padding: 8px;
|
||||
}
|
||||
.good {
|
||||
color: #4f7529;
|
||||
font-weight: bold;
|
||||
color: #4f7529;
|
||||
font-weight: bold;
|
||||
}
|
||||
.average {
|
||||
color: #cd6500;
|
||||
font-weight: bold;
|
||||
color: #cd6500;
|
||||
font-weight: bold;
|
||||
}
|
||||
.bad {
|
||||
color: #ee0000;
|
||||
font-weight: bold;
|
||||
color: #ee0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight {
|
||||
color: #8BA5C4;
|
||||
color: #8BA5C4;
|
||||
}
|
||||
.dark {
|
||||
color: #272727;
|
||||
color: #272727;
|
||||
}
|
||||
.notice {
|
||||
position: relative;
|
||||
background: url(uiNoticeBackground.jpg) 50% 50%;
|
||||
color: #15345A;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
padding: 3px 4px 3px 4px;
|
||||
margin: 4px 0 4px 0;
|
||||
position: relative;
|
||||
background: url(uiNoticeBackground.jpg) 50% 50%;
|
||||
color: #15345A;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
padding: 3px 4px 3px 4px;
|
||||
margin: 4px 0 4px 0;
|
||||
}
|
||||
.notice.icon {
|
||||
padding: 2px 4px 0 20px;
|
||||
padding: 2px 4px 0 20px;
|
||||
}
|
||||
.notice img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
div.notice {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
.itemGroup {
|
||||
border: 1px solid #e9c183;
|
||||
border: 1px solid #e9c183;
|
||||
background: #2c2c2c;
|
||||
padding: 4px;
|
||||
clear: both;
|
||||
}
|
||||
.item {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
margin: 4px 0 0 0;
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
.itemLabel {
|
||||
float: left;
|
||||
width: 30%;
|
||||
color: #e9c183;
|
||||
float: left;
|
||||
width: 30%;
|
||||
color: #e9c183;
|
||||
}
|
||||
.itemContent {
|
||||
float: left;
|
||||
width: 69%;
|
||||
float: left;
|
||||
width: 69%;
|
||||
}
|
||||
.itemLabelNarrow {
|
||||
float: left;
|
||||
width: 20%;
|
||||
color: #e9c183;
|
||||
float: left;
|
||||
width: 20%;
|
||||
color: #e9c183;
|
||||
}
|
||||
.itemContentWide {
|
||||
float: left;
|
||||
width: 79%;
|
||||
float: left;
|
||||
width: 79%;
|
||||
}
|
||||
.itemContentSmall {
|
||||
float: left;
|
||||
width: 33%;
|
||||
float: left;
|
||||
width: 33%;
|
||||
}
|
||||
.statusDisplay {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
border: 1px solid #40628a;
|
||||
padding: 4px;
|
||||
margin: 3px 0;
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
border: 1px solid #40628a;
|
||||
padding: 4px;
|
||||
margin: 3px 0;
|
||||
}
|
||||
.statusLabel {
|
||||
width: 138px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
color: #98B0C3;
|
||||
width: 138px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
color: #98B0C3;
|
||||
}
|
||||
.statusValue {
|
||||
float: left;
|
||||
float: left;
|
||||
}
|
||||
.block {
|
||||
padding: 8px;
|
||||
margin: 10px 4px 4px 4px;
|
||||
border: 1px solid #40628a;
|
||||
background-color: #202020;
|
||||
padding: 8px;
|
||||
margin: 10px 4px 4px 4px;
|
||||
border: 1px solid #40628a;
|
||||
background-color: #202020;
|
||||
}
|
||||
.block h3 {
|
||||
padding: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.displayBar {
|
||||
position: relative;
|
||||
width: 236px;
|
||||
height: 16px;
|
||||
border: 1px solid #666666;
|
||||
float: left;
|
||||
margin: 0 5px 0 0;
|
||||
overflow: hidden;
|
||||
background: #000000;
|
||||
position: relative;
|
||||
width: 236px;
|
||||
height: 16px;
|
||||
border: 1px solid #666666;
|
||||
float: left;
|
||||
margin: 0 5px 0 0;
|
||||
overflow: hidden;
|
||||
background: #000000;
|
||||
}
|
||||
.displayBarText {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
left: 5px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
left: 5px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
}
|
||||
.displayBarFill {
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
background: #40628a;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
background: #40628a;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
.displayBarFill.alignRight {
|
||||
float: right;
|
||||
float: right;
|
||||
}
|
||||
.displayBarFill.good {
|
||||
color: #ffffff;
|
||||
background: #4f7529;
|
||||
color: #ffffff;
|
||||
background: #4f7529;
|
||||
}
|
||||
.displayBarFill.average {
|
||||
color: #ffffff;
|
||||
background: #cd6500;
|
||||
color: #ffffff;
|
||||
background: #cd6500;
|
||||
}
|
||||
.displayBarFill.bad {
|
||||
color: #ffffff;
|
||||
background: #ee0000;
|
||||
color: #ffffff;
|
||||
background: #ee0000;
|
||||
}
|
||||
.displayBarFill.highlight {
|
||||
color: #ffffff;
|
||||
background: #8BA5C4;
|
||||
color: #ffffff;
|
||||
background: #8BA5C4;
|
||||
}
|
||||
.clearBoth {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
.clearLeft {
|
||||
clear: left;
|
||||
clear: left;
|
||||
}
|
||||
.clearRight {
|
||||
clear: right;
|
||||
clear: right;
|
||||
}
|
||||
.line {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
}
|
||||
.inactive, , a.inactive:link, a.inactive:visited, a.inactive:active, a.inactive:hover {
|
||||
color: #ffffff;
|
||||
background: #999999;
|
||||
border-color: #666666;
|
||||
.inactive, , a.inactive:link, a.inactive:visited, a.inactive:active, a.inactive:hover {
|
||||
color: #ffffff;
|
||||
background: #999999;
|
||||
border-color: #666666;
|
||||
}
|
||||
.fixedLeft {
|
||||
width: 110px;
|
||||
float: left;
|
||||
width: 110px;
|
||||
float: left;
|
||||
}
|
||||
.floatRight {
|
||||
float: right;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* DNA Modifier UI (dna_modifier.tmpl) */
|
||||
|
||||
.dnaBlock
|
||||
{
|
||||
float: left;
|
||||
width: 90px;
|
||||
.dnaBlock {
|
||||
float: left;
|
||||
width: 90px;
|
||||
padding: 0 0 5px 0;
|
||||
}
|
||||
|
||||
.dnaBlockNumber
|
||||
{
|
||||
.dnaBlockNumber {
|
||||
font-family: Fixed, monospace;
|
||||
float: left;
|
||||
color: #ffffff;
|
||||
background: #363636;
|
||||
min-width: 20px;
|
||||
height: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dnaSubBlock
|
||||
{
|
||||
.dnaSubBlock {
|
||||
font-family: Fixed, monospace;
|
||||
float: left;
|
||||
padding: 0;
|
||||
min-width: 16px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
min-width: 16px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mask
|
||||
{
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
@@ -349,10 +345,26 @@ div.notice {
|
||||
background: url(uiMaskBackground.png);
|
||||
}
|
||||
|
||||
.maskContent
|
||||
{
|
||||
.maskContent {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
margin: 200px 0;
|
||||
text-align: center;
|
||||
}
|
||||
.link.red {
|
||||
float: left;
|
||||
min-width: 40px;
|
||||
height: 16px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
background: red;
|
||||
border: 1px solid #161616;
|
||||
padding: 0px 4px 4px 4px;
|
||||
margin: 0 2px 2px 0;
|
||||
cursor: default;
|
||||
}
|
||||
.link.red:HOVER {
|
||||
color: #ffffff;
|
||||
background: #FF6060;
|
||||
}
|
||||
@@ -14,7 +14,26 @@ NanoBaseHelpers = function ()
|
||||
|
||||
var initHelpers = function ()
|
||||
{
|
||||
$.views.helpers({
|
||||
$.views.tags({
|
||||
fields: function(object) {
|
||||
var key;
|
||||
var ret = "";
|
||||
for (key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
// For each property/field, render the content of the {{fields object}} tag, with "~key" as template parameter
|
||||
ret += this.tagCtx.render(object[key], { key: key });
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
$.views.helpers({
|
||||
combine: function( arr1, arr2 ) {
|
||||
return arr1 && arr2 ? arr1.concat(arr2) : arr1 || arr2;
|
||||
},
|
||||
dump: function( arr1 ) {
|
||||
return JSON.stringify(arr1);
|
||||
},
|
||||
// Generate a Byond link
|
||||
link: function( text, icon, parameters, status, elementClass, elementId) {
|
||||
|
||||
@@ -44,10 +63,21 @@ NanoBaseHelpers = function ()
|
||||
|
||||
return '<div unselectable="on" class="link linkActive ' + iconClass + ' ' + elementClass + '" data-href="' + generateHref(parameters) + '" ' + elementIdHtml + '>' + iconHtml + text + '</div>';
|
||||
},
|
||||
// Since jsrender breaks the ^ operator
|
||||
xor: function(number,bit) {
|
||||
return number ^ bit;
|
||||
},
|
||||
// Round a number to the nearest integer
|
||||
round: function(number) {
|
||||
return Math.round(number);
|
||||
},
|
||||
// Round a number to X decimal places.
|
||||
precisionRound: function (value, places) {
|
||||
if(places==0)
|
||||
return Math.round(number);
|
||||
var multiplier = Math.pow(10, places);
|
||||
return (Math.round(value * multiplier) / multiplier);
|
||||
},
|
||||
// Round a number down to integer
|
||||
floor: function(number) {
|
||||
return Math.floor(number);
|
||||
@@ -117,6 +147,12 @@ NanoBaseHelpers = function ()
|
||||
|
||||
return '<div class="displayBar ' + styleClass + '"><div class="displayBarFill ' + styleClass + '" style="width: ' + percentage + '%;"></div><div class="displayBarText ' + styleClass + '">' + showText + '</div></div>';
|
||||
},
|
||||
// Convert danger level to class (for the air alarm)
|
||||
dangerToClass: function(level) {
|
||||
if(level==0) return 'good';
|
||||
if(level==1) return 'average';
|
||||
return 'bad';
|
||||
},
|
||||
// Display DNA Blocks (for the DNA Modifier UI)
|
||||
displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) {
|
||||
if (!dnaString)
|
||||
@@ -152,7 +188,7 @@ NanoBaseHelpers = function ()
|
||||
status = 'selected';
|
||||
}
|
||||
|
||||
html += '<div class="link ' + status + ' dnaSubBlock" data-href="' + generateHref(parameters) + '" id="dnaBlock' + index + '">' + characters[index] + '</div>'
|
||||
html += '<div class="link ' + status + ' dnaSubBlock" data-href="' + generateHref(parameters) + '" id="dnaBlock' + index + '">' + characters[index] + '</div>';
|
||||
|
||||
index++;
|
||||
if (index % blockSize == 0 && index < characters.length)
|
||||
@@ -172,7 +208,7 @@ NanoBaseHelpers = function ()
|
||||
return html;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// generate a Byond href, combines _urlParameters with parameters
|
||||
var generateHref = function (parameters)
|
||||
@@ -203,7 +239,7 @@ NanoBaseHelpers = function ()
|
||||
}
|
||||
}
|
||||
return queryString;
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: function ()
|
||||
|
||||
@@ -125,7 +125,7 @@ NanoUpdate = function ()
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
alert('An error occurred while loading the UI: ' + error.message);
|
||||
alert('An error occurred while loading the UI: ' + error.message+"\n"+error.stack);
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -144,7 +144,7 @@ NanoUpdate = function ()
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
alert(error.Message);
|
||||
alert(error.Message+error.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<!--
|
||||
Title: Air Alarm UI
|
||||
Used In File(s): /code/game/machinery/alarm.dm
|
||||
-->
|
||||
{{!--
|
||||
#define AALARM_MODE_SCRUBBING 1
|
||||
#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster.
|
||||
#define AALARM_MODE_PANIC 3 //constantly sucks all air
|
||||
#define AALARM_MODE_CYCLE 4 //sucks off all air, then refill and switches to scrubbing
|
||||
#define AALARM_MODE_FILL 5 //emergency fill
|
||||
#define AALARM_MODE_OFF 6 //Shuts it all down.
|
||||
|
||||
#define AALARM_SCREEN_MAIN 1
|
||||
#define AALARM_SCREEN_VENT 2
|
||||
#define AALARM_SCREEN_SCRUB 3
|
||||
#define AALARM_SCREEN_MODE 4
|
||||
#define AALARM_SCREEN_SENSORS 5
|
||||
--}}
|
||||
<h3>{^{:name}}</h3>
|
||||
{^{if !air}}
|
||||
<div class="notice">Unable to acquire air sample.</div>
|
||||
{{else}}
|
||||
<div class="statusDisplay">
|
||||
<div class="line">
|
||||
<div class="statusLabel">Pressure:</div>
|
||||
{^{:~string("<div class='statusValue {0}'>{1} kPa</div>",~dangerToClass(air.danger.pressure),~precisionRound(air.pressure,4))}}
|
||||
<div class="statusValue" style="margin-left:5px;">
|
||||
{^{if !locked}}
|
||||
{^{if mode == 3}}
|
||||
{^{:~link("DEACTIVATE PANIC SYPHON",null,{"mode" : 1},null,'linkOn')}}
|
||||
{{else}}
|
||||
{^{:~link("ACTIVATE PANIC SYPHON",null,{"mode" : 3},null,'red')}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Oxygen:</div>
|
||||
{^{:~displayBar(air.contents.oxygen, 0, 100, ~dangerToClass(air.danger.oxygen))}}
|
||||
{^{:~string("<div class='statusValue {0}'>{1}%</div>",~dangerToClass(air.danger.oxygen),~precisionRound(air.contents.oxygen,2))}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Nitrogen:</div>
|
||||
{^{:~displayBar(air.contents.nitrogen, 0, 100, ~dangerToClass(air.danger.nitrogen))}}
|
||||
{^{:~string("<div class='statusValue {0}'>{1}%</div>",~dangerToClass(air.danger.nitrogen),~precisionRound(air.contents.nitrogen,2))}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Carbon Dioxide:</div>
|
||||
{^{:~displayBar(air.contents.co2, 0, 100, ~dangerToClass(air.danger.co2))}}
|
||||
{^{:~string("<div class='statusValue {0}'>{1}%</div>",~dangerToClass(air.danger.co2),~precisionRound(air.contents.co2,2))}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Toxins:</div>
|
||||
{^{:~displayBar(air.contents.plasma, 0, 100, ~dangerToClass(air.danger.plasma))}}
|
||||
{^{:~string("<div class='statusValue {0}'>{1}%</div>",~dangerToClass(air.danger.plasma),~precisionRound(air.contents.plasma,2))}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">
|
||||
Temperature:
|
||||
</div>
|
||||
{^{:~string("<div class='statusValue {0}'>{1}°K ({2}°C)</div>",~dangerToClass(air.danger.temperature),~precisionRound(air.temperature,2),~precisionRound(air.temperature_c,2))}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Local Status:</div>
|
||||
{^{if air.danger.overall == 0}}
|
||||
{^{if atmos_alarm}}
|
||||
<div class="average">Caution: Atmos alert in area</div>
|
||||
{{else}}
|
||||
<div class="good">Optimal</div>
|
||||
{{/if}}
|
||||
{{else air.danger.overall == 1}}
|
||||
<div class="average">Caution</div>
|
||||
{{else}}
|
||||
<div class="notice">DANGER: Internals Required</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<!--
|
||||
#define RCON_NO 1
|
||||
#define RCON_AUTO 2
|
||||
#define RCON_YES 3
|
||||
-->
|
||||
<div class="statusLabel">Remote Control:</div>
|
||||
{^{:~link('Off', null, {'rcon' : 1}, (rcon != 1) ? null : 'disabled')}}
|
||||
{^{:~link('Auto', null, {'rcon' : 2}, (rcon != 2) ? null : 'disabled')}}
|
||||
{^{:~link('On', null, {'rcon' : 3}, (rcon != 3) ? null : 'disabled')}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Thermostat:</div>
|
||||
{^{:~link(target_temp+" C", 'carat-2-n-s', {'temperature': 1})}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{^{if locked}}
|
||||
<div class="notice">Swipe card to unlock.</div>
|
||||
{{else}}
|
||||
<div class="notice">Remember to lock with ID card after use.</div>
|
||||
<div class="item">
|
||||
<div class="itemLabel">Screen:</div>
|
||||
<div class="itemContents">
|
||||
{^{:~link('Main', 'gear',{'screen':1},(screen==1)?'linkOn':'')}}
|
||||
{^{:~link('Vents', 'gear',{'screen':2},(screen==2)?'linkOn':'')}}
|
||||
{^{:~link('Scrubbers', 'gear',{'screen':3},(screen==3)?'linkOn':'')}}
|
||||
{^{:~link('Mode', 'gear',{'screen':4},(screen==4)?'linkOn':'')}}
|
||||
{^{:~link('Thresholds','gear',{'screen':5},(screen==5)?'linkOn':'')}}
|
||||
</div>
|
||||
</div>
|
||||
{{!-- VENTS --}}
|
||||
{^{if screen == 2}}
|
||||
<h3>Vent Pump Settings</h3>
|
||||
{^{for vents}}
|
||||
<div class="statusDisplay">
|
||||
<div class="line">
|
||||
<b>{^{>name}}:</b> {^{:state}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Operating:</div>
|
||||
<div class="statusValue">
|
||||
{^{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}}
|
||||
{^{if direction=="siphon"}}
|
||||
{^{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'set_dir','dir':'release'})}}
|
||||
{{else}}
|
||||
{^{:~link('Blowing','arrowthick-1-n',{'id_tag':id_tag,'command':'set_dir','dir':'siphon'})}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Pressure checks:</div>
|
||||
<div class="statusValue">
|
||||
{^{:~link('External','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,1)},null,(checks & 1 ?'linkOn':'red'))}}
|
||||
{^{:~link('Internal','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,2)},null,(checks & 2 ?'linkOn':'red'))}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">External pressure target:</div>
|
||||
<div class="statusValue">
|
||||
{^{:~precisionRound(external,4)}} kPa
|
||||
</div>
|
||||
{^{:~link('Set','gear',{'id_tag':id_tag,'command':'set_external_pressure'})}}
|
||||
{^{:~link('Reset','arrowrefresh-1-n',{'id_tag':id_tag,'command':'set_external_pressure','val':101.325},null,'linkOn')}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<i>No vent pumps located in this area.</i>
|
||||
{{/for}}
|
||||
{{!-- SCRUBBERS --}}
|
||||
{{else screen == 3}}
|
||||
<h3>Scrubbers</h3>
|
||||
{^{for scrubbers}}
|
||||
<div class="statusDisplay">
|
||||
<div class="line">
|
||||
<b>{^{>name}}:</b> {^{:state}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Operating:</div>
|
||||
<div class="statusValue">
|
||||
{^{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Type:</div>
|
||||
<div class="statusValue">
|
||||
{^{if scrubbing==0}}
|
||||
{^{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'scrubbing','val':1},null,'red')}}
|
||||
{{else}}
|
||||
{^{:~link('Scrubbing','transferthick-e-w',{'id_tag':id_tag,'command':'scrubbing','val':0},null,'linkOn')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{^{if scrubbing==1}}
|
||||
<div class="line">
|
||||
<div class="statusLabel">Filtering:</div>
|
||||
<div class="statusValue">
|
||||
{^{:~link('CO<sub>2</sub>',null,{'id_tag':id_tag,'command':'co2_scrub','val':(filter_co2==0?1:0)},null,(filter_co2?'linkOn':''))}}
|
||||
{^{:~link('Plasma', null,{'id_tag':id_tag,'command':'tox_scrub','val':(filter_tox==0?1:0)},null,(filter_tox?'linkOn':''))}}
|
||||
{^{:~link('N<sub>2</sub>O',null,{'id_tag':id_tag,'command':'n2o_scrub','val':(filter_n2o==0?1:0)},null,(filter_n2o?'linkOn':''))}}
|
||||
{^{:~link('O<sub>2</sub>', null,{'id_tag':id_tag,'command':'o2_scrub', 'val':(filter_o2 ==0?1:0)},null,(filter_o2 ?'linkOn':''))}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
<i>No scrubbers located in this area.</i>
|
||||
{{/for}}
|
||||
{{!-- MODES --}}
|
||||
{{else screen == 4}}
|
||||
<h3>System Mode</h3>
|
||||
<div class="statusDisplay">
|
||||
{^{for modes}}
|
||||
<div class="line">
|
||||
<div class="statusLabel">{^{:~link(name,'gear',{'mode':#index+1},null,(#index+1==~root.mode?'linkOn':''))}}</div>
|
||||
<div class="statusValue">
|
||||
{^{:desc}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
<h3>System Preset</h3>
|
||||
<div class="notice">After making a selection, the system will automatically cycle in order to remove contaminants.</div>
|
||||
<div class="statusDisplay">
|
||||
{^{for presets}}
|
||||
<div class="line">
|
||||
<div class="statusLabel">{^{:~link(name,'gear',{'preset':#index+1},null,(#index+1==~root.preset?'linkOn':''))}}</div>
|
||||
<div class="statusValue">
|
||||
{^{:desc}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
{{!-- SENSORS --}}
|
||||
{{else screen == 5}}
|
||||
<h3>Sensor Thresholds</h3>
|
||||
<div class="statusDisplay">
|
||||
<table>
|
||||
<thead>
|
||||
<th> </th>
|
||||
<th class="bad">min2</th>
|
||||
<th class="average">min1</th>
|
||||
<th class="average">max1</th>
|
||||
<th class="bad">max2</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>O<sub>2</sub></th>
|
||||
{^{for sensors.oxygen}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'oxygen','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>N<sub>2</sub></th>
|
||||
{^{for sensors.nitrogen}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'nitrogen','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CO<sub>2</sub></th>
|
||||
{^{for sensors.carbon_dioxide}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'carbon_dioxide','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Toxins</th>
|
||||
{^{for sensors.plasma}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'plasma','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Pressure</th>
|
||||
{^{for sensors.pressure}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'pressure','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Temperature (K)</th>
|
||||
{^{for sensors.temperature}}
|
||||
<td>{^{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'temperature','var':#index+1})}}</td>
|
||||
{{/for}}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,141 @@
|
||||
<div class='notice'>
|
||||
{^{if locked}}
|
||||
Swipe ID card to unlock interface
|
||||
{{else}}
|
||||
Swipe ID card to lock interface
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<h3>Status</h3>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Main Breaker:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{^{if locked}}
|
||||
{^{if isOperating}}
|
||||
<span class='good'>On</span>
|
||||
{{else}}
|
||||
<span class='bad'>Off</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{^{:~link('On', {'breaker' : 1}, isOperating ? 'selected' : null)}}{^{:~link('Off', {'breaker' : 1}, isOperating ? null : 'selected')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
External Power:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{^{if externalPower == 2}}
|
||||
<span class='good'>Good</span>
|
||||
{{else externalPower == 1}}
|
||||
<span class='average'>Low</span>
|
||||
{{else}}
|
||||
<span class='bad'>None</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Power Cell:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{^{if powerCellStatus == null}}
|
||||
<span class='bad'>Not connected.</span>
|
||||
{{else}}
|
||||
{^{:powerCellStatus}}%
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{^{if powerCellStatus != null}}
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Charge Mode:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{^{if locked}}
|
||||
{^{if chargeMode}}
|
||||
<span class='good'>Auto</span>
|
||||
{{else}}
|
||||
<span class='bad'>Off</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{^{:~link('Auto', {'cmode' : 1}, chargeMode ? 'selected' : null)}}{^{:~link('Off', {'cmode' : 1}, chargeMode ? null : 'selected')}}
|
||||
{{/if}}
|
||||
|
||||
{^{if chargingStatus > 1}}
|
||||
(<span class='good'>Fully Charged</span>)
|
||||
{{else chargingStatus == 1}}
|
||||
(<span class='average'>Charging</span>)
|
||||
{{else}}
|
||||
(<span class='bad'>Not Charging</span>)
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<h3>Power Channels</h3>
|
||||
|
||||
{^{for powerChannels}}
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
{^{:title}}
|
||||
</div>
|
||||
<div class="itemContentSmall" style="width: 26%;">
|
||||
{^{:powerLoad}} W
|
||||
</div>
|
||||
<div class="itemContentSmall" style="width: 40%;">
|
||||
{^{if !~root.locked}}
|
||||
{^{:~link('Auto', topicParams.auto, (status == 1 || status == 3) ? 'selected' : null)}}
|
||||
{^{:~link('On', topicParams.on, (status == 2) ? 'selected' : null)}}
|
||||
{^{:~link('Off', topicParams.off, (status == 0) ? 'selected' : null)}}
|
||||
{{/if}}
|
||||
{^{if status <= 1}}
|
||||
<span class='bad'>Off</span>
|
||||
{{else status >= 2}}
|
||||
<span class='good'>On</span>
|
||||
{{/if}}
|
||||
{^{if ~root.locked}}
|
||||
{^{if status == 1 || status == 3}}
|
||||
(Auto)
|
||||
{{else}}
|
||||
(Manual)
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
|
||||
<div class="item"> </div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Total Load:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:totalLoad}} W
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Cover Lock:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{^{if locked}}
|
||||
{^{if coverLocked}}
|
||||
<span class='good'>Engaged</span>
|
||||
{{else}}
|
||||
<span class='bad'>Disengaged</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{^{:~link('Engaged', {'lock' : 1}, coverLocked ? 'selected' : null)}}{^{:~link('Disengaged', {'lock' : 1}, coverLocked ? null : 'selected')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user