Beispiel #1
0
def hal_config():
    from machinekit import launcher

    launcher.cleanup_session()
    comp_path = os.path.join(
        os.path.dirname(os.path.realpath(__file__)),
        '../components/absolute_joint.icomp',
    )
    launcher.install_comp(comp_path)
    launcher.start_realtime()
    rt.init_RTAPI()

    config = HalConfig(thread=THREAD)
    rt.newthread(config.thread.name, config.thread.period_ns, fp=True)
    hal.start_threads()

    yield config

    hal.stop_threads()
    launcher.end_session()
Beispiel #2
0
    description='This is the Prusa-i3-soc run script '
    'it demonstrates how a run script could look like '
    'and of course starts the Prusa-i3 config')

parser.add_argument('-v',
                    '--video',
                    help='Starts the video server',
                    action='store_true')

args = parser.parse_args()

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.register_exit_handler()  # needs to executed after HAL files
    launcher.install_comp('thermistor_check.comp')
    launcher.install_comp('reset.comp')
    nc_path = os.path.expanduser('~/nc_files')
    if not os.path.exists(nc_path):
        os.mkdir(nc_path)

    if not check_mklaucher(
    ):  # start mklauncher if not running to make things easier
        launcher.start_process('mklauncher .')
    launcher.start_process("configserver -n Prusa-i3 ~/Machineface ")
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_process('linuxcnc Prusa-i3.ini')
    while True:
        launcher.check_processes()
        time.sleep(1)
Beispiel #3
0
import sys
import os
import subprocess
import importlib
import argparse
from time import *
from machinekit import launcher

launcher.register_exit_handler()
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.install_comp('thermistor_check.comp')
    launcher.install_comp('reset.comp')
    # Video Streaming: you might need to create your own config
    # launcher.start_process("videoserver --ini ~/video.ini Webcam1")
    # Remote Control: Get a Machineface at ARM.Replicape.A4A.vel/
    launcher.start_process("configserver -n Replicape ~/Machineface/")
    launcher.start_process('linuxcnc replicape.ini')
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #4
0
#!/usr/bin/python

import sys
import os
import subprocess
import importlib
import argparse
from time import *
from machinekit import launcher

launcher.register_exit_handler()
# launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file("paralell_cape3.bbio")
    launcher.install_comp("thermistor_check.comp")
    launcher.install_comp("led_dim.comp")
    launcher.start_process("configserver -n Uni-print-3D ~/Machineface")
    launcher.start_process("linuxcnc UNIPRINT-3D.ini")
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #5
0
            pass
        else:
            raise

launcher.register_exit_handler()
# leave debug level off. Setting debug_level(5) will cause cpu overload and will stop
# your printer with joint errors! 
# 
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
#mkdir_p('/tmp/machinekit.ftp') # Create a folder for uploading gcodes

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.install_comp('replicape/thermistor_check.icomp')
    launcher.install_comp('replicape/io_muxn_bit.icomp')
    launcher.install_comp('replicape/muxn_bit.icomp')
    launcher.install_comp('replicape/reset.icomp')
    # Video Streaming: you might need to create your own config
    # launcher.start_process("videoserver --ini ~/video.ini Webcam1")
    # Remote Control: Get a Machineface at ARM.Replicape.A4A.vel/
    launcher.start_process("configserver -n Replicape ~/Machineface/")
    launcher.start_process('linuxcnc replicape.ini')
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #6
0
from machinekit import config
from time import *


launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
c = config.Config()
os.environ["MACHINEKIT_INI"] = c.MACHINEKIT_INI

try:
    launcher.check_installation()  # make sure the Machinekit installation is sane
    launcher.cleanup_session()  # cleanup a previous session
    # Uncomment and modify the following line if you create a configuration for the BeagleBone Black
    # launcher.load_bbio_file('myoverlay.bbio')  # load a BeagleBone Black universal overlay file
    # Uncomment and modify the following line of you have custom HAL components
    # launcher.install_comp('gantry.comp')  # install a comp HAL component if not already installed
    launcher.install_comp('lineardeltajointscartesian.comp') 
    launcher.start_process("configserver -n Delta /home/machinekit/Cetus")  # start the configserver with Cetus user interfaces
    launcher.start_process('linuxcnc CRAMPS.ini')  # start linuxcnc
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)
    
# loop until script receives exit signal
# or one of the started applications exited incorrectly
# cleanup is done automatically
while True:
    sleep(1)
    launcher.check_processes()
