From: dxy15521469561 <1731678236@qq.com> Date: Tue, 23 Jan 2024 03:17:04 +0000 (+0800) Subject: 去掉不必要的宏控 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=6e0a8be274ddfe149a785e71f3c307ef8fedc100;p=mirrors%2FASR1603_G5.git 去掉不必要的宏控 --- diff --git a/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr.py index 0a104682..79821082 100644 --- a/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr.py @@ -1957,18 +1957,6 @@ if EventMesh.model == "D10": # EventMesh.publish("set_history_hr_value",heart_value) EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - if EventMesh.model == "D15" :#D15型号 - blood_data = get_autoblood_value() - if blood_data == None: - blood_data[0] = 0 - blood_data[1] = 0 - - max_value = blood_data[0] - min_value = blood_data[1] - if max_value != 0 and min_value != 0: - EventMesh.publish(constants.PROTOCOL.BLOOD_SEND,[max_value,min_value]) - pass - else: EventMesh.publish("play_hr_value",0) diff --git a/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr_d15.py b/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr_d15.py index 5db15fbc..df695119 100644 --- a/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr_d15.py +++ b/2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr_d15.py @@ -1307,76 +1307,19 @@ if EventMesh.model == "D15": call_state = EventMesh.publish("get_call_state") if call_state == None: call_state = 0 - if EventMesh.model == "D15": - video_state = EventMesh.publish("get_video_state") - if video_state != None: - if battery[0] != "1": - if get_temp_state != None and call_state != None and video_state != None: #突然脱腕 - if get_temp_state > 1 and (WEAR != 1 or call_state != 0 or video_state != 0): - EventMesh.publish(constants.EVENT.STOP_TEMP) - EventMesh.publish("set_temp_state",0) - EventMesh.txt_log("auto stop_temp:22") - - if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1 or get_bg_state > 1) and (WEAR != 1 or call_state != 0 or video_state != 0): - # print("wear faile") - if self.get_hr_state > 1 : - EventMesh.txt_log("auto stop_hr:22") - EventMesh.publish("set_hr_state",0)#2代表后台进入测试,定时测心率 1ui界面测试洗心率 - EventMesh.publish(constants.EVENT.STOP_HEART) - if WEAR == 1: - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - - if self.get_spo2_state > 1: - EventMesh.txt_log("auto stop_spo2:22") - EventMesh.publish("set_spo2_state",0)#2代表后台进入测试 - - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if WEAR == 1: - if spo2_value > 85 and spo2_value != None: - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - - if get_bp_state > 1: - EventMesh.txt_log("auto stop_bp:22") - EventMesh.publish("set_bp_state",0)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.STOP_HEART) - if WEAR == 1: - blood_data = get_autoblood_value() - if blood_data == None: - blood_data[0] = 0 - blood_data[1] = 0 - - max_value = blood_data[0] - min_value = blood_data[1] - if max_value != 0 and min_value != 0: - EventMesh.publish(constants.PROTOCOL.BLOOD_SEND,[max_value,min_value]) - - if get_bg_state > 1: - EventMesh.txt_log("auto stop_bg:22") - - EventMesh.publish("set_bg_state",0)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.STOP_HEART) - if WEAR == 1: - bg_data = get_blood_sugar_value() - if bg_data == None: - bg_data = 0 - if bg_data != 0: - # EventMesh.publish("play_sugar_value", bg_data)#播放血糖数值 - EventMesh.publish(constants.PROTOCOL.BLOODGLUSOCE_SEND,bg_data) - else: + video_state = EventMesh.publish("get_video_state") + if video_state != None: if battery[0] != "1": - if get_temp_state != None and call_state != None: #突然脱腕 + if get_temp_state != None and call_state != None and video_state != None: #突然脱腕 - if get_temp_state > 1 and (WEAR != 1 or call_state != 0): + if get_temp_state > 1 and (WEAR != 1 or call_state != 0 or video_state != 0): EventMesh.publish(constants.EVENT.STOP_TEMP) EventMesh.publish("set_temp_state",0) EventMesh.txt_log("auto stop_temp:22") - if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1 or get_bg_state > 1) and (WEAR != 1 or call_state != 0): + if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1 or get_bg_state > 1) and (WEAR != 1 or call_state != 0 or video_state != 0): # print("wear faile") if self.get_hr_state > 1 : EventMesh.txt_log("auto stop_hr:22") @@ -1424,8 +1367,8 @@ if EventMesh.model == "D15": bg_data = 0 if bg_data != 0: # EventMesh.publish("play_sugar_value", bg_data)#播放血糖数值 - EventMesh.publish(constants.PROTOCOL.BLOODGLUSOCE_SEND,bg_data) - + EventMesh.publish(constants.PROTOCOL.BLOODGLUSOCE_SEND,bg_data) + if self.pull_time == 0: self.pull_time = time_tmp # if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已联网 并且不在充电 佩戴正常 不在通话就给测试心率 @@ -2023,17 +1966,15 @@ if EventMesh.model == "D15": # EventMesh.publish("set_history_hr_value",heart_value) EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - if EventMesh.model == "D15" :#D15型号 - blood_data = get_autoblood_value() - if blood_data == None: - blood_data[0] = 0 - blood_data[1] = 0 + blood_data = get_autoblood_value() + if blood_data == None: + blood_data[0] = 0 + blood_data[1] = 0 - max_value = blood_data[0] - min_value = blood_data[1] - if max_value != 0 and min_value != 0: - EventMesh.publish(constants.PROTOCOL.BLOOD_SEND,[max_value,min_value]) - pass + max_value = blood_data[0] + min_value = blood_data[1] + if max_value != 0 and min_value != 0: + EventMesh.publish(constants.PROTOCOL.BLOOD_SEND,[max_value,min_value]) else: EventMesh.publish("play_hr_value",0) @@ -2170,8 +2111,7 @@ if EventMesh.model == "D15": self.alarm_flag = 1 EventMesh.publish("set_rtc_alarm") - if EventMesh.model == "D15":#只有D15才有这个功能 - EventMesh.publish("video_no_network") + EventMesh.publish("video_no_network") def clear_usb_flag(self,event,msg): self.charge_full_count = 0 diff --git a/2.sdk/project/K5_DDY/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk/project/K5_DDY/sdk/services/microPython/ports/quectel/core/mgr.py index 7c1f18e8..732c017d 100644 --- a/2.sdk/project/K5_DDY/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk/project/K5_DDY/sdk/services/microPython/ports/quectel/core/mgr.py @@ -825,7 +825,6 @@ class DeviceInfoManager(Abstract): self.hsensor.set_sar(1) except Exception as e: print("Hsensor none set_sar:{}".format(e)) - self.old_temp_time = 0 # #print("hsensor.open_heart:%d\r\n"%(self.hsensor.open_heart())) print("DeviceInfoManager:3") self.i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE)