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()
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()))
# 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()))
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()
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)
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)
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
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:
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
#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
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)
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):
#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----------------------------------------------------------#
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
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"})
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)
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#
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))