diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 35b05df547d..5e8f4852bfd 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -35,7 +35,7 @@ Pipelines + Other Objects -> Pipe network return /obj/machinery/atmospherics/proc/safe_input(var/title, var/text, var/default_set) - var/new_value = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",default_set) as num + var/new_value = input(usr,text,title,default_set) as num if(usr.canUseTopic(src)) return new_value return default_set diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 24771a56241..ba6c6e60bfd 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -89,14 +89,24 @@ Passive gate is similar to the regular pump except: return 1 -/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob) - var/dat = {"Power: [on?"On":"Off"]
- Desirable output pressure: - [round(target_pressure,0.1)]kPa | Change - "} +/obj/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) + return - user << browse("[src.name] control[dat]", "window=atmo_pump") - onclose(user, "atmo_pump") + var/data = list() + + data["on"] = on + data["pressure_set"] = round(target_pressure*100) //Nano UI can't handle rounded non-integers, apparently. + data["max_pressure"] = MAX_OUTPUT_PRESSURE + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "atmos_gas_pump.tmpl", name, 400, 120) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/atmospherics/binary/passive_gate/initialize() ..() @@ -145,7 +155,7 @@ Passive gate is similar to the regular pump except: user << "Access denied." return usr.set_machine(src) - interact(user) + ui_interact(user) return /obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list) @@ -154,7 +164,11 @@ Passive gate is similar to the regular pump except: on = !on investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos") if(href_list["set_press"]) - target_pressure = max(0, min(4500, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", target_pressure))) + switch(href_list["set_press"]) + if ("max") + target_pressure = MAX_OUTPUT_PRESSURE + if ("set") + target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure))) investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos") usr.set_machine(src) src.update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index d9547e0a1c3..e1069c9f1ae 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -97,14 +97,24 @@ Thus, the two variables affect pump operation are set in New(): return 1 -/obj/machinery/atmospherics/binary/pump/interact(mob/user as mob) - var/dat = {"Power: [on?"On":"Off"]
- Desirable output pressure: - [round(target_pressure,0.1)]kPa | Change - "} +/obj/machinery/atmospherics/binary/pump/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) + return - user << browse("[src.name] control[dat]", "window=atmo_pump") - onclose(user, "atmo_pump") + var/data = list() + + data["on"] = on + data["pressure_set"] = round(target_pressure*100) //Nano UI can't handle rounded non-integers, apparently. + data["max_pressure"] = MAX_OUTPUT_PRESSURE + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "atmos_gas_pump.tmpl", name, 400, 120) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/atmospherics/binary/pump/initialize() ..() @@ -152,7 +162,7 @@ Thus, the two variables affect pump operation are set in New(): user << "Access denied." return usr.set_machine(src) - interact(user) + ui_interact(user) return /obj/machinery/atmospherics/binary/pump/Topic(href,href_list) @@ -161,7 +171,11 @@ Thus, the two variables affect pump operation are set in New(): on = !on investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos") if(href_list["set_press"]) - target_pressure = max(0, min(4500, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", target_pressure))) + switch(href_list["set_press"]) + if ("max") + target_pressure = MAX_OUTPUT_PRESSURE + if ("set") + target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure))) investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos") usr.set_machine(src) src.update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 380e1c16bfe..9d66f6c88bd 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -20,7 +20,7 @@ Thus, the two variables affect pump operation are set in New(): can_unwrench = 1 var/on = 0 - var/transfer_rate = 200 + var/transfer_rate = MAX_TRANSFER_RATE var/frequency = 0 var/id = null @@ -93,16 +93,24 @@ Thus, the two variables affect pump operation are set in New(): return 1 -/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user as mob) - var/dat = {"Power: [on?"On":"Off"]
- Desirable output flow: - [round(transfer_rate,1)]l/s | Change - "} +/obj/machinery/atmospherics/binary/volume_pump/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) + return - user << browse("[src.name] control[dat]", "window=atmo_pump") - onclose(user, "atmo_pump") + var/data = list() + data["on"] = on + data["transfer_rate"] = round(transfer_rate*100) //Nano UI can't handle rounded non-integers, apparently. + data["max_rate"] = MAX_TRANSFER_RATE + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "atmos_gas_pump.tmpl", name, 400, 120) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/atmospherics/binary/volume_pump/initialize() ..() @@ -149,7 +157,7 @@ Thus, the two variables affect pump operation are set in New(): user << "Access denied." return usr.set_machine(src) - interact(user) + ui_interact(user) return /obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list) @@ -158,7 +166,11 @@ Thus, the two variables affect pump operation are set in New(): on = !on investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos") if(href_list["set_transfer_rate"]) - transfer_rate = max(0, min(200, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", transfer_rate))) + switch(href_list["set_transfer_rate"]) + if ("max") + transfer_rate = MAX_TRANSFER_RATE + if ("set") + transfer_rate = max(0, min(MAX_TRANSFER_RATE, safe_input("Pressure control", "Enter new transfer rate (0-[MAX_TRANSFER_RATE] L/s)", transfer_rate))) investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", "atmos") usr.set_machine(src) src.update_icon() diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 839d3ecde24..985904f3bcd 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -1,6 +1,13 @@ +#define FILTER_NOTHING -1 +#define FILTER_PLASMA 0 +#define FILTER_OXYGEN 1 +#define FILTER_NITROGEN 2 +#define FILTER_CARBONDIOXIDE 3 +#define FILTER_NITROUSOXIDE 4 + /obj/machinery/atmospherics/trinary/filter icon_state = "filter_off" - density = 1 + density = 0 name = "gas filter" @@ -92,7 +99,7 @@ Filter types: filtered_out.temperature = removed.temperature switch(filter_type) - if(0) //removing plasma + if(FILTER_PLASMA) filtered_out.toxins = removed.toxins removed.toxins = 0 @@ -102,19 +109,19 @@ Filter types: removed.trace_gases -= trace_gas filtered_out.trace_gases += trace_gas - if(1) //removing O2 + if(FILTER_OXYGEN) filtered_out.oxygen = removed.oxygen removed.oxygen = 0 - if(2) //removing N2 + if(FILTER_NITROGEN) filtered_out.nitrogen = removed.nitrogen removed.nitrogen = 0 - if(3) //removing CO2 + if(FILTER_CARBONDIOXIDE) filtered_out.carbon_dioxide = removed.carbon_dioxide removed.carbon_dioxide = 0 - if(4)//removing N2O + if(FILTER_NITROUSOXIDE) if(removed.trace_gases.len>0) for(var/datum/gas/trace_gas in removed.trace_gases) if(istype(trace_gas, /datum/gas/sleeping_agent)) @@ -148,50 +155,27 @@ Filter types: user << "Access denied." return - var/dat - var/current_filter_type - switch(filter_type) - if(0) - current_filter_type = "Plasma" - if(1) - current_filter_type = "Oxygen" - if(2) - current_filter_type = "Nitrogen" - if(3) - current_filter_type = "Carbon Dioxide" - if(4) - current_filter_type = "Nitrous Oxide" - if(-1) - current_filter_type = "Nothing" - else - current_filter_type = "ERROR - Report this bug to the admin, please!" + ui_interact(user) - dat += {" - Power: [on?"On":"Off"]
- Filtering: [current_filter_type]

-

Set Filter Type:

- Plasma
- Oxygen
- Nitrogen
- Carbon Dioxide
- Nitrous Oxide
- Nothing
-
Desirable output pressure: - [src.target_pressure]kPa | Change - "} -/* - user << browse("[src.name] control[dat]","window=atmo_filter") - onclose(user, "atmo_filter") +/obj/machinery/atmospherics/trinary/filter/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) return - if (src.temp) - dat = text("[]

Clear Screen", src.temp, src) - //else - // src.on != src.on -*/ - user << browse("[src.name] control[dat]", "window=atmo_filter") - onclose(user, "atmo_filter") - return + var/data = list() + + data["on"] = on + data["pressure_set"] = round(target_pressure*100) //Nano UI can't handle rounded non-integers, apparently. + data["max_pressure"] = MAX_OUTPUT_PRESSURE + data["filter_type"] = filter_type + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "atmos_filter.tmpl", name, 400, 320) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) if(..()) @@ -200,12 +184,31 @@ Filter types: src.add_fingerprint(usr) if(href_list["filterset"]) src.filter_type = text2num(href_list["filterset"]) + var/filtering_name = "nothing" + switch(filter_type) + if(FILTER_PLASMA) + filtering_name = "plasma" + if(FILTER_OXYGEN) + filtering_name = "oxygen" + if(FILTER_NITROGEN) + filtering_name = "nitrogen" + if(FILTER_CARBONDIOXIDE) + filtering_name = "carbon dioxide" + if(FILTER_NITROUSOXIDE) + filtering_name = "nitrous oxide" + investigate_log("was set to filter [filtering_name] by [key_name(usr)]", "atmos") if (href_list["temp"]) src.temp = null if(href_list["set_press"]) - target_pressure = max(0, min(4500, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", target_pressure))) + switch(href_list["set_press"]) + if ("max") + target_pressure = MAX_OUTPUT_PRESSURE + if ("set") + target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure))) + investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos") if(href_list["power"]) on=!on + investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos") src.update_icon() src.updateUsrDialog() /* @@ -213,6 +216,4 @@ Filter types: if ((M.client && M.machine == src)) src.attack_hand(M) */ - return - - + return \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index c70dce74cf9..8726dac92da 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -1,6 +1,6 @@ /obj/machinery/atmospherics/trinary/mixer icon_state = "mixer_off" - density = 1 + density = 0 name = "gas mixer" @@ -101,48 +101,56 @@ /obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob) if(..()) return - src.add_fingerprint(usr) + if(!src.allowed(user)) user << "Access denied." return - usr.set_machine(src) - var/dat = {"Power: [on?"On":"Off"]
- Desirable output pressure: - [target_pressure]kPa | Change -
- Node 1 Concentration: - - - - - [node1_concentration]([node1_concentration*100]%) - + - + -
- Node 2 Concentration: - - - - - [node2_concentration]([node2_concentration*100]%) - + - + - "} - user << browse("[src.name] control[dat]", "window=atmo_mixer") - onclose(user, "atmo_mixer") - return + ui_interact(user) + +/obj/machinery/atmospherics/trinary/mixer/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) + return + + var/data = list() + + data["on"] = on + data["pressure_set"] = round(target_pressure*100) //Nano UI can't handle rounded non-integers, apparently. + data["max_pressure"] = MAX_OUTPUT_PRESSURE + data["node1_concentration"] = round(node1_concentration*100) + data["node2_concentration"] = round(node2_concentration*100) + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "atmos_mixer.tmpl", name, 400, 320) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list) if(..()) return if(href_list["power"]) on = !on + investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos") if(href_list["set_press"]) - target_pressure = max(0, min(4500, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", target_pressure))) + switch(href_list["set_press"]) + if ("max") + target_pressure = MAX_OUTPUT_PRESSURE + if ("set") + target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure))) + investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos") if(href_list["node1_c"]) var/value = text2num(href_list["node1_c"]) src.node1_concentration = max(0, min(1, src.node1_concentration + value)) src.node2_concentration = max(0, min(1, src.node2_concentration - value)) + investigate_log("was set to [node1_concentration] % on node 1 by [key_name(usr)]", "atmos") if(href_list["node2_c"]) var/value = text2num(href_list["node2_c"]) src.node2_concentration = max(0, min(1, src.node2_concentration + value)) src.node1_concentration = max(0, min(1, src.node1_concentration - value)) + investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", "atmos") src.update_icon() src.updateUsrDialog() return diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index ac619b10b20..d43fd334d1a 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -106,5 +106,9 @@ #define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE #define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :( #define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). + +#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this -#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this \ No newline at end of file +// Atmos pipe limits +#define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at. +#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at. \ No newline at end of file diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 0b11e742401..78d258c0251 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -167,8 +167,7 @@ return 0 /obj/machinery/alarm/attack_hand(mob/user) - . = ..() - if (.) + if (..()) return user.set_machine(src) @@ -188,17 +187,41 @@ if(!shorted) //user << browse(return_text(),"window=air_alarm") //onclose(user, "air_alarm") - var/datum/browser/popup = new(user, "air_alarm", "[alarm_area.name] Air Alarm", 500, 400) + /*var/datum/browser/popup = new(user, "air_alarm", "[alarm_area.name] Air Alarm", 500, 400) popup.set_content(return_text()) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() - refresh_all() + refresh_all()*/ + ui_interact(user) if(panel_open && (!istype(user, /mob/living/silicon/ai))) wires.Interact(user) return +/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main") + if(stat & (BROKEN|NOPOWER)) + return + + var/data = list() + + data["locked"] = locked + data["siliconUser"] = user.has_unlimited_silicon_privilege + data["screen"] = screen + data["dangerous"] = emagged + + populate_status(data) + if (!locked || user.has_unlimited_silicon_privilege) + populate_controls(data) + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "air_alarm.tmpl", "Air Alarm", 350, 500) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/alarm/proc/shock(mob/user, prb) if((stat & (NOPOWER))) // unpowered, no shock @@ -247,326 +270,156 @@ return 1 -/obj/machinery/alarm/proc/return_text() - var/dat = "" - dat += "
Swipe ID card to [locked ? "unlock" : "lock"] interface.
" - if(!usr.has_unlimited_silicon_privilege && locked) - dat += "[return_status()]" - else - dat += "[return_safety()][return_status()]
[return_controls()]" - return dat - -/obj/machinery/alarm/proc/return_status() - var/turf/location = src.loc +/obj/machinery/alarm/proc/populate_status(var/list/data) + 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 - var/output = "

