From: dxy15521469561 <1731678236@qq.com> Date: Mon, 15 Jul 2024 02:21:23 +0000 (+0800) Subject: W9: X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=42fc78b9d39b92777f5e79307c2c8dec85bf469b;p=mirrors%2FASR1603_G5.git W9: UI调整 --- diff --git a/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png b/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png deleted file mode 100644 index 0db49139..00000000 Binary files a/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png and /dev/null differ diff --git a/2.sdk-ZY/project/W9/images/customer_fs.bin b/2.sdk-ZY/project/W9/images/customer_fs.bin index de0b82c0..8f2e353e 100644 Binary files a/2.sdk-ZY/project/W9/images/customer_fs.bin and b/2.sdk-ZY/project/W9/images/customer_fs.bin differ diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py index db7cc215..c2af60f0 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py @@ -18,7 +18,7 @@ from ui import style_font_youyuan_20,style_screen,Screen,style_img,LCD_SIZE_H,LC style_font_youyuan_ai_20 = lv.style_t() style_font_youyuan_ai_20.init() style_font_youyuan_ai_20.set_text_color(lv.color_make(253, 82, 19)) -style_font_youyuan_ai_20.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_ai_20.set_text_font(lv.lv_font_20_ALL) #length长度内,返回string句号或逗号的分割字符串 def split_string(string,start,end): count = string.find('\n',start,end) @@ -107,7 +107,7 @@ style_font_20_ai_white.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) style_font_20_ai_white.set_bg_grad_dir(lv.GRAD_DIR.NONE) style_font_20_ai_white.set_bg_opa(255) style_font_20_ai_white.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_20_ai_white.set_text_font(lv.K01_font_16_ALL) +style_font_20_ai_white.set_text_font(lv.lv_font_20_ALL) style_font_20_ai_green = lv.style_t() style_font_20_ai_green.init() @@ -117,7 +117,7 @@ style_font_20_ai_green.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) style_font_20_ai_green.set_bg_grad_dir(lv.GRAD_DIR.NONE) style_font_20_ai_green.set_bg_opa(255) style_font_20_ai_green.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_20_ai_green.set_text_font(lv.K01_font_16_ALL) +style_font_20_ai_green.set_text_font(lv.lv_font_20_ALL) AI_screen = lv.obj() print("AI_screen") @@ -173,31 +173,59 @@ al_talk_end_screen_cancel_bt.set_size(80, 72) al_talk_end_screen_cancel_bt.set_pos(0,0) al_talk_end_screen_cancel_bt.add_flag(lv.obj.FLAG.CLICKABLE) -al_talk_end_screen_icon2 = lv.btn(AI_talk_end_bt_screen) +al_talk_end_screen_icon2 = lv.label(AI_talk_end_bt_screen) al_talk_end_screen_icon2.set_pos(int(80),int(10)) al_talk_end_screen_icon2.set_size(150,50) al_talk_end_screen_icon2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -screen_btn_1_label = lv.label(al_talk_end_screen_icon2) -screen_btn_1_label.set_text("继续对话") -al_talk_end_screen_icon2.set_style_pad_all(0, lv.STATE.DEFAULT) -screen_btn_1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -style_screen_btn_1_main_main_default = lv.style_t() -style_screen_btn_1_main_main_default.init() -style_screen_btn_1_main_main_default.set_radius(10) -style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) -style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) -style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_btn_1_main_main_default.set_bg_opa(255) -style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x19,0x19,0x19)) -style_screen_btn_1_main_main_default.set_border_width(0) -style_screen_btn_1_main_main_default.set_border_opa(255) -style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) -style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_talk_end_screen_icon2.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_talk_end_screen_icon2.set_text("继续对话") +al_talk_end_screen_icon2.set_long_mode(lv.label.LONG.WRAP) +al_talk_end_screen_icon2.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(15) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_talk_end_screen_icon2.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_talk_end_screen_icon2 = lv.btn(AI_talk_end_bt_screen) +# al_talk_end_screen_icon2.set_pos(int(80),int(10)) +# al_talk_end_screen_icon2.set_size(150,50) +# al_talk_end_screen_icon2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# screen_btn_1_label = lv.label(al_talk_end_screen_icon2) +# screen_btn_1_label.set_text("继续对话") +# al_talk_end_screen_icon2.set_style_pad_all(0, lv.STATE.DEFAULT) +# screen_btn_1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# style_screen_btn_1_main_main_default = lv.style_t() +# style_screen_btn_1_main_main_default.init() +# style_screen_btn_1_main_main_default.set_radius(10) +# style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +# style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +# style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# style_screen_btn_1_main_main_default.set_bg_opa(255) +# style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x19,0x19,0x19)) +# style_screen_btn_1_main_main_default.set_border_width(0) +# style_screen_btn_1_main_main_default.set_border_opa(255) +# style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +# style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) +# style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_talk_end_screen_icon2.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_talk_end_screen_icon2 = lv.img(AI_talk_end_bt_screen) # al_talk_end_screen_icon2.set_size(150,50) @@ -241,7 +269,7 @@ style_font_28_green_bg_gray.init() # style_font_28_green_bg_gray.set_pad_top(0) # style_font_28_green_bg_gray.set_pad_bottom(0) style_font_28_green_bg_gray.set_text_color(lv.color_make(255, 255, 255)) #字体文本颜色 -style_font_28_green_bg_gray.set_text_font(lv.K01_font_16_ALL) +style_font_28_green_bg_gray.set_text_font(lv.lv_font_20_ALL) style_gray_screen = lv.style_t() style_gray_screen.init() style_gray_screen.set_radius(5) @@ -265,7 +293,7 @@ style_font_28_black_bg_gray.init() # style_font_28_black_bg_gray.set_pad_bottom(0) # style_font_28_black_bg_gray.set_bg_color(lv.color_make(66,66,66)) #字体文本颜色 style_font_28_black_bg_gray.set_text_color(lv.color_make(153, 153, 153)) #字体文本颜色 -style_font_28_black_bg_gray.set_text_font(lv.K01_font_16_ALL) +style_font_28_black_bg_gray.set_text_font(lv.lv_font_20_ALL) style_wechat_r_btn = lv.style_t() style_wechat_r_btn.init() @@ -380,31 +408,60 @@ al_talk_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) # al_talk_screen_icon.add_flag(lv.obj.FLAG.CLICKABLE) # al_talk_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -al_talk_screen_icon = lv.btn(AI_talk_screen) + +al_talk_screen_icon = lv.label(AI_talk_screen) al_talk_screen_icon.set_pos(int(5),int(210)) al_talk_screen_icon.set_size(230,58) al_talk_screen_icon.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -screen_btn_1_label = lv.label(al_talk_screen_icon) -screen_btn_1_label.set_text("开始对话") -al_talk_screen_icon.set_style_pad_all(0, lv.STATE.DEFAULT) -screen_btn_1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -style_screen_btn_1_main_main_default = lv.style_t() -style_screen_btn_1_main_main_default.init() -style_screen_btn_1_main_main_default.set_radius(20) -style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x37,0xbf,0x12)) -style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x37,0xbf,0x12)) -style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_btn_1_main_main_default.set_bg_opa(255) -style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x37,0xbf,0x12)) -style_screen_btn_1_main_main_default.set_border_width(0) -style_screen_btn_1_main_main_default.set_border_opa(255) -style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) -style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_talk_screen_icon.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_talk_screen_icon.set_text("开始对话") +al_talk_screen_icon.set_long_mode(lv.label.LONG.WRAP) +al_talk_screen_icon.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x37,0xbf,0x12)) +al_talk_screen_icon_main_main_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(18) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_talk_screen_icon.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_talk_screen_icon = lv.btn(AI_talk_screen) +# al_talk_screen_icon.set_pos(int(5),int(210)) +# al_talk_screen_icon.set_size(230,58) +# al_talk_screen_icon.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# screen_btn_1_label = lv.label(al_talk_screen_icon) +# screen_btn_1_label.set_text("开始对话") +# al_talk_screen_icon.set_style_pad_all(0, lv.STATE.DEFAULT) +# screen_btn_1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# style_screen_btn_1_main_main_default = lv.style_t() +# style_screen_btn_1_main_main_default.init() +# style_screen_btn_1_main_main_default.set_radius(20) +# style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x37,0xbf,0x12)) +# style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x37,0xbf,0x12)) +# style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# style_screen_btn_1_main_main_default.set_bg_opa(255) +# style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x37,0xbf,0x12)) +# style_screen_btn_1_main_main_default.set_border_width(0) +# style_screen_btn_1_main_main_default.set_border_opa(255) +# style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +# style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) +# style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_talk_screen_icon.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_talk_screen_icon_btn = lv.label(AI_talk_screen) @@ -457,32 +514,59 @@ al_no_sim_popup_screen_title3.set_text("请先开启移动数据") al_no_sim_popup_screen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) al_no_sim_popup_screen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -al_no_sim_popup_screen_icon1 = lv.btn(AI_no_net_screen) +al_no_sim_popup_screen_icon1 = lv.label(AI_no_net_screen) al_no_sim_popup_screen_icon1.set_pos(int(5),int(210)) al_no_sim_popup_screen_icon1.set_size(230,58) al_no_sim_popup_screen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -al_no_sim_popup_screen_icon1_label = lv.label(al_no_sim_popup_screen_icon1) -al_no_sim_popup_screen_icon1_label.set_text("确定") -al_no_sim_popup_screen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) -al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -al_no_sim_popup_screen_icon1_label_default = lv.style_t() -al_no_sim_popup_screen_icon1_label_default.init() -al_no_sim_popup_screen_icon1_label_default.set_radius(20) -al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_border_width(0) -al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.K01_font_16_ALL) -al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_no_sim_popup_screen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_no_sim_popup_screen_icon1.set_text("确定") +al_no_sim_popup_screen_icon1.set_long_mode(lv.label.LONG.WRAP) +al_no_sim_popup_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(18) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_no_sim_popup_screen_icon1.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_no_sim_popup_screen_icon1 = lv.btn(AI_no_net_screen) +# al_no_sim_popup_screen_icon1.set_pos(int(5),int(210)) +# al_no_sim_popup_screen_icon1.set_size(230,58) +# al_no_sim_popup_screen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# al_no_sim_popup_screen_icon1_label = lv.label(al_no_sim_popup_screen_icon1) +# al_no_sim_popup_screen_icon1_label.set_text("确定") +# al_no_sim_popup_screen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) +# al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# al_no_sim_popup_screen_icon1_label_default = lv.style_t() +# al_no_sim_popup_screen_icon1_label_default.init() +# al_no_sim_popup_screen_icon1_label_default.set_radius(20) +# al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_border_width(0) +# al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +# al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.lv_font_20_ALL) +# al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_no_sim_popup_screen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_no_sim_popup_screen_icon1 = lv.img(AI_no_net_screen) # al_no_sim_popup_screen_icon1.set_size(230,58) # al_no_sim_popup_screen_icon1.set_pos((240-230)//2,210) @@ -585,31 +669,59 @@ al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") al_think_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -al_think_screen_icon1 = lv.btn(AI_think_screen) +al_think_screen_icon1 = lv.label(AI_think_screen) al_think_screen_icon1.set_pos(int(5),int(210)) al_think_screen_icon1.set_size(230,58) al_think_screen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -al_no_sim_popup_screen_icon1_label = lv.label(al_think_screen_icon1) -al_no_sim_popup_screen_icon1_label.set_text("取消") -al_think_screen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) -al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -al_no_sim_popup_screen_icon1_label_default = lv.style_t() -al_no_sim_popup_screen_icon1_label_default.init() -al_no_sim_popup_screen_icon1_label_default.set_radius(20) -al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_border_width(0) -al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(253, 82, 19)) -al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.K01_font_16_ALL) -al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_think_screen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_think_screen_icon1.set_text("取消") +al_think_screen_icon1.set_long_mode(lv.label.LONG.WRAP) +al_think_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(253, 82, 19)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(18) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_think_screen_icon1.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_think_screen_icon1 = lv.btn(AI_think_screen) +# al_think_screen_icon1.set_pos(int(5),int(210)) +# al_think_screen_icon1.set_size(230,58) +# al_think_screen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# al_no_sim_popup_screen_icon1_label = lv.label(al_think_screen_icon1) +# al_no_sim_popup_screen_icon1_label.set_text("取消") +# al_think_screen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) +# al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# al_no_sim_popup_screen_icon1_label_default = lv.style_t() +# al_no_sim_popup_screen_icon1_label_default.init() +# al_no_sim_popup_screen_icon1_label_default.set_radius(20) +# al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_border_width(0) +# al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(253, 82, 19)) +# al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.lv_font_20_ALL) +# al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_think_screen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_think_screen_icon1 = lv.img(AI_think_screen) # al_think_screen_icon1.set_size(230,58) @@ -669,32 +781,59 @@ al_connect_timerout_title3.set_text("请重新对话") al_connect_timerout_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) al_connect_timerout_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -al_connect_timerout_icon1 = lv.btn(AI_connect_timerout_screen) +al_connect_timerout_icon1 = lv.label(AI_connect_timerout_screen) al_connect_timerout_icon1.set_pos(int(5),int(210)) al_connect_timerout_icon1.set_size(230,58) al_connect_timerout_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -al_no_sim_popup_screen_icon1_label = lv.label(al_connect_timerout_icon1) -al_no_sim_popup_screen_icon1_label.set_text("确定") -al_connect_timerout_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) -al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -al_no_sim_popup_screen_icon1_label_default = lv.style_t() -al_no_sim_popup_screen_icon1_label_default.init() -al_no_sim_popup_screen_icon1_label_default.set_radius(20) -al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_border_width(0) -al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.K01_font_16_ALL) -al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_connect_timerout_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_connect_timerout_icon1.set_text("确定") +al_connect_timerout_icon1.set_long_mode(lv.label.LONG.WRAP) +al_connect_timerout_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(18) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_connect_timerout_icon1.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_connect_timerout_icon1 = lv.btn(AI_connect_timerout_screen) +# al_connect_timerout_icon1.set_pos(int(5),int(210)) +# al_connect_timerout_icon1.set_size(230,58) +# al_connect_timerout_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# al_no_sim_popup_screen_icon1_label = lv.label(al_connect_timerout_icon1) +# al_no_sim_popup_screen_icon1_label.set_text("确定") +# al_connect_timerout_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) +# al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# al_no_sim_popup_screen_icon1_label_default = lv.style_t() +# al_no_sim_popup_screen_icon1_label_default.init() +# al_no_sim_popup_screen_icon1_label_default.set_radius(20) +# al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_border_width(0) +# al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +# al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.lv_font_20_ALL) +# al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_connect_timerout_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_connect_timerout_icon1 = lv.img(AI_connect_timerout_screen) # al_connect_timerout_icon1.set_size(230,58) @@ -753,31 +892,59 @@ al_not_listen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) al_not_listen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -al_not_listen_icon1 = lv.btn(AI_not_listen_text_screen) +al_not_listen_icon1 = lv.label(AI_not_listen_text_screen) al_not_listen_icon1.set_pos(int(5),int(210)) al_not_listen_icon1.set_size(230,58) al_not_listen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -al_no_sim_popup_screen_icon1_label = lv.label(al_not_listen_icon1) -al_no_sim_popup_screen_icon1_label.set_text("确定") -al_not_listen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) -al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) -# create style style_screen_btn_1_main_main_default -al_no_sim_popup_screen_icon1_label_default = lv.style_t() -al_no_sim_popup_screen_icon1_label_default.init() -al_no_sim_popup_screen_icon1_label_default.set_radius(20) -al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) -al_no_sim_popup_screen_icon1_label_default.set_border_width(0) -al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) -al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.K01_font_16_ALL) -al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) - -# add style for screen_btn_1 -al_not_listen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) +al_not_listen_icon1.set_text("确定") +al_not_listen_icon1.set_long_mode(lv.label.LONG.WRAP) +al_not_listen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +# create style style_screen_label_1_main_main_default +al_talk_screen_icon_main_main_default = lv.style_t() +al_talk_screen_icon_main_main_default.init() +al_talk_screen_icon_main_main_default.set_radius(30) +al_talk_screen_icon_main_main_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +al_talk_screen_icon_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +al_talk_screen_icon_main_main_default.set_bg_opa(255) +al_talk_screen_icon_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +al_talk_screen_icon_main_main_default.set_text_font(lv.lv_font_20_ALL) +al_talk_screen_icon_main_main_default.set_text_letter_space(2) +al_talk_screen_icon_main_main_default.set_text_line_space(0) +al_talk_screen_icon_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +al_talk_screen_icon_main_main_default.set_pad_left(0) +al_talk_screen_icon_main_main_default.set_pad_right(0) +al_talk_screen_icon_main_main_default.set_pad_top(18) +al_talk_screen_icon_main_main_default.set_pad_bottom(0) + +# add style for screen_label_1 +al_not_listen_icon1.add_style(al_talk_screen_icon_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# al_not_listen_icon1 = lv.btn(AI_not_listen_text_screen) +# al_not_listen_icon1.set_pos(int(5),int(210)) +# al_not_listen_icon1.set_size(230,58) +# al_not_listen_icon1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# al_no_sim_popup_screen_icon1_label = lv.label(al_not_listen_icon1) +# al_no_sim_popup_screen_icon1_label.set_text("确定") +# al_not_listen_icon1.set_style_pad_all(0, lv.STATE.DEFAULT) +# al_no_sim_popup_screen_icon1_label.align(lv.ALIGN.CENTER,0,0) +# # create style style_screen_btn_1_main_main_default +# al_no_sim_popup_screen_icon1_label_default = lv.style_t() +# al_no_sim_popup_screen_icon1_label_default.init() +# al_no_sim_popup_screen_icon1_label_default.set_radius(20) +# al_no_sim_popup_screen_icon1_label_default.set_bg_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +# al_no_sim_popup_screen_icon1_label_default.set_bg_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_border_color(lv.color_make(0x19,0x19,0x19)) +# al_no_sim_popup_screen_icon1_label_default.set_border_width(0) +# al_no_sim_popup_screen_icon1_label_default.set_border_opa(255) +# al_no_sim_popup_screen_icon1_label_default.set_text_color(lv.color_make(0xff,0xff,0xff)) +# al_no_sim_popup_screen_icon1_label_default.set_text_font(lv.lv_font_20_ALL) +# al_no_sim_popup_screen_icon1_label_default.set_text_align(lv.TEXT_ALIGN.CENTER) + +# # add style for screen_btn_1 +# al_not_listen_icon1.add_style(al_no_sim_popup_screen_icon1_label_default, lv.PART.MAIN|lv.STATE.DEFAULT) # al_not_listen_icon1 = lv.img(AI_not_listen_text_screen) # al_not_listen_icon1.set_size(230,58) @@ -868,6 +1035,7 @@ class AIScreen(Screen):#AI_GUI self.scroll_timer_count = 0 self.play_flag = 0 + self.play_end = 0 self.play_flag_init = 0 AI_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), lv.EVENT.GESTURE, None) @@ -1218,7 +1386,7 @@ class AIScreen(Screen):#AI_GUI self.not_talk_cb() def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据 - + self.play_end = 0 self.play_flag = 1 self.AI_label_answer = "" @@ -1347,6 +1515,7 @@ class AIScreen(Screen):#AI_GUI AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # pass def initialization(self): + self.play_end = 0 self.play_flag = 1 self.TTS_PRO_TYPE = 0 AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) @@ -1584,7 +1753,11 @@ class AIScreen(Screen):#AI_GUI else: pass def _1S_timer_cb(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 + if (self.play_end == 1 and EventMesh.publish("get_audio_state") == 0 ) or self.play_flag == 0: #字符串为0 或者暂停需要自动熄屏 + # print("self.play_end!!!!!\r\n") + pass + else: + EventMesh.publish("system_sleep_rest")#防止黑屏 if self.scroll_timer_count > 0: self.scroll_timer_count-=1 #定时器 @@ -2090,6 +2263,8 @@ class AIScreen(Screen):#AI_GUI if tmp != 0: print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data[0]))) self.AI_client_tts_data_len -=len(data[0]) + if len(self.AI_client_chat_play_str) == 0: #播放完了 + self.play_end = 1 mem = gc.mem_free() print('1剩余内存RAM:{} KB'.format(mem / 1024)) except Exception as e: @@ -2177,6 +2352,17 @@ class AIScreen(Screen):#AI_GUI self.hard_flag_prev = 1 pass + def lcd_off(self): + self.play_flag = 0 + self.aud.stopPlayStream() + self.aud.stopAll() + EventMesh.publish("publish_message_event_ui",{"func":self.upload_img,"data":0}) + self._1S_timer.stop() + + def lcd_on(self): + # self.play_flag = 1 + # EventMesh.publish("publish_message_event_ui",{"func":self.upload_img,"data":1}) + self._1S_timer.start(1000,1,self._1S_timer_cb) def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py index 34a170a9..5bad5df6 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py @@ -32,33 +32,41 @@ MAX_ALARM = 3 #CONT的样式 style_cont_alarm = lv.style_t() style_cont_alarm.init() -style_cont_alarm.set_bg_color(lv.color_make(51, 51,51)) style_cont_alarm.set_radius(5) +style_cont_alarm.set_bg_color(lv.color_make(51, 51,51)) +style_cont_alarm.set_bg_grad_color(lv.color_make(51, 51,51)) +style_cont_alarm.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_cont_alarm.set_bg_opa(255) +style_cont_alarm.set_text_color(lv.color_make(255, 255,255)) +style_cont_alarm.set_text_font(lv.lv_font_20_ALL) +style_cont_alarm.set_text_letter_space(0) +style_cont_alarm.set_text_line_space(0) +style_cont_alarm.set_text_align(lv.TEXT_ALIGN.CENTER) style_cont_alarm.set_pad_left(0) style_cont_alarm.set_pad_right(0) -style_cont_alarm.set_pad_top(0) +style_cont_alarm.set_pad_top(10) style_cont_alarm.set_pad_bottom(0) + +style_cont_alarm_btn = lv.style_t() +style_cont_alarm_btn.init() +style_cont_alarm_btn.set_bg_color(lv.color_make(51, 51,51)) +style_cont_alarm_btn.set_radius(5) +style_cont_alarm_btn.set_pad_left(0) +style_cont_alarm_btn.set_pad_right(0) +style_cont_alarm_btn.set_pad_top(0) +style_cont_alarm_btn.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(lv.K01_font_16_ALL) -# style_font_white.set_border_width(0) -# style_font_white.set_pad_left(0) -# style_font_white.set_pad_right(0) -# style_font_white.set_pad_top(0) -# style_font_white.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(lv.K01_font_16_ALL) +style_font_yellow.set_text_font(lv.lv_font_20_ALL) alarm_style_font_youyuan_20_gray = lv.style_t() alarm_style_font_youyuan_20_gray.init() alarm_style_font_youyuan_20_gray.set_text_color(lv.color_make(100, 100, 100)) -alarm_style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) +alarm_style_font_youyuan_20_gray.set_text_font(lv.lv_font_20_ALL) #背景样式 style_alarm_screen_default = lv.style_t() style_alarm_screen_default.init() @@ -74,18 +82,26 @@ clk_list_screen = lv.obj() print("clk_list_screen") clk_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -clk_list_title_bg= lv.btn(clk_list_screen) -clk_list_title_bg.set_size(220,40) -clk_list_title_bg.set_pos(10,10) -clk_list_title_bg.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) - -clk_list_title = lv.label(clk_list_title_bg) -clk_list_title.set_pos(0, 12) -clk_list_title.set_size(240, 38) +clk_list_title = lv.label(clk_list_screen) +clk_list_title.set_pos(int(10),int(10)) +clk_list_title.set_size(220,40) +clk_list_title.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) clk_list_title.set_text("闹钟列表") -clk_list_title.set_long_mode(lv.label.LONG.WRAP) -clk_list_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -clk_list_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_list_title.set_long_mode(lv.label.LONG.DOT) +clk_list_title.add_style(style_cont_alarm, lv.PART.MAIN|lv.STATE.DEFAULT) + +# clk_list_title_bg= lv.btn(clk_list_screen) +# clk_list_title_bg.set_size(220,40) +# clk_list_title_bg.set_pos(10,10) +# clk_list_title_bg.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +# clk_list_title = lv.label(clk_list_title_bg) +# clk_list_title.set_pos(0, 12) +# clk_list_title.set_size(240, 38) +# clk_list_title.set_text("闹钟列表") +# clk_list_title.set_long_mode(lv.label.LONG.WRAP) +# clk_list_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# clk_list_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # clk_list_add_btn = lv.btn(clk_list_screen) # clk_list_add_btn.set_pos(180,45) # clk_list_add_btn.set_size(50,20) @@ -110,12 +126,13 @@ 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(65, 0) no_add_alarm_img.set_size(110, 140) +no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") no_add_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) #暂未添加闹钟 no_add_alarm = lv.label(clk_list_screen1_1) -no_add_alarm.set_pos(0, 170) +no_add_alarm.set_pos(0, 100) no_add_alarm.set_size(240, (LCD_SIZE_H-65)-170) no_add_alarm.set_text("闹钟暂未设置") no_add_alarm.set_long_mode(lv.label.LONG.WRAP) @@ -786,15 +803,22 @@ popup_alarm_screen = lv.obj() print("popup_alarm_screen") popup_alarm_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +popup_alarm_title = lv.label(popup_alarm_screen) +popup_alarm_title.set_pos(0, 20) +popup_alarm_title.set_size(240, 50) +popup_alarm_title.set_text("闹钟") +popup_alarm_title.set_long_mode(lv.label.LONG.WRAP) +popup_alarm_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +popup_alarm_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -popup_alarm_img = lv.img(popup_alarm_screen) -popup_alarm_img.set_pos(63, 60) -popup_alarm_img.set_size(110, 140) -popup_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") -popup_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +# popup_alarm_img = lv.img(popup_alarm_screen) +# popup_alarm_img.set_pos(63, 60) +# popup_alarm_img.set_size(110, 140) +# popup_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") +# popup_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) popup_alarm_time = lv.label(popup_alarm_screen) -popup_alarm_time.set_pos(0, 230) +popup_alarm_time.set_pos(0, 120) popup_alarm_time.set_size(240, 50) popup_alarm_time.set_text(" ") popup_alarm_time.set_long_mode(lv.label.LONG.WRAP) @@ -903,13 +927,16 @@ class ClkListScreen(Screen): lv.EVENT.GESTURE, None) self.timer=osTimer() for i in range(self.MXA_clk_num): - + _btn = lv.btn(self.alarm_show_list) - _btn.add_flag(lv.obj.FLAG.CLICKABLE) - _btn.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + # _btn.add_flag(lv.obj.FLAG.CLICKABLE) + _btn.add_style(style_cont_alarm_btn, lv.PART.MAIN | lv.STATE.DEFAULT) _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), lv.EVENT.CLICKED, None) - _btn.add_flag(lv.obj.FLAG.HIDDEN) + # _btn = lv.label(clk_list_screen) + # _btn.add_style(style_cont_alarm, lv.PART.MAIN|lv.STATE.DEFAULT) + # _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), + # lv.EVENT.CLICKED, None) _btn_label1 = lv.label(_btn) _btn_label2 = lv.label(_btn) _btn_label2.set_long_mode(lv.label.LONG.DOT) @@ -1000,7 +1027,7 @@ class ClkListScreen(Screen): self.contact_detail_listt_dict[count]["_btn"].clear_flag(lv.obj.FLAG.HIDDEN) count+=1 if count == 0: - no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) else : @@ -1008,11 +1035,11 @@ class ClkListScreen(Screen): no_add_alarm.add_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.clear_flag(lv.obj.FLAG.HIDDEN) else: - no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) else: - no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py index b2153193..5e87bd4c 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py @@ -10,14 +10,10 @@ from machine import Timer import constants from misc import Power import pm -from ui import Screen +from ui import Screen,style_font_youyuan_20 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)) -style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) style_btn_alipay = lv.style_t() style_btn_alipay.init() @@ -901,7 +897,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(lv.K01_font_16_ALL) +style_font_youyuan_black_20.set_text_font(lv.lv_font_20_ALL) # alipay_barcode_num = lv.label(alipay_paycode_screen) # alipay_barcode_num.set_pos(0, 130) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py index 12121e2c..a3c7c780 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py @@ -32,7 +32,7 @@ style_btn_1.set_bg_grad_dir(lv.GRAD_DIR.NONE) style_font_W_B_28 = lv.style_t() style_font_W_B_28.init() style_font_W_B_28.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_W_B_28.set_text_font(lv.K01_font_16_ALL) +style_font_W_B_28.set_text_font(lv.lv_font_20_ALL) style_font_W_B_28.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) factorymode_title = lv.label(factorymode_screen) @@ -521,7 +521,7 @@ class FactoryModeBatTestScreen(Screen): def BatTest_timer_cb(self,e): EventMesh.publish("system_sleep_rest")#防止黑屏 - temp = Power.getVbatt() + temp = EventMesh.publish("get_adc_battery") FactoryModeBatTest_label.set_text("Vbat:{}V".format(temp)) def Close(self): diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py index 3aaff247..e88fca34 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py @@ -247,17 +247,17 @@ style_screen.set_pad_bottom(0) style_font_youyuan_40 = lv.style_t() style_font_youyuan_40.init() style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_40.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_40.set_text_font(lv.lv_font_20_ALL) style_font_youyuan_black_40 = lv.style_t() style_font_youyuan_black_40.init() style_font_youyuan_black_40.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_youyuan_black_40.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_black_40.set_text_font(lv.lv_font_20_ALL) style_font_youyuan_20_op = lv.style_t() style_font_youyuan_20_op.init() style_font_youyuan_20_op.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20_op.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_20_op.set_text_font(lv.lv_font_20_ALL) lcd.lcd_display_on() diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py index e27ab6e4..f7725b24 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py @@ -229,7 +229,7 @@ style_font_youyuan_black_40.set_text_font_v2("font_40.bin",40,0) style_font_youyuan_20_op = lv.style_t() style_font_youyuan_20_op.init() style_font_youyuan_20_op.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20_op.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_20_op.set_text_font(lv.lv_font_20_ALL) power_on_screen = lv.obj() print("power_on_screen") diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py index 7b37bb17..dd0d6812 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py @@ -77,9 +77,10 @@ def main_init(): # ProtoColResolver,PHL_ProtoCol,MONITOR_ProtoCol,bootoff_ProtoCol,WDSTART_ProtoCol,LOWBAT_ProtoCol,sosHome_dial_ProtoCol,SockManager,NetManager import protocol - + import ui_setting as _ui_setting import ui as _ui # import ui as _ui + import mgr as mgr #print("init4:{}".format(utime.localtime())) ui = _ui.UI() pcr = protocol.ProtoColResolver() @@ -89,6 +90,7 @@ def main_init(): try: app.append_manager(getStorageDataManager()) app.append_manager(motorEventManager()) + app.append_manager(mgr.DeviceInfoManager()) except Exception as e: usys.print_exception(e) try: @@ -105,7 +107,7 @@ def main_init(): except Exception as e: usys.print_exception(e) try: - import ui_setting as _ui_setting + ui.add_screen(_ui_setting.SettingScreen()) ui.add_screen(_ui_setting.ThemeswitchScreen()) ui.add_screen(_ui.ToolboxScreen()) @@ -302,7 +304,6 @@ def main_init(): app.append_manager(mgr.AlarmVolumeLevelManager()) \ .append_manager(mgr.MsgVolumeLevelManager()) \ .append_manager(mgr.PhoneVolumeLevelManager()) \ - .append_manager(mgr.DeviceInfoManager()) \ .append_manager(mgr.BatteryManager()) \ # .append_manager(mgr.StopwatchManager()) \ diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py index 9b5467e9..2c55eda0 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py @@ -389,7 +389,7 @@ class Battery(object): return self.__get_soc_from_dict(20, volt_arg) def __get_power_vbatt(self): - return int(sum([Power.getVbatt() for i in range(100)]) / 100) + return int(sum([EventMesh.publish("get_adc_battery") for i in range(100)]) / 100) def __get_adc_vbatt(self): self.__adc.open() @@ -681,7 +681,7 @@ def voice_callback(args): elif args[0] == 16: print('voicecall holding, PhoneNO.: ', args[6]) - +from misc import ADC class DeviceInfoManager(Abstract): """ @@ -689,7 +689,8 @@ class DeviceInfoManager(Abstract): """ def __init__(self): - + self.adc = ADC() + self.adc.open() self.DeviceInfo_queue = Queue() _thread.start_new_thread(self.DeviceInfo_queue_thread, ()) EventMesh.subscribe("publish_message_event_DeviceInfo",self.publish_message_event_DeviceInfo) @@ -869,9 +870,12 @@ class DeviceInfoManager(Abstract): #EventMesh.publish(constants.EVENT.START_HEART) # 设备开机立刻更新一次参数 self.publish_event_cb() - - print("post_processor_after_instantiation:3") + EventMesh.subscribe("get_adc_battery",self.get_adc_battery) + print("post_processor_after_instantiation:3") + def get_adc_battery(self,event,msg): + return int(self.adc.read(ADC.ADC0)*55.2/15) + def publish_message_event_DeviceInfo(self,event,msg): self.DeviceInfo_queue.put(msg) @@ -1041,7 +1045,10 @@ class DeviceInfoManager(Abstract): EventMesh.txt_log("publish_event1:".format(e)) try : """电池平均值""" - temp = Power.getVbatt() + temp = EventMesh.publish("get_adc_battery") #Power.getVbatt() + # print("temp:{}".format(temp)) + if temp == None: + temp = 4200 if self.bat_count < 10: self.vbat_buf.append(temp) self.bat_count += 1 @@ -3083,6 +3090,7 @@ class getWeatherDataManager(Abstract): self.max_temp = msg[6] self.city = msg[7] self.no_data = msg[8] + EventMesh.publish("updata_weather_show") class getHrTimeManager(Abstract): diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py index aa019c8e..ac79ec39 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py @@ -312,7 +312,10 @@ class SockManager(Abstract): print("TCP:send data1 len:{}".format(len(data))) #print("ui_queue_thread:data = {}".format(data)) - socketsta = self.sock.getsocketsta() + socketsta = -1 + if self.sock != None: + socketsta = self.sock.getsocketsta() + if(socketsta == -1): #给释放了或者出错了 continue if(socketsta == 4):#正常连击 @@ -871,7 +874,7 @@ class WT_ProtoCol(ProtoCol): print("WT_ProtoCol RECV msg:%s"%(msg)) EventMesh.publish("set_weather_data",[msg_date,msg_time,msg_weather_content,msg_type,msg_temp,msg_min_temp,msg_max_temp,msg_city,1]) - EventMesh.publish("updata_weather_show") + class REMIND_ProtoCol(ProtoCol):#普通闹钟 """ diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py index 206fb588..f2f0953b 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py @@ -35,6 +35,17 @@ def audio_cb(event): CALL_LOG_MAX = 50 aud = audio.Audio(0) aud.setCallback(audio_cb) +style_main_default_bg = lv.style_t() +style_main_default_bg.init() +style_main_default_bg.set_radius(10) +style_main_default_bg.set_bg_color(lv.color_make(0x33,0x33,0x33)) +style_main_default_bg.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_main_default_bg.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_main_default_bg.set_bg_opa(255) +style_main_default_bg.set_border_color(lv.color_make(0x33,0x33,0x33)) +style_main_default_bg.set_border_width(0) +style_main_default_bg.set_border_opa(255) + # -----------------------------------------style create-------------------------------------- style_screen = lv.style_t() style_screen.init() @@ -93,35 +104,35 @@ 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(lv.K01_font_16_ALL) +style_font_youyuan_20.set_text_font(lv.lv_font_20_ALL) style_font_youyuan_20_gray = lv.style_t() style_font_youyuan_20_gray.init() style_font_youyuan_20_gray.set_text_color(lv.color_make(128, 128, 128)) -style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_20_gray.set_text_font(lv.lv_font_20_ALL) style_font_youyuan_40 = lv.style_t() style_font_youyuan_40.init() style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_40.set_text_font(lv.K01_font_30_DIAL) +style_font_youyuan_40.set_text_font(lv.lv_font_20_ALL) #黑色 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(lv.K01_font_16_ALL) +style_font_youyuan_20_black.set_text_font(lv.lv_font_20_ALL) #灰色背景黑色字 style_font_28_black_bg_gray = lv.style_t() style_font_28_black_bg_gray.init() style_font_28_black_bg_gray.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_28_black_bg_gray.set_text_font(lv.K01_font_16_ALL) +style_font_28_black_bg_gray.set_text_font(lv.lv_font_20_ALL) style_font_28_black_bg_gray.set_bg_color(lv.color_make(0xe1,0xdb,0xdb)) style_font_youyuan_28 = lv.style_t() style_font_youyuan_28.init() style_font_youyuan_28.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) -style_font_youyuan_28.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_28.set_text_font(lv.lv_font_20_ALL) #黑色 style_black = lv.style_t() style_black.init() @@ -131,12 +142,12 @@ style_black.set_text_color(lv.color_make(0x00, 0x00, 0x00)) 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(lv.K01_font_16_ALL) +style_font_youyuan_20_red.set_text_font(lv.lv_font_20_ALL) style_font_youyuan_20_white = lv.style_t() style_font_youyuan_20_white.init() style_font_youyuan_20_white.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20_white.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_20_white.set_text_font(lv.lv_font_20_ALL) style_img = lv.style_t() style_img.init() @@ -326,8 +337,8 @@ class PhoneScreen(Screen): def initialization(self): - self.phone_num='' - self.phone_list = [] + # self.phone_num='' + # self.phone_list = [] global phone_screen ,phone_label_maxnum,phone_line,phone_label,phone_one,phone_two,phone_three,phone_four,phone_five,phone_six,phone_seven,phone_eight,phone_nine,phone_start,\ phone_zero,phone_hash,phone_call,phone_call_btn,phone_contact,phone_contact_btn,phone_delete,phone_delete_btn self.is_sliding = 0 @@ -557,13 +568,23 @@ class PhoneScreen(Screen): lv.EVENT.SHORT_CLICKED, None) phone_label_maxnum.add_flag(lv.obj.FLAG.HIDDEN) - self.phone_num='' - self.phone_list = [] + # self.phone_num='' + # self.phone_list = [] self.count = 0 if phone_label != None: - phone_label.set_pos(0, 20) - phone_label.set_size(0, 0) - phone_label.set_text(" ") + + if len(self.phone_num) != 0: + len_t = len(self.phone_list)*40 + if len_t > 215: + len_t = 215 + phone_label.set_size(len_t,48) + phone_label.set_pos(215-len_t,24) + phone_label.set_text(self.phone_num) + else: + phone_label.set_pos(0, 20) + phone_label.set_size(0, 0) + phone_label.set_text(" ") + #phone_label.set_text(" ") # print("self.phone_list :{} self.phone_num:{}".format(self.phone_list,self.phone_num)) if self.timer_cb == 0: @@ -1014,14 +1035,20 @@ class PhoneScreen(Screen): self.timer.stop() def done_return(self): + self.phone_num='' + self.phone_list = [] EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): + self.phone_num='' + self.phone_list = [] EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + self.phone_num='' + self.phone_list = [] EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -1636,7 +1663,7 @@ class NoSimPowerScreen(Screen):# style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1675,7 +1702,7 @@ class NoSimPowerScreen(Screen):# style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1803,7 +1830,7 @@ class NoSimAutoScreen(Screen):#无sim卡是否关机 style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1841,7 +1868,7 @@ class NoSimAutoScreen(Screen):#无sim卡是否关机 style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1970,7 +1997,7 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 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, 170) + dialing_popup_call.set_pos(0, 160) dialing_popup_call.set_size(LCD_SIZE_W, 50) dialing_popup_call.set_text("正在拨号中") dialing_popup_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -3043,6 +3070,18 @@ toolbox_cont_style.set_pad_right(0) toolbox_cont_style.set_pad_top(0) toolbox_cont_style.set_pad_bottom(0) + +style_tool_main_main_default = lv.style_t() +style_tool_main_main_default.init() +style_tool_main_main_default.set_radius(20) +style_tool_main_main_default.set_bg_color(lv.color_make(249,47,109)) +style_tool_main_main_default.set_bg_grad_color(lv.color_make(249,47,109)) +style_tool_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_tool_main_main_default.set_bg_opa(255) +style_tool_main_main_default.set_border_color(lv.color_make(249,47,109)) +style_tool_main_main_default.set_border_width(0) +style_tool_main_main_default.set_border_opa(255) + TOOL_ICON_OFFSET_SIZE = 84 TOOL_ICON_W_SIZE = 220 TOOL_ICON_H_SIZE = 65 @@ -3068,8 +3107,8 @@ class ToolboxScreen(Screen): toolbox_screen.set_scrollbar_mode(0) toolbox_text_img = lv.img(toolbox_screen) - toolbox_text_img.set_pos(0, 10) - toolbox_text_img.set_size(232, 34) + toolbox_text_img.set_pos((230-90)//2, 10) + toolbox_text_img.set_size(90, 34) toolbox_text_img.set_src("U:/static/tool/tool_text.png") toolbox_text_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -3091,7 +3130,7 @@ class ToolboxScreen(Screen): toolbox_step_bg_img.set_size(230,78) toolbox_step_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) toolbox_step_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) - toolbox_step_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + toolbox_step_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) toolbox_step_img = lv.img(toolbox_cont) @@ -3114,7 +3153,7 @@ class ToolboxScreen(Screen): toolbox_weather_bg_img.set_size(230,78) toolbox_weather_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) toolbox_weather_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) - toolbox_weather_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + toolbox_weather_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) toolbox_weather_img = lv.img(toolbox_cont) toolbox_weather_img.set_pos(8, tool_set_y+6) @@ -3138,7 +3177,7 @@ class ToolboxScreen(Screen): toolbox_alarm_bg_img.set_size(230,78) toolbox_alarm_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) toolbox_alarm_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) - toolbox_alarm_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + toolbox_alarm_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) toolbox_alarm_img = lv.img(toolbox_cont) toolbox_alarm_img.set_pos(8, tool_set_y+6) @@ -3169,7 +3208,7 @@ class ToolboxScreen(Screen): toolbox_countdown_bg_img.set_size(230,78) toolbox_countdown_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) toolbox_countdown_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) - toolbox_countdown_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + toolbox_countdown_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) toolbox_countdown_img = lv.img(toolbox_cont) toolbox_countdown_img.set_pos(8, tool_set_y+6) @@ -3192,7 +3231,7 @@ class ToolboxScreen(Screen): toolbox_stopwatch_bg_img.set_size(230,78) toolbox_stopwatch_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) toolbox_stopwatch_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) - toolbox_stopwatch_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + toolbox_stopwatch_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) toolbox_stopwatch_img = lv.img(toolbox_cont) toolbox_stopwatch_img.set_pos(8, tool_set_y+6) @@ -3579,21 +3618,25 @@ class OnCallScreen(Screen): print("on_call_screen") on_call_label_name = lv.label(on_call_obj) - on_call_label_name.set_pos(0, 70) + on_call_label_name.set_pos(0, 40) on_call_label_name.set_size(LCD_SIZE_W, 50) on_call_label_name.set_text(" ") on_call_label_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) on_call_label_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) on_call_second_label = lv.label(on_call_obj) - on_call_second_label.set_pos(0, 130) + on_call_second_label.set_pos(0, 100) on_call_second_label.set_size(LCD_SIZE_W, 30) on_call_second_label.set_text("00:00") on_call_second_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) on_call_second_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + # poweroff_screen_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.VALUE_CHANGED, None) + on_call_bar = lv.bar(on_call_obj) - on_call_bar.set_pos(49, 173) + on_call_bar.set_pos(49, 143) on_call_bar.set_size(140, 25) on_call_bar.set_style_anim_time(1000, lv.PART.INDICATOR | lv.STATE.DEFAULT) on_call_bar.set_mode(lv.bar.MODE.NORMAL) @@ -3601,15 +3644,23 @@ class OnCallScreen(Screen): on_call_bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) on_call_bar.add_style(style_bar_indic, lv.PART.INDICATOR | lv.STATE.DEFAULT) - on_call_volum_reduce = lv.img(on_call_obj) - on_call_volum_reduce.set_size(36, 36) - on_call_volum_reduce.set_pos(4, 168) - on_call_volum_reduce.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_volum_reduce.set_src("U:/static/REDUCE_VOLUM_ICON.png") + on_call_volum_reduce = lv.label(on_call_obj) + on_call_volum_reduce.set_pos(int(4),int(138)) + on_call_volum_reduce.set_size(36,36) + on_call_volum_reduce.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + on_call_volum_reduce.set_text("-") + on_call_volum_reduce.set_long_mode(lv.label.LONG.DOT) + on_call_volum_reduce.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + # on_call_volum_reduce = lv.img(on_call_obj) + # on_call_volum_reduce.set_size(36, 36) + # on_call_volum_reduce.set_pos(4, 168) + # on_call_volum_reduce.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # on_call_volum_reduce.set_src("U:/static/REDUCE_VOLUM_ICON.png") on_call_volum_reduce_btn = lv.label(on_call_obj) - on_call_volum_reduce_btn.set_pos(0, 160) + on_call_volum_reduce_btn.set_pos(0, 138) on_call_volum_reduce_btn.add_flag(lv.obj.FLAG.CLICKABLE) on_call_volum_reduce_btn.set_size(60, 50) on_call_volum_reduce_btn.set_text(" ") @@ -3618,15 +3669,22 @@ class OnCallScreen(Screen): on_call_volum_reduce_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), lv.EVENT.PRESSING, None) - on_call_volum_add = lv.img(on_call_obj) - on_call_volum_add.set_size(36, 36) - on_call_volum_add.set_pos(194, 168) - on_call_volum_add.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_volum_add.set_src("U:/static/VOLUM_ADD_ICON.png") + # on_call_volum_add = lv.img(on_call_obj) + # on_call_volum_add.set_size(36, 36) + # on_call_volum_add.set_pos(194, 168) + # on_call_volum_add.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # on_call_volum_add.set_src("U:/static/VOLUM_ADD_ICON.png") + on_call_volum_add = lv.label(on_call_obj) + on_call_volum_add.set_pos(int(194),int(138)) + on_call_volum_add.set_size(36,36) + on_call_volum_add.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + on_call_volum_add.set_text("+") + on_call_volum_add.set_long_mode(lv.label.LONG.DOT) + on_call_volum_add.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) on_call_volum_add_btn = lv.label(on_call_obj) - on_call_volum_add_btn.set_pos(180, 160) + on_call_volum_add_btn.set_pos(180, 130) on_call_volum_add_btn.add_flag(lv.obj.FLAG.CLICKABLE) on_call_volum_add_btn.set_size(60, 50) on_call_volum_add_btn.set_text(" ") @@ -3657,7 +3715,7 @@ class OnCallScreen(Screen): on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), lv.EVENT.SHORT_CLICKED, None) on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.PRESSING, None) + lv.EVENT.PRESSING, None) on_call_tab_label = lv.label(on_call_obj) on_call_tab_label.set_pos(150, 240) @@ -4092,15 +4150,17 @@ class OnCallScreen(Screen): EventMesh.publish("publish_message_event_ui",{"func":self.refresh_do,"data":0}) def refresh_do(self,data): - # print("call_in") - global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup - min = self.count_sec/60 - sec = self.count_sec%60 - if min > 99: - total = "%03d:%02d"%(min,sec) - else: - total = "%02d:%02d"%(min,sec) - on_call_second_label.set_text(str(total)) + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + # print("call_in") + global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup + min = self.count_sec/60 + sec = self.count_sec%60 + if min > 99: + total = "%03d:%02d"%(min,sec) + else: + total = "%02d:%02d"%(min,sec) + on_call_second_label.set_text(str(total)) self.count_sec+=1 def hangup(self,e): @@ -4114,9 +4174,17 @@ class OnCallScreen(Screen): EventMesh.publish("set_UI_high_priority",0) EventMesh.publish("return_prev_screen") voiceCall.callEnd() - - + def lcd_on(self): + global on_call_second_label + if on_call_second_label != None: + min = self.count_sec/60 + sec = self.count_sec%60 + if min > 99: + total = "%03d:%02d"%(min,sec) + else: + total = "%02d:%02d"%(min,sec) + on_call_second_label.set_text(str(total)) def Close(self): self.timer.stop() @@ -4227,6 +4295,8 @@ weather_location_label = None no_connect_label = None no_connect_label1 = None weather_type_label = None +weather_screen_no_data = None +weather_screen_yes_data = None class WeatherScreen(Screen): NAME = "weather" @@ -4237,7 +4307,7 @@ class WeatherScreen(Screen): EventMesh.subscribe("updata_weather_show", self.update_weather_data) def initialization(self): - global weather_screen,weather_img,weather_type_label,no_weather_img,weather_tem_label,no_weather_degree,\ + global weather_screen,weather_img,weather_type_label,weather_screen_no_data,weather_screen_yes_data,no_weather_img,weather_tem_label,no_weather_degree,\ weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 if weather_screen == None : weather_screen = lv.obj() @@ -4245,13 +4315,38 @@ class WeatherScreen(Screen): weather_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) weather_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) - weather_type_label = lv.label(weather_screen) - weather_type_label.set_pos(10, 10) - weather_type_label.set_size(135, 120) - weather_type_label.set_text(" ") - weather_type_label.set_long_mode(lv.label.LONG.WRAP) - weather_type_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - weather_type_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + weather_screen_no_data = lv.obj(weather_screen) + print("weather_screen_no_data") + weather_screen_no_data.set_pos(0,0) + weather_screen_no_data.set_size(240,282) + weather_screen_no_data.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_no_data.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_connect_label = lv.label(weather_screen_no_data) + no_connect_label.set_pos(0, 100) + no_connect_label.set_size(LCD_SIZE_W, 40) + no_connect_label.set_text("找不到服务器") + no_connect_label.set_long_mode(lv.label.LONG.WRAP) + no_connect_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_connect_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_connect_label1 = lv.label(weather_screen_no_data) + no_connect_label1.set_pos(0, 140) + no_connect_label1.set_size(LCD_SIZE_W, 54) + no_connect_label1.set_text("请联网后重试") + no_connect_label1.set_long_mode(lv.label.LONG.WRAP) + no_connect_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_connect_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + weather_screen_yes_data = lv.obj(weather_screen) + print("weather_screen_yes_data") + weather_screen_yes_data.set_pos(0,0) + weather_screen_yes_data.set_size(240,282) + weather_screen_yes_data.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_yes_data.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + # weather_img = lv.img(weather_screen) # weather_img.set_pos(10, 10) @@ -4259,35 +4354,43 @@ class WeatherScreen(Screen): # weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - no_weather_img = lv.img(weather_screen) - no_weather_img.set_pos(10, 10) - no_weather_img.set_size(135, 120) - no_weather_img.set_src("U:/static/update.png") - no_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # no_weather_img = lv.img(weather_screen_yes_data) + # no_weather_img.set_pos(10, 10) + # no_weather_img.set_size(135, 120) + # no_weather_img.set_src("U:/static/update.png") + # no_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - weather_tem_label = lv.label(weather_screen) - weather_tem_label.set_pos(145, 44) - weather_tem_label.set_size(240-145, 50) + weather_tem_label = lv.label(weather_screen_yes_data) + weather_tem_label.set_pos(0, 44) + weather_tem_label.set_size(240, 50) weather_tem_label.set_text("_ _℃") weather_tem_label.set_long_mode(lv.label.LONG.WRAP) weather_tem_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) weather_tem_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_weather_degree = lv.img(weather_screen) - no_weather_degree.set_pos(205, 40) - no_weather_degree.set_size(22, 22) - # no_weather_degree.set_src("U:/static/degree.png") - no_weather_degree.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # no_weather_degree = lv.img(weather_screen_yes_data) + # no_weather_degree.set_pos(205, 40) + # no_weather_degree.set_size(22, 22) + # # no_weather_degree.set_src("U:/static/degree.png") + # no_weather_degree.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - weather_detail_label = lv.label(weather_screen) - weather_detail_label.set_pos(145, 80) - weather_detail_label.set_size(85, 50) + weather_detail_label = lv.label(weather_screen_yes_data) + weather_detail_label.set_pos(0, 80) + weather_detail_label.set_size(LCD_SIZE_W, 50) weather_detail_label.set_text("-/-") weather_detail_label.set_long_mode(lv.label.LONG.WRAP) weather_detail_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) weather_detail_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - weather_location_label = lv.label(weather_screen) + weather_type_label = lv.label(weather_screen_yes_data) + weather_type_label.set_pos(0, 116) + weather_type_label.set_size(LCD_SIZE_W, 120) + weather_type_label.set_text(" ") + weather_type_label.set_long_mode(lv.label.LONG.WRAP) + weather_type_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + weather_type_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + weather_location_label = lv.label(weather_screen_yes_data) weather_location_label.set_pos(0, 180) weather_location_label.set_size(LCD_SIZE_W, 50) weather_location_label.set_text("--") @@ -4295,62 +4398,52 @@ class WeatherScreen(Screen): weather_location_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) weather_location_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_connect_label = lv.label(weather_screen) - no_connect_label.set_pos(0, 180) - no_connect_label.set_size(LCD_SIZE_W, 40) - no_connect_label.set_text("找不到服务器") - no_connect_label.set_long_mode(lv.label.LONG.WRAP) - no_connect_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_connect_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_connect_label1 = lv.label(weather_screen) - no_connect_label1.set_pos(0, 230) - no_connect_label1.set_size(LCD_SIZE_W, 54) - no_connect_label1.set_text("请联网后重试") - no_connect_label1.set_long_mode(lv.label.LONG.WRAP) - no_connect_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_connect_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = weather_screen #EventMesh.publish(constants.PROTOCOL.WT_SEND) EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.WT_SEND) #开始WT定位 def post_processor_after_initialization(self): + EventMesh.publish("updata_weather_show") def update_weather_data(self, event, msg): - global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,\ + global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,weather_type_label,\ weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 connect = EventMesh.publish(constants.EVENT.GET_CONNECT) #获取网络状态 self.weather_data = EventMesh.publish("get_weather_data") + print("self.weather_data:{}\r\n".format(self.weather_data)) if weather_screen != None: if connect != 0 and self.weather_data != None: no_data = self.weather_data[8] if no_data != 0 : - no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_no_data.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_yes_data.clear_flag(lv.obj.FLAG.HIDDEN) + # no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) weather_type_label.clear_flag(lv.obj.FLAG.HIDDEN) # weather_img.clear_flag(lv.obj.FLAG.HIDDEN) - no_connect_label.set_text(" ") - no_connect_label1.set_text(" ") # print("self.weather_data:{}".format(self.weather_data)) type = self.weather_data[3] if type == None: weather_type_label.add_flag(lv.obj.FLAG.HIDDEN) - no_weather_img.clear_flag(lv.obj.FLAG.HIDDEN) + # no_weather_img.clear_flag(lv.obj.FLAG.HIDDEN) # weather_img.set_src("U:/static/update.png")#天气类型 else: - no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) + # no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) weather_type_label.clear_flag(lv.obj.FLAG.HIDDEN) - if type == 0: #晴 + if type == "0": #晴 weather_type_label.set_text("晴") - elif type == 1: #阴 + elif type == "1": #阴 weather_type_label.set_text("阴") - elif type == 2: #雨 + elif type == "2": #雨 weather_type_label.set_text("雨") - elif type == 3: #雪 + elif type == "3": #雪 weather_type_label.set_text("雪") else: - weather_type_label.set_text(" ") + weather_type_label.set_text("未知") # weather_img.set_src("U:/static/{}_weather.png".format(type))#天气类型 @@ -4374,20 +4467,15 @@ class WeatherScreen(Screen): else: weather_location_label.set_text("--") else:#已联网未获取到天气数据 - weather_location_label.set_text(" ") - weather_detail_label.set_text("-/-") - weather_tem_label.set_text("_ _℃") + weather_screen_yes_data.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_no_data.clear_flag(lv.obj.FLAG.HIDDEN) no_connect_label.set_text("未获取网络数据") no_connect_label1.set_text("请稍候重试") else: - weather_location_label.set_text(" ") - weather_detail_label.set_text("-/-") - weather_tem_label.set_text("_ _℃") - - no_weather_img.clear_flag(lv.obj.FLAG.HIDDEN) - weather_type_label.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_yes_data.add_flag(lv.obj.FLAG.HIDDEN) + weather_screen_no_data.clear_flag(lv.obj.FLAG.HIDDEN) no_connect_label.set_text("找不到服务器") no_connect_label1.set_text("请联网后重试") @@ -4682,6 +4770,24 @@ countdown_start_img = None countdown_start_imgbtn = None countdown_stop_img = None countdown_min = None + +countdown_screen_label_1_main_main_default = lv.style_t() +countdown_screen_label_1_main_main_default.init() +countdown_screen_label_1_main_main_default.set_radius(5) +countdown_screen_label_1_main_main_default.set_bg_color(lv.color_make(0x21,0x95,0xf6)) +countdown_screen_label_1_main_main_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +countdown_screen_label_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) +countdown_screen_label_1_main_main_default.set_bg_opa(255) +countdown_screen_label_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xfc)) +countdown_screen_label_1_main_main_default.set_text_font(lv.lv_font_20_ALL) +countdown_screen_label_1_main_main_default.set_text_letter_space(0) +countdown_screen_label_1_main_main_default.set_text_line_space(0) +countdown_screen_label_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) +countdown_screen_label_1_main_main_default.set_pad_left(0) +countdown_screen_label_1_main_main_default.set_pad_right(0) +countdown_screen_label_1_main_main_default.set_pad_top(4) +countdown_screen_label_1_main_main_default.set_pad_bottom(0) + class CountdownScreen(Screen): NAME = "countdown" @@ -4725,8 +4831,8 @@ class CountdownScreen(Screen): countdown_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_hour = lv.label(countdown_screen) - countdown_hour.set_pos(30, 130) - countdown_hour.set_size(60, 30) + countdown_hour.set_pos(40, 130) + countdown_hour.set_size(50, 30) countdown_hour.set_text("00") countdown_hour.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_hour.set_long_mode(lv.label.LONG.WRAP) @@ -4742,8 +4848,8 @@ class CountdownScreen(Screen): countdown_min = lv.label(countdown_screen) - countdown_min.set_pos(95, 130) - countdown_min.set_size(60, 30) + countdown_min.set_pos(105, 130) + countdown_min.set_size(50, 30) countdown_min.set_text("00") countdown_min.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_min.set_long_mode(lv.label.LONG.WRAP) @@ -4759,19 +4865,26 @@ class CountdownScreen(Screen): countdown_sec = lv.label(countdown_screen) - countdown_sec.set_pos(160, 130) - countdown_sec.set_size(60, 30) + countdown_sec.set_pos(170, 130) + countdown_sec.set_size(50, 30) countdown_sec.set_text("00") countdown_sec.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_sec.set_long_mode(lv.label.LONG.WRAP) countdown_sec.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - countdown_hour_up = lv.img(countdown_screen) - countdown_hour_up.set_size(34, 30) - countdown_hour_up.set_pos(36, 90) - countdown_hour_up.set_src("U:/static/time_up.png") - countdown_hour_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_hour_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_hour_up = lv.label(countdown_screen) + countdown_hour_up.set_pos(int(36),int(90)) + countdown_hour_up.set_size(34,30) + countdown_hour_up.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_hour_up.set_text("+") + countdown_hour_up.set_long_mode(lv.label.LONG.DOT) + countdown_hour_up.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + # countdown_hour_up = lv.img(countdown_screen) + # countdown_hour_up.set_size(34, 30) + # countdown_hour_up.set_pos(36, 90) + # countdown_hour_up.set_src("U:/static/time_up.png") + # countdown_hour_up.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_hour_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_hour_up_btn= lv.img(countdown_screen) countdown_hour_up_btn.set_size(62, 65) @@ -4779,12 +4892,20 @@ class CountdownScreen(Screen): countdown_hour_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_hour_down = lv.img(countdown_screen) - countdown_hour_down.set_size(34, 30) - countdown_hour_down.set_pos(36, 170) - countdown_hour_down.set_src("U:/static/time_down.png") - countdown_hour_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_hour_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_hour_down = lv.label(countdown_screen) + countdown_hour_down.set_pos(int(36),int(170)) + countdown_hour_down.set_size(34,30) + countdown_hour_down.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_hour_down.set_text("-") + countdown_hour_down.set_long_mode(lv.label.LONG.DOT) + countdown_hour_down.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + # countdown_hour_down = lv.img(countdown_screen) + # countdown_hour_down.set_size(34, 30) + # countdown_hour_down.set_pos(36, 170) + # countdown_hour_down.set_src("U:/static/time_down.png") + # countdown_hour_down.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_hour_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_hour_down_btn= lv.img(countdown_screen) countdown_hour_down_btn.set_size(62, 70) @@ -4792,12 +4913,20 @@ class CountdownScreen(Screen): countdown_hour_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_min_up = lv.img(countdown_screen) - countdown_min_up.set_size(34, 30) - countdown_min_up.set_pos(99, 90) - countdown_min_up.set_src("U:/static/time_up.png") - countdown_min_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_min_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_min_up = lv.label(countdown_screen) + countdown_min_up.set_pos(int(99),int(90)) + countdown_min_up.set_size(34,30) + countdown_min_up.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_min_up.set_text("+") + countdown_min_up.set_long_mode(lv.label.LONG.DOT) + countdown_min_up.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + # countdown_min_up = lv.img(countdown_screen) + # countdown_min_up.set_size(34, 30) + # countdown_min_up.set_pos(99, 90) + # countdown_min_up.set_src("U:/static/time_up.png") + # countdown_min_up.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_min_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_min_up_btn= lv.img(countdown_screen) countdown_min_up_btn.set_size(64, 65) @@ -4805,38 +4934,60 @@ class CountdownScreen(Screen): countdown_min_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_min_down = lv.label(countdown_screen) + countdown_min_down.set_pos(int(99),int(170)) + countdown_min_down.set_size(34,30) + countdown_min_down.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_min_down.set_text("-") + countdown_min_down.set_long_mode(lv.label.LONG.DOT) + countdown_min_down.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - countdown_min_down = lv.img(countdown_screen) - countdown_min_down.set_size(34, 30) - countdown_min_down.set_pos(99, 170) - countdown_min_down.set_src("U:/static/time_down.png") - countdown_min_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_min_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # countdown_min_down = lv.img(countdown_screen) + # countdown_min_down.set_size(34, 30) + # countdown_min_down.set_pos(99, 170) + # countdown_min_down.set_src("U:/static/time_down.png") + # countdown_min_down.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_min_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_min_down_btn= lv.img(countdown_screen) countdown_min_down_btn.set_size(64, 70) countdown_min_down_btn.set_pos(82, 145) countdown_min_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - countdown_sec_up = lv.img(countdown_screen) - countdown_sec_up.set_size(34, 30) - countdown_sec_up.set_pos(165, 90) - countdown_sec_up.set_src("U:/static/time_up.png") - countdown_sec_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_sec_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_sec_up = lv.label(countdown_screen) + countdown_sec_up.set_pos(int(165),int(90)) + countdown_sec_up.set_size(34,30) + countdown_sec_up.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_sec_up.set_text("+") + countdown_sec_up.set_long_mode(lv.label.LONG.DOT) + countdown_sec_up.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + # countdown_sec_up = lv.img(countdown_screen) + # countdown_sec_up.set_size(34, 30) + # countdown_sec_up.set_pos(165, 90) + # countdown_sec_up.set_src("U:/static/time_up.png") + # countdown_sec_up.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_sec_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_sec_up_btn = lv.img(countdown_screen) countdown_sec_up_btn.set_size(64, 65) countdown_sec_up_btn.set_pos(146, 80) countdown_sec_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_sec_down = lv.img(countdown_screen) - countdown_sec_down.set_size(34, 30) - countdown_sec_down.set_pos(165, 170) - countdown_sec_down.set_src("U:/static/time_down.png") - countdown_sec_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_sec_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_sec_down = lv.label(countdown_screen) + countdown_sec_down.set_pos(int(165),int(170)) + countdown_sec_down.set_size(34,30) + countdown_sec_down.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + countdown_sec_down.set_text("-") + countdown_sec_down.set_long_mode(lv.label.LONG.DOT) + countdown_sec_down.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + # countdown_sec_down = lv.img(countdown_screen) + # countdown_sec_down.set_size(34, 30) + # countdown_sec_down.set_pos(165, 170) + # countdown_sec_down.set_src("U:/static/time_down.png") + # countdown_sec_down.add_flag(lv.obj.FLAG.CLICKABLE) + # countdown_sec_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_sec_down_btn = lv.img(countdown_screen) countdown_sec_down_btn.set_size(64, 70) @@ -5293,14 +5444,14 @@ class CountdownEndScreen(Screen): countdown_end_screen = lv.obj() print("countdown_end_screen") countdown_end_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_end_img = lv.img(countdown_end_screen) - countdown_end_img.set_size(140, 140) - countdown_end_img.set_pos(50, 60) - countdown_end_img.set_src("U:/static/time_finish.png") - countdown_end_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # countdown_end_img = lv.img(countdown_end_screen) + # countdown_end_img.set_size(140, 140) + # countdown_end_img.set_pos(50, 60) + # countdown_end_img.set_src("U:/static/time_finish.png") + # countdown_end_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) countdown_end_label = lv.label(countdown_end_screen) - countdown_end_label.set_pos(0, 240) + countdown_end_label.set_pos(0, 120) countdown_end_label.set_size(LCD_SIZE_W, 40) countdown_end_label.set_text("时间到") countdown_end_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -5731,7 +5882,7 @@ class UIFINDScreen(Screen): self.meta = FIND_screen - + self.aud.play(1, 1, 'U:/static/audio_audio_haixiu.mp3') #播放声音 def post_processor_after_initialization(self): utime.sleep_ms(200)#不加延时会切屏 @@ -5739,27 +5890,26 @@ class UIFINDScreen(Screen): print("self.FIND_timer_count:{}".format(self.FIND_timer_count)) EventMesh.publish("set_motor_time",[1,2,8*10,8,4])#设置马达参数 self.FIND_timer.start(3000, 1, self.FIND_timer_cb) - self.aud.play(1, 1, 'U:/static/audio_audio_haixiu.mp3') #播放声音 + def FIND_timer_cb(self, *args): EventMesh.publish("system_sleep_rest") - self.aud.play(1, 1, 'U:/static/audio_audio_haixiu.mp3') self.FIND_timer_count += 1 if self.FIND_timer_count > 20: #120秒 - self.FIND_timer_count = 0 self.stop_FIND() + return + self.aud.play(1, 1, 'U:/static/audio_audio_haixiu.mp3') def stop_FIND(self) : + self.FIND_timer_count = 0 self.FIND_timer.stop() - self.aud.stop() #播放声音 - EventMesh.publish("close_motor_infor")#关闭马达和定时器 + self.aud.stopAll() EventMesh.publish("return_prev_screen") def Close(self): - EventMesh.publish("close_motor_infor")#关闭马达和定时器 + self.FIND_timer_count = 0 self.FIND_timer.stop() - self.aud.stop() #播放声音 - + self.aud.stopAll() def done_return(self): @@ -6006,7 +6156,7 @@ class sosScreen(Screen): style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -6044,7 +6194,7 @@ class sosScreen(Screen): style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) - style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) + style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -6536,7 +6686,7 @@ class restore_confirmScreen(Screen): style_font_youyuan_70_red = lv.style_t() style_font_youyuan_70_red.init() style_font_youyuan_70_red.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_70_red.set_text_font(lv.K01_font_30_DIAL) +style_font_youyuan_70_red.set_text_font(lv.font_70_bold) class_mgr_popup_screen = None class_mgr_popup_label = None @@ -7180,11 +7330,17 @@ class UI(object): try: self.screen_list.append(screen) except Exception as e: - usys.print_exception(e) + usys.print_exception(e) return self def get_screen_NAME(self, event, msg): - return self.screen.NAME + # print("self.screen.NAME:{}".format(self.screen)) + if self.screen != None: + if self.screen.NAME != None: + return self.screen.NAME + return None + else: + return None def load_screen_cb(self, topic, msg): EventMesh.publish("publish_message_event_ui",{"func":self.load_screen,"data":msg}) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py index b5f061e6..5d7df377 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py @@ -17,7 +17,7 @@ from lcd import LCD_SIZE_W,LCD_SIZE_H 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(lv.K01_font_16_ALL) +watchface_style_default.set_text_font(lv.lv_font_20_ALL) @@ -98,12 +98,12 @@ watchface1_bg_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.D style_font_youyuan_70_white = lv.style_t() style_font_youyuan_70_white.init() style_font_youyuan_70_white.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_70_white.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_70_white.set_text_font(lv.font_70_bold) style_font_youyuan_70_black = lv.style_t() style_font_youyuan_70_black.init() style_font_youyuan_70_black.set_text_color(lv.color_make(0x32, 0xc8, 0xdb)) -style_font_youyuan_70_black.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_70_black.set_text_font(lv.font_70_bold) #init3:(2106, 2, 7, 6, 29, 38, 6, 38) data = RTC().datetime() hour = data[4] @@ -399,7 +399,7 @@ watchface2_res_stat_battery_line.add_style(power_line_red,0) style_font_youyuan_70_red = lv.style_t() style_font_youyuan_70_red.init() style_font_youyuan_70_red.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_70_red.set_text_font(lv.K01_font_16_ALL) +style_font_youyuan_70_red.set_text_font(lv.font_70_bold) #时间 x = 30 y = 80 @@ -438,7 +438,7 @@ watchface2_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFA #日期 watchface2_week = lv.label(Watchface2) watchface2_week.set_pos(146, 170) -watchface2_week.set_size(110, 35) +watchface2_week.set_size(94, 35) watchface2_week.set_align(lv.TEXT_ALIGN.LEFT) watchface2_week.set_text("星期%s"%(get_week(week))) watchface2_week.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py index d87f8cc6..59f2a63a 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py @@ -33,15 +33,11 @@ style_MainMenu_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) style_MainMenu_img_default.set_img_recolor_opa(0) 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(lv.K01_font_16_ALL) 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(lv.K01_font_16_ALL) +style_font_youyuan_25.set_text_font(lv.lv_font_20_ALL) style_btn = lv.style_t() style_btn.init() @@ -55,28 +51,28 @@ MainMenu = lv.obj() style_font_youyuan_font_60 = lv.style_t() style_font_youyuan_font_60.init() style_font_youyuan_font_60.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) -style_font_youyuan_font_60.set_text_font(lv.K01_font_16_ALL) -MainMenu2x = 0 -MainMenu2_num = 0 -MainMenu2 = lv.obj(MainMenu) -MainMenu2.set_size(LCD_SIZE_W,LCD_SIZE_H) -#MainMenu1.set_pos(0,0) -MainMenu2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -MainMenu2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) -print("MainMenu2") -MainMenu2_til = lv.tileview(MainMenu2) -MainMenu2_til.set_scrollbar_mode(0) -MainMenu2_til.set_size(240,284) -MainMenu2_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) -#MainMenu2_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) -#LV_OBJ_FLAG_SCROLL_MOMENTUM -#表盘 -MainMenu2_Watchface = MainMenu2_til.add_tile(0, 1, lv.DIR.LEFT | lv.DIR.RIGHT) - -label_text = lv.label(MainMenu2_Watchface) -label_text.set_pos(0, LCD_SIZE_W) -label_text.set_size(0, 0) -label_text.set_text("0") +style_font_youyuan_font_60.set_text_font(lv.lv_font_20_ALL) +# MainMenu2x = 0 +# MainMenu2_num = 0 +# MainMenu2 = lv.obj(MainMenu) +# MainMenu2.set_size(LCD_SIZE_W,LCD_SIZE_H) +# #MainMenu1.set_pos(0,0) +# MainMenu2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# MainMenu2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) +# print("MainMenu2") +# MainMenu2_til = lv.tileview(MainMenu2) +# MainMenu2_til.set_scrollbar_mode(0) +# MainMenu2_til.set_size(240,284) +# MainMenu2_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) +# #MainMenu2_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) +# #LV_OBJ_FLAG_SCROLL_MOMENTUM +# #表盘 +# MainMenu2_Watchface = MainMenu2_til.add_tile(0, 1, lv.DIR.LEFT | lv.DIR.RIGHT) + +# label_text = lv.label(MainMenu2_Watchface) +# label_text.set_pos(0, LCD_SIZE_W) +# label_text.set_size(0, 0) +# label_text.set_text("0") # MainMenu2_num+=1 # # # #支付宝 @@ -392,7 +388,7 @@ THEME1_ICON_Y = 80 MAIN1_ICON_X = 26 MAIN1_ICON_Y = 12 -MainMenu1x = 0 +MainMenu1x = 1 MainMenu1_num = 0 MainMenu1 = lv.obj(MainMenu) MainMenu1.set_size(LCD_SIZE_W,LCD_SIZE_H) @@ -404,10 +400,11 @@ MainMenu1_til = lv.tileview(MainMenu1) MainMenu1_til.set_scrollbar_mode(0) MainMenu1_til.set_size(240,284) MainMenu1_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) -#MainMenu1_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) +MainMenu1_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) + #LV_OBJ_FLAG_SCROLL_MOMENTUM #表盘 -MainMenu1_Watchface = MainMenu1_til.add_tile(0, 1, lv.DIR.LEFT | lv.DIR.RIGHT) +MainMenu1_Watchface = MainMenu1_til.add_tile(0, 0, lv.DIR.NONE) label_text = lv.label(MainMenu1_Watchface) label_text.set_pos(0, LCD_SIZE_W) @@ -418,7 +415,7 @@ label_text.set_text("0") MainMenu1_num+=1 #拨号盘 -MainMenu1_one = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +MainMenu1_one = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.NONE) label_text = lv.label(MainMenu1_one) label_text.set_pos(0, LCD_SIZE_H) label_text.set_size(0, 0) @@ -560,7 +557,7 @@ MainMenu1_img_calllog_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|l MainMenu1_num+=1 MainMenu1x+=1 #短信 -MainMenu1_three = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +MainMenu1_three = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.NONE) label_text = lv.label(MainMenu1_three) label_text.set_pos(0, LCD_SIZE_H) label_text.set_size(0, 0) @@ -625,7 +622,7 @@ MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE MainMenu1_num+=1 MainMenu1x+=1 #相机,相册,视频通话,支付宝 -MainMenu1_four = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +MainMenu1_four = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.NONE) label_text = lv.label(MainMenu1_four) label_text.set_pos(0, LCD_SIZE_H) label_text.set_size(0, 0) @@ -662,33 +659,42 @@ 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,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_img_alipay_text = lv.label(MainMenu1_four) +# MainMenu1_img_alipay_text.set_pos(MAIN1_ICON_X,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_img_stopwatch_text = lv.label(MainMenu1_four) -MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X*2+85,140+5) +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_num+=1 MainMenu1x+=1 #工具箱 设置 -MainMenu1_setting = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +MainMenu1_setting = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.NONE) label_text = lv.label(MainMenu1_setting) label_text.set_pos(0, LCD_SIZE_H) 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) @@ -703,16 +709,16 @@ MainMenu1_img_setting.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.ST # 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,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,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*2+85),int(MAIN1_ICON_Y+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) @@ -720,7 +726,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),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) @@ -759,56 +765,58 @@ class MainMenuScreen(Screen): self.scroll_begin_event_count = 0 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) - + MainMenu.add_event_cb(lambda e:EventMesh.callback_wrapper(self.setting_cb(e,"void")), lv.EVENT.GESTURE, None) + MainMenu1.add_event_cb(lambda e:EventMesh.callback_wrapper(self.setting_cb(e,"void")), lv.EVENT.GESTURE, None) + # MainMenu1_til.add_event_cb(lambda e: EventMesh.callback_wrapper(self.scroll_begin_event_cb(e)),lv.EVENT.SCROLL_END,None) + MainMenu1_til.add_event_cb(lambda e:EventMesh.callback_wrapper(self.setting_cb(e,"void")), lv.EVENT.GESTURE, 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) + MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "contacts")), lv.EVENT.PRESSING, None) - MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.PRESSING, None) + MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "call_log")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "call_log")), lv.EVENT.PRESSING, None) - MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.PRESSING, None) + MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "popup")), lv.EVENT.PRESSING, None) - MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) + MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "Phone")), 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_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_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) + MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "wechat")), lv.EVENT.PRESSING, None) - MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.PRESSING, None) + MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "clk_list")), lv.EVENT.PRESSING, None) - MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) + MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) - MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.PRESSING, None) + MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "countdown")), lv.EVENT.PRESSING, None) - MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.PRESSING, None) - MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.PRESSING, None) - MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.PRESSING, None) + MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "camera")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "camera")), lv.EVENT.PRESSING, None) + MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "camera_album")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "camera_album")), lv.EVENT.PRESSING, None) + MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "videolist")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "videolist")), lv.EVENT.PRESSING, None) # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) - MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) + # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) - MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) - MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) - MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) + MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "toolbox")), lv.EVENT.PRESSING, None) + MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "setting")), lv.EVENT.PRESSING, None) @@ -853,13 +861,56 @@ class MainMenuScreen(Screen): EventMesh.subscribe("return_alipay", self.return_alipay) EventMesh.subscribe("return_setiing", self.return_setiing) #MainMenu2_img_alipay.add_event_cb(lambda e: img_cb(e, "Watchface_set"), lv.EVENT.CLICKED, None) - + + def setting_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + # print("setting_cb lv.DIR.BOTTOM!!!!!!!!!\r\n") + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + self.menu_id = id + page_id = int(id) #0 1 2 3 4 总共五个 + # print("done_right_to_left:ID {} menu_id {} page_id:{}\r\n".format(id,self.menu_id,page_id)) + if page_id == 0: + self.MainMenu_til.set_tile_id(4,0,lv.ANIM.OFF) + else: + self.MainMenu_til.set_tile_id(page_id-1,0,lv.ANIM.OFF) + elif dir == lv.DIR.LEFT: + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + page_id = int(id) #0 1 2 3 4 总共五个 + # print("done_right_to_left:ID {} menu_id {} page_id:{}\r\n".format(id,self.menu_id,page_id)) + if page_id <= 3: + self.MainMenu_til.set_tile_id(page_id+1,0,lv.ANIM.OFF) + else: + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + elif dir == lv.DIR.TOP: + print("lv.DIR.TOP!!!!!!!!!\r\n") + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id == "0": + EventMesh.publish("load_screen", {"screen": "call_log"}) + self.menu_id = id + self.is_sliding = 0 + elif dir == lv.DIR.BOTTOM: + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id == "0": + EventMesh.publish("load_screen", {"screen": "popup"}) + self.menu_id = id + self.is_sliding = 0 + print("lv.DIR.BOTTOM!!!!!!!!!\r\n") + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != "void": + EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) + def initialization(self): self.watchface.initialization() self.is_sliding = 0 if self.menu_id =="0": - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) # if self.meta_info in globals() : # self.MainMenu_til.set_tile_id(self.meta_info[0],self.meta_info[1],lv.ANIM.OFF) pass# @@ -868,13 +919,13 @@ class MainMenuScreen(Screen): def set_mainmenu(self, event=None, msg=None): if self.watchface != None: self.watchface.Close() - MainMenu2.add_flag(lv.obj.FLAG.HIDDEN)#隐藏菜单 + # MainMenu2.add_flag(lv.obj.FLAG.HIDDEN)#隐藏菜单 MainMenu1.add_flag(lv.obj.FLAG.HIDDEN) if msg[0] == "2": - MainMenu2.clear_flag(lv.obj.FLAG.HIDDEN)#显示菜单 - self.MainMenu_Watchface = MainMenu2_Watchface - self.MainMenu_til = MainMenu2_til - self.MainMenu_num = MainMenu2_num + # MainMenu2.clear_flag(lv.obj.FLAG.HIDDEN)#显示菜单 + # self.MainMenu_Watchface = MainMenu2_Watchface + # self.MainMenu_til = MainMenu2_til + # self.MainMenu_num = MainMenu2_num # self.watchface = MainMenu2_watchface print("set_mainmenu2") elif msg[0] == "1": @@ -904,7 +955,7 @@ class MainMenuScreen(Screen): EventMesh.publish("load_screen", {"screen": "main_menu"}) #self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) #self.initialization() - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) def scroll_begin_event_cb(self, e): pass # EventMesh.publish("publish_message_event_ui",{"func":self.scroll_begin_event,"data":0}) @@ -935,7 +986,7 @@ class MainMenuScreen(Screen): # if code == lv.EVENT.SCROLL_END: # pass def watch_top_show(self, event, msg): # - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) def img_cb(self,e,msg): code = e.get_code() @@ -964,7 +1015,7 @@ class MainMenuScreen(Screen): self.watchface.timer_update.stop() def done_return(self): - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) def btn1_release(self): flag = EventMesh.publish("get_lcd_state") @@ -974,7 +1025,7 @@ class MainMenuScreen(Screen): if self.MainMenu_til.get_tile_act() != None: id = self.MainMenu_til.get_tile_act().get_child(0).get_text() if id != "0": - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) else: EventMesh.publish("load_screen", {"screen": "alipay_open"}) @@ -982,7 +1033,7 @@ class MainMenuScreen(Screen): self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) def return_setiing(self, event, msg): - self.MainMenu_til.set_tile_id(7,0,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(8,0,lv.ANIM.OFF) @@ -998,17 +1049,17 @@ class MainMenuScreen(Screen): EventMesh.publish(constants.EVENT.SYSTEM_UP) else: if flag == 1: - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) else: EventMesh.publish(constants.EVENT.SYSTEM_UP) else: if flag == 1: - self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) else: EventMesh.publish(constants.EVENT.SYSTEM_UP) def done_bottom_to_top(self): - + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() if id == "0": EventMesh.publish("load_screen", {"screen": "call_log"}) @@ -1016,6 +1067,7 @@ class MainMenuScreen(Screen): self.is_sliding = 0 def done_top_to_bottom(self): + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() if id == "0": EventMesh.publish("load_screen", {"screen": "popup"}) @@ -1023,30 +1075,56 @@ class MainMenuScreen(Screen): self.is_sliding = 0 def done_left_to_right(self): + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() print("done_left_to_right:ID{} menu_id{}".format(id,self.menu_id)) + self.menu_id = id + page_id = int(id) #0 1 2 3 4 总共五个 + print("done_right_to_left:ID {} menu_id {} page_id:{}\r\n".format(id,self.menu_id,page_id)) + if page_id == 0: + self.MainMenu_til.set_tile_id(4,0,lv.ANIM.OFF) + else: + self.MainMenu_til.set_tile_id(page_id-1,0,lv.ANIM.OFF) + return if id == "0": - self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + self.MainMenu_til.set_tile_id(self.MainMenu_num-1,0,lv.ANIM.OFF) elif self.menu_id != '2' and id == '1': - self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) - elif self.menu_id == id : + self.MainMenu_til.set_tile_id(self.MainMenu_num-1,0,lv.ANIM.OFF) + else: + self.MainMenu_til.set_tile_id(int(id)-1,0,lv.ANIM.OFF) self.menu_action = 1 self.menu_id = id self.is_sliding = 0 def done_right_to_left(self): + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() - print("done_right_to_left:ID{} menu_id{}".format(id,self.menu_id)) - if id == "0": - self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) - elif (self.menu_id != str(self.MainMenu_num-2) ) and id == str(self.MainMenu_num-1) : + + page_id = int(id) #0 1 2 3 4 总共五个 + print("done_right_to_left:ID {} menu_id {} page_id:{}\r\n".format(id,self.menu_id,page_id)) + if page_id <= 3: + self.MainMenu_til.set_tile_id(page_id+1,0,lv.ANIM.OFF) + else: self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) - else : - self.menu_action = 2 + # if id == "0": #表盘界面 + # self.MainMenu_til.set_tile_id(1,0,lv.ANIM.OFF) + # elif (self.menu_id != str(self.MainMenu_num-1) ) and id == str(self.MainMenu_num): + # self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + + self.menu_id = id + return + print("done_right_to_left:ID {} menu_id {} self.MainMenu_num-2:{}\r\n".format(id,self.menu_id,self.MainMenu_num-2)) + # if id == "0": + # self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + # elif (self.menu_id != str(self.MainMenu_num-1) ) and id == str(self.MainMenu_num) : + # self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + # else : + # self.menu_action = 2 self.menu_id = id self.is_sliding = 0 def done_DOWN(self):#下滑 + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() print("done_right_to_left: {} {} {}".format(id,self.menu_id,self.MainMenu_num)) if id == "0": @@ -1062,6 +1140,7 @@ class MainMenuScreen(Screen): self.is_sliding = 0 def done_UP(self):#上滑 + return id = self.MainMenu_til.get_tile_act().get_child(0).get_text() print("done_right_to_left: {} {} {}".format(id,self.menu_id,self.MainMenu_num)) if id == "0": diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py index 53a099f1..a5987320 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py @@ -3,7 +3,7 @@ import lvgl as lv import ql_fs import EventMesh from misc import Power -from ui import style_screen,style_font_youyuan_20_gray,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn,style_bar,style_bar_indic +from ui import countdown_screen_label_1_main_main_default,style_screen,style_main_default_bg,style_font_youyuan_20_gray,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn,style_bar,style_bar_indic import constants import osTimer import audio @@ -25,17 +25,7 @@ style_volume_btn.set_shadow_opa(0) style_volume_btn.set_border_width(0) style_volume_btn.set_bg_color(lv.color_make(0x80, 0x80, 0x80)) -style_screen_btn_1_main_main_default = lv.style_t() -style_screen_btn_1_main_main_default.init() -style_screen_btn_1_main_main_default.set_radius(10) -style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x33,0x33,0x33)) -style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_btn_1_main_main_default.set_bg_opa(255) -style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x33,0x33,0x33)) -style_screen_btn_1_main_main_default.set_border_width(0) -style_screen_btn_1_main_main_default.set_border_opa(255) -style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0x00,0x00)) + setting_cont_y = 0 setting_screen = lv.obj() @@ -44,8 +34,8 @@ setting_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) setting_imei_img = lv.img(setting_screen) -setting_imei_img.set_pos(4, 10) -setting_imei_img.set_size(232, 34) +setting_imei_img.set_pos((240-60)//2, 10) +setting_imei_img.set_size(60, 34) setting_imei_img.set_src("U:/static/setting/setting_text.png") setting_imei_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) # setting_title = lv.label(setting) @@ -169,7 +159,7 @@ setting_imei_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_imei_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) # create style style_screen_btn_1_main_main_default # add style for screen_btn_1 -setting_imei_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_imei_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_imei_img = lv.img(setting_cont) setting_imei_img.set_pos(8, setting_cont_y+6) @@ -185,7 +175,7 @@ setting_app_bg_img.set_pos(int(0),int(setting_cont_y)) setting_app_bg_img.set_size(230,78) setting_app_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_app_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_app_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_app_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) # setting_app_bg_img = lv.img(setting_cont) # setting_app_bg_img.set_pos(0, setting_cont_y) # setting_app_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) @@ -213,7 +203,7 @@ setting_bright_bg_img.set_pos(int(0),int(setting_cont_y)) setting_bright_bg_img.set_size(230,78) setting_bright_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_bright_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_bright_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_bright_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_bright_img = lv.img(setting_cont) setting_bright_img.set_pos(8, setting_cont_y+6) @@ -234,7 +224,7 @@ setting_volume_bg_img.set_pos(int(0),int(setting_cont_y)) setting_volume_bg_img.set_size(230,78) setting_volume_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_volume_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_volume_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_volume_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_volume_img = lv.img(setting_cont) setting_volume_img.set_pos(8, setting_cont_y+6) @@ -256,7 +246,7 @@ setting_restore_bg_img.set_pos(int(0),int(setting_cont_y)) setting_restore_bg_img.set_size(230,78) setting_restore_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_restore_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_restore_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_restore_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_restore_img = lv.img(setting_cont) setting_restore_img.set_pos(8, setting_cont_y+6) @@ -278,7 +268,7 @@ setting_poweroff_bg_img.set_pos(int(0),int(setting_cont_y)) setting_poweroff_bg_img.set_size(230,78) setting_poweroff_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_poweroff_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_poweroff_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_poweroff_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_poweroff_img = lv.img(setting_cont) setting_poweroff_img.set_pos(8, setting_cont_y+6) @@ -300,7 +290,7 @@ setting_version_bg_img.set_pos(int(0),int(setting_cont_y)) setting_version_bg_img.set_size(230,78) setting_version_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) setting_version_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -setting_version_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +setting_version_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) setting_version_img = lv.img(setting_cont) setting_version_img.set_pos(8, setting_cont_y+6) @@ -526,7 +516,7 @@ menustyle_img1_bg_img.set_pos(int(0),int(54)) menustyle_img1_bg_img.set_size(230,78) menustyle_img1_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) menustyle_img1_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -menustyle_img1_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +menustyle_img1_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) menustyle_btn1_label = lv.label(menustyle_img1_bg_img) @@ -559,7 +549,7 @@ menustyle_img2_bg_img.set_pos(int(0),int(139)) menustyle_img2_bg_img.set_size(230,78) menustyle_img2_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) menustyle_img2_bg_img.set_style_pad_all(0, lv.STATE.DEFAULT) -menustyle_img2_bg_img.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +menustyle_img2_bg_img.add_style(style_main_default_bg, lv.PART.MAIN|lv.STATE.DEFAULT) menustyle_btn1_label = lv.label(menustyle_img2_bg_img) menustyle_btn1_label.set_text("单页") @@ -1154,7 +1144,7 @@ poweroff_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) poweroff_confirm_img = lv.btn(poweroff_screen) -poweroff_confirm_img.set_pos(int(32),int(46)) +poweroff_confirm_img.set_pos(int(32),int(160)) poweroff_confirm_img.set_size(176,46) poweroff_confirm_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) screen_btn_1_label = lv.label(poweroff_confirm_img) @@ -1173,7 +1163,7 @@ style_screen_btn_1_main_main_default.set_border_color(lv.color_make(249,47,109)) style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) +style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1224,7 +1214,7 @@ style_screen_btn_1_main_main_default.set_border_color(lv.color_make(7,222,169)) style_screen_btn_1_main_main_default.set_border_width(0) style_screen_btn_1_main_main_default.set_border_opa(255) style_screen_btn_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_btn_1_main_main_default.set_text_font(lv.K01_font_16_ALL) +style_screen_btn_1_main_main_default.set_text_font(lv.lv_font_20_ALL) style_screen_btn_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) # add style for screen_btn_1 @@ -1310,7 +1300,7 @@ class PowerOnScreen(Screen): EventMesh.publish("set_UI_high_priority",1) self.count = 0 self.aud.setVolume(11) - temp = Power.getVbatt() + temp = EventMesh.publish("get_adc_battery") if temp > 3400:#低电播放音频会导致一直复位 self.aud.play(1, 1, 'U:/static/R_POWER_1.mp3') #播放来电铃声 # EventMesh.publish("set_motor_time",[1,2,8,8,4])#设置马达参数 @@ -1795,21 +1785,29 @@ brightness_add_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_label_time = lv.label(brightness_screen) brightness_label_time.set_pos(10, 140) -brightness_label_time.set_size(80, 30) +brightness_label_time.set_size(60, 30) brightness_label_time.set_text("时间:") brightness_label_time.set_long_mode(lv.label.LONG.WRAP) brightness_label_time.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) brightness_label_time.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -brightness_time_reduce_img = lv.img(brightness_screen) -brightness_time_reduce_img.set_pos(90, 135) -brightness_time_reduce_img.set_size(30, 34) -brightness_time_reduce_img.set_src("U:/static/time_up2.png") -brightness_time_reduce_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +brightness_time_reduce_img = lv.label(brightness_screen) +brightness_time_reduce_img.set_pos(int(90),int(135)) +brightness_time_reduce_img.set_size(30,34) +brightness_time_reduce_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +brightness_time_reduce_img.set_text("-") +brightness_time_reduce_img.set_long_mode(lv.label.LONG.DOT) +brightness_time_reduce_img.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +# brightness_time_reduce_img = lv.img(brightness_screen) +# brightness_time_reduce_img.set_pos(90, 135) +# brightness_time_reduce_img.set_size(30, 34) +# brightness_time_reduce_img.set_src("U:/static/time_up2.png") +# brightness_time_reduce_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_reduce_imgbtn= lv.img(brightness_screen) -brightness_time_reduce_imgbtn.set_size(80, 45) -brightness_time_reduce_imgbtn.set_pos(90, 130) +brightness_time_reduce_imgbtn.set_size(70, 45) +brightness_time_reduce_imgbtn.set_pos(100, 130) brightness_time_reduce_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) @@ -1821,11 +1819,18 @@ brightness_label_time_text.set_long_mode(lv.label.LONG.WRAP) brightness_label_time_text.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) brightness_label_time_text.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -brightness_time_add_img = lv.img(brightness_screen) -brightness_time_add_img.set_pos(190, 135) -brightness_time_add_img.set_size(30, 34) -brightness_time_add_img.set_src("U:/static/time_up1.png") -brightness_time_add_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +brightness_time_add_img = lv.label(brightness_screen) +brightness_time_add_img.set_pos(int(190),int(135)) +brightness_time_add_img.set_size(30,34) +brightness_time_add_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +brightness_time_add_img.set_text("+") +brightness_time_add_img.set_long_mode(lv.label.LONG.DOT) +brightness_time_add_img.add_style(countdown_screen_label_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) +# brightness_time_add_img = lv.img(brightness_screen) +# brightness_time_add_img.set_pos(190, 135) +# brightness_time_add_img.set_size(30, 34) +# brightness_time_add_img.set_src("U:/static/time_up1.png") +# brightness_time_add_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_add_imgbtn= lv.img(brightness_screen) brightness_time_add_imgbtn.set_size(70, 45) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py index 4f4e2cb6..0eb510bc 100644 --- a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py @@ -1216,8 +1216,9 @@ class voiceInCallScreen(Screen):#语音通话打入中 EventMesh.publish("set_UI_high_priority", 1) call_id = str(EventMesh.publish("get_vedio_call_id"))# + voice_call_name_label.set_text(self.meta_info) - voice_call_name_label.set_text(call_id) + # voice_call_name_label.set_text(call_id) def post_processor_after_initialization(self): @@ -1373,7 +1374,9 @@ class vedioCallingCallScreen(Screen):#视频通话打入中 EventMesh.publish("set_UI_high_priority", 1) call_id = str(EventMesh.publish("get_vedio_call_id"))# - vedio_call_name_label.set_text(call_id) + vedio_call_name_label.set_text(self.meta_info) + + # vedio_call_name_label.set_text(call_id) def post_processor_after_initialization(self): @@ -1588,7 +1591,7 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 if call_state != 5:#未接通 1分钟未接通挂断或者 接通后app 网络不好也主动手表挂断 self.time_count+=1 - if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 2 and self.answer != 1): + if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 5 and self.answer != 1): self.time_count = 0 self.timer1.stop() call_id = str(EventMesh.publish("get_vedio_call_id"))# @@ -1745,7 +1748,7 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 if call_state != 5: self.time_count+=1 - if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 2 and self.answer != 1): + if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 5 and self.answer != 1): self.time_count = 0 self.timer1.stop() call_id = str(EventMesh.publish("get_vedio_call_id"))# @@ -1807,7 +1810,7 @@ class videolistScreen(Screen): self.timer = osTimer() self.videolist_detail_list = None EventMesh.subscribe("video_updata_list_show", self.video_updata_list_show) - self.MXA_phone_num = 50 #最大显示号码个数 + self.MXA_phone_num = 20 #最大显示号码个数 self.videolist_detail_listt_dict = [] self.calling_btn = [] self.is_sliding = 0 @@ -1869,11 +1872,11 @@ class videolistScreen(Screen): # contact_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) contact_btn_label_1 = lv.label(contact_btn) - contact_btn_label_1.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + contact_btn_label_1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) contact_btn_label_2 = lv.label(contact_btn) # contact_btn_label_2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) contact_btn_label_3 = lv.label(contact_btn) - contact_btn_label_3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + # contact_btn_label_3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) self.videolist_detail_listt_dict.append({"contact_btn":contact_btn,"contact_btn_label_1":contact_btn_label_1,"contact_btn_label_2":contact_btn_label_2,"contact_btn_label_3":contact_btn_label_3}) self.meta = videolist_screen self.count = 0 @@ -1923,16 +1926,16 @@ class videolistScreen(Screen): #contact_btn = lv.btn(self.contact_detail_list) self.videolist_detail_listt_dict[i]["contact_btn"].set_size(LCD_SIZE_W,55) self.videolist_detail_listt_dict[i]["contact_btn"].set_pos(0,47*i ) - self.videolist_detail_listt_dict[i]["contact_btn"].set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) + self.videolist_detail_listt_dict[i]["contact_btn"].set_style_bg_color(lv.color_make(128, 128, 128), lv.PART.MAIN | lv.STATE.DEFAULT) # add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) # contact_btn.add_style(style_contact_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) # self.contact_detail_listt_dict[i]["contact_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), # lv.EVENT.SHORT_CLICKED, None) #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_pos(0, 10) 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_text(name) 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) @@ -1940,14 +1943,14 @@ class videolistScreen(Screen): #contact_btn_label_2 = lv.label(contact_btn) self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_pos(0, 0) self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_size(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_text(key_tmp[4:]) + self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_text(name) #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-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.DOT) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 0) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(0, 0) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_text(key_tmp[4:]) + # 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) @@ -1976,8 +1979,9 @@ class videolistScreen(Screen): elif code == lv.EVENT.SHORT_CLICKED: if msg == 1: if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡 - msg_text = e.get_target().get_child(1).get_text() - EventMesh.publish("load_screen", {"screen": "vedio_mode","meta":msg_text}) + name_text = e.get_target().get_child(1).get_text() + call_id = e.get_target().get_child(2).get_text() + EventMesh.publish("load_screen", {"screen": "vedio_mode","meta":[name_text,call_id]}) else: EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) @@ -2116,8 +2120,8 @@ class videoModeScreen(Screen):#通话模式选择 lv.EVENT.SHORT_CLICKED, None) if self.meta_info != None: - if len(str(self.meta_info)) != 0: - video_select_mode_name.set_text("{}".format(self.meta_info)) + if len(str(self.meta_info[0])) != 0: + video_select_mode_name.set_text("{}".format(self.meta_info[0])) else: video_select_mode_name.set_text(" ") else: @@ -2174,7 +2178,8 @@ class videoModeScreen(Screen):#通话模式选择 pass def calling(self,msg_text): - _msg = msg_text[0] + _msg = msg_text[0][0] + call_id = msg_text[0][1] mode = msg_text[1] print("calling",msg_text,_msg,mode) if mode == 1:#0是语音 1是视频通话 @@ -2182,9 +2187,9 @@ class videoModeScreen(Screen):#通话模式选择 else: EventMesh.publish("load_screen", {"screen": "voice_outcall","meta":_msg}) - EventMesh.publish("set_vedio_call_id", _msg)# + EventMesh.publish("set_vedio_call_id", call_id)# EventMesh.publish("set_vedio_call_type", mode)# - EventMesh.publish(constants.PROTOCOL.AGTALK_SEND,[mode,_msg]) + EventMesh.publish(constants.PROTOCOL.AGTALK_SEND,[mode,call_id]) def Close(self): self.timer.stop() @@ -2458,12 +2463,30 @@ class CALLING_ProtoCol(ProtoCol):#app发起视频通话 EventMesh.publish(constants.PROTOCOL.CALLING_SEND,1) else: EventMesh.publish(constants.PROTOCOL.CALLING_SEND,0) + videobook = EventMesh.publish("get_videobook_list") + datainfor = "" + if videobook != None: + check_json = videobook[0] + videobook_data = videobook[1] #视频通话列表 + phonebook_keys = [] + if videobook_data != {}: + phonebook_keys = sorted(videobook_data.keys()) + for i in range(len(phonebook_keys)): + id = phonebook_keys[i] + id_tmp = id[4:] + if str(id_tmp) == str(call_id): #在视频通话列表 + datainfor = videobook_data[id] + break + if len(datainfor) <= 0: + datainfor = str(call_id) + if int(call_type) == 1:#视频通话 - EventMesh.publish("load_screen", {"screen": "vedio_incall"}) + + EventMesh.publish("load_screen", {"screen": "vedio_incall","meta":str(datainfor)}) # EventMesh.publish("load_screen", {"screen": "vedio_incall","meta":"1"}) pass else: - EventMesh.publish("load_screen", {"screen": "voice_incall"}) + EventMesh.publish("load_screen", {"screen": "voice_incall","meta":str(datainfor)}) # EventMesh.publish("load_screen", {"screen": "vedio_incall","meta":"0"})#语音界面 pass diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk index e1b0119c..089fbb5f 100644 --- a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk @@ -65,4 +65,6 @@ CONFIG_LCD=y #CONFIG_LVGL_USE_FREETYPE=y #菊风视频通话 CONFIG_juphoon=y -PROJECT_NAME_G3_K01_font=y +LV_FONT_20_ALL=y +LV_FONT_70_BOLD=y + diff --git a/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png b/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png index 7aedfa6c..ca8444d4 100644 Binary files a/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png and b/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png index b175b0f4..3126d217 100644 Binary files a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png index 2464976f..aa3ab34b 100644 Binary files a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png b/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png index b6a3faec..e8ba0f12 100644 Binary files a/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png and b/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png differ