7. [APIs: btn_functions.py]: 重写了告警输出函数,从日志中拿数据

8. [APIs: aio.py]: 将日志框输出的内容,也保存至日志文件
9. [APIs: do_brake.py]
   - 修改获取初始速度的逻辑,只获取configs文件中配置的时间内的速度
   - 新增 configs 参数 single_brake,可针对特定条件做测试
This commit is contained in:
2024-08-01 17:11:12 +08:00
parent e713485d00
commit 60726d9d07
6 changed files with 41 additions and 14 deletions

View File

@ -38,12 +38,15 @@ def get_state(hr, w2t):
def warning_info(hr, w2t):
for msg in hr.c_msg:
if 'alarm' in msg.lower():
w2t(str(loads(msg)), tab_name=tab_name)
for msg in hr.c_msg_xs:
if 'alarm' in msg.lower():
w2t(str(loads(msg)), tab_name=tab_name)
for postfix in ['', '.2', '.3', '.4', '.5', '.6', '.7', '.8', '.9', '.10']:
log_name = clibs.log_data + postfix
try:
with open(log_name, 'r', encoding='utf-8') as f_log:
for line in f_log:
if 'alarm' in line:
w2t(line.strip(), tab_name=tab_name)
except FileNotFoundError:
pass
def main(hr, md, func, w2t):