k5:
authordxy15521469561 <1731678236@qq.com>
Sat, 19 Aug 2023 11:30:35 +0000 (19:30 +0800)
committerdxy15521469561 <1731678236@qq.com>
Sat, 19 Aug 2023 11:30:35 +0000 (19:30 +0800)
修复bug

2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/ui.py
2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/ui_setting.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/appFactoryMode.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/btn_device_ec800m.py
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/protocol.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_setting.py

index 08bdfa7..cef0c81 100644 (file)
@@ -890,7 +890,7 @@ class DeviceInfoManager(Abstract):
                 spo2 = EventMesh.publish("get_old_spo2_data")
                 if spo2 != 0:
                     EventMesh.publish("set_old_spo2_data", 0)
-            EventMesh.publish("set_old_time_data",time_tmp)
+                EventMesh.publish("set_old_time_data",time_tmp)
 
         if hour == 0:#清步数
             if min <= 1:
index 8e6abcd..b7f2e53 100644 (file)
@@ -3353,7 +3353,7 @@ class OnCallScreen(Screen):
         self.phone_list = []
         self.button = 0
         self.mute_state = 0
-        on_call_volum_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
+        on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT)
 
     def show_num(self):
         global on_call_screen_tab_label
@@ -3556,9 +3556,9 @@ class OnCallScreen(Screen):
         global on_call_screen_tab,on_call_screen,on_call_obj
         if self.mute_state == 0:#默认是开启
             self.mute_state = 1
-            on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
+            on_call_volum_label.set_style_text_color(lv.color_make(0, 169, 242), lv.STATE.DEFAULT)
         else:
-            on_call_volum_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
+            on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT)
             self.mute_state = 0
        # self.aud.setVolume(0)
         # if self.open_volum_state == 1:
index 8968100..311ba7e 100644 (file)
@@ -861,8 +861,7 @@ class RestoreScreen(Screen):
             ql_fs.mkdirs("/usr/static/storage_file")
         if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂
             EventMesh.publish(constants.PROTOCOL.DLT_SEND)
-        else:
-            Power.powerRestart()
+        Power.powerRestart()
 
     def concel(self, e):
         EventMesh.publish("load_screen", {"screen": "setting"})
index 94af60f..c5a7a40 100644 (file)
@@ -325,22 +325,22 @@ FactoryModeLocation_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAU
 
 FactoryModeLocation_WIFI_label = lv.label(FactoryModeLocation_screen)
 FactoryModeLocation_WIFI_label.set_text("WIFI:")
-FactoryModeLocation_WIFI_label.set_size(240, 100)
+FactoryModeLocation_WIFI_label.set_size(240, 120)
 FactoryModeLocation_WIFI_label.set_pos(0, 0)
 FactoryModeLocation_WIFI_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
 FactoryModeLocation_WIFI_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
 
 FactoryModeLocation_CALL_label = lv.label(FactoryModeLocation_screen)
 FactoryModeLocation_CALL_label.set_text("CALL:")
-FactoryModeLocation_CALL_label.set_size(240, 60)
-FactoryModeLocation_CALL_label.set_pos(0, 100)
+FactoryModeLocation_CALL_label.set_size(240, 100)
+FactoryModeLocation_CALL_label.set_pos(0, 120)
 FactoryModeLocation_CALL_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
 FactoryModeLocation_CALL_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
 
 FactoryModeLocation_GNSS_label = lv.label(FactoryModeLocation_screen)
 FactoryModeLocation_GNSS_label.set_text("GNSS:\n")
 FactoryModeLocation_GNSS_label.set_size(240, 200)
-FactoryModeLocation_GNSS_label.set_pos(0, 160)
+FactoryModeLocation_GNSS_label.set_pos(0, 220)
 FactoryModeLocation_GNSS_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
 FactoryModeLocation_GNSS_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
 
index 8715ada..4b0b2d7 100644 (file)
@@ -121,13 +121,27 @@ class BtnDevice(Abstract):
         if self.pwk_press == 1: #按按钮时不处理
             return
         if status == 1:#拔出
+            screen_NAME = EventMesh.publish("get_screen_NAME")
+            if screen_NAME != None:
+                if screen_NAME == "poweron":
+                    return
             # if(self.GPIO26_status == 1):
             #     EventMesh.publish("btn8_press")
             #self.__pwk_timer.start(self.__PowerDownTimeOut, 0, self.pwk_press_cb)
-            EventMesh.publish("load_screen", {"screen": "charge_in"})
+            bat_tmp = EventMesh.publish("screen_get_battery")
+            if bat_tmp !=  None:
+                if bat_tmp[0] == "1":
+                    EventMesh.publish("load_screen", {"screen": "charge_in"})
             pass
         elif status == 0:#插入usb
-            EventMesh.publish("load_screen", {"screen": "charge_out"})
+            screen_NAME = EventMesh.publish("get_screen_NAME")
+            if screen_NAME != None:
+                if screen_NAME == "poweron":
+                    return
+            bat_tmp = EventMesh.publish("screen_get_battery")
+            if bat_tmp !=  None:
+                if bat_tmp[0] == "0":
+                    EventMesh.publish("load_screen", {"screen": "charge_out"})
             # self.__pwk_timer.stop()
             # # print("btn_back:{}".format(mdls.screen_size_style[mdls.models][1]))
             # if self.pwk_press != 0:
