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")
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:#已联网 并且不在充电 佩戴正常 不在通话就给测试心率
# 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)
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