parser.add_argument('-v', '--video', help='Starts the video server', action='store_true') parser.add_argument('-l', '--local', help='Enable local mode only', action='store_true') parser.add_argument('-g', '--gladevcp', help='Starts the GladeVCP user interface', action='store_true') parser.add_argument('-s', '--halscope', help='Starts the halscope', action='store_true') parser.add_argument('-m', '--halmeter', help='Starts the halmeter', action='store_true') parser.add_argument('-w', '--webtalk', help='Starts webtalk', action='store_true') parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true') args = parser.parse_args() if args.debug: launcher.set_debug_level(5) if not args.local: # override default $MACHINEKIT_INI with a version which was REMOTE=1 launcher.set_machinekit_ini('/etc/linuxcnc/machinekit.ini') try: launcher.check_installation() launcher.cleanup_session() launcher.load_bbio_file('led-demo.bbio') if args.config: # the point-of-contact for QtQUickVCP launcher.start_process('configserver -n Motorctrl-Demo .') if args.webtalk: # the Websockets/JSON bridge into Machinetalk launcher.start_process('webtalk --ini led-demo.ini') if args.video: launcher.start_process('videoserver --ini video.ini Webcam1') launcher.start_realtime()
#!/usr/bin/env python import sys import os import subprocess import time from machinekit import launcher from machinekit import config launcher.register_exit_handler() #launcher.set_debug_level(9) os.chdir(os.path.dirname(os.path.realpath(__file__))) launcher.set_machinekit_ini(config.MACHINEKIT_INI) try: launcher.check_installation() launcher.cleanup_session() launcher.register_exit_handler() # needs to executed after HAL files launcher.load_bbio_file('bebopr_cape.bbio') nc_path = os.path.expanduser('~/nc_files') if not os.path.exists(nc_path): os.mkdir(nc_path) launcher.ensure_mklauncher() # ensure mklauncher is started launcher.start_process("configserver -n 'Arcus-3D-C1' ~/Machineface") launcher.start_process('machinekit arcus-3d-c1.ini') while True: launcher.check_processes() time.sleep(1)
parser = argparse.ArgumentParser(description='starts the Uni-Print-3D confgurations') parser.add_argument('-e', '--num_extruders', help='number of extruders', nargs='?', type=int, default=1) parser.add_argument('-a', '--with_abp', help='enable a automated build platform', action='store_true') parser.add_argument('config', nargs=1, help='path to config file') args = parser.parse_args() configName = args.config[0] numExtruders = args.num_extruders withAbp = args.with_abp launcher.register_exit_handler() #launcher.set_debug_level(5) os.chdir(os.path.dirname(os.path.realpath(__file__))) launcher.set_machinekit_ini(config.MACHINEKIT_INI) if not os.path.isfile(configName): sys.stderr.write('Config file %s does not exist\n' % configName) sys.exit(1) startupIniName = 'startup.ini' sourceIni = open(configName) # open ini lines = sourceIni.readlines() sourceIni.close() lines.append('NUM_EXTRUDERS = %i\n' % numExtruders) lines.append('NUM_FANS = %i\n' % numExtruders) if withAbp: lines.append('ABP = 1\n') startupIni = open(startupIniName, 'w') startupIni.writelines(lines) # copy file contents