self.mearsure_btn = int(hr_time[0])
self.mearsure_timer = int(hr_time[1])
if self.mearsure_btn != None and self.mearsure_timer != None:
- print("hr......01....{} {}\r\n".format(hr_time[0],hr_time[1]))
+ # print("hr......01....{} {}\r\n".format(hr_time[0],hr_time[1]))
if self.mearsure_btn > 0:
if self.mearsure_timer > 0:
#print("get_hr_state:{} get_spo2_state:{} self.old_time:{} mearsure_timer:{}".format(self.get_hr_state,self.get_spo2_state,self.old_time,mearsure_timer))
if temp_state != None : #突然脱腕
if temp_state > 1 and WEAR != 1:
- print("TMEP WEAR !!!!")
+ # print("TMEP WEAR !!!!")
EventMesh.publish(constants.EVENT.STOP_TEMP)
- EventMesh.publish("set_temp_state",0)
+ EventMesh.publish("set_temp_state",0)
+ if hr_state != None and spo2_state != None and bp_state != None:
if (hr_state > 1 or spo2_state > 1 or bp_state > 1) and WEAR != 1:
- print("SENSOR WEAR !!!!")
+ # print("SENSOR WEAR !!!!")
if hr_state > 1 :
EventMesh.publish("set_hr_state",0)#2代表后台进入测试,定时测心率 1ui界面测试洗心率
EventMesh.publish(constants.EVENT.STOP_HEART)
EventMesh.txt_log("auto stop_bp:22")
EventMesh.publish("set_bp_state",0)#2代表后台进入测试
EventMesh.publish(constants.EVENT.STOP_HEART)
+
if self.pull_time == 0:
self.pull_time = time_tmp
# EventMesh.txt_log("time_tmp - self.pull_time!!!!{}".format(time_tmp - self.pull_time))
self.call_timer.start(10000, 0, self.call_timer_cb)#延迟10S 继续拨打
def call_timer_cb(self, *args, **kwargs):
- sos_state = EventMesh.publish("get_dev_state")
- tmp = 1 << 16
- sos_state = sos_state|tmp #第16位=1
- EventMesh.publish("set_dev_state",sos_state)
-
- EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,sos_state]) #开始AL定位
- # print("call_timer_cb:{}".format(self.callnumer))
- EventMesh.publish("save_phonename",str(self.callnumer))
- EventMesh.publish("save_phonenum",str(self.callnumer))
- EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"})
+ if self.sos_flag == 1:
+ sos_state = EventMesh.publish("get_dev_state")
+ tmp = 1 << 16
+ sos_state = sos_state|tmp #第16位=1
+ EventMesh.publish("set_dev_state",sos_state)
+
+ EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,sos_state]) #开始AL定位
+ # print("call_timer_cb:{}".format(self.callnumer))
+ EventMesh.publish("save_phonename",str(self.callnumer))
+ EventMesh.publish("save_phonenum",str(self.callnumer))
+ EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"})
def close_sos_timer(self,event,msg):
self.call_timer.stop()