Excessive code cleanup
This commit is contained in:
parent
367714cb4f
commit
9e6272d1ee
@ -18,53 +18,57 @@ alias filter1 r1
|
|||||||
alias filter2 r2
|
alias filter2 r2
|
||||||
alias tank_press r3
|
alias tank_press r3
|
||||||
alias button r4
|
alias button r4
|
||||||
alias temp_run r5
|
alias filter_run r5
|
||||||
alias press_run r6
|
alias filter_test r6
|
||||||
alias filter_run r7
|
alias purge_run r7
|
||||||
alias purge_run r8
|
alias has_gas r8
|
||||||
|
|
||||||
define MAX_PRESS 58000 # 58MPa
|
define MAX_PRESS 58000 # 58MPa
|
||||||
define MAX_TEMP 313 # 40C
|
define MAX_TEMP 313 # 40C
|
||||||
|
|
||||||
l filter1 purge_pump Maximum # borrow filter1
|
l r9 purge_pump Maximum
|
||||||
s purge_pump Setting filter1 # set max throughput
|
s purge_pump Setting r9
|
||||||
|
|
||||||
s filter_display Color 4 # red
|
s filter_display Color 4 # red
|
||||||
|
|
||||||
start:
|
start:
|
||||||
yield
|
yield
|
||||||
s purge_pump On 0 # ensure pump is off
|
s purge_pump On 0
|
||||||
ls filter1 filter_unit 0 Quantity # check r-filter
|
ls filter1 filter_unit 0 Quantity
|
||||||
ls filter2 filter_unit 1 Quantity # check l-filter
|
ls filter2 filter_unit 1 Quantity
|
||||||
beqz filter1 swap_filter_1 # right filter spent
|
beqz filter1 swap_filter_1
|
||||||
beqz filter2 swap_filter_2 # left filter spent
|
beqz filter2 swap_filter_2
|
||||||
s filter_display On 0 # turn off filter display
|
s filter_display On 0
|
||||||
l purge_run purge_button Setting # check purge
|
l purge_run purge_button Setting
|
||||||
bgtz purge_run purge # run purge if triggered
|
bgtz purge_run purge
|
||||||
j filter # or start filtering
|
j filter
|
||||||
|
|
||||||
swap_filter_1: # if right filter needs swapping
|
swap_filter_1: # if right filter needs swapping
|
||||||
s filter_display Setting 1
|
s filter_display Setting 1
|
||||||
s filter_display On 1
|
s filter_display On 1
|
||||||
j filter # then start filtering
|
j filter # then continue filtering
|
||||||
|
|
||||||
swap_filter_2: # if left filter needs swapping
|
swap_filter_2: # if left filter needs swapping
|
||||||
s filter_display Setting 2
|
s filter_display Setting 2
|
||||||
s filter_display On 1
|
s filter_display On 1
|
||||||
j filter # then start filtering
|
j filter # then continue filtering
|
||||||
|
|
||||||
filter:
|
filter:
|
||||||
l mud_temp mud_sensor Temperature # get input temp
|
l mud_temp mud_sensor Temperature
|
||||||
l tank_press tank Pressure # get output pressure
|
l tank_press tank Pressure
|
||||||
slt temp_run mud_temp MAX_TEMP # is temp safe
|
l has_gas mud_sensor RatioCarbonDioxide
|
||||||
slt press_run tank_press MAX_PRESS # is press safe
|
sgtz has_gas has_gas
|
||||||
and filter_run temp_run press_run # temp and press?
|
slt filter_run mud_temp MAX_TEMP
|
||||||
s filter_unit On filter_run # run filter
|
slt filter_test tank_press MAX_PRESS
|
||||||
j start # loop
|
and filter_run filter_run filter_test
|
||||||
|
and filter_run filter_run has_gas
|
||||||
|
s filter_unit On filter_run
|
||||||
|
j start
|
||||||
|
|
||||||
purge: # purge button pressed
|
purge:
|
||||||
yield
|
yield
|
||||||
s filter_unit On 0 # stop filtering
|
s filter_unit On 0
|
||||||
l tank_press tank Pressure # check pressure
|
l tank_press tank Pressure
|
||||||
s purge_pump On 1 # run evac-pump
|
s purge_pump On 1
|
||||||
bgtz tank_press purge # keep sucking until tank dry
|
bgtz tank_press purge
|
||||||
j start # begin filtering
|
j start
|
Loading…
Reference in New Issue
Block a user