v0.1.7.5(2024/07/03)

1. [APIs: aio.py]
   - 增加触发急停和恢复急停功能逻辑
2. [APIs: do_current.py]
   - 重新调整运行顺序,增加数据处理的逻辑(惯量负载逻辑暂不实现,等待软件部解决了修改工程之后不生效的问题再考虑)
3. [APIs: btn_functions.py]
   - 增加触发急停和恢复急停的modbus实现,仅适用于自动化测试

v0.1.7.6(2024/07/04)
1. [APIs: aio.py]
   - Automatic Test逻辑中增加选择current时,需要选负载类型的逻辑
2. [APIs: do_current.py]
   - 单轴/场景电机电流的采集已完成
3. [APIs: openapi.py]
   - 增加了modbus读取浮点数的功能
   - 优化了get_from_id的逻辑
4. [autotest.xml]: 新增了scenario_time只写寄存器
This commit is contained in:
2024-07-04 13:34:04 +08:00
parent aedac4c90c
commit 524af160d8
6 changed files with 287 additions and 93 deletions

View File

@ -1,4 +1,4 @@
import json
from json import loads
from sys import argv
@ -20,11 +20,21 @@ def execution(cmd, hr, w2t, **kwargs):
if not _msg:
w2t(f"无法获取{_id}请求的响应信息", 0, 6, 'red', tab_name='Automatic Test')
else:
_response = json.loads(_msg)
_response = loads(_msg)
validate_resp(_id, _response, w2t)
return _response
def trigger_estop(md, w2t):
md.trigger_estop()
w2t("触发急停成功,可点击机器状态验证。", 0, 0, 'green', 'Automatic Test')
def reset_estop(md, w2t):
md.reset_estop()
w2t("恢复急停成功,可点击机器状态验证。", 0, 0, 'green', 'Automatic Test')
def get_state(hr, w2t):
# 获取机器状态
_response = execution('state.get_state', hr, w2t)
@ -48,17 +58,21 @@ def get_state(hr, w2t):
def warning_info(hr, w2t):
for msg in hr.c_msg:
if 'alarm' in msg.lower():
w2t(msg, tab_name='Automatic Test')
w2t(str(loads(msg)), tab_name='Automatic Test')
for msg in hr.c_msg_xs:
if 'alarm' in msg.lower():
w2t(msg, tab_name='Automatic Test')
w2t(str(loads(msg)), tab_name='Automatic Test')
def main(hr, func, w2t):
def main(hr, md, func, w2t):
if hr is None:
w2t("无法连接机器人检查是否已经使用Robot Assist软件连接机器重试中...", 0, 49, 'red', tab_name='Automatic Test')
# func: get_state/
match func:
case 'trigger_estop':
trigger_estop(md, w2t)
case 'reset_estop':
reset_estop(md, w2t)
case 'get_state':
get_state(hr, w2t)
case 'warning_info':
@ -68,21 +82,3 @@ def main(hr, func, w2t):
if __name__ == '__main__':
main(*argv[1:])
# 一、设置/检测机器人状态:
# 1. 上电
# 2. 软限位打开
# 3. 示教器断开
# 4. 操作模式/机器人类型
# 5. 控制器状态/工作任务控件/机器人动态
# 二、加载RL程序开始运行
# 1. 怎么触发急停
# 2. 怎么恢复急停
# 3. 怎么采集曲线
# 4.
# 三、运行过程中,收集数据,并处理出结果
# 四