Skip to content

Commit c272d39

Browse files
committed
fix 1ch diagnostic test
1 parent 37ddb1e commit c272d39

File tree

2 files changed

+45
-5
lines changed
  • hardware-testing/hardware_testing

2 files changed

+45
-5
lines changed

hardware-testing/hardware_testing/data/ui.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
PRINT_HEADER_DASHES = "-" * PRINT_HEADER_NUM_SPACES
77
PRINT_TITLE_POUNDS = "#" * PRINT_HEADER_NUM_SPACES
88
PRINT_HEADER_SPACES = " " * (PRINT_HEADER_NUM_SPACES - 1)
9-
PRINT_HEADER_ASTERISK = "*"
9+
PRINT_HEADER_ASTERISK = "*" * PRINT_HEADER_NUM_SPACES
1010

1111

1212
def get_user_answer(question: str) -> bool:
@@ -72,3 +72,43 @@ def print_warning(message: str) -> None:
7272
def print_info(message: str) -> None:
7373
"""Print information."""
7474
print(message)
75+
76+
def print_fail (message: str) -> None:
77+
"""print fail"""
78+
length = len(message)
79+
dashes = PRINT_HEADER_DASHES + ("-" * length) + PRINT_HEADER_DASHES
80+
middle = f"|{PRINT_HEADER_SPACES}{message}{PRINT_HEADER_SPACES}|"
81+
#print(f"\n{dashes}\n{middle}\n{dashes}\n")
82+
print(f'\033[1;31m\n -FAIL- {dashes} \n{middle}\n{dashes}\n\033[0m')
83+
84+
def print_test_results (message: str,passval:bool) -> None:
85+
"""print fail"""
86+
PRINT_HEADER_ASTERISK = "*" * PRINT_HEADER_NUM_SPACES
87+
length = len(message)
88+
dashes = PRINT_HEADER_ASTERISK + ("*" * length) + PRINT_HEADER_ASTERISK
89+
middle = f"|{PRINT_HEADER_SPACES}{message}{PRINT_HEADER_SPACES}|"
90+
#print(f"\n{dashes}\n{middle}\n{dashes}\n")
91+
if passval:
92+
print(f'\033[4;32m\n 测试结果 {dashes} \n{middle}\n{dashes}\n\033[0m')
93+
else:
94+
print(f'\033[1;31m\n 测试结果 {dashes} \n{middle}\n{dashes}\n\033[0m')
95+
96+
def print_results (message: str,passval:bool) -> None:
97+
""""test results list"""
98+
if passval:
99+
print(f'\033[4;32m\n 测试结果PASS ')
100+
print(f'{dashes}\n\033[0m')
101+
else:
102+
max_length = max(len(item) for item in message)
103+
104+
PRINT_HEADER_ASTERISK = "*" * PRINT_HEADER_NUM_SPACES
105+
dashes = PRINT_HEADER_ASTERISK + ("*" * max_length) + PRINT_HEADER_ASTERISK
106+
107+
middle = [
108+
f"|{PRINT_HEADER_SPACES}{item.center(max_length)}{PRINT_HEADER_SPACES}|"
109+
for item in message
110+
]
111+
print(f'\033[1;31m\n 测试结果FAIL {dashes} ')
112+
for line in middle:
113+
print(line)
114+
print(f'{dashes}\n\033[0m')

hardware-testing/hardware_testing/production_qc/pipette_assembly_qc_ot3/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ async def _read_cap(_sensor_id: SensorId) -> float:
12081208
probe_pos += Point(13, 13, 0)
12091209
if sensor_id == SensorId.S1:
12101210
probe_pos += Point(x=0, y=9 * 7, z=0)
1211-
await api.add_tip(mount, api.config.calibration.probe_length)
1211+
api.add_tip(mount, api.config.calibration.probe_length)
12121212
#print(f"Moving to: {probe_pos}")
12131213
LOG_GING.info(f"Moving to: {probe_pos}")
12141214
# start probe 5mm above deck
@@ -1248,7 +1248,7 @@ async def _read_cap(_sensor_id: SensorId) -> float:
12481248
await api.home_z(mount)
12491249
if not api.is_simulator:
12501250
_get_operator_answer_to_question('REMOVE the probe, enter "y" when removed')
1251-
await api.remove_tip(mount)
1251+
api.remove_tip(mount)
12521252

12531253
return all(results)
12541254

@@ -1265,9 +1265,9 @@ async def _test_diagnostics_pressure(
12651265
sensor_ids = [SensorId.S0]
12661266
if pip.channels == 8:
12671267
sensor_ids.append(SensorId.S1)
1268-
await api.add_tip(mount, 0.1)
1268+
api.add_tip(mount, 0.1)
12691269
await api.prepare_for_aspirate(mount)
1270-
await api.remove_tip(mount)
1270+
api.remove_tip(mount)
12711271

12721272
async def _read_pressure(_sensor_id: SensorId) -> float:
12731273
return await _read_pipette_sensor_repeatedly_and_average(

0 commit comments

Comments
 (0)