Beispiel #1
0
# create an appium instance
print 'Launching Calibration App'
driver = appium.Appium('Appium.RobotCalibration', argv[1])
driver.start()

# lower the pen until the ios device is touched
current_point = starting_position
screen_center = None
print 'Entering Calibration Loop'
while current_point <= 80 and screen_center == None:
    current_point += 1
    # exit if we did not touch the ios device
    if current_point > 80:
        raise Exception("Could not contact the iOS device")
    bot.move(current_point, current_point, current_point)
    screen_center = get_coords()

    contact_point = bot.forward_k(current_point, current_point, current_point)
    if contact_point[0] is not 0:
        raise Exception('Could not detect contact point')
    contact_point = (contact_point[1], contact_point[2], contact_point[3])

    origin_point = bot.forward_k(starting_position, starting_position, starting_position)
    if origin_point[0] is not 0:
        raise Exception('Could not detect origin point')
    origin_point = (origin_point[1], origin_point[2], origin_point[3])

# add a mapping to the screen center
mappings.append((screen_center, (bot.a.angle, bot.b.angle, bot.c.angle)))
Beispiel #2
0
# create an appium instance
print 'Launching Calibration App'
driver = appium.Appium('Appium.RobotCalibration', argv[1])
driver.start()

# lower the pen until the ios device is touched
current_point = starting_position
screen_center = None
print 'Entering Calibration Loop'
while current_point <= 80 and screen_center == None:
    current_point += 1
    # exit if we did not touch the ios device
    if current_point > 80:
        raise Exception("Could not contact the iOS device")
    bot.move(current_point, current_point, current_point)
    screen_center = get_coords()

    contact_point = bot.forward_k(current_point, current_point, current_point)
    if contact_point[0] is not 0:
        raise Exception('Could not detect contact point')
    contact_point = (contact_point[1], contact_point[2], contact_point[3])

    origin_point = bot.forward_k(starting_position, starting_position,
                                 starting_position)
    if origin_point[0] is not 0:
        raise Exception('Could not detect origin point')
    origin_point = (origin_point[1], origin_point[2], origin_point[3])

# add a mapping to the screen center
mappings.append((screen_center, (bot.a.angle, bot.b.angle, bot.c.angle)))