index 0ee4b2d..c466701 100644 (file)
@@ -154,6 +154,7 @@ def main_init():
     ui.add_screen(_ui.chargefullScreen())
     ui.add_screen(_ui.chargeInScreen())
     ui.add_screen(_ui.chargeOutScreen())
+    ui.add_screen(_ui.restore_confirmScreen())
     ui.add_screen(NewWechatPopupScreen())
     ui.add_screen(HealthScreen())
     # ui.add_screen(_ui.Setting3Screen())  
index 904a10f..80197a8 100644 (file)
@@ -780,7 +780,7 @@ class DeviceInfoManager(Abstract):
 
     def gsensor_cb(self, para):
         print("gsensor_cb:{}".format(para))
-        flip_sw = EventMesh.publish("get_storage_key_data","flip_sw")
+        flip_sw = EventMesh.publish("get_storage_config","flip_sw")
         
         if para == 0: #跌倒报警
             pass
@@ -1904,13 +1904,13 @@ class LocationManager(Abstract):
         if step != 0:
             
 
-            tmp_data  = EventMesh.publish("get_storage_key_data","old_step_new")
+            tmp_data  = EventMesh.publish("get_storage_config","old_step_new")
             if tmp_data != None:
                 old_step = tmp_data
 
             if old_step !=  step:
-                EventMesh.publish("set_storage_key_data",["old_step",step])
-                EventMesh.publish("set_storage_key_data",["old_step_new",step])
+                EventMesh.publish("set_storage_config",["old_step",step])
+                EventMesh.publish("set_storage_config",["old_step_new",step])
                 
         old_step = step
         # step = str(EventMesh.publish(constants.EVENT.GET_STEP)[0])
@@ -2036,7 +2036,7 @@ class LocationManager(Abstract):
                         if len(match_gsv_data) >= 3:
                             #print("match_gsv_data[3]:{}".format(match_gsv_data[3]))
                             #if  (self.wifi_data != [] and self.cell_data != [] and self.location_timer_count > 10): #超过10秒且卫星个数少于3  
-                            if (int(match_gsv_data[3]) < 3 and self.wifi_data != [] and self.cell_data != [] and self.location_timer_count > 10): #超过10秒且卫星个数少于3
+                            if (int(match_gsv_data[3]) < 3 and self.wifi_data != [] and self.cell_data != [] and self.location_timer_count > 20): #超过10秒且卫星个数少于3
                                 self.Location_send([self.gps_data,self.wifi_data,self.cell_data])
                                 
                                 EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位    
@@ -2193,13 +2193,13 @@ class gethistoryDataManager(Abstract):
         self.read_histroy_temp_data = []
         self.read_histroy_spo2_data = []
 
-        oldHr  = EventMesh.publish("get_storage_key_data","old_hr")
+        oldHr  = EventMesh.publish("get_storage_config","old_hr")
         if oldHr != None:
             self.oldHr = oldHr  
-        old_spo2  = EventMesh.publish("get_storage_key_data","old_spo2")
+        old_spo2  = EventMesh.publish("get_storage_config","old_spo2")
         if old_spo2 != None:
             self.oldspo2 = old_spo2 
-        old_step  = EventMesh.publish("get_storage_key_data","old_step")    
+        old_step  = EventMesh.publish("get_storage_config","old_step")    
         if old_step != None:
             self.oldstep = old_step
 
@@ -2242,7 +2242,7 @@ class gethistoryDataManager(Abstract):
         EventMesh.subscribe("get_history_spo2_value", self.get_history_spo2_value)
         EventMesh.subscribe("set_history_spo2_value", self.set_history_spo2_value)
 
-    def get_history_spo2_value(self, event, msg): #近7次体温历史数据统计显示
+    def get_history_spo2_value(self, event, msg): #近7次血氧历史数据统计显示
         return self.read_histroy_spo2_data
 
     def set_history_spo2_value(self, event, msg): 
@@ -2270,7 +2270,7 @@ class gethistoryDataManager(Abstract):
             else:
                 self.read_histroy_temp_data.append({"timeSec": time_tmp, "temp": self.temp_value}) 
 
-            with open("/ext/static/storage_file/history_spo2.json","w",encoding="utf-8") as fd:
+            with open("/ext/static/storage_file/history_temp.json","w",encoding="utf-8") as fd:
                 ujson.dump(self.read_histroy_temp_data,fd)
             #print(self.read_histroy_temp_data)
 
@@ -2284,7 +2284,7 @@ class gethistoryDataManager(Abstract):
 
     def save_hr_value(self, event, msg): 
         if msg >= 50:
-            EventMesh.publish("set_storage_key_data",["old_hr",msg])
+            EventMesh.publish("set_storage_config",["old_hr",msg])
             self.oldHr = msg
             
 
