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
This commit is contained in:
@ -33,7 +33,8 @@ def initialization(path, sub, w2t):
|
||||
else:
|
||||
if not (match('j[1-7].*\\.data', filename) or match('j[1-7].*\\.csv', filename)):
|
||||
msg = f"不合规 {data_file}\n"
|
||||
msg += f"所有数据文件必须以 jx_ 开头,以 .data/csv 结尾(x取值1-7),配置文件需要命名为\"configs.xlsx\",结果文件需要命名为\"T_电机电流.xlsx\",请检查后重新运行。"
|
||||
msg += f"所有数据文件必须以 jx_ 开头,以 .data/csv 结尾(x取值1-7),配置文件需要命名为\"configs.xlsx\",结果文件需要命名为\"T_电机电流.xlsx\",请检查后重新运行。\n"
|
||||
msg += "使用max/avg功能时,需要有配置文件表格\"configs.xlsx\";使用cycle功能时,需要有电机电流数据处理\"T_电机电流.xlsx\"和配置文件\"configs.xlsx\"两个表格,确认后重新运行!"
|
||||
w2t(msg, 0, 6, 'red')
|
||||
|
||||
if not ((sub == 'cycle' and count == 2) or (sub != 'cycle' and count == 1)):
|
||||
@ -186,7 +187,6 @@ def find_point(data_file, pos, flag, df, _row_s, _row_e, w2t, exitcode, threshol
|
||||
else:
|
||||
return _row_s, _row_e
|
||||
else:
|
||||
# w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到第{exitcode}个有效点...", 0, exitcode, 'red')
|
||||
w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到第{exitcode}个有效点...", 0, 0, 'red')
|
||||
elif flag == 'gt':
|
||||
while _row_e > end_point:
|
||||
@ -198,7 +198,6 @@ def find_point(data_file, pos, flag, df, _row_s, _row_e, w2t, exitcode, threshol
|
||||
else:
|
||||
return _row_s, _row_e
|
||||
else:
|
||||
# w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到有效起始点或结束点...", 0, exitcode, 'red')
|
||||
w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到有效起始点或结束点...", 0, 0, 'red')
|
||||
|
||||
|
||||
@ -234,6 +233,7 @@ def p_single(wb, single, vel, trq, rpms, rrs, w2t):
|
||||
df_1 = df[col_names[vel-1]].multiply(rpm*addition)
|
||||
df_2 = df[col_names[trq-1]].multiply(scale)
|
||||
# print(df_1.abs().max())
|
||||
df_origin = df
|
||||
df = concat([df_1, df_2], axis=1)
|
||||
|
||||
_step = 5 if data_file.endswith('.csv') else 50
|
||||
@ -270,11 +270,12 @@ def p_single(wb, single, vel, trq, rpms, rrs, w2t):
|
||||
row_start = _row_s + _adjust
|
||||
data = []
|
||||
for row in range(row_start, row_end):
|
||||
data.append(df.iloc[row, 0])
|
||||
data.append(df.iloc[row, 1])
|
||||
data.append(df_origin.iloc[row, 0])
|
||||
data.append(df_origin.iloc[row, 1])
|
||||
data.append(df_origin.iloc[row, 2])
|
||||
|
||||
i = 0
|
||||
for row in ws.iter_rows(min_row=2, min_col=2, max_row=150000, max_col=3):
|
||||
for row in ws.iter_rows(min_row=2, min_col=2, max_row=150000, max_col=4):
|
||||
for cell in row:
|
||||
try:
|
||||
_ = f"{data[i]:.2f}"
|
||||
|
Reference in New Issue
Block a user