self.motor_mode = 0#模式
_thread.start_new_thread(self.motorInfo_queue_thread, ())
EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo)
+ EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
+ EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
pass
def motorInfo_queue_thread(self):
EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0})
def post_processor_after_instantiation(self):
- EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
- EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
+ pass
# msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数
def set_motor_time(self,event,msg):
- open_power = EventMesh.publish("get_power_on_state")#获取开机标识
- if open_power != None:
- if open_power == 0:
- return
+ # open_power = EventMesh.publish("get_power_on_state")#获取开机标识
+ # if open_power != None:
+ # if open_power == 0:
+ # return
if msg != None:
self.motor_enable = msg[0]
if self.motor_enable == 1: #马达使能
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
if self.motor_mode == 1:#
+
if self.motor_total_time > 0:
self.motor_total_time-=1
if self.motor_total_time > 0:
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
elif self.motor_mode == 2:#
+ # print("motor_fun_cb:{}\r\n".format(self.motor_total_time))
# print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time)
if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3
+ # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time))
open_motor()
else:
close_motor()
self.press_state = 0
self.refresh_count = 0
self.refresh_texttimer.stop()
- if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0 or EventMesh.publish("get_sim_Status") != 1:#网络不正常
+ signal = EventMesh.publish("screen_get_sig")
+ if signal == None or signal == 0 or signal == 99:
AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN)
AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) #
AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示
+ al_no_sim_popup_screen_title3.set_text("请先开启移动数据")
+
+ elif signal == -1 or EventMesh.publish("get_sim_Status") != 1:#网络不正常
+ AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN)
+ AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
+ AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
+ AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
+ AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
+ AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) #
+ AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示
+ al_no_sim_popup_screen_title3.set_text("无SIM卡")
else:
AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏
AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏
ui.add_screen(_ui_setting.PowerOnScreen())
ui.add_screen(_ui.DialingScreen())
ui.add_screen(_ui.CallLogScreen())
-
- except Exception as e:
- usys.print_exception(e)
- try:
- from appAlipay import Alipay ,AlipayOpenScreen,Alipay_1_1,Alipay_invite,Alipay_inviting,\
- Alipay_success,Alipay_paycode,Alipay_pay_success,Alipay_collect,Alipay_parent
- from appFactoryMode import FactoryModeAlipayInitScreen
- ui.add_screen(AlipayOpenScreen())
- ui.add_screen(Alipay_1_1())
- ui.add_screen(Alipay_invite())
- ui.add_screen(Alipay_inviting())
- ui.add_screen(Alipay_success())
- ui.add_screen(Alipay_paycode())
- ui.add_screen(Alipay_pay_success())
- ui.add_screen(Alipay_collect())
- ui.add_screen(Alipay_parent())
- ui.add_screen(FactoryModeAlipayInitScreen())
+
except Exception as e:
usys.print_exception(e)
+
+
try:
ui.add_screen(_ui.UIFINDScreen())
ui.add_screen(_ui.MsgDetailScreen())
#print("init10:{}".format(utime.localtime()))
-
+
+ try:
+ from appAlipay import Alipay ,AlipayOpenScreen,Alipay_1_1,Alipay_invite,Alipay_inviting,\
+ Alipay_success,Alipay_paycode,Alipay_pay_success,Alipay_collect,Alipay_parent
+ from appFactoryMode import FactoryModeAlipayInitScreen
+ ui.add_screen(AlipayOpenScreen())
+ ui.add_screen(Alipay_1_1())
+ ui.add_screen(Alipay_invite())
+ ui.add_screen(Alipay_inviting())
+ ui.add_screen(Alipay_success())
+ ui.add_screen(Alipay_paycode())
+ ui.add_screen(Alipay_pay_success())
+ ui.add_screen(Alipay_collect())
+ ui.add_screen(Alipay_parent())
+ ui.add_screen(FactoryModeAlipayInitScreen())
+ except Exception as e:
+ usys.print_exception(e)
EventMesh.publish("load_screen", {"screen": "poweron"})#开机画面
+
app.append_manager(mgr.AlarmVolumeLevelManager()) \
.append_manager(mgr.MsgVolumeLevelManager()) \
.append_manager(mgr.PhoneVolumeLevelManager()) \
self.motor_mode = 0#模式
_thread.start_new_thread(self.motorInfo_queue_thread, ())
EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo)
+ EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
+ EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
pass
def motorInfo_queue_thread(self):
EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0})
def post_processor_after_instantiation(self):
- EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
- EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
+ pass
# msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数
def set_motor_time(self,event,msg):
- open_power = EventMesh.publish("get_power_on_state")#获取开机标识
- if open_power != None:
- if open_power == 0:
- return
+ # open_power = EventMesh.publish("get_power_on_state")#获取开机标识
+ # if open_power != None:
+ # if open_power == 0:
+ # return
if msg != None:
self.motor_enable = msg[0]
if self.motor_enable == 1: #马达使能
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
if self.motor_mode == 1:#
+
if self.motor_total_time > 0:
self.motor_total_time-=1
if self.motor_total_time > 0:
EventMesh.publish("close_motor_infor")#关闭马达和定时器
return
elif self.motor_mode == 2:#
+ # print("motor_fun_cb:{}\r\n".format(self.motor_total_time))
# print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time)
if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3
+ # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time))
open_motor()
else:
close_motor()
def send(self, event, msg):
#[XT*334588000000156*LEN*FALLDOWN]
- send_data = EventMesh.publish("get_new_pid")+"*%s*0008*HELP,%d"%(self.imei,msg)
+ send_data = EventMesh.publish("get_new_pid")+"*%s*0004*HELP,%d"%(self.imei,msg)
MD5_SIGN = self.pack_MD5_head(send_data)
data = "[%s%s]"%(str(MD5_SIGN),send_data)
#Wechat_log("POWEROFF_ProtoCol:send:%s"%(data))
self.system_sleep_timer_count += 1
if self.system_sleep_timer_count >= time :
self.system_sleep_timer_count = 0
+ screen_NAME = EventMesh.publish("get_screen_NAME")
+ if screen_NAME != None:
+ if screen_NAME == "poweron":
+ return
self.__lcd_off()
def system_ui_flag(self, *args):
self.aud.stop()
if self.screen_old != None :
- EventMesh.publish("close_motor_infor")#设置参数切换界面时关闭马达振动
+ if scr.NAME != "poweron":
+ EventMesh.publish("close_motor_infor")#设置参数切换界面时关闭马达振动
self.screen_old.Close() #先关闭上一次界面
self.lv.img.cache_invalidate_src(None) #清img cache
self.lv.img.cache_set_size(16) #开img cache
EventMesh.publish("set_UI_high_priority",1)
self.count = 0
self.aud.setVolume(11)
+ temp = Power.getVbatt()
+ if temp > 3400:#低电播放音频会导致一直复位
+ self.aud.play(1, 1, 'E:/static/R_POWER_1.mp3') #播放来电铃声
# EventMesh.publish("set_motor_time",[1,2,8,8,4])#设置马达参数
- self.timer.start(1000,1,self.fun)
- self.timer1.start(3000,0,self.fun_motor)
- self.timer2.start(13000,0,self.to_main_page_fun)
+ EventMesh.publish("set_motor_time",[1,2,8*1,8,4])#设置马达参数
+ # self.timer.start(1000,1,self.fun)
+ # self.timer1.start(3000,0,self.fun_motor)
+ EventMesh.publish("system_sleep_rest")#防止黑屏
+ self.timer2.start(15000,0,self.to_main_page_fun)
pass
- def fun(self,*data):
+ def fun(self,*data):
EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb,"data":0})
def fun_cb(self,data):
EventMesh.publish("system_sleep_rest")#防止黑屏
- if self.flag == 1:
- # self.timer.stop()
- return
- EventMesh.publish("system_sleep_rest")#防止黑屏
- print("power fun!!!!!!! {}\r\n".format(self.count))
- if self.count == 0:
- temp = Power.getVbatt()
- if temp > 3400:#低电播放音频会导致一直复位
- self.aud.play(1, 1, 'E:/static/R_POWER_1.mp3') #播放来电铃声
- else:
-
- if self.count >= 9:#在上一个界面在播放音频时切换界面则关闭 以免一直播放
- self.count = 0
- self.flag = 1
- # self.timer.stop()
- return
- self.count+=1
+
def to_main_page_fun(self,*argc):
EventMesh.publish("set_UI_high_priority",0)
EventMesh.publish("load_screen", {"screen": "main_menu"})
def fun_motor(self,*argc):
+ print("fun_motor!!!!!!!\r\n")
EventMesh.publish("set_motor_time",[1,2,8*1,8,4])#设置马达参数
def Close(self):