Пример #1
0
def main():

    parser = ArgumentParser(description="ADC CLOCK GUI")

    args = parser.parse_args()

    root = Tk()
    root.title("ADC GUI")
    window = GUI_WINDOW(root)
    root.mainloop()
Пример #2
0
def main():

    parser = ArgumentParser(description="Example GUI")

    args = parser.parse_args()

    root = Tk()
    root.title("FEMB Test GUI")
    window = GUI_WINDOW(root)
    root.mainloop()
Пример #3
0
def main():
    from femb_python.configuration.argument_parser import ArgumentParser

    parser = ArgumentParser(description="QUADADC Test GUI")

    args = parser.parse_args()

    root = Tk()
    root.title("QUADADC Test GUI")
    window = GUI_WINDOW(root)
    root.mainloop()
Пример #4
0
def main():
    from femb_python.configuration.argument_parser import ArgumentParser

    parser = ArgumentParser(description="ADC test GUI")
    parser.add_argument(
        "-q",
        "--forceQuick",
        help=
        "Force to run only the ADC offset current off setting (normally runs all when warm)",
        action="store_true")
    parser.add_argument(
        "-l",
        "--forceLong",
        help=
        "Force to run over all ADC offset current settings (normally doesn't when cold)",
        action="store_true")
    args = parser.parse_args()

    print("Using femb_python:", os.path.dirname(femb_python.__file__))

    root = Tk()
    root.title("ADC Test GUI")
    window = GUI_WINDOW(root,
                        forceLong=args.forceLong,
                        forceQuick=args.forceQuick)
    root.mainloop()
Пример #5
0
def main():
    from femb_python.configuration.argument_parser import ArgumentParser
    from femb_python.configuration import CONFIG

    ROOT.gROOT.SetBatch(True)

    timestamp = datetime.datetime.now().replace(
        microsecond=0).isoformat().replace(":", "").replace("-", "")

    parser = ArgumentParser(description="Sets up ADC board")
    parser.add_argument("-t",
                        "--timestamp",
                        help="Timestamp string to use for this test",
                        type=str,
                        default=timestamp)
    parser.add_argument("-o",
                        "--operator",
                        help="Test operator name",
                        type=str,
                        default="Command-line Operator")
    parser.add_argument(
        "-s",
        "--serial",
        help=
        "Chip serial number, use multiple times for multiple chips, e.g. -s 1 -s 2 -s 3 -s 4",
        action='append',
        default=[])
    parser.add_argument("-b",
                        "--board",
                        help="Test board serial number",
                        default=None)
    parser.add_argument("-f",
                        "--outfilename",
                        help="Output file name",
                        default="adcSetup.json")
    parser.add_argument("-j",
                        "--jsonfile",
                        help="json options file location",
                        default=None)
    args = parser.parse_args()

    config = CONFIG(exitOnError=False)
    chipsPass = None

    hostname = socket.gethostname()
    timestamp = args.timestamp
    operator = args.operator
    boardid = args.board
    serialNumbers = args.serial
    outfilename = args.outfilename
    power_on = True
    power_off = True

    options = None

    if args.jsonfile:
        with open(args.jsonfile) as jsonfile:
            options = json.load(jsonfile)
            try:
                hostname = options["hostname"]
                timestamp = options["timestamp"]
                operator = options["operator"]
                boardid = options["board_id"]
                serialNumbers = options["serials"]
                outfilename = options["outfilename"]
                power_on = options["power_on"]
                power_off = options["power_off"]
            except KeyError as e:
                print("Error while parsing json input options: ", e)
                sys.exit(1)

    if len(serialNumbers) == 0:
        serialNumbers = list(range(-1, -(config.NASICS + 1), -1))
    elif len(serialNumbers) != config.NASICS:
        print(
            "Error: number of serial numbers ({}) doesn't equal number of ASICs in configuration ({}), exiting."
            .format(len(serialNumbers), config.NASICS))
        sys.exit(1)
    try:
        chipsPass = setup_board(config,
                                outfilename,
                                serialNumbers,
                                timestamp,
                                operator,
                                boardid,
                                hostname,
                                power_on=power_on,
                                power_off=power_off,
                                sumatradict=options)
    except Exception as e:
        print("Uncaught exception in setup_board. Traceback in stderr.")
        sys.stderr.write(
            "Uncaught exception in setup_board: Error: {} {}\n".format(
                type(e), e))
        traceback.print_tb(e.__traceback__)
        if power_off:
            config.POWERSUPPLYINTER.off()
        sys.exit(1)
