fix merge

This commit is contained in:
edo-neo 2024-10-25 09:18:10 +02:00
parent cb9abeb46f
commit 32e858f0f7
2 changed files with 14 additions and 8 deletions

View File

@ -448,14 +448,14 @@ class Test(Widget):
leak1_index = step_types.index("leak_1")
leak2_index = step_types.index("leak_2")
if leak1_index + 1 == leak2_index: # Ensure 'leak_1' is immediately followed by 'leak_2'
steps.insert(leak2_index, Steps(type="instruction_extra", spec={}))
steps.insert(leak2_index, Step(step_type="instruction_extra", spec={}))
inserted_instruction = True
# Insert 'instruction_extra' after the first 'instructions' if not inserted between leaks
if not inserted_instruction:
for i, step in enumerate(steps):
if step.type == "instructions":
steps.insert(i + 1, Steps(type="instruction_extra", spec={}))
steps.insert(i + 1, Step(step_type="instruction_extra", spec={}))
inserted_instruction = True
break

View File

@ -12,13 +12,14 @@ from ui.test_test import Test_Test
VALVE_TIME=0.5
class Test_Leak(Test_Test):
def __init__(self, components=None, recipe=None, step=None, pieces=None, run_once=False, reset_on_start=True, enable_override=False,parent=None):
def __init__(self, config,components=None, recipe=None, step=None, pieces=None, run_once=False, reset_on_start=True, enable_override=False,parent=None):
super().__init__(components=components, recipe=recipe, step=step, pieces=pieces, run_once=run_once, reset_on_start=reset_on_start, enable_override=enable_override)
self.get_connection = None
self.io_ok = True
self.blow_on = False
self.parent=parent
self.step=step
self.config = config
self.recipe_written = False
self.start_b.clicked.connect(self.start_test)
self.stop_b.clicked.connect(self.stop_test)
@ -143,11 +144,16 @@ class Test_Leak(Test_Test):
time.sleep(2)
# AUTO START SECOND TEST
if step.step_type == "leak_2":
self.recipe_written = False
time.sleep(1)
self.start_b.setEnabled(True)
self.start_b.click()
if step.type == "leak_2":
if self.config["hardware_config"].get("dual_chanel", "absent") == "present":
self.recipe_written = False
time.sleep(1)
self.start_b.setEnabled(True)
self.start_b.click()
else:
self.recipe_written = False
time.sleep(1)
self.start_b.setEnabled(True)
return show