@@ -2313,7 +2313,7 @@ class gethistoryDataManager(Abstract):
 
     def save_spo2_value(self, event, msg): 
         if msg >= 85:
-            EventMesh.publish("set_storage_key_data",["old_spo2",msg])
+            EventMesh.publish("set_storage_config",["old_spo2",msg])
             self.oldspo2 = msg
 
 
@@ -2351,7 +2351,7 @@ class getOldTimeManager(Abstract):
     # 获取天气数据
     def __init__(self):
         self.time_sec = 0
-        tmp_data = EventMesh.publish("get_storage_key_data","old_time")
+        tmp_data = EventMesh.publish("get_storage_config","old_time")
         if tmp_data !=None :
             self.time_sec = tmp_data
           
@@ -2364,7 +2364,7 @@ class getOldTimeManager(Abstract):
 
     def set_old_time_data(self, event, msg):
         self.time_sec = msg
-        EventMesh.publish("set_storage_key_data",["old_time",msg])
+        EventMesh.publish("set_storage_config",["old_time",msg])
 
         
 
@@ -2410,10 +2410,10 @@ class getHrTimeManager(Abstract):
         self.set_hr = 0 #0关闭 1手动 2 自动测量按照时间间隔测试心率
         self.set_spo2 = 0
         self.open_btn = 0
-        read_data = EventMesh.publish("get_storage_key_data","measure_time")
+        read_data = EventMesh.publish("get_storage_config","measure_time")
         if read_data != None:
             self.set_time = read_data  
-        read_data = EventMesh.publish("get_storage_key_data","open_hr_btn")
+        read_data = EventMesh.publish("get_storage_config","open_hr_btn")
                 
         if read_data != None:
             self.open_btn = read_data   
@@ -2432,8 +2432,8 @@ class getHrTimeManager(Abstract):
     def set_time_hr_spo2(self, event, msg): 
         self.open_btn = msg[0]
         self.set_time = msg[1]
-        EventMesh.publish("set_storage_key_data",["measure_time",self.set_time])
-        EventMesh.publish("set_storage_key_data",["open_hr_btn",self.open_btn])
+        EventMesh.publish("set_storage_config",["measure_time",self.set_time])
+        EventMesh.publish("set_storage_config",["open_hr_btn",self.open_btn])
 
     def get_time_hr_spo2(self, event, msg): 
         return [self.open_btn,self.set_time]
@@ -2455,7 +2455,7 @@ class getTempTimeManager(Abstract):
     def __init__(self):
         self.set_time = 0
         self.get_temp = 0
-        read_data = EventMesh.publish("get_storage_key_data","temp_time")
+        read_data = EventMesh.publish("get_storage_config","temp_time")
 
         if read_data != None:
             self.set_time = read_data
@@ -2471,7 +2471,7 @@ class getTempTimeManager(Abstract):
 
     def set_temp_time(self, event, msg): 
         self.set_time = msg
-        EventMesh.publish("set_storage_key_data",["set_temp_time",self.set_time])
+        EventMesh.publish("set_storage_config",["set_temp_time",self.set_time])
 
     def get_temp_time(self, event, msg): 
         return self.set_time
@@ -2501,20 +2501,20 @@ class getBrightnessManager(Abstract):#获取亮度级别
 
     def set_brightness_level(self, event, msg): 
         self.level = msg
-        EventMesh.publish("set_storage_key_data", ["brightness_level",self.level])
+        EventMesh.publish("set_storage_config", ["brightness_level",self.level])
 
     def get_brightness_level(self, event, msg): 
-        tmp = EventMesh.publish("get_storage_key_data","brightness_level")
+        tmp = EventMesh.publish("get_storage_config","brightness_level")
         if tmp != None:
             self.level = tmp
         return self.level
     
     def set_brightness_time(self, event, msg): 
         self.time = msg
-        EventMesh.publish("set_storage_key_data", ["brightness_time",self.time])
+        EventMesh.publish("set_storage_config", ["brightness_time",self.time])
     
     def get_brightness_time(self, event, msg): 
-        tmp = EventMesh.publish("get_storage_key_data","brightness_time")
+        tmp = EventMesh.publish("get_storage_config","brightness_time")
         if tmp != None:
             self.time = tmp
         return self.time
@@ -2526,7 +2526,7 @@ class getBrightnessManager(Abstract):#获取亮度级别
             self.level = self.level + 2
         self.PWM_backlight = PWM(PWM.PWM1, PWM.ABOVE_MS, self.level, 10)
         self.PWM_backlight.open()
-        EventMesh.publish("set_storage_key_data", ["brightness_level",self.level])
+        EventMesh.publish("set_storage_config", ["brightness_level",self.level])
 
 
     def reduce(self, event, msg):
@@ -2538,7 +2538,7 @@ class getBrightnessManager(Abstract):#获取亮度级别
             self.PWM_backlight = PWM(PWM.PWM1, PWM.ABOVE_MS,self.level, 10)
 
         self.PWM_backlight.open()
