Skip to content

Commit 40d510b

Browse files
author
andy
committed
judge the leveling test result
1 parent 6ca6abc commit 40d510b

File tree

7 files changed

+21
-3
lines changed

7 files changed

+21
-3
lines changed

__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import subprocess
33

4-
VERSION = '1.1.7'
4+
VERSION = '1.1.8'
55

66

77
def get_version():

dist/Productions.exe

369 Bytes
Binary file not shown.

ot3_testing/tests/base_init.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def initial_api(self, ip: str, hc=False):
2121
else:
2222
self.api = ProtocolContext(ip)
2323

24+
def judge_test_result(self, result_list, test_spec):
25+
"""
26+
judge the difference
27+
"""
28+
diff = abs(max(result_list) - min(result_list))
29+
if diff > test_spec:
30+
raise ValueError(f"Difference - {diff} don't match test spec - {test_spec} (测试结果超过预期,请复测!)")
31+
2432
def initial_server(self):
2533
"""
2634
restart opentrons-robot-server

ot3_testing/tests/gantry_leveling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
SecondThreshold = 0.15
1919
ThisMount = Mount.LEFT
2020

21+
TEST_SPEC = 0.3
22+
2123

2224
class GantryLeveling(TestBase):
2325
def __init__(self):
@@ -115,7 +117,7 @@ def get_test_result(self):
115117
return "Fail", 1000
116118
point_value.append(value[0])
117119
point_value.append(0)
118-
sub_value = abs(max(point_value)-min(point_value))
120+
sub_value = abs(max(point_value) - min(point_value))
119121
return "Pass", sub_value if sub_value < SecondThreshold else "Fail", sub_value
120122

121123
async def run_test(self, only_check=False):

ot3_testing/tests/gripper_leveling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
ApplyCompensationFlag = True
1212
CalibrateFlag = True
1313

14+
TEST_SPEC = 0.45
15+
1416

1517
class GripperLeveling(TestBase):
1618
def __init__(self, slot_location, robot_ip=None):
@@ -126,6 +128,7 @@ async def run_slot(self, p: Point, test_name, definition, keep_reading=False):
126128
while True:
127129
result = await self.read_definition_distance(definition, GripperChannel, self.laser_sensor, self.mount)
128130
print(result)
131+
self.judge_test_result(list(result.values()), TEST_SPEC)
129132
if not keep_reading:
130133
return {test_name: result}
131134

ot3_testing/tests/pipette_leveling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
DoCalibrate = True
1616
ApplyCompensationFlag = True
1717

18+
TEST_SPEC = 0.45
19+
1820

1921
class PipetteLeveling(TestBase):
2022
def __init__(self, slot_location, channel_definition, robot_ip=None):
@@ -220,6 +222,7 @@ async def run_test_slot(self, test_slot_name: str, test_slot_value: str, read_de
220222
print(f"{test_slot_value}-{key}: {value}")
221223
_value_list = list(ret_dict.values())
222224
print(f"Difference: {round(max(_value_list) - min(_value_list), 3)}")
225+
self.judge_test_result(_value_list, TEST_SPEC)
223226
if keep_reading is False:
224227
return {test_slot_value: ret_dict}
225228

ot3_testing/tests/zstage_leveling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
RequestReadyFlag = False
1515
ApplyCompensationFlag = True
1616

17+
TEST_SPEC = 0.3
18+
1719

1820
class ZStageLeveling(TestBase):
1921
def __init__(self, slot_location, robot_ip=None):
@@ -143,7 +145,7 @@ async def run_test_slot(self, point: Point, slot_name: str, read_definition: Lis
143145
ret_dict = await self.read_definition_distance(read_definition, ZStageChannel, self.laser_sensor, self.mount)
144146
for key, value in ret_dict.items():
145147
print(f"{slot_name}-{key}: {value}")
146-
148+
self.judge_test_result(list(ret_dict.values()), TEST_SPEC)
147149
return {slot_name: ret_dict}
148150

149151
async def th_reading_c2(self):

0 commit comments

Comments
 (0)