Air Status:

" - if(total == 0) - output +={"Warning: Cannot obtain air sample for analysis."} - return output + var/list/environment_data = list() + data["atmos_alarm"] = alarm_area.atmosalm + data["fire_alarm"] = (alarm_area.fire != null && alarm_area.fire) + data["danger_level"] = danger_level + if(total) + var/datum/tlv/cur_tlv + var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - output += {" - -"} - var/datum/tlv/cur_tlv - var/GET_PP = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + cur_tlv = TLV["pressure"] + var/pressure = environment.return_pressure() + var/pressure_danger = cur_tlv.get_danger_level(pressure) + environment_data += list(list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_danger)) - cur_tlv = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = cur_tlv.get_danger_level(environment_pressure) + cur_tlv = TLV["oxygen"] + var/oxygen_danger = cur_tlv.get_danger_level(environment.oxygen*partial_pressure) + environment_data += list(list("name" = "Oxygen", "value" = environment.oxygen / total * 100, "unit" = "%", "danger_level" = oxygen_danger)) - cur_tlv = TLV["oxygen"] - var/oxygen_dangerlevel = cur_tlv.get_danger_level(environment.oxygen*GET_PP) - var/oxygen_percent = round(environment.oxygen / total * 100, 2) + cur_tlv = TLV["carbon dioxide"] + var/carbon_dioxide_danger = cur_tlv.get_danger_level(environment.carbon_dioxide*partial_pressure) + environment_data += list(list("name" = "Carbon dioxide", "value" = environment.carbon_dioxide / total * 100, "unit" = "%", "danger_level" = carbon_dioxide_danger)) - cur_tlv = TLV["carbon dioxide"] - var/co2_dangerlevel = cur_tlv.get_danger_level(environment.carbon_dioxide*GET_PP) - var/co2_percent = round(environment.carbon_dioxide / total * 100, 2) + cur_tlv = TLV["plasma"] + var/plasma_danger = cur_tlv.get_danger_level(environment.toxins*partial_pressure) + environment_data += list(list("name" = "Toxins", "value" = environment.toxins / total * 100, "unit" = "%", "danger_level" = plasma_danger)) - cur_tlv = TLV["plasma"] - var/plasma_dangerlevel = cur_tlv.get_danger_level(environment.toxins*GET_PP) - var/plasma_percent = round(environment.toxins / total * 100, 2) + cur_tlv = TLV["other"] + var/other_moles = 0.0 + for(var/datum/gas/G in environment.trace_gases) + other_moles+=G.moles + var/other_danger = cur_tlv.get_danger_level(other_moles*partial_pressure) + environment_data += list(list("name" = "Other", "value" = other_moles / total * 100, "unit" = "%", "danger_level" = other_danger)) - cur_tlv = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = cur_tlv.get_danger_level(other_moles*GET_PP) - - cur_tlv = TLV["temperature"] - var/temperature_dangerlevel = cur_tlv.get_danger_level(environment.temperature) - - output += {" -Pressure: [environment_pressure]kPa
-Oxygen: [oxygen_percent]%
-Carbon dioxide: [co2_percent]%
-Toxins: [plasma_percent]%
-"} - if (other_dangerlevel==2) - output += {"Notice: High Concentration of Unknown Particles Detected
"} - else if (other_dangerlevel==1) - output += {"Notice: Low Concentration of Unknown Particles Detected
"} - - output += {" -Temperature: [environment.temperature]K
-"} - - var/display_danger_level = max( - pressure_dangerlevel, - oxygen_dangerlevel, - co2_dangerlevel, - plasma_dangerlevel, - other_dangerlevel, - temperature_dangerlevel - ) - - //Overall status - output += {"Local Status: "} - if(display_danger_level == 2) - output += {"DANGER: Internals Required"} - else if(display_danger_level == 1) - output += {"Caution"} - else if (alarm_area.atmosalm) - output += {"Caution: Atmos alert in area"} - else - output += {"Optimal"} - - return output - -/obj/machinery/alarm/proc/return_safety() - var/output = "" - if(src.emagged) - output += "NOTICE: Safety measures nonfunctional. Device may exhibit abnormal behavior.