-        EventMesh.publish("set_storage_key_data", ["brightness_level",self.level])
+        EventMesh.publish("set_storage_config", ["brightness_level",self.level])
        
     
 class getStorageDataManager(Abstract):#获取内存数据
@@ -2554,31 +2554,35 @@ class getStorageDataManager(Abstract):#获取内存数据
 
     def post_processor_after_instantiation(self):
         EventMesh.subscribe("set_storage_data", self.set_storage_data)
-        EventMesh.subscribe("set_storage_key_data", self.set_storage_key_data)
+        EventMesh.subscribe("set_storage_config", self.set_storage_config)
         EventMesh.subscribe("get_storage_data", self.get_storage_data)
-        EventMesh.subscribe("get_storage_key_data", self.get_storage_key_data)
+        EventMesh.subscribe("get_storage_config", self.get_storage_config)
 
     def set_storage_data(self, event, msg): 
-        print("set_storage_data:{}".format(msg))
+        # print("set_storage_data:{}".format(msg))
         if msg != None:
             self.config_data = msg
             with open("/ext/static/storage_file/config.json",'w+',encoding="utf-8") as fd:
                 ujson.dump(self.config_data,fd)
-    def set_storage_key_data(self, event, msg): 
-        print("set_storage_key_data1:{}".format(msg))
+    
+
+    def set_storage_config(self,event,msg): 
+        # print("set_storage_key_data1:{}".format(msg))
         if len(msg) >= 2:
             self.config_data[msg[0]]=msg[1]
-            print("set_storage_key_data2:{}".format(self.config_data[msg[0]]))
+            # print("set_storage_key_data2:{}".format(self.config_data[msg[0]]))
+            EventMesh.publish("publish_message_event_ui",{"func":self.set_storage_save,"data":0})
+    def set_storage_save(self, data): 
             with open("/ext/static/storage_file/config.json",'w+',encoding="utf-8") as fd:
                 ujson.dump(self.config_data,fd)
     def get_storage_data(self, event, msg): 
-        print("get_storage_data:{}".format(self.config_data))
+        # print("get_storage_data:{}".format(self.config_data))
         return self.config_data 
-    def get_storage_key_data(self,event,msg):
-        print("get_storage_key_data1:{}".format(msg))
+    def get_storage_config(self,event,msg):
+        # print("get_storage_key_data1:{}".format(msg))
         b = msg in self.config_data.keys()
         if b == True:
-            print("get_storage_key_data2:{}".format(self.config_data[msg]))
+            # print("get_storage_key_data2:{}".format(self.config_data[msg]))
             return self.config_data[msg]
         else :
             return None
@@ -2591,7 +2595,7 @@ class getStorageDataManager(Abstract):#获取内存数据
 class getUpLoadDataManager(Abstract):#
     def __init__(self):
         self.upload_time = 1800
-        read_data = EventMesh.publish("get_storage_key_data","upload_time")
+        read_data = EventMesh.publish("get_storage_config","upload_time")
         if read_data != None:
             self.upload_time = read_data 
            
@@ -2623,7 +2627,7 @@ class getplayAudiodStateManager(Abstract):#获取设置播放音频状态
 class getVolumSizeManager(Abstract):#设置或获取音量大小数据
     def __init__(self):
         self.volume_size = 8
-        read_data = EventMesh.publish("get_storage_key_data","volum")
+        read_data = EventMesh.publish("get_storage_config","volum")
         if read_data != None:
             self.volume_size = read_data
     
@@ -2633,7 +2637,7 @@ class getVolumSizeManager(Abstract):#设置或获取音量大小数据
 
     def set_volum_size(self, event, msg): 
         self.volume_size = msg
-        EventMesh.publish("set_storage_key_data", ["volum",self.volume_size])
+        EventMesh.publish("set_storage_config", ["volum",self.volume_size])
 
     def get_volum_size(self, event, msg): 
         return self.volume_size
@@ -2646,14 +2650,14 @@ class getSosFlagManager(Abstract):#设置sos
         self.call_timer = osTimer()
         self.sos_numer1 = []
         self.callnumer =""
-        SOS_NUMBER1 = EventMesh.publish("get_storage_key_data","SOS_NUMBER1")
+        SOS_NUMBER1 = EventMesh.publish("get_storage_config","SOS_NUMBER1")
         if SOS_NUMBER1 != None:
                 self.sos_numer1 = SOS_NUMBER1
-        SOS_NUMBER2 = EventMesh.publish("get_storage_key_data","SOS_NUMBER2")
+        SOS_NUMBER2 = EventMesh.publish("get_storage_config","SOS_NUMBER2")
         if SOS_NUMBER1 != None:        
             self.sos_numer1 = [SOS_NUMBER1, SOS_NUMBER2]
 
-        SOS_NUMBER3 = EventMesh.publish("get_storage_key_data","SOS_NUMBER3")
+        SOS_NUMBER3 = EventMesh.publish("get_storage_config","SOS_NUMBER3")
         if SOS_NUMBER3 != None:        
             self.sos_numer1 = [SOS_NUMBER1, SOS_NUMBER2,SOS_NUMBER3]
 
