def __init__(self, port, baud): self.displayOutput = displayoutputs() self.port = serial.Serial(port, baud, timeout=0.2) self.msgs = { "jumpToBoot": {"frame": "o%c" % "^", "waitTime": 5}, "identity": {"frame": "o%c" % "?", "waitTime": 10}, "summaryRequest": {"frame": "o%c" % "r", "waitTime": 10}, "testComplete": {"frame": "o%c" % "C", "waitTime": 10}, "SP-illuminationOn": {"frame": "o%c" % "1", "waitTime": 5}, "SP-illuminationOff": {"frame": "o%c" % "2", "waitTime": 5}, "PC-relayState": {"frame": "o%c" % "1", "waitTime": 5}, "PC-sensorPowerState": {"frame": "o%c" % "2", "waitTime": 5}, "PC-pumpOff": {"frame": "o%c" % "0", "waitTime": 5}, "PC-pumpOn": {"frame": "o%c" % "1", "waitTime": 5}, "IC-relayEnable": {"frame": "o%c%c%c%c" % ("+", "+", "+", "1"), "waitTime": 5}, "IC-relayDisable": {"frame": "o%c%c%c%c" % ("+", "+", "+", "0"), "waitTime": 5}, "IC-calibrateStep0": {"frame": "o%c%c" % ("C", "0"), "waitTime": 20}, "IC-calibrateStep1": {"frame": "o%c%c" % ("C", "1"), "waitTime": 10}, "IC-calibrateStep2": {"frame": "o%c%c" % ("C", "2"), "waitTime": 10}, "IC-calibrateStep3": {"frame": "o%c%c" % ("C", "3"), "waitTime": 10}, "IC-calibrateStep4": {"frame": "o%c%c" % ("C", "4"), "waitTime": 10}, "IC-calibrateStep5": {"frame": "o%c%c" % ("C", "5"), "waitTime": 10}, "IC-calibrateStep6": {"frame": "o%c%c" % ("C", "6"), "waitTime": 10}, "IC-saveCalInfo": {"frame": "o%c" % "S", "waitTime": 10}, "TC-testMode": {"frame": "o%c" % "T", "waitTime": 1}, "TC-moveEast": {"frame": "o%c" % "1", "waitTime": 20}, "TC-moveWest": {"frame": "o%c" % "2", "waitTime": 20}, "TC-moveUp": {"frame": "o%c" % "3", "waitTime": 20}, "TC-moveDown": {"frame": "o%c" % "4", "waitTime": 20}, "TC-sensorPackComm": {"frame": "o%c" % "5", "waitTime": 10}, "TC-interconnectComm": {"frame": "o%c" % "6", "waitTime": 10}, "TC-railComm": {"frame": "o%c" % "7", "waitTime": 10}, "TC-moduleTemps": {"frame": "o%c" % "8", "waitTime": 10}, "RC-rtcComms": {"frame": "o%c" % "1", "waitTime": 25}, "RC-flashComms": {"frame": "o%c" % "2", "waitTime": 60}, "RC-rs485Comms": {"frame": "o%c" % "3", "waitTime": 10}, "RC-portVoltage": {"frame": "o%c" % "4", "waitTime": 10}, "RC-digitalInputs": {"frame": "o%c" % "5", "waitTime": 10}, "RC-permissionInput": {"frame": "o%c" % "6", "waitTime": 10}, "RC-estops": {"frame": "o%c" % "7", "waitTime": 10}, "RC-ethernet": {"frame": "o%c" % "8", "waitTime": 20}, "RC-ir": {"frame": "o%c" % "9", "waitTime": 20}, "RC-testPortPowerLEDs": {"frame": "o%c" % "A", "waitTime": 20}, "RC-testPortLEDsRed": {"frame": "o%c" % "B", "waitTime": 10}, "RC-testPortLEDsBlue": {"frame": "o%c" % "C", "waitTime": 10}, "RC-testPortLEDsGreen": {"frame": "o%c" % "D", "waitTime": 10}, "RC-test7SegmentDisplays": {"frame": "o%c" % "E", "waitTime": 10}, "RC-testAllIndicators": {"frame": "o%c" % "F", "waitTime": 10}, "RC-testsComplete": {"frame": "o%c" % "G", "waitTime": 10}, "RC-testSysLED": {"frame": "o%c" % "H", "waitTime": 10}, }
success = 0 DEBUG = 0 # chose an implementation, depending on os ------------------------------------- if os.name == 'nt': #sys.platform == 'win32': platform = "win" elif os.name == 'posix': platform = "linux" else: raise ImportError("Sorry: no implementation for your platform ('%s') available" % (os.name,)) # initialize test objects ------------------------------------------------------ print testerInfo = testerinfo(MANUFACTURING_DATA_START_ADDRESS,MANUFACTURING_DATA_LENGTH,APP_CODE_START,APP_CODE_LENGTH,MICROPROCESSOR_VARIANT,MSPDEBUG_DRIVER,PROGRAMMER_PORT_BAUD_RATE,COMMUNICATION_PORT_BAUD_RATE,BOOTLOADER_FILE_LOCATION,PRODUCTION_FILE_LOCATION) testerInfo.initialize() displayOutput = displayoutputs() harnessLib = harnesslib(platform) print #=============================================================================== # Start of Test #=============================================================================== while running : td = testData() jtr = testreport("Tracker Controller") md,jtr = harnessLib.testInit(testerInfo, jtr) if (jtr.getFieldValue("summary") == "failed"): # if some part of the init failed, stop here break jtr.setFieldValue("hardwareVersion", testerInfo.versioninfo)
def __init__(self): self.displayOutput = displayoutputs()