Beispiel #1
0
def initParser(args, mode=None, gui=None):

    printerProfileName = "UM2" # xxx todo: get from commandline args

    # Create printer profile singleton instance
    printerProfile = PrinterProfile(printerProfileName)
    # Create material profile singleton instance
    mat = MatProfile(args.mat, args.smat)

    # Overwrite settings from printer profile with command line arguments:
    if args.retractLength:
        printerProfile.override("RetractLength", args.retractLength)

    # Overwrite settings from material profile with command line arguments:
    if args.t0:
        mat.override("bedTemp", args.t0)
    if args.t1:
        mat.override("hotendStartTemp", args.t1)

    nozzle = NozzleProfile(args.nozzle)

    # Create the Printer singleton instance
    printer = Printer(gui)

    # Create the planner singleton instance
    planner = Planner(args, gui)

    # Create parser singleton instance
    parser = gcodeparser.UM2GcodeParser()

    return (parser, planner, printer)