@@ -2722,7 +2726,7 @@ class getLowBatManager(Abstract):#低电提醒
     def __init__(self):
 
         self.low_btn = 0
-        read_data = EventMesh.publish("get_storage_key_data","low_on")
+        read_data = EventMesh.publish("get_storage_config","low_on")
         if read_data != None:
             self.low_btn = read_data
 
@@ -2732,7 +2736,7 @@ class getLowBatManager(Abstract):#低电提醒
 
     def set_low_bat_btn(self, event, msg): 
         self.low_btn = msg
-        EventMesh.publish("set_storage_key_data",["low_on",self.low_btn])
+        EventMesh.publish("set_storage_config",["low_on",self.low_btn])
 
     def get_low_bat_btn(self, event, msg): 
         return self.low_btn
@@ -2761,13 +2765,13 @@ class getBootOffManager(Abstract):#开关机时间
         self.off_flag = 0
         self.rtc =  RTC()
         
-        read_data = EventMesh.publish("get_storage_key_data","off_on")
+        read_data = EventMesh.publish("get_storage_config","off_on")
         if read_data != None:
             self.off_on = read_data
-        read_data = EventMesh.publish("get_storage_key_data","off_start")
+        read_data = EventMesh.publish("get_storage_config","off_start")
         if read_data != None:
             self.off_start= read_data
-        read_data = EventMesh.publish("get_storage_key_data","off_end")
+        read_data = EventMesh.publish("get_storage_config","off_end")
         if read_data != None:
             self.off_end = read_data
 
@@ -2777,9 +2781,9 @@ class getBootOffManager(Abstract):#开关机时间
         EventMesh.subscribe("get_boot_off_time", self.get_boot_off_time)
 
     def set_boot_off_time(self, event, msg): 
-        EventMesh.publish("get_storage_key_data",["off_on",msg[0]])
-        EventMesh.publish("get_storage_key_data",["off_start",msg[1]])
-        EventMesh.publish("get_storage_key_data",["off_end",msg[2]])
+        EventMesh.publish("get_storage_config",["off_on",msg[0]])
+        EventMesh.publish("get_storage_config",["off_start",msg[1]])
+        EventMesh.publish("get_storage_config",["off_end",msg[2]])
         self.off_msg = msg
 
 
@@ -2819,13 +2823,13 @@ class testSmsSetIPManager(Abstract):#
         self.newip = "api.xcloudtech.com"#默认防走丢协议
         self.newcom = 9000
         self.newmd5 = "bZld0ALsZTt15tKEZhOlLPgbsO75BLTP"
-        tmp_data = EventMesh.publish("get_storage_key_data","set_new_ip_addr")
+        tmp_data = EventMesh.publish("get_storage_config","set_new_ip_addr")
         if tmp_data != None:
             self.newip = tmp_data
-        tmp_data = EventMesh.publish("get_storage_key_data","set_new_com")
+        tmp_data = EventMesh.publish("get_storage_config","set_new_com")
         if tmp_data != None:
             self.newcom = tmp_data
-        tmp_data = EventMesh.publish("get_storage_key_data","set_new_md5")
+        tmp_data = EventMesh.publish("get_storage_config","set_new_md5")
         if tmp_data != None:
             self.newmd5 = tmp_data    
 
@@ -2844,8 +2848,8 @@ class testSmsSetIPManager(Abstract):#
         # self.read_data["set_new_md5"] = self.newmd5  #通过短信设置ip的key密钥
        
 
-        EventMesh.publish("set_storage_key_data",["set_new_ip_addr",self.newip])
-        EventMesh.publish("set_storage_key_data",["set_new_com",self.newcom])
+        EventMesh.publish("set_storage_config",["set_new_ip_addr",self.newip])
+        EventMesh.publish("set_storage_config",["set_new_com",self.newcom])
 
         number = str(msg[2])
         sms.sendPduMsg(number, 'set ok', 'UCS2')
index 55e1b07..85f106c 100644 (file)
@@ -470,14 +470,14 @@ class KA_ProtoCol(ProtoCol):
         step = 0
         step = EventMesh.publish("get_old_step_value")
         if step != 0:
-            read_data = EventMesh.publish("get_storage_key_data","old_step_new")
+            read_data = EventMesh.publish("get_storage_config","old_step_new")
             if read_data != None:
                 old_step = read_data
             
             if old_step !=  step:
                 # print("old_step:send:%d %d"%(old_step,step))
-                EventMesh.publish("set_storage_key_data",["old_step_new",step+10])
-                EventMesh.publish("set_storage_key_data",["old_step_new",step])
+                EventMesh.publish("set_storage_config",["old_step_new",step+10])
+                EventMesh.publish("set_storage_config",["old_step_new",step])
 
         old_step = step
         # step = EventMesh.publish(constants.EVENT.GET_STEP)[0]
