diff --git a/assets/files/projects/NB4h_R580_3G.zip b/assets/files/projects/NB4h_R580_3G.zip index aec3b47..a7ee4ae 100644 Binary files a/assets/files/projects/NB4h_R580_3G.zip and b/assets/files/projects/NB4h_R580_3G.zip differ diff --git a/assets/files/projects/autotest.xml b/assets/files/projects/autotest.xml index 8b12819..483b9af 100644 --- a/assets/files/projects/autotest.xml +++ b/assets/files/projects/autotest.xml @@ -386,7 +386,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -457,7 +457,7 @@ - + @@ -786,7 +786,7 @@ - + @@ -806,7 +806,7 @@ - + @@ -817,7 +817,26 @@ - + + + + + + + + + + + + + + + + + + + + diff --git a/assets/files/version/file_version_info.txt b/assets/files/version/file_version_info.txt index fee9997..aa27a6e 100644 --- a/assets/files/version/file_version_info.txt +++ b/assets/files/version/file_version_info.txt @@ -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, 3, 1, 5), - prodvers=(0, 3, 1, 5), + filevers=(0, 3, 1, 6), + prodvers=(0, 3, 1, 6), # 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.3.1.5 (2025-03-10)'), + StringStruct('FileVersion', '0.3.1.6 (2025-03-21)'), StringStruct('InternalName', 'AIO.exe'), StringStruct('LegalCopyright', '© 2024-2025 Manford Fan'), StringStruct('OriginalFilename', 'AIO.exe'), StringStruct('ProductName', 'AIO'), - StringStruct('ProductVersion', '0.3.1.5 (2025-03-10)')]) + StringStruct('ProductVersion', '0.3.1.6 (2025-03-21)')]) ]), VarFileInfo([VarStruct('Translation', [1033, 1200])]) ] diff --git a/assets/files/version/release_change.md b/assets/files/version/release_change.md index 5ed4541..8d7e904 100644 --- a/assets/files/version/release_change.md +++ b/assets/files/version/release_change.md @@ -480,4 +480,11 @@ v0.3.1.3(2025/02/12) 1. 修改自动测试(制动)的打开关闭曲线逻辑,开始时打开,完整测试结束时关闭 v0.3.1.3(2025/02/13) -1. 修改自动测试(电机电流)的数据处理方法,从以前的Multiprocessing->threading,因为Intel CPU遇到Multiprocessing会重新打开一个AIO实例 \ No newline at end of file +1. 修改自动测试(电机电流)的数据处理方法,从以前的Multiprocessing->threading,因为Intel CPU遇到Multiprocessing会重新打开一个AIO实例 + +v0.3.1.5(2025/03/10) +1. 因公司网络环境调整,修改服务器校验IP + +v0.3.1.6(2025/03/21) +1. 调整耐久(场景)测试工程,以及相应的数据采集逻辑,将采集规则由固定时间间隔,修改为固定运动动作周期 +> Tips:工程以及寄存器文件均有变动 \ No newline at end of file diff --git a/assets/files/version/version b/assets/files/version/version index a5f4362..245a459 100644 --- a/assets/files/version/version +++ b/assets/files/version/version @@ -1 +1 @@ -0.3.1.5@03/10/2025 \ No newline at end of file +0.3.1.6@03/21/2025 \ No newline at end of file diff --git a/code/aio.py b/code/aio.py index 83edcc5..15603d8 100644 --- a/code/aio.py +++ b/code/aio.py @@ -37,7 +37,7 @@ class App: self.label_pages_logs = ctk.StringVar() self.label_pages_logs.set("-.-.-.-.-.-") self.entry_tips_v = None - self.server_vers = None + self.server_vers = "" self.tv_cols = {1: ["ID", 1], 2: ["time", 160], 3: ["level", 25], 4: ["module", 30], 5: ["content", 700]} self.chk_box_v = ctk.BooleanVar() self.chk_box_v.set(False) @@ -143,12 +143,14 @@ class App: self.label_tips = ctk.CTkLabel(self.frame_status, textvariable=var_tips, compound="left", bg_color="#C9C9C9", font=self.f_status, anchor="e") self.__auth_and_vercheck() if local_vers == self.server_vers: - # if True: image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/updated.png"), size=(16, 16)) var_tips.set(" 当前是最新版本,继续保持! ") self.label_tips.configure(text_color="#0D8A3D", image=image) - else: - if self.server_vers is None: + elif local_vers > self.server_vers: + pass + elif local_vers < self.server_vers: + if self.server_vers == "": + messagebox.showerror(title="错误", message=f"服务器版本校验失败,退出...") return image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/upgrade.png"), size=(16, 16)) var_tips.set(f" {self.server_vers.split('@')[0]}已经发布,尽快更新至最新版本! ") diff --git a/code/common/openapi.py b/code/common/openapi.py index b4f562c..51e3697 100644 --- a/code/common/openapi.py +++ b/code/common/openapi.py @@ -314,7 +314,7 @@ class ModbusRequest(object): result = self.__c.convert_from_registers(registers=results.registers, data_type=self.__c.DATATYPE.FLOAT32, word_order="little") return result - def read_brake_done(self): + def read_capture_start(self): result = self.__c.read_holding_registers(40603, count=1) return result.registers[0] diff --git a/code/durable_docs/factory_test.py b/code/durable_docs/factory_test.py index e4132b3..4d7ba17 100644 --- a/code/durable_docs/factory_test.py +++ b/code/durable_docs/factory_test.py @@ -4,7 +4,6 @@ import time import pandas import math import csv -import numpy from common import clibs @@ -122,12 +121,12 @@ def run_rl(path, params, curves, hr, md, w2t): while True: scenario_time = float(f"{float(md.read_scenario_time()):.2f}") if scenario_time != 0: - w2t(f"耐久工程的周期时间:{scenario_time}s | 单轮次执行时间:{scenario_time+interval}\n") + w2t(f"耐久工程的周期时间:{scenario_time}s | 单轮次执行时间:{scenario_time+interval}~{scenario_time*2+interval}\n") break else: time.sleep(1) - if (time.time() - t_start) > 300: - w2t(f"300s 内未收到耐久工程的周期时间,需要确认RL程序和工具通信交互是否正常执行...\n", "red", "GetScenarioTimeError") + if (time.time() - t_start) > 900: + w2t(f"900s 内未收到耐久工程的周期时间,需要确认RL程序和工具通信交互是否正常执行...\n", "red", "GetScenarioTimeError") # 6. 准备数据保存文件 for curve in curves: @@ -141,11 +140,19 @@ def run_rl(path, params, curves, hr, md, w2t): count = 0 while clibs.running: this_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) - next_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1)) - w2t(f"[{this_time}] 当前次数:{count:09d} | 预计下次数据更新时间:{next_time}\n", "#008B8B") + next_time_1 = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1)) + next_time_2 = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1+scenario_time)) + w2t(f"[{this_time}] 当前次数:{count:09d} | 预计下次数据更新时间:{next_time_1}~{next_time_2}\n", "#008B8B") count += 1 # 固定间隔,更新一次数据,打开曲线,获取周期内电流,关闭曲线 time.sleep(interval) + while True: + capture_start = md.read_capture_start() + if capture_start == 1: + break + else: + time.sleep(0.1) + change_curve_state(hr, curves, True, True) time.sleep(scenario_time) end_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) @@ -194,7 +201,7 @@ def proc_device_servo_trq_feedback(records, params, w2t): for axis in range(6): df = pandas.DataFrame.from_dict({"device_servo_trq_feedback": d_trq[axis]}) - _ = math.sqrt(df.apply(lambda x: numpy.power((rcs[axis] * float(x.iloc[0]) / 1000), 2)).sum() / len(df)) + _ = math.sqrt((df[df.columns[0]] * rcs[axis] / 1000).pow(2).sum() / len(df)) results.append(_) path = "/".join(params["prj_file"].split("/")[:-1]) diff --git a/readme.md b/readme.md index 2b3aff3..689079b 100644 --- a/readme.md +++ b/readme.md @@ -60,7 +60,7 @@ - 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作 - 必要条件: - - RL 工程,参考 `assets/files/projects/`,需要详细阅读对应的注释 + - RL 工程(brake任务),参考 `assets/files/projects/`,需要详细阅读对应的注释 - 需要有一个配置文件,命名为 configs.xlsx - 需要有三个结果文件,命名为 reach33/66/100_xxxxxxxx.xlsx @@ -68,9 +68,15 @@ - 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作 - 必要条件: - - RL 工程,参考 `assets/files/projects/`,需要详细阅读对应的注释 + - RL 工程(current任务),参考 `assets/files/projects/`,需要详细阅读对应的注释 - 需要有一个结果文件,命名为 T_电机电流.xlsx +## 三、耐久测试数据采集 + +- 原理:根据设置的时间间隔,采集相应的场景周期指标数据 +- 必要条件: + - RL 工程(factory任务),参考 `assets/files/projects/`,需要详细阅读对应的注释 + ## 三、注意事项 > **!!仅内网使用!!** @@ -78,10 +84,11 @@ 1. 仅适用于 xCore 2.3.0.7 及以上的版本 2. 仅适配了六轴工业/协作机型,其他机型可能会存在使用上的问题,具体可以找fanmingfu@rokae.com确认 3. 单轴电机电流数据处理,至少需要三个完整周期,使用本工具采集一般不会有问题,主要是针对手动采集命名的数据 -4. 执行制动测试/电机电流采集/耐久测试的时候,执行过程中停止,再次运行需要等待一分钟左右,输出框会有提示 +4. 执行制动测试/电机电流采集/耐久测试的时候,执行过程中停止,需要重新关闭软件再次打开,才能正常使用 5. RL工程/寄存器文件/configs.xlsx文件已更新,需要使用新版,其他使用方法和之前工具一致 6. 基恩士采集数据时,不同轮次(每5次测试)数据时间间隔最好大于 2 倍的周期时间,否则会出现采集的轮数不正确的情况,但数据是完整的 7. 激光数据处理只支持英文版本的数据文件 +8. 耐久(场景)指标数据采集的工程运行周期需要小于 300s,否则会出现异常 > **需要使用 assets/files/projects/ 下的工程,寄存器文件以及配置文件等!!!**