diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index e29777e1dae..f056b2b690b 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -22,14 +22,13 @@ obj/machinery/atmospherics/binary/pump
var/on = 0
var/target_pressure = ONE_ATMOSPHERE
- //The maximum amount of volume in Liters the pump can transfer in 1 second.
- //This is limited by how fast the pump can spin without breaking, and means you can't instantly fill up the distro even when it's empty (at 10000, it will take about 15 seconds)
- var/max_volume_transfer = 10000
+ //var/max_volume_transfer = 10000
use_power = 1
idle_power_usage = 10 //10 W for internal circuitry and stuff
active_power_usage = 7500 //This also doubles as a measure of how powerful the pump is, in Watts. 7500 W ~ 10 HP
- last_power_draw = 0 //for UI
+ var/last_power_draw = 0 //for UI
+ var/max_pressure_setting = 9000 //kPa
var/frequency = 0
var/id = null
@@ -68,16 +67,17 @@ obj/machinery/atmospherics/binary/pump
return 0
var/output_starting_pressure = air2.return_pressure()
- if( (target_pressure - output_starting_pressure) < 0.01)
- //No need to pump gas if target is already reached!
+ if( (target_pressure - output_starting_pressure) < 0.01) //No need to pump gas if target is already reached!
update_power_usage(0)
return 1
var/output_volume = air2.volume
if (network2 && network2.air_transient)
- output_volume = network2.air_transient.volume
- output_volume = min(output_volume, max_volume_transfer)
+ output_volume = network2.air_transient.volume //note that the amount of gas in the adjacent pipe will still limit what we can transfer
+ //This is pointless since gas_mixure/remove() won't let as remove more than is in the adjacent pipe anyways and removing gas directly from the network is not going to work.
+ //output_volume = min(output_volume, max_volume_transfer)
+
//Calculate necessary moles to transfer using PV=nRT
if((air1.total_moles() > 0) && (air1.temperature > 0 || air2.temperature > 0))
var/air_temperature = (air2.temperature > 0)? air2.temperature : air1.temperature
@@ -86,7 +86,7 @@ obj/machinery/atmospherics/binary/pump
//estimate the amount of energy required
var/specific_entropy = air2.specific_entropy() - air1.specific_entropy() //air2 is gaining moles, air1 is loosing
- var/specific_power = 0
+ var/specific_power = 0 // W/mol
//src.visible_message("DEBUG: [src] >>> terminal pressures: sink = [air2.return_pressure()] kPa, source = [air1.return_pressure()] kPa")
//src.visible_message("DEBUG: [src] >>> specific entropy = [air2.specific_entropy()] - [air1.specific_entropy()] = [specific_entropy] J/K")
@@ -95,7 +95,7 @@ obj/machinery/atmospherics/binary/pump
if (specific_entropy < 0)
specific_power = -specific_entropy*air_temperature //how much power we need per mole
- //src.visible_message("DEBUG: [src] >>> limiting transfer_moles to [power_rating / (air_temperature * -specific_entropy)] mol")
+ //src.visible_message("DEBUG: [src] >>> limiting transfer_moles to [active_power_usage / specific_power] mol")
transfer_moles = min(transfer_moles, active_power_usage / specific_power)
//Actually transfer the gas
@@ -164,15 +164,43 @@ obj/machinery/atmospherics/binary/pump
use_power(usage_amount)
last_power_draw = usage_amount
+ if (use_power > 0)
+ last_power_draw = max(last_power_draw, idle_power_usage)
+
+ turn_on()
+ on = 1
+ update_use_power(1)
+
+ turn_off()
+ on = 0
+ last_power_draw = 0
+ update_use_power(0)
- interact(mob/user as mob)
- var/dat = {"Power: [on?"On":"Off"]
- Desirable output pressure:
- [round(target_pressure,0.1)]kPa | Change
- "}
+ ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
+
+ if(stat & (BROKEN|NOPOWER))
+ return
- user << browse("