From: dxy15521469561 <1731678236@qq.com> Date: Tue, 16 Jul 2024 03:07:17 +0000 (+0800) Subject: W8:UI调整 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=d74d98ab81d711bf1fb74cc1978ed24e6ff50699;p=mirrors%2FASR1603_G5.git W8:UI调整 --- diff --git a/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c b/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c index 6ca480bf..d23e153c 100644 --- a/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c +++ b/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c @@ -14,7 +14,7 @@ // #define K01_font_16_ALL 1 // #endif -#if PROJECT_NAME_G3_K01 +#if PROJECT_NAME_G3_K01 || PROJECT_NAME_M36_W9 /*----------------- * BITMAPS diff --git a/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h b/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h index 99e10a71..322ddc73 100644 --- a/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h +++ b/2.sdk/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h @@ -245,7 +245,7 @@ LV_FONT_DECLARE(lv_font_70_bold) 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 diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py index cd31639b..7e932af3 100644 --- a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py +++ b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py @@ -31,6 +31,8 @@ class motorEventManager(Abstract):#马达事件 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): @@ -50,15 +52,14 @@ class motorEventManager(Abstract):#马达事件 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: #马达使能 @@ -78,6 +79,7 @@ class motorEventManager(Abstract):#马达事件 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: @@ -87,8 +89,10 @@ class motorEventManager(Abstract):#马达事件 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() @@ -99,6 +103,8 @@ class motorEventManager(Abstract):#马达事件 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#总的时间 diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c index 4c458595..d4072279 100644 --- a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c +++ b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c @@ -27194,7 +27194,7 @@ STATIC const mp_lv_struct_t mp_lv_font_60_main_menu = { (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 @@ -33002,7 +33002,7 @@ STATIC const mp_rom_map_elem_t lvgl_globals_table[] = { { 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 diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ai.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ai.py index 71471c72..f0c940f7 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ai.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ai.py @@ -712,8 +712,9 @@ class AIScreen(Screen):#AI_GUI 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)), @@ -1062,7 +1063,7 @@ class AIScreen(Screen):#AI_GUI self.not_talk_cb() def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据 - + self.play_end = 0 self.play_flag = 1 self.AI_label_answer = "" @@ -1191,6 +1192,7 @@ class AIScreen(Screen):#AI_GUI 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) @@ -1428,7 +1430,11 @@ class AIScreen(Screen):#AI_GUI 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 #定时器 @@ -1932,7 +1938,10 @@ class AIScreen(Screen):#AI_GUI 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)) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/alarm.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/alarm.py index 3de9113c..9f8511b6 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/alarm.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/alarm.py @@ -402,7 +402,7 @@ label_ok.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) 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__() @@ -413,8 +413,11 @@ class ClockManager(Abstract): 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) @@ -453,8 +456,11 @@ class ClockManager(Abstract): 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): diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appFactoryMode.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appFactoryMode.py index fa7cd47d..65eb8bee 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appFactoryMode.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appFactoryMode.py @@ -256,9 +256,12 @@ class FactoryModeLogScreen(Screen): 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: @@ -269,7 +272,7 @@ class FactoryModeLogScreen(Screen): 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): diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appWechat.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appWechat.py index b8306ab6..0a2838af 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appWechat.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appWechat.py @@ -104,18 +104,21 @@ class WechatScreen(Screen): 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:#音频文件记录 @@ -220,7 +223,7 @@ class WechatScreen(Screen): 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)) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/mgr.py index a05b7710..94e5b1a4 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/mgr.py @@ -611,6 +611,10 @@ def voice_callback(args): 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)#设置 @@ -646,10 +650,8 @@ def voice_callback(args): 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') @@ -659,10 +661,17 @@ def voice_callback(args): 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]) @@ -2628,9 +2637,12 @@ class AddrBookManager(Abstract): 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) @@ -2704,9 +2716,12 @@ class CallLogManager(Abstract): 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) @@ -2779,29 +2794,41 @@ class gethistoryDataManager(Abstract): 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},\ @@ -2847,7 +2874,7 @@ class gethistoryDataManager(Abstract): 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") @@ -2889,7 +2916,7 @@ class gethistoryDataManager(Abstract): 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") @@ -2927,7 +2954,7 @@ class gethistoryDataManager(Abstract): 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) @@ -2957,7 +2984,7 @@ class gethistoryDataManager(Abstract): 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) @@ -3219,8 +3246,12 @@ class getStorageDataManager(Abstract):#获取内存数据 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 @@ -3741,9 +3772,12 @@ class setclassTimeManager(Abstract):#设置上课禁用时间 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) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/protocol.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/protocol.py index 82a1c017..a3510f83 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/protocol.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/protocol.py @@ -809,7 +809,7 @@ class PHL_ProtoCol(ProtoCol): 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("创建电话簿") @@ -2252,7 +2252,7 @@ class TKS_ProtoCol(ProtoCol): 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)): @@ -2382,7 +2382,7 @@ class TK_ProtoCol(ProtoCol): 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)): diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui.py index b2ecd408..4fab87e4 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui.py @@ -1390,10 +1390,12 @@ class DialingScreen(Screen): 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() @@ -1837,9 +1839,12 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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: @@ -1879,6 +1884,8 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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 @@ -1934,7 +1941,7 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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]) @@ -1948,14 +1955,27 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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() @@ -1964,7 +1984,12 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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: @@ -1972,13 +1997,12 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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() @@ -3271,7 +3295,7 @@ class IncomingCallScreen(Screen): 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]) @@ -3315,19 +3339,15 @@ class IncomingCallScreen(Screen): 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 @@ -3946,16 +3966,13 @@ class OnCallScreen(Screen): 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") diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py index 829f1a3b..2adfd785 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py @@ -441,7 +441,7 @@ watchface2_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFA #日期 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) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_video.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_video.py index a84694d1..26e63c4b 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_video.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_video.py @@ -2300,9 +2300,12 @@ class videoBookManager(Abstract): 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) @@ -2404,7 +2407,7 @@ class MEMBERS_ProtoCol(ProtoCol):#获取账号列表 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("创建视频通话账号") @@ -2660,7 +2663,7 @@ class JMEMBERS_ProtoCol(ProtoCol):#获取账号列表 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("创建视频通话账号") diff --git a/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib b/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib index 74bafbf0..8f0ae189 100644 Binary files a/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib and b/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib differ diff --git a/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib b/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib index 32e65615..2c9d26bb 100644 Binary files a/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib and b/2.sdk/project/W8/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib differ