Skip to content

Commit 656e85e

Browse files
author
andy
committed
new status
1 parent ef7d3b6 commit 656e85e

File tree

8 files changed

+49
-39
lines changed

8 files changed

+49
-39
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.2.1'
4+
VERSION = '1.2.4'
55

66

77
def get_version():

devices/air_sensor2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ def get_air_params(self):
4040

4141

4242
if __name__ == '__main__':
43+
# sensor1 = AirSensor2(49846)
4344
sensor1 = AirSensor2(49846)
44-
sensor2 = AirSensor2(49847)
4545
sensor1.connect()
46-
sensor2.connect()
46+
# sensor2.connect()
4747
while True:
4848
ret1 = sensor1.get_air_params()
49-
ret2 = sensor2.get_air_params()
49+
# ret2 = sensor2.get_air_params()
5050
print("RET - 1: ")
5151
print(ret1)
52-
print("RET - 2: ")
53-
print(ret2)
52+
# print("RET - 2: ")
53+
# print(ret2)

devices/wtvb01_bt50.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,25 @@ def get_viration_hz(self, data) -> dict:
9494
while True:
9595
data = device.read_data()
9696

97-
result = device.get_vibration_velocity(data)
98-
print("====震动速度====")
99-
print(result)
100-
print('\n')
101-
result = device.get_vibration_angular(data)
102-
print("====震动角度=====")
103-
print(result)
104-
print('\n')
105-
result = device.get_temperature(data)
106-
print("====温度====")
107-
print(result)
108-
print('\n')
97+
# result = device.get_vibration_velocity(data)
98+
# print("====震动速度====")
99+
# print(result)
100+
# print('\n')
101+
# result = device.get_vibration_angular(data)
102+
# print("====震动角度=====")
103+
# print(result)
104+
# print('\n')
105+
# result = device.get_temperature(data)
106+
# print("====温度====")
107+
# print(result)
108+
# print('\n')
109109
result = device.get_vibration_distance(data)
110110
print("====震动距离=====")
111111
print(result)
112112
print('\n')
113-
result = device.get_viration_hz(data)
114-
print("====震动频率=====")
115-
print(result)
116-
print('\n')
113+
# result = device.get_viration_hz(data)
114+
# print("====震动频率=====")
115+
# print(result)
116+
# print('\n')
117117

118118
time.sleep(1)

dist/Productions.exe

18.8 KB
Binary file not shown.

production_scripts.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
from ot3_testing.test_config.zstage_leveling_config import ZStagePoint
99
from ot3_testing.test_config.gripper_leveling_config import Gripper_Position
1010
import asyncio
11-
from tools.inquirer import prompt_flex_name, prompt_test_name, prompt_exit
11+
from tools.inquirer import prompt_flex_name, prompt_test_name, prompt_exit, prompt_ip
1212
from tools import heat_96ch
1313
from __version__ import get_version
1414
from gravimetric_testing.openwebapp import openweb
15+
from tools.reading_laser import ReadLaser
1516

1617
addpathpat = os.path.dirname(__file__)
1718
addpath = os.path.dirname(os.path.dirname(__file__))
@@ -49,7 +50,12 @@
4950
asyncio.run(pipette_leveling.run_8ch_test(flex_name, project_path=project_path))
5051
elif "grav-openweb" in test_name:
5152
openweb()
52-
53+
elif 'leveling-reading-sensor' in test_name:
54+
add_height = float(input("请输入增加的高度: ").strip())
55+
reader = ReadLaser(add_height)
56+
reader.robot_ip = prompt_ip()
57+
reader.add_height = add_height
58+
asyncio.run(reader.run_test("RIGHT-D1", project_path))
5359
else:
5460
pass
5561

tools/inquirer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from PyInquirer import prompt
22

33
test_choices = ['leveling-8ch', 'leveling-96ch', 'leveling-gantry', 'leveling-z-stage', 'leveling-gripper',
4-
'heat-96ch', 'grav-openweb']
4+
'leveling-reading-sensor', 'heat-96ch', 'grav-openweb']
55

66
question_flex = {
77
'type': 'input',

tools/reading_difference_by_laser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class ReadLaser(TestBase):
2424
def __init__(self):
2525
super(ReadLaser).__init__()
26-
self.robot_ip = "192.168.6.54"
26+
self.robot_ip = "192.168.6.84"
2727
self.laser_sensor = None
2828
self.mount = Mount.RIGHT
2929
self.high_laser_sensor = None

tools/reading_laser.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,28 @@
77
import asyncio
88
from utils import Utils
99
from devices.laser_stj_10_m0 import LaserSensor as HighAccuracySensor
10+
import os
1011

1112
# _point = Point(195, 195, 357) # C2 - Right
1213
Rounds = 30
1314
KeepReading = False
1415
UseHighAccuracy = False
1516

16-
WaitTime = 60
17+
WaitTime = 15
1718

18-
19-
_point = Point(30, 90, 357) # D1 - Right
19+
_point = Point(20, 90, 357) # D1 - Right
2020

2121

2222
# _point = Point(55, 92, 356.5)
2323

2424
class ReadLaser(TestBase):
25-
def __init__(self):
25+
def __init__(self, add_height):
2626
super(ReadLaser).__init__()
27-
self.robot_ip = "192.168.6.33"
27+
self.robot_ip = "192.168.6.84"
2828
self.laser_sensor = None
2929
self.mount = Mount.RIGHT
3030
self.high_laser_sensor = None
31+
self.point = _point + Point(0, 0, add_height)
3132

3233
def init_laser_sensor(self, send=False):
3334
"""
@@ -69,14 +70,14 @@ async def move_to_test_point(self, p: Point):
6970
"""
7071
await self.api.move_to(self.mount, p, target="pipette", )
7172

72-
async def run_test(self, slot_name):
73+
async def run_test(self, slot_name, project_path):
7374
await self.build_reading()
7475
if KeepReading:
75-
await self.move_to_test_point(_point)
76+
await self.move_to_test_point(self.point)
7677
for i in range(Rounds):
77-
print(f"Round --------------------------------- {i+1}")
78+
print(f"Round --------------------------------- {i + 1}")
7879
if not KeepReading:
79-
await self.move_to_test_point(_point)
80+
await self.move_to_test_point(self.point)
8081

8182
result = {}
8283
for _wait in range(WaitTime):
@@ -94,13 +95,16 @@ async def run_test(self, slot_name):
9495
if UseHighAccuracy:
9596
result.update({"high": high_res})
9697
print(result)
97-
98-
file_path = '../testing_data/reading_sensor.csv'
98+
if project_path is not None:
99+
file_path = os.path.join(project_path, 'testing_data', 'reading_laser.csv')
100+
else:
101+
file_path = '../../testing_data/reading_laser.csv'
99102
self.save_csv(file_path, [slot_name], list(result.values()))
100103
if KeepReading is not True:
101104
await self.api.home()
102105

103106

104107
if __name__ == '__main__':
105-
re = ReadLaser()
106-
asyncio.run(re.run_test("RIGHT-D1"))
108+
pass
109+
re = ReadLaser(4)
110+
asyncio.run(re.run_test("RIGHT-D1", project_path=None))

0 commit comments

Comments
 (0)