stationeers_ic10/filtration.ic10

74 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-09-04 22:15:58 +00:00
# Complete filtration circuit that controls filter-
# unit, checks filters, maintains safe temperature
# and pressure.
#
# "Mud pipe" is the shared input-pipe for all
# filtration units, where all gasses are mixed into
# a "mud" before being filtered.
alias mud_sensor d0 # Pipe Analyzer
alias tank d1 # Tank
alias purge_button d2 # Logic (Switch)
alias purge_pump d3 # Volume (Turbo) Pump
alias filter_unit d4 # Kit (Atmospherics)
alias filter_display d5 # Kit (Console)
2021-09-04 21:53:19 +00:00
alias mud_temp r0
2021-09-05 15:21:23 +00:00
alias filter1 r1
alias filter2 r2
alias tank_press r3
alias button r4
2022-01-17 10:49:38 +00:00
alias filter_run r5
alias filter_test r6
alias purge_run r7
alias has_gas r8
2021-09-04 21:53:19 +00:00
2021-11-15 13:32:10 +00:00
define MAX_PRESS 58000 # 58MPa
define MAX_TEMP 313 # 40C
2021-09-04 21:53:19 +00:00
2022-01-17 10:49:38 +00:00
l r9 purge_pump Maximum
s purge_pump Setting r9
2021-09-04 22:15:58 +00:00
s filter_display Color 4 # red
2021-09-04 21:53:19 +00:00
start:
yield
2022-01-17 10:49:38 +00:00
s purge_pump On 0
ls filter1 filter_unit 0 Quantity
ls filter2 filter_unit 1 Quantity
beqz filter1 swap_filter_1
beqz filter2 swap_filter_2
s filter_display On 0
l purge_run purge_button Setting
bgtz purge_run purge
j filter
2021-09-04 22:15:58 +00:00
swap_filter_1: # if right filter needs swapping
2021-09-04 21:53:19 +00:00
s filter_display Setting 1
s filter_display On 1
2022-01-17 10:49:38 +00:00
j filter # then continue filtering
2021-09-04 21:53:19 +00:00
2021-09-04 22:15:58 +00:00
swap_filter_2: # if left filter needs swapping
2021-09-04 21:53:19 +00:00
s filter_display Setting 2
s filter_display On 1
2022-01-17 10:49:38 +00:00
j filter # then continue filtering
2021-09-04 21:53:19 +00:00
filter:
2022-01-17 10:49:38 +00:00
l mud_temp mud_sensor Temperature
l tank_press tank Pressure
l has_gas mud_sensor RatioCarbonDioxide
sgtz has_gas has_gas
slt filter_run mud_temp MAX_TEMP
slt filter_test tank_press MAX_PRESS
and filter_run filter_run filter_test
and filter_run filter_run has_gas
s filter_unit On filter_run
j start
2021-09-04 22:15:58 +00:00
2022-01-17 10:49:38 +00:00
purge:
2021-09-04 21:53:19 +00:00
yield
2022-01-17 10:49:38 +00:00
s filter_unit On 0
l tank_press tank Pressure
s purge_pump On 1
bgtz tank_press purge
j start