示例#1
0
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')
示例#2
0
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')
示例#3
0
 def touchOK(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('b')
     self.showLog('touch Jok')
示例#4
0
 def touch10(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('a')
     self.showLog('touch J10')
示例#5
0
 def touch10(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('a')
     self.log.set("正在发送10")
示例#6
0
 def touchOK(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('b')
     self.log.set("正在发送ok")
示例#7
0
 def touch8(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('8')
     self.log.set("正在发送8")
示例#8
0
 def touch2(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('2')
     self.log.set("正在发送2")
示例#9
0
 def touch6(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('6')
     self.log.set("正在发送6")
示例#10
0
 def touch7(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('7')
     self.log.set("正在发送7")
示例#11
0
 def touch5(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('5')
     self.log.set("正在发送5")
示例#12
0
 def touch4(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('4')
     self.log.set("正在发送4")
示例#13
0
 def touch3(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('3')
     self.log.set("正在发送3")
示例#14
0
 def touch1(self):  # 在鼠标焦点处插入输入内容
     # t.insert('insert', var)
     pyutil.func_sendCMD('1')
     self.showLog('touch J1')
示例#15
0
 def touch9(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('9')
     self.log.set("正在发送9")
示例#16
0
 def touch4(self):  # 在文本框内容最后接着插入输入内容
     pyutil.func_sendCMD('4')
     self.showLog('touch J4')
示例#17
0
 def touch1(self):  # 在鼠标焦点处插入输入内容
     # t.insert('insert', var)
     pyutil.func_sendCMD('1')
     self.log.set("正在发送1")