" - else - output += "Safety measures functioning properly.

" - return output - - -/obj/machinery/alarm/proc/return_controls() - var/output = ""//"[alarm_zone] Air [name]
" + cur_tlv = TLV["temperature"] + var/temperature_danger = cur_tlv.get_danger_level(environment.temperature) + environment_data += list(list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_danger)) + data["environment_data"] = environment_data +/obj/machinery/alarm/proc/populate_controls(var/list/data) switch(screen) - if (AALARM_SCREEN_MAIN) - if(alarm_area.atmosalm) - output += {"Reset - Atmospheric Alarm
"} - else - output += {"Activate - Atmospheric Alarm
"} + if(AALARM_SCREEN_MAIN) + data["mode"] = mode + if(AALARM_SCREEN_VENT) + data["vents"] = list() + for(var/id_tag in alarm_area.air_vent_names) + var/long_name = alarm_area.air_vent_names[id_tag] + var/list/info = alarm_area.air_vent_info[id_tag] + if(!info) + continue + data["vents"] += list(list( + "id_tag" = id_tag, + "long_name" = sanitize(long_name), + "power" = info["power"], + "excheck" = info["checks"]&1, + "incheck" = info["checks"]&2, + "direction" = info["direction"], + "external" = info["external"] + )) + if(AALARM_SCREEN_SCRUB) + data["scrubbers"] = list() + for(var/id_tag in alarm_area.air_scrub_names) + var/long_name = alarm_area.air_scrub_names[id_tag] + var/list/info = alarm_area.air_scrub_info[id_tag] + if(!info) + continue + data["scrubbers"] += list(list( + "id_tag" = id_tag, + "long_name" = sanitize(long_name), + "power" = info["power"], + "scrubbing" = info["scrubbing"], + "panic" = info["panic"], + "filter_co2" = info["filter_co2"], + "filter_toxins" = info["filter_toxins"], + "filter_n2o" = info["filter_n2o"] + )) + if(AALARM_SCREEN_MODE) + data["mode"] = mode + data["modes"] = list() + data["modes"] += list(list("name" = "Filtering - Scrubs out contaminants", "mode" = AALARM_MODE_SCRUBBING, "selected" = mode == AALARM_MODE_SCRUBBING, "danger" = 0)) + data["modes"] += list(list("name" = "Draught - Siphons out air while replacing", "mode" = AALARM_MODE_VENTING, "selected" = mode == AALARM_MODE_VENTING, "danger" = 0)) + data["modes"] += list(list("name" = "Cycle - Siphons air before replacing", "mode" = AALARM_MODE_REPLACEMENT, "selected" = mode == AALARM_MODE_REPLACEMENT, "danger" = 1)) + data["modes"] += list(list("name" = "Panic - Siphons air out of the room", "mode" = AALARM_MODE_PANIC, "selected" = mode == AALARM_MODE_PANIC, "danger" = 1)) + data["modes"] += list(list("name" = "Off - Shuts off vents and scrubbers", "mode" = AALARM_MODE_OFF, "selected" = mode == AALARM_MODE_OFF, "danger" = 0)) + if (src.emagged) + data["modes"] += list(list("name" = "Flood - Shuts off scrubbers and opens vents", "mode" = AALARM_MODE_FLOOD, "selected" = mode == AALARM_MODE_FLOOD, "danger" = 1)) + if(AALARM_SCREEN_SENSORS) + var/list/selected = list() + var/list/thresholds = list() - output += {" -Scrubbers Control
-Vents Control
-Set Environmentals Mode
-Sensor Settings
-
-"} - if (mode==AALARM_MODE_PANIC) - output += "PANIC SYPHON ACTIVE
Turn syphoning off" - else - output += "ACTIVATE PANIC SYPHON IN AREA" - if (AALARM_SCREEN_VENT) - var/sensor_data = "" - if(alarm_area.air_vent_names.len) - for(var/id_tag in alarm_area.air_vent_names) - var/long_name = alarm_area.air_vent_names[id_tag] - var/list/data = alarm_area.air_vent_info[id_tag] - if(!data) - continue; - var/state = "" - - sensor_data += {" -

