def serialThread(pUtool): time.sleep(1) if pyutil.func_isSerialOpen(): pUtool.showLog('尝试打开之前设置的串口') else: pUtool.showLog('未设置串口号,或串口被占用,\n串口号可在设备管理器中查看') time.sleep(2.0) pyutil.func_sendCMD('t') taskobj = TimeObj() times = taskobj.times while True: time.sleep(0.005) nowtime = int(time.time()*1000) if len(times) > 0 and times[0] <= nowtime: if nowtime - times[0] > 60: #一分钟前已点击,这里直接认为时间为无效 ptime = times.pop(0) taskobj.timedict.pop(ptime) print('time is passed:%s'%(timetool.getNowDate(ptime/1000))) else: touchdat = taskobj.timedict.pop(times.pop(0)) key = touchdat['key'] tmpcount = touchdat['times'] delay = touchdat['delay'] while tmpcount > 0: pyutil.func_sendCMD(key) if delay > 0: time.sleep(delay/1000.0) else: time.sleep(0.005) tmpcount -= 1 elif len(times) < 1: taskobj.initTimer() times = taskobj.times time.sleep(1.0) print('init times again')
def serialThread(pUtool): time.sleep(1) if pyutil.func_isSerialOpen(): pUtool.showLog('尝试打开之前设置的串口') else: pUtool.showLog('未设置串口号,或串口被占用,\n串口号可在设备管理器中查看') while True: time.sleep(1.0) if pUtool.isTestCom: pyutil.func_sendCMD('t')
def touchOK(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('b') self.showLog('touch Jok')
def touch10(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('a') self.showLog('touch J10')
def touch10(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('a') self.log.set("正在发送10")
def touchOK(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('b') self.log.set("正在发送ok")
def touch8(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('8') self.log.set("正在发送8")
def touch2(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('2') self.log.set("正在发送2")
def touch6(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('6') self.log.set("正在发送6")
def touch7(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('7') self.log.set("正在发送7")
def touch5(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('5') self.log.set("正在发送5")
def touch4(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('4') self.log.set("正在发送4")
def touch3(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('3') self.log.set("正在发送3")
def touch1(self): # 在鼠标焦点处插入输入内容 # t.insert('insert', var) pyutil.func_sendCMD('1') self.showLog('touch J1')
def touch9(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('9') self.log.set("正在发送9")
def touch4(self): # 在文本框内容最后接着插入输入内容 pyutil.func_sendCMD('4') self.showLog('touch J4')
def touch1(self): # 在鼠标焦点处插入输入内容 # t.insert('insert', var) pyutil.func_sendCMD('1') self.log.set("正在发送1")