删除无用的ui
authordxy15521469561 <1731678236@qq.com>
Tue, 18 Jul 2023 02:56:57 +0000 (10:56 +0800)
committerdxy15521469561 <1731678236@qq.com>
Tue, 18 Jul 2023 02:56:57 +0000 (10:56 +0800)
2.sdk/project/K5/ext/static/APP/alipay/1_12_1_1.png [deleted file]
2.sdk/project/K5/ext/static/APP/alipay/1_2_2.png [deleted file]
2.sdk/project/K5/ext/static/APP/alipay/loading.jpg [deleted file]
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/main_init.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py

diff --git a/2.sdk/project/K5/ext/static/APP/alipay/1_12_1_1.png b/2.sdk/project/K5/ext/static/APP/alipay/1_12_1_1.png
deleted file mode 100644 (file)
index 3ab2ceb..0000000
Binary files a/2.sdk/project/K5/ext/static/APP/alipay/1_12_1_1.png and /dev/null differ
diff --git a/2.sdk/project/K5/ext/static/APP/alipay/1_2_2.png b/2.sdk/project/K5/ext/static/APP/alipay/1_2_2.png
deleted file mode 100644 (file)
index 7fcdf72..0000000
Binary files a/2.sdk/project/K5/ext/static/APP/alipay/1_2_2.png and /dev/null differ
diff --git a/2.sdk/project/K5/ext/static/APP/alipay/loading.jpg b/2.sdk/project/K5/ext/static/APP/alipay/loading.jpg
deleted file mode 100644 (file)
index 7726101..0000000
Binary files a/2.sdk/project/K5/ext/static/APP/alipay/loading.jpg and /dev/null differ
index cf45b10..aad2f01 100644 (file)
@@ -140,6 +140,7 @@ def main_init():
     ui.add_screen(_ui.DialingNoPlayPopupScreen())
     ui.add_screen(_ui.NovaliedNumScreen())
     ui.add_screen(_ui.DialNoconnectPopupScreen())
+    ui.add_screen(_ui.LowOnePowerScreen())
     ui.add_screen(NewWechatPopupScreen())
     ui.add_screen(HealthScreen())
     # ui.add_screen(_ui.Setting3Screen())  
index 7ece984..fef234e 100644 (file)
@@ -649,6 +649,8 @@ class DeviceInfoManager(Abstract):
         self.temp_state = 0
         self.temp_one_state = 0
 
+        self.vbat_count = 0
+
         self.usb = USB()
         self.usb.setCallback(self.usb_event_cb)
         self.log = LogAdapter(self.__class__.__name__)
@@ -793,6 +795,16 @@ class DeviceInfoManager(Abstract):
         EventMesh.publish(constants.EVENT.PUSH_STEP, self.get_step_count())
 
         
+        bat_tmp = EventMesh.publish("screen_get_battery")
+        self.vbat_count+=10
+        if self.vbat_count >= 50:
+            self.vbat_count = 0
+            if bat_tmp != None:
+                bat_value = bat_tmp[1]
+                bat_value = 0
+                if bat_value <= 0:
+                    bat_value = 10
+                    #EventMesh.publish("load_screen", {"screen": "LOW_ONE_POWER"})
         
         self.get_hr_state = EventMesh.publish("get_hr_state")
         self.get_spo2_state = EventMesh.publish("get_spo2_state")
@@ -912,6 +924,7 @@ class DeviceInfoManager(Abstract):
 
                                 tmp_d = str(temp).split('.')[1][:1]
                                 tmp_d_tmp = int(tmp_d)
+                                EventMesh.publish("set_history_temp_value",temp)
                                 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)
@@ -933,10 +946,14 @@ class DeviceInfoManager(Abstract):
 
                                         tmp_d = str(temp).split('.')[1][:1]
                                         tmp_d_tmp = int(tmp_d)
+                                        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)
                                         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)
-                                        EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
                         else:
                            self.temp_one_state = 0 
                            self.temp_state = 0
@@ -964,10 +981,14 @@ class DeviceInfoManager(Abstract):
 
                             tmp_d = str(temp).split('.')[1][:1]
                             tmp_d_tmp = int(tmp_d)
+                            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(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)
-                            EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+                            
 
             if hr_time != None:
                 # print("hr......01....{}\r\n".format(hr_time))
@@ -985,6 +1006,7 @@ class DeviceInfoManager(Abstract):
                                 heart_value = EventMesh.publish(constants.EVENT.GET_HEART)
                                 if heart_value > 50 and heart_value != None:
                                     EventMesh.publish("set_old_hr_data",heart_value)
