diff --git a/aio/README.md b/aio/README.md index fd9b2d5..5adc60c 100644 --- a/aio/README.md +++ b/aio/README.md @@ -146,7 +146,7 @@ pyinstaller --noconfirm --onedir --windowed --optimize 2 --contents-directory . 10. 由于xCore系统问题,运行过程中可能会出现机器人宕机问题,如果遇到,可以手动重启控制柜,重新运行 11. 务必正确填写configs.xlsx中的Target页面,A1单元格可以选择正负方向急停 12. 工程文件可以手动重命名,按照机型存档,或者导出用于自动化测试 -13. 自动化测试前,需要将HMI程序速度设置为100%并同步至控制器,也即左下方速度滑条滑动至最大 +13. (可废弃,但未验证)自动化测试前,需要将HMI程序速度设置为100%并同步至控制器,也即左下方速度滑条滑动至最大 #### 6) 电机电流自动化测试 @@ -625,3 +625,5 @@ v0.2.0.8(2024/08/20) - 在 assets 目录新建 logs 目录,存放日志文件,并增加了相应的逻辑保证正常执行 2. [t_change_ui: aio.py]:增加 App 窗口图标代码 3. [t_change_ui: openapi.py]:将重复输出的网络错误提示,从 textbox 中转移到 debug.log 日志文件中 +4. [main: openapi.py]:新增 rl_task.set_run_params 指令支持,可设定速度滑块以及是否重复运行 +5. [main: do_brake/do_current/factory_test.py]:在初始化运动时增加 `clibs.execution('rl_task.set_run_params', hr, w2t, tab_name, loop_mode=True, override=1.0)` diff --git a/aio/assets/templates/json/rl_task.set_run_params.json b/aio/assets/templates/json/rl_task.set_run_params.json new file mode 100644 index 0000000..8490383 --- /dev/null +++ b/aio/assets/templates/json/rl_task.set_run_params.json @@ -0,0 +1,9 @@ +{ + "id": "xxxxxxxxxxx", + "module": "project", + "command": "rl_task.set_run_params", + "data": { + "loop_mode": true, + "override": 1.0 + } +} \ No newline at end of file diff --git a/aio/code/automatic_test/do_brake.py b/aio/code/automatic_test/do_brake.py index 76a07e9..8a4bf26 100644 --- a/aio/code/automatic_test/do_brake.py +++ b/aio/code/automatic_test/do_brake.py @@ -184,6 +184,7 @@ def run_rl(path, loadsel, hr, md, config_file, result_dirs, w2t): 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) + clibs.execution('rl_task.set_run_params', hr, w2t, tab_name, loop_mode=True, override=1.0) clibs.execution('rl_task.run', hr, w2t, tab_name, tasks=['brake', 'stop0_related']) _t_start = time() while True: diff --git a/aio/code/automatic_test/do_current.py b/aio/code/automatic_test/do_current.py index 0d15ab8..600d03d 100644 --- a/aio/code/automatic_test/do_current.py +++ b/aio/code/automatic_test/do_current.py @@ -290,6 +290,7 @@ def run_rl(path, hr, md, loadsel, w2t): clibs.execution('state.switch_motor_on', hr, w2t, tab_name) # 3. 开始运行程序,单轴运行35s + clibs.execution('rl_task.set_run_params', hr, w2t, tab_name, loop_mode=True, override=1.0) clibs.execution('rl_task.run', hr, w2t, tab_name, tasks=['current']) _t_start = time() while True: diff --git a/aio/code/commons/openapi.py b/aio/code/commons/openapi.py index fa38b66..e8f8a69 100644 --- a/aio/code/commons/openapi.py +++ b/aio/code/commons/openapi.py @@ -599,6 +599,9 @@ class HmiRequest(object): req['data']['tasks'] = kwargs['tasks'] case 'rl_task.pp_to_main' | 'rl_task.run' | 'rl_task.stop': req['data']['tasks'] = kwargs['tasks'] + case 'rl_task.set_run_params': + req['data']['loop_mode'] = kwargs['loop_mode'] + req['data']['override'] = kwargs['override'] case 'diagnosis.set_params': req['data']['display_pdo_params'] = kwargs['display_pdo_params'] case 'diagnosis.open': diff --git a/aio/code/durable_action/factory_test.py b/aio/code/durable_action/factory_test.py index b9c0d71..629d5ac 100644 --- a/aio/code/durable_action/factory_test.py +++ b/aio/code/durable_action/factory_test.py @@ -61,6 +61,7 @@ def run_rl(path, config_file, data_all, hr, md, w2t): clibs.execution('state.switch_motor_on', hr, w2t, tab_name) # 3. 开始运行程序 + clibs.execution('rl_task.set_run_params', hr, w2t, tab_name, loop_mode=True, override=1.0) clibs.execution('rl_task.run', hr, w2t, tab_name, tasks=['current']) _t_start = time() while True: diff --git a/main.py b/main.py new file mode 100644 index 0000000..e69de29