Cleaned automatic tests
This commit is contained in:
parent
fcab8ac473
commit
41323eb016
25
main.py
25
main.py
|
|
@ -271,9 +271,6 @@ def is_connected():
|
|||
|
||||
# PU CONTROL
|
||||
|
||||
# --- helpers.py (or in the same file if you want) ---
|
||||
|
||||
|
||||
def validate_state(state: str) -> str:
|
||||
"""Normalize and validate the requested state."""
|
||||
state = state.upper()
|
||||
|
|
@ -543,7 +540,8 @@ async def stop_auto_test(pu: int):
|
|||
async def run_auto_test_1(pu: int = 1):
|
||||
try:
|
||||
await send_command_with_delay("PRE-PRODUCTION", pu = pu, delay_s=0, ploop_setpoint=2.5, qperm_setpoint=1200.0)
|
||||
await set_patients_with_delay(5, delay_s=190)
|
||||
await asyncio.sleep(180) # Starting time of the machine
|
||||
await set_patients_with_delay(5, delay_s=10)
|
||||
await set_patients_with_delay(10, delay_s=20)
|
||||
await set_patients_with_delay(0, delay_s=20)
|
||||
await send_command_with_delay("IDLE", pu =pu, delay_s=20, ploop_setpoint=2.5, qperm_setpoint=1200.0)
|
||||
|
|
@ -559,31 +557,18 @@ async def run_auto_test_2():
|
|||
try:
|
||||
# Step 1: Run PU1 test
|
||||
# await run_auto_test_1(1, ploop_setpoint)
|
||||
|
||||
# Step 2: PU2 sequence
|
||||
await send_command_with_delay("PRE-PRODUCTION", pu=2, delay_s=0, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
# await send_command_with_delay("PRODUCTION", 2, delay_s=180, ploop_setpoint=ploop_setpoint)
|
||||
await set_patients_with_delay(15, delay_s=60)
|
||||
await set_patients_with_delay(0, delay_s=60)
|
||||
await send_command_with_delay("IDLE", pu=2, delay_s=60, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
await send_command_with_delay("IDLE", pu=1, delay_s=60, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
# TODO : TODO
|
||||
logging.info("[AUTO TEST] Finished PU1 + PU2 test")
|
||||
except asyncio.CancelledError:
|
||||
logging.info(f"[AUTO TEST] PU 2 task cancelled")
|
||||
# optional cleanup
|
||||
raise
|
||||
|
||||
async def run_auto_test_3(ploop_setpoint: float):
|
||||
async def run_auto_test_3():
|
||||
try:
|
||||
# Step 1: Run PU1 test
|
||||
# await run_auto_test_1()
|
||||
|
||||
# Step 2: PU2 sequence
|
||||
await send_command_with_delay("PRE-PRODUCTION", pu=2, delay_s=0, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
await set_patients_with_delay(15, delay_s=60)
|
||||
await set_patients_with_delay(0, delay_s=60)
|
||||
await send_command_with_delay("IDLE", pu=2, delay_s=60, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
await send_command_with_delay("IDLE", pu=1, delay_s=60, ploop_setpoint=ploop_setpoint, qperm_setpoint=1200.0)
|
||||
# TODO : TODO
|
||||
logging.info("[AUTO TEST] Finished PU1 + PU2 test")
|
||||
except asyncio.CancelledError:
|
||||
logging.info(f"[AUTO TEST] PU 2 task cancelled")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user