From 58c881cf7256b7a97a848755398793f351a5ddd8 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Thu, 19 Dec 2024 16:26:23 +0800 Subject: [PATCH] =?utf8?q?=E7=B3=BB=E7=BB=9F=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?utf8?q?=E5=BF=83=E7=8E=87=E8=A1=80=E6=B0=A7=E8=BF=90=E5=8A=A8=E5=AD=97?= =?utf8?q?=E7=AC=A6=E4=B8=B2=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/log_parser/runtimeanalysis.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/tools/log_parser/runtimeanalysis.py b/tools/log_parser/runtimeanalysis.py index 4ef7b3c13..0cfd364b8 100644 --- a/tools/log_parser/runtimeanalysis.py +++ b/tools/log_parser/runtimeanalysis.py @@ -10,11 +10,8 @@ os.makedirs(output_dir, exist_ok=True) # 定义输出文件的完整路径 output_file_path = os.path.join(output_dir, "runtimeout.txt") -# 定义默认的输入文件路径 -default_txtname = "default_input.txt" # 请将此处的文件名替换为你的默认输入文件名 - # 从命令行参数中获取输入文件名称,如果没有提供则使用默认文件 -txtname = sys.argv[-1] if len(sys.argv) > 1 else default_txtname +txtname = sys.argv[-1] # 字符串与其对应的消息的映射 str_bin_list = [ @@ -39,7 +36,21 @@ str_bin_list = [ ['1101', "录音开始 "], ['1102', "录音停止 "], ['1103', "AI录音开始 "], - ['1104', "AI录音停止 "] + ['1104', "AI录音停止 "], + ['0401',"手表发起运动"], + ['0402',"app发起运动"], + ['0403',"开始特殊运动"], + ['0404',"开始普通运动"], + ['0405',"停止运动"], + ['0406',"恢复运动"], + ['0407',"运动结束"], + ['0501',"主动检测心率"], + ['0502',"主动检测心率结束"], + ['0503',"被动检测心率"], + ['0504',"被动检测心率结束"], + ['0701',"主动检测血氧"], + ['0702',"主动检测血氧结束"], + ] # 打开输出文件以写入 @@ -59,10 +70,10 @@ with open(output_file_path, "w+") as f_out: if l[0] == data_1_bin: f_out.write(l[1]) found = True - break - - if not found: - f_out.write(data_1_bin) # 如果没有找到对应的字符串,则写入二进制字符串 + break + + f_out.write(' ') + f_out.write(data_1_bin) # 如果没有找到对应的字符串,则写入二进制字符串 f_out.write(' ') f_out.write(data_2_bin) f_out.write('\n') -- 2.17.1