@@ -1028,7 +1028,7 @@ class DLT_ProtoCol(ProtoCol):
         @param msg: 接收到的下行数据
         """
         # print("DLT_ProtoCol RECV msg:")
-        reset_factory(1)
+        
 
 #定位频率
 class UPLOAD_ProtoCol(ProtoCol):
@@ -1055,7 +1055,7 @@ class UPLOAD_ProtoCol(ProtoCol):
         msg_tmp = msg_tmp.split(',')
         msg_tmp = msg_tmp[1]
         upload_time = int(msg_tmp)
-        EventMesh.publish("set_storage_key_data",["upload_time",upload_time])
+        EventMesh.publish("set_storage_config",["upload_time",upload_time])
 
         EventMesh.publish("set_upload_data", upload_time)
         EventMesh.publish(constants.PROTOCOL.UPLOAD_SEND)
@@ -1086,7 +1086,7 @@ class CENTER_ProtoCol(ProtoCol):
         msg_tmp = msg_tmp[1]
         print("CENTER_ProtoCol RECV msg:{} msg_:{}".format(msg,msg_tmp))
         center_dial = str(msg_tmp)
-        EventMesh.publish("set_storage_key_data",["center_dial",center_dial])
+        EventMesh.publish("set_storage_config",["center_dial",center_dial])
         EventMesh.publish(constants.PROTOCOL.CENTER_SEND)  
 
 #呼叫快捷电话号码
@@ -1109,7 +1109,7 @@ class MONITOR_ProtoCol(ProtoCol):
         @param msg: 接收到的下行数据
         """
         # b'[SZKW*867387060319166*000A*MONITOR]'
-        read_data = EventMesh.publish("set_storage_key_data","center_dial")
+        read_data = EventMesh.publish("set_storage_config","center_dial")
 
         if read_data != None: 
             contact = read_data
@@ -1180,7 +1180,7 @@ class sosHome_dial_ProtoCol(ProtoCol):
         for i in range(len(msg_tmp)-1):
             # print("sos:send data :{}".format(msg_tmp[i+1]))
             if len(msg_tmp[i+1]) != 0:
-                EventMesh.publish("set_storage_key_data",["SOS_NUMBER{}".format(i+1),msg_tmp[i+1]])
+                EventMesh.publish("set_storage_config",["SOS_NUMBER{}".format(i+1),msg_tmp[i+1]])
                 # print("read_data:{} msg_tmp:{}".format(read_data,msg_tmp[i+1]))
        
         if (len(msg_tmp)-1) == 3:
index 8f93981..d0e0d09 100644 (file)
@@ -2305,6 +2305,8 @@ class MsgDetailScreen(Screen):
             msg_detail_cont.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT)
             self.meta = msg_detail_screen
         #获取字符串
+        
+        
         msg_detail_cont_obj.scroll_to(0, 0, lv.ANIM.OFF)
         
         self.name = EventMesh.publish("get_msg_name")
@@ -2314,6 +2316,11 @@ class MsgDetailScreen(Screen):
         # msg_detail_cont.set_size(240, tmp_y)
         msg_detail_cont.set_text(self.content)
 
+        
+    def post_processor_after_initialization(self):
+        size = msg_detail_cont.get_height()
+        print("size:",size)
+    
     def done_return(self):
         EventMesh.publish("load_screen", {"screen": "popup"})
 
@@ -3273,12 +3280,12 @@ class OnCallScreen(Screen):
         on_call_label_name.set_text(name)
         # on_call_label.set_text(str(self.meta_info))
         on_call_second_label.set_text("00:00")
-        on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
+        on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT)
         self.phone_num = ''
         self.phone_list = []
         self.button = 0
         self.mute_btn = 0
-        voiceCall.mute(2,1,0)
+        voiceCall.mute(2,0,0)
 
     def show_num(self):
         global on_call_screen_tab_label
@@ -3421,13 +3428,13 @@ class OnCallScreen(Screen):
         global on_call_screen_tab,on_call_screen,on_call_obj
         if self.mute_btn == 0:#默认是开启
             self.mute_btn = 1
-            voiceCall.mute(2,0,0)
-            on_call_volum_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
+            voiceCall.mute(2,1,0)
+            on_call_volum_label.set_style_text_color(lv.color_make(0, 169, 242), lv.STATE.DEFAULT)
         else:
 
-            on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
+            on_call_volum_label.set_style_text_color(lv.color_make(255, 255, 255), lv.STATE.DEFAULT)
             self.mute_btn = 0
-            voiceCall.mute(2,1,0)
+            voiceCall.mute(2,0,0)
        # self.aud.setVolume(0)
         # if self.open_volum_state == 1:
         #     self.open_volum_state = 0
@@ -4566,7 +4573,7 @@ class Spo2Screen(Screen):
         self.point = self.point + 1
         EventMesh.publish("system_sleep_rest")#防止黑屏
         WEAR = EventMesh.publish(constants.EVENT.GET_WEAR)#佩戴数据
-        print("sop2:start_measure:point{}".format(self.point))
+        # print("sop2:start_measure:point{}".format(self.point))
         self.spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN)
         if self.point >= 2:
             if self.spo2_value != 0:
@@ -6189,6 +6196,85 @@ class chargeOutScreen(Screen):
     def btn1_release(self):
         EventMesh.publish("return_prev_screen")
         pass