[long_name]

-[state]
-Operating: -[data["power"]?"on":"off"] -
-Pressure checks: -external -internal -
-External pressure bound: -- -- -- -- -[data["external"]] -+ -+ -+ -+ -reset -
-"} - if (data["direction"] == "siphon") - sensor_data += {" -Direction: -siphoning -
-"} - sensor_data += {"
"} - else - sensor_data = "No vents connected.
" - output = {"<< Main Menu

[sensor_data]"} - if (AALARM_SCREEN_SCRUB) - var/sensor_data = "" - 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/data = alarm_area.air_scrub_info[id_tag] - if(!data) - continue; - var/state = "" - - sensor_data += {" -[long_name][state]
-Operating: -[data["power"]?"on":"off"]
-Type: -[data["scrubbing"]?"scrubbing":"syphoning"]
-"} - - if(data["scrubbing"]) - sensor_data += {" -Filtering: -Carbon Dioxide -[data["filter_co2"]?"on":"off"]; -Toxins -[data["filter_toxins"]?"on":"off"]; -Nitrous Oxide -[data["filter_n2o"]?"on":"off"] -
-"} - sensor_data += {" -Panic syphon: [data["panic"]?"PANIC SYPHON ACTIVATED":""] -Dea":"red'>A")]ctivate
-
-"} - else - sensor_data = "No scrubbers connected.
" - output = {"<< Main Menu

[sensor_data]"} - - if (AALARM_SCREEN_MODE) - output += {" -<< Main Menu

-Air machinery mode for the area:" - if (AALARM_SCREEN_SENSORS) - output += {" -<< Main Menu


