style_contact_btn = lv.style_t()
style_contact_btn.init()
style_contact_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff))
+style_contact_btn.set_radius(5)
style_contact_btn.set_border_width(0)
style_contact_btn.set_shadow_opa(0)
# lv.EVENT.PRESSING, None)
phone_call_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.call(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
phone_call_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.call(e)),
lv.EVENT.PRESSING, None)
# # phone_contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.contact(e)),
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
self.timer.stop()
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
+ def done_left_to_right(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
print("call_log_screen")
call_log_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
call_log_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
-
+ call_log_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
+ lv.EVENT.GESTURE, None)
+
call_log_cont_list_screen = lv.obj(call_log_screen)
call_log_cont_list_screen.set_pos(0, 50)
call_log_cont_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-50)
call_log_cont_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
call_log_cont_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
-
+ call_log_cont_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
+ lv.EVENT.GESTURE, None)
call_log_title = lv.label(call_log_screen)
call_log_title.set_pos(0, 10)
self.call_log_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-50+1)
self.call_log_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
self.call_log_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
+ self.call_log_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
+ lv.EVENT.GESTURE, None)
for i in range(self.CALL_LOG_MAX):
_btn = lv.btn(self.call_log_detail_list)
_btn.add_flag(lv.obj.FLAG.CLICKABLE)
_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
- lv.EVENT.CLICKED, None)
- _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
- lv.EVENT.PRESSING, None)
+ lv.EVENT.SHORT_CLICKED, None)
+ # _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
+ # lv.EVENT.PRESSING, None)
_btn.add_flag(lv.obj.FLAG.HIDDEN)
_btn_label2 = lv.label(_btn)
_btn_label3 = lv.label(_btn)
# print("num_count :{} num_name:{} num_time:{}".format(num_count,num_name,num_time))
#_btn = lv.btn(self.call_log_detail_list)
self.call_log_detail_list_dict[h]["_btn"].set_size(LCD_SIZE_W-10,CALL_LOG_LIST_SIZE)
- self.call_log_detail_list_dict[h]["_btn"].set_pos(0,(CALL_LOG_LIST_SIZE+4)*h)
+ self.call_log_detail_list_dict[h]["_btn"].set_pos(5,(CALL_LOG_LIST_SIZE+4)*h)
#self.call_log_detail_list_dict[h]["_btn"].add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT)
self.call_log_detail_list_dict[h]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
+ # self.call_log_detail_list_dict[h]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)),
+ # lv.EVENT.PRESSING, None)
#_btn_label2 = lv.label(_btn)
def calling(self,e):
code = e.get_code()
- if code == lv.EVENT.PRESSING:
- #print("PRESSING")
- self.is_sliding += 1
+ indev = lv.indev_get_act()
+ lv.indev_t.wait_release(indev)
+ dir = lv.indev_t.get_gesture_dir(indev)
+ if code == lv.EVENT.GESTURE:
+ if dir == lv.DIR.RIGHT:
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
self.is_sliding = 0
def done_return(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
+ def done_left_to_right(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT)
hangup_imgbtn.set_pos(80, 210)
hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
lv.EVENT.PRESSING, None)
self.meta = dialing_screen
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
screen_NAME = EventMesh.publish("get_screen_NAME")
if screen_NAME != None:
if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("return_prev_screen")
self.is_sliding =0
self.meta = no_sim_popup_screen
- def done_left_to_right(self):
- EventMesh.publish("return_prev_screen")
+
- def done_right_to_left(self):
+ def done_return(self):
EventMesh.publish("return_prev_screen")
- def done_bottom_to_top(self):
+
+ def btn1_release(self):
EventMesh.publish("return_prev_screen")
- def done_top_to_bottom(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
+ def done_bottom_to_top(self):
+ EventMesh.publish("return_prev_screen")
- def btn1_release(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
def btn8_press(self):
def Close(self):
self.timer.stop()
- def done_left_to_right(self):
+
+
+ def done_return(self):
EventMesh.publish("return_prev_screen")
- def done_right_to_left(self):
+ def btn1_release(self):
EventMesh.publish("return_prev_screen")
- def done_bottom_to_top(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
- def done_top_to_bottom(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
+ def done_bottom_to_top(self):
EventMesh.publish("return_prev_screen")
- def btn1_release(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
def btn8_press(self):
self.meta = no_sim_power_screen
no_sim_power_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
no_sim_power_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.cancel(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
no_sim_power_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),
lv.EVENT.PRESSING, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
self.meta = no_sim_auto_screen
no_sim_auto_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
no_sim_auto_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.cancel(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
no_sim_auto_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),
lv.EVENT.PRESSING, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
dialing_popup_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT)
dialing_popup_hangup_imgbtn.set_pos(80, 210)
dialing_popup_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
dialing_popup_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
lv.EVENT.PRESSING, None)
self.meta = dialing_popup_screen
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
EventMesh.publish("set_interrup_incall",0)
EventMesh.publish("set_UI_high_priority",0)
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("return_prev_screen")
self.is_sliding =0
EventMesh.publish("set_sos_info_call")
self.timer.stop()
- def done_left_to_right(self):
+
+
+ def done_return(self):
EventMesh.publish("return_prev_screen")
- def done_right_to_left(self):
+ def btn1_release(self):
EventMesh.publish("return_prev_screen")
- def done_bottom_to_top(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
- def done_top_to_bottom(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
+ def done_bottom_to_top(self):
EventMesh.publish("return_prev_screen")
- def btn1_release(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
def btn8_press(self):
def done_return(self):
EventMesh.publish("return_prev_screen")
- def done_left_to_right(self):
- EventMesh.publish("return_prev_screen")
+
def btn1_release(self):
EventMesh.publish("return_prev_screen")
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("return_prev_screen")
+
+
+ def done_return(self):
+ EventMesh.publish("return_prev_screen")
+ def done_click(self):
+ EventMesh.publish("load_screen", {"screen": "popup"})
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
- EventMesh.publish("return_prev_screen")
- def done_click(self):
- EventMesh.publish("load_screen", {"screen": "popup"})
-
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
-
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def Close(self):
self.timer.stop()
+
+
+ def done_return(self):
+ EventMesh.publish("return_prev_screen")
+ def done_click(self):
+ EventMesh.publish("load_screen", {"screen": "popup"})
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
- EventMesh.publish("return_prev_screen")
- def done_click(self):
- EventMesh.publish("load_screen", {"screen": "popup"})
-
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
-
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
message_full_screen = None
message_full_cancel.set_ext_click_area(20)
self.meta = message_full_screen
- message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.CLICKED, None)
- message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.CLICKED, None)
+ message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None)
+ message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None)
message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.PRESSING, None)
message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.PRESSING, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
def concel(self, e):
EventMesh.publish("return_prev_screen")
+
+
+ def done_return(self):
+ EventMesh.publish("return_prev_screen")
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
- def done_return(self):
- EventMesh.publish("return_prev_screen")
-
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
-
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
############短信###############################
print("msg_list_screen")
msg_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
msg_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
-
+ msg_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
+ lv.EVENT.GESTURE, None)
msg_top_title = lv.label(msg_list_screen)
self.sms_detail_list.set_size(LCD_SIZE_W-10, LCD_SIZE_H-50+1)
self.sms_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
self.sms_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
+ self.sms_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
+ lv.EVENT.GESTURE, None)
for i in range(MSG_MAX):
msg_btn = lv.btn(self.sms_detail_list)
msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
- lv.EVENT.CLICKED, None)
- msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
- lv.EVENT.PRESSING, None)
+ lv.EVENT.SHORT_CLICKED, None)
+ # msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
+ # lv.EVENT.PRESSING, None)
msg_btn.add_flag(lv.obj.FLAG.HIDDEN)
_btn_label2 = lv.label(msg_btn)
_btn_label3 = lv.label(msg_btn)
if tmp != -1:
#msg_btn = lv.btn(self.sms_detail_list)
self.sms_detail_list_dict[i]["msg_btn"].set_size(LCD_SIZE_W-10,SMS_LIST_ONE_ICON)
- self.sms_detail_list_dict[i]["msg_btn"].set_pos(0,(SMS_LIST_ONE_ICON+4)*count)
+ self.sms_detail_list_dict[i]["msg_btn"].set_pos(5,(SMS_LIST_ONE_ICON+4)*count)
#self.sms_detail_list_dict[i]["msg_btn"].add_style(style_sms_bg_btn, lv.PART.MAIN | lv.STATE.DEFAULT)
# self.sms_detail_list_dict[i]["msg_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)),
# lv.EVENT.CLICKED, None)
def sms_cb(self, e):
code = e.get_code()
- if code == lv.EVENT.PRESSING:
- #print("PRESSING")
- self.is_sliding += 1
+ indev = lv.indev_get_act()
+ lv.indev_t.wait_release(indev)
+ dir = lv.indev_t.get_gesture_dir(indev)
+ if code == lv.EVENT.GESTURE:
+ if dir == lv.DIR.RIGHT:
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ elif code == lv.EVENT.SHORT_CLICKED:
+ _name = e.get_target().get_child(0).get_text()
+ EventMesh.publish("save_msg_name", _name)
+ content = e.get_target().get_child(1).get_text()
+ EventMesh.publish("save_msg_content", content)
+ EventMesh.publish("load_screen", {"screen": "msg_detail"})
+
- elif code == lv.EVENT.CLICKED:
- #utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- self.is_sliding = 0
- _name = e.get_target().get_child(0).get_text()
- EventMesh.publish("save_msg_name", _name)
- content = e.get_target().get_child(1).get_text()
- EventMesh.publish("save_msg_content", content)
- EventMesh.publish("load_screen", {"screen": "msg_detail"})
- self.is_sliding =0
def done_DOWN(self):#下滑
if self.sms_detail_list != None:
scroll_y = self.sms_detail_list.get_scroll_y()
self.sms_detail_list.scroll_to_y(scroll_y+SMS_LIST_ONE_ICON,lv.ANIM.ON)
pass
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ # def done_left_to_right(self):
+ # EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def post_processor_after_initialization(self):
pass
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "popup"})
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "popup"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ def done_left_to_right(self):
+ EventMesh.publish("load_screen", {"screen": "popup"})
+
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "popup"})
self.timer = osTimer()
self.point = 0
self.heart_value = 0
- self.is_sliding =0
+ self.is_sliding = 0
+ EventMesh.subscribe("show_history_hr_data",self.show_history_hr_data)
def initialization(self):
self.is_sliding =0
self.meta = heartrate_screen
heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
lv.EVENT.PRESSING, None)
heartrate_done_label.set_text(" ")
heartrate_bpm_label.set_text("-- bpm")
heartrate_start_label.set_text("正在测量中.")
- EventMesh.publish("set_hr_state",1)#1代表手动进入测试界面
+ # EventMesh.publish("set_hr_state",1)#1代表手动进入测试界面
- EventMesh.publish(constants.EVENT.START_HEART)
+ # EventMesh.publish(constants.EVENT.START_HEART)
def post_processor_after_initialization(self):
self.point = 0
self.is_sliding = 0
self.heart_value = 0
- self.show_history_data()
+ EventMesh.publish("show_history_hr_data")
+ # self.show_history_data()
self.start_init()
def restart_up(self,e):
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
EventMesh.publish(constants.EVENT.START_HEART)
- def show_history_data(self):
+ def show_history_hr_data(self,event,msg):
global hr_line1,hr_line2,hr_line3,hr_line4,hr_line5,hr_line6,hr_line7
read_data = {}
read_data = EventMesh.publish("get_history_hr_value")
# heartrate_done_label.set_text("测量完成")
else:
heartrate_bpm_label.set_text("-- bpm")
- self.show_history_data()
+
self.point = 0
EventMesh.publish("set_hr_state",0)#0代表关闭测试
print("stop debug9")
def done_return(self):
EventMesh.publish("load_screen", {"screen": "health"})
+
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "health"})
+
def done_left_to_right(self):
self.timer.stop()
get_hr_state = EventMesh.publish("get_hr_state")
EventMesh.publish("set_hr_state",0)#0代表关闭测试
print("stop debug10")
EventMesh.publish(constants.EVENT.STOP_HEART)
- EventMesh.publish("load_screen", {"screen": "health"})
+ EventMesh.publish("return_prev_screen")
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "health"})
-
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
toolbox_stopwatch_img.set_src("E:/static/tool/IMAGE_SECMENU_STOPWATCH.png")
toolbox_stopwatch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT)
- toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.CLICKED, None)
- toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.CLICKED, None)
- toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.CLICKED, None)
- # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.CLICKED, None)
- toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.CLICKED, None)
- toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.CLICKED, None)
+ toolbox_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "void")), lv.EVENT.GESTURE, None)
- toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.PRESSING, None)
- toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.PRESSING, None)
- toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.PRESSING, None)
+ toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.SHORT_CLICKED, None)
+ toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.SHORT_CLICKED, None)
+ toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None)
# toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.CLICKED, None)
- toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.PRESSING, None)
- toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.PRESSING, None)
+ toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None)
+ toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None)
+
+ # toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.PRESSING, None)
+ # toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.PRESSING, None)
+ # toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.PRESSING, None)
+ # # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.CLICKED, None)
+ # toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.PRESSING, None)
+ # toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.PRESSING, None)
self.meta = toolbox_screen
def tool_cb(self,e,msg):
code = e.get_code()
- if code == lv.EVENT.PRESSING:
- #print("PRESSING")
- self.is_sliding += 1
+ indev = lv.indev_get_act()
+ lv.indev_t.wait_release(indev)
+ dir = lv.indev_t.get_gesture_dir(indev)
+ if code == lv.EVENT.GESTURE:
+ if dir == lv.DIR.RIGHT:
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ elif code == lv.EVENT.SHORT_CLICKED:
+ EventMesh.publish("load_screen", {"screen": "{}".format(msg)})
- elif code == lv.EVENT.CLICKED:
- #utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- self.is_sliding = 0
- EventMesh.publish("load_screen", {"screen": "{}".format(msg)})
-
- self.is_sliding =0
def done_DOWN(self):#下滑
scroll_y = toolbox_cont.get_scroll_y()
print("scroll_y:{}".format(scroll_y))
toolbox_cont.scroll_to_y(scroll_y+TOOL_ICON_OFFSET_SIZE,lv.ANIM.ON)
pass
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
-
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
incoming_call_hangup.set_src("E:/static/hang_up.png")
incoming_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
incoming_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
incoming_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)),
lv.EVENT.PRESSING, None)
incoming_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
screen_NAME = EventMesh.publish("get_screen_NAME")
if screen_NAME != None:
if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("return_prev_screen")
self.is_sliding =0
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.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
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_btn.set_size(60, 50)
on_call_volum_add_btn.set_text(" ")
on_call_volum_add_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
on_call_volum_add_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)),
lv.EVENT.PRESSING, None)
on_call_volum_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0)
on_call_volum_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
on_call_volum_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.open_volum_show(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
on_call_volum_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.open_volum_show(e)),
lv.EVENT.PRESSING, None)
on_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT)
on_call_hangup.set_src("E:/static/hang_up.png")
on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)),
lv.EVENT.PRESSING, None)
on_call_tab_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0)
on_call_tab_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT)
on_call_tab_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_call_tab_show(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
on_call_tab_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_call_tab_show(e)),
lv.EVENT.PRESSING, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
screen_NAME = EventMesh.publish("get_screen_NAME")
if screen_NAME != None:
if screen_NAME != "dialing_noplay_popup":
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("return_prev_screen")
self.is_sliding =0
def Close(self):
self.timer.stop()
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "toolbox"})
+
+ # EventMesh.publish("load_screen", {"screen": "toolbox"})
# def done_return(self):
# EventMesh.publish("load_screen", {"screen": "toolbox"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "toolbox"})
-
+
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
no_connect_label.set_text("找不到服务器")
no_connect_label1.set_text("请联网后重试")
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "toolbox"})
+
# def done_return(self):
# EventMesh.publish("load_screen", {"screen": "toolbox"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "toolbox"})
+
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
def btn8_press(self):
EventMesh.publish("watch_top_show")
print("contacts_screen")
contacts_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
contacts_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
-
+ contacts_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)),
+ lv.EVENT.GESTURE, None)
+
contacts_screen_list_screen = lv.obj(contacts_screen)
contacts_screen_list_screen.set_pos(0, 50)
contacts_screen_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-50)
self.contact_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-50+1)
self.contact_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
self.contact_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
+ self.contact_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)),
+ lv.EVENT.GESTURE, None)
for i in range(self.MXA_phone_num):
contact_btn = lv.btn(self.contact_detail_list)
contact_btn.add_flag(lv.obj.FLAG.CLICKABLE)
contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)),
- lv.EVENT.CLICKED, None)
- contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)),
- lv.EVENT.PRESSING, None)
+ lv.EVENT.SHORT_CLICKED, None)
+ # contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)),
+ # lv.EVENT.PRESSING, None)
contact_btn.add_flag(lv.obj.FLAG.HIDDEN)
contact_btn_label_1 = lv.label(contact_btn)
if contacts_screen == None:
return
#读取json文件中的键作为label文本;
-
+ self.check_json = True
+
if self.check_json == True and len(self.phonebook) != 0:
+
self.contact_detail_list.clear_flag(lv.obj.FLAG.HIDDEN)
contact_none_label.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本
j =0
name = self.phonebook[phonebook_keys[j]]
key_tmp =phonebook_keys[j]
- print("name :{} key_tmp:{}".format(name,key_tmp))
+
+ # print("name :{} key_tmp:{}".format(name,key_tmp))
#contact_btn = lv.btn(self.contact_detail_list)
self.contact_detail_listt_dict[i]["contact_btn"].set_size(LCD_SIZE_W-10,CONTACTS_LIST_SIZE)
- self.contact_detail_listt_dict[i]["contact_btn"].set_pos(0,(CONTACTS_LIST_SIZE+6)*i )
+ self.contact_detail_listt_dict[i]["contact_btn"].set_pos(5,(CONTACTS_LIST_SIZE+6)*i )
#self.contact_detail_listt_dict[i]["contact_btn"].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)),
def calling_cb(self,e):
code = e.get_code()
- if code == lv.EVENT.PRESSING:
- #print("PRESSING")
- self.is_sliding += 1
+ indev = lv.indev_get_act()
+ lv.indev_t.wait_release(indev)
+ dir = lv.indev_t.get_gesture_dir(indev)
+ if code == lv.EVENT.GESTURE:
+ if dir == lv.DIR.RIGHT:
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
- elif code == lv.EVENT.CLICKED:
- #utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机
- msg_text = e.get_target().get_child(1).get_text()
- EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text})
- else:
- EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"})
+ elif code == lv.EVENT.SHORT_CLICKED:
+ if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机
+ msg_text = e.get_target().get_child(1).get_text()
+ EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text})
+ else:
+ EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"})
- self.is_sliding =0
def calling(self,msg_text):
self.contact_detail_list.scroll_to_y(scroll_y+CONTACTS_LIST_SIZE,lv.ANIM.ON)
pass
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
+ def done_left_to_right(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
self.point = 0
self.temp_value = 0
self.is_sliding =0
-
+ EventMesh.subscribe("show_history_temp_data",self.show_history_temp_data)
def initialization(self):
self.is_sliding =0
global temperature_screen,temperature_keep_label,temperature_label,temp_reset_btn_img,temp_line1,temp_line2,temp_line3,temp_line4,temp_line5,\
self.meta = temperature_screen
temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
lv.EVENT.PRESSING, None)
size_x = len(str("- -"))*14
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
temperature_start_label.set_text("正在测量中.")
EventMesh.publish("set_temp_state",1)
EventMesh.publish(constants.EVENT.START_TEMP)
- self.show_history_data()
+ EventMesh.publish("show_history_temp_data")
self.timer.start(1*500, 1, self.start_measure)
self.is_sliding =0
temperature_start_label.set_text("正在测量中.")
EventMesh.publish("set_temp_state",1)
EventMesh.publish(constants.EVENT.START_TEMP)
- self.show_history_data()
+ EventMesh.publish("show_history_temp_data")
self.timer.start(1*500, 1, self.start_measure)
- def show_history_data(self):
+ def show_history_temp_data(self,event,msg):
global temp_line1,temp_line2,temp_line3,temp_line4,temp_line5,temp_line6,temp_line7
read_data = {}
read_data = EventMesh.publish("get_history_temp_value")
else:
temperature_done_img.set_src("E:/static/temp_gif03.png")
temp_reset_btn_img.clear_flag(lv.obj.FLAG.HIDDEN)
-
- self.show_history_data()
-
self.point = 0
EventMesh.publish("set_temp_state",0)
EventMesh.publish("set_temp_state",0)
EventMesh.publish(constants.EVENT.STOP_TEMP)
- def done_left_to_right(self):
- self.timer.stop()
- EventMesh.publish("set_temp_state",0)
- EventMesh.publish(constants.EVENT.STOP_TEMP)
- EventMesh.publish("load_screen", {"screen": "health"})
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "health"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "health"})
-
+
+ def done_left_to_right(self):
+ self.timer.stop()
+ EventMesh.publish("set_temp_state",0)
+ EventMesh.publish(constants.EVENT.STOP_TEMP)
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
self.point = 0
self.spo2_value = 0
self.is_sliding = 0
+ EventMesh.subscribe("show_history_spo2_data",self.show_history_spo2_data)
+
#self.Hsensor = None
def initialization(self):
self.is_sliding = 0
self.meta = spo2_screen
spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)),
lv.EVENT.PRESSING, None)
self.point = 0
self.is_sliding= 0
self.spo2_value = 0
- self.show_history_data()
+ EventMesh.publish("show_history_spo2_data")
self.start_init()
def restart_up(self,e):
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
EventMesh.publish("set_spo2_state",1)#2代表后台进入血氧测试
EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)
- def show_history_data(self):
+ def show_history_spo2_data(self,event,msg):
global spo2_line1,spo2_line2,spo2_line3,spo2_line4,spo2_line5,spo2_line6,spo2_line7
read_data = {}
read_data = EventMesh.publish("get_history_spo2_value")
spo2_value_label.set_text("- -%")
- self.show_history_data()
+ # self.show_history_data()
self.point = 0
EventMesh.publish("set_spo2_state",0)#0代表关闭测试
def done_return(self):
EventMesh.publish("load_screen", {"screen": "health"})
+
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "health"})
+
def done_left_to_right(self):
self.timer.stop()
get_hr_state = EventMesh.publish("get_hr_state")
if get_hr_state == 1 or get_spo2_state == 1:
EventMesh.publish("set_spo2_state",0)#0代表关闭测试
EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
- EventMesh.publish("load_screen", {"screen": "health"})
+ EventMesh.publish("return_prev_screen")
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "health"})
-
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
countdown_hour_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hour_down(e)),
lv.EVENT.CLICKED, None)
countdown_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
countdown_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reset(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
countdown_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)),
lv.EVENT.PRESSING, None)
countdown_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reset(e)),
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
if self.g_end == 1:
EventMesh.publish("load_screen", {"screen": "countdown"})
else:
- EventMesh.publish("load_screen", {"screen": "toolbox"})
+ EventMesh.publish("return_prev_screen")
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "toolbox"})
+
def btn1_release(self):
if self.g_state == 0:
self.timer.stop()
EventMesh.publish("load_screen", {"screen": "toolbox"})
+
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
def btn8_press(self):
if self.g_state == 0:
def Close(self):
self.stop_FIND()
- def done_left_to_right(self):
+
+
+ def done_return(self):
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
- def done_right_to_left(self):
+ def done_click(self):
+ print("count down !!!!!!!!!!")
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
- def done_bottom_to_top(self):
+ def done_left_to_right(self):
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
- def done_top_to_bottom(self):
+ def done_right_to_left(self):
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
- def done_return(self):
+ def done_bottom_to_top(self):
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
- def done_click(self):
- print("count down !!!!!!!!!!")
+ def done_top_to_bottom(self):
self.stop_FIND()
EventMesh.publish("load_screen", {"screen": "countdown"})
self.timer.stop()
EventMesh.publish("load_screen", {"screen": "toolbox"})
- def done_left_to_right(self):
- if self.s_state == 0:
- self.timer.stop()
- EventMesh.publish("load_screen", {"screen": "toolbox"})
+
def btn1_release(self):
if self.s_state == 0:
self.timer.stop()
EventMesh.publish("load_screen", {"screen": "toolbox"})
-
+
+ def done_left_to_right(self):
+ if self.s_state == 0:
+ self.timer.stop()
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
if self.s_state == 0:
self.timer.stop()
self.FIND_timer.stop()
self.aud.stop() #播放声音
- def done_left_to_right(self):
- self.stop_FIND()
-
- def done_right_to_left(self):
- self.stop_FIND()
- def done_bottom_to_top(self):
- self.stop_FIND()
-
- def done_top_to_bottom(self):
- self.stop_FIND()
+
def done_return(self):
self.stop_FIND()
def btn1_release(self):
self.stop_FIND()
+ def done_left_to_right(self):
+ self.stop_FIND()
+
+ def done_right_to_left(self):
+ self.stop_FIND()
+ def done_bottom_to_top(self):
+ self.stop_FIND()
+ def done_top_to_bottom(self):
+ self.stop_FIND()
+
def btn8_press(self):
self.stop_FIND()
Lowpower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT)
self.meta = Lowpower_screen
+
+ def done_return(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+ def done_click(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ def btn1_release(self):
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
def done_left_to_right(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def done_right_to_left(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def done_top_to_bottom(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_return(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_click(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
-
- def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
def btn8_press(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def fun(self,e):
EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"})
- def done_left_to_right(self):
+
+
+ def done_return(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_right_to_left(self):
+ def done_click(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_bottom_to_top(self):
+ def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_top_to_bottom(self):
+ def done_left_to_right(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_return(self):
+ def done_right_to_left(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def done_click(self):
+ def done_bottom_to_top(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
- def btn1_release(self):
+ def done_top_to_bottom(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def btn8_press(self):
self.meta = sos_screen
sos_screen_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_comfirm_cb(e)),
- lv.EVENT.CLICKED, None)
+ lv.EVENT.SHORT_CLICKED, None)
sos_screen_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_cancel_cb(e)),
lv.EVENT.CLICKED, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
def Close(self):
self.timer.stop()
- def done_left_to_right(self):
- EventMesh.publish("return_prev_screen")
- pass
- def done_right_to_left(self):
- EventMesh.publish("return_prev_screen")
- pass
- def done_bottom_to_top(self):
- EventMesh.publish("return_prev_screen")
- pass
- def done_top_to_bottom(self):
- EventMesh.publish("return_prev_screen")
- pass
+
def done_return(self):
EventMesh.publish("return_prev_screen")
pass
def btn1_press(self):
EventMesh.publish("return_prev_screen")
pass
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+ pass
+ def done_right_to_left(self):
+ EventMesh.publish("return_prev_screen")
+ pass
+ def done_bottom_to_top(self):
+ EventMesh.publish("return_prev_screen")
+ pass
+ def done_top_to_bottom(self):
+ EventMesh.publish("return_prev_screen")
+ pass
+
def btn1_release(self):
EventMesh.publish("return_prev_screen")
pass
EventMesh.publish("return_prev_screen")
- def done_left_to_right(self):
+
+ def done_return(self):
EventMesh.publish("return_prev_screen")
pass
- def done_right_to_left(self):
+ def done_click(self):
EventMesh.publish("return_prev_screen")
pass
- def done_bottom_to_top(self):
- EventMesh.publish("return_prev_screen")
+
+ def btn8_press(self):
+
pass
- def done_top_to_bottom(self):
+ def btn1_press(self):
EventMesh.publish("return_prev_screen")
pass
- def done_return(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
pass
- def done_click(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
pass
-
- def btn8_press(self):
-
+ def done_bottom_to_top(self):
+ EventMesh.publish("return_prev_screen")
pass
- def btn1_press(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
pass
+
def btn1_release(self):
EventMesh.publish("return_prev_screen")
pass
EventMesh.publish("return_prev_screen")
- def done_left_to_right(self):
+
+ def done_return(self):
EventMesh.publish("return_prev_screen")
pass
- def done_right_to_left(self):
+ def done_click(self):
EventMesh.publish("return_prev_screen")
pass
- def done_bottom_to_top(self):
+
+ def btn8_press(self):
EventMesh.publish("return_prev_screen")
pass
- def done_top_to_bottom(self):
+ def btn1_press(self):
EventMesh.publish("return_prev_screen")
pass
- def done_return(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
pass
- def done_click(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
pass
-
- def btn8_press(self):
+ def done_bottom_to_top(self):
EventMesh.publish("return_prev_screen")
pass
- def btn1_press(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
pass
+
def btn1_release(self):
EventMesh.publish("return_prev_screen")
pass
EventMesh.publish("return_prev_screen")
- def done_left_to_right(self):
+
+ def done_return(self):
EventMesh.publish("return_prev_screen")
pass
- def done_right_to_left(self):
+ def done_click(self):
EventMesh.publish("return_prev_screen")
pass
- def done_bottom_to_top(self):
+
+ def btn8_press(self):
EventMesh.publish("return_prev_screen")
pass
- def done_top_to_bottom(self):
+ def btn1_press(self):
EventMesh.publish("return_prev_screen")
pass
- def done_return(self):
+ def done_left_to_right(self):
EventMesh.publish("return_prev_screen")
pass
- def done_click(self):
+ def done_right_to_left(self):
EventMesh.publish("return_prev_screen")
pass
-
- def btn8_press(self):
+ def done_bottom_to_top(self):
EventMesh.publish("return_prev_screen")
pass
- def btn1_press(self):
+ def done_top_to_bottom(self):
EventMesh.publish("return_prev_screen")
pass
+
def btn1_release(self):
EventMesh.publish("return_prev_screen")
pass
self.screen_list = []
self.lv = lv
self.system_sleep_timer = osTimer()
+ self.system_ui_timer = osTimer()
self.system_sleep_timer_count = 0
self.sleep_flag = 1
self.level = 6
self.aud = audio.Audio(0)
-
+ self.system_ui_state = 0
self.main_flag = 0
self.main_id = 0
self.set_interrup_flag = 0
return
self.system_sleep_timeout_rest()
#print("ui press {}".format(event))
- if event == "done_left_to_right":
- self.screen.done_left_to_right()
- if event == "done_right_to_left":
- self.screen.done_right_to_left()
- if event == "done_bottom_to_top":
- self.screen.done_bottom_to_top()
- if event == "done_top_to_bottom":
- self.screen.done_top_to_bottom()
+ if self.system_ui_state == 0:
+ if event == "done_left_to_right":
+ self.screen.done_left_to_right()
+ if event == "done_right_to_left":
+ self.screen.done_right_to_left()
+ if event == "done_bottom_to_top":
+ self.screen.done_bottom_to_top()
+ if event == "done_top_to_bottom":
+ self.screen.done_top_to_bottom()
if event == "done_return":
self.screen.done_return()
if event == "done_click":
if self.system_sleep_timer_count >= time :
self.system_sleep_timer_count = 0
self.__lcd_off()
+
+ def system_ui_flag(self, *args):
+ self.system_ui_state = 0
+
def system_sleep_timeout_rest(self) :
#print("system_sleep_timeout_rest")
self.__lcd_on()
mem = gc.mem_free()
print('2剩余内存RAM:{} KB'.format(mem / 1024))
-
+ self.system_ui_state = 1
+ self.system_ui_timer.start(100, 0, self.system_ui_flag)
print("setting_screen")
setting_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT)
+
setting_imei_img = lv.img(setting_screen)
setting_imei_img.set_pos(4, 10)
setting_imei_img.set_size(232, 34)
self.is_sliding =0
super().__init__()
self.meta = setting_screen
-
+ setting_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.setting_cb(e,"void")), lv.EVENT.GESTURE, None)
# img regist btton
# setting_language.add_event_cb(lambda e: self.load_screen(e, {"screen": "language"}), lv.EVENT.CLICKED, None)
- setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.CLICKED, None)
- setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.CLICKED, None)
- setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.CLICKED, None)
- setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.CLICKED, None)
- setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.CLICKED, None)
- setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.CLICKED, None)
- setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.CLICKED, None)
- setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.CLICKED, None)
+ setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.SHORT_CLICKED, None)
+ setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.SHORT_CLICKED, None)
+ setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.SHORT_CLICKED, None)
+ setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.SHORT_CLICKED, None)
+ setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.SHORT_CLICKED, None)
+ setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.SHORT_CLICKED, None)
+ setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.SHORT_CLICKED, None)
+ setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.SHORT_CLICKED, None)
# setting_update_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "update")), lv.EVENT.CLICKED, None)
- setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.CLICKED, None)
-
- setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.PRESSING, None)
- setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.PRESSING, None)
- setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.PRESSING, None)
- setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.PRESSING, None)
- setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.PRESSING, None)
- setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.PRESSING, None)
- setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.PRESSING, None)
- setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.PRESSING, None)
- # setting_update_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "update")), lv.EVENT.PRESSING, None)
- setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.PRESSING, None)
+ setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.SHORT_CLICKED, None)
+
+ # setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.PRESSING, None)
+ # setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.PRESSING, None)
+ # setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.PRESSING, None)
+ # setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.PRESSING, None)
+ # setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.PRESSING, None)
+ # setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.PRESSING, None)
+ # setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.PRESSING, None)
+ # setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.PRESSING, None)
+ # # setting_update_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "update")), lv.EVENT.PRESSING, None)
+ # setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.PRESSING, None)
def initialization(self):
self.is_sliding = 0
def setting_cb(self,e,msg):
code = e.get_code()
- if code == lv.EVENT.PRESSING:
- #print("PRESSING")
+ indev = lv.indev_get_act()
+ lv.indev_t.wait_release(indev)
+ dir = lv.indev_t.get_gesture_dir(indev)
+ if code == lv.EVENT.GESTURE:
+ if dir == lv.DIR.RIGHT:
+ EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+ elif code == lv.EVENT.PRESSING:
+ print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
+ EventMesh.publish("load_screen", {"screen": "{}".format(msg)})
#utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- self.is_sliding = 0
- EventMesh.publish("load_screen", {"screen": "{}".format(msg)})
+ # print("1self.is_sliding",self.is_sliding)
+ # if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
+ # self.is_sliding = 0
+ # if msg != "void":
+ # EventMesh.publish("load_screen", {"screen": "{}".format(msg)})
- self.is_sliding =0
+ # self.is_sliding =0
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+
def btn1_release(self):
EventMesh.publish("return_setiing")
EventMesh.publish("load_screen", {"screen": "main_menu"})
-
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
self.is_sliding = 0
super().__init__()
self.meta = restore_screen
- restore_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.CLICKED, None)
+ restore_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None)
restore_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.PRESSING, None)
- restore_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.CLICKED, None)
+ restore_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None)
restore_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.PRESSING, None)
def initialization(self):
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
def done_return(self):
EventMesh.publish("load_screen", {"screen": "setting"})
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
-
+
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
def done_return(self):
EventMesh.publish("load_screen", {"screen": "setting"})
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
super().__init__()
self.is_sliding = 0
self.meta = poweroff_screen
- poweroff_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.CLICKED, None)
- poweroff_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.CLICKED, None)
+ poweroff_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None)
+ poweroff_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None)
poweroff_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.PRESSING, None)
poweroff_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.PRESSING, None)
#print("PRESSING")
self.is_sliding += 1
- elif code == lv.EVENT.CLICKED:
+ elif code == lv.EVENT.SHORT_CLICKED:
#utime.sleep_ms(10)
print("1self.is_sliding",self.is_sliding)
if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
#EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"})
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def concel(self, e):
EventMesh.publish("load_screen", {"screen": "setting"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
def __init__(self):
super().__init__()
- self.is_sliding = 0
self.meta = menustyle_screen
+ self.is_sliding1 = 0
+ self.is_sliding2 = 0
menustyle_img1_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun1(e)),
lv.EVENT.CLICKED, None)
menustyle_img2_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun2(e)),
lv.EVENT.PRESSING, None)
+
def initialization(self):
- self.is_sliding = 0
+ self.is_sliding1 = 0
+ self.is_sliding2 = 0
read_data = EventMesh.publish("get_storage_config","MainMenu")
if read_data != None:
if read_data == "1":
code = e.get_code()
if code == lv.EVENT.PRESSING:
#print("PRESSING")
- self.is_sliding += 1
+ self.is_sliding1 += 1
elif code == lv.EVENT.CLICKED:
#utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- self.is_sliding = 0
+ print("1self.is_sliding",self.is_sliding1)
+ if self.is_sliding1 <= 5 and self.is_sliding1 != 0:#如果是在滑动中则不需要点击事件
+ self.is_sliding1 = 0
menustyle_select.set_pos(int(190),int(80))
# menustyle_img1.set_src("E:/static/theme_four2.png")
# menustyle_img2.set_src("E:/static/theme_single1.png")
EventMesh.publish("set_mainmenu",[1])
EventMesh.publish("load_screen", {"screen": "main_menu"})
- self.is_sliding =0
+ self.is_sliding1 =0
def fun2(self,e):
code = e.get_code()
if code == lv.EVENT.PRESSING:
#print("PRESSING")
- self.is_sliding += 1
+ self.is_sliding2 += 1
elif code == lv.EVENT.CLICKED:
#utime.sleep_ms(10)
- print("1self.is_sliding",self.is_sliding)
- if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件
- self.is_sliding = 0
+ print("2self.is_sliding",self.is_sliding2)
+ if self.is_sliding2 <= 5 and self.is_sliding2 != 0:#如果是在滑动中则不需要点击事件
+ self.is_sliding2 = 0
menustyle_select.set_pos(int(190),int(165))
# menustyle_img1.set_src("E:/static/theme_four1.png")
# menustyle_img2.set_src("E:/static/theme_single2.png")
EventMesh.publish("set_mainmenu",[2])
EventMesh.publish("load_screen", {"screen": "main_menu"})
- self.is_sliding = 0
-
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+ self.is_sliding2 = 0
def done_return(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("load_screen", {"screen": "setting"})
def btn1_release(self):
- EventMesh.publish("load_screen", {"screen": "main_menu"})
+ EventMesh.publish("load_screen", {"screen": "setting"})
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
+
+
+
# -------------------------------------------imei screen----------------------------------------------------------
imei_screen = lv.obj()
print("imei_screen")
self.meta = imei_screen
def initialization(self):
-
+ print("rrrrrrr1")
imei = EventMesh.publish(constants.EVENT.GET_IMEI)
imei_qr_data = str(imei)
imei_qr.update(imei_qr_data,len(imei_qr_data))
EventMesh.publish("load_screen", {"screen": "setting"})
def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+ EventMesh.publish("return_prev_screen")
def btn8_press(self):
EventMesh.publish("watch_top_show")
imei = EventMesh.publish(constants.EVENT.GET_IMEI)
app_label.set_text(imei)
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "setting"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
-
+
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
brightness_bar.set_value((100 // 10) * self.level, lv.ANIM.OFF)
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "setting"})
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})
self.aud.stop()
EventMesh.publish("load_screen", {"screen": "setting"})
- def done_left_to_right(self):
- EventMesh.publish("load_screen", {"screen": "setting"})
+
def btn1_release(self):
EventMesh.publish("load_screen", {"screen": "setting"})
+ def done_left_to_right(self):
+ EventMesh.publish("return_prev_screen")
+
def btn8_press(self):
EventMesh.publish("watch_top_show")
EventMesh.publish("load_screen", {"screen": "main_menu"})