+rrestor_confirm_n_screen = None
+rrestor_confirm_n_screen_label = None
+
+#正在充电
+class restore_confirmScreen(Screen):
+    NAME = "restore_confirm"
+    def __init__(self):
+        super().__init__()
+        self.meta = None
+        self.meta_type = "popup"
+        self.count = 0
+        self.timer1 = osTimer()
+        self.timer2 = osTimer()
+
+    def initialization(self):
+        global rrestor_confirm_n_screen ,rrestor_confirm_n_screen_label  
+        if rrestor_confirm_n_screen == None :
+            rrestor_confirm_n_screen = lv.obj()
+            print("rrestor_confirm_n_screen")
+            rrestor_confirm_n_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
+            # add style for watchface
+            rrestor_confirm_n_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT)
+            #进入图片
+
+            rrestor_confirm_n_screen_label = lv.label(rrestor_confirm_n_screen)
+            rrestor_confirm_n_screen_label.set_pos(0, 150)
+            rrestor_confirm_n_screen_label.set_size(240, 60)
+            rrestor_confirm_n_screen_label.set_text("正在恢复出厂中\n请稍等...")
+            rrestor_confirm_n_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
+            rrestor_confirm_n_screen_label.set_long_mode(lv.label.LONG.WRAP)
+            rrestor_confirm_n_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
+
+
+            self.meta = rrestor_confirm_n_screen
+        self.timer1.start(1000,1,self.timer_cb_onescond)
+        self.timer2.start(3000,0,self.timer_cb_threescond)
+        ret = 0
+        ret = ql_fs.path_exists("/ext/static/storage_file")#电话本
+        if ret == True:
+            ql_fs.rmdirs("/ext/static/storage_file")
+            ql_fs.mkdirs("/ext/static/storage_file")
+        EventMesh.publish("alipay_unbind")
+        if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂
+            EventMesh.publish(constants.PROTOCOL.DLT_SEND)
+       
+
+
+    def Close(self):
+        self.timer1.stop()
+        self.timer2.stop()
+
+    def timer_cb_threescond(self,e):
+
+        Power.powerRestart()
+
+    def timer_cb_onescond(self,e):
+        EventMesh.publish("system_sleep_rest")#防止黑屏
+
+
+    def done_left_to_right(self):
+        pass
+    def done_right_to_left(self):
+        pass
+    def done_bottom_to_top(self):
+        pass
+    def done_top_to_bottom(self):
+        pass
+    def done_return(self):
+        pass
+    def done_click(self):
+        pass
+
+    def btn8_press(self):
+        pass
+    def btn1_press(self):
+        pass
+    def btn1_release(self):
+        pass
+
 
 
 #from usr.ui_WatchFaceScreen import WatchFaceScreen
index 9cbdc68..c9418ef 100644 (file)
@@ -604,7 +604,7 @@ class WatchFace():
         self.timer_update = osTimer()
         EventMesh.subscribe("set_change_face", self.change_face)
         self.PWM_backlight  = None
-        read_data = EventMesh.publish("get_storage_key_data","watchface")
+        read_data = EventMesh.publish("get_storage_config","watchface")
         if read_data != None:
             self.watchface_style_num = read_data
 
index 18898b2..010f1eb 100644 (file)
@@ -804,8 +804,8 @@ version_label8.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
 version_label8.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
 
 version_label9 = lv.label(version_screen)
-version_label9.set_pos(20, 240)
-version_label9.set_size(220, 30)
+version_label9.set_pos(0, 240)
+version_label9.set_size(240, 30)
 version_label9.set_long_mode(lv.label.LONG.WRAP)
 version_label9.set_text(" ")
 version_label9.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
@@ -852,16 +852,7 @@ class RestoreScreen(Screen):
         
     
     def confirm(self, e):
-        ret = 0
-        ret = ql_fs.path_exists("/ext/static/storage_file")#电话本
-        if ret == True:
-            ql_fs.rmdirs("/ext/static/storage_file")
-            ql_fs.mkdirs("/ext/static/storage_file")
-        EventMesh.publish("alipay_unbind")
-        if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂
-            EventMesh.publish(constants.PROTOCOL.DLT_SEND)
-        else:
-            Power.powerRestart()
+        EventMesh.publish("load_screen", {"screen": "restore_confirm"})
         
 
     def concel(self, e):
@@ -1030,7 +1021,7 @@ class PowerOnScreen(Screen):
         self.aud.set_pa(Pin.GPIO29)
         read_data = {}
         self.volum_size = 8
-        check_volum = EventMesh.publish("get_storage_key_data","volum")
+        check_volum = EventMesh.publish("get_storage_config","volum")
 
         if check_volum != None:
             self.volum_size = read_data["volum"]  
@@ -1094,10 +1085,10 @@ class PoweroffConfirmScreen(Screen):
     def initialization(self):
         step = EventMesh.publish("get_old_step_value")
         if step != 0:
-            EventMesh.publish("set_storage_key_data",["old_step",step])
+            EventMesh.publish("set_storage_config",["old_step",step])
             
         date_tmp = utime.localtime()