Beispiel #7
0
#args = parser.parse_args()

#if args.debug:
#launcher.set_debug_level(5)

if 'MACHINEKIT_INI' not in os.environ:  # export for package installs

    mkconfig = config.Config()
    os.environ['MACHINEKIT_INI'] = mkconfig.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()  # kill any running Machinekit instances
    launcher.start_realtime()  # start Machinekit realtime environment
    launcher.install_comp('dxlincurve.comp')
    launcher.install_comp('progtime.icomp')
    launcher.load_hal_file('main.hal')  # load the main HAL file
    launcher.register_exit_handler(
    )  # enable on ctrl-C, needs to executed after HAL files
    launcher.ensure_mklauncher()  # ensure mklauncher is started
    launcher.start_process(
        "configserver -n kilncontrol ./ui_mon ./ui_prog ./ui_run")
    while True:
        launcher.check_processes()
        time.sleep(1)
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

sys.exit(0)
Beispiel #8
0
def install_rt_comps():
    launcher.install_comp(
        os.path.join(HAL_CONFIG_PATH, 'components', 'absolute_joint.icomp'))
Beispiel #9
0
import sys
import os
import subprocess
import importlib
import argparse
from time import *
from machinekit import launcher
from machinekit import config

launcher.register_exit_handler()
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
c = config.Config()
os.environ["MACHINEKIT_INI"] = c.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('cramps_cape.bbio')
    launcher.install_comp('reset.comp')
    launcher.start_process("configserver -n Arcus-3D-M1 ./lib/Arcus-Machineface")
    launcher.start_process('linuxcnc Arcus-3D-M1.ini')
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #10
0
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('machinekit.ini')

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('halanduino.bbio')
    launcher.install_comp('kalman.comp')
    launcher.install_comp('hbridge.icomp')
    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 motorctrl.ini')
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_realtime()
#    launcher.load_hal_file('hardware.hal',  'hardware.ini')
#    launcher.load_hal_file('halanduino.hal', 'halanduino.ini')
#    launcher.load_hal_file('threading.hal', 'halanduino.ini')
    import hardware
    if args.gladevcp:
Beispiel #11
0
lines = sourceIni.readlines()
sourceIni.close()
lines.append('NUM_EXTRUDERS = %i\n' % numExtruders)
lines.append('NUM_FANS = %i\n' % numExtruders)
lines = [l.replace('uni_print_3d.py', 'sim.py') for l in lines]
if withAbp:
    lines.append('ABP = 1\n')
startupIni = open(startupIniName, 'w')
startupIni.writelines(lines)  # copy file contents
startupIni.close()

try:
    launcher.check_installation()
    launcher.cleanup_session()
    #launcher.load_bbio_file('paralell_cape3.bbio')
    launcher.install_comp('thermistor_check.icomp')
    cfg = configparser.ConfigParser({'NAME': ''})
    cfg.read(startupIniName)
    machineName = cfg.get('EMC', 'NAME')
    command = 'configserver'
    if machineName is not '':
        command += ' -n %s' % machineName
    command += ' ~/projects/Machineface'
    launcher.start_process(command)
    launcher.start_process('linuxcnc %s' % startupIniName)
    while True:
        launcher.check_processes()
        sleep(1)
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)
Beispiel #12
0
import sys
import os
import subprocess
import importlib
from machinekit import launcher
from time import *

launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

try:
    launcher.check_installation(
    )  # make sure the Machinekit installation is sane
    launcher.cleanup_session()  # cleanup a previous session
    #launcher.load_bbio_file('myoverlay.bbio')                         # load a BBB universal overlay
    launcher.install_comp(
        'ringlog.comp'
    )  # install a comp HAL component of not already installed
    launcher.start_process(
        "configserver -n Testmachine")  # start the configserver
    launcher.start_process('linuxcnc axis.ini')  # start linuxcnc
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #13
0
import sys
import os
import subprocess
import importlib
import argparse
from time import *
from machinekit import launcher
from machinekit import config

launcher.register_exit_handler()
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
c = config.Config()
os.environ["MACHINEKIT_INI"] = c.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('cramps_cape.bbio')
    launcher.install_comp('reset.comp')
    launcher.start_process(
        "configserver -n Arcus-3D-M2 ./lib/Arcus-Machineface")
    launcher.start_process('linuxcnc Arcus-3D-M2.ini')
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()