1. [main: do_brake.py] 修改了 SSH 的固定 IP 为 clibs 中读取的内容,并删除了每次都 reload 工程的动作,改为只在修改 RL 工程时 reload 一次,旨在减少最近频繁出现的“无法获取overview.reload-xxxxxx”请求的响应,初步判断是 xCore 的问题,非 AIO 问题,已反馈待版本修复

2. [main: wavelogger.py] 新增异常数据校验功能
This commit is contained in:
gitea 2024-12-16 13:51:04 +08:00
parent 4b6f78dd7e
commit 14f6d43027
8 changed files with 37 additions and 18 deletions

View File

@ -1,3 +0,0 @@
# rokae
测试内容自动化处理

View File

@ -635,3 +635,9 @@ v0.2.1.0(2024/12/05)
1. [current: do_current.py] 增加了 hw_sensor_trq_feedback 曲线的采集
2. [current: current.py] 增加了 hw_sensor_trq_feedback 曲线数据的处理,以及修改了之前数据处理的逻辑
3. [current: clibs.py] 新增可手动修改连接 IP 地址的功能,存储在 assets/templates/ipaddr.txt 中,默认是 192.168.0.160
v0.2.1.1(2024/12/16)
1. [main: do_brake.py] 修改了 SSH 的固定 IP 为 clibs 中读取的内容,并删除了每次都 reload 工程的动作,改为只在修改 RL 工程时 reload 一次旨在减少最近频繁出现的“无法获取overview.reload-xxxxxx”请求的响应初步判断是 xCore 的问题,非 AIO 问题,已反馈待版本修复
2. [main: wavelogger.py] 新增异常数据校验功能

View File

@ -6,8 +6,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(0, 2, 1, 0),
prodvers=(0, 2, 1, 0),
filevers=(0, 2, 1, 1),
prodvers=(0, 2, 1, 1),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
@ -31,12 +31,12 @@ VSVersionInfo(
'040904b0',
[StringStruct('CompanyName', 'Rokae - https://www.rokae.com/'),
StringStruct('FileDescription', 'All in one automatic toolbox'),
StringStruct('FileVersion', '0.2.1.0 (2024-12-05)'),
StringStruct('FileVersion', '0.2.1.1 (2024-12-16)'),
StringStruct('InternalName', 'AIO.exe'),
StringStruct('LegalCopyright', '© 2024-2024 Manford Fan'),
StringStruct('OriginalFilename', 'AIO.exe'),
StringStruct('ProductName', 'AIO'),
StringStruct('ProductVersion', '0.2.1.0 (2024-12-05)')])
StringStruct('ProductVersion', '0.2.1.1 (2024-12-16)')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]

View File

@ -1 +1 @@
1
0

View File

@ -1 +1 @@
0.2.1.0 @ 12/05/2024
0.2.1.1 @ 12/16/2024

View File

@ -96,7 +96,7 @@ class App(customtkinter.CTk):
btns_func['log']['btn'].configure(command=lambda: self.thread_it(self.func_log_callback))
btns_func['end']['btn'].configure(command=lambda: self.thread_it(self.func_end_callback))
# 1.3 create version info
self.label_version = customtkinter.CTkLabel(self.frame_func, justify='left', text="Vers: 0.2.1.0\nDate: 12/05/2024", font=self.my_font, text_color="#4F4F4F")
self.label_version = customtkinter.CTkLabel(self.frame_func, justify='left', text="Vers: 0.2.1.1\nDate: 12/16/2024", font=self.my_font, text_color="#4F4F4F")
self.frame_func.rowconfigure(6, weight=1)
self.label_version.grid(row=6, column=0, padx=20, pady=20, sticky='s')
# =====================================================================

View File

@ -155,10 +155,10 @@ def run_rl(path, loadsel, hr, md, config_file, result_dirs, w2t):
sleep(write_diagnosis) # 软急停超差后等待写诊断时间可通过configs.xlsx配置
while count == 1:
# 2. 修改要执行的场景
# 2. 修改要执行的场景
ssh = SSHClient()
ssh.set_missing_host_key_policy(AutoAddPolicy())
ssh.connect('192.168.0.160', 22, username='luoshi', password='luoshi2019')
ssh.connect(hostname=clibs.ip_addr, port=22, username='luoshi', password='luoshi2019')
if ws.cell(row=1, column=1).value == 'positive':
_rl_cmd = f"brake_E(j{axis}_{_reach}_p, j{axis}_{_reach}_n, p_speed, p_tool)"
elif ws.cell(row=1, column=1).value == 'negative':
@ -238,7 +238,7 @@ def run_rl(path, loadsel, hr, md, config_file, result_dirs, w2t):
md.reset_estop() # 其实没必要
md.clear_alarm()
clibs.execution('overview.reload', hr, w2t, tab_name, prj_path=prj_path, tasks=['brake', 'stop0_related'])
# clibs.execution('overview.reload', hr, w2t, tab_name, prj_path=prj_path, tasks=['brake', 'stop0_related'])
clibs.execution('rl_task.pp_to_main', hr, w2t, tab_name, tasks=['brake', 'stop0_related'])
clibs.execution('state.switch_auto', hr, w2t, tab_name)
clibs.execution('state.switch_motor_on', hr, w2t, tab_name)

