temp += 0.5
if temp < 25 or temp > 42:
temp = 0
- tmp_f = str(temp).split('.')[0]
- tmp_f_tmp = int(tmp_f)
-
+ tmp_f_tmp = 0
+ tmp_d_tmp = 0
+ if str(temp).find(".") != -1:
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ else:
+ tmp_f_tmp = temp
- tmp_d = str(temp).split('.')[1][:1]
- tmp_d_tmp = int(tmp_d)
if temp != 0:
EventMesh.publish("set_history_temp_value",temp)
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+ num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp)
+ EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
EventMesh.publish(constants.EVENT.STOP_TEMP)
print("AUTO temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp))
EventMesh.publish("set_temp_state",0)
temp += 0.5
if temp < 25 or temp > 42:
temp = 0
- tmp_f = str(temp).split('.')[0]
- tmp_f_tmp = int(tmp_f)
-
-
- tmp_d = str(temp).split('.')[1][:1]
- tmp_d_tmp = int(tmp_d)
+ tmp_f_tmp = 0
+ tmp_d_tmp = 0
+ if str(temp).find(".") != -1:
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ else:
+ tmp_f_tmp = temp
if temp != None:
if temp != 0:
EventMesh.publish("set_history_temp_value",temp)
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
- EventMesh.publish("set_history_temp_value",temp)
+ num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp)
+ EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
EventMesh.publish(constants.EVENT.STOP_TEMP)
print("once temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp))
EventMesh.publish("set_temp_state",0)
temp += 0.5
if temp < 25 or temp > 42:
temp = 0
- tmp_f = str(temp).split('.')[0]
- tmp_f_tmp = int(tmp_f)
-
- tmp_d = str(temp).split('.')[1][:1]
- tmp_d_tmp = int(tmp_d)
+ tmp_f_tmp = 0
+ tmp_d_tmp = 0
+ if str(temp).find(".") != -1:
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ else:
+ tmp_f_tmp = temp
if temp != None:
if temp != 0:
EventMesh.publish("set_history_temp_value",temp)
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+ num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp)
+ EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
EventMesh.publish(constants.EVENT.STOP_TEMP)
print("AUTO once temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp))
EventMesh.publish("set_temp_state",0)
temp += 0.5
if temp < 25 or temp > 42:
temp = 0
-
- tmp_f = str(temp).split('.')[0]
- tmp_f_tmp = int(tmp_f)
+ tmp_f_tmp = 0
+ tmp_d_tmp = 0
+ if str(temp).find(".") != -1:
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ else:
+ tmp_f_tmp = temp
- tmp_d = str(temp).split('.')[1][:1]
- tmp_d_tmp = int(tmp_d)
EventMesh.publish("set_temp_state",0)
if temp != None:
if temp != 0:
EventMesh.publish("set_history_temp_value",temp)
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+ num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp)
+ EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
EventMesh.publish(constants.EVENT.STOP_TEMP)
self.SENSOR_time = time_tmp
self.HR_Onestate = 0
# msg_weather_content,msg_type,msg_temp,msg_min_temp,msg_max_temp,msg_city))
print("WT_ProtoCol RECV msg:%s"%(msg))
+
+
EventMesh.publish("set_weather_data",[msg_date,msg_time,msg_weather_content,msg_type,msg_temp,msg_min_temp,msg_max_temp,msg_city,1])
EventMesh.publish("updata_weather_show")
# print("temp:data:%s"%(data))
# 通过socket发送到服务器端
EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data)
-
- str_data = str(msg[0])+'.'+str(msg[1])
- num = eval(str_data)#将字符串数据转换成十进制数据
- EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
-
+
def recv(self, event, msg):
"""
@param event:
temperature_start_label.set_text("正在测量中.")
temperature_done_img.set_src("E:/static/temp_gif03.png")
- tmp_f = str(temp).split('.')[0]
- tmp_f_tmp = int(tmp_f)
+ tmp_f_tmp = 0
+ tmp_d_tmp = 0
+ if str(temp).find(".") != -1:
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ else:
+ tmp_f_tmp = temp
- tmp_d = str(temp).split('.')[1][:1]
- tmp_d_tmp = int(tmp_d)
if self.point >= 2:
if temp >= 37.3:
temperature_start_label.set_text("测量结束,点击重测")
EventMesh.publish("set_history_temp_value",temp)
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+ num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp)
+ EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num])
if temp >= 37.3:
temperature_done_img.set_src("E:/static/temp_high.png")
else: