From: dxy15521469561 <1731678236@qq.com> Date: Sat, 8 Jul 2023 03:32:12 +0000 (+0800) Subject: 1.优化电话显示界面 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=02b4e25be4a8e6655ddedf8e1db7153a8b00d58c;p=mirrors%2FASR1603_G5.git 1.优化电话显示界面 2.加大字号 3.表盘界面调整 4.各个界面调整 --- diff --git a/2.sdk/project/K5/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png b/2.sdk/project/K5/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png index 5e181141..b5e4849b 100644 Binary files a/2.sdk/project/K5/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png and b/2.sdk/project/K5/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png differ diff --git a/2.sdk/project/K5/ext/static/IMG_CC_HUNGUP1.png b/2.sdk/project/K5/ext/static/IMG_CC_HUNGUP1.png deleted file mode 100644 index a725b9dd..00000000 Binary files a/2.sdk/project/K5/ext/static/IMG_CC_HUNGUP1.png and /dev/null differ diff --git a/2.sdk/project/K5/ext/static/charge_in.png b/2.sdk/project/K5/ext/static/charge_in.png index 2747b7d6..f33a6ea5 100644 Binary files a/2.sdk/project/K5/ext/static/charge_in.png and b/2.sdk/project/K5/ext/static/charge_in.png differ diff --git a/2.sdk/project/K5/ext/static/degree.png b/2.sdk/project/K5/ext/static/degree.png deleted file mode 100644 index 62b467f5..00000000 Binary files a/2.sdk/project/K5/ext/static/degree.png and /dev/null differ diff --git a/2.sdk/project/K5/font/ext_font.bin b/2.sdk/project/K5/font/ext_font.bin index dc2e9370..0864f185 100644 Binary files a/2.sdk/project/K5/font/ext_font.bin and b/2.sdk/project/K5/font/ext_font.bin differ diff --git a/2.sdk/project/K5/new.bat b/2.sdk/project/K5/new.bat index 8445fd2d..cb9d5073 100644 --- a/2.sdk/project/K5/new.bat +++ b/2.sdk/project/K5/new.bat @@ -2,7 +2,7 @@ md images del images /q -..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1572864 -i .\images\ext_fs.bin +..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin if errorlevel 1 ( echo "ext_fs.binÉú³Éʧ°Ü !!!!!!!!!!!!!!! " goto exit diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/alarm.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/alarm.py index 786b10ed..419b2bff 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/alarm.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/alarm.py @@ -43,7 +43,7 @@ style_cont_alarm.set_pad_bottom(0) # style_font_white = lv.style_t() # style_font_white.init() # style_font_white.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -# style_font_white.set_text_font_v2("font_24.bin",24,0) +# style_font_white.set_text_font_v2("font_28.bin",28,0) # style_font_white.set_border_width(0) # style_font_white.set_pad_left(0) # style_font_white.set_pad_right(0) @@ -53,7 +53,7 @@ style_cont_alarm.set_pad_bottom(0) style_font_yellow = lv.style_t() style_font_yellow.init() style_font_yellow.set_text_color(lv.color_make(0xF1, 0xA3, 0x3B)) -style_font_yellow.set_text_font_v2("font_24.bin",24,0) +style_font_yellow.set_text_font_v2("font_28.bin",28,0) #背景样式 style_alarm_screen_default = lv.style_t() @@ -105,8 +105,8 @@ clk_list_screen1_1.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE no_add_alarm_img = lv.img(clk_list_screen1_1) -no_add_alarm_img.set_pos(63, 0) -no_add_alarm_img.set_size(113, 152) +no_add_alarm_img.set_pos(65, 0) +no_add_alarm_img.set_size(110, 140) no_add_alarm_img.set_src("E:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") no_add_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -670,7 +670,7 @@ class ClockManager(Abstract): EventMesh.publish("read_alarminjson") rtc_now_time = self.rtc.datetime() - print("00获取所有闹钟信息:{}".format(alarm_list)) + # print("00获取所有闹钟信息:{}".format(alarm_list)) new_alarm_list = [(alarm['hour'], alarm['minute'], alarm['days'],alarm["idx"]) for alarm in alarm_list if alarm['enabled']] print("01获取开启的闹钟:{}".format(new_alarm_list)) diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/appAlipay.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/appAlipay.py index f928673c..93eec789 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/appAlipay.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/appAlipay.py @@ -15,7 +15,7 @@ from code import code_128_generate_barcode style_font_youyuan_20 = lv.style_t() style_font_youyuan_20.init() style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) style_btn_alipay = lv.style_t() style_btn_alipay.init() @@ -78,7 +78,7 @@ class Alipay(Abstract): #self.alipay = ALIPAY("867387060319491", "898604293619F0549750","460044917509047", "123456", "P1Q22I80C0007530P","ZHIHUISHIXUN", "ZHIHUISHIXUN", "EC800M", "uHTfYqOlGlA" , "a15PcyZ3IHA", "kOGGPhtXAg1Lz1vg",0) #self.alipay.register_print() self.alipay.set_log_limit(5) - self.alipay.set_log_limit(0) + #self.alipay.set_log_limit(0) #self.timer_Alipay.start(20000, 1, self.timeout_Alipay) def post_processor_after_instantiation(self): @@ -737,7 +737,7 @@ alipay_paycode_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DE style_font_youyuan_black_20 = lv.style_t() style_font_youyuan_black_20.init() style_font_youyuan_black_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_black_20.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_black_20.set_text_font_v2("font_28.bin",28,0) # alipay_barcode_num = lv.label(alipay_paycode_screen) # alipay_barcode_num.set_pos(0, 130) diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py index f81ba932..bf47fc0d 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py @@ -508,7 +508,12 @@ def voice_callback(args): EventMesh.publish("set_interrup_incall",0) EventMesh.publish("set_UI_high_priority",0) - EventMesh.publish("load_screen", {"screen": "main_menu"}) + + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "dialing_noplay_popup": + EventMesh.publish("load_screen", {"screen": "main_menu"}) + hangup_mode = EventMesh.publish("get_hangup_mode") if hangup_mode == 1: EventMesh.publish("set_sos_flag",0) @@ -570,6 +575,7 @@ def voice_callback(args): elif args[0] == 14: print('voicecall dialing, PhoneNO.: ', args[6]) + EventMesh.publish("set_UI_high_priority",0) EventMesh.publish("load_screen", {"screen": "dialing"}) elif args[0] == 15: diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py index b50425a5..3c89dc98 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py @@ -69,7 +69,7 @@ style_bar_indic.set_bg_opa(255) style_font_youyuan_20 = lv.style_t() style_font_youyuan_20.init() style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) style_font_youyuan_40 = lv.style_t() style_font_youyuan_40.init() @@ -79,13 +79,13 @@ style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) style_font_youyuan_20_black = lv.style_t() style_font_youyuan_20_black.init() style_font_youyuan_20_black.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_youyuan_20_black.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_20_black.set_text_font_v2("font_28.bin",28,0) style_font_youyuan_20_red = lv.style_t() style_font_youyuan_20_red.init() style_font_youyuan_20_red.set_text_color(lv.color_make(0xff, 0x00, 0x00)) -style_font_youyuan_20_red.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_20_red.set_text_font_v2("font_28.bin",28,0) style_img = lv.style_t() style_img.init() @@ -599,42 +599,48 @@ class PhoneScreen(Screen): EventMesh.publish("load_screen", {"screen": "contacts"}) def call(self,e): - self.name = None - self.phonebook = {} - self.number_tmp = {} - if len(self.phone_list) != 0: - data = EventMesh.publish("get_phonebook_list") - if data != None: - check = data[0] - self.phonebook = data[1] - # print("check :{}".format(check)) - if check == 1:#检查通讯录 - phonebook_keys = sorted(self.phonebook.keys()) - b = str(self.phone_num) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - j = 0 - if b == True: - for i in range(len(self.phonebook)): #字典 key value - #'001:张三':15521469561 - name = self.phonebook[phonebook_keys[j]] - name_value = phonebook_keys[j] - number_tmp = str(self.phone_num) - # print("name :{} number_tmp:{}".format(name,number_tmp)) - if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 - number_f= name_value - name_s = number_f.split(':') - name_s = name_s[1] - self.name = name_s - break - j+=1 + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: + self.name = None + self.phonebook = {} + self.number_tmp = {} + if len(self.phone_list) != 0: + data = EventMesh.publish("get_phonebook_list") + if data != None: + check = data[0] + self.phonebook = data[1] + # print("check :{}".format(check)) + if check == 1:#检查通讯录 + phonebook_keys = sorted(self.phonebook.keys()) + b = str(self.phone_num) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + j = 0 + if b == True: + for i in range(len(self.phonebook)): #字典 key value + #'001:张三':15521469561 + name = self.phonebook[phonebook_keys[j]] + name_value = phonebook_keys[j] + number_tmp = str(self.phone_num) + # print("name :{} number_tmp:{}".format(name,number_tmp)) + if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 + number_f= name_value + name_s = number_f.split(':') + name_s = name_s[1] + self.name = name_s + break + j+=1 + else: + self.name = self.phone_num else: self.name = self.phone_num - else: - self.name = self.phone_num - EventMesh.publish("save_phonenum",self.phone_num) - EventMesh.publish("save_phonename",self.name)# - voiceCall.callStart(self.phone_num) - + EventMesh.publish("save_phonenum",self.phone_num) + EventMesh.publish("save_phonename",self.name)# + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + else: + EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"}) + else:#未插卡 + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + def show_num(self): #print("self.phone_num ",self.phone_num,self.phone_list) len_t = len(self.phone_list)*40 @@ -743,6 +749,7 @@ class CallLogScreen(Screen): self.call_log_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) for i in range(self.CALL_LOG_MAX): _btn = lv.btn(self.call_log_detail_list) + _btn.add_flag(lv.obj.FLAG.CLICKABLE) _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), lv.EVENT.CLICKED, None) _btn.add_flag(lv.obj.FLAG.HIDDEN) @@ -853,7 +860,7 @@ class CallLogScreen(Screen): phonnum = str(e.get_target().get_child(0).get_text()) phnoname = e.get_target().get_child(3).get_text() # print("phonnum :{} _msg:{}".format(phonnum,phnoname)) - EventMesh.publish("save_phonenum",phonnum)#保存电话号码用于界面显示获取 + self.name = None self.phonebook = {} @@ -893,9 +900,14 @@ class CallLogScreen(Screen): if self.name == None: self.name = phnoname - if len(self.name) > 0: + if len(phonnum) > 0: EventMesh.publish("save_phonename",self.name)# - voiceCall.callStart(str(phonnum)) + EventMesh.publish("save_phonenum",phonnum)#保存电话号码用于界面显示获取 + #voiceCall.callStart(str(phonnum)) + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + else: + EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"}) + def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -912,6 +924,7 @@ class CallLogScreen(Screen): dialing_screen = None dialing_img = None dialing_name = None +dialing_call_label = None hangup_imgbtn = None class DialingScreen(Screen): NAME = "dialing" @@ -934,27 +947,40 @@ class DialingScreen(Screen): dialing_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) dialing_img = lv.img(dialing_screen) - dialing_img.set_pos(80, 60) + dialing_img.set_pos(80, 20) dialing_img.set_size(64, 64) dialing_img.set_src("E:/static/IMAGE_NOTICE_CALL.png") dialing_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) dialing_name = lv.label(dialing_screen) - dialing_name.set_pos(0, 160) + dialing_name.set_pos(0, 120) dialing_name.set_size(240, 50) + dialing_name.set_text(" ") dialing_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) dialing_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + dialing_call_label = lv.label(dialing_screen) + dialing_call_label.set_pos(0, 180) + dialing_call_label.set_size(240, 50) + dialing_call_label.set_text("正在等待对方接听电话") + dialing_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + hangup_imgbtn = lv.img(dialing_screen) hangup_imgbtn.set_size(64, 64) - hangup_imgbtn.set_src("E:/static/IMG_CC_HUNGUP1.png") + hangup_imgbtn.set_src("E:/static/hang_up.png") hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - hangup_imgbtn.set_pos(80, 220) + hangup_imgbtn.set_pos(80, 250) hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), lv.EVENT.CLICKED, None) self.meta = dialing_screen - + if dialing_name != None: + name = EventMesh.publish("get_phonename")#获取拨打电话名称 + dialing_name.set_text(name)#名称 + def post_processor_after_initialization(self): + # print("创建通话记录 post_processor_before_initialization\n") + utime.sleep_ms(200)#不加延时会切屏 #获取字符串 name = EventMesh.publish("get_phonename")#获取拨打电话名称 content = EventMesh.publish("get_phonenum")#获取电话号码 @@ -962,8 +988,6 @@ class DialingScreen(Screen): # ["15692025051","2","12:59","哥gdh符合双方和开发商开发好看的思考"], # 格式:{"电话号码":{"timesec":'时间戳',"number":'电话号码',"name":'名字',"time":'时间',"count":'通话次数'}} - - dialing_name.set_text(name)#名称 # dialing_content.set_text(content)#电话号码 num = 0 @@ -1010,7 +1034,7 @@ class DialingScreen(Screen): self.read_call_log[content] = tmp with open("/ext/static/storage_file/Call_log.json","w",encoding="utf-8") as fd: ujson.dump(self.read_call_log,fd) - print("创建通话记录") + print("创建通话记录") EventMesh.publish("set_call_log_list", [1,self.read_call_log]) EventMesh.publish("call_log_update_show_list") @@ -1035,6 +1059,335 @@ class DialingScreen(Screen): EventMesh.publish(constants.EVENT.SYSTEM_UP) + +no_sim_popup_screen = None +no_sim_popup_screen_title1 = None +no_sim_popup_screen_title2 = None +#未插卡 +class NoSimScreen(Screen):# + NAME = "no_sim_popup_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global no_sim_popup_screen,no_sim_popup_screen_title1,no_sim_popup_screen_title2 + if no_sim_popup_screen == None : + no_sim_popup_screen = lv.obj() + print("no_sim_popup_screen") + no_sim_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_popup_screen_title1 = lv.label(no_sim_popup_screen) + no_sim_popup_screen_title1.set_pos(0, 140) + no_sim_popup_screen_title1.set_size(240, 40) + no_sim_popup_screen_title1.set_text("无法连接到网络,请") + no_sim_popup_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_popup_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_popup_screen_title2 = lv.label(no_sim_popup_screen) + no_sim_popup_screen_title2.set_pos(0, 190) + no_sim_popup_screen_title2.set_size(240, 40) + no_sim_popup_screen_title2.set_text("插卡拨打") + no_sim_popup_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_popup_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = no_sim_popup_screen + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + +no_valied_num_screen = None +no_valied_num_screen_title1 = None +no_valied_num_screen_title2 = None +#=无效的号码 请重新输入 +class NovaliedNumScreen(Screen):# + NAME = "no_valied_num_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer_count = 0 + self.timer=osTimer() + + def initialization(self): + global no_valied_num_screen,no_valied_num_screen_title1,no_valied_num_screen_title2 + if no_valied_num_screen == None : + no_valied_num_screen = lv.obj() + print("no_valied_num_screen") + no_valied_num_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_valied_num_screen_title1 = lv.label(no_valied_num_screen) + no_valied_num_screen_title1.set_pos(0, 140) + no_valied_num_screen_title1.set_size(240, 40) + no_valied_num_screen_title1.set_text("无效的号码,") + no_valied_num_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_valied_num_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + no_valied_num_screen_title2 = lv.label(no_valied_num_screen) + no_valied_num_screen_title2.set_pos(0, 190) + no_valied_num_screen_title2.set_size(240, 40) + no_valied_num_screen_title2.set_text("请重新输入") + no_valied_num_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_valied_num_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = no_valied_num_screen + def post_processor_after_initialization(self): + self.timer_count = 0 + self.timer.start(5000,1,self.timeout_exit) + + def timeout_exit(self,e): + self.timer_count+=1 + if self.timer_count >= 2: + self.timer_count = 0 + EventMesh.publish("return_prev_screen") + + def Close(self): + self.timer.stop() + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + + +no_sim_power_screen = None +no_sim_power_screen_title = None +no_sim_power_screen_label =None +no_sim_power_screen_comfirm =None +no_sim_power_screen_cancel = None + + +#未插卡,长按关机 +class NoSimPowerScreen(Screen):# + NAME = "no_sim_power_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global no_sim_power_screen,no_sim_power_screen_title,no_sim_power_screen_comfirm,no_sim_power_screen_cancel,no_sim_power_screen_label + if no_sim_power_screen == None : + no_sim_power_screen = lv.obj() + print("no_sim_power_screen") + no_sim_power_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_power_screen_title = lv.label(no_sim_power_screen) + no_sim_power_screen_title.set_pos(0, 60) + no_sim_power_screen_title.set_size(240, 80) + no_sim_power_screen_title.set_text("未插卡,无法拨打") + no_sim_power_screen_title.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_power_screen_label = lv.label(no_sim_power_screen) + no_sim_power_screen_label.set_pos(0, 150) + no_sim_power_screen_label.set_size(240, 40) + no_sim_power_screen_label.set_text("是否关机?") + no_sim_power_screen_label.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + no_sim_power_screen_comfirm = lv.label(no_sim_power_screen) + no_sim_power_screen_comfirm.set_pos(0, 200) + no_sim_power_screen_comfirm.set_size(120, 80) + no_sim_power_screen_comfirm.set_text("是") + no_sim_power_screen_comfirm.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_power_screen_comfirm.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_comfirm.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + no_sim_power_screen_cancel = lv.label(no_sim_power_screen) + no_sim_power_screen_cancel.set_pos(120, 200) + no_sim_power_screen_cancel.set_size(120, 80) + no_sim_power_screen_cancel.set_text("否") + no_sim_power_screen_cancel.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_power_screen_cancel.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_cancel.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_cancel.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = no_sim_power_screen + no_sim_power_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), + lv.EVENT.CLICKED, None) + + no_sim_power_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.cancel(e)), + lv.EVENT.CLICKED, None) + + def confirm(self,e): + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + + def cancel(self,e): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + pass + #EventMesh.publish("return_prev_screen") + + def btn1_release(self): + #EventMesh.publish("return_prev_screen") + pass + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + +dialing_popup_screen = None +dialing_popup_img = None +dialing_popup_name = None +dialing_popup_hangup_imgbtn = None +class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 + NAME = "dialing_noplay_popup" + + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer1 = osTimer() + self.time_count = 0 + self.timer2 = osTimer() + + def initialization(self): + 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: + dialing_popup_screen = lv.obj() + print("dialing_popup_screen") + dialing_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_img = lv.img(dialing_popup_screen) + dialing_popup_img.set_pos(80, 20) + dialing_popup_img.set_size(64, 64) + dialing_popup_img.set_src("E:/static/IMAGE_NOTICE_CALL.png") + dialing_popup_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_name = lv.label(dialing_popup_screen) + dialing_popup_name.set_pos(0, 120) + dialing_popup_name.set_size(240, 50) + dialing_popup_name.set_text(" ") + dialing_popup_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_popup_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_call = lv.label(dialing_popup_screen) + dialing_popup_call.set_pos(0, 180) + dialing_popup_call.set_size(240, 50) + dialing_popup_call.set_text("正在拨号中") + dialing_popup_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_popup_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_hangup_imgbtn = lv.img(dialing_popup_screen) + dialing_popup_hangup_imgbtn.set_size(64, 64) + dialing_popup_hangup_imgbtn.set_src("E:/static/hang_up.png") + dialing_popup_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + dialing_popup_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + dialing_popup_hangup_imgbtn.set_pos(80, 250) + dialing_popup_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), + lv.EVENT.CLICKED, None) + self.meta = dialing_popup_screen + if dialing_popup_name != None: + name = EventMesh.publish("get_phonename")#获取拨打电话名称 + dialing_popup_name.set_text(name)#名称 + + def post_processor_after_initialization(self): + self.time_count = 0 + + self.timer1.start(1000, 1, self.timeout_hangup) + self.timer2.start(2000, 0, self.timeout_call) + + def timeout_call(self,e): + phone_num = EventMesh.publish("get_phonenum") + voiceCall.callStart(phone_num) + + def timeout_hangup(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.time_count+=1 + if self.time_count >= 10: + self.time_count = 0 + EventMesh.publish("set_UI_high_priority", 0) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + def hangup(self,e): + EventMesh.publish("set_UI_high_priority", 0) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + voiceCall.callEnd() + + def Close(self): + self.timer1.stop() + self.timer2.stop() + + def done_return(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn1_release(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + 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 message_popup_title = None #信息弹窗 @@ -1782,6 +2135,7 @@ class IncomingCallScreen(Screen): self.meta = incoming_call_screen EventMesh.publish("set_UI_high_priority", 1) + def post_processor_after_initialization(self): global incoming_call_screen,incoming_call_img,incoming_call_name_label,incoming_call_answer ,incoming_call_hangup utime.sleep_ms(200)#不加延时会切屏 @@ -2499,10 +2853,10 @@ class StepScreen(Screen): step_label = lv.label(step_screen) step_label.set_pos(10, 30) - step_label.set_size(100, 50) + step_label.set_size(230, 50) step_label.set_text("今日步数") step_label.set_long_mode(lv.label.LONG.WRAP) - step_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + step_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) step_label_01 = lv.label(step_screen) @@ -2779,9 +3133,11 @@ class ContactsScreen(Screen): self.contact_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) for i in range(self.MXA_phone_num): contact_btn = lv.btn(self.contact_detail_list) + contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), lv.EVENT.CLICKED, None) contact_btn.add_flag(lv.obj.FLAG.HIDDEN) + contact_btn_label_1 = lv.label(contact_btn) contact_btn_label_2 = lv.label(contact_btn) contact_btn_label_3 = lv.label(contact_btn) @@ -2876,8 +3232,11 @@ class ContactsScreen(Screen): def calling_cb(self,e): code = e.get_code() if code == lv.EVENT.CLICKED: - msg_text = e.get_target().get_child(1).get_text() - EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + msg_text = e.get_target().get_child(1).get_text() + EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + else: + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) def calling(self,msg_text): _msg = msg_text @@ -2889,8 +3248,12 @@ class ContactsScreen(Screen): phone_num = self.phonebook[_msg] EventMesh.publish("save_phonenum", phone_num) + # phone_num_tmp = int(phone_num) - voiceCall.callStart(phone_num) + + "dialing_noplay_popup" + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -2937,10 +3300,10 @@ class TemperatureScreen(Screen): temperature_body_label = lv.label(temperature_screen) temperature_body_label.set_pos(80, 40) - temperature_body_label.set_size(100, 20) + temperature_body_label.set_size(160, 20) temperature_body_label.set_text("当前腕温") temperature_body_label.set_long_mode(lv.label.LONG.WRAP) - temperature_body_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + temperature_body_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) temperature_body_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) temperature_degree_img = lv.img(temperature_screen) @@ -4421,12 +4784,19 @@ class SystemInitScreen(Screen): def system_init_timer_cb(self, *args): EventMesh.publish("system_sleep_rest")#防止黑屏 self.system_init_timer_count += 1 + if self.system_init_timer_count > 4: + self.system_init_timer_count = 1 if system_init_screen != None: - system_init_label_str = "系统初始化中" - for i in range(self.system_init_timer_count%5): - system_init_label_str += "." - system_init_label.set_text("{:<23}".format(system_init_label_str)) + system_init_label_str = "系统初始化中" + if self.system_init_timer_count == 1: + system_init_label.set_text("系统初始化中.") + elif self.system_init_timer_count == 2: + system_init_label.set_text("系统初始化中..") + elif self.system_init_timer_count == 3: + system_init_label.set_text("系统初始化中...") + else: + system_init_label.set_text("系统初始化中....") def Close(self): self.system_init_timer.stop() @@ -4567,6 +4937,9 @@ class UI(object): self.system_sleep_timeout_rest() def ui_press(self, event, key): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME == "system_init": + return self.system_sleep_timeout_rest() #print("ui press {}".format(event)) if event == "done_left_to_right": @@ -4584,6 +4957,9 @@ class UI(object): # if event == "done_press": # self.system_sleep_timeout_rest() def btn_press(self, event, key): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME == "system_init": + return print("btn_press: {}".format(event)) #主表盘按电源键,息屏 @@ -4603,7 +4979,7 @@ class UI(object): else: EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) else: - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) else: self.__lcd_on() return @@ -4624,13 +5000,16 @@ class UI(object): else: EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) else: - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) if event == "btn1_press": self.screen.btn1_release() def btn_release(self, event, msg): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME == "system_init": + return print("btn_release: {}".format(event)) # if self.main_flag != 1 and self.sleep_flag == 0: # self.__lcd_on() diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py index e45cd8fd..2f6b7c18 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py @@ -19,7 +19,7 @@ from machine import RTC watchface_style_default = lv.style_t() watchface_style_default.init() watchface_style_default.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -watchface_style_default.set_text_font_v2("font_24.bin",24,0) +watchface_style_default.set_text_font_v2("font_28.bin",28,0) style_font_youyuan_28 = lv.style_t() @@ -66,7 +66,7 @@ watchface1_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.M watchface1_res_stat_charge_in_img = lv.img(Watchface1) watchface1_res_stat_charge_in_img.set_pos(int(180),int(0)) -watchface1_res_stat_charge_in_img.set_size(6,16) +watchface1_res_stat_charge_in_img.set_size(10,18) watchface1_res_stat_charge_in_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) watchface1_res_stat_charge_in_img.add_flag(lv.obj.FLAG.CLICKABLE) watchface1_res_stat_charge_in_img.set_src("E:/static/charge_in.png") @@ -75,7 +75,7 @@ watchface1_res_stat_charge_in_img.add_style(style_watchface_img_default, lv.PART #主图片 watchface1_bg_img = lv.img(Watchface1) -watchface1_bg_img.set_pos(int(0),int(65)) +watchface1_bg_img.set_pos(int(9),int(65)) watchface1_bg_img.set_size(222,222) watchface1_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) watchface1_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) @@ -150,20 +150,26 @@ watchface1_step_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFA +# watchface1_HB_span = lv.label(Watchface1) +# watchface1_HB_span.set_pos(52, 235) +# watchface1_HB_span.set_size(80, 30) +# watchface1_HB_span.set_align(lv.TEXT_ALIGN.LEFT) +# watchface1_HB_span.set_text("0") +# watchface1_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + watchface1_HB_span = lv.label(Watchface1) -watchface1_HB_span.set_pos(52, 235) -watchface1_HB_span.set_size(80, 30) -watchface1_HB_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_HB_span.set_pos(5, 235) +watchface1_HB_span.set_size(115, 30) watchface1_HB_span.set_text("0") -watchface1_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - +watchface1_HB_span.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +watchface1_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN | lv.STATE.DEFAULT) watchface1_SPO2_span = lv.label(Watchface1) -watchface1_SPO2_span.set_pos(160, 235) -watchface1_SPO2_span.set_size(80, 30) -watchface1_SPO2_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_SPO2_span.set_pos(110, 235) +watchface1_SPO2_span.set_size(120, 30) watchface1_SPO2_span.set_text("0") +watchface1_SPO2_span.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) watchface1_SPO2_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) @@ -260,7 +266,7 @@ class WatchFace1(): pass def __oldHrValue(self, event, msg): - watchface1_HB_span.set_text(str(msg)) + watchface1_HB_span.set_text("120") def __oldSpo2Value(self, event, msg): watchface1_SPO2_span.set_text(str(msg)) @@ -321,7 +327,7 @@ watchface2_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.M watchface2_res_stat_charge_in_img = lv.img(Watchface2) watchface2_res_stat_charge_in_img.set_pos(int(180),int(0)) -watchface2_res_stat_charge_in_img.set_size(6,16) +watchface2_res_stat_charge_in_img.set_size(10,18) watchface2_res_stat_charge_in_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) watchface2_res_stat_charge_in_img.add_flag(lv.obj.FLAG.CLICKABLE) watchface2_res_stat_charge_in_img.set_src("E:/static/charge_in.png") diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_main_menu.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_main_menu.py index 10b43f20..e4f4ea78 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_main_menu.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_main_menu.py @@ -31,12 +31,12 @@ style_MainMenu_img_default.set_img_opa(255) style_font_youyuan_20 = lv.style_t() style_font_youyuan_20.init() style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) style_font_youyuan_25 = lv.style_t() style_font_youyuan_25.init() style_font_youyuan_25.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_25.set_text_font_v2("font_24.bin",24,0) +style_font_youyuan_25.set_text_font_v2("font_28.bin",28,0) style_btn = lv.style_t() style_btn.init() diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_setting.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_setting.py index d2b2604d..4f9451db 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_setting.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui_setting.py @@ -956,7 +956,7 @@ poweroff_confirm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) poweroff_confirm_label = lv.label(poweroff_confirm_img) poweroff_confirm_label.set_text("关机") -poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 0) +poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 5) poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) poweroff_return = lv.img(poweroff_screen) @@ -967,7 +967,7 @@ poweroff_return.add_flag(lv.obj.FLAG.CLICKABLE) poweroff_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) poweroff_return_label = lv.label(poweroff_return) poweroff_return_label.set_text("返回") -poweroff_return_label.align(lv.ALIGN.CENTER, 0, 0) +poweroff_return_label.align(lv.ALIGN.CENTER, 0, 5) poweroff_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) poweroff_return.set_ext_click_area(20) diff --git a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip index 01c2f983..2fffe126 100644 Binary files a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip and b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip differ diff --git a/2.sdk/project/K5/usr/main.py b/2.sdk/project/K5/usr/main.py index 0b4df1b7..7cffa64f 100644 --- a/2.sdk/project/K5/usr/main.py +++ b/2.sdk/project/K5/usr/main.py @@ -134,6 +134,10 @@ if __name__ == '__main__': ui.add_screen(_ui.NewMessageScreen()) ui.add_screen(_ui.sosScreen()) ui.add_screen(_ui.noSosDataScreen()) + ui.add_screen(_ui.NoSimScreen()) + ui.add_screen(_ui.NoSimPowerScreen()) + ui.add_screen(_ui.DialingNoPlayPopupScreen()) + ui.add_screen(_ui.NovaliedNumScreen()) ui.add_screen(NewWechatPopupScreen()) ui.add_screen(HealthScreen()) # ui.add_screen(_ui.Setting3Screen()) @@ -242,10 +246,12 @@ if __name__ == '__main__': sms.setSaveLoc('SM', 'SM', 'SM') print("init12:{}".format(utime.localtime())) timer_t = net.nitzTime() + print("timer_t:{}".format(timer_t)) if(timer_t != -1): timeSecond = int(timer_t[1]) - next_alarm_time = utime.localtime(timeSecond) - machine.RTC().datetime((next_alarm_time[0],next_alarm_time[1],next_alarm_time[2],next_alarm_time[6],next_alarm_time[3],next_alarm_time[4],next_alarm_time[5],0)) + if timeSecond != 0: + next_alarm_time = utime.localtime(timeSecond) + machine.RTC().datetime((next_alarm_time[0],next_alarm_time[1],next_alarm_time[2],next_alarm_time[6],next_alarm_time[3],next_alarm_time[4],next_alarm_time[5],0)) EventMesh.publish("load_screen", {"screen": "main_menu"})