View File

@ -13,7 +13,7 @@ def find_point(bof, step, pos, data_file, flag, df, row, w2t):
# flag: greater than or lower than
if flag == 'gt':
while 0 < row < df.index[-1]-100:
_value = df.iloc[row, 2]
_value = float(df.iloc[row, 2])
if _value > 2:
if bof == 'backward':
row -= step
@ -33,7 +33,7 @@ def find_point(bof, step, pos, data_file, flag, df, row, w2t):
row_target = row + 100
elif flag == 'lt':
while 0 < row < df.index[-1]-100:
_value = df.iloc[row, 2]
_value = float(df.iloc[row, 2])
if _value < 2:
if bof == 'backward':
row -= step
@ -61,14 +61,19 @@ def get_cycle_info(data_file, df, row, step, w2t):
# 1. 从最后读取数据无论是大于1还是小于1都舍弃找到相反的值的起始点
# 2. 从起始点,继续往前寻找,找到与之数值相反的中间点
# 3. 从中间点,继续往前寻找,找到与之数值相反的结束点,至此,得到了高低数值的时间区间以及一轮的周期时间
if df.iloc[row, 2] < 2:
# print(f"row = {row}")
# print(df.iloc[row, 2])
if float(df.iloc[row, 2]) < 2:
row = find_point('backward', step, 'a1', data_file, 'lt', df, row, w2t)
_row = find_point('backward', step, 'a2', data_file, 'gt', df, row, w2t)
_row = find_point('backward', step, 'a3', data_file, 'lt', df, _row, w2t)
row_end = find_point('backward', step, 'a4', data_file, 'gt', df, _row, w2t)
# print(f"row_end = {row_end}")
row_middle = find_point('backward', step, 'a5', data_file, 'lt', df, row_end, w2t)
# print(f"row_middle = {row_middle}")
row_start = find_point('backward', step, 'a6', data_file, 'gt', df, row_middle, w2t)
# print(f"row_start = {row_start}")
return row_end-row_middle, row_middle-row_start, row_end-row_start
@ -95,13 +100,14 @@ def preparation(data_file, wb, w2t):
begin = int(row[1])
break
df = read_csv(data_file, sep=',', encoding='gbk', skip_blank_lines=False, header=begin - 1, on_bad_lines='warn')
# print(f"df = {df}")
low, high, cycle = get_cycle_info(data_file, df, df.index[-1]-110, 5, w2t)
return ws, df, low, high, cycle
def single_file_proc(ws, data_file, df, low, high, cycle, w2t):
_row = _row_lt = _row_gt = count = 1
_row = _row_lt = _row_gt = count = count_i = 1
_step = 5
_data = {}
row_max = df.index[-1]-100
@ -110,19 +116,29 @@ def single_file_proc(ws, data_file, df, low, high, cycle, w2t):
if count not in _data.keys():
_data[count] = []
_value = df.iloc[_row, 2]
_value = float(df.iloc[_row, 2])
if _value < 2:
_row_lt = find_point('forward', _step, 'c'+str(_row), data_file, 'lt', df, _row, w2t)
# print(f"_row_lt = {_row_lt}")
_start = int(_row_gt + (_row_lt - _row_gt - 50) / 2)
# print(f"_start = {_start}")
_end = _start + 50
# print(f"_end = {_end}")
# print("========================================\n")
value = df.iloc[_start:_end, 2].mean() + 3 * df.iloc[_start:_end, 2].std()
if value > 1:
w2t(f"{data_file} 文件第 {count} 轮 第 {count_i} 个数据可能有问题,需人工手动确认,确认有问题可删除,无问题则保留", 0, 0, 'orange')
_data[count].append(value)
count_i += 1
else:
_row_gt = find_point('forward', _step, 'c'+str(_row), data_file, 'gt', df, _row, w2t)
# print(f"_row_gt = {_row_gt}")
if _row_gt - _row_lt > cycle * 2:
count += 1
count_i = 1
_row = max(_row_gt, _row_lt)
# print(f"_row = {_row}")
for i in range(2, 10):
ws.cell(row=1, column=i).value = f"{i-1}次测试"