diff --git a/configs/sim/axis/orphans/README b/configs/sim/axis/orphans/README deleted file mode 100644 index 3db068cb1a5..00000000000 --- a/configs/sim/axis/orphans/README +++ /dev/null @@ -1,49 +0,0 @@ -orphans - -Obsolete or broken configs - - -axis_noio.ini no io specified: - [EMCIO]EMCIO = - -py.ini.notworking -- needs work -pyiocontrol.ini.notworking -- needs work - - - -directory: configs/sim/axis/orphans/pysubs - -originally was: configs/sim/axis/pysubs - -The examples here seem to similar to or redundant to -files in configs/sim/axis/remap/ - -------------------------------------------------------- - -configs/sim/axis/orphans/pysubs/customtask.py -configs/sim/axis/remap/iocontrol-removed/python/customtask.py - -configs/sim/axis/orphans/pysubs/nulluserfuncs.py -configs/sim/axis/remap/iocontrol-removed/python/nulluserfuncs.py - -configs/sim/axis/orphans/pysubs/oword.py -configs/sim/axis/remap/getting-started/python/oword.py -configs/sim/axis/remap/iocontrol-removed/python/oword.py - -configs/sim/axis/orphans/pysubs/plugins.py - - -configs/sim/axis/orphans/pysubs/sqltoolaccess.py -configs/sim/axis/remap/iocontrol-removed/python/sqltoolaccess.py - -configs/sim/axis/orphans/pysubs/task.py -configs/sim/axis/remap/iocontrol-removed/python/task.py - -configs/sim/axis/orphans/pysubs/tooltable.py -configs/sim/axis/remap/iocontrol-removed/python/tooltable.py - -configs/sim/axis/orphans/pysubs/userfuncs.py -configs/sim/axis/remap/iocontrol-removed/python/userfuncs.py - -configs/sim/axis/orphans/pysubs/remap.py -many diff --git a/configs/sim/axis/orphans/acc_test.ini b/configs/sim/axis/orphans/acc_test.ini deleted file mode 100644 index 34812cab97b..00000000000 --- a/configs/sim/axis/orphans/acc_test.ini +++ /dev/null @@ -1,123 +0,0 @@ -[EMC] -VERSION = 1.1 -MACHINE = LinuxCNC-HAL-SIM-AXIS -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -DEBUG = 0 - -[DISPLAY] -DISPLAY = axis -CYCLE_TIME = 0.100 -HELP_FILE = doc/help.txt -POSITION_OFFSET = RELATIVE -POSITION_FEEDBACK = ACTUAL -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 -MAX_LINEAR_VELOCITY = 12 -DEFAULT_LINEAR_VELOCITY = .25 -PROGRAM_PREFIX = ../../../nc_files/ -INTRO_GRAPHIC = linuxcnc.gif -INTRO_TIME = 5 -#EDITOR = geany -TOOL_EDITOR = tooledit -INCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in - -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 - -[RS274NGC] -PARAMETER_FILE = sim.var - -[EMCMOT] -EMCMOT = motmod -COMM_TIMEOUT = 1.0 -SERVO_PERIOD = 1000000 - - -[TASK] -TASK = milltask -CYCLE_TIME = 0.001 - -[HAL] - HALUI = halui -HALFILE = LIB:basic_sim.tcl - -[TRAJ] -COORDINATES = X Y Z -HOME = 0 0 0 -LINEAR_UNITS = inch -ANGULAR_UNITS = degree -DEFAULT_LINEAR_VELOCITY = 1.2 -POSITION_FILE = position.txt -MAX_LINEAR_VELOCITY = 12 - -[EMCIO] -EMCIO = io -CYCLE_TIME = 0.100 -TOOL_TABLE = sim.tbl -TOOL_CHANGE_POSITION = 0 0 0 -TOOL_CHANGE_QUILL_UP = 1 - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -MAX_VELOCITY = 8.3333 -MAX_ACCELERATION = 40 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 8.3333 -MAX_ACCELERATION = 40 -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 - -[AXIS_Y] -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -MAX_VELOCITY = 8.3333 -MAX_ACCELERATION = 30 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 8.3333 -MAX_ACCELERATION = 30 -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 1 - -[AXIS_Z] -MIN_LIMIT = -10.0 -MAX_LIMIT = 10.0001 -MAX_VELOCITY = 8.333333 -MAX_ACCELERATION = 20 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 8.333333 -MAX_ACCELERATION = 20 -MIN_LIMIT = -10.0 -MAX_LIMIT = 10.0001 -HOME_OFFSET = 1.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 diff --git a/configs/sim/axis/orphans/axis_noio.ini b/configs/sim/axis/orphans/axis_noio.ini deleted file mode 100644 index 41ccbae72a0..00000000000 --- a/configs/sim/axis/orphans/axis_noio.ini +++ /dev/null @@ -1,198 +0,0 @@ -# EMC controller parameters for a simulated machine. -# General note: Comments can either be preceded with a # or ; - either is -# acceptable, although # is in keeping with most linux config files. -# General section ------------------------------------------------------------- - -[EMC] -# Version of this INI file -VERSION = 1.1 -# Name of machine, for use with display, etc. -MACHINE = axis_noio -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -# DEBUG = 0x7FFFFFFF -DEBUG = 0 -# Sections for display options ------------------------------------------------ - -[DISPLAY] -# Name of display program, e.g., xlinuxcnc -DISPLAY = axis -# Cycle time, in seconds, that display will sleep between polls -CYCLE_TIME = 0.100 -# Path to help file -HELP_FILE = doc/help.txt -# Initial display setting for position, RELATIVE or MACHINE -POSITION_OFFSET = RELATIVE -# Initial display setting for position, COMMANDED or ACTUAL -POSITION_FEEDBACK = ACTUAL -# Highest value that will be allowed for feed override, 1.0 = 100% -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 -# Prefix to be used -PROGRAM_PREFIX = ../../nc_files/ -# Introductory graphic -INTRO_GRAPHIC = linuxcnc.gif -INTRO_TIME = 5 -#EDITOR = geany -INCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in - -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 -# Task controller section ----------------------------------------------------- - -[RS274NGC] -SUBROUTINE_PATH = ../../nc_files/remap_lib/common_nc_subs -# File containing interpreter variables -PARAMETER_FILE = sim_mm.var -# Motion control section ------------------------------------------------------ - -[EMCMOT] -EMCMOT = motmod -# Timeout for comm to emcmot, in seconds -COMM_TIMEOUT = 1.0 -# BASE_PERIOD is unused in this configuration but specified in core_sim.hal -BASE_PERIOD = 0 -# Servo task period, in nano-seconds -SERVO_PERIOD = 1000000 -# Hardware Abstraction Layer section -------------------------------------------------- - -[TASK] -# Name of task controller program, e.g., milltask -TASK = milltask -# Cycle time, in seconds, that task controller will sleep between polls -CYCLE_TIME = 0.001 -# Part program interpreter section -------------------------------------------- - -[HAL] -# The run script first uses halcmd to execute any HALFILE -# files, and then to execute any individual HALCMD commands. -# -# list of hal config files to run through halcmd -# files are executed in the order in which they appear -HALFILE = core_sim_noiocontrol.hal -#HALFILE = axis_manualtoolchange.hal -HALFILE = simulated_home.hal -#HALFILE = gamepad.hal -# list of halcmd commands to execute -# commands are executed in the order in which they appear -#HALCMD = save neta -# Single file that is executed after the GUI has started. Only supported by -# AXIS at this time (only AXIS creates a HAL component of its own) -#POSTGUI_HALFILE = test_postgui.hal -HALUI = halui -# Trajectory planner section -------------------------------------------------- - -[HALUI] -#No Content - -[TRAJ] -COORDINATES = X Y Z -HOME = 0 0 0 -LINEAR_UNITS = mm -ANGULAR_UNITS = degree -DEFAULT_LINEAR_VELOCITY = 30.48 -MAX_LINEAR_VELOCITY = 53.34 -DEFAULT_LINEAR_ACCELERATION = 508 -MAX_LINEAR_ACCELERATION = 508 -POSITION_FILE = position_mm.txt -# Axes sections --------------------------------------------------------------- -# First axis - -[EMCIO] -# Name of IO controller program, e.g., io -#EMCIO = io -EMCIO= -#iocontrol-replace -# cycle time, in seconds -CYCLE_TIME = 0.100 -# tool table file -TOOL_TABLE = sim_mm.tbl -TOOL_CHANGE_POSITION = 0 0 50.8 - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 -# Second axis - -[AXIS_Y] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -# Third axis - -[AXIS_Z] -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 25.4 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 -# section for main IO controller parameters ----------------------------------- diff --git a/configs/sim/axis/orphans/core_sim_noio.hal b/configs/sim/axis/orphans/core_sim_noio.hal deleted file mode 100644 index 945517c01db..00000000000 --- a/configs/sim/axis/orphans/core_sim_noio.hal +++ /dev/null @@ -1,53 +0,0 @@ -# core HAL config file for simulation - -# first load all the RT modules that will be needed -# kinematics -loadrt [KINS]KINEMATICS -# motion controller, get name and thread periods from ini file -loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS -# load 6 differentiators (for velocity and accel signals -loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv -# load additional blocks -loadrt hypot names=vel_xy,vel_xyz - -# add motion controller functions to servo thread -addf motion-command-handler servo-thread -addf motion-controller servo-thread -# link the differentiator functions into the code -addf ddt_x servo-thread -addf ddt_xv servo-thread -addf ddt_y servo-thread -addf ddt_yv servo-thread -addf ddt_z servo-thread -addf ddt_zv servo-thread -addf vel_xy servo-thread -addf vel_xyz servo-thread - -# create HAL signals for position commands from motion module -# loop position commands back to motion module feedback -net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in -net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in -net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in - -# send the position commands thru differentiators to -# generate velocity and accel signals -net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 -net Xacc <= ddt_xv.out -net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 -net Yacc <= ddt_yv.out -net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0 -net Zacc <= ddt_zv.out - -# Cartesian 2- and 3-axis velocities -net XYvel vel_xy.out => vel_xyz.in1 -net XYZvel <= vel_xyz.out - -# estop loopback -#disabled for noio: net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in -#reenabled for iotask_remove: -# iocontrol doesn't exist any more, these are really motion pins -#net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in - -# create signals for tool loading loopback -# net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared -# net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed diff --git a/configs/sim/axis/orphans/core_sim_noiocontrol.hal b/configs/sim/axis/orphans/core_sim_noiocontrol.hal deleted file mode 100644 index f15dafba3b9..00000000000 --- a/configs/sim/axis/orphans/core_sim_noiocontrol.hal +++ /dev/null @@ -1,50 +0,0 @@ -# core HAL config file for simulation - -# first load all the RT modules that will be needed -# kinematics -loadrt [KINS]KINEMATICS -# motion controller, get name and thread periods from ini file -loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS -# load 6 differentiators (for velocity and accel signals -loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv -# load additional blocks -loadrt hypot names=vel_xy,vel_xyz - -# add motion controller functions to servo thread -addf motion-command-handler servo-thread -addf motion-controller servo-thread -# link the differentiator functions into the code -addf ddt_x servo-thread -addf ddt_xv servo-thread -addf ddt_y servo-thread -addf ddt_yv servo-thread -addf ddt_z servo-thread -addf ddt_zv servo-thread -addf vel_xy servo-thread -addf vel_xyz servo-thread - -# create HAL signals for position commands from motion module -# loop position commands back to motion module feedback -net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in -net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in -net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in - -# send the position commands thru differentiators to -# generate velocity and accel signals -net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 -net Xacc <= ddt_xv.out -net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 -net Yacc <= ddt_yv.out -net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0 -net Zacc <= ddt_zv.out - -# Cartesian 2- and 3-axis velocities -net XYvel vel_xy.out => vel_xyz.in1 -net XYZvel <= vel_xyz.out - -# estop loopback -#net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in - -# create signals for tool loading loopback -#net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared -#net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed diff --git a/configs/sim/axis/orphans/core_sim_test.hal b/configs/sim/axis/orphans/core_sim_test.hal deleted file mode 100644 index a395f727613..00000000000 --- a/configs/sim/axis/orphans/core_sim_test.hal +++ /dev/null @@ -1,52 +0,0 @@ -# core HAL config file for simulation - -# first load all the RT modules that will be needed -# kinematics -loadrt [KINS]KINEMATICS -# motion controller, get name and thread periods from ini file -loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS -# load 6 differentiators (for velocity and accel signals -loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv -# load additional blocks -loadrt hypot names=vel_xy,vel_xyz - -# add motion controller functions to servo thread -addf motion-command-handler servo-thread -addf motion-controller servo-thread -# link the differentiator functions into the code -addf ddt_x servo-thread -addf ddt_xv servo-thread -addf ddt_y servo-thread -addf ddt_yv servo-thread -addf ddt_z servo-thread -addf ddt_zv servo-thread -addf vel_xy servo-thread -addf vel_xyz servo-thread - -# create HAL signals for position commands from motion module -# loop position commands back to motion module feedback -net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in -net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in -net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in - -# send the position commands thru differentiators to -# generate velocity and accel signals -net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 -net Xacc <= ddt_xv.out -net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 -net Yacc <= ddt_yv.out -net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0 -net Zacc <= ddt_zv.out - -# Cartesian 2- and 3-axis velocities -net XYvel vel_xy.out => vel_xyz.in1 -net XYZvel <= vel_xyz.out - -# estop loopback -net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in - -# create signals for tool loading loopback -net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared -net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed - -#net foo bar diff --git a/configs/sim/axis/orphans/gladevcp_postgui.hal b/configs/sim/axis/orphans/gladevcp_postgui.hal deleted file mode 100644 index ef154f0f6b7..00000000000 --- a/configs/sim/axis/orphans/gladevcp_postgui.hal +++ /dev/null @@ -1,84 +0,0 @@ -# unlink because core_sim.hal looped them already -unlinkp iocontrol.0.tool-change -unlinkp iocontrol.0.tool-changed -unlinkp iocontrol.0.tool-prepare -unlinkp iocontrol.0.tool-prepared - -# loop back iocontrol(v2) pins to keep her happy -net io-tool-prepare iocontrol.0.tool-prepare iocontrol.0.tool-prepared -net io-tool-change iocontrol.0.tool-change iocontrol.0.tool-changed - - -############################## Tx pins ############################## -net tool-prep-number-f motion.analog-out-00 => gladevcp.txt_tool_prepare_no -net tool-prep-pocket-f motion.analog-out-01 => gladevcp.txt_prepare_pocket -net tool-prepare motion.digital-out-00 => gladevcp.led_tool_prepare -net tool-prepared motion.digital-out-02 => gladevcp.led_tool_prepared - - -############################## M6 pins ############################## -net tool-number-f motion.analog-out-02 => gladevcp.txt_tool_number -net tool-change motion.digital-out-01 => gladevcp.led_tool_change -net tool-changed motion.digital-out-03 => gladevcp.led_tool_changed - - -############################## Spindle Pin ############################## -#net spindle_has_stoped motion.digital-in-02 <= hm2_5i20.0.gpio.032.in -# Fürs Debugging -net spindle_has_stoped motion.digital-in-02 <= gladevcp.chk_spindle_stoped -net spindle_has_stoped => gladevcp.led_spindle_stoped -net spindle_has_not_stoped gladevcp.led_spindle_not_stoped <= gladevcp.chk_spindle_stoped-not - - -############################## Doors ############################## -#net left_door_is_closed motion.digital-in-00 <= hm2_5i20.0.gpio.035.in -# Fürs Debugging -net left_door_closed motion.digital-in-00 <= gladevcp.chk_left_door_closed -net left_door_closed => gladevcp.led_left_door_is_closed -net left_door_open gladevcp.led_left_door_is_open <= gladevcp.chk_left_door_closed-not - -#net right_door_is_closed motion.digital-in-01 <= hm2_5i20.0.gpio.036.in -# Fürs Debugging -net right_door_closed motion.digital-in-01 <= gladevcp.chk_right_door_closed -net right_door_closed => gladevcp.led_right_door_is_closed -net right_door_open gladevcp.led_right_door_is_open <= gladevcp.chk_right_door_closed-not - - -############################## Covers ############################## -# Öffnet die linke Klappe Verknüpfung unter ToolChangeTest.hal -# net valvle_cover_left motion.digital-out-04 => hm2_5i20.0.gpio.043.out -# Fürs Debugging -net valvle_cover_left => gladevcp.led_valvle_left_on - -# hm2_5i20.0.gpio.026.in = Klappe links offen -net cover_left_open motion.digital-in-06 <= gladevcp.chk_cover_left -net cover_left_open gladevcp.led_cover_left_open -# hm2_5i20.0.gpio.028.in = Klappe links zu -net cover_left_closed motion.digital-in-03 <= gladevcp.chk_cover_left-not -net cover_left_closed gladevcp.led_cover_left_closed - -# Öffnet die rechte Klappe Verknüpfung unter ToolChangeTest.hal -# net valvle_cover_right motion.digital-out-05 => hm2_5i20.0.gpio.041.out -# Fürs Debugging -net valvle_cover_right => gladevcp.led_valvle_right_on - -# hm2_5i20.0.gpio.025.in = Klappe rechts offen -net cover_right_open motion.digital-in-07 <= gladevcp.chk_cover_right -net cover_right_open gladevcp.led_cover_right_open -# hm2_5i20.0.gpio.027.in = Klappe rechts zu -net cover_right_closed motion.digital-in-04 <= gladevcp.chk_cover_right-not -net cover_right_closed gladevcp.led_cover_right_closed - - -############################## Changing fork ############################## -net fork_down motion.digital-in-09 <= gladevcp.chk_fork_up-not -net fork_down gladevcp.led_fork_down -net fork_up motion.digital-in-08 <= gladevcp.chk_fork_up -net fork_up gladevcp.led_fork_up - - -############################## Coolant ############################## -net coolant-flood => gladevcp.led_coolant_on - -#net tool-changed gladevcp.led_tool_changed motion.digital-in-01 -#net halui-abort gladevcp.halui-abort halui.abort diff --git a/configs/sim/axis/orphans/iocontrol-removed/core_sim_test.hal b/configs/sim/axis/orphans/iocontrol-removed/core_sim_test.hal deleted file mode 100644 index c3af9d447c9..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/core_sim_test.hal +++ /dev/null @@ -1,44 +0,0 @@ -# core HAL config file for simulation - -# first load all the RT modules that will be needed -# kinematics -loadrt trivkins -# motion controller, get name and thread periods from ini file -loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS -# load 6 differentiators (for velocity and accel signals -loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv -# load additional blocks -loadrt hypot names=vel_xy,vel_xyz - -# add motion controller functions to servo thread -addf motion-command-handler servo-thread -addf motion-controller servo-thread -# link the differentiator functions into the code -addf ddt_x servo-thread -addf ddt_xv servo-thread -addf ddt_y servo-thread -addf ddt_yv servo-thread -addf ddt_z servo-thread -addf ddt_zv servo-thread -addf vel_xy servo-thread -addf vel_xyz servo-thread - -# create HAL signals for position commands from motion module -# loop position commands back to motion module feedback -net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in -net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in -net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in - -# send the position commands thru differentiators to -# generate velocity and accel signals -net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 -net Xacc <= ddt_xv.out -net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 -net Yacc <= ddt_yv.out -net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0 -net Zacc <= ddt_zv.out - -# Cartesian 2- and 3-axis velocities -net XYvel vel_xy.out => vel_xyz.in1 -net XYZvel <= vel_xyz.out - diff --git a/configs/sim/axis/orphans/iocontrol-removed/gladevcp.hal b/configs/sim/axis/orphans/iocontrol-removed/gladevcp.hal deleted file mode 100644 index ebdb20179f5..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/gladevcp.hal +++ /dev/null @@ -1,31 +0,0 @@ - -# estop loopback -net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in gladevcp.user-enable-out - -# create signals for tool loading loopback - -# in case they were linked already -unlinkp iocontrol.0.tool-change -unlinkp iocontrol.0.tool-changed - -net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared gladevcp.tool-prepare -net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed gladevcp.tool-change -net start-change iocontrol.0.start-change iocontrol.0.start-change-ack gladevcp.start-change - - -net tool-lock motion.digital-out-00 gladevcp.tool-lock-led -net tool-flush motion.digital-out-01 gladevcp.tool-flush-led - -net mist iocontrol.0.coolant-mist gladevcp.mist -net flood iocontrol.0.coolant-flood gladevcp.flood -net tool-prep-pocket iocontrol.0.tool-prep-pocket gladevcp.tool-prep-pocket -net tool-prep-number iocontrol.0.tool-prep-number gladevcp.tool-prep-number -net tool-number iocontrol.0.tool-number gladevcp.tool-number -net emc-reason iocontrol.0.emc-reason gladevcp.emc-reason - - -net toolchanger-reason gladevcp.toolchanger-reason-s iocontrol.0.toolchanger-reason -net toolchanger-fault gladevcp.set-toolchanger-faulted iocontrol.0.toolchanger-fault -net toolchanger-clear-fault gladevcp.toolchanger-clear-fault iocontrol.0.toolchanger-clear-fault -net toolchanger-faulted iocontrol.0.toolchanger-faulted gladevcp.toolchanger-faulted -setp gladevcp.table 1 diff --git a/configs/sim/axis/orphans/iocontrol-removed/iocontrol-removed.ini b/configs/sim/axis/orphans/iocontrol-removed/iocontrol-removed.ini deleted file mode 100644 index 0ed4b24dad9..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/iocontrol-removed.ini +++ /dev/null @@ -1,394 +0,0 @@ -# General section ------------------------------------------------------------- -[EMC] -# make emcsrv not create tool rcs channels if not using iocontrol -TOOL_CHANNELS = 0 - -# Name of NML file to use. toolCmd and toolSts, and tool process disabled -NML_FILE = no-iotask.nml - -# Version of this INI file -VERSION = 1.0 - -# Name of machine, for use with display, etc. -MACHINE = iocontrol-removed.ini - -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -#DEBUG = 0x7FFFFFFF -#DEBUG = 0x7FFFDEFF #no interp,oword -#DEBUG = 0x00008000 # py only -#DEBUG = 0x0000E000 # py + remap + Oword -#DEBUG = 0x0000C000 # py + remap -#DEBUG = 0x0000C100 # py + remap + Interpreter -#DEBUG = 0x0000C140 # py + remap + Interpreter + NML msgs -#DEBUG = 0x0004C140 # py + remap + Interpreter + NML msgs + PythonTask -#DEBUG = 0x0000C040 # py + remap + NML -#DEBUG = 0x0004C040 # py + remap + NML + PythonTask -#DEBUG = 0x0003E100 # py + remap + Interpreter + oword + signals + namedparams -#DEBUG = 0x00008000 -#DEBUG = 0 # 0x00000100 -#PythonTask -DEBUG=0x00040000 -#define EMC_DEBUG_IOCONTROL 0x00001000 -#define EMC_DEBUG_OWORD 0x00002000 -#define EMC_DEBUG_REMAP 0x00004000 -#define EMC_DEBUG_PYTHON 0x00008000 -#define EMC_DEBUG_NAMEDPARAM 0x00010000 -#define EMC_DEBUG_GDBONSIGNAL 0x00020000 -#define EMC_DEBUG_PYTHON_TASK 0x00040000 - - -# Sections for display options ------------------------------------------------ - -[DISPLAY] -# how to use the Firefox SQlite manager plugin as tooltable editor: -# -# 0: read http://code.google.com/p/sqlite-manager -# -# 1. download 'SQLiteManager 0.7.7 as XULRunner App' (or whatever the latest version is, -# eg http://code.google.com/p/sqlite-manager/downloads/detail?name=sqlitemanager-xr-0.7.7-all.zip&can=2&q== -# -# 2. create a directory under your home directory, eg ~/sqlite-manager -# -# 3. unzip the zp file from 1) into this directory -# -# 4. try running firefox with this plugin and the tooltable.sqlite file in this directory -# like so: -# -# firefox -app /sqlite-manager/application.ini -f tooltable.sqlite -# -# firefox should come up with the sqlite manager extension and having this database opened -# -# 5. adapt the following command line with appropriate paths: -# -TOOL_EDITOR= firefox -app /home/mah/sqlite-manager/application.ini -f /home/mah/emc2-dev/configs/sim/remap/iocontrol-removed/tooltable.sqlite - -GLADEVCP=-c gladevcp racktoolchange-noioctl.glade - -# Name of display program, e.g., xlinuxcnc -DISPLAY = axis - -#OPEN_FILE=/home/mah/emc2-tc/nc_files/taskcall.ngc -OPEN_FILE=./nc_files/tcdemo.ngc - -# Cycle time, in seconds, that display will sleep between polls -CYCLE_TIME = 0.100 - -# Path to help file -HELP_FILE = doc/help.txt - -# Initial display setting for position, RELATIVE or MACHINE -POSITION_OFFSET = RELATIVE - -# Initial display setting for position, COMMANDED or ACTUAL -POSITION_FEEDBACK = ACTUAL - -# Highest value that will be allowed for feed override, 1.0 = 100% -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 - -# Prefix to be used -PROGRAM_PREFIX = ../../nc_files/ - -# Introductory graphic -#INTRO_GRAPHIC = linuxcnc.gif -INTRO_TIME = 0 - -#EDITOR = geany - -INCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script - -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 - -# Task controller section ----------------------------------------------------- -[RS274NGC] - -SUBROUTINE_PATH = nc_subroutines:../../nc_files/remap_lib/common_nc_subs - -# optional features - a bit mask to selectively turn on experimental/dubious features -# see -# RETAIN_G43 0x00000001 -# OWORD_N_ARGS 0x00000002 -# INI_VARS 0x00000004 -# HAL_PIN_VARS 0x00000008 -# NO_DOWNCASE_OWORD 0x00000010 - -# turn on all optional features except RETAIN_G43 -FEATURES=30 - -# handler procedure called on aborts - to cleanup HAL pins etc -ON_ABORT_COMMAND=O call - -LOG_LEVEL = 9 -# File containing interpreter variables -PARAMETER_FILE = sim_mm.var - -# see python/remap.py for the prolog and epilog handlers -# see nc_files/remap-subroutines for the NGC procedures -# -REMAP=M6 modalgroup=6 prolog=change_prolog ngc=rack_change epilog=change_epilog - -# accessible in interp as #<_[section]name> -[EMCMOT] - -EMCMOT = motmod - -# Timeout for comm to emcmot, in seconds -COMM_TIMEOUT = 1.0 - -# BASE_PERIOD is unused in this configuration but specified in core_sim.hal -BASE_PERIOD = 0 -# Servo task period, in nano-seconds -SERVO_PERIOD = 1000000 - -# Hardware Abstraction Layer section -------------------------------------------------- -[TASK] - -# Name of task controller program, e.g., milltask -TASK = milltask - -# Cycle time, in seconds, that task controller will sleep between polls -CYCLE_TIME = 0.001 - -# the Python plugins serves interpreter and task - -[HAL] - -# The run script first uses halcmd to execute any HALFILE -# files, and then to execute any individual HALCMD commands. -# - -# list of hal config files to run through halcmd -# files are executed in the order in which they appear - -# POSTTASK_HALFILE is executed by task after initialisation -# because task now sports HAL pins -# POSTGUI_HALFILE is only supported by Axis -POSTTASK_HALFILE = core_sim.hal -POSTTASK_HALFILE = racktoolchange.hal -POSTTASK_HALFILE = simulated_home.hal - -POSTGUI_HALFILE= gladevcp.hal - -#HALFILE = gamepad.hal - -# list of halcmd commands to execute -# commands are executed in the order in which they appear -#HALCMD = save neta - -# Single file that is executed after the GUI has started. Only supported by -# AXIS at this time (only AXIS creates a HAL component of its own) -#POSTGUI_HALFILE = test_postgui.hal - -HALUI = halui - -# Trajectory planner section -------------------------------------------------- -[HALUI] -#No Content - -[TRAJ] -COORDINATES = X Y Z -LINEAR_UNITS = mm -ANGULAR_UNITS = degree -DEFAULT_LINEAR_VELOCITY = 30.48 -MAX_LINEAR_VELOCITY = 53.34 -DEFAULT_LINEAR_ACCELERATION = 508 -MAX_LINEAR_ACCELERATION = 508 -POSITION_FILE = position_mm.txt -NO_FORCE_HOMING = 1 - -# Axes sections --------------------------------------------------------------- - -# First axis -[EMCIO] section for main IO controller parameters is gone - - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 - -# Second axis -[AXIS_Y] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 - -# Third axis -[AXIS_Z] -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 25.4 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 - -[PYTHON] -# where to find Python code -# code specific for this configuration -PATH_PREPEND=./python -# generic support code -PATH_APPEND=../../nc_files/remap_lib/python-stdglue - -# import the following Python module -TOPLEVEL=python/toplevel.py - -# the higher the more verbose tracing of the Python plugin -LOG_LEVEL = 0 - -RELOAD_ON_CHANGE=1 - -LOG_LEVEL = 2 - -# start a Python (really IO) Task class -# see end of python/task.py to see how it's instantiated -PYTHON_TASK=1 - -# section for everything tool related -# relevant only if NOT using iocontrol - see EMCIO in that case - -# needed to keep axis happy for now -# technically the [EMCIO] section for main IO controller parameters is gone - -[TOOL] - -# how to connect to a toolstore in an SQL database -ODBC_CONNECT= Driver=SQLite3;Database=tooltable.sqlite - -# legacy tool table filename -TOOL_TABLE = tool.tbl - -# if nonzero, save tool-in-spindle and pocket-prepped on exit, and restore on startup -# ODBC only -SAVE_TOOLSTATE=1 - -# manual, random, any other -CHANGER_TYPE= manual - -# if TASK_TOOLCHANGE_PINS=1, the task Python plugin will emulate the -# following iocontrol.0 pins: -# tool-change -# tool-changed -# tool-number -# tool-prep-number -# tool-prep-pocket -# tool-prepare -# tool-prepared -# -TASK_TOOLCHANGE_PINS=1 - -# if TASK_START_CHANGE_PINS=1, the task Python plugin will emulate the -# start-change/start-change-ack pins and their protocol as per iocontrolv2: -TASK_START_CHANGE_PINS=1 - -# if TASK_TOOLCHANGE_FAULT_PINS=1 the task Python plugin will emulate the iocontrolv2 pins: -# emc-abort -# emc-abort-ack -# emc-reason -# toolchanger-fault -# toolchanger-fault-ack -# toolchanger-reason -# toolchanger-faulted -# toolchanger-clear-fault -TASK_TOOLCHANGE_FAULT_PINS=1 - - -# Part program interpreter section -------------------------------------------- -[TOOL_HOLDER_CLEAR] -X = 10 -Y = 30 -Z = 10 - -[TOOL_SLOT_DELTA] -X = 0 -Y = 10 -Z = 0 - -# this is not named TOOL_CHANGE_POSITION ón purpose - canon uses it and will -# interfere -[CHANGE_POSITION] -X = 10 -Y = 10 -Z = 10 - -[DWELL] -LOCK_TIME = 0.5 -MYSTERY = 0 -NEW_TOOL = 1.0 -POST_UNLOCK = 0.5 - -# motion.digital-out-NN pins -[PINS] -LOCK = 0 -FLUSH = 1 - - -# Motion control section ------------------------------------------------------ diff --git a/configs/sim/axis/orphans/iocontrol-removed/nc_files/tcdemo.ngc b/configs/sim/axis/orphans/iocontrol-removed/nc_files/tcdemo.ngc deleted file mode 100644 index db81cb3b215..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/nc_files/tcdemo.ngc +++ /dev/null @@ -1,11 +0,0 @@ -(change tools 1 through 6) -F100 -#1 = 1 -O101 while [#1 lt 7] - -T#1 M6 - -#1 = [#1+1] -O101 endwhile - -m2 diff --git a/configs/sim/axis/orphans/iocontrol-removed/nc_subroutines b/configs/sim/axis/orphans/iocontrol-removed/nc_subroutines deleted file mode 120000 index dbfd1bfabfd..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/nc_subroutines +++ /dev/null @@ -1 +0,0 @@ -../rack-toolchange/nc_subroutines \ No newline at end of file diff --git a/configs/sim/axis/orphans/iocontrol-removed/no-iotask.nml b/configs/sim/axis/orphans/iocontrol-removed/no-iotask.nml deleted file mode 100644 index bd76900ac5d..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/no-iotask.nml +++ /dev/null @@ -1,47 +0,0 @@ - -# Note: emcsvr is the master for all NML channels, and therefore is the -# first to start. - -# Buffers -# Name Type Host size neut? (old) buffer# MP --- - -# Top-level buffers to EMC -B emcCommand SHMEM localhost 8192 0 0 1 16 1001 TCP=5005 xdr -B emcStatus SHMEM localhost 16384 0 0 2 16 1002 TCP=5005 xdr -B emcError SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue - -# These are for the IO controller, EMCIO -#B toolCmd SHMEM localhost 1024 0 0 4 16 1004 TCP=5005 xdr -#B toolSts SHMEM localhost 8192 0 0 5 16 1005 TCP=5005 xdr - -# Processes -# Name Buffer Type Host Ops server? timeout master? cnum - -P emc emcCommand LOCAL localhost RW 0 1.0 0 0 -P emc emcStatus LOCAL localhost W 0 1.0 0 0 -P emc emcError LOCAL localhost W 0 1.0 0 0 -P emc toolCmd LOCAL localhost W 0 1.0 0 0 -P emc toolSts LOCAL localhost R 0 1.0 0 0 - -P emcsvr emcCommand LOCAL localhost W 1 1.0 1 2 -P emcsvr emcStatus LOCAL localhost R 1 1.0 1 2 -P emcsvr emcError LOCAL localhost R 1 1.0 1 2 -P emcsvr toolCmd LOCAL localhost W 1 1.0 1 2 -P emcsvr toolSts LOCAL localhost R 1 1.0 1 2 -P emcsvr default LOCAL localhost RW 1 1.0 1 2 - -#P tool emcError LOCAL localhost W 0 1.0 0 3 -#P tool toolCmd LOCAL localhost RW 0 1.0 0 3 -#P tool toolSts LOCAL localhost W 0 1.0 0 3 - -P xemc emcCommand LOCAL localhost W 0 10.0 0 10 -P xemc emcStatus LOCAL localhost R 0 10.0 0 10 -P xemc emcError LOCAL localhost R 0 10.0 0 10 -P xemc toolCmd LOCAL localhost W 0 10.0 0 10 -P xemc toolSts LOCAL localhost R 0 10.0 0 10 - -P keystick emcCommand LOCAL localhost W 0 10.0 0 10 -P keystick emcStatus LOCAL localhost R 0 10.0 0 10 -P keystick emcError LOCAL localhost R 0 10.0 0 10 -P keystick toolCmd LOCAL localhost W 0 10.0 0 10 -P keystick toolSts LOCAL localhost R 0 10.0 0 10 diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/customtask.py b/configs/sim/axis/orphans/iocontrol-removed/python/customtask.py deleted file mode 100644 index 7833a5114f3..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/customtask.py +++ /dev/null @@ -1,561 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2012, 2013 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import sys -import signal -import traceback - -import emctask -import emccanon -import interpreter -import hal - -try: - import emc -except ImportError: - import linuxcnc as emc # ini only - -try: - import cPickle as pickle -except ImportError: - import pickle - -try: - from userfuncs import UserFuncs -except ImportError: - from nulluserfuncs import UserFuncs - -def debug(): - # interpreter.this isn't usable until after Interpreter.init has been called - if hasattr(interpreter,'this'): - return interpreter.this.debugmask & 0x00040000 # EMC_DEBUG_PYTHON_TASK - return - - -def handler(signum, frame): - ''' controlled shut down - after this, emcIoHalt() will be called, too - ''' - print("Python Task shutdown handler") - # this handler overrides the handler in emctaskmain, so call that as well - emctask.emctask_quit(signum) - - -class CustomTask(emctask.Task,UserFuncs): - - def __init__(self): - signal.signal(signal.SIGINT, handler) - signal.signal(signal.SIGTERM, handler) - try: - if debug(): print("py: CustomTask()") - emctask.Task.__init__(self) - self.inifile = emc.ini(emctask.ini_filename()) - self.tcpins = int(self.inifile.find("TOOL", "TASK_TOOLCHANGE_PINS") or 0) - self.startchange_pins = int(self.inifile.find("TOOL", "TASK_START_CHANGE_PINS") or 0) - self.fault_pins = int(self.inifile.find("TOOL", "TASK_TOOLCHANGE_FAULT_PINS") or 0) - - h = hal.component("iocontrol.0") - h.newpin("coolant-flood", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("coolant-mist", hal.HAL_BIT, hal.HAL_OUT) - - h.newpin("lube-level", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("lube", hal.HAL_BIT, hal.HAL_OUT) - - h.newpin("emc-enable-in", hal.HAL_BIT, hal.HAL_IN) - h.newpin("user-enable-out", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("user-request-enable", hal.HAL_BIT, hal.HAL_OUT) - - if self.tcpins: - h.newpin("tool-change", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_IN) - h.newpin("tool-number", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_IN) - if self.startchange_pins: - h.newpin("start-change", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("start-change-ack", hal.HAL_BIT, hal.HAL_IN) - if self.fault_pins: - h.newpin("emc-abort", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("emc-abort-ack", hal.HAL_BIT, hal.HAL_IN) - h.newpin("emc-reason", hal.HAL_S32, hal.HAL_OUT) - h.newpin("toolchanger-fault", hal.HAL_BIT, hal.HAL_IN) - h.newpin("toolchanger-fault-ack", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("toolchanger-reason", hal.HAL_S32, hal.HAL_IN) - h.newpin("toolchanger-faulted", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("toolchanger-clear-fault", hal.HAL_BIT, hal.HAL_IN) - - h.ready() - self.components = dict() - self.components["iocontrol.0"] = h - self.hal = h - self.hal_init_pins() - self.io = emctask.emcstat.io - self.io.aux.estop = 1 - self._callback = None - self._check = None - tt = self.io.tool.toolTable - for p in range(0,len(tt)): - tt[p].zero() - UserFuncs.__init__(self) - self.enqueue = EnqueueCall(self) - except Exception as e: - print("__init__") - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.io.status = emctask.RCS_STATUS.RCS_DONE - - - def emcIoInit(self): - if debug(): print("py: emcIoInit tt=",self.tooltable_filename) - try: - self.io.aux.estop = 1 - self.io.tool.pocketPrepped = -1; - self.io.tool.toolInSpindle = 0; - self.io.coolant.mist = 0 - self.io.coolant.flood = 0 - self.io.lube.on = 0 - self.io.lube.level = 1 - - self.hal_init_pins() - # on nonrandom machines, always start by assuming the spindle is empty - if not self.random_toolchanger: - self.io.tool.toolTable[0].zero() - - if self.inifile.find("TOOL", "ODBC_CONNECT"): - import sqltoolaccess - self.tt = sqltoolaccess.SqlToolAccess(self.inifile, self.random_toolchanger) - else: - import tooltable - self.tt = tooltable.EmcToolTable(self.tooltable_filename, self.random_toolchanger) - - self.comments = dict() - self.fms = dict() - self.tt.load_table(self.io.tool.toolTable,self.comments,self.fms) - self.tt.restore_state(emctask.emcstat) - # self.io.tool.toolInSpindle = 2 # works - self.reload_tool_number(self.io.tool.toolInSpindle) - - except Exception as e: - print("emcIoInit",e) - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.io.status = emctask.RCS_STATUS.RCS_DONE - finally: - return 0 - - def emcToolLoadToolTable(self,file): - # triggered by UI if tooltable was edited - if debug(): print("py: emcToolLoadToolTable file = '%s'" % (file)) - self.comments = dict() - self.fms = dict() - try: - self.tt.load_table(self.io.tool.toolTable,self.comments,self.fms) - except Exception as e: - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.reload_tool_number(self.io.tool.toolInSpindle) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def prepare_complete(self): - if debug(): print("prepare complete") - self.io.tool.pocketPrepped = self.hal["tool-prep-pocket"] - self.hal["tool-prepare"] = 0 - - def emcToolPrepare(self,p,tool): - if debug(): print("py: emcToolPrepare p =",p,"tool =",tool) - if self.random_toolchanger and (p == 0): - if debug(): print("it doesn't make sense to prep the spindle pocket") - return 0 - - if self.tcpins: - if self.fault_pins and self.hal["toolchanger-faulted"]: - if debug(): print("prepare: toolchanger faulted (reason=%d), next M6 will %s" % (self.hal["toolchanger-reason"], "set fault code and reason" if self.hal["toolchanger-reason"] > 0 else "abort program")) - self.hal["tool-prep-pocket"] = p - if not self.random_toolchanger and (p == 0): - self.hal["tool-prep-number"] = 0 - else: - self.hal["tool-prep-number"] = self.io.tool.toolTable[p].toolno - - self.hal["tool-prepare"] = 1 - - # and tell task to wait until status changes to RCS_DONE - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.tool-prepared",self.prepare_complete) - else: - self.io.tool.pocketPrepped = p - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def reload_tool_number(self, toolno): - if self.random_toolchanger: return - t = self.io.tool.toolTable - for p in range(1,len(t)): - if toolno == t[p].toolno: - self.load_tool(p) - - def load_tool(self,pocket): - if self.random_toolchanger: - self.io.tool.toolTable[0],self.io.tool.toolTable[pocket] = self.io.tool.toolTable[pocket],self.io.tool.toolTable[0] - self.comments[0],self.comments[pocket] = self.comments[pocket],self.comments[0] - self.tt.save_table(self.io.tool.toolTable,self.comments,self.fms) - else: - if pocket == 0: - self.io.tool.toolTable[0].zero() - else: - self.io.tool.toolTable[0] = self.io.tool.toolTable[pocket] - - def change_complete(self): - if debug(): print("change complete") - if not self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.tool.toolInSpindle = 0 - else: - self.io.tool.toolInSpindle = self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.load_tool(self.io.tool.pocketPrepped) - self.io.tool.pocketPrepped = -1 - self.hal["tool-prep-number"] = 0 - self.hal["tool-prep-pocket"] = 0 - self.hal["tool-change"] = 0 - - def emcToolLoad(self): - if debug(): print("py: emcToolLoad") - - if self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - if not self.random_toolchanger and (self.io.tool.pocketPrepped > 0) and ( - self.io.tool.toolInSpindle == - self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno): - - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - if self.tcpins: - if self.fault_pins and self.hal["toolchanger-faulted"]: - self.io.status = emctask.RCS_STATUS.RCS_ERROR - return 0 - if self.io.tool.pocketPrepped != -1: - self.hal["tool-change"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.tool-changed",self.change_complete) - return 0 - else: - if not self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.tool.toolInSpindle = 0 - else: - self.io.tool.toolInSpindle = self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno - self.load_tool(self.io.tool.pocketPrepped) - self.io.tool.pocketPrepped = -1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolUnload(self): - if debug(): print("py: emcToolUnload") - self.io.tool.toolInSpindle = 0 - # this isn't in ioControlv1, but I think it should be. - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolSetNumber(self,number): - if debug(): print("py: emcToolSetNumber number =",number) - self.io.tool.toolInSpindle = number - if self.tcpins: - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolSetOffset(self,pocket,toolno,offset,diameter,frontangle,backangle,orientation): - if debug(): print("py: emcToolSetOffset", pocket,toolno,str(offset),diameter,frontangle,backangle,orientation) - - self.io.tool.toolTable[pocket].toolno = toolno - self.io.tool.toolTable[pocket].orientation = orientation - self.io.tool.toolTable[pocket].diameter = diameter - self.io.tool.toolTable[pocket].frontangle = frontangle - self.io.tool.toolTable[pocket].backangle = backangle - self.io.tool.toolTable[pocket].offset = offset - - if debug(): print("new tool entry: ",str(self.io.tool.toolTable[pocket])) - - if self.io.tool.toolInSpindle == toolno: - self.io.tool.toolTable[0] = self.io.tool.toolTable[pocket] - - self.tt.save_table(self.io.tool.toolTable,self.comments,self.fms) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - - def emcIoPluginCall(self, len, msg): - if debug(): print("py: emcIoPluginCall len=%d msg=%s" %(len,msg)) - call = pickle.loads(msg) - func = getattr(self, call[0], None) - if func: - self.io.status = func(*call[1],**call[2]) - else: - raise AttributeError, "no such method: " + call[0] - return 0 - - - def emcIoHalt(self): - if debug(): print("py: emcIoHalt") - self.tt.save_state(emctask.emcstat) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emc_abort_acked(self): - if debug(): print("emc_abort_acked") - self.hal["emc-abort"] = 0 - - def emcIoAbort(self,reason): - if debug(): print("py: emcIoAbort reason=",reason,"state=",emctask.emcstat.task.state) - #if debug(): print("tc fault=",self.io.fault, "tc reason=",self.io.reason) - - self.io.coolant.mist = 0 - self.io.coolant.flood = 0 - - if self.tcpins: - self.hal["coolant-mist"] = 0 - self.hal["coolant-flood"] = 0 - self.hal["tool-change"] = 0 - self.hal["tool-prepare"] = 0 - if self.startchange_pins: - self.hal["start-change"] = 0 - if self.fault_pins: - self.hal["emc-reason"] = reason - self.hal["emc-abort"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.emc-abort-ack",self.emc_abort_acked) - return 0 - - if self._callback: - if debug(): print("emcIoAbort: cancelling callback to ",self._callback) - self._callback = None - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def start_change_acked(self): - if debug(): print("start_change_acked") - self.hal["start-change"] = 0 - - def emcToolStartChange(self): - if debug(): print("py: emcToolStartChange", "wait for iocontrol.0.start-change-ack" if self.startchange_pins else "noop") - if self.startchange_pins: - self.hal["start-change"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.start-change-ack",self.start_change_acked) - return 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcAuxEstopOn(self): - if debug(): print("py: emcAuxEstopOn taskstate=",emctask.emcstat.task.state) - self.hal["user-enable-out"] = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcAuxEstopOff(self): - if debug(): print("py: emcAuxEstopOff") - self.hal["user-enable-out"] = 1 - self.hal["user-request-enable"] = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantMistOn(self): - if debug(): print("py: emcCoolantMistOn") - self.hal["coolant-mist"] = 1 - self.io.coolant.mist = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantMistOff(self): - if debug(): print("py: emcCoolantMistOff") - self.hal["coolant-mist"] = 0 - self.io.coolant.mist = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantFloodOn(self): - if debug(): print("py: emcCoolantFloodOn") - self.hal["coolant-flood"] = 1 - self.io.coolant.flood = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantFloodOff(self): - if debug(): print("py: emcCoolantFloodOff") - self.hal["coolant-flood"] = 0 - self.io.coolant.flood = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcLubeOn(self): - if debug(): print("py: emcLubeOn") - self.hal["lube"] = 1 - self.io.lube.on = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcLubeOff(self): - if debug(): print("py: emcLubeOff") - self.hal["lube"] = 0 - self.io.lube.on = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcIoSetDebug(self,debug): - if debug(): print("py: emcIoSetDebug debug =",debug) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcIoUpdate(self): - try: - #if debug(): print("py: emcIoUpdate") - self.hal["user-request-enable"] = 0 - self.io.aux.estop = not self.hal["emc-enable-in"] - if self.fault_pins: - if self.hal["toolchanger-fault"]: - self.io.reason = self.hal["toolchanger-reason"] - self.hal["toolchanger-fault-ack"] = 1 - self.hal["toolchanger-faulted"] = 1 # fault indicator latch - self.io.fault = 1 - return 0 - else: - self.hal["toolchanger-fault-ack"] = 0 - if self.hal["toolchanger-clear-fault"]: - self.hal["toolchanger-faulted"] = 0 # reset fault indicator latch - self.io.reason = 0 - if self._check: - self.io.status = self._check() - return 0 - except KeyboardInterrupt: # shutting down - print("emcIoUpdate----KeyboardInterrupt:") - return -1 - except Exception as e: - print("emcIoUpdate----:") - print_exc_plus() - return -1 - else: - return 0 - - def wait_for_named_pin_callback(self): - if self._comp[self._pin] == self._value: - if debug(): print("pin %s now %d" % (self._pin, self._value)) - if self._callback: self._callback() - self._check = None - self._callback = None - return emctask.RCS_STATUS.RCS_DONE - return emctask.RCS_STATUS.RCS_EXEC - - def wait_for_named_pin(self,value,name,callback = None): - (component, pin) = name.rsplit('.',1) - comp = self.components[component] - if comp[pin] == value: - if debug(): print("pin: %s already at %d" % (name,value)) - if callback: callback() - return emctask.RCS_STATUS.RCS_DONE - else: - if debug(): print("waiting for %s to become %d" % (name,value)) - # else set up callback - self._comp = comp - self._pin = pin - self._value = value - self._check = self.wait_for_named_pin_callback - self._callback = callback - # and tell task to wait until status changes to RCS_DONE - return emctask.RCS_STATUS.RCS_EXEC - - - def hal_init_pins(self): - """ Sets HAL pins default values """ - self.hal["user-enable-out"] = 0 - self.hal["user-request-enable"] = 0 - self.hal["coolant-mist"] = 0 - self.hal["coolant-flood"] = 0 - self.hal["lube"] = 0 - if self.tcpins: - self.hal["tool-prepare"] = 0 - self.hal["tool-prepared"] = 0 - self.hal["tool-prep-number"] = 0 - self.hal["tool-prep-pocket"] = 0 - self.hal["tool-change"] = 0 - self.hal["tool-number"] = 0 - if self.startchange_pins: - self.hal["start-change"] = 0 - if self.fault_pins: - self.hal["emc-abort"] = 0 - self.hal["emc-reason"] = 0 - self.hal["toolchanger-fault-ack"] = 0 - self.hal["toolchanger-faulted"] = 0 - - -# support queuing calls from Interp to Task Python methods: -# trap call, pickle a tuple of name and arguments and enqueue with canon IO_PLUGIN_CALL -class EnqueueCall(object): - def __init__(self,e): - if debug(): print("EnqueueCall.__init__()") - self._e = e - - def _encode(self,*args,**kwargs): - if hasattr(self._e,self._name) and callable(getattr(self._e,self._name)): - p = pickle.dumps((self._name,args,kwargs),-1) # binary pickle - emccanon.IO_PLUGIN_CALL(int(len(p)),p) - else: - raise AttributeError,"no such Task method: " + self._name - - def __getattr__(self, name): - self._name = name - return self._encode - -## {{{ http://code.activestate.com/recipes/52215/ (r1) - -def print_exc_plus(): - """ - Print the usual traceback information, followed by a listing of all the - local variables in each frame. - """ - tb = sys.exc_info()[2] - while 1: - if not tb.tb_next: - break - tb = tb.tb_next - stack = [] - f = tb.tb_frame - while f: - stack.append(f) - f = f.f_back - stack.reverse() - traceback.print_exc() - print("Locals by frame, innermost last") - for frame in stack: - print - print("Frame %s in %s at line %s" % (frame.f_code.co_name, - frame.f_code.co_filename, - frame.f_lineno)) - for key, value in frame.f_locals.items(): - print("\t%20s = " % key, end=" ") - #We have to be careful not to cause a new error in our error - #printer! Calling str() on an unknown object could cause an - #error we don't want. - try: - print(value) - except: - print("") diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/embedding.py b/configs/sim/axis/orphans/iocontrol-removed/python/embedding.py deleted file mode 100644 index 0ae8681999c..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/embedding.py +++ /dev/null @@ -1,64 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# a tour of accessing interpreter internals - -def call_stack(self,*args): - print("------- interpreter call stack: ") - for i in range(self.call_level): - s = self.sub_context[i] - print("%d: position=%d sequence_number=%d filename=%s subname=%s context_status=%x" % (i, s.position, s.sequence_number,s.filename,s.subname,s.context_status), end=" ") - print("named_params=",s.named_params) - -def remap_stack(self, *args): - print("------- interpreter remap stack: ") - for i in range(self.remap_level): - r = self.blocks[i].executing_remap - print("%d: name=%s argspec=%s prolog_func=%s ngc=%s py=%s epilog=%s modal_group=%d" % (r.name,r.argspec,r.prolog_func,r.ngc,r.epilog_func,r.modal_group)) - -def tooltable(self, *args): - print("------- tool table:") - for i in range(len(self.tool_table)): - t = self.tool_table[i] - if t.toolno != -1: print(str(t)) - print("tool in spindle=%d pocketPrepped=%d" % (self.current_tool,self.selected_pocket)) - - -def show_block(self,*args): - if len(args) > 0: - n = int(args[0]) - else: - n = 0 - b = self.blocks[n] - print("-- blocks[%d]" % (n)) - print("line_number=%d o_name=%s p_flag=%d p_number%g q_flag=%d q_number=%g comment=%s" % (b.line_number,b.o_name,b.p_flag,b.p_number,b.q_flag,b.q_number,b.comment)) - - - -def show(self,*args): - print("dir(interpreter)=",dir(self)) - tooltable(self) - show_block(self,0) - if self.remap_level: show_block(self,self.remap_level) - call_stack(self) - remap_stack(self) - print("active G-codes:",self.active_g_codes) - print("active M-codes:",self.active_m_codes) - print("active settings:",self.active_settings) - print("parameters:",self.parameters) - diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/nulluserfuncs.py b/configs/sim/axis/orphans/iocontrol-removed/python/nulluserfuncs.py deleted file mode 100644 index 994b40c389e..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/nulluserfuncs.py +++ /dev/null @@ -1,23 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# empty extension object to make inheritance work - -class UserFuncs(object): - - pass diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/oword.py b/configs/sim/axis/orphans/iocontrol-removed/python/oword.py deleted file mode 100644 index e3afae3e619..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/oword.py +++ /dev/null @@ -1,128 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import sys,os -import interpreter -import emccanon - -if 'emctask' in sys.builtin_module_names: - import emctask - -import task - -from embedding import * - - - -#define EMC_DEBUG_CONFIG 0x00000002 -#define EMC_DEBUG_VERSIONS 0x00000008 -#define EMC_DEBUG_TASK_ISSUE 0x00000010 -#define EMC_DEBUG_NML 0x00000040 -#define EMC_DEBUG_MOTION_TIME 0x00000080 -#define EMC_DEBUG_INTERP 0x00000100 -#define EMC_DEBUG_RCS 0x00000200 -#define EMC_DEBUG_INTERP_LIST 0x00000800 -#define EMC_DEBUG_IOCONTROL 0x00001000 -#define EMC_DEBUG_OWORD 0x00002000 -#define EMC_DEBUG_REMAP 0x00004000 -#define EMC_DEBUG_PYTHON 0x00008000 -#define EMC_DEBUG_NAMEDPARAM 0x00010000 -#define EMC_DEBUG_GDBONSIGNAL 0x00020000 - -def debug(): - return interpreter.this.debugmask & 0x00008000 - -# Demo Python O-word subroutine - call as: -# o [5] -# (debug, #<_value>) -# -# len(args) always reflects the number of actual parameters passed -def square(self, *args): - return args[0]*args[0] - - -# a function taking a variable number of arguments -# o [5] [7] -# (debug, #<_value>) -# o [5] [7] [9] [16] -# (debug, #<_value>) -import operator -def multiply(self, *args): - return reduce(operator.mul, *args) - - -#---------------- queue calls for task-time execution ------------ -# see userfuncs.py for the actual function definitions - -# trivial demo: wiggle a user-defined HAL pin a few times -def qdemo(self,*args,**kwargs): - try: - task.pytask.enqueue.demo(*args,**kwargs) - if debug(): print("enqueueing demo()",args,kwargs) - except Exception as e: - # self happens if called with the UI context - no task there: harmless - pass - -# access emcStatus -# this is queued so it is done in-sequence at task time -def show_emcstat(self,*args,**kwargs): - try: - task.pytask.enqueue.show_emcstat(*args,**kwargs) - if debug(): print("enqueueing show_emcstat()",args) - except Exception as e: - if debug(): print("show_emcstat:",e,"pid=",os.getpid()) - pass - - -def set_named_pin(self,*args): - ''' an uh, creative way to pass a string argument: use a trailing comment - usage example: o call [2.345] (component.pinname) - ''' - try: - if (len(args) != 1): - self.set_errormsg("set_named_pin takes a single argument and a comment") - return -1 - if len(self.blocks[0].comment) == 0: - self.set_errormsg("set_named_pin takes a comment, which is the HAL pin name") - return -1 - task.pytask.enqueue.set_named_pin(args[0], self.blocks[0].comment) - if debug(): print("enqueuing set_named_pin()",args) - except Exception as e: - if debug(): print("set_named_pin:",e,"pid=",os.getpid()) - pass - - -def wait_for_named_pin(self,*args): - ''' same trick to wait for a given named pin to show a certain value: - usage example: o call [1] (component.boolpin) - - NB: this will NOT stop readhead, and this is not a method to retrieve a named pin's value - ''' - try: - if (len(args) != 1): - self.set_errormsg("wait_for_named_pin takes a single argument and a comment") - return -1 - if len(self.blocks[0].comment) == 0: - self.set_errormsg("wait_for_named_pin takes a comment, which is the HAL pin name") - return -1 - task.pytask.enqueue.wait_for_named_pin(args[0], self.blocks[0].comment) - if debug(): print("enqueuing wait_for_named_pin()",args) - except Exception as e: - if debug(): print("wait_for_named_pin:",e,"pid=",os.getpid()) - pass - diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/remap.py b/configs/sim/axis/orphans/iocontrol-removed/python/remap.py deleted file mode 100644 index 8ddafe0e8a2..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/remap.py +++ /dev/null @@ -1,20 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2012, 2013 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -from stdglue import * - diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/sqltoolaccess.py b/configs/sim/axis/orphans/iocontrol-removed/python/sqltoolaccess.py deleted file mode 100644 index 45afbfcc364..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/sqltoolaccess.py +++ /dev/null @@ -1,154 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2012, 2013 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import re -import pyodbc -try: - import emc -except ImportError: - import linuxcnc as emc # ini only -import sys, traceback - -class SqlToolAccess(object): - ''' - beginnings of ODBC tooltable access - ''' - - def __init__(self,inifile,random_toolchanger): - print("SQL tt init") - self.inifile = inifile - self.random_toolchanger = random_toolchanger - self.persist = int(self.inifile.find("TOOL", "SAVE_TOOLSTATE") or 0) - - self.connectstring = self.inifile.find("TOOL", "ODBC_CONNECT") - conn = pyodbc.connect(self.connectstring) - cursor = conn.cursor() - print("tables in database %s:" % (self.connectstring)) - for row in cursor.tables(): - print(row.table_name) - cursor.close() - conn.close() - - - def load_table(self, tooltable,comments,fms): - ''' populate the table''' - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - - cursor = conn.cursor() - cursor.execute("select * from tools;") - - for row in cursor.fetchall(): - pocket = row.pocket - t = tooltable[pocket] - t.toolno = row.toolno - t.orientation = row.orientation - t.diameter = row.diameter - t.frontangle = row.frontangle - t.backangle = row.backangle - t.offset.tran.x = row.x_offset - t.offset.y = row.y_offset - t.offset.z = row.z_offset - t.offset.a = row.a_offset - t.offset.b = row.b_offset - t.offset.c = row.c_offset - t.offset.u = row.u_offset - t.offset.v = row.v_offset - t.offset.w = row.w_offset - - except pyodbc.Error as e: - traceback.print_exc(file=sys.stdout) - else: - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: print(str(t)) - finally: - cursor.close() - conn.close() - - def save_table(self, tooltable, comments,fms): - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - cursor.execute("delete from tools;") - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: - cursor.execute("insert into tools values(?,?,?,?,?,?,'?',?,?,?,?,?,?,?,?,?);", - (t.toolno, p, t.diameter, t.backangle,t.frontangle,t.orientation, - comment[p],t.offset.x,t.offset.y,t.offset.z,t.offset.a,t.offset.b, - t.offset.c,t.offset.u,t.offset.v,t.offset.w)) - except pyodbc.Error as msg: - print("saving tooltable failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - def save_state(self,e): - if not self.persist: - return - print("SQL save_state", end=" ") - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - cursor.execute("delete from state;") - cursor.execute("insert into state (tool_in_spindle,pocket_prepped) values(?,?)", e.io.tool.toolInSpindle,e.io.tool.pocketPrepped) - print("done") - - except pyodbc.Error as msg: - print("save_state() failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - - def restore_state(self,e): - if not self.persist: - return - - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - if not cursor.tables(table='state').fetchone(): - print("trying to restore, but no 'state' table found") - return - row = cursor.execute("select tool_in_spindle,pocket_prepped from state;").fetchone() - if row: - e.io.tool.pocketPrepped = row.pocket_prepped - e.io.tool.toolInSpindle = row.tool_in_spindle - print("restored tool=%d pocketPrepped=%d" % (row.tool_in_spindle,row.pocket_prepped)) - else: - print("no saved state record found") - - except pyodbc.Error as msg: - print("restore_state() failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/task.py b/configs/sim/axis/orphans/iocontrol-removed/python/task.py deleted file mode 100644 index b99d2cdb9e0..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/task.py +++ /dev/null @@ -1,49 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2012, 2013 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import sys -import hal -import emccanon -import interpreter - -try: - import emctask - import customtask -except ImportError as e: - print("failed on import emctask,customtask",e) - pass - -try: - import cPickle as pickle -except ImportError: - import pickle - -def starttask(): - global pytask - try: - import emc - except ImportError: - import linuxcnc as emc # ini only - - ini = emc.ini(emctask.ini_filename()) - t = ini.find("PYTHON", "PYTHON_TASK") - if int(t) if t else 0: - pytask = customtask.CustomTask() - -if 'emctask' in sys.builtin_module_names: - starttask() diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/tooltable.py b/configs/sim/axis/orphans/iocontrol-removed/python/tooltable.py deleted file mode 100644 index 83b3ab1a8a8..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/tooltable.py +++ /dev/null @@ -1,140 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import re - -class EmcToolTable(object): - ''' intended as bug-compatible Python replacement for the - tooltable io used in iocontrol - NB: old file formats not supported. - ''' - - ttype = { 'T' : int, 'P': int, 'Q':int, - 'X' : float, 'Y' : float, 'Z' : float, - 'A' : float, 'B' : float, 'C' : float, - 'U' : float, 'V' : float, 'W' : float, - 'I' : float, 'J' : float, 'D' : float } - - def __init__(self,filename,random_toolchanger): - self.filename = filename - self.random_toolchanger = random_toolchanger - - def load_table(self, tooltable,comments,fms): - self.fakepocket = 0 - fp = open(self.filename) - lno = 0 - for line in fp.readlines(): - lno += 1 - if not line.startswith(';') and line.strip(): - entry = self.parseline(lno,line.strip()) - if entry: - self.assign(tooltable,entry,comments,fms) - fp.close() - - def save_table(self, tooltable, comments,fms): - os.rename(self.filename,self.filename + '.bak') - fp = open(self.filename, 'w') - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: - fp.write("T%d P%d" % (t.toolno, p if self.random_toolchanger else fms[p])) - if t.diameter: fp.write("D%f" % (t.diameter)) - if t.offset.x: fp.write("X%+f" % (t.offset.x)) - if t.offset.y: fp.write("Y%+f" % (t.offset.y)) - if t.offset.z: fp.write("Z%+f" % (t.offset.z)) - if t.offset.a: fp.write("A%+f" % (t.offset.a)) - if t.offset.b: fp.write("B%+f" % (t.offset.b)) - if t.offset.c: fp.write("C%+f" % (t.offset.c)) - if t.offset.u: fp.write("U%+f" % (t.offset.u)) - if t.offset.v: fp.write("V%+f" % (t.offset.v)) - if t.offset.w: fp.write("W%+f" % (t.offset.w)) - if t.offset.w: fp.write("W%+f" % (t.offset.w)) - if t.frontangle: fp.write("I%+f" % (t.frontangle)) - if t.backangle: fp.write("J%+f" % (t.backangle)) - if t.orientation: fp.write("Q%+d" % (t.orientation)) - if comments.has_key(p) and comments[p]: - fp.write(";%s\n" % (comments[p])) - else: - fp.write("\n") - fp.close() - - def assign(self,tooltable,entry,comments,fms): - pocket = entry['P'] - if not self.random_toolchanger: - self.fakepocket += 1 - if self.fakepocket >= len(tooltable): - print("too many tools. skipping tool %d" % (toolno)) - return - if not fms is None: - fms[self.fakepocket] = pocket - pocket = self.fakepocket - if pocket < 0 or pocket > len(tooltable): - print("max pocket number is %d. skipping tool %d" % (len(tooltable) - 1, toolno)) - return - - tooltable[pocket].zero() - for (key,value) in entry.items(): - if key == 'T' : tooltable[pocket].toolno = value - if key == 'Q' : tooltable[pocket].orientation = value - if key == 'D' : tooltable[pocket].diameter = value - if key == 'I' : tooltable[pocket].frontangle = value - if key == 'J' : tooltable[pocket].backangle = value - if key == 'X' : tooltable[pocket].offset.x = value - if key == 'Y' : tooltable[pocket].offset.y = value - if key == 'Z' : tooltable[pocket].offset.z = value - if key == 'A' : tooltable[pocket].offset.a = value - if key == 'B' : tooltable[pocket].offset.b = value - if key == 'C' : tooltable[pocket].offset.c = value - if key == 'U' : tooltable[pocket].offset.u = value - if key == 'V' : tooltable[pocket].offset.v = value - if key == 'W' : tooltable[pocket].offset.w = value - if key == 'comment' : comments[pocket] = value # aaargh - - def parseline(self,lineno,line): - """ - read a tooltable line - if an entry was parsed successfully, return a Tool() instance - """ - line.rstrip("\n") - if re.match('\A\s*T\d+',line): - semi = line.find(";") - if semi != -1: - comment = line[semi+1:] - else: - comment = None - entry = line.split(';')[0] - result = dict() - for field in entry.split(): - (name,value) = re.search('([a-zA-Z])([+-]?\d*\.?\d*)',field).groups() - if name: - key = name.upper() - result[key] = EmcToolTable.ttype[key](value) - else: - print("%s:%d bad line: '%s' " % (self.filename, lineno, entry)) - result['comment'] = comment - return result - print("%s:%d: unrecognized tool table entry '%s'" % (self.filename,lineno,line)) - - - def restore_state(self,e): - pass - - def save_state(self,e): - pass diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/toplevel.py b/configs/sim/axis/orphans/iocontrol-removed/python/toplevel.py deleted file mode 100644 index ff4c70e2659..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/toplevel.py +++ /dev/null @@ -1,35 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import interpreter -import emccanon - -try: - import emctask - print("toplevel: milltask=",os.getpid()) -except ImportError: - print("toplevel: axis=",os.getpid()) - pass - - -import task -import oword -import remap - - diff --git a/configs/sim/axis/orphans/iocontrol-removed/python/userfuncs.py b/configs/sim/axis/orphans/iocontrol-removed/python/userfuncs.py deleted file mode 100644 index 902cfe8ff85..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/python/userfuncs.py +++ /dev/null @@ -1,73 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013 Dewey Garrett , Michael -# Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import hal -import emctask - -class UserFuncs(object): - ''' additional user-defined methods for Task() which may be called through - the IO_PLUGIN_CALL mechanism - a mixin class to CustomTask - - methods are expected to return a emctask, - ''' - def __init__(self): - print("UserFuncs.__init__()") - myhal = hal.component("myhal") - myhal.newpin("bit", hal.HAL_BIT, hal.HAL_OUT) - myhal.newpin("float", hal.HAL_FLOAT, hal.HAL_OUT) - myhal.newpin("int", hal.HAL_S32, hal.HAL_OUT) - myhal.ready() - self.myhal = myhal #FIXME - self.components["myhal"] = myhal - - def demo(self,*args, **kwargs): - print("TASK: demo(%s,%s)" % (args,kwargs)) - for i in range(int(args[0])): - self.myhal['bit'] = not self.myhal['bit'] - return emctask.RCS_STATUS.RCS_DONE - - - def show_emcstat(self,args): - ''' - snapshot some of emcstat to stdout - ''' - e = emctask.emcstat - print("mode=",e.task.mode) - print("state=",e.task.state) - print("file=",e.task.file) - print("toolOffset=",str(e.task.toolOffset)) - print("tooltable[0]=",e.io.tool.toolTable[0]) - print("g5x_offset=", e.task.g5x_offset, "system=",e.task.g5x_index) - return emctask.RCS_STATUS.RCS_DONE - - def set_named_pin(self,value,name): - print("set_named_pin ",value,name) - (component,pin) = name.rsplit('.',1) - comp = self.components[component] - - if type(comp[pin]).__name__ == 'float': - comp[pin] = value - - if type(comp[pin]).__name__ == 'int': - comp[pin] = int(value) - - if type(comp[pin]).__name__ == 'bool': - comp[pin] = bool(int(value)) - - return emctask.RCS_STATUS.RCS_DONE diff --git a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.glade b/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.glade deleted file mode 100644 index 103d40755a1..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.glade +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - True - 14 - 2 - - - True - 2 - #16eefaef15f5 - - - 1 - 2 - 1 - 2 - - 4 - 4 - - - - - True - 2 - #ffff3ff60e08 - - - 1 - 2 - - 4 - 4 - - - - - True - tool-lock - - - - 4 - 4 - - - - - True - tool-flush - - - 1 - 2 - - 4 - 4 - - - - - True - lube - - - 2 - 3 - - - - - True - tool-prepare - - - 7 - 8 - - - - - True - tool-change - - - 8 - 9 - - - - - True - start-change - - - 9 - 10 - - - - - True - user-enable-out - - - 10 - 11 - - - - - True - toolchanger-reason - - - 12 - 13 - - - - - True - Prepapred pocket: %d - - - 5 - 6 - - - - - True - Prepared tool: %d - - - 1 - 2 - 5 - 6 - - - - - True - Current tool: %d - - - 6 - 7 - - - - - True - EMC abort reason: %d - - - 1 - 2 - 6 - 7 - - - - - True - 2 - green - - - 1 - 2 - 7 - 8 - - - - - True - 2 - yellow - - - 1 - 2 - 8 - 9 - - - - - True - 2 - #ffffae230cc9 - - - 1 - 2 - 9 - 10 - - - - - True - 2 - #111bcaebe8ee - - - 1 - 2 - 10 - 11 - - - - - True - True - - 0 -100 100 1 10 10 - - - 1 - 2 - 12 - 13 - - - - - Toolchanger - fault - True - True - True - - - 13 - 14 - - - - - True - toolchanger-faulted - - - 11 - 12 - - - - - True - 2 - - - 1 - 2 - 11 - 12 - - - - - Clear -Toolchanger Fault - True - True - True - - - 1 - 2 - 13 - 14 - - - - - True - 2 - #f408fedc13df - - - 1 - 2 - 2 - 3 - - - - - True - 2 - #1124f4938d56 - - - 1 - 2 - 3 - 4 - - - - - True - flood - - - 4 - 5 - - - - - True - 2 - #0484f8b4bb27 - - - 1 - 2 - 4 - 5 - - - - - True - mist - - - 3 - 4 - - - - - - diff --git a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.ui b/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.ui deleted file mode 100644 index 7838c03a11a..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange-noioctl.ui +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - True - 14 - 2 - - - True - 2 - #16eefaef15f5 - - - 1 - 2 - 1 - 2 - - 4 - 4 - - - - - True - 2 - #ffff3ff60e08 - - - 1 - 2 - - 4 - 4 - - - - - True - tool-lock - - - - 4 - 4 - - - - - True - tool-flush - - - 1 - 2 - - 4 - 4 - - - - - True - lube - - - 2 - 3 - - - - - True - tool-prepare - - - 7 - 8 - - - - - True - tool-change - - - 8 - 9 - - - - - True - start-change - - - 9 - 10 - - - - - True - user-enable-out - - - 10 - 11 - - - - - True - toolchanger-reason - - - 12 - 13 - - - - - True - Prepapred pocket: %d - - - 5 - 6 - - - - - True - Prepared tool: %d - - - 1 - 2 - 5 - 6 - - - - - True - Current tool: %d - - - 6 - 7 - - - - - True - EMC abort reason: %d - - - 1 - 2 - 6 - 7 - - - - - True - 2 - green - - - 1 - 2 - 7 - 8 - - - - - True - 2 - yellow - - - 1 - 2 - 8 - 9 - - - - - True - 2 - #ffffae230cc9 - - - 1 - 2 - 9 - 10 - - - - - True - 2 - #111bcaebe8ee - - - 1 - 2 - 10 - 11 - - - - - True - True - - reason - - - 1 - 2 - 12 - 13 - - - - - Toolchanger - fault - True - True - True - - - 13 - 14 - - - - - True - toolchanger-faulted - - - 11 - 12 - - - - - True - 2 - - - 1 - 2 - 11 - 12 - - - - - Clear -Toolchanger Fault - True - True - True - - - 1 - 2 - 13 - 14 - - - - - True - 2 - #f408fedc13df - - - 1 - 2 - 2 - 3 - - - - - True - 2 - #1124f4938d56 - - - 1 - 2 - 3 - 4 - - - - - True - flood - - - 4 - 5 - - - - - True - 2 - #0484f8b4bb27 - - - 1 - 2 - 4 - 5 - - - - - True - mist - - - 3 - 4 - - - - - - - -100 - 100 - 1 - 10 - 10 - - diff --git a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange.hal b/configs/sim/axis/orphans/iocontrol-removed/racktoolchange.hal deleted file mode 100644 index 96a6c0d6e13..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/racktoolchange.hal +++ /dev/null @@ -1,2 +0,0 @@ - -net emc-abort-loop iocontrol.0.emc-abort iocontrol.0.emc-abort-ack diff --git a/configs/sim/axis/orphans/iocontrol-removed/tool.tbl b/configs/sim/axis/orphans/iocontrol-removed/tool.tbl deleted file mode 120000 index 4393451da6c..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/tool.tbl +++ /dev/null @@ -1 +0,0 @@ -../tool.tbl \ No newline at end of file diff --git a/configs/sim/axis/orphans/iocontrol-removed/tooltable.sql b/configs/sim/axis/orphans/iocontrol-removed/tooltable.sql deleted file mode 100644 index ac84dfb8809..00000000000 --- a/configs/sim/axis/orphans/iocontrol-removed/tooltable.sql +++ /dev/null @@ -1,47 +0,0 @@ - -BEGIN TRANSACTION; - -DROP TABLE IF EXISTS "tools"; -CREATE TABLE "tools" ( - toolno INTEGER PRIMARY KEY, - pocket INTEGER, - diameter REAL DEFAULT (0.0), - backangle REAL DEFAULT (0.0), - frontangle REAL DEFAULT (0.0), - orientation INTEGER DEFAULT (0.0), - comment TEXT DEFAULT (NULL), - x_offset REAL DEFAULT (0.0), - y_offset REAL DEFAULT (0.0), - z_offset REAL DEFAULT (0.0), - a_offset REAL DEFAULT (0.0), - b_offset REAL DEFAULT (0.0), - c_offset REAL DEFAULT (0.0), - u_offset REAL DEFAULT (0.0), - v_offset REAL DEFAULT (0.0), - w_offset REAL DEFAULT (0.0) -); - - - -INSERT INTO "tools" VALUES (1,6,4.0, 0.0,0.0,0.0,"tool1",1.2,0.0,3.7,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (2,4,2.0, 0.0,0.0,0.0,"tool2",0.2,0.0,1.2,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (3,3,3.3, 0.0,0.0,0.0,"tool3",3.2,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (4,2,1.2, 0.0,0.0,0.0,"tool4",0.0,0.0,5.9,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (5,5,6.2, 0.0,0.0,0.0,"tool5",0.0,0.0,1.1,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (6,1,1.9, 0.0,0.0,0.0,"tool6",0.0,0.0,3.4,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (7,8,0.3, 0.0,0.0,0.0,"tool7",0.0,0.0,1.7,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (8,11,2.50, 0.0,0.0,0.0,"tool8",0.0,0.0,2.7,0.0,0.0,0.0,0.0,0.0,0.0); -INSERT INTO "tools" VALUES (9,24,1.1, 0.0,0.0,0.0,"tool9",0.0,0.0,4.9,0.0,0.0,0.0,0.0,0.0,0.0); - -DROP TABLE IF EXISTS "state"; -CREATE TABLE "state" ( - tool_in_spindle INTEGER, - pocket_prepped INTEGER - -); - -INSERT INTO "state" VALUES (6,0); - - - -COMMIT; diff --git a/configs/sim/axis/orphans/iocontrol-removed/tooltable.sqlite b/configs/sim/axis/orphans/iocontrol-removed/tooltable.sqlite deleted file mode 100644 index be4f80f5e2c..00000000000 Binary files a/configs/sim/axis/orphans/iocontrol-removed/tooltable.sqlite and /dev/null differ diff --git a/configs/sim/axis/orphans/iov2.hal b/configs/sim/axis/orphans/iov2.hal deleted file mode 100644 index bbc69051d74..00000000000 --- a/configs/sim/axis/orphans/iov2.hal +++ /dev/null @@ -1,7 +0,0 @@ - -# jumper iocontrolv2 pins -net emc-abort-loop iocontrol.0.emc-abort iocontrol.0.emc-abort-ack -net start-change-loop iocontrol.0.start-change iocontrol.0.start-change-ack - - -setp iocontrol.0.toolchanger-reason 134 diff --git a/configs/sim/axis/orphans/medium.ini b/configs/sim/axis/orphans/medium.ini deleted file mode 100644 index 4877b9acf65..00000000000 --- a/configs/sim/axis/orphans/medium.ini +++ /dev/null @@ -1,122 +0,0 @@ -[EMC] -VERSION = 1.1 -MACHINE = LinuxCNC-HAL-SIM-AXIS -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -DEBUG = 0 - -[DISPLAY] -DISPLAY = axis -CYCLE_TIME = 0.100 -HELP_FILE = doc/help.txt -POSITION_OFFSET = RELATIVE -POSITION_FEEDBACK = ACTUAL -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 -MAX_LINEAR_VELOCITY = 1.2 -DEFAULT_LINEAR_VELOCITY = .25 -PROGRAM_PREFIX = ../../../nc_files/ -INTRO_GRAPHIC = linuxcnc.gif -INTRO_TIME = 5 -#EDITOR = geany -TOOL_EDITOR = tooledit -INCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in - -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 - -[RS274NGC] -PARAMETER_FILE = sim.var - -[EMCMOT] -EMCMOT = motmod -COMM_TIMEOUT = 1.0 -SERVO_PERIOD = 1000000 - -[TASK] -TASK = milltask -CYCLE_TIME = 0.001 - -[HAL] - HALUI = halui -HALFILE = LIB:basic_sim.tcl -HALFILE = check_xyz_constraints.hal - -[TRAJ] -COORDINATES = X Y Z -LINEAR_UNITS = inch -ANGULAR_UNITS = degree -DEFAULT_LINEAR_VELOCITY = 10 -POSITION_FILE = position.txt -MAX_LINEAR_VELOCITY = 10 - -[EMCIO] -EMCIO = io -CYCLE_TIME = 0.100 -TOOL_TABLE = sim.tbl -TOOL_CHANGE_POSITION = 0 0 0 -TOOL_CHANGE_QUILL_UP = 1 - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -MAX_VELOCITY = 1.83 -MAX_ACCELERATION = 15 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 1.83 -MAX_ACCELERATION = 15 -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 - -[AXIS_Y] -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -MAX_VELOCITY = 1.83 -MAX_ACCELERATION = 15 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 1.83 -MAX_ACCELERATION = 15 -MIN_LIMIT = -40.0 -MAX_LIMIT = 40.0 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 1 - -[AXIS_Z] -MIN_LIMIT = -8.0 -MAX_LIMIT = 8.0 -MAX_VELOCITY = 1.5 -MAX_ACCELERATION = 15 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 1.5 -MAX_ACCELERATION = 15 -MIN_LIMIT = -8.0 -MAX_LIMIT = 8.0 -HOME_OFFSET = 1.0 -HOME_SEARCH_VEL = 20.0 -HOME_LATCH_VEL = 20.0 -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 diff --git a/configs/sim/axis/orphans/no-iotask.nml b/configs/sim/axis/orphans/no-iotask.nml deleted file mode 100644 index bd76900ac5d..00000000000 --- a/configs/sim/axis/orphans/no-iotask.nml +++ /dev/null @@ -1,47 +0,0 @@ - -# Note: emcsvr is the master for all NML channels, and therefore is the -# first to start. - -# Buffers -# Name Type Host size neut? (old) buffer# MP --- - -# Top-level buffers to EMC -B emcCommand SHMEM localhost 8192 0 0 1 16 1001 TCP=5005 xdr -B emcStatus SHMEM localhost 16384 0 0 2 16 1002 TCP=5005 xdr -B emcError SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue - -# These are for the IO controller, EMCIO -#B toolCmd SHMEM localhost 1024 0 0 4 16 1004 TCP=5005 xdr -#B toolSts SHMEM localhost 8192 0 0 5 16 1005 TCP=5005 xdr - -# Processes -# Name Buffer Type Host Ops server? timeout master? cnum - -P emc emcCommand LOCAL localhost RW 0 1.0 0 0 -P emc emcStatus LOCAL localhost W 0 1.0 0 0 -P emc emcError LOCAL localhost W 0 1.0 0 0 -P emc toolCmd LOCAL localhost W 0 1.0 0 0 -P emc toolSts LOCAL localhost R 0 1.0 0 0 - -P emcsvr emcCommand LOCAL localhost W 1 1.0 1 2 -P emcsvr emcStatus LOCAL localhost R 1 1.0 1 2 -P emcsvr emcError LOCAL localhost R 1 1.0 1 2 -P emcsvr toolCmd LOCAL localhost W 1 1.0 1 2 -P emcsvr toolSts LOCAL localhost R 1 1.0 1 2 -P emcsvr default LOCAL localhost RW 1 1.0 1 2 - -#P tool emcError LOCAL localhost W 0 1.0 0 3 -#P tool toolCmd LOCAL localhost RW 0 1.0 0 3 -#P tool toolSts LOCAL localhost W 0 1.0 0 3 - -P xemc emcCommand LOCAL localhost W 0 10.0 0 10 -P xemc emcStatus LOCAL localhost R 0 10.0 0 10 -P xemc emcError LOCAL localhost R 0 10.0 0 10 -P xemc toolCmd LOCAL localhost W 0 10.0 0 10 -P xemc toolSts LOCAL localhost R 0 10.0 0 10 - -P keystick emcCommand LOCAL localhost W 0 10.0 0 10 -P keystick emcStatus LOCAL localhost R 0 10.0 0 10 -P keystick emcError LOCAL localhost R 0 10.0 0 10 -P keystick toolCmd LOCAL localhost W 0 10.0 0 10 -P keystick toolSts LOCAL localhost R 0 10.0 0 10 diff --git a/configs/sim/axis/orphans/py.ini.notworking b/configs/sim/axis/orphans/py.ini.notworking deleted file mode 100644 index 41a9859315f..00000000000 --- a/configs/sim/axis/orphans/py.ini.notworking +++ /dev/null @@ -1,433 +0,0 @@ -# EMC controller parameters for a simulated machine. -# General note: Comments can either be preceded with a # or ; - either is -# acceptable, although # is in keeping with most linux config files. -# General section ------------------------------------------------------------- - -[EMC] -# make emcsrv not create tool rcs channels if not using iocontrol -TOOL_CHANNELS = 0 -# Name of NML file to use, default is emc.nml -NML_FILE = no-iotask.nml -# Version of this INI file -VERSION = 1.0 -# Name of machine, for use with display, etc. -MACHINE = py.ini -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -#DEBUG = 0x7FFFFFFF -#DEBUG = 0x7FFFDEFF #no interp,oword -#DEBUG = 0x00008000 # py only -#DEBUG = 0x0000E000 # py + remap + Oword -#DEBUG = 0x0000C000 # py + remap -#DEBUG = 0x0000C100 # py + remap + Interpreter -#DEBUG = 0x0000C140 # py + remap + Interpreter + NML msgs -DEBUG = 0x0000C040 # py + remap + NML -#DEBUG = 0x0003E100 # py + remap + Interpreter + oword + signals + namedparams -#DEBUG = 0x00008000 -#DEBUG = 0 # 0x00000100 -# 0x00000001 Ausgabe ungültige Meldungen -# 0x00000002 Ausgabe Konfigurations-Settings -# 0x00000004 Ausgabe Defaults -# 0x00000008 Ausgabe Version -# 0x00000010 Ausgabe Task Meldungen -# 0x00000020 Ausgabe IO-Points -# 0x00000040 Ausgabe NML-Messages -# 0x00000080 Ausgabe Zeit zur Beendigung einer Motorbewegung -# 0x00000100 Ausgabe Intepreter Debugging -# 0x00000200 Ausgabe RCS-Debugging -# 0x00000400 Ausgabe Roh-Bahn-Daten -# 0x00000800 Ausgabe Interpreter List -#define EMC_DEBUG_IOCONTROL 0x00001000 -#define EMC_DEBUG_OWORD 0x00002000 -#define EMC_DEBUG_REMAP 0x00004000 -#define EMC_DEBUG_PYTHON 0x00008000 -#define EMC_DEBUG_NAMEDPARAM 0x00010000 -# EMC_DEBUG_GDBONSIGNAL flag 0x00020000 -# 0x7FFFFFFF Ausgabe alle Debugging Messages -# Sections for display options ------------------------------------------------ - -[DISPLAY] -GLADEVCP=osubdemo-ns.ui -# Name of display program, e.g., xemc -DISPLAY = axis -#OPEN_FILE=../../nc_files/m66test.ngc -#OPEN_FILE=/home/mah/emc2-tc/nc_files/arcspiral.ngc -#OPEN_FILE=/home/mah/emc2-tc/nc_files/taskcall.ngc -OPEN_FILE=./taskcall.ngc -# Cycle time, in seconds, that display will sleep between polls -CYCLE_TIME = 0.100 -# Path to help file -HELP_FILE = doc/help.txt -# Initial display setting for position, RELATIVE or MACHINE -POSITION_OFFSET = RELATIVE -# Initial display setting for position, COMMANDED or ACTUAL -POSITION_FEEDBACK = ACTUAL -# Highest value that will be allowed for feed override, 1.0 = 100% -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 -# Prefix to be used -#PROGRAM_PREFIX = /home/mah/emc2-tc/nc_files/ -PROGRAM_PREFIX = ../../nc_files -# Introductory graphic -#INTRO_GRAPHIC = emc2.gif -INTRO_TIME = 0 -#EDITOR = geany -INCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in - -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 -# Task controller section ----------------------------------------------------- - -[RS274NGC] -#PRINT_CODES = 1 -SUBROUTINE_PATH = ../../nc_files/remap_lib/common_nc_subs -#RS274NGC_STARTUP_CODE = G21 -# this bombs - machine not on yet so no 'I/O' possible -#RS274NGC_STARTUP_CODE = M61Q3 -# handler procedure called on aborts - to cleanup HAL pins etc -#ON_ABORT_COMMAND=ocall -#LOG_FILE= py.log -LOG_LEVEL = 9 -# File containing interpreter variables -PARAMETER_FILE = sim_mm.var -# generalized remapping -#------------------------ -# currently only unused M- and G-codes may be activated as per below, except for the -# T,M6,M61,S and F codes. -# G: currently supported modal group: 1 -# M:currently supported modal groups: 5,6,7,8,9,10 -# for T,S,F remaps the modal group is fixed and any modalgroup= option is ignored -# An argument specification (keyword 'argspec') describes required and permitted words, -# and preconditions for that code to execute. -# - -# It consists of 0-n characters of the class [@A-KMNP-Za-kmnp-z^>] . -# -# parameter words: -# an uppercase letter for each required parameter 'word' -# a lowercase letter for each optional parameter 'word' -# -# Preconditions: -# an '^' means: speed must be > 0 -# an '>' means: feed must be > 0 -# -# if calling an NGC oword function (ngc=), the parameters are passed -# as local named parameters which are already set when the function starts -# optional words are passed if set in the block, and may be tested for existence -# by # EXISTS(#<..>) . -# -# example: -# REMAP=M400 modalgroup=10 argspec=Px ngc=demosub -# -# executing 'M400 P2 X3' will result in the call -# o call -# -# the demosub.ngc body might look as follows: -#------------------------- -# o sub -# -# (debug, P=#) (note: P is required since it's uppercase in the argspec) -# -# (the x argspec is optional since its lowercase in the argspec. Use as follows:) -# - -# o100 if [EXISTS[#]] -# (debug, X param set: #) -# o100 endif -# -# o endsub -# M2 -#------------------------- -# -# Calling with traditional positioal parameter lists: -# -# To do so, add the '@' character to the argspec. -# In this case, the arguments (required or optional) will be passed tradional-style -# ini example: -# REMAP=M400 modalgroup=10 argspec=@XYp ngc=demosub -# -# executing 'M400 X2 Y3' will result in the call - -# o call [2] [3] -# -# executing 'M400 X2 Y3 P4' will result in the call - -# o call [2] [3] [4] -# -# NB: you lose the capability to distinguish more than one optional parameter word! -# -# if calling a Python function, the actual words present in the block as -# required or optional are passed in the words dictionary; no positional -# parameters are passed in this case. -#REMAP=F python=blah deppert -aanix -REMAP=G88.1 modalgroup=1 argspec=xyzpqr ngc=g881min -REMAP=G88.2 modalgroup=1 argspec=xyzpqr ngc=g882min prolog=addlocals -#prolog=fooprolog epilog=fooepilog -#REMAP=G88.6 modalgroup=1 argspec=@XYZ ngc=g886 -#REMAP=G88.8 modalgroup=1 argspec=XYZ python=m315 -# cone cycle -# abcdefhijklpqrstuvwxyz -REMAP=G88.9 modalgroup=1 argspec=@XZIJKLPQRABC ngc=rcone - -# ( o call [X1][Z1][X2][Z2][step][feed][EngageZ][ClearAxial][ClearRadial][feedF][outflag]) -# O sub -# (Startpoint) - -# # = [#1] X - -# # = [#2] Z -# (Endpoint) - -# # = [#3] I - -# # = [#4] J - -# # = [#5] (Radial stepdown) K - -# # = [#6] (Roughing feed rate) L - -# # = [#7] (Clearance to stock) P - -# # = [#8] (Axial rest material for finishing) Q - -# # = [#9] (Radial rest material for finishing) R - -# # = [#10] (Finishing feed rate) A - -# # = [#11] (Lead out move) B - -# # = [#3] (Start position in X) C -#REMAP=M75 modalgroup=10 python=m250 -#REMAP=M250 modalgroup=10 argspec=xyzpqr python=whoami prolog=fooprolog epilog=fooepilog -#REMAP=M251 modalgroup=6 argspec=xyzpqr python=whoami -#REMAP=M315 modalgroup=10 python=m315 -REMAP=M400 modalgroup=10 prolog=introspect ngc=nestremap -REMAP=M401 modalgroup=10 prolog=introspect ngc=null_sub -REMAP=M402 modalgroup=10 argspec=p python=test_reschedule -REMAP=M403 modalgroup=10 argspec=p python=print_tool -REMAP=M404 modalgroup=10 argspec=PQ python=set_tool_zoffset -#REMAP=S ngc=sdemo prolog=sprolog -#REMAP=F ngc=null_sub # python=null_remap -#REMAP=S python=null_remap -# see pythonsubs.py and nc_files/remap-subroutines -#REMAP=T argspec=T prolog=prepare_prolog epilog=prepare_epilog ngc=prepare -#REMAP=M61 modalgroup=6 argspec=Q python=set_tool_number -#REMAP=M6 modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog -# for a -REMAP=T argspec=T prolog=prepare_prolog ngc=rtdemo epilog=prepare_epilog -REMAP=M6 modalgroup=6 prolog=change_prolog ngc=rm6demo epilog=change_epilog -#REMAP=M61 modalgroup=6 prolog=change_prolog ngc=rm6demo.ngc epilog=change_epilog -#REMAP=M61 modalgroup=6 argspec=Q python=set_tool_number -# this needs work.. -#RETAIN_G43=1 -REMAP=M900 python=gen_backtrace modalgroup=10 -REMAP=M901 python=gdb_window modalgroup=10 -REMAP=M950 argspec=p python=symbols modalgroup=10 -# a plain .ngc sub call by M42: -# -#REMAP=M42 modalgroup=9 prolog=setup_m42 ngc=m42.ngc epilog=finish_m42 -# -# semantics: -# if M42 is encountered, execute it in modal group 9. -# Fail if other group 9 codes are present in the current block. -# the setup_m42 prolog Python function will be called before executing 'o call' -# Then the O-word sub m42.ngc is executed. -# The finish_m42 epilog Python function will be executed after m42.ngc finishes. -# - -[EMCMOT] -EMCMOT = motmod -# Timeout for comm to emcmot, in seconds -COMM_TIMEOUT = 1.0 -# BASE_PERIOD is unused in this configuration but specified in core_sim.hal -BASE_PERIOD = 0 -# Servo task period, in nano-seconds -SERVO_PERIOD = 1000000 -# Hardware Abstraction Layer section -------------------------------------------------- - -[TASK] -# Name of task controller program, e.g., milltask -TASK = milltask -# Cycle time, in seconds, that task controller will sleep between polls -CYCLE_TIME = 0.001 -# the Python plugins serves the interpreter as well as task - -[HAL] -# The run script first uses halcmd to execute any HALFILE -# files, and then to execute any individual HALCMD commands. -# -# list of hal config files to run through halcmd -# files are executed in the order in which they appear -#HALFILE = core_sim_noio.hal -#HALFILE = core_sim.hal -POSTTASK_HALFILE = core_sim_test.hal -#HALFILE = axis_owordsub_manualtoolchange.hal -#HALFILE = simulated_home.hal -POSTTASK_HALFILE = simulated_home.hal -#HALFILE = gamepad.hal -# list of halcmd commands to execute -# commands are executed in the order in which they appear -#HALCMD = save neta -# Single file that is executed after the GUI has started. Only supported by -# AXIS at this time (only AXIS creates a HAL component of its own) -#POSTGUI_HALFILE = test_postgui.hal -POSTGUI_HALFILE = v2_oword_gladevcp_postgui_noio.hal -HALUI = halui -# Trajectory planner section -------------------------------------------------- - -[HALUI] -#No Content - -[TRAJ] -COORDINATES = X Y Z -HOME = 0 0 0 -LINEAR_UNITS = mm -ANGULAR_UNITS = degree -DEFAULT_VELOCITY = 30.48 -MAX_VELOCITY = 53.34 -DEFAULT_ACCELERATION = 508 -MAX_ACCELERATION = 508 -POSITION_FILE = position_mm.txt -NO_FORCE_HOMING = 1 -# Axes sections --------------------------------------------------------------- -# First axis - -[EMCIO] -# Name of IO controller program, e.g., io -# explicitly support the start-change protocol. -# needs to be explicitly enabled for backwards compatibility. -# NB: if the start-change pin isn't used it needs to be looped like below to -# start-change-ack or an M6 will hang waiting for start-change-ack: -# net start-change iocontrol.0.start-change iocontrol.0.start-change-ack -#EMCIO = iov2 -support-start-change -# starting iov2 like so will create the start-change and start-change-ack pins -# but the start-change protocol remains disabled - start-change remains low and -# start-change-ack is ignored: -#EMCIO = iov2 -# cycle time, in seconds -CYCLE_TIME = 0.100 -# tool table file -#TOOL_TABLE = sim_mm_test.tbl -TOOL_TABLE = nstools.tbl -TOOL_CHANGE_POSITION = 0 0 50.8 -#RANDOM_TOOLCHANGER = 1 - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 -# Second axis - -[AXIS_Y] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -# Third axis - -[AXIS_Z] -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 25.4 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 -# section for main IO controller parameters ----------------------------------- - -[PYTHON] -#PLUGIN_DIR=/home/mah/emc2-tc/configs/sim/pysubs -PLUGIN_DIR=./pysubs -# import the following Python modules -MODULE_BASENAME=plugins -# if this is set: -RELOAD_ON_CHANGE=1 -# and the file specified in MODULE_BASENAME was changed, it will be reloaded before -# executing any Python calls -# This is handy for debugging because you dont need to restart EMC -# BUT it incurs a bit of overhead per call so you might want to turn -# it off in production mode -# the Python reload_on_change variable may be used to toggle this -# at runtime -#LOG_FILE= py.log -LOG_LEVEL = 3 -# the python Task() instance variable -TASKVAR = pytask -# Part program interpreter section -------------------------------------------- - -[VARS] - -# accessible in interp as #<_[section]name> -FOO = 47.11 -X=3 -Y=4 -Z=5 -TOOL_CHANGE_POSITION_X = 1 -TOOL_CHANGE_POSITION_Y = 2 -TOOL_CHANGE_POSITION_Z = 3 -# Motion control section ------------------------------------------------------ diff --git a/configs/sim/axis/orphans/pyiocontrol.ini.notworking b/configs/sim/axis/orphans/pyiocontrol.ini.notworking deleted file mode 100644 index 2559122e82c..00000000000 --- a/configs/sim/axis/orphans/pyiocontrol.ini.notworking +++ /dev/null @@ -1,490 +0,0 @@ -# EMC controller parameters for a simulated machine. -# General note: Comments can either be preceded with a # or ; - either is -# acceptable, although # is in keeping with most linux config files. -# General section ------------------------------------------------------------- - -[EMC] -# make emcsrv not create tool rcs channels if not using iocontrol -TOOL_CHANNELS = 0 -# Name of NML file to use, default is emc.nml -NML_FILE = no-iotask.nml -# Version of this INI file -VERSION = 1.0 -# Name of machine, for use with display, etc. -MACHINE = pyiocontrol.ini -# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others -#DEBUG = 0x7FFFFFFF -#DEBUG = 0x7FFFDEFF #no interp,oword -#DEBUG = 0x00008000 # py only -#DEBUG = 0x0000E000 # py + remap + Oword -#DEBUG = 0x0000C000 # py + remap -#DEBUG = 0x0000C100 # py + remap + Interpreter -#DEBUG = 0x0000C140 # py + remap + Interpreter + NML msgs -DEBUG = 0x0004C140 # py + remap + Interpreter + NML msgs + PythonTask -#DEBUG = 0x0000C040 # py + remap + NML -#DEBUG = 0x0004C040 # py + remap + NML + PythonTask -#DEBUG = 0x0003E100 # py + remap + Interpreter + oword + signals + namedparams -#DEBUG = 0x00008000 -#DEBUG = 0 # 0x00000100 -# 0x00000001 Ausgabe ungültige Meldungen -# 0x00000002 Ausgabe Konfigurations-Settings -# 0x00000004 Ausgabe Defaults -# 0x00000008 Ausgabe Version -# 0x00000010 Ausgabe Task Meldungen -# 0x00000020 Ausgabe IO-Points -# 0x00000040 Ausgabe NML-Messages -# 0x00000080 Ausgabe Zeit zur Beendigung einer Motorbewegung -# 0x00000100 Ausgabe Intepreter Debugging -# 0x00000200 Ausgabe RCS-Debugging -# 0x00000400 Ausgabe Roh-Bahn-Daten -# 0x00000800 Ausgabe Interpreter List -#define EMC_DEBUG_IOCONTROL 0x00001000 -#define EMC_DEBUG_OWORD 0x00002000 -#define EMC_DEBUG_REMAP 0x00004000 -#define EMC_DEBUG_PYTHON 0x00008000 -#define EMC_DEBUG_NAMEDPARAM 0x00010000 -#define EMC_DEBUG_GDBONSIGNAL 0x00020000 -#define EMC_DEBUG_PYTHON_TASK 0x00040000 -# 0x7FFFFFFF Ausgabe alle Debugging Messages -# Sections for display options ------------------------------------------------ - -[DISPLAY] -# how to use the Firefox SQlite manager plugin as tooltable editor: -# -# 0: read http://code.google.com/p/sqlite-manager/wiki/XulrunnerApplication#More_details -# -# 1. download the zip file 'SQLiteManager 0.7.6 as XULRunner App ' -# or whatever is the latest from http://code.google.com/p/sqlite-manager/downloads/list -# -# 2. Install like so: -# sudo xulrunner --install-app /path/to/zipfile -# This will install an app in /usr/local/lib/lazierthanthou/sqlite-manager/sqlite-manager . -# (note this path recently change - please verify) -# -# 3. try the following command line with an appropriate path to the tooltable database: -# -TOOL_EDITOR= firefox -app /usr/lib/lazierthanthou/sqlite-manager/application.ini -f /home/mah/emc2-tc/configs/sim/tooltable.sqlite -#GLADEVCP=osubdemo-ns.ui -# Name of display program, e.g., xemc -DISPLAY = axis -#OPEN_FILE=../../nc_files/m66test.ngc -#OPEN_FILE=/home/mah/emc2-tc/nc_files/arcspiral.ngc -#OPEN_FILE=/home/mah/emc2-tc/nc_files/taskcall.ngc -OPEN_FILE=./taskcall.ngc -# Cycle time, in seconds, that display will sleep between polls -CYCLE_TIME = 0.100 -# Path to help file -HELP_FILE = doc/help.txt -# Initial display setting for position, RELATIVE or MACHINE -POSITION_OFFSET = RELATIVE -# Initial display setting for position, COMMANDED or ACTUAL -POSITION_FEEDBACK = ACTUAL -# Highest value that will be allowed for feed override, 1.0 = 100% -MAX_FEED_OVERRIDE = 1.2 -MAX_SPINDLE_OVERRIDE = 1.0 -# Prefix to be used -#PROGRAM_PREFIX = /home/mah/emc2-tc/nc_files/ -PROGRAM_PREFIX = ../../nc_files/ -# Introductory graphic -#INTRO_GRAPHIC = emc2.gif -INTRO_TIME = 0 -#EDITOR = geany -INCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in - -[FILTER] -PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image -PROGRAM_EXTENSION = .py Python Script -png = image-to-gcode -gif = image-to-gcode -jpg = image-to-gcode -py = python3 -# Task controller section ----------------------------------------------------- - -[RS274NGC] -#PRINT_CODES = 1 -SUBROUTINE_PATH = ../../nc_files/remap_lib/common_nc_subs -#RS274NGC_STARTUP_CODE = G21 -# this bombs - machine not on yet so no 'I/O' possible -#RS274NGC_STARTUP_CODE = M61Q3 -# handler procedure called on aborts - to cleanup HAL pins etc -#ON_ABORT_COMMAND=ocall -#LOG_FILE= py.log -LOG_LEVEL = 9 -# File containing interpreter variables -PARAMETER_FILE = sim_mm.var -# generalized remapping -#------------------------ -# currently only unused M- and G-codes may be activated as per below, except for the -# T,M6,M61,S and F codes. -# G: currently supported modal group: 1 -# M:currently supported modal groups: 5,6,7,8,9,10 -# for T,S,F remaps the modal group is fixed and any modalgroup= option is ignored -# An argument specification (keyword 'argspec') describes required and permitted words, -# and preconditions for that code to execute. -# - -# It consists of 0-n characters of the class [@A-KMNP-Za-kmnp-z^>] . -# -# parameter words: -# an uppercase letter for each required parameter 'word' -# a lowercase letter for each optional parameter 'word' -# -# Preconditions: -# an '^' means: speed must be > 0 -# an '>' means: feed must be > 0 -# -# if calling an NGC oword function (ngc=), the parameters are passed -# as local named parameters which are already set when the function starts -# optional words are passed if set in the block, and may be tested for existence -# by # EXISTS(#<..>) . -# -# example: -# REMAP=M400 modalgroup=10 argspec=Px ngc=demosub -# -# executing 'M400 P2 X3' will result in the call -# o call -# -# the demosub.ngc body might look as follows: -#------------------------- -# o sub -# -# (debug, P=#) (note: P is required since it's uppercase in the argspec) -# -# (the x argspec is optional since its lowercase in the argspec. Use as follows:) -# - -# o100 if [EXISTS[#]] -# (debug, X param set: #) -# o100 endif -# -# o endsub -# M2 -#------------------------- -# -# Calling with traditional positioal parameter lists: -# -# To do so, add the '@' character to the argspec. -# In this case, the arguments (required or optional) will be passed tradional-style -# ini example: -# REMAP=M400 modalgroup=10 argspec=@XYp ngc=demosub -# -# executing 'M400 X2 Y3' will result in the call - -# o call [2] [3] -# -# executing 'M400 X2 Y3 P4' will result in the call - -# o call [2] [3] [4] -# -# NB: you lose the capability to distinguish more than one optional parameter word! -# -# if calling a Python function, the actual words present in the block as -# required or optional are passed in the words dictionary; no positional -# parameters are passed in this case. -#REMAP=F python=blah deppert -aanix -REMAP=G88.1 modalgroup=1 argspec=xyzpqr ngc=g881min -REMAP=G88.2 modalgroup=1 argspec=xyzpqr ngc=g882min prolog=addlocals -#prolog=fooprolog epilog=fooepilog -#REMAP=G88.6 modalgroup=1 argspec=@XYZ ngc=g886 -#REMAP=G88.8 modalgroup=1 argspec=XYZ python=m315 -# cone cycle -# abcdefhijklpqrstuvwxyz -REMAP=G88.9 modalgroup=1 argspec=@XZIJKLPQRABC ngc=rcone - -# ( o call [X1][Z1][X2][Z2][step][feed][EngageZ][ClearAxial][ClearRadial][feedF][outflag]) -# O sub -# (Startpoint) - -# # = [#1] X - -# # = [#2] Z -# (Endpoint) - -# # = [#3] I - -# # = [#4] J - -# # = [#5] (Radial stepdown) K - -# # = [#6] (Roughing feed rate) L - -# # = [#7] (Clearance to stock) P - -# # = [#8] (Axial rest material for finishing) Q - -# # = [#9] (Radial rest material for finishing) R - -# # = [#10] (Finishing feed rate) A - -# # = [#11] (Lead out move) B - -# # = [#3] (Start position in X) C -#REMAP=M75 modalgroup=10 python=m250 -#REMAP=M250 modalgroup=10 argspec=xyzpqr python=whoami prolog=fooprolog epilog=fooepilog -#REMAP=M251 modalgroup=6 argspec=xyzpqr python=whoami -#REMAP=M315 modalgroup=10 python=m315 -REMAP=M400 modalgroup=10 prolog=introspect ngc=nestremap -REMAP=M401 modalgroup=10 prolog=introspect ngc=null_sub -REMAP=M402 modalgroup=10 argspec=p python=test_reschedule -REMAP=M403 modalgroup=10 argspec=p python=print_tool -REMAP=M404 modalgroup=10 argspec=PQ python=set_tool_zoffset -#REMAP=S ngc=sdemo prolog=sprolog -#REMAP=F ngc=null_sub # python=null_remap -#REMAP=S python=null_remap -# see pythonsubs.py and nc_files/remap-subroutines -#REMAP=T argspec=T prolog=prepare_prolog epilog=prepare_epilog ngc=prepare -#REMAP=M61 modalgroup=6 argspec=Q python=set_tool_number -#REMAP=M6 modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog -# for a -#REMAP=T argspec=T prolog=prepare_prolog ngc=rtdemo epilog=prepare_epilog -#REMAP=M6 modalgroup=6 prolog=change_prolog ngc=rm6demo epilog=change_epilog -#REMAP=M61 modalgroup=6 prolog=change_prolog ngc=rm6demo.ngc epilog=change_epilog -#REMAP=M61 modalgroup=6 argspec=Q python=set_tool_number -# this needs work.. -#RETAIN_G43=1 -REMAP=M900 python=gen_backtrace modalgroup=10 -REMAP=M901 python=gdb_window modalgroup=10 -REMAP=M950 argspec=p python=symbols modalgroup=10 -# a plain .ngc sub call by M42: -# -#REMAP=M42 modalgroup=9 prolog=setup_m42 ngc=m42.ngc epilog=finish_m42 -# -# semantics: -# if M42 is encountered, execute it in modal group 9. -# Fail if other group 9 codes are present in the current block. -# the setup_m42 prolog Python function will be called before executing 'o call' -# Then the O-word sub m42.ngc is executed. -# The finish_m42 epilog Python function will be executed after m42.ngc finishes. -# - -[EMCMOT] -EMCMOT = motmod -# Timeout for comm to emcmot, in seconds -COMM_TIMEOUT = 1.0 -# BASE_PERIOD is unused in this configuration but specified in core_sim.hal -BASE_PERIOD = 0 -# Servo task period, in nano-seconds -SERVO_PERIOD = 1000000 -# Hardware Abstraction Layer section -------------------------------------------------- - -[TASK] -# Name of task controller program, e.g., milltask -TASK = milltask -# Cycle time, in seconds, that task controller will sleep between polls -CYCLE_TIME = 0.001 -# the Python plugins serves the interpreter as well as task - -[HAL] -# The run script first uses halcmd to execute any HALFILE -# files, and then to execute any individual HALCMD commands. -# -# list of hal config files to run through halcmd -# files are executed in the order in which they appear -#HALFILE = core_sim_noio.hal -#HALFILE = core_sim.hal -POSTTASK_HALFILE = core_sim_test.hal -POSTTASK_HALFILE = axis_manualtoolchange.hal -POSTTASK_HALFILE = iov2.hal -#HALFILE = axis_owordsub_manualtoolchange.hal -#HALFILE = simulated_home.hal -POSTTASK_HALFILE = simulated_home.hal -#HALFILE = gamepad.hal -# list of halcmd commands to execute -# commands are executed in the order in which they appear -#HALCMD = save neta -# Single file that is executed after the GUI has started. Only supported by -# AXIS at this time (only AXIS creates a HAL component of its own) -#POSTGUI_HALFILE = test_postgui.hal -#POSTGUI_HALFILE = v2_oword_gladevcp_postgui_noio.hal -HALUI = halui -# Trajectory planner section -------------------------------------------------- - -[HALUI] -#No Content - -[TRAJ] -COORDINATES = X Y Z -HOME = 0 0 0 -LINEAR_UNITS = mm -ANGULAR_UNITS = degree -DEFAULT_VELOCITY = 30.48 -MAX_VELOCITY = 53.34 -DEFAULT_ACCELERATION = 508 -MAX_ACCELERATION = 508 -POSITION_FILE = position_mm.txt -NO_FORCE_HOMING = 1 -# Axes sections --------------------------------------------------------------- -# First axis - -[EMCIO] -# Name of IO controller program, e.g., io -# explicitly support the start-change protocol. -# needs to be explicitly enabled for backwards compatibility. -# NB: if the start-change pin isn't used it needs to be looped like below to -# start-change-ack or an M6 will hang waiting for start-change-ack: -# net start-change iocontrol.0.start-change iocontrol.0.start-change-ack -#EMCIO = iov2 -support-start-change -# starting iov2 like so will create the start-change and start-change-ack pins -# but the start-change protocol remains disabled - start-change remains low and -# start-change-ack is ignored: -#EMCIO = iov2 -# cycle time, in seconds -CYCLE_TIME = 0.100 -# tool table file -#TOOL_TABLE = sim_mm_test.tbl -TOOL_TABLE = nstools.tbl -TOOL_CHANGE_POSITION = 0 0 50.8 -RANDOM_TOOLCHANGER = 0 - -[KINS] -KINEMATICS = trivkins -JOINTS = 3 - -[AXIS_X] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_0] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -HOME_IS_SHARED = 1 -# Second axis - -[AXIS_Y] -MIN_LIMIT = -254 -MAX_LIMIT = 254 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_1] -TYPE = LINEAR -HOME = 0.000 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -254 -MAX_LIMIT = 254 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 0.0 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 1 -# Third axis - -[AXIS_Z] -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 - -[JOINT_2] -TYPE = LINEAR -HOME = 0.0 -MAX_VELOCITY = 30.48 -MAX_ACCELERATION = 508 -BACKLASH = 0.000 -INPUT_SCALE = 157.48 -OUTPUT_SCALE = 1.000 -MIN_LIMIT = -50.8 -MAX_LIMIT = 101.6 -FERROR = 1.27 -MIN_FERROR = .254 -HOME_OFFSET = 25.4 -HOME_SEARCH_VEL = 127 -HOME_LATCH_VEL = 25.4 -HOME_USE_INDEX = NO -HOME_IGNORE_LIMITS = NO -HOME_SEQUENCE = 0 -HOME_IS_SHARED = 1 -# section for main IO controller parameters ----------------------------------- - -[PYTHON] -#PLUGIN_DIR=/home/mah/emc2-tc/configs/sim/pysubs -PLUGIN_DIR=./pysubs -# import the following Python modules -MODULE_BASENAME=plugins -# if this is set: -RELOAD_ON_CHANGE=1 -# and the file specified in MODULE_BASENAME was changed, it will be reloaded before -# executing any Python calls -# This is handy for debugging because you dont need to restart EMC -# BUT it incurs a bit of overhead per call so you might want to turn -# it off in production mode -# the Python reload_on_change variable may be used to toggle this -# at runtime -#LOG_FILE= py.log -LOG_LEVEL = 2 -# start a Python (really IO) Task class -# see end of $PLUGIN_DIR/$MODULE_BASENAME/task.py to see how it's instantiated -PYTHON_TASK=1 -# section for everything tool related -# relevant only if NOT using iocontrol - see EMCIO in that case - -[TOOL] -# how to connect to a toolstore in an SQL database -ODBC_CONNECT= Driver=SQLite3;Database=tooltable.sqlite -# legacy tool table filename -TOOL_TABLE = foo.tbl -# if nonzero, save tool-in-spindle and pocket-prepped on exit, and restore on startup -SAVE_TOOLSTATE=1 -# manual, random, any other -CHANGER_TYPE= manual -# if TASK_TOOLCHANGE_PINS=1, the task Python plugin will emulate the -# following iocontrol.0 pins: -# tool-change -# tool-changed -# tool-number -# tool-prep-number -# tool-prep-pocket -# tool-prepare -# tool-prepared -# -TASK_TOOLCHANGE_PINS=1 -# if TASK_START_CHANGE_PINS=1, the task Python plugin will emulate the -# start-change/start-change-ack pins and their protocol as per iocontrolv2: -TASK_START_CHANGE_PINS=1 -# if TASK_TOOLCHANGE_FAULT_PINS=1 the task Python plugin will emulate the iocontrolv2 pins: -# emc-abort -# emc-abort-ack -# emc-reason -# toolchanger-fault -# toolchanger-fault-ack -# toolchanger-reason -# toolchanger-faulted -# toolchanger-clear-fault -TASK_TOOLCHANGE_FAULT_PINS=1 -# Part program interpreter section -------------------------------------------- - -[VARS] - -# accessible in interp as #<_[section]name> -FOO = 47.11 -X=3 -Y=4 -Z=5 -TOOL_CHANGE_POSITION_X = 1 -TOOL_CHANGE_POSITION_Y = 2 -TOOL_CHANGE_POSITION_Z = 3 -# Motion control section ------------------------------------------------------ diff --git a/configs/sim/axis/orphans/pysubs/customtask.py b/configs/sim/axis/orphans/pysubs/customtask.py deleted file mode 100644 index 396b8d12517..00000000000 --- a/configs/sim/axis/orphans/pysubs/customtask.py +++ /dev/null @@ -1,555 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import sys -import signal -import traceback - -import emctask -import emccanon -import interpreter -import hal - -import emc # ini only - -try: - import cPickle as pickle -except ImportError: - import pickle - -try: - from userfuncs import UserFuncs -except ImportError: - from nulluserfuncs import UserFuncs - -def debug(): - return interpreter.this.debugmask & 0x00040000 # EMC_DEBUG_PYTHON_TASK - - -def handler(signum, frame): - ''' controlled shut down - after this, emcIoHalt() will be called, too - ''' - print("Python Task shutdown handler") - # this handler overrides the handler in emctaskmain, so call that as well - emctask.emctask_quit(signum) - - -class CustomTask(emctask.Task,UserFuncs): - - def __init__(self): - signal.signal(signal.SIGINT, handler) - signal.signal(signal.SIGTERM, handler) - try: - if debug(): print("py: CustomTask()") - emctask.Task.__init__(self) - self.inifile = emc.ini(emctask.ini_filename()) - self.tcpins = int(self.inifile.find("TOOL", "TASK_TOOLCHANGE_PINS") or 0) - self.startchange_pins = int(self.inifile.find("TOOL", "TASK_START_CHANGE_PINS") or 0) - self.fault_pins = int(self.inifile.find("TOOL", "TASK_TOOLCHANGE_FAULT_PINS") or 0) - - h = hal.component("iocontrol.0") - h.newpin("coolant-flood", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("coolant-mist", hal.HAL_BIT, hal.HAL_OUT) - - h.newpin("lube-level", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("lube", hal.HAL_BIT, hal.HAL_OUT) - - h.newpin("emc-enable-in", hal.HAL_BIT, hal.HAL_IN) - h.newpin("user-enable-out", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("user-request-enable", hal.HAL_BIT, hal.HAL_OUT) - - if self.tcpins: - h.newpin("tool-change", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_IN) - h.newpin("tool-number", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_OUT) - h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_IN) - if self.startchange_pins: - h.newpin("start-change", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("start-change-ack", hal.HAL_BIT, hal.HAL_IN) - if self.fault_pins: - h.newpin("emc-abort", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("emc-abort-ack", hal.HAL_BIT, hal.HAL_IN) - h.newpin("emc-reason", hal.HAL_S32, hal.HAL_OUT) - h.newpin("toolchanger-fault", hal.HAL_BIT, hal.HAL_IN) - h.newpin("toolchanger-fault-ack", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("toolchanger-reason", hal.HAL_S32, hal.HAL_IN) - h.newpin("toolchanger-faulted", hal.HAL_BIT, hal.HAL_OUT) - h.newpin("toolchanger-clear-fault", hal.HAL_BIT, hal.HAL_IN) - - h.ready() - self.components = dict() - self.components["iocontrol.0"] = h - self.hal = h - self.hal_init_pins() - self.io = emctask.emcstat.io - self.io.aux.estop = 1 - self._callback = None - self._check = None - tt = self.io.tool.toolTable - for p in range(0,len(tt)): - tt[p].zero() - UserFuncs.__init__(self) - self.enqueue = EnqueueCall(self) - except Exception as e: - print("__init__") - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.io.status = emctask.RCS_STATUS.RCS_DONE - - - def emcIoInit(self): - if debug(): print("py: emcIoInit tt=",self.tooltable_filename) - try: - self.io.aux.estop = 1 - self.io.tool.pocketPrepped = -1; - self.io.tool.toolInSpindle = 0; - self.io.coolant.mist = 0 - self.io.coolant.flood = 0 - self.io.lube.on = 0 - self.io.lube.level = 1 - - self.hal_init_pins() - # on nonrandom machines, always start by assuming the spindle is empty - if not self.random_toolchanger: - self.io.tool.toolTable[0].zero() - - if self.inifile.find("TOOL", "ODBC_CONNECT"): - import sqltoolaccess - self.tt = sqltoolaccess.SqlToolAccess(self.inifile, self.random_toolchanger) - else: - import tooltable - self.tt = tooltable.EmcToolTable(self.tooltable_filename, self.random_toolchanger) - - self.comments = dict() - self.fms = dict() - self.tt.load_table(self.io.tool.toolTable,self.comments,self.fms) - self.tt.restore_state(emctask.emcstat) - # self.io.tool.toolInSpindle = 2 # works - self.reload_tool_number(self.io.tool.toolInSpindle) - - except Exception as e: - print("emcIoInit",e) - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.io.status = emctask.RCS_STATUS.RCS_DONE - finally: - return 0 - - def emcToolLoadToolTable(self,file): - # triggered by UI if tooltable was edited - if debug(): print("py: emcToolLoadToolTable file = '%s'" % (file)) - self.comments = dict() - self.fms = dict() - try: - self.tt.load_table(self.io.tool.toolTable,self.comments,self.fms) - except Exception as e: - print_exc_plus() - self.io.status = emctask.RCS_STATUS.RCS_ERROR - else: - self.reload_tool_number(self.io.tool.toolInSpindle) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def prepare_complete(self): - if debug(): print("prepare complete") - self.io.tool.pocketPrepped = self.hal["tool-prep-pocket"] - self.hal["tool-prepare"] = 0 - - def emcToolPrepare(self,p,tool): - if debug(): print("py: emcToolPrepare p =",p,"tool =",tool) - if self.random_toolchanger and (p == 0): - if debug(): print("it doesn't make sense to prep the spindle pocket") - return 0 - - if self.tcpins: - if self.fault_pins and self.hal["toolchanger-faulted"]: - if debug(): print("prepare: toolchanger faulted (reason=%d), next M6 will %s" % (self.hal["toolchanger-reason"], "set fault code and reason" if self.hal["toolchanger-reason"] > 0 else "abort program")) - self.hal["tool-prep-pocket"] = p - if not self.random_toolchanger and (p == 0): - self.hal["tool-prep-number"] = 0 - else: - self.hal["tool-prep-number"] = self.io.tool.toolTable[p].toolno - - self.hal["tool-prepare"] = 1 - - # and tell task to wait until status changes to RCS_DONE - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.tool-prepared",self.prepare_complete) - else: - self.io.tool.pocketPrepped = p - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def reload_tool_number(self, toolno): - if self.random_toolchanger: return - t = self.io.tool.toolTable - for p in range(1,len(t)): - if toolno == t[p].toolno: - self.load_tool(p) - - def load_tool(self,pocket): - if self.random_toolchanger: - self.io.tool.toolTable[0],self.io.tool.toolTable[pocket] = self.io.tool.toolTable[pocket],self.io.tool.toolTable[0] - self.comments[0],self.comments[pocket] = self.comments[pocket],self.comments[0] - self.tt.save_table(self.io.tool.toolTable,self.comments,self.fms) - else: - if pocket == 0: - self.io.tool.toolTable[0].zero() - else: - self.io.tool.toolTable[0] = self.io.tool.toolTable[pocket] - - def change_complete(self): - if debug(): print("change complete") - if not self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.tool.toolInSpindle = 0 - else: - self.io.tool.toolInSpindle = self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.load_tool(self.io.tool.pocketPrepped) - self.io.tool.pocketPrepped = -1 - self.hal["tool-prep-number"] = 0 - self.hal["tool-prep-pocket"] = 0 - self.hal["tool-change"] = 0 - - def emcToolLoad(self): - if debug(): print("py: emcToolLoad") - - if self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - if not self.random_toolchanger and (self.io.tool.pocketPrepped > 0) and ( - self.io.tool.toolInSpindle == - self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno): - - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - if self.tcpins: - if self.fault_pins and self.hal["toolchanger-faulted"]: - self.io.status = emctask.RCS_STATUS.RCS_ERROR - return 0 - if self.io.tool.pocketPrepped != -1: - self.hal["tool-change"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.tool-changed",self.change_complete) - return 0 - else: - if not self.random_toolchanger and (self.io.tool.pocketPrepped == 0): - self.io.tool.toolInSpindle = 0 - else: - self.io.tool.toolInSpindle = self.io.tool.toolTable[self.io.tool.pocketPrepped].toolno - self.load_tool(self.io.tool.pocketPrepped) - self.io.tool.pocketPrepped = -1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolUnload(self): - if debug(): print("py: emcToolUnload") - self.io.tool.toolInSpindle = 0 - # this isn't in ioControlv1, but I think it should be. - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolSetNumber(self,number): - if debug(): print("py: emcToolSetNumber number =",number) - self.io.tool.toolInSpindle = number - if self.tcpins: - self.hal["tool-number"] = self.io.tool.toolInSpindle - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcToolSetOffset(self,pocket,toolno,offset,diameter,frontangle,backangle,orientation): - if debug(): print("py: emcToolSetOffset", pocket,toolno,str(offset),diameter,frontangle,backangle,orientation) - - self.io.tool.toolTable[pocket].toolno = toolno - self.io.tool.toolTable[pocket].orientation = orientation - self.io.tool.toolTable[pocket].diameter = diameter - self.io.tool.toolTable[pocket].frontangle = frontangle - self.io.tool.toolTable[pocket].backangle = backangle - self.io.tool.toolTable[pocket].offset = offset - - if debug(): print("new tool entry: ",str(self.io.tool.toolTable[pocket])) - - if self.io.tool.toolInSpindle == toolno: - self.io.tool.toolTable[0] = self.io.tool.toolTable[pocket] - - self.tt.save_table(self.io.tool.toolTable,self.comments,self.fms) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - - def emcIoPluginCall(self, len, msg): - if debug(): print("py: emcIoPluginCall len=%d msg=%s" %(len,msg)) - call = pickle.loads(msg) - func = getattr(self, call[0], None) - if func: - self.io.status = func(*call[1],**call[2]) - else: - raise AttributeError, "no such method: " + call[0] - return 0 - - - def emcIoHalt(self): - if debug(): print("py: emcIoHalt") - self.tt.save_state(emctask.emcstat) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emc_abort_acked(self): - if debug(): print("emc_abort_acked") - self.hal["emc-abort"] = 0 - - def emcIoAbort(self,reason): - if debug(): print("py: emcIoAbort reason=",reason,"state=",emctask.emcstat.task.state) - #if debug(): print("tc fault=",self.io.fault, "tc reason=",self.io.reason) - - self.io.coolant.mist = 0 - self.io.coolant.flood = 0 - - if self.tcpins: - self.hal["coolant-mist"] = 0 - self.hal["coolant-flood"] = 0 - self.hal["tool-change"] = 0 - self.hal["tool-prepare"] = 0 - if self.startchange_pins: - self.hal["start-change"] = 0 - if self.fault_pins: - self.hal["emc-reason"] = reason - self.hal["emc-abort"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.emc-abort-ack",self.emc_abort_acked) - return 0 - - if self._callback: - if debug(): print("emcIoAbort: cancelling callback to ",self._callback) - self._callback = None - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def start_change_acked(self): - if debug(): print("start_change_acked") - self.hal["start-change"] = 0 - - def emcToolStartChange(self): - if debug(): print("py: emcToolStartChange", "wait for iocontrol.0.start-change-ack" if self.startchange_pins else "noop") - if self.startchange_pins: - self.hal["start-change"] = 1 - self.io.status = self.wait_for_named_pin(1,"iocontrol.0.start-change-ack",self.start_change_acked) - return 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcAuxEstopOn(self): - if debug(): print("py: emcAuxEstopOn taskstate=",emctask.emcstat.task.state) - self.hal["user-enable-out"] = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcAuxEstopOff(self): - if debug(): print("py: emcAuxEstopOff") - self.hal["user-enable-out"] = 1 - self.hal["user-request-enable"] = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantMistOn(self): - if debug(): print("py: emcCoolantMistOn") - self.hal["coolant-mist"] = 1 - self.io.coolant.mist = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantMistOff(self): - if debug(): print("py: emcCoolantMistOff") - self.hal["coolant-mist"] = 0 - self.io.coolant.mist = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantFloodOn(self): - if debug(): print("py: emcCoolantFloodOn") - self.hal["coolant-flood"] = 1 - self.io.coolant.flood = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcCoolantFloodOff(self): - if debug(): print("py: emcCoolantFloodOff") - self.hal["coolant-flood"] = 0 - self.io.coolant.flood = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcLubeOn(self): - if debug(): print("py: emcLubeOn") - self.hal["lube"] = 1 - self.io.lube.on = 1 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcLubeOff(self): - if debug(): print("py: emcLubeOff") - self.hal["lube"] = 0 - self.io.lube.on = 0 - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcIoSetDebug(self,debug): - if debug(): print("py: emcIoSetDebug debug =",debug) - self.io.status = emctask.RCS_STATUS.RCS_DONE - return 0 - - def emcIoUpdate(self): - try: - #if debug(): print("py: emcIoUpdate") - self.hal["user-request-enable"] = 0 - self.io.aux.estop = not self.hal["emc-enable-in"] - if self.fault_pins: - if self.hal["toolchanger-fault"]: - self.io.reason = self.hal["toolchanger-reason"] - self.hal["toolchanger-fault-ack"] = 1 - self.hal["toolchanger-faulted"] = 1 # fault indicator latch - self.io.fault = 1 - return 0 - else: - self.hal["toolchanger-fault-ack"] = 0 - if self.hal["toolchanger-clear-fault"]: - self.hal["toolchanger-faulted"] = 0 # reset fault indicator latch - self.io.reason = 0 - if self._check: - self.io.status = self._check() - return 0 - except KeyboardInterrupt: # shutting down - print("emcIoUpdate----KeyboardInterrupt:") - return -1 - except Exception as e: - print("emcIoUpdate----:") - print_exc_plus() - return -1 - else: - return 0 - - def wait_for_named_pin_callback(self): - if self._comp[self._pin] == self._value: - if debug(): print("pin %s now %d" % (self._pin, self._value)) - if self._callback: self._callback() - self._check = None - self._callback = None - return emctask.RCS_STATUS.RCS_DONE - return emctask.RCS_STATUS.RCS_EXEC - - def wait_for_named_pin(self,value,name,callback = None): - (component, pin) = name.rsplit('.',1) - comp = self.components[component] - if comp[pin] == value: - if debug(): print("pin: %s already at %d" % (name,value)) - if callback: callback() - return emctask.RCS_STATUS.RCS_DONE - else: - if debug(): print("waiting for %s to become %d" % (name,value)) - # else set up callback - self._comp = comp - self._pin = pin - self._value = value - self._check = self.wait_for_named_pin_callback - self._callback = callback - # and tell task to wait until status changes to RCS_DONE - return emctask.RCS_STATUS.RCS_EXEC - - - def hal_init_pins(self): - """ Sets HAL pins default values """ - self.hal["user-enable-out"] = 0 - self.hal["user-request-enable"] = 0 - self.hal["coolant-mist"] = 0 - self.hal["coolant-flood"] = 0 - self.hal["lube"] = 0 - if self.tcpins: - self.hal["tool-prepare"] = 0 - self.hal["tool-prepared"] = 0 - self.hal["tool-prep-number"] = 0 - self.hal["tool-prep-pocket"] = 0 - self.hal["tool-change"] = 0 - self.hal["tool-number"] = 0 - if self.startchange_pins: - self.hal["start-change"] = 0 - if self.fault_pins: - self.hal["emc-abort"] = 0 - self.hal["emc-reason"] = 0 - self.hal["toolchanger-fault-ack"] = 0 - self.hal["toolchanger-faulted"] = 0 - - -# support queuing calls from Interp to Task Python methods: -# trap call, pickle a tuple of name and arguments and enqueue with canon IO_PLUGIN_CALL -class EnqueueCall(object): - def __init__(self,e): - if debug(): print("EnqueueCall.__init__()") - self._e = e - - def _encode(self,*args,**kwargs): - if hasattr(self._e,self._name) and callable(getattr(self._e,self._name)): - p = pickle.dumps((self._name,args,kwargs),-1) # binary pickle - emccanon.IO_PLUGIN_CALL(int(len(p)),p) - else: - raise AttributeError,"no such Task method: " + self._name - - def __getattr__(self, name): - self._name = name - return self._encode - -## {{{ http://code.activestate.com/recipes/52215/ (r1) - -def print_exc_plus(): - """ - Print the usual traceback information, followed by a listing of all the - local variables in each frame. - """ - tb = sys.exc_info()[2] - while 1: - if not tb.tb_next: - break - tb = tb.tb_next - stack = [] - f = tb.tb_frame - while f: - stack.append(f) - f = f.f_back - stack.reverse() - traceback.print_exc() - print("Locals by frame, innermost last") - for frame in stack: - print - print("Frame %s in %s at line %s" % (frame.f_code.co_name, - frame.f_code.co_filename, - frame.f_lineno)) - for key, value in frame.f_locals.items(): - print("\t%20s = " % key, end=" ") - #We have to be careful not to cause a new error in our error - #printer! Calling str() on an unknown object could cause an - #error we don't want. - try: - print(value) - except: - print("") diff --git a/configs/sim/axis/orphans/pysubs/nulluserfuncs.py b/configs/sim/axis/orphans/pysubs/nulluserfuncs.py deleted file mode 100644 index 13e458c517e..00000000000 --- a/configs/sim/axis/orphans/pysubs/nulluserfuncs.py +++ /dev/null @@ -1,23 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# empty extension object to make inheritance work - -class UserFuncs(object): - - pass diff --git a/configs/sim/axis/orphans/pysubs/oword.py b/configs/sim/axis/orphans/pysubs/oword.py deleted file mode 100644 index 8940c39c003..00000000000 --- a/configs/sim/axis/orphans/pysubs/oword.py +++ /dev/null @@ -1,128 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import sys,os -import interpreter -import emccanon - -if 'emctask' in sys.builtin_module_names: - import emctask - -import task - -from embedding import * - - - -#define EMC_DEBUG_CONFIG 0x00000002 -#define EMC_DEBUG_VERSIONS 0x00000008 -#define EMC_DEBUG_TASK_ISSUE 0x00000010 -#define EMC_DEBUG_NML 0x00000040 -#define EMC_DEBUG_MOTION_TIME 0x00000080 -#define EMC_DEBUG_INTERP 0x00000100 -#define EMC_DEBUG_RCS 0x00000200 -#define EMC_DEBUG_INTERP_LIST 0x00000800 -#define EMC_DEBUG_IOCONTROL 0x00001000 -#define EMC_DEBUG_OWORD 0x00002000 -#define EMC_DEBUG_REMAP 0x00004000 -#define EMC_DEBUG_PYTHON 0x00008000 -#define EMC_DEBUG_NAMEDPARAM 0x00010000 -#define EMC_DEBUG_GDBONSIGNAL 0x00020000 - -def debug(): - return interpreter.this.debugmask & 0x00008000 - -# Demo Python O-word subroutine - call as: -# o [5] -# (debug, #<_value>) -# -# len(args) always reflects the number of actual parameters passed -def square(self, *args): - return args[0]*args[0] - - -# a function taking a variable number of arguments -# o [5] [7] -# (debug, #<_value>) -# o [5] [7] [9] [16] -# (debug, #<_value>) -import operator -def multiply(self, *args): - return reduce(operator.mul, *args) - - -#---------------- queue calls for task-time execution ------------ -# see userfuncs.py for the actual function definitions - -# trivial demo: wiggle a user-defined HAL pin a few times -def qdemo(self,*args,**kwargs): - try: - task.pytask.enqueue.demo(*args,**kwargs) - if debug(): print("enqueueing demo()",args,kwargs) - except Exception as e: - # self happens if called with the UI context - no task there: harmless - pass - -# access emcStatus -# this is queued so it is done in-sequence at task time -def show_emcstat(self,*args,**kwargs): - try: - task.pytask.enqueue.show_emcstat(*args,**kwargs) - if debug(): print("enqueueing show_emcstat()",args) - except Exception as e: - if debug(): print("show_emcstat:",e,"pid=",os.getpid()) - pass - - -def set_named_pin(self,*args): - ''' an uh, creative way to pass a string argument: use a trailing comment - usage example: o call [2.345] (component.pinname) - ''' - try: - if (len(args) != 1): - self.set_errormsg("set_named_pin takes a single argument and a comment") - return -1 - if len(self.blocks[0].comment) == 0: - self.set_errormsg("set_named_pin takes a comment, which is the HAL pin name") - return -1 - task.pytask.enqueue.set_named_pin(args[0], self.blocks[0].comment) - if debug(): print("enqueuing set_named_pin()",args) - except Exception as e: - if debug(): print("set_named_pin:",e,"pid=",os.getpid()) - pass - - -def wait_for_named_pin(self,*args): - ''' same trick to wait for a given named pin to show a certain value: - usage example: o call [1] (component.boolpin) - - NB: this will NOT stop readhead, and this is not a method to retrieve a named pin's value - ''' - try: - if (len(args) != 1): - self.set_errormsg("wait_for_named_pin takes a single argument and a comment") - return -1 - if len(self.blocks[0].comment) == 0: - self.set_errormsg("wait_for_named_pin takes a comment, which is the HAL pin name") - return -1 - task.pytask.enqueue.wait_for_named_pin(args[0], self.blocks[0].comment) - if debug(): print("enqueuing wait_for_named_pin()",args) - except Exception as e: - if debug(): print("wait_for_named_pin:",e,"pid=",os.getpid()) - pass - diff --git a/configs/sim/axis/orphans/pysubs/plugins.py b/configs/sim/axis/orphans/pysubs/plugins.py deleted file mode 100644 index 30d8f49bf78..00000000000 --- a/configs/sim/axis/orphans/pysubs/plugins.py +++ /dev/null @@ -1,35 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import interpreter -import emccanon - -try: - import emctask - print("plugins: milltask=",os.getpid()) -except ImportError: - print("plugins: axis=",os.getpid()) - pass - - -import task -import oword -import remap - - diff --git a/configs/sim/axis/orphans/pysubs/remap.py b/configs/sim/axis/orphans/pysubs/remap.py deleted file mode 100644 index 67203152ff5..00000000000 --- a/configs/sim/axis/orphans/pysubs/remap.py +++ /dev/null @@ -1,262 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import signal - -from interpreter import * -import emccanon - -# -# to remap Tx (prepare) to an NGC file 'prepare.ngc', incantate like so: -# -# REMAP=T prolog=prepare_prolog epilog=prepare_epilog ngc=prepare -# This means: -# -# prolog=prepare_prolog -# before calling prepare.ngc, execute the Python function 'prepare_prolog' -# ngc=prepare -# your O-word procedure goes to prepare.ngc -# epilog=prepare_epilog -# after calling prepare.ngc, execute the Python function 'prepare_epilog' -# -def prepare_prolog(self, userdata,**words): - self.params[5599] = 1 # turn on DEBUG, output - self._tool = int(words['t']) - if self._tool: - (status,self._pocket) = self.find_tool_pocket(self._tool) - if status != INTERP_OK: - self.set_errormsg("T%d: pocket not found" % (self._tool)) - return status - else: - self._pocket = -1 # this is an T0 - tool unload - - # these variables will be visible in the ngc oword sub - # as # and # as local variables - self.params["tool"] = self._tool - self.params["pocket"] = self._pocket - return INTERP_OK - -# The minimal ngc prepare procedure looks like so: -# -# o sub -# (debug, r_prepare tool=# pocket=#) -# -# returning a negative value fails the prepare command -# returning a positive value sets this value as the new pocket: -# o endsub [#] -# m2 - -# the prepare epilog looks at the return value from the NGC procedure -# and does the right thing: -def prepare_epilog(self, userdata, **words): - #print("prepare_epilog cl=",self.call_level, self._pocket) - retval = self.return_value - if retval >= 0: - self.selected_pocket = self._pocket - self.selected_tool = self._tool - emccanon.SELECT_TOOL(self._tool) - return INTERP_OK - else: - self.set_errormsg("T%d: aborted (return code %.4f)" % (self._tool,retval)) - return INTERP_ERROR - - -# -# M6 remapped to a NGC handler, with Python prolog+epilog -# -# Incantation: -# REMAP=M6 modalgroup=6 argspec=- prolog=change_prolog ngc=change epilog=change_epilog -# -def change_prolog(self, userdata,**words): - if self.selected_pocket < 0: - self.set_errormsg("Need tool prepared -Txx- for toolchange") - return INTERP_ERROR - if self.cutter_comp_side: - self.set_errormsg("Cannot change tools with cutter radius compensation on") - return INTERP_ERROR - - # bug in interp_convert.cc: WONT WORK - isn't valid anymore - ## settings->selected_pocket); - ## settings->tool_table[0].toolno, <--- BROKEN - ## block->t_number, - #self.params["prepared" ] = 2 - - self.params["tool_in_spindle"] = self.current_tool - self.params["selected_pocket"] = self.selected_pocket - return INTERP_OK - -def change_epilog(self, userdata,**words): - retval = self.return_value - print("change_epilog retval=% selected_pocket=%d" %(retval,self.selected_pocket)) - if retval > 0: - # commit change - #emccanon.CHANGE_TOOL(self.selected_pocket) - emccanon.CHANGE_TOOL(self.selected_tool) - self.current_pocket = self.selected_pocket - # cause a sync() - self.tool_change_flag = True - self.set_tool_parameters() - return INTERP_OK - else: - self.set_errormsg("M6 aborted (return code %.4f)" % (retval)) - return INTERP_ERROR - - -# M61 remapped to an all-Python handler -# demo - this really does the same thing as the builtin (non-remapped) M61 -# -# Incantation: -# -# REMAP=M61 python=set_tool_number -# -# This means: -# -# argspec=Q- : -# a mandatory Q parameter word is required, others are ignored -# -# python=set_tool_number -# the following function is executed on M61: -# -def set_tool_number(self, userdata,**words): - toolno = int(words['q']) - (status,pocket) = self.find_tool_pocket(toolno) - if status != INTERP_OK: - self.set_errormsg("M61 failed: requested tool %d not in table" % (toolno)) - return status - if words['q'] > -TOLERANCE_EQUAL: - self.current_pocket = pocket - - emccanon.CHANGE_TOOL_NUMBER(pocket) - # test: self.tool_table[0].offset.tran.z = self.tool_table[pocket].offset.tran.z - # cause a sync() - self.tool_change_flag = True - self.set_tool_parameters() - return INTERP_OK - else: - self.set_errormsg("M61 failed: Q=%4" % (toolno)) - return INTERP_ERROR - -# -# This demonstrates how queuebusters -# (toolchange, wait for input, probe) can be dealt with in Python handlers. -# -# on the initial call, userdata equals zero. -# if a queuebuster is executed, the function is expected to return -# (INTERP_EXECUTE_FINISH, -# -# Post sync, the function is called again with the userdata value -# returned previously for continuation. -# -def test_reschedule(self, userdata,**words): - if userdata > 0: - # we were called post-sync(): - pin_status = emccanon.GET_EXTERNAL_DIGITAL_INPUT(0,0); - print("pin status=",pin_status) - return INTERP_OK # done - else: - # wait for digital-input 00 to go hi for 5secs - emccanon.WAIT(0,1,2,5.0) - # pls call again after sync() with new userdata value - return (INTERP_EXECUTE_FINISH,userdata + 1) - -#------ demonstrate task signal handlers -- -def gen_backtrace(self, userdata,**words): - if 'emctask' in sys.builtin_module_names: - os.kill(os.getpid(), signal.SIGUSR2) - return INTERP_OK - -def gdb_window(self, userdata,**words): - if 'emctask' in sys.builtin_module_names: - os.kill(os.getpid(), signal.SIGUSR1) - return INTERP_OK - -#---------------- debugging fluff ---------- -# named parameters table -def symbols(self, userdata, **words): - self.print_named_params(words.has_key('p')) - return INTERP_OK - -# tool table access -def print_tool(self, userdata, **words): - n = 0 - if words['p']: - n = int(words['p']) - print("tool %d:" % (n)) - print("tool number:", self.tool_table[n].toolno) - print("tool offset x:", self.tool_table[n].offset.tran.x) - print("tool offset y:", self.tool_table[n].offset.tran.y) - print("tool offset z:", self.tool_table[n].offset.tran.z) - return INTERP_OK - -def set_tool_zoffset(self, userdata, **words): - n = int(words['p']) - self.tool_table[n].offset.tran.z = words['q'] - if n == 0: - self.set_tool_parameters() - return INTERP_OK - - -def printobj(b,header=""): - print("object ",header,":") - for a in dir(b): - if not a.startswith('_'): - if hasattr(b,a): - print(a,getattr(b,a)) - -def introspect(args,**kwargs): - print("----- introspect:") - r = self.remap_level - print("call_level=",self.call_level, "remap_level=",self.remap_level) - print("selected_pocket=",self.selected_pocket) - print("blocks[r].comment=",self.blocks[r].comment) - print("blocks[r].seq=",self.blocks[r].line_number) - print("blocks[r].p_flag=",self.blocks[r].p_flag) - print("blocks[r].p_number=",self.blocks[r].p_number) - print("blocks[r].q_flag=",self.blocks[r].q_flag) - print("blocks[r].q_number=",self.blocks[r].q_number) - - #printobj(interp,"interp") - printobj(self.tool_offset,"tool_offset") - callstack() - for i in [5220,"_metric","_absolute","_tool_offset","_feed","_rpm"]: - print("param",i,"=",self.params[i]) - print("blocks[r].executing_remap:", end=" ") - print("name=",self.blocks[r].executing_remap.name) - print("argspec=",self.blocks[r].executing_remap.argspec) - print("prolog=",self.blocks[r].executing_remap.prolog_func) - print("py=",self.blocks[r].executing_remap.remap_py) - print("ngc=",self.blocks[r].executing_remap.remap_ngc) - print("epilog=",self.blocks[r].executing_remap.epilog_func) - - return INTERP_OK - -def null(args,**kwargs): - return INTERP_OK - - -def callstack(): - for i in range(len(self.sub_context)): - print("-------- call_level: ",i) - print("position=",self.sub_context[i].position) - print("sequence_number=",self.sub_context[i].sequence_number) - print("filenameposition=",self.sub_context[i].filename) - print("subname=",self.sub_context[i].subname) - print("context_status=",self.sub_context[i].context_status) - return INTERP_OK - diff --git a/configs/sim/axis/orphans/pysubs/sqltoolaccess.py b/configs/sim/axis/orphans/pysubs/sqltoolaccess.py deleted file mode 100644 index d25553f0203..00000000000 --- a/configs/sim/axis/orphans/pysubs/sqltoolaccess.py +++ /dev/null @@ -1,151 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import re -import pyodbc -import emc # for ini file access only -import sys, traceback - -class SqlToolAccess(object): - ''' - beginnings of ODBC tooltable access - ''' - - def __init__(self,inifile,random_toolchanger): - print("SQL tt init") - self.inifile = inifile - self.random_toolchanger = random_toolchanger - self.persist = int(self.inifile.find("TOOL", "SAVE_TOOLSTATE") or 0) - - self.connectstring = self.inifile.find("TOOL", "ODBC_CONNECT") - conn = pyodbc.connect(self.connectstring) - cursor = conn.cursor() - print("tables in database %s:" % (self.connectstring)) - for row in cursor.tables(): - print(row.table_name) - cursor.close() - conn.close() - - - def load_table(self, tooltable,comments,fms): - ''' populate the table''' - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - - cursor = conn.cursor() - cursor.execute("select * from tools;") - - for row in cursor.fetchall(): - pocket = row.pocket - t = tooltable[pocket] - t.toolno = row.toolno - t.orientation = row.orientation - t.diameter = row.diameter - t.frontangle = row.frontangle - t.backangle = row.backangle - t.offset.tran.x = row.x_offset - t.offset.y = row.y_offset - t.offset.z = row.z_offset - t.offset.a = row.a_offset - t.offset.b = row.b_offset - t.offset.c = row.c_offset - t.offset.u = row.u_offset - t.offset.v = row.v_offset - t.offset.w = row.w_offset - - except pyodbc.Error as e: - traceback.print_exc(file=sys.stdout) - else: - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: print(str(t)) - finally: - cursor.close() - conn.close() - - def save_table(self, tooltable, comments,fms): - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - cursor.execute("delete from tools;") - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: - cursor.execute("insert into tools values(?,?,?,?,?,?,'?',?,?,?,?,?,?,?,?,?);", - (t.toolno, p, t.diameter, t.backangle,t.frontangle,t.orientation, - comment[p],t.offset.x,t.offset.y,t.offset.z,t.offset.a,t.offset.b, - t.offset.c,t.offset.u,t.offset.v,t.offset.w)) - except pyodbc.Error as msg: - print("saving tooltable failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - def save_state(self,e): - if not self.persist: - return - print("SQL save_state", end=" ") - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - cursor.execute("delete from state;") - cursor.execute("insert into state (tool_in_spindle,pocket_prepped) values(?,?)", e.io.tool.toolInSpindle,e.io.tool.pocketPrepped) - print("done") - - except pyodbc.Error as msg: - print("save_state() failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - - def restore_state(self,e): - if not self.persist: - return - - try: - conn = pyodbc.connect(self.connectstring) - conn.autocommit = True - cursor = conn.cursor() - if not cursor.tables(table='state').fetchone(): - print("trying to restore, but no 'state' table found") - return - row = cursor.execute("select tool_in_spindle,pocket_prepped from state;").fetchone() - if row: - e.io.tool.pocketPrepped = row.pocket_prepped - e.io.tool.toolInSpindle = row.tool_in_spindle - print("restored tool=%d pocketPrepped=%d" % (row.tool_in_spindle,row.pocket_prepped)) - else: - print("no saved state record found") - - except pyodbc.Error as msg: - print("restore_state() failed:") - traceback.print_exc(file=sys.stdout) - finally: - cursor.close() - conn.close() - - diff --git a/configs/sim/axis/orphans/pysubs/task.py b/configs/sim/axis/orphans/pysubs/task.py deleted file mode 100644 index e04d6076252..00000000000 --- a/configs/sim/axis/orphans/pysubs/task.py +++ /dev/null @@ -1,44 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import sys -import hal -import emccanon -import interpreter - -try: - import emctask - import customtask -except ImportError: - pass - -try: - import cPickle as pickle -except ImportError: - import pickle - -def starttask(): - global pytask - import emc - ini = emc.ini(emctask.ini_filename()) - t = ini.find("PYTHON", "PYTHON_TASK") - if int(t) if t else 0: - pytask = customtask.CustomTask() - -if 'emctask' in sys.builtin_module_names: - starttask() diff --git a/configs/sim/axis/orphans/pysubs/tooltable.py b/configs/sim/axis/orphans/pysubs/tooltable.py deleted file mode 100644 index 45046d0ee1f..00000000000 --- a/configs/sim/axis/orphans/pysubs/tooltable.py +++ /dev/null @@ -1,140 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import os -import re - -class EmcToolTable(object): - ''' intended as bug-compatible Python replacement for the - tooltable io used in iocontrol - NB: old file formats not supported. - ''' - - ttype = { 'T' : int, 'P': int, 'Q':int, - 'X' : float, 'Y' : float, 'Z' : float, - 'A' : float, 'B' : float, 'C' : float, - 'U' : float, 'V' : float, 'W' : float, - 'I' : float, 'J' : float, 'D' : float } - - def __init__(self,filename,random_toolchanger): - self.filename = filename - self.random_toolchanger = random_toolchanger - - def load_table(self, tooltable,comments,fms): - self.fakepocket = 0 - fp = open(self.filename) - lno = 0 - for line in fp.readlines(): - lno += 1 - if not line.startswith(';') and line.strip(): - entry = self.parseline(lno,line.strip()) - if entry: - self.assign(tooltable,entry,comments,fms) - fp.close() - - def save_table(self, tooltable, comments,fms): - os.rename(self.filename,self.filename + '.bak') - fp = open(self.filename, 'w') - start = 0 if self.random_toolchanger else 1 - for p in range(start,len(tooltable)): - t = tooltable[p] - if t.toolno != -1: - fp.write("T%d P%d" % (t.toolno, p if self.random_toolchanger else fms[p])) - if t.diameter: fp.write("D%f" % (t.diameter)) - if t.offset.x: fp.write("X%+f" % (t.offset.x)) - if t.offset.y: fp.write("Y%+f" % (t.offset.y)) - if t.offset.z: fp.write("Z%+f" % (t.offset.z)) - if t.offset.a: fp.write("A%+f" % (t.offset.a)) - if t.offset.b: fp.write("B%+f" % (t.offset.b)) - if t.offset.c: fp.write("C%+f" % (t.offset.c)) - if t.offset.u: fp.write("U%+f" % (t.offset.u)) - if t.offset.v: fp.write("V%+f" % (t.offset.v)) - if t.offset.w: fp.write("W%+f" % (t.offset.w)) - if t.offset.w: fp.write("W%+f" % (t.offset.w)) - if t.frontangle: fp.write("I%+f" % (t.frontangle)) - if t.backangle: fp.write("J%+f" % (t.backangle)) - if t.orientation: fp.write("Q%+d" % (t.orientation)) - if comments.has_key(p) and comments[p]: - fp.write(";%s\n" % (comments[p])) - else: - fp.write("\n") - fp.close() - - def assign(self,tooltable,entry,comments,fms): - pocket = entry['P'] - if not self.random_toolchanger: - self.fakepocket += 1 - if self.fakepocket >= len(tooltable): - print("too many tools. skipping tool %d" % (toolno)) - return - if not fms is None: - fms[self.fakepocket] = pocket - pocket = self.fakepocket - if pocket < 0 or pocket > len(tooltable): - print("max pocket number is %d. skipping tool %d" % (len(tooltable) - 1, toolno)) - return - - tooltable[pocket].zero() - for (key,value) in entry.items(): - if key == 'T' : tooltable[pocket].toolno = value - if key == 'Q' : tooltable[pocket].orientation = value - if key == 'D' : tooltable[pocket].diameter = value - if key == 'I' : tooltable[pocket].frontangle = value - if key == 'J' : tooltable[pocket].backangle = value - if key == 'X' : tooltable[pocket].offset.x = value - if key == 'Y' : tooltable[pocket].offset.y = value - if key == 'Z' : tooltable[pocket].offset.z = value - if key == 'A' : tooltable[pocket].offset.a = value - if key == 'B' : tooltable[pocket].offset.b = value - if key == 'C' : tooltable[pocket].offset.c = value - if key == 'U' : tooltable[pocket].offset.u = value - if key == 'V' : tooltable[pocket].offset.v = value - if key == 'W' : tooltable[pocket].offset.w = value - if key == 'comment' : comments[pocket] = value # aaargh - - def parseline(self,lineno,line): - """ - read a tooltable line - if an entry was parsed successfully, return a Tool() instance - """ - line.rstrip("\n") - if re.match('\A\s*T\d+',line): - semi = line.find(";") - if semi != -1: - comment = line[semi+1:] - else: - comment = None - entry = line.split(';')[0] - result = dict() - for field in entry.split(): - (name,value) = re.search('([a-zA-Z])([+-]?\d*\.?\d*)',field).groups() - if name: - key = name.upper() - result[key] = EmcToolTable.ttype[key](value) - else: - print("%s:%d bad line: '%s' " % (self.filename, lineno, entry)) - result['comment'] = comment - return result - print("%s:%d: unrecognized tool table entry '%s'" % (self.filename,lineno,line)) - - - def restore_state(self,e): - pass - - def save_state(self,e): - pass diff --git a/configs/sim/axis/orphans/pysubs/userfuncs.py b/configs/sim/axis/orphans/pysubs/userfuncs.py deleted file mode 100644 index 608d715748c..00000000000 --- a/configs/sim/axis/orphans/pysubs/userfuncs.py +++ /dev/null @@ -1,73 +0,0 @@ -# This is a component of LinuxCNC -# Copyright 2011, 2013, 2014 Dewey Garrett , -# Michael Haberler -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -import hal -import emctask - -class UserFuncs(object): - ''' additional user-defined methods for Task() which may be called through - the IO_PLUGIN_CALL mechanism - a mixin class to CustomTask - - methods are expected to return a emctask, - ''' - def __init__(self): - print("UserFuncs.__init__()") - myhal = hal.component("myhal") - myhal.newpin("bit", hal.HAL_BIT, hal.HAL_OUT) - myhal.newpin("float", hal.HAL_FLOAT, hal.HAL_OUT) - myhal.newpin("int", hal.HAL_S32, hal.HAL_OUT) - myhal.ready() - self.myhal = myhal #FIXME - self.components["myhal"] = myhal - - def demo(self,*args, **kwargs): - print("TASK: demo(%s,%s)" % (args,kwargs)) - for i in range(int(args[0])): - self.myhal['bit'] = not self.myhal['bit'] - return emctask.RCS_STATUS.RCS_DONE - - - def show_emcstat(self,args): - ''' - snapshot some of emcstat to stdout - ''' - e = emctask.emcstat - print("mode=",e.task.mode) - print("state=",e.task.state) - print("file=",e.task.file) - print("toolOffset=",str(e.task.toolOffset)) - print("tooltable[0]=",e.io.tool.toolTable[0]) - print("g5x_offset=", e.task.g5x_offset, "system=",e.task.g5x_index) - return emctask.RCS_STATUS.RCS_DONE - - def set_named_pin(self,value,name): - print("set_named_pin ",value,name) - (component,pin) = name.rsplit('.',1) - comp = self.components[component] - - if type(comp[pin]).__name__ == 'float': - comp[pin] = value - - if type(comp[pin]).__name__ == 'int': - comp[pin] = int(value) - - if type(comp[pin]).__name__ == 'bool': - comp[pin] = bool(int(value)) - - return emctask.RCS_STATUS.RCS_DONE diff --git a/configs/sim/axis/orphans/sim_mm.tbl b/configs/sim/axis/orphans/sim_mm.tbl deleted file mode 120000 index fc1bee07e9f..00000000000 --- a/configs/sim/axis/orphans/sim_mm.tbl +++ /dev/null @@ -1 +0,0 @@ -../../sim_mm.tbl \ No newline at end of file diff --git a/configs/sim/axis/orphans/taskcall.ngc b/configs/sim/axis/orphans/taskcall.ngc deleted file mode 100644 index 44afa70a8ab..00000000000 --- a/configs/sim/axis/orphans/taskcall.ngc +++ /dev/null @@ -1,4 +0,0 @@ -; test plugin call -o call [100000] [2] -m2 -