2021-08-29 21:38:49 +00:00
|
|
|
# needs two volume pumps and a pipe analyzer
|
|
|
|
# fill_pump points to the tank storage
|
|
|
|
# evac_pump points back to the gas-feed
|
|
|
|
# analyzer is on a pipe between punps and tank
|
2021-08-29 21:26:24 +00:00
|
|
|
# !!! Remember to set volume pump to 10l !!!
|
2021-08-29 13:07:24 +00:00
|
|
|
|
2021-08-30 11:28:41 +00:00
|
|
|
alias tank_stor d0
|
2021-08-29 21:10:21 +00:00
|
|
|
alias fill_pump d1
|
|
|
|
alias evac_pump d2
|
2021-08-29 21:26:24 +00:00
|
|
|
alias analyzer d3
|
2021-08-29 13:07:24 +00:00
|
|
|
|
2021-08-30 11:28:41 +00:00
|
|
|
alias tank_in r0
|
2021-08-29 21:26:24 +00:00
|
|
|
alias tank_hash r1
|
2021-08-30 11:28:41 +00:00
|
|
|
alias stor_press r2
|
|
|
|
alias gas_move r3
|
|
|
|
alias fill_press r4
|
2021-08-29 13:07:24 +00:00
|
|
|
|
2021-08-29 21:26:24 +00:00
|
|
|
define canister_hash 42280099
|
|
|
|
define smart_canister_hash -668314371
|
2021-08-29 19:37:16 +00:00
|
|
|
|
|
|
|
start:
|
2021-08-30 11:28:41 +00:00
|
|
|
ls tank_in tank_stor 0 Occupied # check tank in
|
|
|
|
|
|
|
|
beqz tank_in evac
|
|
|
|
bgtz tank_in setpress
|
|
|
|
|
|
|
|
evac:
|
|
|
|
l stor_press analyzer Pressure # get pipe pressure
|
|
|
|
s evac_pump On 1 # run evac_pump
|
|
|
|
s fill_pump On 0 # stop fill_pump
|
|
|
|
bgtz stor_press evac # pressure >0, evac more
|
|
|
|
# else, shut off evac_pump and go to start
|
|
|
|
s evac_pump On 0
|
|
|
|
j start
|
|
|
|
|
|
|
|
setpress:
|
|
|
|
ls tank_hash tank_stor 0 OccupantHash # ident tank
|
2021-08-29 19:37:16 +00:00
|
|
|
# set safe fill-pressure
|
2021-08-29 21:26:24 +00:00
|
|
|
beq tank_hash canister_hash regular
|
|
|
|
beq tank_hash smart_canister_hash smart
|
2021-08-29 19:37:16 +00:00
|
|
|
|
|
|
|
regular:
|
2021-08-30 11:28:41 +00:00
|
|
|
move fill_press 8000000 # regular tank safe max
|
2021-08-29 19:37:16 +00:00
|
|
|
j fill # start filling
|
|
|
|
|
|
|
|
smart:
|
2021-08-30 11:28:41 +00:00
|
|
|
move fill_press 18000000 # smart tank safe max
|
2021-08-29 19:37:16 +00:00
|
|
|
j fill # start filling
|
|
|
|
|
2021-08-30 11:28:41 +00:00
|
|
|
fill:
|
|
|
|
ls stor_press tank_stor 0 Pressure # get tank press
|
|
|
|
slt gas_move stor_press fill_press # room for more?
|
|
|
|
s fill_pump On gas_move # trigger fill pump
|
|
|
|
j start
|