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)
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()
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")
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)
# 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)
# 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()
# 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)
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)
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)
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)
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)
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)
self.not_talk_cb()
def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据
-
+ self.play_end = 0
self.play_flag = 1
self.AI_label_answer = ""
AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) #
pass
def initialization(self):
+ self.play_end = 0
self.play_flag = 1
self.TTS_PRO_TYPE = 0
AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN)
else:
pass
def _1S_timer_cb(self,*argc):
- EventMesh.publish("system_sleep_rest")#防止黑屏
+ if (self.play_end == 1 and EventMesh.publish("get_audio_state") == 0 ) or self.play_flag == 0: #字符串为0 或者暂停需要自动熄屏
+ # print("self.play_end!!!!!\r\n")
+ pass
+ else:
+ EventMesh.publish("system_sleep_rest")#防止黑屏
if self.scroll_timer_count > 0:
self.scroll_timer_count-=1
#定时器
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:
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"})
#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()
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)
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)
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)
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)
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 :
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)
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()
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)
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)
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):
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()
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")
# 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()
try:
app.append_manager(getStorageDataManager())
app.append_manager(motorEventManager())
+ app.append_manager(mgr.DeviceInfoManager())
except Exception as e:
usys.print_exception(e)
try:
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())
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()) \
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()
elif args[0] == 16:
print('voicecall holding, PhoneNO.: ', args[6])
-
+from misc import ADC
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)
#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)
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
self.max_temp = msg[6]
self.city = msg[7]
self.no_data = msg[8]
+ EventMesh.publish("updata_weather_show")
class getHrTimeManager(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):#正常连击
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):#普通闹钟
"""
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()
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()
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()
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
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:
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"})
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
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
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
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
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)
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
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)
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)
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)
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)
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)
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)
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)
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(" ")
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(" ")
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)
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):
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()
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"
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()
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)
# 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("--")
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))#天气类型
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("请联网后重试")
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"
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)
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)
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)
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)
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)
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)
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)
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)#不加延时会切屏
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):
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
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
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
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})
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)
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]
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
#日期
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)
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()
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
# # # #支付宝
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)
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)
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)
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)
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)
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)
# 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)
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)
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)
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#
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":
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})
# 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()
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")
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"})
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)
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"})
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"})
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":
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":
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
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()
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)
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)
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)
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)
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)
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)
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)
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)
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)
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("单页")
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)
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
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
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])#设置马达参数
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)
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)
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):
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):
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"))#
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"))#
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
# 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
#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)
#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)
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"})
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:
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是视频通话
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()
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
#CONFIG_LVGL_USE_FREETYPE=y
#菊风视频通话
CONFIG_juphoon=y
-PROJECT_NAME_G3_K01_font=y
+LV_FONT_20_ALL=y
+LV_FONT_70_BOLD=y
+