Пример #6
0
def main():
    from femb_python.configuration.argument_parser import ArgumentParser
    from femb_python.configuration import CONFIG
    import json

    ROOT.gROOT.SetBatch(True)

    timestamp = datetime.datetime.now().replace(microsecond=0).isoformat().replace(":","").replace("-","")

    parser = ArgumentParser(description="Collects David Adams data. Assumes board is already in a good state 2 MHz no offset, ext clock")
    parser.add_argument("-t", "--timestamp",help="Timestamp string to use for this test",type=str,default=timestamp)
    parser.add_argument("-o", "--operator",help="Test operator name",type=str,default="Command-line Operator")
    parser.add_argument("-s", "--serial",help="Chip serial number, use multiple times for multiple chips, e.g. -s 1 -s 2 -s 3 -s 4",action='append',default=[])
    parser.add_argument("-b", "--board",help="Test board serial number",default=None)
    parser.add_argument("-d", "--datadir",help="Directory for output data files",default="")
    parser.add_argument("-p", "--profiler",help="Enable python timing profiler and save to given file name",type=str,default=None)
    parser.add_argument("-j", "--jsonfile",help="json options file location",default=None)
    args = parser.parse_args()
  
    config = CONFIG(exitOnError=False)
    chipsPass = None
    startTime = datetime.datetime.now()

    hostname = socket.gethostname()
    timestamp = args.timestamp
    operator = args.operator
    boardid = args.board
    serialNumbers = args.serial
    dataDir = args.datadir
    iTry = 1

    options = None

    if args.jsonfile:
        with open(args.jsonfile) as jsonfile:
            options = json.load(jsonfile)
            try:
                hostname = options["hostname"]
                timestamp = options["timestamp"]
                operator = options["operator"]
                boardid = options["board_id"]
                serialNumbers = options["serials"]
                dataDir = options["datadir"]
                iTry = options["iTry"]
            except KeyError as e:
                print("Error while parsing json input options: ",e)
                sys.exit(1)

    if len(serialNumbers) == 0:
        serialNumbers = list(range(-1,-(config.NASICS+1),-1))
    elif len(serialNumbers) != config.NASICS:
        print("Error: number of serial numbers ({}) doesn't equal number of ASICs in configuration ({}), exiting.".format(len(serialNumbers),config.NASICS))
        sys.exit(1)

    try:
        if args.profiler:
            import cProfile
            cProfile.runctx('chipsPass = runTests(config,dataDir,serialNumbers,timestamp,operator,boardid,hostname,sumatradict=options,iTry=iTry)',globals(),locals(),args.profiler)
        else:
            chipsPass = runTests(config,dataDir,serialNumbers,timestamp,operator,boardid,hostname,sumatradict=options,iTry=iTry)
    except Exception as e:
        print("Uncaught exception in runTests. Traceback in stderr.")
        sys.stderr.write("Uncaught exception in runTests: Error: {} {}\n".format(type(e),e))
        traceback.print_tb(e.__traceback__)
        sys.exit(1)
    else:
        runTime = datetime.datetime.now() - startTime
        print("Test took: {:.0f} min {:.1f} s".format(runTime.total_seconds() // 60, runTime.total_seconds() % 60.))
        print("Chips Pass: ",chipsPass)