def __askForTrader(): '''获得交易资源(ZXRIS 8801)''' if PARAM["tradeReaderType"] == "zxris8801": sc = askForResource('CpuCardTrader', CpuCardTrader.CpuCardTrader) elif PARAM["tradeReaderType"] == "shhicgs25": sc = askForResource('ShhicGS25Trader', ShhicGS25Trader.ShhicGS25) return sc
def finalFun(product): __askForPlateDeviceCom(product.productSlot).asynSend("PowerOffObu") global finishedTestSlots finishedTestSlots += 1 if finishedTestSlots == len(PARAM["productSlots"].split(",")): finishedTestSlots = 0 askForResource("BoardFreqIOController", BoardFreqIOController).stopTesting()
def __getNuLink(slot): '''获得ICP下载工具''' return askForResource("GS11NuLink-slot%s" % slot, GS11NuLink, linkId=PARAM["linkId-slot%s" % slot], nulinkCfg0Value=PARAM["nulinkCfg0Value"], nulinkCfg1Value=PARAM["nulinkCfg1Value"])
def switchMode(mode="VER"): # 切换串口模式:VER为版本下载,CPC为读取CPCID和SN io = askForResource("longgangIO", LonggangIOBoardDevice, impl=IOInputProcessor(), ioBoardCom=PARAM["ioBoardCom"]) global currentBaud, ser ser.close() if mode == "VER": #版本下载,采用115200波特率 # if currentBaud != 115200: # currentBaud = 115200 # ser.close() # ser = serial.Serial(PARAM["downloadBoardCom"], baudrate = currentBaud , bytesize=8, parity='N', stopbits=1, xonxoff=0,timeout=2) # ser.setDTR(True) for i in range(5): io[i] = False time.sleep(1) elif mode == "CPC": # if currentBaud != 9600: # currentBaud = 9600 # ser.close() # ser = serial.Serial(PARAM["downloadBoardCom"], baudrate = currentBaud , bytesize=8, parity='N', stopbits=1, xonxoff=0,timeout=2) # ser.setDTR(False) ser.setRTS(False) for i in range(5): io[i] = True time.sleep(1.8) ser.open()
def __askForPlateDeviceCom(): '''获得工装板资源''' sc = askForResource('GS10PlateDevice', GS10PlateDevice.GS10PlateDevice, serialPortName=PARAM["gs10PlateDeviceCom"], cableComsuption=PARAM["cableComsuption"]) return sc
def __getVNA(): # 获得矢量网络分析仪 return askForResource( "VectorNetworkAnalyzerForHrDivider", VectorNetworkAnalyzerForHrDivider, vectorNetworkAnalyzerIp=PARAM["vectorNetworkAnalyzerIp"], vectorNetworkAnalyzerPort=PARAM["vectorNetworkAnalyzerPort"])
def getIVB(): # 获取集成工装板工具 return askForResource( "IntegratedVATBoard", IntegratedVATBoard, integratedVatBoardIp=PARAM["integratedVatBoardIp"], integratedVatBoardPort=PARAM["integratedVatBoardPort"])
def __askForPlateDeviceCom(): '''获得工装板资源''' sc = askForResource('RD50CPlateDevice', RD50CDownloadNetMyd.GS10PlateDevice, serialPortName=PARAM["defaultCOMPort"], cableComsuption=1) return sc
def __init__(self): AbstractAutoTrigger.__init__(self) from hhplt.deviceresource import askForResource self.vdb = askForResource( "VersionDownloadIOController", ObuVersionDownloadBoard, downloadBoardSerialPort=PARAM["downloadBoardSerialPort"]) self.isStarted = False
def setup(product): iob = askForResource("BoardFreqIOController", BoardFreqIOController) if iob.currentState != BoardFreqIOController.STATE_TESTING: iob.startTesting() r = __askForPlateDeviceCom(product.productSlot).sendAndGet("PowerOnObu") if r == 'PowerOnObuFail': raise AbortTestException(message=u'上电电流过大,请立即抬起夹具,测试终止。') time.sleep(1)
def __init__(self): AbstractAutoTrigger.__init__(self) self.readerDevice = askForResource( "GS15ReaderDevice", GS15ReaderDevice, readerIp=PARAM["gs15ReaderIp"], readerPort=PARAM["gs15ReaderPort"], accessPassword=PARAM["gs15accessPassword"]) self.nowTid = None self.nowEpc = None
def autoScanThread(): barScannerDriverCls = None if PARAM["barScannerType"] == 'mindeo': barScannerDriverCls = AutoBarScanner.MindeoAutoBarScanner elif PARAM["barScannerType"] == 'keyence': barScannerDriverCls = AutoBarScanner.KeyenceAutoBarScanner sc = askForResource('AutoBarScanner', barScannerDriverCls, barScannerCom=PARAM["barScannerCom"]) barCode = sc.scan() if barCode is not None: self.emit(SIGNAL("AUTO_SCANNER_RESULT(QString)"), barCode)
def __askForTrader(): '''获得交易资源(ZXRIS 8801)''' sc = askForResource('ShhicGS25Trader', ShhicGS25Trader.ShhicGS25) return sc
def __getRsu(): return askForResource("CpcIssuer", CpcTraderIssuer)
def __getLaserCaving(): #获得镭雕机资源 return askForResource("DHLaserCarvingMachine", DaHengLaserCarvingMachine.DHLaserCarvingMachine)
def __getIoBoard(): '''获得IO板资源''' return askForResource( "GS11IOBoardDevice", GS11IOBoardDevice.GS11IOBoardDevice, )
def __getVideoCapture(): '''获得摄像头抓拍工具''' return askForResource( "VideoCaptureAndParser", VideoCaptureAndParser.VideoCaptureAndParser, )
def __getSpecAnlzr(): # 获得频谱仪,用于读功率 return askForResource("SpectrumAnalyzerForHrReader", SpectrumAnalyzerForHrReader, spectrumAnalyzerIp=PARAM["spectrumAnalyzerIp"], spectrumAnalyzerPort=PARAM["spectrumAnalyzerPort"])
def __getRD52ReaderDevice(): return askForResource("RD52ReaderDevice", RD52ReaderDevice, ipaddr=PARAM["rd52_ipaddr"], post=PARAM["rd52_post"])
def __getPDCtrl(): # 获得功分器测试工装板资源 return askForResource("PowerDividerCtrl",PowerDividerCtrl, powerDividerCtrlCom=PARAM["powerDividerCtrlCom"])
def __init__(self): AbstractAutoTrigger.__init__(self) self.iodevice = askForResource("BoardDigitIOController", BoardDigitIOController) #启动IO板卡
def __getIO(): return askForResource("CheckerIOController", CheckerIOController)
def __getReader(): return askForResource("GS15ReaderDevice")
def __getIoBoard(): return askForResource( "GS10IOBoardDevice", GS10IOBoardDevice.GS10IOBoardDevice, ) #启动IO板卡
def __getSerialToolingBoard(): return askForResource("SerialToolingBoard", SerialToolingBoard, port=PARAM["downloadBoardCom"])
def __getReader(): # RD201驱动 return askForResource("RD201", RD201Driver, readerCom=PARAM["RD201SerialPort"])
def __getNuLink(): '''获得ICP下载工具''' return askForResource( "GS11NuLink", GS11NuLink.GS11NuLink, )
def __askForTrader(): '''获得交易资源(ZXRIS 8801)''' sc = askForResource('CpuCardTrader', CpuCardTrader.CpuCardTrader) return sc
def __getGs25(): return askForResource("gs25", GS25Device, issueCom=PARAM["issueCom"]).gs25
failWeightSum = 10 #整体不通过权值,当失败权值和超过此,判定测试不通过 import time from hhplt.parameters import SESSION, PARAM from hhplt.testengine.parallelTestSynAnnotation import syntest, serialSuite from hhplt.deviceresource import askForResource, GS10PlateDevice from hhplt.testengine.exceptions import TestItemFailException, AbortTestException from hhplt.testengine.server import serverParam as SP, serialCode, ServerBusiness from hhplt.testengine.testutil import multipleTestCase from hhplt.testengine.testcase import uiLog from hhplt.productsuite.gs11sh.BoardIOController import BoardFreqIOControllerAutoTrigger, BoardFreqIOController import util __askForPlateDeviceCom = lambda slot: askForResource( 'GS10PlateDevice-slot%s' % slot, GS10PlateDevice.GS10PlateDevice, serialPortName=PARAM["gs10PlateDeviceCom-slot%s" % slot], cableComsuption=PARAM["cableComsuption"]) autoTrigger = BoardFreqIOControllerAutoTrigger finishedTestSlots = 0 @serialSuite def setup(product): iob = askForResource("BoardFreqIOController", BoardFreqIOController) if iob.currentState != BoardFreqIOController.STATE_TESTING: iob.startTesting() r = __askForPlateDeviceCom(product.productSlot).sendAndGet("PowerOnObu") if r == 'PowerOnObuFail':