ui相关更改
authord15521469561 <d155214695615@qq.com>
Sat, 13 May 2023 01:38:59 +0000 (09:38 +0800)
committerd15521469561 <d155214695615@qq.com>
Sat, 13 May 2023 01:38:59 +0000 (09:38 +0800)
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/appWechat.py
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/mgr.py
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/ui.py

index a001675..82631aa 100644 (file)
@@ -478,25 +478,25 @@ class NewWechatPopupScreen(Screen):
         self.meta = wechat_popup_screen
 
     def done_left_to_right(self):
-        EventMesh.publish("wechat_updata_list_show")
+        # EventMesh.publish("wechat_updata_list_show")
         EventMesh.publish("load_screen", {"screen": "wechat"})
 
     def done_right_to_left(self):
-        EventMesh.publish("wechat_updata_list_show")
+        # EventMesh.publish("wechat_updata_list_show")
         EventMesh.publish("load_screen", {"screen": "wechat"})
 
     def done_bottom_to_top(self):
-        EventMesh.publish("wechat_updata_list_show")
+        # EventMesh.publish("wechat_updata_list_show")
         EventMesh.publish("load_screen", {"screen": "wechat"})
 
     def done_top_to_bottom(self):
-        EventMesh.publish("wechat_updata_list_show")
+        # EventMesh.publish("wechat_updata_list_show")
         EventMesh.publish("load_screen", {"screen": "wechat"})
 
     def done_return(self):
         EventMesh.publish("load_screen", {"screen": "main_menu"})
     def done_click(self):
-        EventMesh.publish("wechat_updata_list_show")
+        # EventMesh.publish("wechat_updata_list_show")
         EventMesh.publish("load_screen", {"screen": "wechat"})
 
     def btn1_release(self):
@@ -582,7 +582,8 @@ class TK_ProtoCol(ProtoCol):
             get_send_state=EventMesh.publish("get_send_state")
             if get_send_state != 1:
                 EventMesh.publish("load_screen", {"screen": "wechat_popup"})
-            EventMesh.publish("wechat_updata_list_show")
+            else:
+                EventMesh.publish("wechat_updata_list_show")
             # path = "/ext/static/storage_file/audio_amr/amr/{}.amr".format(wechat_num)
             path = "/ext/static/storage_file/{}.amr".format(wechat_num)
             with open(path,"w") as fd:
@@ -667,7 +668,8 @@ class MESSAGE_ProtoCol(ProtoCol):
         get_send_state=EventMesh.publish("get_send_state")
         if get_send_state != 1:
             EventMesh.publish("load_screen", {"screen": "wechat_popup"})
-        EventMesh.publish("wechat_updata_list_show")
+        else:
+            EventMesh.publish("wechat_updata_list_show")
             
 
 
index c6d76af..a3bca26 100644 (file)
@@ -581,11 +581,12 @@ class DeviceInfoManager(Abstract):
         self.bat_time = 0
         self.sms_full_flag = 0
         self.clear_step = 0
-
+        self.test = 0
         self.old_time = 0
         self.UD_time = 0
         self.upload_time = 0
         self.UD_timeout = 7*60
+        self.aud = audio.Audio(0)
         print("DeviceInfoManager:1")
         self.gsensor = SC7A20()
         print("DeviceInfoManager:1.0")
@@ -651,7 +652,7 @@ class DeviceInfoManager(Abstract):
 
         print("post_processor_after_instantiation:2")
         self.timer_push_schedule.start(10000, 1, self.publish_event)
-        # self.timer_push_schedule.start(1000, 1, self.publish_test)
+        # self.timer_push_schedule.start(2000, 1, self.publish_test)
         # self.battery_push_schedule.start(3000, 1, self.__check_battery)
         self.log.debug("post_processor_after_instantiation finished")
         #EventMesh.publish(constants.EVENT.START_HEART)
@@ -659,7 +660,12 @@ class DeviceInfoManager(Abstract):
         self.publish_event()
         print("post_processor_after_instantiation:3")
     def publish_test(self, *args, **kwargs):
-        pass
+        if self.test == 0:
+            self.test = 1
+            self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3')  #播放声音
+        elif self.test == 1:
+            self.aud.stop()
+            self.test = 0
         # self.read_data = {}
         # check = ql_fs.path_exists("/ext/static/storage_file/config.json")
         # if check == True:
@@ -745,7 +751,7 @@ class DeviceInfoManager(Abstract):
             if msg_nums >= 50:
                 EventMesh.publish("load_screen", {"screen": "message_full"})
         
-        
+
         if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 or battery[1] != 1:
             if hr_time != None:
                 # print("hr......01....{}\r\n".format(hr_time))
@@ -1375,7 +1381,7 @@ class SockManager(Abstract):
             if data[-1] != 0x5d and len(data)<20*1024: #']':
                 continue
             self.connect_tmp = 1 #有数据,就认为是连接状态
-            print("TCP:recv: data:{}".format(data))
+            # print("TCP:recv: data:{}".format(data))
             EventMesh.publish(constants.EVENT.SET_CONNECT, 1)
             data_str = data.decode('ascii')
             data_str = data_str.split(']')
index bdc2b34..cce8b67 100644 (file)
@@ -3239,6 +3239,7 @@ class UIFINDScreen(Screen):
 
     def initialization(self):
         global FIND_screen ,watchface_mpsignal_img 
+        
         if FIND_screen ==None:
             FIND_screen = lv.obj()
             FIND_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
@@ -3257,24 +3258,32 @@ class UIFINDScreen(Screen):
 
     def post_processor_after_initialization(self):
         utime.sleep_ms(200)#不加延时会切屏
+        self.FIND_timer_count = 0
+        print("self.FIND_timer_count:{}".format(self.FIND_timer_count))
         self.FIND_timer.start(3000, 1, self.FIND_timer_cb)
         self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3')  #播放声音
         pass
     def FIND_timer_cb(self, *args):
+               EventMesh.publish("system_sleep_rest")
         self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') 
         self.FIND_timer_count += 1
-        if self.FIND_timer_count > 40: #120秒
+        if self.FIND_timer_count > 20: #120秒
             self.stop_FIND()
     
     def stop_FIND(self) :
         self.FIND_timer.stop()
         self.aud.stopAll()
+        self.aud.stop(1, 1, 'E:/static/audio_audio_haixiu.mp3')  #播放声音
+        EventMesh.publish("load_screen", {"screen": "main_menu"})
+
     def Close(self):
-       self.stop_FIND()
+        print("self.FIND_timer_Close")
+        self.FIND_timer.stop()
+        self.aud.stop(1, 1, 'E:/static/audio_audio_haixiu.mp3')  #播放声音
 
     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):
@@ -3509,9 +3518,6 @@ class UI(object):
             utime.sleep_ms(100)
             EventMesh.publish("set_lcd_state",self.sleep_flag)
             self.level = EventMesh.publish("get_brightness_level")
-
-            self.read_data = EventMesh.publish("get_storage_data")
-            # print("self.read_data:{} self.level:{}".format(self.read_data,self.level))
             if self.level == None:
                 self.level = 6 
             elif self.level > 10: