def setup(product): '''准备函数,同射频相同,读取MAC地址并设置''' SESSION["autoTrigger"].pause() closeAsynMessage() iob = __getIoBoard() if iob.checkClampState() == True: #OBU未插到位 raise AbortTestException(message=u'OBU未插入到位,请检查硬件') iob.releaseDemolishButton() #合上防拆下电按键,使其上电 time.sleep(1) #return uiLog(u"正在读取产品标识...") sc = __askForPlateDeviceCom() try: try: macBytes = sc.read_obu_id(VAT_VERSION_FILE) except Exception, e: if "BSL password error" in e.message: #如果因密码不对读取不到MAC地址,证明版本不是测试版本,且已经被擦除,重新下载测试版本 uiLog(u"OBU中非测试版本,正在下载测试版本...") sc.downloadVersion(version_file=VAT_VERSION_FILE) macBytes = sc.read_obu_id(VAT_VERSION_FILE) else: raise e mac = "".join(["%.2X" % i for i in macBytes]) product.setTestingProductIdCode(mac) uiLog(u"测试产品标识:" + mac) if not SESSION["isMend"]: __checkBoardFinished(mac) iob.pressDemolishButton() time.sleep(0.5) iob.releaseDemolishButton() #合上防拆下电按键,使其上电 time.sleep(0.5)
def setup(product): '''初始化''' #检查夹具动作,如果夹具没合上,则合上夹具 iob = __getIoBoard() iob.closeClap() iob.releaseDemolishButton() board_digital.setup(product) SESSION["autoTrigger"].pause() closeAsynMessage()
def setup(product): '''初始化函数''' SESSION["isMend"] = True iob = __getIoBoard() iob.closeClap() iob.releaseDemolishButton() board_digital.setup(product) SESSION["autoTrigger"].pause() closeAsynMessage()
def setup(product): '''检查工装板电流,如果范围不对,终止测试''' SESSION["autoTrigger"].pause() closeAsynMessage() #如果测试项中没有扫描条码,则直接合夹具上电 if u'扫描条码' not in SESSION["seletedTestItemNameList"]: __closeClapFinallyAndStartTest(product) iob = __getIoBoard() try: iob.releaseDemolishButton() except AbortTestException, e: iob.openClap() raise e
def T_02_testVerisonDownload_A(product): u'''测试版本下载-下载测试版本,自动判断是否下载成功''' from hhplt.testengine.manul import showAsynMessage, closeAsynMessage showAsynMessage(u"异步消息", u"这是个异步消息,3秒后自动关闭") time.sleep(3) closeAsynMessage()
def setup(product): '''准备函数,可空''' print u"这里做准备工作" manul.closeAsynMessage() pass
def setup(product): '''准备函数,可空''' print u"这里做准备工作" #print "slot="+product.productSlot manul.closeAsynMessage() pass
time.sleep(2) try: v = sc.testDeepStaticCurrent() resultMap = {u"深度静态电流": v} if v < SP('gs10.deepStaticCurrent.low', 0) or v > SP( 'gs10.deepStaticCurrent.high', 3): raise TestItemFailException(failWeight=10, message=u'深度静态电流测试不通过,正常阈值0-3', output=resultMap) return resultMap except TestItemFailException, e: raise e except: raise TestItemFailException(failWeight=10, message=u'深度静态电流测试失败') finally: closeAsynMessage() sc.assertSynComm(request='OpenObuUart', response='OpenObuUartOK') #def T_07_disturbOn14k_M(product): # u'''5.8G芯片上电14k干扰测试-上电时发送14k,检查干扰是否造成混乱''' # sc = __askForPlateDeviceCom() # time.sleep(1) # autoCloseAsynMessage(u"操作提示(提示框会自动关闭)",u"请按住防拆下电按键!", # lambda:not time.sleep(1)) # sc.asynSend('EtSend14k 3000') # autoCloseAsynMessage(u"操作提示(提示框会自动关闭)",u"请松开防拆下电按键!", # lambda:not time.sleep(1)) # time.sleep(1) # res = sc.asynReceive() # uiLog(u"串口接收:%s"%(res))
def setupFun(product): manul.closeAsynMessage()