From: d15521469561 Date: Mon, 8 May 2023 12:33:58 +0000 (+0800) Subject: 上传亮屏时间图片 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=78221ab7912280eab19211558286c38874223a32;p=mirrors%2FASR1603_G5.git 上传亮屏时间图片 --- diff --git a/3.code/1.watch/2.code/main.py b/3.code/1.watch/2.code/main.py index ba2c50b8..d4cd94fc 100644 --- a/3.code/1.watch/2.code/main.py +++ b/3.code/1.watch/2.code/main.py @@ -42,19 +42,20 @@ if __name__ == '__main__': uos.mount(ldev,'/ext') res = uos.statvfs("/ext") res = list(res) - print('总ext空间:{} MB,剩余空é—?:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) + print('总ext空间:{} MB,剩余空间:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) print("init1:{}".format(utime.localtime())) import EventMesh from common import Abstract print("init2:{}".format(utime.localtime())) from lcd import tp_cst816 print("init3:{}".format(utime.localtime())) - from btn_device_ec800m import BtnDevice + from ui_main_menu import MainMenuScreen # from ui_WatchFaceScreen import WatchFaceScreen from appFactoryMode import FactoryModeLocationScreen,FactoryModeScreen import ui as _ui + # import ui as _ui print("init4:{}".format(utime.localtime())) ui = _ui.UI() ui.post_processor_after_instantiation() @@ -129,12 +130,12 @@ if __name__ == '__main__': print("init6:{}".format(utime.localtime())) - from protocol import LK_ProtoCol,PING_ProtoCol,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,HRSTART_ProtoCol,UPLOAD_ProtoCol,TEMP_ProtoCol,DLT_ProtoCol,\ + from protocol import LK_ProtoCol,PING_ProtoCol,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,HRSTART_ProtoCol,CENTER_ProtoCol,UPLOAD_ProtoCol,TEMP_ProtoCol,DLT_ProtoCol,\ WT_ProtoCol,UD_ProtoCol,REMIND_ProtoCol, CR_ProtoCol,KA_ProtoCol,FIND_ProtoCol,POWEROFF_ProtoCol,ProtoColResolver,PHL_ProtoCol,MONITOR_ProtoCol import mgr as mgr print("init7:{}".format(utime.localtime())) - from mgr import ConfigStoreManager, LocationManager, SockManager,getVolumSizeManager,gethistoryDataManager, \ + from mgr import ConfigStoreManager, LocationManager, SockManager,getVolumSizeManager,gethistoryDataManager,getUpLoadDataManager, \ NetManager,AddrBookManager,MsgdetailManager,PhoneCallingManager,getStorageDataManager,getBrightnessManager,getHrTimeManager print("init8:{}".format(utime.localtime())) @@ -146,8 +147,7 @@ if __name__ == '__main__': # getStorageDataManager print("init9:{}".format(utime.localtime())) #from usr.ui_wechat import WechatScreen,TK_ProtoCol - btn_device = BtnDevice(tp_cst816) - btn_device.start() + print("init10:{}".format(utime.localtime())) @@ -177,7 +177,7 @@ if __name__ == '__main__': app.append_manager(getHrTimeManager()) app.append_manager(getBrightnessManager()) app.append_manager(getStorageDataManager()) - app.append_manager(mgr.getUpLoadDataManager()) + app.append_manager(getUpLoadDataManager()) print("init11:{}".format(utime.localtime())) pcr = ProtoColResolver() @@ -201,6 +201,7 @@ if __name__ == '__main__': pcr.add_support(DLT_ProtoCol()) pcr.add_support(UPLOAD_ProtoCol()) pcr.add_support(MONITOR_ProtoCol()) + # pcr.add_support(CENTER_ProtoCol()) pcr.add_support(CENTER_ProtoCol()) sm = SockManager() sm.add_support_resolver(pcr) diff --git a/3.code/1.watch/2.code/main_1.py b/3.code/1.watch/2.code/main_1.py index 0bb49952..d4cd94fc 100644 --- a/3.code/1.watch/2.code/main_1.py +++ b/3.code/1.watch/2.code/main_1.py @@ -201,6 +201,7 @@ if __name__ == '__main__': pcr.add_support(DLT_ProtoCol()) pcr.add_support(UPLOAD_ProtoCol()) pcr.add_support(MONITOR_ProtoCol()) + # pcr.add_support(CENTER_ProtoCol()) pcr.add_support(CENTER_ProtoCol()) sm = SockManager() sm.add_support_resolver(pcr) diff --git a/3.code/1.watch/2.code/mgr.py b/3.code/1.watch/2.code/mgr.py index 570d1b40..1ea1541a 100644 --- a/3.code/1.watch/2.code/mgr.py +++ b/3.code/1.watch/2.code/mgr.py @@ -647,9 +647,9 @@ class DeviceInfoManager(Abstract): if self.bat_time > 5*60: self.bat_time = 0 - if battery == 20: + if battery[1] == 20: EventMesh.publish("load_screen", {"screen": "LOW_POWER"}) - + print("battery:{}".format(battery)) #消息已满 msg_nums = sms.getMsgNums() #获取短信条数 self.sms_full_flag+=10 @@ -659,7 +659,7 @@ class DeviceInfoManager(Abstract): EventMesh.publish("load_screen", {"screen": "message_full"}) #print("hr......01....{}\r\n".format(hr_time)) - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 or battery[1] != 1: if hr_time != None: # print("hr......01....{}\r\n".format(hr_time)) if hr_time > 0: @@ -916,11 +916,11 @@ class DeviceInfoManager(Abstract): self.HR_Onestate = 0 self.HR_OneTime = 0 else: - if self.get_hr_state == 3 or self.get_spo2_state == 3:#3单次测量 - if self.get_hr_state == 3: + if self.get_hr_state != 0 or self.get_spo2_state != 0:#3单次测量 + if self.get_hr_state != 0: EventMesh.publish("set_hr_state",0)#2代表后台进入测试,定时测心率 1ui界面测试洗心率 EventMesh.publish(constants.EVENT.STOP_HEART) - elif self.get_spo2_state == 3: + elif self.get_spo2_state != 0: EventMesh.publish("set_spo2_state",0)#2代表后台进入测试 EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) self.SENSOR_time = time_tmp diff --git a/3.code/1.watch/2.code/static/time_up1.png b/3.code/1.watch/2.code/static/time_up1.png new file mode 100644 index 00000000..9a42d426 Binary files /dev/null and b/3.code/1.watch/2.code/static/time_up1.png differ diff --git a/3.code/1.watch/2.code/static/time_up2.png b/3.code/1.watch/2.code/static/time_up2.png new file mode 100644 index 00000000..d723d2b8 Binary files /dev/null and b/3.code/1.watch/2.code/static/time_up2.png differ diff --git a/3.code/1.watch/2.code/ui.py b/3.code/1.watch/2.code/ui.py index ca7ca4c3..8cdf7b5d 100644 --- a/3.code/1.watch/2.code/ui.py +++ b/3.code/1.watch/2.code/ui.py @@ -929,8 +929,11 @@ class DialingScreen(Screen): #EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) message_popup_screen = None @@ -1610,6 +1613,7 @@ class IncomingCallScreen(Screen): incoming_call_name_label = lv.label(incoming_call_screen) incoming_call_name_label.set_pos(0, 140) + incoming_call_name_label.set_text(" ") incoming_call_name_label.set_size(240, 50) incoming_call_name_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) incoming_call_name_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1767,8 +1771,11 @@ class IncomingCallScreen(Screen): pass def btn8_press(self): - # self.aud.stop() - # self.call_timer.stop() + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) pass def done_left_to_right(self): @@ -1859,7 +1866,11 @@ class OnCallScreen(Screen): #EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): - pass + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) #EventMesh.publish("load_screen", {"screen": "main_menu"}) # -------------------------------------------step screen----------------------------------------------------------# @@ -2261,7 +2272,7 @@ class TemperatureScreen(Screen): def __init__(self): super().__init__() self.meta = None - + self.temp_timer = osTimer() def initialization(self): global temperature_screen,temperature_bg_img ,temperature_body_label ,temperature_degree_img ,temperature_value_label,\ temperature_wrist_label,temperature_wrist_degree_img ,temperature_wrist_value_label @@ -2319,7 +2330,15 @@ class TemperatureScreen(Screen): temperature_wrist_value_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) temperature_wrist_value_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) self.meta = temperature_screen - + EventMesh.publish(constants.EVENT.START_TEMP) + self.temp_timer.start(1*1000, 1, self.temp_timerout) + def temp_timerout(self,*args): + temp = EventMesh.publish(constants.EVENT.GET_TEMP) + print("temp:{}".format(temp)) + temperature_value_label.set_text("{}".format(temp)) + def Close(self): + EventMesh.publish(constants.EVENT.STOP_TEMP) + self.temp_timer.stop() def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) diff --git a/3.code/1.watch/2.code/ui_main_menu.py b/3.code/1.watch/2.code/ui_main_menu.py index f8a70c9a..a8173949 100644 --- a/3.code/1.watch/2.code/ui_main_menu.py +++ b/3.code/1.watch/2.code/ui_main_menu.py @@ -306,7 +306,7 @@ class MainMenuScreen(Screen): def __init__(self): self.meta = MainMenu2 self.watchface = WatchFace() - self.menu_id = 0 + self.menu_id = "0" print("MainMenu1:__init__") MainMenu2_img_phone.add_event_cb(lambda e: self.img_cb(e, "Phone"), lv.EVENT.CLICKED, None) MainMenu2_img_toolbox.add_event_cb(lambda e: self.img_cb(e, "toolbox"), lv.EVENT.CLICKED, None) @@ -317,11 +317,14 @@ class MainMenuScreen(Screen): MainMenu2_img_spo2.add_event_cb(lambda e: self.img_cb(e, "spo2"), lv.EVENT.CLICKED, None) MainMenu2_img_temperature.add_event_cb(lambda e: self.img_cb(e, "temperature"), lv.EVENT.CLICKED, None) MainMenu2_img_alipay.add_event_cb(lambda e: self.img_cb(e, "alipay_open"), lv.EVENT.CLICKED, None) + EventMesh.subscribe("watch_top_show", self.watch_top_show) #MainMenu2_img_alipay.add_event_cb(lambda e: img_cb(e, "Watchface_set"), lv.EVENT.CLICKED, None) - MainMenu2_til.set_tile_id(0,1,lv.ANIM.OFF) + def initialization(self): self.watchface.initialization(MainMenu2_Watchface) - EventMesh.subscribe("watch_top_show", self.watch_top_show) + + if self.menu_id =="0": + MainMenu2_til.set_tile_id(0,1,lv.ANIM.OFF) # if self.meta_info in globals() : # MainMenu2_til.set_tile_id(self.meta_info[0],self.meta_info[1],lv.ANIM.OFF) pass# @@ -371,11 +374,13 @@ class MainMenuScreen(Screen): id = MainMenu2_til.get_tile_act().get_child(0).get_text() if id == "0": EventMesh.publish("load_screen", {"screen": "call_log"}) + self.menu_id = id def done_top_to_bottom(self): id = MainMenu2_til.get_tile_act().get_child(0).get_text() if id == "0": EventMesh.publish("load_screen", {"screen": "popup"}) + self.menu_id = id def done_left_to_right(self): id = MainMenu2_til.get_tile_act().get_child(0).get_text() print("done_left_to_right:ID{}".format(id))