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:
@ -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}次测试"
|
||||
|
Reference in New Issue
Block a user