-Alarm thresholds:
-Partial pressure for gases - - - -"} - var/list/gases = list( + var/list/gas_names = list( "oxygen" = "O2", "carbon dioxide" = "CO2", "plasma" = "Toxin", - "other" = "Other", - ) - var/list/thresholds = list("min2", "min1", "max1", "max2") - var/datum/tlv/tlv - for (var/g in gases) - output += {" - -"} - tlv = TLV[g] - for (var/v in thresholds) - output += {" - -"} - output += {" - -"} - tlv = TLV["pressure"] - output += {" - -"} - for (var/v in thresholds) - output += {" - -"} - output += {" - -"} - tlv = TLV["temperature"] - output += {" - -"} - for (var/v in thresholds) - output += {" - -"} - output += {" - -"} - output += {"
min2min1max1max2
[gases[g]] -[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] -
Pressure -[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] -
Temperature -[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] -
"} + "other" = "Other") + for (var/g in gas_names) + thresholds[thresholds.len + 1] = list("name" = gas_names[g], "settings" = list()) + selected = TLV[g] + for(var/i = 1, i <= 4, i++) + thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = i, "selected" = selected[i])) - return output + selected = TLV["pressure"] + thresholds[++thresholds.len] = list("name" = "Pressure", "settings" = list()) + for(var/i = 1, i <= 4, i++) + thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = i, "selected" = selected[i])) + + selected = TLV["temperature"] + thresholds[++thresholds.len] = list("name" = "Temperature", "settings" = list()) + for(var/i = 1, i <= 4, i++) + thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = i, "selected" = selected[i])) + + + data["thresholds"] = thresholds /obj/machinery/alarm/Topic(href, href_list) if(..()) return usr.set_machine(src) + if (locked && !usr.has_unlimited_silicon_privilege) + return + if ( (get_dist(src, usr) > 1 )) if (!istype(usr, /mob/living/silicon)) usr.unset_machine() usr << browse(null, "window=air_alarm") return - + if(href_list["toggleaccess"]) + if(usr.has_unlimited_silicon_privilege && !wires.IsIndexCut(AALARM_WIRE_IDSCAN)) + locked = !locked if(href_list["command"]) var/device_id = href_list["id_tag"] switch(href_list["command"]) + if("set_external_pressure") + var/input_pressure = input("What pressure you like the system to mantain?", "Pressure Controls") as num|null + if(isnum(input_pressure)) + send_signal(device_id, list(href_list["command"] = input_pressure)) + return 1 + + if("reset_external_pressure") + send_signal(device_id, list(href_list["command"] = ONE_ATMOSPHERE)) + return 1 if( "power", "adjust_external_pressure", - "set_external_pressure", - "checks", "co2_scrub", "tox_scrub", "n2o_scrub", @@ -577,12 +430,18 @@ table tr:first-child th:first-child { border: none;} spawn(3) src.updateUsrDialog() + if ("excheck") + send_signal(device_id, list ("checks" = text2num(href_list["val"])^1)) + + if ("incheck") + send_signal(device_id, list ("checks" = text2num(href_list["val"])^2)) + //if("adjust_threshold") //was a good idea but required very wide window if("set_threshold") var/env = href_list["env"] var/varname = href_list["var"] var/datum/tlv/tlv = TLV[env] - var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null + var/newval = input("Enter [varname] for [env]", "Alarm triggers", tlv.vars[varname]) as num|null if (isnull(newval) || ..() || (locked && !(usr.has_unlimited_silicon_privilege))) return diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 3004a7a4389..eea599dd0f0 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -257,32 +257,34 @@ update_flag return src.attack_hand(user) /obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob) - return src.interact(user) + return src.ui_interact(user) -/obj/machinery/portable_atmospherics/canister/interact(var/mob/user as mob) +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main") if (src.destroyed) return - user.set_machine(src) - var/holding_text - if(holding) - holding_text = {"
Tank Pressure: [holding.air_contents.return_pressure()] KPa
-Remove Tank
-"} - var/output_text = {"[name][can_label?" relabel":""]
-Pressure: [air_contents.return_pressure()] KPa
-Port Status: [(connected_port)?("Connected"):("Disconnected")] -[holding_text] -
-Release Valve: [valve_open?("Open"):("Closed")]
-Release Pressure: - - - - [release_pressure] + + + +
-
-Close
-"} + var/data = list() + data["name"] = src.name + data["canLabel"] = src.can_label ? 1 : 0 + data["portConnected"] = src.connected_port ? 1 : 0 + data["tankPressure"] = round(src.air_contents.return_pressure() ? src.air_contents.return_pressure() : 0) + data["releasePressure"] = round(src.release_pressure ? src.release_pressure : 0) + data["minReleasePressure"] = round(ONE_ATMOSPHERE/10) + data["maxReleasePressure"] = round(10*ONE_ATMOSPHERE) + data["valveOpen"] = src.valve_open ? 1 : 0 - user << browse("[src][output_text]", "window=canister;size=600x300") - onclose(user, "canister") - return + data["hasHoldingTank"] = src.holding ? 1 : 0 + if (holding) + data["holdingTank"] = list("name" = src.holding.name, "tankPressure" = round(src.holding.air_contents.return_pressure())) + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "canister.tmpl", "Canister", 480, 400) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 63d46028ba5..76ce25a17ba 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -1,3 +1,6 @@ +#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE) +#define TANK_DEFAULT_RELEASE_PRESSURE (ONE_ATMOSPHERE*O2STANDARD) + /obj/item/weapon/tank name = "tank" icon = 'icons/obj/tank.dmi' @@ -90,24 +93,54 @@ /obj/item/weapon/tank/attack_self(mob/user as mob) if (!(src.air_contents)) return - user.set_machine(src) + + ui_interact(user) + +/obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main") + var/mob/living/carbon/location = null + + if(istype(loc, /mob/living/carbon)) + location = loc + else if(istype(loc.loc, /mob/living/carbon)) + location = loc.loc var/using_internal - if(istype(loc,/mob/living/carbon)) - var/mob/living/carbon/location = loc + if(istype(location)) if(location.internal==src) using_internal = 1 - var/message = {" -Tank
-Tank Pressure: [air_contents.return_pressure()]
-
-Mask Release Pressure: - - [distribute_pressure] + +
-Mask Release Valve: [using_internal?("Open"):("Closed")] -"} - user << browse(message, "window=tank;size=600x300") - onclose(user, "tank") - return + // this is the data which will be sent to the ui + var/data = list() + data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) + data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0) + data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE) + data["maxReleasePressure"] = round(TANK_MAX_RELEASE_PRESSURE) + data["valveOpen"] = using_internal ? 1 : 0 + + data["maskConnected"] = 0 + + if(istype(location)) + var/mask_check = 0 + + if(location.internal == src) // if tank is current internal + mask_check = 1 + else if(src in location) // or if tank is in the mobs possession + if(!location.internal) // and they do not have any active internals + mask_check = 1 + + if(mask_check) + if(location.wear_mask && (location.wear_mask.flags & MASKINTERNALS)) + data["maskConnected"] = 1 + + var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key) + if (!ui) + ui = new /datum/nanoui(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + else + ui.push_data(data) + /obj/item/weapon/tank/Topic(href, href_list) ..() @@ -116,8 +149,13 @@ if (src.loc == usr) usr.set_machine(src) if (href_list["dist_p"]) - var/cp = text2num(href_list["dist_p"]) - src.distribute_pressure += cp + if (href_list["dist_p"] == "reset") + src.distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE + else if (href_list["dist_p"] == "max") + src.distribute_pressure = TANK_MAX_RELEASE_PRESSURE + else + var/cp = text2num(href_list["dist_p"]) + src.distribute_pressure += cp src.distribute_pressure = min(max(round(src.distribute_pressure), 0), 3*ONE_ATMOSPHERE) if (href_list["stat"]) if(istype(loc,/mob/living/carbon)) diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index 07a6a4570dc..09b8a4796be 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -141,7 +141,8 @@ return 0 // wasn't open processing_uis.Remove(ui) - ui.user.open_uis.Remove(ui) + if(ui.user) // Sanity check in case a user has been deleted (say a blown up borg watching the alarm interface) + ui.user.open_uis.Remove(ui) var/list/uis = open_uis[src_object_key][ui.ui_key] return uis.Remove(ui) diff --git a/nano/css/shared.css b/nano/css/shared.css index 8f7110ee152..a2fa3507d55 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -29,9 +29,18 @@ a, a:link, a:visited, a:active, .link, .linkOn, .linkOff, .selected, .disabled .link { - float: left; - min-width: 40px; - height: 16px; + float: left; + min-width: 15px; + 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; + white-space: nowrap; } a:hover, .linkActive:hover @@ -218,6 +227,10 @@ h4 font-weight: bold; } +.redButton { + background: #ea0000; +} + .highlight { color: #8BA5C4; @@ -228,6 +241,15 @@ h4 color: #272727; } +.noticePlaceholder { + position: relative; + font-size: 12px; + font-style: italic; + font-weight: bold; + padding: 3px 4px 3px 4px; + margin: 4px 0 4px 0; +} + .notice { background: url(uiNoticeBackground.jpg) 0 0 repeat; diff --git a/nano/templates/air_alarm.tmpl b/nano/templates/air_alarm.tmpl new file mode 100644 index 00000000000..3cb010ea411 --- /dev/null +++ b/nano/templates/air_alarm.tmpl @@ -0,0 +1,199 @@ + +
+ {{if siliconUser}} +
+ Interface Lock: +
+
+ {{:~link('Engaged', 'locked', {'toggleaccess' : 1}, locked ? 'selected' : null)}}{{:~link('Disengaged', 'unlocked', {'toggleaccess' : 1}, (locked ? null : 'selected'))}} +
+ {{else}} + {{if locked}} + Swipe an ID card to unlock this interface. + {{else}} + Swipe an ID card to lock this interface. + {{/if}} + {{/if}} +
+
+

Air Status

+{{if environment_data}} + {{for environment_data}} + {{:name}} + {{if danger_level == 2}} + + {{else danger_level == 1}} + + {{else}} + + {{/if}} + {{:~round(value*100)/100}} + {{:unit}}
+ {{/for}} + Local Status: {{if danger_level == 2}} + DANGER: Internals Required + {{else danger_level == 1}} + Caution + {{else}} + Optimal + {{/if}} +
+ Area Status: {{if atmos_alarm}}Atmosphere alert in area{{else fire_alarm}}Fire alarm in area{{else}}No alerts{{/if}} +{{else}} + Warning: Cannot obtain air sample for analysis. +{{/if}} +{{if dangerous}} +
NOTICE: Safety measures nonfunctional. Device may exhibit abnormal behavior. +{{/if}} +
+{{if (!locked || siliconUser)}} + {{if screen != 1}} +
{{:~link('Main Menu', null, { 'screen' : 1})}}
+ {{/if}} + {{if screen == 1}} +
+ {{if atmos_alarm}} + {{:~link('Reset - Area Atmospheric Alarm', null, { 'atmos_reset' : 1})}} + {{else}} + {{:~link('Activate - Area Atmospheric Alarm', null, { 'atmos_alarm' : 1})}} + {{/if}} +
+
+
+ {{:~link('Scrubbers Control', null, { 'screen' : 3})}} +
+
+ {{:~link('Vents Control', null, { 'screen' : 2})}} +
+
+ {{:~link('Set Environmental Mode', null, { 'screen' : 4})}} +
+
+ {{:~link('Sensor Settings', null, { 'screen' : 5})}} +
+
+ {{if mode==3}} + {{:~link('PANIC SIPHON ACTIVE - Turn siphoning off', null, { 'mode' : 1}, null, 'redButton')}} + {{else}} + {{:~link('ACTIVATE PANIC SIPHON IN AREA', null, { 'mode' : 3}, null, 'yellowButton')}} + {{/if}} + {{else screen == 2}} + {{for vents}} +
{{:long_name}}
+
+
+ Operating: +
+
+ {{:~link(power ? 'On' : 'Off', null, { 'id_tag' : id_tag, 'command' : 'power', 'val' : power ? 0 : 1}, null, power ? null : 'redButton')}} +
+
+
+
+ Mode: +
+
+ {{:direction == "siphon" ? 'Siphoning' : 'Pressurizing'}} +
+
+
+
+ Pressure Checks: +
+
+ {{:~link('External', null, { 'id_tag' : id_tag, 'command' : 'excheck', 'val' : excheck}, null, excheck ? 'selected' : null)}} + {{:~link('Internal', null, { 'id_tag' : id_tag, 'command' : 'incheck', 'val' : incheck}, null, incheck ? 'selected' : null)}} +
+
+
+
+ External Pressure Bound: +
+
+ {{:~link(~round(external*100)/100, null, { 'id_tag' : id_tag, 'command' : 'set_external_pressure'})}} + {{:~link('Reset', null, { 'id_tag' : id_tag, 'command' : 'reset_external_pressure'})}} +
+
+
+ {{/for}} + {{if !vents.length}} + No vents connected. + {{/if}} + {{else screen == 3}} + {{for scrubbers}} +
{{:long_name}}
+
+
+ Operating: +
+
+ {{:~link(power ? 'On' : 'Off', null, { 'id_tag' : id_tag, 'command' : 'power', 'val' : power ? 0 : 1}, null, power ? null : 'redButton')}} +
+
+
+
+ Mode: +
+
+ {{:~link(scrubbing ? 'Scrubbing' : 'Siphoning', null, { 'id_tag' : id_tag, 'command' : 'scrubbing', 'val' : scrubbing ? 0 : 1}, null, scrubbing ? null : 'redButton')}} +
+
+
+
+ Filters: +
+
+ {{:~link("Carbon Dioxide", null, { 'id_tag' : id_tag, 'command' : "co2_scrub", 'val' : filter_co2 ? 0 : 1}, null, filter_co2 ? 'selected' : null)}}
+ {{:~link("Plasma", null, { 'id_tag' : id_tag, 'command' : "tox_scrub", 'val' : filter_toxins ? 0 : 1}, null, filter_toxins ? 'selected' : null)}}
+ {{:~link("Nitrous Oxide", null, { 'id_tag' : id_tag, 'command' : "n2o_scrub", 'val' : filter_n2o ? 0 : 1}, null, filter_n2o ? 'selected' : null)}}
+
+
+
+ {{/for}} + {{if !scrubbers.length}} + No scrubbers connected. + {{/if}} + {{else screen == 4}} +

Environmental Modes

+ {{for modes}} +
+ {{:~link(name, null, { 'mode' : mode }, null, selected ? (danger ? 'redButton' : 'selected') : null)}} +
+ {{/for}} + {{else screen == 5}} +

Alarm Threshold

+ Partial pressure for gases. + + + + + {{for thresholds}} + + + {{for settings.settingsValue.settingsIndex}} + + {{/for}} + + {{/for}} +
min2min1max1max2
{{:name}} + {{:~link(settingsValue.selected >= 0 ? fixed(settingsValue.selected, 2) : "Off", null, { 'command' : 'set_threshold', 'env' : settingsValue.env, 'var' : settingsValue.val })}} +
+ {{/if}} +{{/if}} \ No newline at end of file diff --git a/nano/templates/atmos_filter.tmpl b/nano/templates/atmos_filter.tmpl new file mode 100644 index 00000000000..24ee5c8c75f --- /dev/null +++ b/nano/templates/atmos_filter.tmpl @@ -0,0 +1,51 @@ +
+
+ Power: +
+
+ {{:~link(on? 'On' : 'Off', null, {'power' : 1})}} +
+
+
+
+ Output pressure: +
+
+
+ {{:~link('MAX', null, {'set_press' : 'max'}, null)}} + {{:~link('SET', null, {'set_press' : 'set'}, null)}} +
 {{:(pressure_set/100)}} kPa 
+
+
+
+

Filter Type

+
+
+ {{:~link('Plasma', null, {'filterset' : 0}, (filter_type == 0)? 'selected' : null)}} +
+
+
+
+ {{:~link('Oxygen', null, {'filterset' : 1}, (filter_type == 1)? 'selected' : null)}} +
+
+
+
+ {{:~link('Nitrogen', null, {'filterset' : 2}, (filter_type == 2)? 'selected' : null)}} +
+
+
+
+ {{:~link('Carbon Dioxide', null, {'filterset' : 3}, (filter_type == 3)? 'selected' : null)}} +
+
+
+
+ {{:~link('Nitrous Oxide', null, {'filterset' : 4}, (filter_type == 4)? 'selected' : null)}} +
+
+
+
+ {{:~link('Nothing', null, {'filterset' : -1}, (filter_type == -1)? 'selected' : null)}} +
+
\ No newline at end of file diff --git a/nano/templates/atmos_gas_pump.tmpl b/nano/templates/atmos_gas_pump.tmpl new file mode 100644 index 00000000000..833bc7046cb --- /dev/null +++ b/nano/templates/atmos_gas_pump.tmpl @@ -0,0 +1,36 @@ +
+
+ Power: +
+
+ {{:~link(on? 'On' : 'Off', null, {'power' : 1})}} +
+
+ +{{if max_rate}} +
+
+ Transfer rate: +
+
+
+ {{:~link('MAX', null, {'set_transfer_rate' : 'max'}, null)}} + {{:~link('SET', null, {'set_transfer_rate' : 'set'}, null)}} +
 {{:(transfer_rate/100)}} L/s 
+
+
+
+{{else}} +
+
+ Output pressure: +
+
+
+ {{:~link('MAX', null, {'set_press' : 'max'}, null)}} + {{:~link('SET', null, {'set_press' : 'set'}, null)}} +
 {{:(pressure_set/100)}} kPa 
+
+
+
+{{/if}} \ No newline at end of file diff --git a/nano/templates/atmos_mixer.tmpl b/nano/templates/atmos_mixer.tmpl new file mode 100644 index 00000000000..efc98565b90 --- /dev/null +++ b/nano/templates/atmos_mixer.tmpl @@ -0,0 +1,51 @@ +
+
+ Power: +
+
+ {{:~link(on? 'On' : 'Off', null, {'power' : 1})}} +
+
+ +
+
+ Output pressure: +
+
+
+ {{:~link('MAX', null, {'set_press' : 'max'}, null)}} + {{:~link('SET', null, {'set_press' : 'set'}, null)}} +
 {{:(pressure_set/100)}} kPa 
+
+
+
+ +
+
+ Node 1 Concentration: +
+
+
+ {{:~link('-', null, {'node1_c' : '-0.1'}, null)}} + {{:~link('-', null, {'node1_c' : '-0.01'}, null)}} +
 {{:node1_concentration}} % 
+ {{:~link('+', null, {'node1_c' : '0.01'}, null)}} + {{:~link('+', null, {'node1_c' : '0.1'}, null)}} +
+
+
+ +
+
+ Node 2 Concentration: +
+
+
+ {{:~link('-', null, {'node2_c' : '-0.1'}, null)}} + {{:~link('-', null, {'node2_c' : '-0.01'}, null)}} +
 {{:node2_concentration}} % 
+ {{:~link('+', null, {'node2_c' : '0.01'}, null)}} + {{:~link('+', null, {'node2_c' : '0.1'}, null)}} +
+
+
\ No newline at end of file diff --git a/nano/templates/canister.tmpl b/nano/templates/canister.tmpl new file mode 100644 index 00000000000..1f67d608e5b --- /dev/null +++ b/nano/templates/canister.tmpl @@ -0,0 +1,83 @@ +

Tank Status

+
+
+ Tank Label: +
+
+
{{:name}}
{{:~link('Relabel', 'pencil', {'relabel' : 1}, canLabel ? null : 'disabled')}} +
+
+ +
+
+ Tank Pressure: +
+
+ {{:tankPressure}} kPa +
+
+ +
+
+ Port Status: +
+
+ {{:portConnected ? 'Connected' : 'Disconnected'}} +
+
+ +

Holding Tank Status

+{{if hasHoldingTank}} +
+
+ Tank Label: +
+
+
{{:holdingTank.name}}
{{:~link('Eject', 'eject', {'remove_tank' : 1})}} +
+
+ +
+
+ Tank Pressure: +
+
+ {{:holdingTank.tankPressure}} kPa +
+
+{{else}} +
No holding tank inserted.
+
 
+{{/if}} + + +

Release Valve Status

+
+
+ Release Pressure: +
+
+ {{:~displayBar(releasePressure, minReleasePressure, maxReleasePressure)}} +
+ {{:~link('-', null, {'pressure_adj' : -1000}, (releasePressure > minReleasePressure) ? null : 'disabled')}} + {{:~link('-', null, {'pressure_adj' : -100}, (releasePressure > minReleasePressure) ? null : 'disabled')}} + {{:~link('-', null, {'pressure_adj' : -10}, (releasePressure > minReleasePressure) ? null : 'disabled')}} + {{:~link('-', null, {'pressure_adj' : -1}, (releasePressure > minReleasePressure) ? null : 'disabled')}} +
 {{:releasePressure}} kPa 
+ {{:~link('+', null, {'pressure_adj' : 1}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('+', null, {'pressure_adj' : 10}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('+', null, {'pressure_adj' : 100}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('+', null, {'pressure_adj' : 1000}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} +
+
+
+ +
+
+ Release Valve: +
+
+ {{:~link('Open', 'unlocked', {'toggle' : 1}, valveOpen ? 'selected' : null)}}{{:~link('Close', 'locked', {'toggle' : 1}, valveOpen ? null : 'selected')}} +
+
+ diff --git a/nano/templates/tanks.tmpl b/nano/templates/tanks.tmpl new file mode 100644 index 00000000000..6aa259fd145 --- /dev/null +++ b/nano/templates/tanks.tmpl @@ -0,0 +1,47 @@ +{{if maskConnected}} +
This tank is connected to a mask.
+{{else}} +
This tank is NOT connected to a mask.
+{{/if}} + +
+
+ Tank Pressure: +
+
+ {{:~displayBar(tankPressure, 0, 1013, (tankPressure > 200) ? 'good' : ((tankPressure > 100) ? 'average' : 'bad'))}} +
+ {{:tankPressure}} kPa +
+
+
+ +
 
+ +
+
+ Mask Release Pressure: +
+
+ {{:~displayBar(releasePressure, 0, maxReleasePressure, (releasePressure >= 23) ? null : ((releasePressure >= 17) ? 'average' : 'bad'))}} +
+ {{:~link('-', null, {'dist_p' : -5}, (releasePressure > 0) ? null : 'disabled')}} + {{:~link('-', null, {'dist_p' : -1}, (releasePressure > 0) ? null : 'disabled')}} +
 {{:releasePressure}} kPa 
+ {{:~link('+', null, {'dist_p' : 1}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('+', null, {'dist_p' : 5}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('Max', null, {'dist_p' : 'max'}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:~link('Reset', null, {'dist_p' : 'reset'}, (releasePressure != defaultReleasePressure) ? null : 'disabled')}} +
+
+
+ +
+
+ Mask Release Valve: +
+
+ {{:~link('Open', 'unlocked', {'stat' : 1}, (!maskConnected) ? 'disabled' : (valveOpen ? 'selected' : null))}}{{:~link('Close', 'locked', {'stat' : 1}, valveOpen ? null : 'selected')}} +
+
+