示例#1
0
  def __init__(self):
    self.first_call = True
    self.useFMBTDevice = True
    try:
      self.d = fmbtandroid.Device()
      self.d.refreshScreenshot().save(SCREENSHOT)
      self.screensize = self.__getimgsize(SCREENSHOT)
      self.d.setScreenshotLimit(10)
      self.d.setScreenshotArchiveMethod("remove")
    except:
      self.useFMBTDevice = False

    # When asking server to match the template being selected set to true
    self.livematching = False

    self.templates = ['template 1', 'template 2', 'template 3', 'template 4']
    self.id  = 0
    self.img = self.__loadimage("./screenshot1.png", True)
    self.img2 = self.__loadimage("./screenshot2.png", True)
    self.resultimg = self.__loadimage("./machinevision-result.png", True)

    self.position   = RobotCoord(x=152,y=385,z=0.9,alfa=0)
示例#2
0
import time
import fmbtandroid
import sys
import os

if len(sys.argv) > 1:
	serial = sys.argv[1]
	dut = fmbtandroid.Device(serial) 
	print("Device            = " + serial)
	if (serial) == "BUC4C16727006201":
		print("HUAWEI is connected, related scripts will be executed")
		execfile(r'C:\TestStand AIVI\fMBT\Huawei\LoadContacts.py')
		
	if (dut.serialNumber) == "04cdda6a00747559":
		print("Nexus is connected, related scripts will be executed")
		execfile(r'C:\TestStand AIVI\fMBT\Nexus_5\LoadContacts.py')

else:
	print("No serial specified, First One will be connected !") 
	dut = fmbtandroid.Device()
	print("Device            = " + dut.serialNumber)
	
	if (dut.serialNumber) == "BUC4C16727006201":
		print("HUAWEI is connected, related scripts will be executed")
		execfile(r'C:\TestStand AIVI\fMBT\Huawei\LoadContacts.py')

	if (dut.serialNumber) == "04cdda6a00747559":
		print("Nexus is connected, related scripts will be executed")
		execfile(r'C:\TestStand AIVI\fMBT\Nexus_5\LoadContacts.py')