+                                    EventMesh.publish("set_history_hr_value",heart_value)
                                     EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)
                                 print("stop debug1")
                                 EventMesh.publish(constants.EVENT.STOP_HEART)
@@ -994,6 +1016,7 @@ class DeviceInfoManager(Abstract):
                                 spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN)
                                 if spo2_value > 85 and spo2_value != None:
                                     EventMesh.publish("set_old_spo2_data",spo2_value)
+                                    EventMesh.publish("set_history_spo2_value",spo2_value)
                                     EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                                 EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
                         self.old_time = hr_time
@@ -1007,12 +1030,14 @@ class DeviceInfoManager(Abstract):
                                         heart_value = EventMesh.publish(constants.EVENT.GET_HEART)
                                         if heart_value > 50 and heart_value != None:
                                             EventMesh.publish("set_old_hr_data",heart_value)
+                                            EventMesh.publish("set_history_hr_value",heart_value)
                                             EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)
                                         
                                     elif self.get_spo2_state == 3:
                                         EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
                                         spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN)
                                         if spo2_value > 85 and spo2_value != None:
+                                            EventMesh.publish("set_history_spo2_value",spo2_value)
                                             EventMesh.publish("set_old_spo2_data",spo2_value)
                                             EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
 
@@ -1037,6 +1062,7 @@ class DeviceInfoManager(Abstract):
                             print("heart_value:{}".format(heart_value))
                             if heart_value > 50 and heart_value != None:
                                 EventMesh.publish("set_old_hr_data",heart_value)
+                                EventMesh.publish("set_history_hr_value",heart_value)
                                 EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据
                             #获取心率数据上传数据app
                             print("STOP_HEART:")
@@ -1052,6 +1078,7 @@ class DeviceInfoManager(Abstract):
                             print("spo2_value:{}".format(spo2_value))
                             if spo2_value > 85 and spo2_value != None:
                                 EventMesh.publish("set_old_spo2_data",spo2_value)
+                                EventMesh.publish("set_history_spo2_value",spo2_value)
                                 EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                             self.HR_state = 3
                     else:
@@ -1086,6 +1113,7 @@ class DeviceInfoManager(Abstract):
                                     EventMesh.publish(constants.EVENT.STOP_HEART)
                                     heart_value = EventMesh.publish(constants.EVENT.GET_HEART)
                                     if heart_value > 50 and heart_value != None:
+                                        EventMesh.publish("set_history_hr_value",heart_value)
                                         EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据
                                         EventMesh.publish("set_old_hr_data",heart_value)
                             
@@ -1111,6 +1139,7 @@ class DeviceInfoManager(Abstract):
                                         if spo2_value > 85 and spo2_value != None:
                                             EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                                             EventMesh.publish("set_old_spo2_data",spo2_value)
+                                            EventMesh.publish("set_history_spo2_value",spo2_value)
                                         if self.Hr_Need_Open == 0 and self.get_hr_state == 3:
                                             EventMesh.publish("set_hr_state",3)#2代表后台进入测试
                                             EventMesh.publish(constants.EVENT.START_HEART)
@@ -1129,6 +1158,7 @@ class DeviceInfoManager(Abstract):
                                     EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试
                                     spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN)
                                     if spo2_value > 85 and spo2_value != None:
+                                        EventMesh.publish("set_history_spo2_value",spo2_value)
                                         EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                                         EventMesh.publish("set_old_spo2_data",spo2_value)
                                 elif self.set_hsenor_crt == 1:
@@ -1137,6 +1167,7 @@ class DeviceInfoManager(Abstract):
                                     EventMesh.publish(constants.EVENT.STOP_HEART)
                                     heart_value = EventMesh.publish(constants.EVENT.GET_HEART)
                                     if heart_value > 50 and heart_value != None:
+                                        EventMesh.publish("set_history_hr_value",heart_value)
                                         EventMesh.publish("set_old_hr_data",heart_value)
                                         EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据
                                 self.HR_Onestate = 0
@@ -1176,6 +1207,7 @@ class DeviceInfoManager(Abstract):
                                     print("stop_heart heart_value:{}".format(heart_value))
                                     if heart_value > 50 and heart_value != None:
                                         EventMesh.publish("set_old_hr_data",heart_value)
+                                        EventMesh.publish("set_history_hr_value",heart_value)
                                         EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据
                                     if self.Spo2_Need_Open == 0 and self.get_spo2_state == 3:
                                         EventMesh.publish("set_spo2_state",3)#2代表后台进入血氧测试
