From: Caisking <3449750381@qq.com> Date: Thu, 19 Dec 2024 08:26:23 +0000 (+0800) Subject: 系统:增加心率血氧运动字符串解析 X-Git-Tag: v1.3.113-repair_tp~134 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1535%2F1;p=mirrors%2FFD230.git 系统:增加心率血氧运动字符串解析 --- 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')