// #define K01_font_16_ALL 1
// #endif
-#if PROJECT_NAME_G3_K01
+#if PROJECT_NAME_G3_K01 || PROJECT_NAME_M36_W9
/*-----------------
* BITMAPS
LV_FONT_DECLARE(lv_font_28_dial)
LV_FONT_DECLARE(lv_font_60_main_menu)
#endif
-#ifdef PROJECT_NAME_G3_K01
+#if PROJECT_NAME_G3_K01 || PROJECT_NAME_M36_W9
LV_FONT_DECLARE(K01_font_16_ALL)
LV_FONT_DECLARE(K01_font_30_DIAL)
#endif
self.motor_mode = 0#模式
_thread.start_new_thread(self.motorInfo_queue_thread, ())
EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo)
+ EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
+ EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
pass
def motorInfo_queue_thread(self):
EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0})
def post_processor_after_instantiation(self):
- EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
- EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
+ pass
# msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数
def set_motor_time(self,event,msg):
- open_power = EventMesh.publish("get_power_on_state")#获取开机标识
- if open_power != None:
- if open_power == 0:
- return
+ # open_power = EventMesh.publish("get_power_on_state")#获取开机标识
+ # if open_power != None:
+ # if open_power == 0:
+ # return
if msg != None:
self.motor_enable = msg[0]
if self.motor_enable == 1: #马达使能
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
if self.motor_mode == 1:#
+
if self.motor_total_time > 0:
self.motor_total_time-=1
if self.motor_total_time > 0:
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
elif self.motor_mode == 2:#
+ # print("motor_fun_cb:{}\r\n".format(self.motor_total_time))
# print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time)
if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3
+ # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time))
open_motor()
else:
close_motor()
def close_motor_infor(self,event,msg):
print("close_motor_infor!!!")
+ if self.motor_enable == 0:#未使能马达定时器
+ return
close_motor()
self.motor_enable = 0#马达使能
self.motor_total_time = 0#总的时间
(lv_font_t*)&lv_font_60_main_menu
};
#endif
-#ifdef PROJECT_NAME_G3_K01
+#if PROJECT_NAME_G3_K01 || PROJECT_NAME_M36_W9
STATIC const mp_lv_struct_t mp_K01_font_16_ALL = {
{ &mp_lv_font_t_type },
(lv_font_t*)&K01_font_16_ALL
{ MP_ROM_QSTR(MP_QSTR_font_28_dial), MP_ROM_PTR(&mp_lv_font_28_dial) },
{ MP_ROM_QSTR(MP_QSTR_font_60_main_menu), MP_ROM_PTR(&mp_lv_font_60_main_menu) },
#endif
-#if PROJECT_NAME_G3_K01
+#if PROJECT_NAME_G3_K01 || PROJECT_NAME_M36_W9
{ MP_ROM_QSTR(MP_QSTR_K01_font_16_ALL), MP_ROM_PTR(&mp_K01_font_16_ALL) },
{ MP_ROM_QSTR(MP_QSTR_K01_font_30_DIAL), MP_ROM_PTR(&mp_K01_font_30_DIAL) },
#endif
self.scroll_timer_count = 0
self.play_flag = 0
+ self.play_end = 0
self.play_flag_init = 0
- AI_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)),
+ AI_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,0)),
lv.EVENT.GESTURE, None)
al_talk_screen_icon.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)),
self.not_talk_cb()
def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据
-
+ self.play_end = 0
self.play_flag = 1
self.AI_label_answer = ""
AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) #
pass
def initialization(self):
+ self.play_end = 0
self.play_flag = 1
self.TTS_PRO_TYPE = 0
AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN)
else:
pass
def _1S_timer_cb(self,*argc):
- EventMesh.publish("system_sleep_rest")#防止黑屏
+ if (self.play_end == 1 and EventMesh.publish("get_audio_state") == 0 ) or self.play_flag == 0: #字符串为0 或者暂停需要自动熄屏
+ # print("self.play_end!!!!!\r\n")
+ pass
+ else:
+ EventMesh.publish("system_sleep_rest")#防止黑屏
if self.scroll_timer_count > 0:
self.scroll_timer_count-=1
#定时器
tmp= self.aud.playStream(3, data[0])#播放音频流
print("出:{},{}!!!".format(len(data[0]),self.AI_client_tts_data_len))
if tmp != 0:
+
print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data[0])))
+ if len(self.AI_client_chat_play_str) == 0:
+ self.play_end = 1
self.AI_client_tts_data_len -=len(data[0])
mem = gc.mem_free()
print('1剩余内存RAM:{} KB'.format(mem / 1024))
alarm_list = [{'hour': 16, 'repeart': 10, 'idx': 0, 'enabled': 0, 'days': [], 'minute': 39},
{'hour': 16, 'repeart': 10, 'idx': 1, 'enabled': 0, 'days': [], 'minute': 39}]
#用于显示闹钟列表不包含开关机信息
-
+import usys
class ClockManager(Abstract):
def __init__(self):
super().__init__()
IFEXIST = ql_fs.path_exists("/ext/static/storage_file/alarm_msg.json")
self.check_alarm_list = []
if IFEXIST == True:
- with open("/ext/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
- self.check_alarm_list = ujson.load(fd)
+ try:
+ with open("/ext/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
+ self.check_alarm_list = ujson.load(fd)
+ except Exception as e:
+ usys.print_exception(e)
def post_processor_after_instantiation(self):
EventMesh.subscribe("push_clock_info", self.set)
global alarm_list
print("IFEXIST:{}".format(IFEXIST))
if IFEXIST == True:
- with open("/ext/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
- alarm_list = ujson.load(fd)
+ try:
+ with open("/ext/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
+ alarm_list = ujson.load(fd)
+ except Exception as e:
+ usys.print_exception(e)
return alarm_list
def add_alarm(self, event, msg):
def initialization(self):
print("FactoryModeLogScreen")
self.Log_timer.start(1000,1,self.Log_timer_cb)
- with open("/ext/log.txt","r",encoding="utf-8") as fd:
- self.log_data = fd.read()
- print(self.log_data)
+ try:
+ with open("/ext/log.txt","r",encoding="utf-8") as fd:
+ self.log_data = fd.read()
+ print(self.log_data)
+ except Exception as e:
+ usys.print_exception(e)
if len(self.log_data) < screen_log_len:
FactoryModeLog_label.set_text("第1页\n"+self.log_data)
else:
def LogClean_cb(self,e):
self.log_data = ""
- with open("/ext/log.txt","w",encoding="utf-8") as fd:
+ with open("/ext/log.txt","w+",encoding="utf-8") as fd:
fd.write("")
def LogNext_cb(self,e):
self.msg_tmp = ""
check_txt = ql_fs.path_exists("/ext/static/storage_file/wechat_record.json")
if check_txt == True :
- with open("/ext/static/storage_file/wechat_record.json","r") as fd:#音频文件编号
- self.wechat_recode_list = ujson.load(fd)
- if not self.wechat_recode_list:
- self.wechat_recode_list = {"num":0}
- self.wechat_num = 0
- else:
- b = str("num") in self.wechat_recode_list.keys()
- if b == True:
- self.wechat_num = self.wechat_recode_list["num"]
+ try:
+ with open("/ext/static/storage_file/wechat_record.json","r") as fd:#音频文件编号
+ self.wechat_recode_list = ujson.load(fd)
+ if not self.wechat_recode_list:
+ self.wechat_recode_list = {"num":0}
+ self.wechat_num = 0
+ else:
+ b = str("num") in self.wechat_recode_list.keys()
+ if b == True:
+ self.wechat_num = self.wechat_recode_list["num"]
+ except Exception as e:
+ usys.print_exception(e)
else :
self.wechat_recode_list = {"num":0}
- with open("/ext/static/storage_file/wechat_record.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/wechat_record.json","w+",encoding="utf-8") as fd:
ujson.dump(self.wechat_recode_list,fd)
# if self.wechat_num != 0:
# with open("/ext/static/storage_file/wechat_record.json","r",encoding="utf-8") as fd:#音频文件记录
self.MXA_MSG = msg[0]
self.wechat_recode_list = msg[1]
self.wechat_num = self.wechat_recode_list["num"]
- with open("/ext/static/storage_file/wechat_record.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/wechat_record.json","w+",encoding="utf-8") as fd:
ujson.dump(self.wechat_recode_list,fd)
#写编号
Wechat_log("set_wechat_data2:{} ".format(self.wechat_num))
WL_timer.start(30000, 0, WL_timer_cb)
else:
print("voice_callback:不在白名单中,挂断")
+ EventMesh.publish("set_call_state",0)
+ EventMesh.publish("set_interrup_incall",0)
+ EventMesh.publish("set_UI_high_priority",0)
+ EventMesh.publish("return_prev_screen")
voiceCall.callEnd()
return
EventMesh.publish("set_call_state",2)#设置
EventMesh.publish("set_UI_high_priority",0)
- screen_NAME = EventMesh.publish("get_screen_NAME")
- if screen_NAME != None:
- if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("return_prev_screen")
+ if EventMesh.publish("get_call_state") != 0:
+ EventMesh.publish("return_prev_screen")
EventMesh.publish("set_sos_info_call")
print('voicecall disconnect end')
elif args[0] == 13:
print('voicecall is waiting, PhoneNO.: ', args[6])
elif args[0] == 14:
+ if EventMesh.publish("get_phone_state") == 0:
+ EventMesh.publish("set_call_state",0)
+ EventMesh.publish("set_interrup_incall",0)
+ EventMesh.publish("set_UI_high_priority",0)
+ voiceCall.callEnd()
+ return
EventMesh.publish("set_call_state",4)##设置通话状态
print('voicecall dialing, PhoneNO.: ', args[6])
+ EventMesh.publish("set_interrup_incall",0)
EventMesh.publish("set_UI_high_priority",0)
- EventMesh.publish("load_screen", {"screen": "dialing"})
+ EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"})
elif args[0] == 15:
print('voicecall alerting, PhoneNO.: ', args[6])
self.check_json = ql_fs.path_exists("/ext/static/storage_file/phonebook.json")
if self.check_json == True:
- with open("/ext/static/storage_file/phonebook.json","r",encoding="utf-8") as fd:
- self.read_phonebook = ujson.load(fd)
- print("读取电话本")
+ try:
+ with open("/ext/static/storage_file/phonebook.json","r",encoding="utf-8") as fd:
+ self.read_phonebook = ujson.load(fd)
+ print("读取电话本")
+ except Exception as e:
+ usys.print_exception(e)
def post_processor_after_instantiation(self):
EventMesh.subscribe("get_phonebook_list", self.get)
self.check_json = ql_fs.path_exists("/ext/static/storage_file/Call_log.json")
if self.check_json == True:
- with open("/ext/static/storage_file/Call_log.json","r",encoding="utf-8") as fd:
- self.read_call_log = ujson.load(fd)
- print("读取通话记录")
+ try:
+ with open("/ext/static/storage_file/Call_log.json","r",encoding="utf-8") as fd:
+ self.read_call_log = ujson.load(fd)
+ print("读取通话记录")
+ except Exception as e:
+ usys.print_exception(e)
def post_processor_after_instantiation(self):
EventMesh.subscribe("get_call_log_list", self.get)
check_hr= ql_fs.path_exists("/ext/static/storage_file/history_hr.json")
if check_hr == True :
- with open("/ext/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 = []
+ try:
+ with open("/ext/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("/ext/static/storage_file/history_temp.json")
if check_temp == True :
- with open("/ext/static/storage_file/history_temp.json","r") as fd:#音频文件编号
- self.read_histroy_temp_data = ujson.load(fd)
- if self.read_histroy_temp_data == None:
- self.read_histroy_temp_data = []
+ try:
+ with open("/ext/static/storage_file/history_temp.json","r") as fd:#音频文件编号
+ self.read_histroy_temp_data = ujson.load(fd)
+ if self.read_histroy_temp_data == None:
+ self.read_histroy_temp_data = []
+ except Exception as e:
+ usys.print_exception(e)
check_spo2= ql_fs.path_exists("/ext/static/storage_file/history_spo2.json")
if check_spo2 == True :
- with open("/ext/static/storage_file/history_spo2.json","r") as fd:#音频文件编号
- self.read_histroy_spo2_data = ujson.load(fd)
- if self.read_histroy_spo2_data == None:
- self.read_histroy_spo2_data = []
+ try:
+ with open("/ext/static/storage_file/history_spo2.json","r") as fd:#音频文件编号
+ self.read_histroy_spo2_data = ujson.load(fd)
+ if self.read_histroy_spo2_data == None:
+ self.read_histroy_spo2_data = []
+ except Exception as e:
+ usys.print_exception(e)
check_blood= ql_fs.path_exists("/ext/static/storage_file/history_blood.json")
if check_blood == True :
- with open("/ext/static/storage_file/history_blood.json","r") as fd:#音频文件编号
- self.read_histroy_blood_data = ujson.load(fd)
- if self.read_histroy_blood_data == None:
- self.read_histroy_blood_data = []
+ try:
+ with open("/ext/static/storage_file/history_blood.json","r") as fd:#音频文件编号
+ self.read_histroy_blood_data = ujson.load(fd)
+ if self.read_histroy_blood_data == None:
+ self.read_histroy_blood_data = []
+ except Exception as e:
+ usys.print_exception(e)
self.temp_value = 0
# self.read_histroy_hr_data=[{"timeSec":16789890,"value":90},{"timeSec":16789888,"value":78},{"timeSec":16789688,"value":68},{"timeSec":16789898,"value":58},\
else:
self.read_histroy_blood_data.append({"timeSec": time_tmp, "blMax": self.blMax,"blMin": self.blMin})
- with open("/ext/static/storage_file/history_blood.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/history_blood.json","w+",encoding="utf-8") as fd:
ujson.dump(self.read_histroy_blood_data,fd)
print(self.read_histroy_blood_data)
EventMesh.publish("show_history_blood_data")
else:
self.read_histroy_temp_data.append({"timeSec": time_tmp, "temp": self.temp_value})
- with open("/ext/static/storage_file/history_temp.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)
EventMesh.publish("show_history_temp_data")
self.read_histroy_hr_data.append({"timeSec": time_tmp, "hr": self.oldHr})
- with open("/ext/static/storage_file/history_hr.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/history_hr.json","w+",encoding="utf-8") as fd:
ujson.dump(self.read_histroy_hr_data,fd)
EventMesh.publish("show_history_hr_data")
#print(self.read_histroy_hr_data)
else:
self.read_histroy_spo2_data.append({"timeSec": time_tmp, "spo2": self.oldspo2})
- with open("/ext/static/storage_file/history_spo2.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/history_spo2.json","w+",encoding="utf-8") as fd:
ujson.dump(self.read_histroy_spo2_data,fd)
EventMesh.publish("show_history_spo2_data")
#print(self.read_histroy_spo2_data)
self.config_data = {}
check = ql_fs.path_exists("/ext/static/storage_file/config.json")
if check == True:
- with open("/ext/static/storage_file/config.json","r") as fd:
- self.config_data = ujson.load(fd)
+ try:
+ with open("/ext/static/storage_file/config.json","r") as fd:
+ self.config_data = ujson.load(fd)
+ except Exception as e:
+ usys.print_exception(e)
+ self.config_data = {'old_time': 0, 'flip_sw': 0}
else :
self.config_data = {'old_time': 0, 'flip_sw': 0}
pass
check_json = ql_fs.path_exists("/ext/static/storage_file/class_msg.json")
if check_json == True:
- with open("/ext/static/storage_file/class_msg.json","r",encoding="utf-8") as fd:
- self.class_buf = ujson.load(fd)
- print("读取上课禁用时间段")
+ try:
+ with open("/ext/static/storage_file/class_msg.json","r",encoding="utf-8") as fd:
+ self.class_buf = ujson.load(fd)
+ print("读取上课禁用时间段")
+ except Exception as e:
+ usys.print_exception(e)
# print("self.class_buf:",self.class_buf)
phonebook_oldtmp = phonebook_tmp
# print("phonebook_oldtmp!!!:{}".format(str(phonebook_oldtmp)))
# print("phonebook!!!:{}".format(str(phonebook)))
- with open("/ext/static/storage_file/phonebook.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/phonebook.json","w+",encoding="utf-8") as fd:
ujson.dump(phonebook,fd)
print("创建电话簿")
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:
+ with open(path,"w+") as fd:
arm = bytearray()
j = 0
for i in range(len(arm_data)):
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:
+ with open(path,"w+") as fd:
arm = bytearray()
j = 0
for i in range(len(arm_data)):
EventMesh.publish("set_UI_high_priority", 0)
EventMesh.publish("close_sos_timer")
EventMesh.publish("set_hangup_mode", 1)
- voiceCall.callEnd()
+ EventMesh.publish("set_call_state",0)
EventMesh.publish("set_interrup_incall",0)
EventMesh.publish("set_UI_high_priority",0)
EventMesh.publish("return_prev_screen")
+ voiceCall.callEnd()
+
def Close(self):
self.timer.stop()
self.number_tmp = {}
self.CALL_LOG_MAX = CALL_LOG_MAX
self.is_sliding =0
+ self.phone_page_state = 0
+ EventMesh.subscribe("get_phone_state",self.get_phone_state)
def initialization(self):
self.is_sliding =0
+ self.phone_page_state = 1
EventMesh.publish("set_UI_high_priority", 1)
global dialing_popup_screen,dialing_popup_img,dialing_popup_name ,dialing_popup_call,dialing_popup_hangup_imgbtn
if dialing_popup_screen == None:
if dialing_popup_name != None:
name = EventMesh.publish("get_phonename")#获取拨打电话名称
dialing_popup_name.set_text(name)#名称
+ if dialing_popup_call != None:
+ dialing_popup_call.set_text("正在拨号中")
def post_processor_after_initialization(self):
self.is_sliding =0
tmp["number"] = content
self.read_call_log[content] = tmp
- with open("/ext/static/storage_file/Call_log.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/Call_log.json","w+",encoding="utf-8") as fd:
ujson.dump(self.read_call_log,fd)
print("创建通话记录")
EventMesh.publish("set_call_log_list", [1,self.read_call_log])
def timeout_hangup(self,e):
EventMesh.publish("system_sleep_rest")#防止黑屏
+ if EventMesh.publish("get_call_state") == 4: #拨通了
+ if dialing_popup_call != None:
+ dialing_popup_call.set_text("正在等待对方接\n听电话")
self.time_count+=1
- if self.time_count >= 5 :#设置:#5s内没有打通则不在继续拨打关闭
+ if self.time_count >= 60 :#设置:#5s内没有打通则不在继续拨打关闭
self.time_count = 0
- voiceCall.callEnd()
+ self.phone_page_state = 0
+ self.timer1.stop()
+ self.timer2.stop()
EventMesh.publish("set_UI_high_priority", 0)
- EventMesh.publish("set_sos_info_call")
- # EventMesh.publish("load_screen", {"screen": "dialing"})
- EventMesh.publish("load_screen", {"screen": "dial_no_connect_popup"})
+
+ sos_flag = EventMesh.publish("get_sos_flag")
+ print("sos_flag!!!!!!!!!!!!!!!!:",sos_flag)
+ if sos_flag == 1:
+ EventMesh.publish("set_sos_info_call")
+
+ EventMesh.publish("set_call_state",0)#设置通话状态为0
+ EventMesh.publish("set_interrup_incall",0)
+ EventMesh.publish("set_UI_high_priority",0)
+ EventMesh.publish("return_prev_screen")
+ voiceCall.callEnd()
def hangup(self,e):
code = e.get_code()
pass
elif code == lv.EVENT.SHORT_CLICKED:
- EventMesh.publish("set_UI_high_priority", 0)
+ self.phone_page_state = 0
+ EventMesh.publish("set_call_state",0)
+ EventMesh.publish("set_interrup_incall",0)
+ EventMesh.publish("set_UI_high_priority",0)
+
+ EventMesh.publish("return_prev_screen")
voiceCall.callEnd()
sos_flag = EventMesh.publish("get_sos_flag")
if sos_flag == 1:
EventMesh.publish("set_sos_flag",0)
EventMesh.publish("set_sos_num",0)
EventMesh.publish("set_hangup_mode",0)
- EventMesh.publish("set_interrup_incall",0)
- EventMesh.publish("set_UI_high_priority",0)
-
- EventMesh.publish("return_prev_screen")
-
+ def get_phone_state(self,event,msg):
+ return self.phone_page_state
+
def Close(self):
+ self.phone_page_state = 0
self.timer1.stop()
self.timer2.stop()
tmp["number"] = self.meta_info
self.read_call_log[self.meta_info] = tmp
- with open("/ext/static/storage_file/Call_log.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/Call_log.json","w+",encoding="utf-8") as fd:
ujson.dump(self.read_call_log,fd)
print("创建通话记录")
EventMesh.publish("set_call_log_list", [1,self.read_call_log])
code = e.get_code()
if code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
- EventMesh.publish("set_UI_high_priority", 0)
self.aud.stop()
self.call_timer.stop()
- voiceCall.callEnd()
+ EventMesh.publish("set_call_state",0)
EventMesh.publish("set_interrup_incall",0)
EventMesh.publish("set_UI_high_priority",0)
+ EventMesh.publish("return_prev_screen")
+ voiceCall.callEnd()
- screen_NAME = EventMesh.publish("get_screen_NAME")
- if screen_NAME != None:
- if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("return_prev_screen")
-
def btn1_release(self):
pass
def hangup(self,e):
code = e.get_code()
if code == lv.EVENT.SHORT_CLICKED:
- EventMesh.publish("set_UI_high_priority", 0)
self.timer.stop()
- voiceCall.callEnd()
+ EventMesh.publish("set_call_state",0)
EventMesh.publish("set_interrup_incall",0)
EventMesh.publish("set_UI_high_priority",0)
+ EventMesh.publish("return_prev_screen")
+ voiceCall.callEnd()
- screen_NAME = EventMesh.publish("get_screen_NAME")
- if screen_NAME != None:
- if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("return_prev_screen")
#日期
watchface2_week = lv.label(Watchface2)
watchface2_week.set_pos(146, 170)
-watchface2_week.set_size(110, 35)
+watchface2_week.set_size(94, 35)
watchface2_week.set_align(lv.TEXT_ALIGN.LEFT)
watchface2_week.set_text("星期%s"%(get_week(week)))
watchface2_week.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT)
self.check_json = ql_fs.path_exists("/ext/static/storage_file/videobook.json")
if self.check_json == True:
- with open("/ext/static/storage_file/videobook.json","r",encoding="utf-8") as fd:
- self.videobook = ujson.load(fd)
- print("读取视频通话账号列表")
+ try:
+ with open("/ext/static/storage_file/videobook.json","r",encoding="utf-8") as fd:
+ self.videobook = ujson.load(fd)
+ print("读取视频通话账号列表")
+ except Exception as e:
+ usys.print_exception(e)
def post_processor_after_instantiation(self):
EventMesh.subscribe("get_videobook_list", self.get)
j+=1
print("videobook!!!:{}".format(str(videobook)))
# print("phonebook!!!:{}".format(str(phonebook)))
- with open("/ext/static/storage_file/videobook.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/videobook.json","w+",encoding="utf-8") as fd:
ujson.dump(videobook,fd)
print("创建视频通话账号")
j+=1
print("videobook!!!:{}".format(str(videobook)))
# print("phonebook!!!:{}".format(str(phonebook)))
- with open("/ext/static/storage_file/videobook.json","w",encoding="utf-8") as fd:
+ with open("/ext/static/storage_file/videobook.json","w+",encoding="utf-8") as fd:
ujson.dump(videobook,fd)
print("创建视频通话账号")