-        EventMesh.publish("set_storage_key_data",["old_timesecond",date_tmp])#关机保存一个是时间
+        EventMesh.publish("set_storage_config",["old_timesecond",date_tmp])#关机保存一个是时间
 
         #print("self.read_data:{}".format(self.read_data))
         EventMesh.publish("play_poewr_off_event")#
@@ -1203,7 +1194,7 @@ class DialswitchScreen(Screen):
     def initialization(self):
         self.dial_num = 1
         self.move = 0
-        read_data = EventMesh.publish("get_storage_key_data","watchface")
+        read_data = EventMesh.publish("get_storage_config","watchface")
 
         if read_data != None:
             self.watchface_style_num = read_data
@@ -1221,7 +1212,7 @@ class DialswitchScreen(Screen):
             self.timer.start(50,0,self.enter_main_show)
             
     def enter_main_show(self,e):
-        EventMesh.publish("set_storage_key_data",["watchface","Watchface{}".format(self.dial_num)])
+        EventMesh.publish("set_storage_config",["watchface","Watchface{}".format(self.dial_num)])
         EventMesh.publish("set_change_face", "Watchface{}".format(self.dial_num))
         EventMesh.publish("watch_top_show")
         EventMesh.publish("load_screen", {"screen": "main_menu"})
@@ -1462,16 +1453,24 @@ brightness_time_add_imgbtn.set_pos(170, 140)
 brightness_time_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE)
 
 brightness_flip_label = lv.label(brightness_screen)
-brightness_flip_label.set_pos(0, 260)
+brightness_flip_label.set_pos(0, 270)
 brightness_flip_label.set_size(140, 40)
 brightness_flip_label.set_text("翻腕亮屏")
 #brightness_flip_label.set_long_mode(lv.label.LONG.WRAP)
 brightness_flip_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0)
 brightness_flip_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
 brightness_flip_sw = lv.switch(brightness_screen)
-brightness_flip_sw.set_pos(140, 250)
+brightness_flip_sw.set_pos(140, 260)
 brightness_flip_sw.set_size(80, 40)
 
+brightness_flip_label_btn = lv.label(brightness_screen)
+brightness_flip_label_btn.set_pos(135, 255)
+brightness_flip_label_btn.set_size(105, 65)
+brightness_flip_label_btn.set_text(" ")
+brightness_flip_label_btn.add_flag(lv.obj.FLAG.CLICKABLE)
+
+
+
 class BrightnessScreen(Screen):
     NAME = "brightness"
 
@@ -1479,6 +1478,7 @@ class BrightnessScreen(Screen):
         super().__init__()
         self.level = 6
         self.time = 10
+        self.flip_sw =0
         self.meta = brightness_screen
         brightness_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_level(e)),
                                      lv.EVENT.CLICKED, None)
@@ -1490,7 +1490,7 @@ class BrightnessScreen(Screen):
 
         brightness_time_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_time_level(e)),
                                      lv.EVENT.CLICKED, None)
-        brightness_flip_sw.add_event_cb(lambda e: EventMesh.callback_wrapper(self.flip_sw_cb(e)),lv.EVENT.ALL, None)
+        brightness_flip_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.flip_sw_cb(e)),lv.EVENT.CLICKED, None)
     def initialization(self):
         self.level = EventMesh.publish("get_brightness_level")
         self.time = EventMesh.publish("get_brightness_time")
@@ -1498,6 +1498,13 @@ class BrightnessScreen(Screen):
         if self.time == None:
             self.time = 5
         brightness_label_time_text.set_text("{}秒".format(self.time))
+        EventMesh.publish("get_storage_config","flip_sw")
+        if self.flip_sw == None:
+            self.flip_sw = 0
+        if self.flip_sw == 0: 
+            brightness_flip_sw.clear_state(lv.STATE.CHECKED)
+        else:
+            brightness_flip_sw.add_state(lv.STATE.CHECKED)
         self.show_bar()
     def add_level(self, e):
         EventMesh.publish("push_add_brightness_level")
@@ -1513,15 +1520,15 @@ class BrightnessScreen(Screen):
     def flip_sw_cb(self,e):
         code = e.get_code()
         obj = e.get_target()
-        if code == lv.EVENT.VALUE_CHANGED:
-            flip_sw = 0
-            if obj.has_state(lv.STATE.CHECKED):
-                print("flip_sw_cb: on")
-                flip_sw = 1
+        if code == lv.EVENT.CLICKED:
+            if self.flip_sw == 0:
+                self.flip_sw = 1
+                brightness_flip_sw.add_state(lv.STATE.CHECKED)
             else:
-                print("flip_sw_cb: off")
-                flip_sw = 0
-            EventMesh.publish("set_storage_key_data",["flip_sw",flip_sw])
+                self.flip_sw = 0
+                brightness_flip_sw.clear_state(lv.STATE.CHECKED)
+            # print("self.flip_sw:",self.flip_sw)
+            EventMesh.publish("set_storage_config",["flip_sw",self.flip_sw]) 
 
     def reduce_time_level(self, e):
         if self.time > 5: