def draw12():
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPJUMPXYZMode,
                                 xArr[0] - xOS,
                                 y2DArr[0][1] - yOS[0],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPMOVLXYZMode,
                                 xArr[1] + xOS,
                                 y2DArr[1][2] + yOS[0],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPJUMPXYZMode,
                                 xArr[0] - xOS,
                                 y2DArr[0][2] + yOS[0],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPMOVLXYZMode,
                                 xArr[1] + xOS,
                                 y2DArr[1][1] - yOS[0],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     goHome()
 def draw20():
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPJUMPXYZMode,
                                 xArr[2] - xOS,
                                 y2DArr[2][2] - yOS[2],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPMOVLXYZMode,
                                 xArr[3] + xOS,
                                 y2DArr[3][3] + yOS[2],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPJUMPXYZMode,
                                 xArr[2] - xOS,
                                 y2DArr[2][3] + yOS[2],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPMOVLXYZMode,
                                 xArr[3] + xOS,
                                 y2DArr[3][2] - yOS[2],
                                 zCoor,
                                 0,
                                 isQueued=1)[0]
     goHome()
Exemple #3
0
def work():
    dType.SetQueuedCmdClear(api)
    init()
    offset=0;offset1=0
    print(waittime2)
    for i in range(0, 10):
        print(i)
        if i % 4 == 0:
            offset = 0;offset1=-50
        elif i % 4 == 1:
            offset = 0;offset1=0
        elif i % 4 == 2:
            offset = 20;offset1=0
        elif i % 4 == 3:
            offset = 0;offset1=0

        lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode,postion[0]+offset1,postion[1],postion[2]-offset,postion[3])[0]  # 移动

        dType.SetWAITCmd(api, waittime2)
        dType.SetQueuedCmdStartExec(api)

    # Wait for Executing Last Command
    while lastIndex > dType.GetQueuedCmdCurrentIndex(api)[0]:
        dType.dSleep(200)

    #Stop to Execute Command Queued
    dType.SetQueuedCmdStopExec(api)
    dType.SetQueuedCmdClear(api)
 def goHome():
     lastIndex = dType.SetPTPCmd(api,
                                 dType.PTPMode.PTPJUMPXYZMode,
                                 172,
                                 -120,
                                 50,
                                 0,
                                 isQueued=1)[0]
Exemple #5
0
def moveForward(offset=0):
    """
    default offset = 0 means above the phone screen
    when offset = -70, it means moveBackward, (to let the camera get the image)
    """
    dType.SetQueuedCmdClear(api)
    init()
    last_index = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode,
                                 postion[0] + offset, postion[1], postion[2],
                                 postion[3])[0]  # 移动
    dType.SetQueuedCmdStartExec(api)

    while last_index > dType.GetQueuedCmdCurrentIndex(api)[0]:
        dType.dSleep(0)
    dType.SetQueuedCmdStopExec(api)
    dType.SetQueuedCmdClear(api)
Exemple #6
0
def press_screen(press_time):
    dType.SetQueuedCmdClear(api)
    init() if press_time > 450 else init(coordinate=9000)
    waiting_time = press_time * 0.001

    for i in range(0, 2):
        offset = 20 if i % 2 == 0 else 0
        last_index = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode,
                                     postion[0], postion[1],
                                     postion[2] - offset, postion[3])[0]
        dType.SetWAITCmd(api, waiting_time)
        dType.SetQueuedCmdStartExec(api)

    while last_index > dType.GetQueuedCmdCurrentIndex(api)[0]:
        dType.dSleep(0)
    dType.SetQueuedCmdStopExec(api)
    dType.SetQueuedCmdClear(api)
Exemple #7
0
def move(p):
    return dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode, p[0], p[1], p[2],
                           0, 1)[0]