self.days = 0
self.idx = 0
self.rtc.enable_alarm(1)
+ size_data = 0
IFEXIST = ql_fs.path_exists("/usr/static/storage_file/alarm_msg.json")
- self.check_alarm_list = []
if IFEXIST == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/alarm_msg.json")
+ self.check_alarm_list = []
+ if IFEXIST == True and size_data != 0:
try:
with open("/usr/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
self.check_alarm_list = ujson.load(fd)
def read_alarminjson(self, event, msg):
IFEXIST = ql_fs.path_exists("/usr/static/storage_file/alarm_msg.json")
+ size_data = 0
+ if IFEXIST == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/alarm_msg.json")
global alarm_list
print("IFEXIST:{}".format(IFEXIST))
- if IFEXIST == True:
+ if IFEXIST == True and size_data != 0:
try:
with open("/usr/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
alarm_list = ujson.load(fd)
self.wechat_num = 0
self.volum_size = 8
self.msg_tmp = ""
+ size_data = 0
check_txt = ql_fs.path_exists("/usr/static/storage_file/wechat_record.json")
- if check_txt == True :
+ if check_txt == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/wechat_record.json")
+ if check_txt == True and size_data != 0:
try:
with open("/usr/static/storage_file/wechat_record.json","r") as fd:#音频文件编号
self.wechat_recode_list = ujson.load(fd)
def __init__(self):
self.read_phonebook = {}
self.check_json = 0
+ size_data = 0
self.check_json = ql_fs.path_exists("/usr/static/storage_file/phonebook.json")
-
if self.check_json == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/phonebook.json")
+ if self.check_json == True and size_data != 0:
try:
with open("/usr/static/storage_file/phonebook.json","r",encoding="utf-8") as fd:
self.read_phonebook = ujson.load(fd)
def __init__(self):
self.read_call_log = {}
self.check_json = ql_fs.path_exists("/usr/static/storage_file/Call_log.json")
-
if self.check_json == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/Call_log.json")
+
+ if self.check_json == True and size_data != 0:
try:
with open("/usr/static/storage_file/Call_log.json","r",encoding="utf-8") as fd:
self.read_call_log = ujson.load(fd)
check_hr= ql_fs.path_exists("/usr/static/storage_file/history_hr.json")
+ size_data = 0
if check_hr == True :
- with open("/usr/static/storage_file/history_hr.json","r") as fd:#音频文件编号
- self.read_histroy_hr_data = ujson.load(fd)
- if self.read_histroy_hr_data == None:
- self.read_histroy_hr_data = []
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/history_hr.json")
+ if check_hr == True and size_data != 0:
+ try:
+ with open("/usr/static/storage_file/history_hr.json","r") as fd:#音频文件编号
+ self.read_histroy_hr_data = ujson.load(fd)
+ if self.read_histroy_hr_data == None:
+ self.read_histroy_hr_data = []
+ except Exception as e:
+ usys.print_exception(e)
check_temp= ql_fs.path_exists("/usr/static/storage_file/history_temp.json")
if check_temp == True :
+ check_temp_data = ql_fs.path_getsize("/usr/static/storage_file/history_temp.json")
+ if check_temp == True and check_temp_data != 0:
try:
with open("/usr/static/storage_file/history_temp.json","r") as fd:#音频文件编号
self.read_histroy_temp_data = ujson.load(fd)
usys.print_exception(e)
check_spo2= ql_fs.path_exists("/usr/static/storage_file/history_spo2.json")
if check_spo2 == True :
+ check_spo2_data = ql_fs.path_getsize("/usr/static/storage_file/history_spo2.json")
+ if check_spo2 == True and check_spo2_data != 0:
try:
with open("/usr/static/storage_file/history_spo2.json","r") as fd:#音频文件编号
self.read_histroy_spo2_data = ujson.load(fd)
check_blood= ql_fs.path_exists("/usr/static/storage_file/history_blood.json")
if check_blood == True :
+ check_blood_data = ql_fs.path_getsize("/usr/static/storage_file/history_blood.json")
+ if check_blood == True and check_blood_data != 0:
try:
with open("/usr/static/storage_file/history_blood.json","r") as fd:#音频文件编号
self.read_histroy_blood_data = ujson.load(fd)
def __init__(self):
self.config_data = {}
check = ql_fs.path_exists("/usr/static/storage_file/config.json")
+ size_data = 0
if check == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/config.json")
+ if check == True and size_data != 0:
try:
with open("/usr/static/storage_file/config.json","r") as fd:
self.config_data = ujson.load(fd)
def __init__(self):
self.class_buf = {}
self.class_state = 0
+ size_data = 0
check_json = ql_fs.path_exists("/usr/static/storage_file/class_msg.json")
-
if check_json == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/class_msg.json")
+ if check_json == True and size_data != 0:
try:
with open("/usr/static/storage_file/class_msg.json","r",encoding="utf-8") as fd:
self.class_buf = ujson.load(fd)
return self.phone_page_state
def timeout_hangup(self,e):
+ # print("timeout_hangup\r\n")
EventMesh.publish("system_sleep_rest")#防止黑屏
if EventMesh.publish("get_call_state") == 4: #拨通了
if dialing_popup_call != None:
self.button = 0
self.mute_btn = 0
self.is_sliding = 0
+ self.count_sec = 0
+ self.timer.start(1000,1,self.refresh)
voiceCall.mute(2,0,0)
def show_num(self):
def post_processor_after_initialization(self):
global on_call_screen_tab,on_call_obj
- self.count_sec = 0
- self.timer.start(1000,1,self.refresh)
-
num = EventMesh.publish("get_volum_size")
if num == None:
self.volum_size = 8
self.timer = osTimer()
self.contact_detail_list = None
EventMesh.subscribe("contact_updata_list_show", self.btn_create_list)
- self.MXA_phone_num = 50 #最大显示号码个数
+ self.MXA_phone_num = 10 #最大显示号码个数
self.contact_detail_listt_dict = []
self.calling_btn = []
self.is_sliding = 0
self.total_time+=1
if self.sec_value > 59:
self.sec_value = 0
- if self.total_time > 99*60:
+ if self.total_time >= 99*60:
self.total_time = 99*60
self.timer.stop()
stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN)
rrestor_confirm_n_screen = None
rrestor_confirm_n_screen_label = None
-#正在充电
+#
class restore_confirmScreen(Screen):
NAME = "restore_confirm"
def __init__(self):
self.system_sleep_timeout_rest()
# print("ui press {} self.screen_old:{}".format(self.screen_prev,self.screen_old))
# print("ui_press_do")
-
if self.system_ui_state == 0:
if event == "done_left_to_right":
self.screen.done_left_to_right()
self.screen.done_bottom_to_top()
if event == "done_top_to_bottom":
self.screen.done_top_to_bottom()
- if event == "done_return":
- self.screen.done_return()
- if event == "done_click":
- self.screen.done_click()
- if event == "done_DOWN":
- self.screen.done_DOWN()
- if event == "done_UP":
- self.screen.done_UP()
+ if event == "done_return":
+ self.screen.done_return()
+ if event == "done_click":
+ self.screen.done_click()
+ if event == "done_DOWN":
+ self.screen.done_DOWN()
+ if event == "done_UP":
+ self.screen.done_UP()
# if event == "done_press":
# self.system_sleep_timeout_rest()
EventMesh.publish("load_screen", {"screen": "delete_album"})
return
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
elif i == 2:
EventMesh.publish("load_screen", {"screen": "main_menu"})
pass
def __init__(self):
self.videobook = {}
self.check_json = 0
+ size_data = 0
self.check_json = ql_fs.path_exists("/usr/static/storage_file/videobook.json")
-
if self.check_json == True:
+ size_data = ql_fs.path_getsize("/usr/static/storage_file/videobook.json")
+ if self.check_json == True and size_data != 0:
try:
with open("/usr/static/storage_file/videobook.json","r",encoding="utf-8") as fd:
self.videobook = ujson.load(fd)