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