@@ -1196,6 +1228,7 @@ class DeviceInfoManager(Abstract):
                                         print("spo2_value:{}.......01..".format(spo2_value))
                                         if spo2_value > 85 and spo2_value != None:
                                             EventMesh.publish("set_old_spo2_data",spo2_value)
+                                            EventMesh.publish("set_history_spo2_value",spo2_value)
                                             EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                                         if self.Hr_Need_Open == 0 and self.get_hr_state == 3:
                                             EventMesh.publish("set_hr_state",3)#2代表后台进入测试
@@ -1215,6 +1248,7 @@ class DeviceInfoManager(Abstract):
                                     spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN)
                                     if spo2_value > 85 and spo2_value != None:
                                         EventMesh.publish("set_old_spo2_data",spo2_value)
+                                        EventMesh.publish("set_history_spo2_value",spo2_value)
                                         EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                                 elif self.set_hsenor_crt == 1:
                                     EventMesh.publish("set_hr_state",0)#0代表g关闭测试
@@ -1223,6 +1257,7 @@ class DeviceInfoManager(Abstract):
                                     heart_value = EventMesh.publish(constants.EVENT.GET_HEART)
                                     if heart_value > 50 and heart_value != None:
                                         EventMesh.publish("set_old_hr_data",heart_value)
+                                        EventMesh.publish("set_history_hr_value",heart_value)
                                         EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据
                                 self.HR_Onestate = 0
                         else:
@@ -1250,7 +1285,10 @@ class DeviceInfoManager(Abstract):
                     tmp_d = str(temp).split('.')[1][:1]
                     tmp_d_tmp = int(tmp_d)
                     EventMesh.publish("set_temp_state",0)
-                    EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+                    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(constants.EVENT.STOP_TEMP)
             self.SENSOR_time = time_tmp
             self.HR_Onestate = 0
index 3b486e9..583448d 100644 (file)
@@ -5672,6 +5672,85 @@ class LowPowerScreen(Screen):
 
     def btn8_press(self):
         EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+LowOnePower_screen = None
+LowOnePower_screen_img = None
+LowOnePower_screen_label2 = None
+LowOnePower_screen_label1 = None
+class LowOnePowerScreen(Screen): #0%的电池电量
+    NAME = "LOW_ONE_POWER"
+    def __init__(self):
+        super().__init__()
+        self.meta = None
+        self.timer = osTimer()
+
+    def initialization(self):
+        global LowOnePower_screen ,LowOnePower_screen_img ,LowOnePower_screen_label2,LowOnePower_screen_label1
+        if LowOnePower_screen == None :
+            LowOnePower_screen = lv.obj()
+            print("LowOnePower_screen")
+            LowOnePower_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
+            # add style for watchface
+            LowOnePower_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT)
+            #进入图片
+            LowOnePower_screen_img = lv.img(LowOnePower_screen)
+            LowOnePower_screen_img.set_pos(int(86),int(30))
+            LowOnePower_screen_img.set_size(68,110)
+            LowOnePower_screen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
+            LowOnePower_screen_img.add_flag(lv.obj.FLAG.CLICKABLE)
+            LowOnePower_screen_img.set_src("E:/static/0_BAT.png")
+            LowOnePower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT)
+
+            LowOnePower_screen_label1 = lv.label(LowOnePower_screen)
+            LowOnePower_screen_label1.set_pos(0, 180)
+            LowOnePower_screen_label1.set_size(240, 30)
+            LowOnePower_screen_label1.set_text("电池电量过低,请及时充电")
+            LowOnePower_screen_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
+            LowOnePower_screen_label1.set_long_mode(lv.label.LONG.WRAP)
+            LowOnePower_screen_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
+
+            LowOnePower_screen_label2 = lv.label(LowOnePower_screen)
+            LowOnePower_screen_label2.set_pos(0, 240)
+            LowOnePower_screen_label2.set_size(240, 30)
+            LowOnePower_screen_label2.set_text("继续使用,5s过后强制关机")
+            LowOnePower_screen_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
+            LowOnePower_screen_label2.set_long_mode(lv.label.LONG.WRAP)
+            LowOnePower_screen_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
+
+            self.meta = LowOnePower_screen
+
+    def post_processor_after_initialization(self):
+        self.timer.start(5000,0,self.fun)
+
+    def fun(self,e):
+        EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"})
+
+    def done_left_to_right(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def done_right_to_left(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def done_bottom_to_top(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def done_top_to_bottom(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def done_return(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def done_click(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def btn1_release(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+    def btn8_press(self):
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+
+
 sos_screen = None
 sos_screen_label = None
 sos_screen_label_p = None