Ejemplo n.º 1
0
def print_file(a_file):
    api = PrinterAPI()
    api.load_printer()

    print_api = api.get_print_api()
    running = True
    print_api.print_gcode(a_file)

    while running:
        status = print_api.get_status()
        if status['status'] in ['Complete', 'Cancelled', 'Failed']:
            running = False
        time.sleep(0.05)
        print_status(status)
Ejemplo n.º 2
0
def print_file(a_file):
    api = PrinterAPI()
    api.load_printer()

    print_api = api.get_print_api()
    running = True
    print_api.print_gcode(a_file)

    while running:
        status = print_api.get_status()
        if status['status'] in ['Complete', 'Cancelled', 'Failed']:
            running = False
        time.sleep(0.05)
        print_status(status)
def run():
    signal.signal(signal.SIGINT, signal_handler)
    print('Press Ctrl+C to exit')
    global print_api
    setup_logging()
    api = PrinterAPI()
    api.load_printer()
    print_api = api.get_print_api(status_call_back=callback)
    test_print_api = api.get_test_print_api()
    name = "Simple 5 Sided 180 Twist Vase (BETA)"
    height = 80.0
    width = 80.0
    layer_height = 0.01
    speed = 120.0
    generator = test_print_api.get_test_print(name, height, width, layer_height, speed)

    print_api.print_layers(generator)
    signal.pause()
Ejemplo n.º 4
0
    def __init__(self, parent, path):
        Tk.__init__(self, parent)
        self.path = path
        self.geometry("800x700")
        self.title('Peachy Printer Tools')

        if sys.platform != 'darwin':
            self.setup_icon()

        self.parent = parent
        self._api  = PrinterAPI()

        self.start_main_window()

        self.protocol("WM_DELETE_WINDOW", self.close)
Ejemplo n.º 5
0
def run():
    signal.signal(signal.SIGINT, signal_handler)
    print('Press Ctrl+C to exit')
    global print_api
    setup_logging()
    api = PrinterAPI()
    api.load_printer()
    print_api = api.get_print_api(status_call_back=callback)
    test_print_api = api.get_test_print_api()
    name = "Simple 5 Sided 180 Twist Vase (BETA)"
    height = 80.0
    width = 80.0
    layer_height = 0.01
    speed = 120.0
    generator = test_print_api.get_test_print(name, height, width,
                                              layer_height, speed)

    print_api.print_layers(generator)
    signal.pause()
Ejemplo n.º 6
0
if __name__ == "__main__":
    parser = argparse.ArgumentParser("Configure and print with Peachy Printer")
    parser.add_argument('-l', '--log',     dest='loglevel', action='store',      required=False, default="WARNING", help="Enter the loglevel [DEBUG|INFO|WARNING|ERROR] default: WARNING")
    parser.add_argument('-t', '--console', dest='console',  action='store_true', required=False, help="Logs to console not file")
    parser.add_argument('-d', '--development', dest='devmode',  action='store_true', required=False, help="Enable Developer Testing Mode")
    parser.add_argument('-m', '--module', dest='mod',  action='store', required=False, help='Activate a module (use "list" to get a list of available modules).')
    parser.add_argument('-y', '--language', dest='lang', action='store', required=False, default=None, help='override locale code')
    args, unknown = parser.parse_known_args()

    path = os.path.dirname(os.path.realpath(__file__))
    setup_env(path)

    from peachyprinter import config, PrinterAPI

    if not os.path.exists(config.PEACHY_PATH):
        os.makedirs(config.PEACHY_PATH)
    if args.devmode:
        config.devmode = True
    setup_logging(args)

    api = PrinterAPI()
    api.load_printer()
    sys.argv = [sys.argv[0]]
    if args.mod:
        sys.argv.append("-m")
        sys.argv.append(args.mod)

    from gui import PeachyPrinter
    PeachyPrinter(api, language=args.lang).run()
Ejemplo n.º 7
0
        'Activate a module (use "list" to get a list of available modules).')
    parser.add_argument('-y',
                        '--language',
                        dest='lang',
                        action='store',
                        required=False,
                        default=None,
                        help='override locale code')
    args, unknown = parser.parse_known_args()

    path = os.path.dirname(os.path.realpath(__file__))
    setup_env(path)

    from peachyprinter import config, PrinterAPI

    if not os.path.exists(config.PEACHY_PATH):
        os.makedirs(config.PEACHY_PATH)
    if args.devmode:
        config.devmode = True
    setup_logging(args)

    api = PrinterAPI()
    api.load_printer()
    sys.argv = [sys.argv[0]]
    if args.mod:
        sys.argv.append("-m")
        sys.argv.append(args.mod)

    from gui import PeachyPrinter
    PeachyPrinter(api, language=args.lang).run()