From: dxy15521469561 <1731678236@qq.com> Date: Tue, 2 Jul 2024 02:07:38 +0000 (+0800) Subject: W8: X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=858e5322c99e91f5520a990f3de02ca044af9b4c;p=mirrors%2FASR1603_G5.git W8: bug修复 --- diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ai.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ai.py index df10e0f3..e3cce41a 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ai.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ai.py @@ -1711,6 +1711,12 @@ class AIScreen(Screen):#AI_GUI self.record.stop()#关闭录音 self.AI_label_answer = "" self.refresh_count = 0 + Record_read_buf = bytearray(self.Audio_buf_size) + for i in range(10): + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("Record_len:!!!!!!{}\r\n".format(Record_len)) + if Record_len <= 0: + break self.refresh_texttimer.stop() self.clear_flag() try: diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/main_init.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/main_init.py index d7b3884a..e4682aeb 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/main_init.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/main_init.py @@ -173,6 +173,14 @@ def main_init(): ui.add_screen(_ui.videoModeScreen()) ui.add_screen(_ui.voiceOutCallScreen()) + try: + from aigcdial import CreateScreen,aigcStyleLIstScreen,aigcMainLIstScreen + ui.add_screen(CreateScreen()) + ui.add_screen(aigcStyleLIstScreen()) + ui.add_screen(aigcMainLIstScreen()) + except Exception as e: + usys.print_exception(e) + # from pp_main import allppPopupScreen,delOnePopupScreen,ppListScreen,noppPopupScreen,delppsucessPopupScreen,ppMainScreen,addfaileppPopupScreen,ppMainPopupScreen,addppPopupScreen,addedppPopupScreen,ownaddppPopupScreen # ui.add_screen(ppMainScreen()) # ui.add_screen(ppMainPopupScreen()) diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py index 2d36ef34..a24b67b8 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py @@ -2192,11 +2192,12 @@ class LocationManager(Abstract): #检查基站数据 if self.cell_data == []: data_tmp = net.getCellInfo() - if(len(data_tmp)>=2): - for cell in data_tmp: - if cell and cell[0][0] == 0 and len(cell[0]) > 1: - self.cell_data = cell - break + if data_tmp != -1: + if(len(data_tmp)>=2): + for cell in data_tmp: + if cell and cell[0][0] == 0 and len(cell[0]) > 1: + self.cell_data = cell + break if self.location_type == 1: #测试模式 self.location_timer_count = 0 @@ -3132,8 +3133,6 @@ class testSmsSetIPManager(Abstract):# EventMesh.subscribe("get_new_key_pid", self.get_new_key_pid)# - - def set_new_key_cb(self, event, msg): self.new_key = msg # print("set_new_key_cb",msg,self.new_key) diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py index 4c500879..3f9a00fe 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py @@ -603,7 +603,8 @@ class KA_ProtoCol(ProtoCol): # print("old_step:send:%d %d"%(old_step,step)) EventMesh.publish("set_storage_config",["old_step_new",step+10]) EventMesh.publish("set_storage_config",["old_step_new",step]) - + else: + step = 0 old_step = step # step = EventMesh.publish(constants.EVENT.GET_STEP)[0] # 电池电量百分比 @@ -2445,7 +2446,7 @@ class MEMBERS_ProtoCol(ProtoCol):#获取账号列表 j+=1 print("videobook!!!:{}".format(str(videobook))) # print("phonebook!!!:{}".format(str(phonebook))) - + with open("/usr/static/storage_file/videobook.json","w+",encoding="utf-8") as fd: ujson.dump(videobook,fd) print("创建视频通话账号") diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ui.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ui.py index 373c6f92..e90ae84a 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ui.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/ui.py @@ -8040,7 +8040,8 @@ class cameraalbumScreen(Screen):#相册 read_album = 0 read_album = EventMesh.publish("get_camera_num") print("read_album",read_album) - if int(read_album) != 0: + IFEXIST = ql_fs.path_exists("/ext/static/album/1_camera.jpg") + if IFEXIST == True: camera_album_popup_img1.clear_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_img1.set_src("U:/static/album/1_camera.jpg") #'U:/6_camera.jpeg'"U:/static/album/1_camera.jpg" camera_album_popup_img2.clear_flag(lv.obj.FLAG.HIDDEN) diff --git a/2.sdk/project/W8/ext/static/IMAGE_APP_QR_CODE.png b/2.sdk/project/W8/ext/static/IMAGE_APP_QR_CODE.png index ad3500a5..69fe55c8 100644 Binary files a/2.sdk/project/W8/ext/static/IMAGE_APP_QR_CODE.png and b/2.sdk/project/W8/ext/static/IMAGE_APP_QR_CODE.png differ diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/EventMesh.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/EventMesh.py index 2b472e34..c33ba103 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/EventMesh.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/EventMesh.py @@ -2,7 +2,7 @@ import _thread import usys import versions -MODEL = "CO6S_" #项目型号 +MODEL = "W8_" #项目型号 version = "{}{}".format(MODEL,versions.Version) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appAlipay.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appAlipay.py index e9acfd94..a48dd898 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appAlipay.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/appAlipay.py @@ -13,6 +13,7 @@ import pm from ui import Screen from code import code_128_generate_barcode import code128 +import usys 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)) @@ -38,6 +39,7 @@ class Alipay(Abstract): 支付宝 """ def __init__(self): + self.alipay = None self.imei = modem.getDevImei() if self.imei == None : self.imei = "1111" @@ -49,7 +51,7 @@ class Alipay(Abstract): self.imsi = "1111" self.mac = "123456" self.sn = modem.getDevSN() - if self.sn == "" : + if self.sn == "" or self.sn == -1 or len(self.sn) < 17: self.sn = "{:Z>17}".format(self.imei) self.vendor = "ZHSX" self.product_name = "ZHSX" @@ -61,6 +63,8 @@ class Alipay(Abstract): self.timer_Alipay = osTimer() self.Alipay_Ui_isOpen = 0 self.Alipay_init_flag = 0 + self.is_simcard_identify = 255 + self.is_init = 255 EventMesh.subscribe("alipay_unbind", self.alipay_unbind) EventMesh.subscribe("alipay_1", self.alipay_1) @@ -74,23 +78,10 @@ class Alipay(Abstract): EventMesh.subscribe("get_Alipay_Ui_isOpen",self.get_Alipay_Ui_isOpen) EventMesh.subscribe("set_Alipay_Ui_isOpen",self.set_Alipay_Ui_isOpen) - self.is_simcard_identify = 255 - self.is_init = 255 - self.upay_bound = 0 #绑定结果 - #print("\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',0".format(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self. product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0)) - self.alipay = ALIPAY(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self. product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0) - #print("Alipay init:{}".format(self.alipay)) - #self.alipay = ALIPAY("867387060319491", "898604293619F0549750","460044917509047", "123456", "P1Q22I80C0007530P","ZHIHUISHIXUN", "ZHIHUISHIXUN", "EC800M", "uHTfYqOlGlA" , "a15PcyZ3IHA", "kOGGPhtXAg1Lz1vg",0) - # '826226511997184', '898600811923C9628962','460071677091483', '123456', 'PIQ38706031949100', 'ZHIHUISHIXUN','ZHIHUISHIXUN', 'EG810M', 'uHTfYqOlGlA', 'a15PcyZ3IHA', 'kOGGPhtXAg1Lz1vg',0 - #self.alipay = ALIPAY('826226511997184', '898600811923C9628962', '460071677091483', '123456', "P1Q22I80C0007530P",'ZHSX', 'ZHSX', 'EG810M', 'voPuTFiLcdA', 'a1c7Ojs6HMR', 'TxPFIJ5F1kwa0zO3', 0) - #self.alipay.register_print() - #self.alipay.set_log_limit(5) - self.alipay.set_log_limit(0) - #self.timer_Alipay.start(20000, 1, self.timeout_Alipay) def post_processor_after_instantiation(self): print("post_processor_after_instantiation") - EventMesh.publish_async("Alipay_init","",40*1024) + #EventMesh.publish_async("Alipay_init","",40*1024) def get_Alipay_Ui_isOpen(self, event, msg): @@ -98,6 +89,25 @@ class Alipay(Abstract): def set_Alipay_Ui_isOpen(self, event, msg): self.Alipay_Ui_isOpen = msg def Alipay_init(self, event, msg): + if self.alipay == None or type(self.alipay) == int: + try: + self.is_simcard_identify = 255 + self.is_init = 255 + self.upay_bound = 0 #绑定结果 + print("\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',0".format(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self.product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0)) + self.alipay = ALIPAY(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self.product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0) + #print("Alipay init:{}".format(self.alipay)) + #self.alipay = ALIPAY("867387060319491", "898604293619F0549750","460044917509047", "123456", "P1Q22I80C0007530P","ZHIHUISHIXUN", "ZHIHUISHIXUN", "EC800M", "uHTfYqOlGlA" , "a15PcyZ3IHA", "kOGGPhtXAg1Lz1vg",0) + # '826226511997184', '898600811923C9628962','460071677091483', '123456', 'PIQ38706031949100', 'ZHIHUISHIXUN','ZHIHUISHIXUN', 'EG810M', 'uHTfYqOlGlA', 'a15PcyZ3IHA', 'kOGGPhtXAg1Lz1vg',0 + #self.alipay = ALIPAY('826226511997184', '898600811923C9628962', '460071677091483', '123456', "P1Q22I80C0007530P",'ZHSX', 'ZHSX', 'EG810M', 'voPuTFiLcdA', 'a1c7Ojs6HMR', 'TxPFIJ5F1kwa0zO3', 0) + #self.alipay.register_print() + #self.alipay.set_log_limit(5) + self.alipay.set_log_limit(0) + + #self.timer_Alipay.start(20000, 1, self.timeout_Alipay) + except Exception as e: + usys.print_exception(e) + if self.Alipay_init_flag == 1: print("Alipay_init:reuse!!!!!!!!") #self.Alipay_init_flag = 0 @@ -409,7 +419,7 @@ class AlipayOpenScreen(Screen): #初始化成功 未联网 #初始化失败 已联网 - if (EventMesh.publish(constants.EVENT.GET_CONNECT) == 0 and EventMesh.publish("get_alipay_init") != 0) or EventMesh.publish("get_alipay_init") != 0: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0: AlipayOpen_label.clear_flag(lv.obj.FLAG.HIDDEN) else: AlipayOpen_label.add_flag(lv.obj.FLAG.HIDDEN) @@ -435,7 +445,7 @@ class AlipayOpenScreen(Screen): state = EventMesh.publish(constants.EVENT.GET_CONNECT) print("AlipayOpenScreen:state",state) if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0: - if self.timer_AlipayOpen_count > 10: + if self.timer_AlipayOpen_count > 30: self.timer_AlipayOpen_count = 0 EventMesh.publish("return_prev_screen") else: @@ -446,8 +456,8 @@ class AlipayOpenScreen(Screen): EventMesh.publish("alipay_1") else : #print("timeout_AlipayOpen:!!!!!!!!!!",self.timer_AlipayOpen_count) - if self.timer_AlipayOpen_count>10 or self.timer_AlipayOpen_count == 0: - if self.timer_AlipayOpen_count > 10: + if (self.timer_AlipayOpen_count % 10 == 0) or self.timer_AlipayOpen_count == 0: + if self.timer_AlipayOpen_count > 30: self.timer_AlipayOpen_count = 0 EventMesh.publish("return_prev_screen") return diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py index 8b180fee..f165c720 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py @@ -6,7 +6,7 @@ """ app_bin_816d = [ -0x00, 0x00, 0x00, 0x3c, 0x61, 0x8c, +0x00, 0x00, 0x00, 0x3c, 0x4d, 0x79, 0x02, 0x29, 0xeb, 0x75, 0x91, 0xcc, 0x75, 0x91, 0x00, 0x32, 0x32, 0x22, 0x02, 0x00, 0x03, 0x02, 0x2e, 0x51, 0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x25, 0x02, 0x0f, 0xac, 0x00, 0x02, 0x30, 0xbf, 0x8f, 0x22, 0x8d, 0x23, 0x12, 0x08, 0xae, 0xe2, 0x70, 0x03, 0x02, 0x05, @@ -873,15 +873,15 @@ app_bin_816d = [ 0x02, 0xf5, 0x83, 0xe0, 0xff, 0x22, 0x12, 0x32, 0x95, 0x74, 0x9c, 0x93, 0xfd, 0x02, 0x00, 0x24, 0xb6, 0x48, 0x01, 0x0a, 0x14, 0x01, 0x02, 0x05, 0x3c, 0x70, 0x00, 0x00, 0x15, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0x00, 0x03, 0x0a, 0x00, 0xc8, 0x03, 0xe8, 0x0f, 0x1e, 0x0c, 0x10, 0x3c, 0x01, 0x00, 0x50, -0x43, 0x41, 0x44, 0x51, 0x45, 0x52, 0x46, 0x53, 0x56, 0x54, 0x17, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x19, 0x28, 0x28, 0x28, 0x28, 0x00, 0x28, -0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x78, 0x2e, 0x90, 0x01, 0x01, 0x0a, 0x0a, 0x85, 0x00, 0x96, +0x00, 0x00, 0x03, 0x0a, 0x00, 0xc8, 0x03, 0xe8, 0x0f, 0x1e, 0x0a, 0x10, 0x3c, 0x01, 0x00, 0x50, +0x43, 0x51, 0x44, 0x52, 0x45, 0x53, 0x46, 0x54, 0x56, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x23, 0x23, 0x23, 0x23, 0x23, 0x19, 0x23, 0x23, 0x23, 0x23, 0x00, 0x28, +0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x78, 0x3a, 0x90, 0x00, 0x01, 0x0a, 0x0a, 0x85, 0x00, 0x96, 0x02, 0x6c, 0x02, 0x6c, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, -0x28, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x01, 0x18, 0x00, 0x23, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, +0x28, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x01, 0x18, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0xc8, 0x00, 0xc8, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x1e, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x00, 0x01, 0x08, 0x09, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, @@ -966,8 +966,7 @@ app_bin_816d = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xb6, 0x02, 0x40, 0x52, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x8c, - +0xb6, 0x02, 0x40, 0x52, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x79, ] #endif /*CAPACITIVE_HYNITRON_CST816D_UPDATE_H__*/ diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/main_init.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/main_init.py index e109eae8..194c0ac6 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/main_init.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/main_init.py @@ -413,6 +413,7 @@ def main_init(): 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)) + except Exception as e: usys.print_exception(e) 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 f0ca4abb..97fceb99 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 @@ -513,11 +513,11 @@ class sosInfoCallManager(Abstract): num_len = 0 if len(number) == 1: - num_len = len(number) - elif len(number) == 2: num_len = len(number)+1 + elif len(number) == 2: + num_len = len(number)+1+2 elif len(number) == 3: - num_len = len(number)+2 + num_len = len(number)+5 # print("number:{} number_len :{} num:{} num_len:{}".format(number,len(number),num,num_len)) if num > num_len : # if len(number) == 1: @@ -546,28 +546,29 @@ class sosInfoCallManager(Abstract): EventMesh.publish("set_callnumer_cb",number[0]) print("phone 1") elif len(number) == 2: - if num == 1 or num == 3: + if num == 1 or num == 3 or num == 5: print("phone 2") if len(number[1]) != 0: EventMesh.publish("set_callnumer_cb",number[1]) - elif num == 2: + elif num == 2 or num == 4: print("phone 3") if len(number[0]) != 0: EventMesh.publish("set_callnumer_cb",number[0]) elif len(number) == 3: - if num == 1 or num == 4: + if num == 1 or num == 4 or num == 7: if len(number[1]) != 0: EventMesh.publish("set_callnumer_cb",number[1]) print("phone 4") - elif num == 2 or num == 5: + elif num == 2 or num == 5 or num == 8: print("phone 5") if len(number[2]) != 0: EventMesh.publish("set_callnumer_cb",number[2]) - elif num == 3: + elif num == 3 or num == 6: if len(number[0]) != 0: print("phone 6") EventMesh.publish("set_callnumer_cb",number[0]) + WL_timer = osTimer() def WL_timer_cb(*args): get_call = EventMesh.publish("get_call_state") @@ -2549,11 +2550,12 @@ class LocationManager(Abstract): #检查基站数据 if self.cell_data == []: data_tmp = net.getCellInfo() - if(len(data_tmp)>=2): - for cell in data_tmp: - if cell and cell[0][0] == 0 and len(cell[0]) > 1: - self.cell_data = cell - break + if data_tmp != -1: + if(len(data_tmp)>=2): + for cell in data_tmp: + if cell and cell[0][0] == 0 and len(cell[0]) > 1: + self.cell_data = cell + break if self.location_type == 1: #测试模式 self.location_timer_count = 0 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 54940cda..82a1c017 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 @@ -613,11 +613,15 @@ class KA_ProtoCol(ProtoCol): # print("old_step:send:%d %d"%(old_step,step)) EventMesh.publish("set_storage_config",["old_step_new",step+10]) EventMesh.publish("set_storage_config",["old_step_new",step]) - + else: + step = 0 old_step = step # step = EventMesh.publish(constants.EVENT.GET_STEP)[0] # 电池电量百分比 bat_tmp = EventMesh.publish("screen_get_battery") + if bat_tmp == None: + bat_tmp[1] = 100 + battery_caption = bat_tmp[1] print("KA,{},{},{},{}".format(date,step,0,battery_caption)) send_data = "KA,%s,%d,%d,%d"%(date,step,0,battery_caption) 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 e1a7d18c..3337fdab 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 @@ -4019,12 +4019,16 @@ class StepScreen(Screen): self.meta = step_screen step = EventMesh.publish("get_old_step_value") + if step == None: + step = 0 step_label_01.set_text("{} æ­¥".format(step)) self.timer.start(1000, 1, self.revcing) def revcing(self, *args, **kwargs): global step_screen,step_label ,step_label_01 ,step_img step = EventMesh.publish("get_old_step_value") + if step == None: + step = 0 step_label_01.set_text("{} æ­¥".format(step)) def Close(self): 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 c9cb89de..d2387126 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 @@ -29,6 +29,7 @@ power_line_points = [{"x":0,"y":0},{"x":0,"y":16}] power_line_red = lv.style_t() power_line_red.init() power_line_red.set_line_width(0)#23 宽度 +power_line_red.set_line_rounded(False) #没有圆角 power_line_red.set_line_color(lv.color_make(0xff, 0xff, 0xff)) Watchface = lv.obj() @@ -74,9 +75,10 @@ watchface1_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.M watchface1_res_stat_battery_line = lv.line(Watchface1) watchface1_res_stat_battery_line.set_points(power_line_points,2) watchface1_res_stat_battery_line.set_pos(int(192),int(20)) -watchface1_res_stat_battery_line.set_size(0,16)#高度12 +watchface1_res_stat_battery_line.set_size(0,6)#高度12 watchface1_res_stat_battery_line.add_style(power_line_red,0) + watchface1_res_stat_charge_in_img = lv.img(Watchface1) watchface1_res_stat_charge_in_img.set_pos(int(180),int(10)) watchface1_res_stat_charge_in_img.set_size(10,18) @@ -291,23 +293,29 @@ class WatchFace1(): else: watchface1_res_stat_battery_img.set_src("E:/static/vbat_0.png") level = msg[1] - if level >= 100: + if level >= 99: level = 100 line_len = int(level*(30/100)) - # print("__battery_cb:",level,line_len,30/100) + print("__battery_cb111:",level,line_len,30/100) if line_len >= 30: line_len = 30 if line_len <= 6: line_len = 6 set_x = int(188+line_len//2) - watchface1_res_stat_battery_line.set_pos(int(set_x),int(18)) - watchface1_res_stat_battery_line.set_size(line_len,5) - watchface1_res_stat_battery_line.set_style_line_width(line_len,lv.PART.MAIN) + + line_points = [ + {"x":0, "y":5}, + {"x":line_len, "y":5}, + ] + watchface1_res_stat_battery_line.set_size(int(line_len),int(6)) + watchface1_res_stat_battery_line.set_pos(int(188),int(21)) + watchface1_res_stat_battery_line.set_points(line_points, 2) + watchface1_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) + if line_len <= 6: watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) else: watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) - # watchface2_res_stat_battery_img.set_src("E:/static/vbat_%d.png"%(msg[1]))#"E:/vbat_60.png" pass def __oldHrValue(self, event, msg): @@ -351,7 +359,12 @@ Watchface2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) Watchface2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) #表盘 - +Watchface2_bg_img = lv.img(Watchface2) +Watchface2_bg_img.set_pos(int(0),int(0)) +Watchface2_bg_img.set_size(240,282) +Watchface2_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +Watchface2_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +Watchface2_bg_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #状态栏 watchface2_mpsignal_img = lv.img(Watchface2) @@ -366,7 +379,6 @@ watchface2_res_stat_battery_img = lv.img(Watchface2) watchface2_res_stat_battery_img.set_pos(int(185),int(15)) watchface2_res_stat_battery_img.set_size(40,22) watchface2_res_stat_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -watchface2_res_stat_battery_img.add_flag(lv.obj.FLAG.CLICKABLE) watchface2_res_stat_battery_img.set_src("E:/static/vbat_0.png") watchface2_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) @@ -374,7 +386,7 @@ watchface2_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.M watchface2_res_stat_battery_line = lv.line(Watchface2) watchface2_res_stat_battery_line.set_points(power_line_points,2) watchface2_res_stat_battery_line.set_pos(int(192),int(20)) -watchface2_res_stat_battery_line.set_size(0,16)#高度12 +watchface2_res_stat_battery_line.set_size(0,6)#高度12 watchface2_res_stat_battery_line.add_style(power_line_red,0) @@ -459,16 +471,38 @@ watchface2_step_txt.set_align(lv.TEXT_ALIGN.LEFT) watchface2_step_txt.set_text("0") watchface2_step_txt.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) +Watchface2_label_edit = lv.label(Watchface2) +Watchface2_label_edit.set_pos(0, 0) +Watchface2_label_edit.set_size(240, 282) +Watchface2_label_edit.set_text(" ") +Watchface2_label_edit.add_flag(lv.obj.FLAG.CLICKABLE) + class WatchFace2(): NAME = "Watchface2" # # #表盘2 def __init__(self): print("Watchface2:__init__") self.meta = Watchface2 + EventMesh.subscribe("update_dial_file", self.update_dial_file) + # Watchface2_label_edit. def set_parent(self,main_menu): Watchface1.set_parent(main_menu)#设置父控件 - + + def update_dial_file(self, event, msg): #更新表盘文件 + check_txt = ql_fs.path_exists("/ext/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True : + Watchface2_bg_img.set_src("E:/static/storage_file/aigc_dial.jpg") + pass + def initialization(self): + check_txt = ql_fs.path_exists("/ext/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True: + Watchface2_bg_img.clear_flag(lv.obj.FLAG.HIDDEN) + Watchface2_bg_img.set_src("E:/static/storage_file/aigc_dial.jpg") + else: + Watchface2_bg_img.add_flag(lv.obj.FLAG.HIDDEN) print("Watchface2:initialization") #Watchface2.set_parent(main_menu)#设置父控件 #获取信号 @@ -554,19 +588,27 @@ class WatchFace2(): if level >= 99: level = 100 line_len = int(level*(30/100)) - # print("__battery_cb:",level,line_len,30/100) + print("__battery_cb:222",level,line_len,30/100) if line_len >= 30: line_len = 30 if line_len <= 6: line_len = 6 set_x = int(188+line_len//2) - watchface2_res_stat_battery_line.set_pos(int(set_x),int(18)) - watchface2_res_stat_battery_line.set_size(line_len,5) - watchface2_res_stat_battery_line.set_style_line_width(line_len,lv.PART.MAIN) + + line_points = [ + {"x":0, "y":5}, + {"x":line_len, "y":5}, + ] + watchface2_res_stat_battery_line.set_size(int(line_len),int(6)) + watchface2_res_stat_battery_line.set_pos(int(188),int(21)) + watchface2_res_stat_battery_line.set_points(line_points, 2) + watchface2_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) + if line_len <= 6: watchface2_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) else: watchface2_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) + # watchface2_res_stat_battery_img.set_src("E:/static/vbat_%d.png"%(msg[1]))#"E:/vbat_60.png" pass def __stepValue(self, event, msg): @@ -773,30 +815,26 @@ class WatchFace3(): if level >= 99: level = 100 line_len = int(level*(30/100)) - # print("__battery_cb:",level,line_len,30/100) + print("__battery_cb:222",level,line_len,30/100) if line_len >= 30: line_len = 30 - if line_len <= 3: - line_len = 3 + if line_len <= 6: + line_len = 6 set_x = int(188+line_len//2) line_points = [ {"x":0, "y":5}, {"x":line_len, "y":5}, ] - watchface3_res_stat_battery_line.set_size(int(line_len),int(10)) + watchface3_res_stat_battery_line.set_size(int(line_len),int(6)) watchface3_res_stat_battery_line.set_pos(int(188),int(21)) watchface3_res_stat_battery_line.set_points(line_points, 2) watchface3_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) - - # watchface3_res_stat_battery_line.set_pos(int(set_x),int(18)) - # watchface3_res_stat_battery_line.set_size(line_len,5) - # watchface3_res_stat_battery_line.set_style_line_width(line_len,lv.PART.MAIN) - if line_len <= 3: + if line_len <= 6: watchface3_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) else: - watchface3_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) + watchface3_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) def __time(self, event, msg): @@ -863,7 +901,7 @@ class WatchFace(): def __init__(self,main_menu): #表盘 self.meta = None - self.watchface_style_num = "Watchface3" + self.watchface_style_num = "Watchface2" self.watchface_list = [] self.watchface_style = None self.timer_update = osTimer() @@ -875,7 +913,6 @@ class WatchFace(): if self.watchface_list == [] : #第一次初始化 self.watchface_list.append( WatchFace1()) self.watchface_list.append( WatchFace2()) - self.watchface_list.append( WatchFace3()) self.set_parent( main_menu) for wat in self.watchface_list: @@ -885,8 +922,27 @@ class WatchFace(): self.watchface_style.initialization() self.meta = self.watchface_style.meta self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 + EventMesh.subscribe("update_dial_file", self.update_dial_file) + + def update_dial_file(self, event, msg): #更新表盘文件 + for wat in self.watchface_list: + if wat.NAME == self.watchface_style_num : + self.watchface_style = wat + wat.meta.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + self.watchface_style.initialization() + self.meta = self.watchface_style.meta + self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 + check_txt = ql_fs.path_exists("/ext/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True : + if Watchface2_bg_img != None: + Watchface2_bg_img.set_src("E:/static/storage_file/aigc_dial.jpg") + + + pass def initialization(self): + self.watchface_style.timerout_update() print("watchface INIT !!!!!!!!:",self.watchface_style_num) @@ -895,7 +951,6 @@ class WatchFace(): def set_parent(self,main_menu): Watchface1.set_parent(main_menu)#设置父控件 Watchface2.set_parent(main_menu)#设置父控件 - Watchface3.set_parent(main_menu)#设置父控件 def timerout_update(self, *args, **kwargs): self.watchface_style.timerout_update() diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_main_menu.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_main_menu.py index 38a97f70..98b98610 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_main_menu.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_main_menu.py @@ -244,28 +244,28 @@ MainMenu2_img_sms_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STAT MainMenu2_num+=1 MainMenu2x+=1 -#AI助手 -MainMenu2_ai = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) -label_text = lv.label(MainMenu2_ai) -label_text.set_pos(0, LCD_SIZE_H) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_ai = lv.img(MainMenu2_ai) -MainMenu2_img_ai.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) -MainMenu2_img_ai.set_pos(MAIN_ICON_X,MAIN_ICON_Y) -MainMenu2_img_ai.set_src("U:/static/IMAGE_ONE_PAGE_AI.png") -MainMenu2_img_ai.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_ai.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_ai_txt = lv.label(MainMenu2_ai) -MainMenu2_img_ai_txt.set_pos(int(0),int(MAIN_LABEL_Y)) -MainMenu2_img_ai_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) -MainMenu2_img_ai_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_ai_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_ai_txt.set_text("AI助手") -MainMenu2_img_ai_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 +# #AI助手 +# MainMenu2_ai = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_ai) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_ai = lv.img(MainMenu2_ai) +# MainMenu2_img_ai.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_ai.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_ai.set_src("U:/static/IMAGE_ONE_PAGE_AI.png") +# MainMenu2_img_ai.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_ai.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_ai_txt = lv.label(MainMenu2_ai) +# MainMenu2_img_ai_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_ai_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_ai_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_ai_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_ai_txt.set_text("AI助手") +# MainMenu2_img_ai_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 #微聊 MainMenu2_wechat = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) @@ -290,28 +290,28 @@ MainMenu2_img_wechat_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.S MainMenu2_num+=1 MainMenu2x+=1 -#健康测量 -MainMenu2_heartrate = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) -label_text = lv.label(MainMenu2_heartrate) -label_text.set_pos(0, LCD_SIZE_H) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_health = lv.img(MainMenu2_heartrate) -MainMenu2_img_health.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) -MainMenu2_img_health.set_pos(MAIN_ICON_X,MAIN_ICON_Y) -MainMenu2_img_health.set_src("U:/static/IMAGE_ONE_PAGE_HEALTH.png") -MainMenu2_img_health.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_health.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_health_txt = lv.label(MainMenu2_heartrate) -MainMenu2_img_health_txt.set_pos(int(0),int(MAIN_LABEL_Y)) -MainMenu2_img_health_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) -MainMenu2_img_health_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_health_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_health_txt.set_text("健康测量") -MainMenu2_img_health_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 +# #健康测量 +# MainMenu2_heartrate = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_heartrate) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_health = lv.img(MainMenu2_heartrate) +# MainMenu2_img_health.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_health.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_health.set_src("U:/static/IMAGE_ONE_PAGE_HEALTH.png") +# MainMenu2_img_health.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_health.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_health_txt = lv.label(MainMenu2_heartrate) +# MainMenu2_img_health_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_health_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_health_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_health_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_health_txt.set_text("健康测量") +# MainMenu2_img_health_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 #血样检测 # MainMenu2_spo2 = MainMenu2_til.add_tile(4, 0, lv.DIR.LEFT | lv.DIR.RIGHT) # label_text = lv.label(MainMenu2_spo2) @@ -571,47 +571,58 @@ MainMenu1_img_wechat.set_src("U:/static/theme1/THEME1_WECHAT.png") # MainMenu1_img_wechat.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_wechat.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) -MainMenu1_img_health_text = lv.label(MainMenu1_three) -MainMenu1_img_health_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) -MainMenu1_img_health_text.set_size(THEME1_ICON_X,THEME1_ICON_X) -MainMenu1_img_health_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_health_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_health_text.set_text(" ") -MainMenu1_img_health_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu1_img_health_text = lv.label(MainMenu1_three) +# MainMenu1_img_health_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_health_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_health_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_health_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_health_text.set_text(" ") +# MainMenu1_img_health_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_ai_text = lv.label(MainMenu1_three) +# MainMenu1_img_ai_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +# MainMenu1_img_ai_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_ai_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_ai_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_ai_text.set_text(" ") +# MainMenu1_img_ai_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu1_img_ai_text = lv.label(MainMenu1_three) -MainMenu1_img_ai_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) -MainMenu1_img_ai_text.set_size(THEME1_ICON_X,THEME1_ICON_X) -MainMenu1_img_ai_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_ai_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_ai_text.set_text(" ") -MainMenu1_img_ai_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) MainMenu1_img_wechat_text = lv.label(MainMenu1_three) -MainMenu1_img_wechat_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_wechat_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) MainMenu1_img_wechat_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_wechat_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_wechat_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) MainMenu1_img_wechat_text.set_text(" ") MainMenu1_img_wechat_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) -# MainMenu1_img_alarm= lv.img(MainMenu1_three) -# MainMenu1_img_alarm.set_size(THEME1_ICON_X,THEME1_ICON_Y) -# MainMenu1_img_alarm.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) -# MainMenu1_img_alarm.set_src("U:/static/theme1/THEME1_ALARM.png") -# MainMenu1_img_alarm.add_flag(lv.obj.FLAG.CLICKABLE) -# MainMenu1_img_alarm.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) MainMenu1_img_alarm_text = lv.label(MainMenu1_three) -MainMenu1_img_alarm_text.set_pos(MAIN1_ICON_X*2+85,140+5) +MainMenu1_img_alarm_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) MainMenu1_img_alarm_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_alarm_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_alarm_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) MainMenu1_img_alarm_text.set_text(" ") MainMenu1_img_alarm_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) +MainMenu1_img_camera_text = lv.label(MainMenu1_three) +MainMenu1_img_camera_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_camera_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_camera_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_camera_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_camera_text.set_text(" ") +MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_picture_text = lv.label(MainMenu1_three) +MainMenu1_img_picture_text.set_pos(int(MAIN1_ICON_X*2+85),int(140+5)) +MainMenu1_img_picture_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_picture_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_picture_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_picture_text.set_text(" ") +MainMenu1_img_picture_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + MainMenu1_num+=1 MainMenu1x+=1 @@ -629,24 +640,10 @@ MainMenu1_img_toolbox.set_src("U:/static/theme1/THEME1_CAMERA.png") # MainMenu1_img_toolbox.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_toolbox.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) -MainMenu1_img_camera_text = lv.label(MainMenu1_four) -MainMenu1_img_camera_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) -MainMenu1_img_camera_text.set_size(THEME1_ICON_X,THEME1_ICON_X) -MainMenu1_img_camera_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_camera_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_camera_text.set_text(" ") -MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu1_img_picture_text = lv.label(MainMenu1_four) -MainMenu1_img_picture_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) -MainMenu1_img_picture_text.set_size(THEME1_ICON_X,THEME1_ICON_X) -MainMenu1_img_picture_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_picture_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_picture_text.set_text(" ") -MainMenu1_img_picture_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) MainMenu1_img_video_text = lv.label(MainMenu1_four) -MainMenu1_img_video_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_video_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) MainMenu1_img_video_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_video_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_video_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -654,13 +651,62 @@ MainMenu1_img_video_text.set_text(" ") MainMenu1_img_video_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) MainMenu1_img_alipay_text = lv.label(MainMenu1_four) -MainMenu1_img_alipay_text.set_pos(MAIN1_ICON_X*2+85,140+5) +MainMenu1_img_alipay_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) MainMenu1_img_alipay_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_alipay_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_alipay_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) MainMenu1_img_alipay_text.set_text(" ") MainMenu1_img_alipay_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu1_img_camera_text = lv.label(MainMenu1_four) +# MainMenu1_img_camera_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_camera_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_camera_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_camera_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_camera_text.set_text(" ") +# MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_picture_text = lv.label(MainMenu1_four) +# MainMenu1_img_picture_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) +# MainMenu1_img_picture_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_picture_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_picture_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_picture_text.set_text(" ") +# MainMenu1_img_picture_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_stopwatch_text = lv.label(MainMenu1_four) +MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_stopwatch_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +MainMenu1_img_stopwatch_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_stopwatch_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_stopwatch_text.set_text(" ") +MainMenu1_img_stopwatch_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + +MainMenu1_img_countdown_text = lv.label(MainMenu1_four) +MainMenu1_img_countdown_text.set_pos(MAIN1_ICON_X*2+85,140+5) +MainMenu1_img_countdown_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +MainMenu1_img_countdown_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_countdown_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_countdown_text.set_text(" ") +MainMenu1_img_countdown_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_video_text = lv.label(MainMenu1_four) +# MainMenu1_img_video_text.set_pos(MAIN1_ICON_X,140+5) +# MainMenu1_img_video_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_video_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_video_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_video_text.set_text(" ") +# MainMenu1_img_video_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_alipay_text = lv.label(MainMenu1_four) +# MainMenu1_img_alipay_text.set_pos(MAIN1_ICON_X*2+85,140+5) +# MainMenu1_img_alipay_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_alipay_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_alipay_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_alipay_text.set_text(" ") +# MainMenu1_img_alipay_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + MainMenu1_num+=1 MainMenu1x+=1 @@ -672,31 +718,31 @@ label_text.set_size(0, 0) label_text.set_text("{}".format(MainMenu1_num)) MainMenu1_img_setting = lv.img(MainMenu1_setting) -MainMenu1_img_setting.set_size(240,282) +MainMenu1_img_setting.set_size(240,140) MainMenu1_img_setting.set_pos(0,0) MainMenu1_img_setting.set_src("U:/static/theme1/THEME1_SETING.png") # MainMenu1_img_setting.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_setting.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) -MainMenu1_img_stopwatch_text = lv.label(MainMenu1_setting) -MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) -MainMenu1_img_stopwatch_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) -MainMenu1_img_stopwatch_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_stopwatch_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_stopwatch_text.set_text(" ") -MainMenu1_img_stopwatch_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu1_img_stopwatch_text = lv.label(MainMenu1_setting) +# MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_stopwatch_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_stopwatch_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_stopwatch_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_stopwatch_text.set_text(" ") +# MainMenu1_img_stopwatch_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu1_img_countdown_text = lv.label(MainMenu1_setting) -MainMenu1_img_countdown_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) -MainMenu1_img_countdown_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) -MainMenu1_img_countdown_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu1_img_countdown_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu1_img_countdown_text.set_text(" ") -MainMenu1_img_countdown_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu1_img_countdown_text = lv.label(MainMenu1_setting) +# MainMenu1_img_countdown_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +# MainMenu1_img_countdown_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_countdown_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_countdown_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_countdown_text.set_text(" ") +# MainMenu1_img_countdown_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) MainMenu1_img_toolbox_text = lv.label(MainMenu1_setting) -MainMenu1_img_toolbox_text.set_pos(int(MAIN1_ICON_X),int(140+5)) +MainMenu1_img_toolbox_text.set_pos(int(MAIN1_ICON_X),int(MAIN1_ICON_Y+5)) MainMenu1_img_toolbox_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_toolbox_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_toolbox_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -704,7 +750,7 @@ MainMenu1_img_toolbox_text.set_text(" ") MainMenu1_img_toolbox_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) MainMenu1_img_setting_text = lv.label(MainMenu1_setting) -MainMenu1_img_setting_text.set_pos(int(MAIN1_ICON_X*2+85),int(140+5)) +MainMenu1_img_setting_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) MainMenu1_img_setting_text.set_size(THEME1_ICON_X,THEME1_ICON_X) MainMenu1_img_setting_text.add_flag(lv.obj.FLAG.CLICKABLE) MainMenu1_img_setting_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -744,48 +790,6 @@ class MainMenuScreen(Screen): self.menu_action = 0 # =1左滑 =2右划 ###1 MainMenu1_til.add_event_cb(lambda e: EventMesh.callback_wrapper(self.scroll_begin_event_cb(e)),lv.EVENT.SCROLL_END,None) - #lv_obj_add_event_cb(lv_tabview_get_content(tabview), scroll_begin_event, LV_EVENT_SCROLL_END, NULL); - # MainMenu1_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_calllog.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_calllog.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_hr.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "heartrate")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_hr.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "heartrate")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_temp.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "temperature")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_temp.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "temperature")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_blood.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "blood_pressure")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_blood.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "blood_pressure")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_alarm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_alarm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_stopwatch.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_stopwatch.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_countdown.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_countdown.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) @@ -800,24 +804,6 @@ class MainMenuScreen(Screen): MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) - # MainMenu1_img_hr_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "heartrate")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_hr_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "heartrate")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_spo2_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_spo2_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_blood_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "blood_pressure")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_blood_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "blood_pressure")), lv.EVENT.PRESSING, None) - - # MainMenu1_img_temp_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "temperature")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu1_img_temp_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "temperature")), lv.EVENT.PRESSING, None) - - MainMenu1_img_health_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_health_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.PRESSING, None) - - MainMenu1_img_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.PRESSING, None) - MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) @@ -857,9 +843,9 @@ class MainMenuScreen(Screen): MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.SHORT_CLICKED, None) MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) @@ -873,9 +859,9 @@ class MainMenuScreen(Screen): MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) - MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.PRESSING, None) + # MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.PRESSING, None) MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) - MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.PRESSING, None) + # MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.PRESSING, None) MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.CLICKED, None) MainMenu2_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.PRESSING, None) diff --git a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_setting.py b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_setting.py index 8222cc55..15f7627e 100644 --- a/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_setting.py +++ b/2.sdk/project/W8/sdk/services/microPython/ports/quectel/core/ui_setting.py @@ -1229,7 +1229,7 @@ class PoweroffConfirmScreen(Screen): def initialization(self): step = EventMesh.publish("get_old_step_value") - if step != 0: + if step != None: EventMesh.publish("set_storage_config",["old_step",step]) date_tmp = utime.localtime() 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 048d3475..20568fa5 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 @@ -227,7 +227,7 @@ class cameraScreen(Screen):#相机拍照二级界面 camera_camera_return_btn_label = lv.label(camera_popup_screen) camera_camera_return_btn_label.set_pos(0, 0) - camera_camera_return_btn_label.set_size(40, 40) + camera_camera_return_btn_label.set_size(70, 70) camera_camera_return_btn_label.set_text(" ") camera_camera_return_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) camera_camera_return_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_return_click(e)), lv.EVENT.SHORT_CLICKED, None) @@ -344,7 +344,6 @@ camera_album_popup_img2 = None camera_album_popup_img3 = None camera_album_popup_img4 = None camera_album_popup_img5 = None -camera_album_popup_img = None class cameraalbumScreen(Screen):#相册 # NAME = "camera_album" @@ -385,12 +384,18 @@ class cameraalbumScreen(Screen):#相册 camera_album_popup_img2.add_flag(lv.obj.FLAG.CLICKABLE) camera_album_popup_img2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) - camera_album_popup_img = lv.img(camera_album_popup_screen) - camera_album_popup_img.set_pos(80, 220) - camera_album_popup_img.set_size(60, 62) - camera_album_popup_img.add_flag(lv.obj.FLAG.CLICKABLE) - camera_album_popup_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) + # camera_album_popup_img = lv.img(camera_album_popup_screen) + # camera_album_popup_img.set_pos(80, 220) + # camera_album_popup_img.set_size(60, 62) + # camera_album_popup_img.add_flag(lv.obj.FLAG.CLICKABLE) + # camera_album_popup_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) + camera_album_return_btn_label = lv.label(camera_popup_screen) + camera_album_return_btn_label.set_pos(0, 0) + camera_album_return_btn_label.set_size(70, 70) + camera_album_return_btn_label.set_text(" ") + camera_album_return_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) + camera_album_return_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,2)), lv.EVENT.SHORT_CLICKED, None) camera_album_popup_img3 = lv.img(camera_album_popup_screen) camera_album_popup_img3.set_pos(20, 20) @@ -403,18 +408,18 @@ class cameraalbumScreen(Screen):#相册 read_album = 0 read_album = EventMesh.publish("get_camera_num") print("read_album",read_album) - if int(read_album) != 0: + IFEXIST = ql_fs.path_exists("/ext/static/1_camera.jpg") + if IFEXIST == True: camera_album_popup_img1.clear_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_img1.set_src("E:/static/1_camera.jpg") #'E:/6_camera.jpeg'"E:/static/1_camera.jpg" camera_album_popup_img2.clear_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img.clear_flag(lv.obj.FLAG.HIDDEN) + # camera_album_popup_img.add_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_img2.set_src("E:/static/album_delete.png") - camera_album_popup_label.add_flag(lv.obj.FLAG.HIDDEN) else: camera_album_popup_img1.add_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_img2.add_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img.add_flag(lv.obj.FLAG.HIDDEN) + # camera_album_popup_img.add_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_label.clear_flag(lv.obj.FLAG.HIDDEN) @@ -433,7 +438,7 @@ class cameraalbumScreen(Screen):#相册 uos.remove("/ext/static/1_camera.jpg")#删除单张图片 album_data = int(EventMesh.publish("get_camera_num")) - EventMesh.publish("set_camera_num",album_data-1) + EventMesh.publish("set_camera_num",0) EventMesh.publish("load_screen", {"screen": "delete_album"}) return @@ -705,9 +710,9 @@ class VoiceShowScreen(Screen):#正在语音通话中 camera_voice_answer_btn.set_size(64, 64) camera_voice_answer_btn.set_src("E:/static/hang_up.png") camera_voice_answer_btn_label = lv.label(camera_voice_answer_screen) - camera_voice_answer_btn_label.set_pos(18, 50) + camera_voice_answer_btn_label.set_pos(70, 200) camera_voice_answer_btn_label.set_text(" ") - camera_voice_answer_btn_label.set_size(90, 78) + camera_voice_answer_btn_label.set_size(90, 82) camera_voice_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) camera_voice_answer_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) @@ -1024,9 +1029,9 @@ class VedioShowScreen(Screen):#正在视频通话中 camera_video_answer_btn_label = lv.label(camera_video_answer_screen) - camera_video_answer_btn_label.set_pos(18, 50) + camera_video_answer_btn_label.set_pos(70, 200) camera_video_answer_btn_label.set_text(" ") - camera_video_answer_btn_label.set_size(90, 78) + camera_video_answer_btn_label.set_size(90, 82) camera_video_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) @@ -1072,9 +1077,10 @@ class VedioShowScreen(Screen):#正在视频通话中 EventMesh.publish("set_UI_high_priority", 0) EventMesh.publish("close_jrtc_event") EventMesh.publish("return_prev_screen") - + def fun(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb,"data":0}) - def fun(self,*argc): + def fun_cb(self,data): EventMesh.publish("system_sleep_rest")#防止黑屏 call_state = jrtc.get_state() if call_state == 5: @@ -1223,8 +1229,10 @@ class voiceInCallScreen(Screen):#语音通话打入中 def call_timer_cb(self,e): self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 + def get_video_state(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.get_video_state_cb,"data":0}) - def get_video_state(self,e): + def get_video_state_cb(self,data): call_state = jrtc.get_state() # print("vedio_incall",call_state) self.timeout+=1 @@ -1377,8 +1385,11 @@ class vedioCallingCallScreen(Screen):#视频通话打入中 def call_timer_cb(self,e): self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 + + def get_video_state(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.get_video_state_cb,"data":0}) - def get_video_state(self,e): + def get_video_state_cb(self,data): call_state = jrtc.get_state() # print("vedio_incall",call_state) self.timeout+=1 @@ -1489,14 +1500,14 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 video_outcall_name = lv.label(video_outcall_screen) video_outcall_name.set_pos(0, 20) - video_outcall_name.set_size(LCD_SIZE_W, 20) + video_outcall_name.set_size(LCD_SIZE_W, 50) video_outcall_name.set_text(" ") - video_outcall_name.set_long_mode(lv.label.LONG.DOT) + video_outcall_name.set_long_mode(lv.label.LONG.WRAP) video_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) video_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) video_outcall_call = lv.label(video_outcall_screen) - video_outcall_call.set_pos(0, 50) + video_outcall_call.set_pos(0, 120) video_outcall_call.set_size(LCD_SIZE_W, 40) video_outcall_call.set_text("正在等待对方接听中...") video_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -1510,9 +1521,9 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 video_outcall_hangup_imgbtn.set_pos(90, 210) video_outcall_hangup_imgbtnlabel = lv.label(video_outcall_screen) - video_outcall_hangup_imgbtnlabel.set_pos(18, 50) + video_outcall_hangup_imgbtnlabel.set_pos(70, 200) video_outcall_hangup_imgbtnlabel.set_text(" ") - video_outcall_hangup_imgbtnlabel.set_size(90, 78) + video_outcall_hangup_imgbtnlabel.set_size(90, 82) video_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) video_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), @@ -1540,7 +1551,7 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 else: video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) video_outcall_call.set_text("正在等待对方接听中...") - video_outcall_call.set_pos(0, 50) + video_outcall_call.set_pos(0, 120) video_outcall_name.set_text(self.meta_info)#名称 video_outcall_name.set_pos(0, 20) @@ -1562,6 +1573,8 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 pass def fun_cb(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb_1,"data":0}) + def fun_cb_1(self,data): call_state = jrtc.get_state() print("video_outcall",call_state) EventMesh.publish("system_sleep_rest")#防止黑屏 @@ -1645,14 +1658,14 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 voice_outcall_name = lv.label(voice_outcall_screen) voice_outcall_name.set_pos(0, 20) - voice_outcall_name.set_size(LCD_SIZE_W, 20) + voice_outcall_name.set_size(LCD_SIZE_W, 50) voice_outcall_name.set_text(" ") - voice_outcall_name.set_long_mode(lv.label.LONG.DOT) + voice_outcall_name.set_long_mode(lv.label.LONG.WRAP) voice_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) voice_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) voice_outcall_call = lv.label(voice_outcall_screen) - voice_outcall_call.set_pos(0, 50) + voice_outcall_call.set_pos(0, 120) voice_outcall_call.set_size(LCD_SIZE_W, 40) voice_outcall_call.set_text("正在等待对方接听中...") voice_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -1666,9 +1679,9 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 voice_outcall_hangup_imgbtn.set_pos(90, 210) voice_outcall_hangup_imgbtnlabel = lv.label(voice_outcall_screen) - voice_outcall_hangup_imgbtnlabel.set_pos(18, 50) + voice_outcall_hangup_imgbtnlabel.set_pos(70, 200) voice_outcall_hangup_imgbtnlabel.set_text(" ") - voice_outcall_hangup_imgbtnlabel.set_size(90, 78) + voice_outcall_hangup_imgbtnlabel.set_size(90, 82) voice_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) voice_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), @@ -1696,7 +1709,7 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 else: # video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) voice_outcall_call.set_text("正在等待对方接听中...") - voice_outcall_call.set_pos(0, 50) + voice_outcall_call.set_pos(0, 120) voice_outcall_name.set_text(self.meta_info)#名称 voice_outcall_name.set_pos(0, 20) @@ -1718,8 +1731,10 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 pass def fun_cb(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb_1,"data":0}) + def fun_cb_1(self,data): call_state = jrtc.get_state() - print("voice_outcall",call_state) + # print("voice_outcall",call_state) EventMesh.publish("system_sleep_rest")#防止黑屏 if call_state == 5: voice_outcall_name.set_text("正在通话中...")# @@ -1916,9 +1931,9 @@ class videolistScreen(Screen): #contact_btn_label_1 = lv.label(contact_btn) self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_pos(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_SIZE_W-15, 20) + self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_SIZE_W-10, 20) self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_text(key_tmp[4:]) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.CLIP) + self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1930,9 +1945,9 @@ class videolistScreen(Screen): #contact_btn_label_3 = lv.label(contact_btn) self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 25) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_SIZE_W-15, 20) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_SIZE_W-10, 20) self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_text(name) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.CLIP) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_3"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -2131,10 +2146,10 @@ class videoModeScreen(Screen):#通话模式选择 elif code == lv.EVENT.SHORT_CLICKED: if msg != 0: if msg == 1: - msg_text = [self.meta_info,1] + msg_text = [self.meta_info,0] EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) else: - msg_text = [self.meta_info,0] + msg_text = [self.meta_info,1] EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) diff --git a/2.sdk/project/W8/usr/static/DIAL_PREV01.png b/2.sdk/project/W8/usr/static/DIAL_PREV01.png index b1a179bf..24f48cc2 100644 Binary files a/2.sdk/project/W8/usr/static/DIAL_PREV01.png and b/2.sdk/project/W8/usr/static/DIAL_PREV01.png differ diff --git a/2.sdk/project/W8/usr/static/bg.png b/2.sdk/project/W8/usr/static/bg.png index 527708dc..cb51f244 100644 Binary files a/2.sdk/project/W8/usr/static/bg.png and b/2.sdk/project/W8/usr/static/bg.png differ diff --git a/2.sdk/project/W8/usr/static/theme1/THEME1_CAMERA.png b/2.sdk/project/W8/usr/static/theme1/THEME1_CAMERA.png index 289e6da4..bce60a99 100644 Binary files a/2.sdk/project/W8/usr/static/theme1/THEME1_CAMERA.png and b/2.sdk/project/W8/usr/static/theme1/THEME1_CAMERA.png differ diff --git a/2.sdk/project/W8/usr/static/theme1/THEME1_SETING.png b/2.sdk/project/W8/usr/static/theme1/THEME1_SETING.png index 9f93de61..82a1ee46 100644 Binary files a/2.sdk/project/W8/usr/static/theme1/THEME1_SETING.png and b/2.sdk/project/W8/usr/static/theme1/THEME1_SETING.png differ diff --git a/2.sdk/project/W8/usr/static/theme1/THEME1_WECHAT.png b/2.sdk/project/W8/usr/static/theme1/THEME1_WECHAT.png index ba00b00b..d2e01bc8 100644 Binary files a/2.sdk/project/W8/usr/static/theme1/THEME1_WECHAT.png and b/2.sdk/project/W8/usr/static/theme1/THEME1_WECHAT.png differ