Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
95c5d38
add bridgeui folder for HALUI
c-morley Aug 16, 2025
f7c752a
halui initial testing of embedded python halui
c-morley Aug 3, 2025
1e32c84
halui -inject socket axis selection
c-morley Aug 16, 2025
89673bc
gladevcp -speedcontrol: put Gstat status in the loop
c-morley Aug 16, 2025
e9566bb
gmoccapy -set property to speed control widget
c-morley Aug 17, 2025
7f8ac53
bridge -remove HAL pin code, get MDI commands working
c-morley Aug 20, 2025
315360e
halui -code clenup, GUI based MDI command feature
c-morley Aug 20, 2025
7777369
halui -add cycle start cycle pause pins
c-morley Aug 22, 2025
53f56a9
qtdragon -adjust external pause message to toggle
c-morley Aug 22, 2025
2f799d9
gmoccapy/hal_bridge -allow hal_bridge to call macros in gmoccapy
c-morley Jul 27, 2025
6f26e73
gmoccapy -ability to run INI MDI commands using HAL bridge
c-morley Jul 31, 2025
063d692
gmoccapy -sample config: add INI MDI commands to test with
c-morley Jul 31, 2025
94a9524
halui -add gui ok/canel pins
c-morley Aug 23, 2025
5dbb904
hal_glib -add ok and cancel messages
c-morley Aug 23, 2025
e3e81e3
qtdragon -react to ok and cancel messages
c-morley Aug 23, 2025
69ae7bf
qtdragon metric -add a control panel
c-morley Aug 23, 2025
605c67f
iniinfo -parse ini commands in a better way
c-morley Sep 1, 2025
08ed08c
gladevcp -gth_action: add ability to run new style INI MDI commands
c-morley Sep 1, 2025
65de817
qtvcp -dialog widget: add status message control of tool change dialog
c-morley Sep 1, 2025
0e3f7fc
qtdragon -add status control of toolchange dialog
c-morley Sep 1, 2025
1291447
gmoccapy -add gstat message control of start and pause
c-morley Sep 1, 2025
5428a3f
gmoccapy -add a halui test config with a sim test panel
c-morley Sep 1, 2025
149dfc3
qtdragon -update test config test panel
c-morley Sep 1, 2025
7ea7c10
qtvcp/gladevcp -action: add ability; return to mode after INI mdi
c-morley Sep 2, 2025
8f62287
gmoccapy -used new mode return INI MDI function
c-morley Sep 2, 2025
cb3fa3a
halui -fix memory leaks
c-morley Sep 6, 2025
f826df6
qtdragon -test files update
c-morley Sep 6, 2025
01e287a
hal_glib -add a function to run the gobject mainloop once
c-morley Sep 27, 2025
8e6df68
axis sinm -add a sim test for halui messages
c-morley Sep 27, 2025
c3fe8e7
qtdragon -add halui test sim
c-morley Sep 27, 2025
f371975
test panel - make mode buttons not checkable
c-morley Oct 18, 2025
b204443
gmoccapy -getinfo.py: fix macro search title
c-morley Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions configs/sim/axis/axis_halui_test.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# 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 = LinuxCNC-HAL-SIM-AXIS

# 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., axis
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

MAX_LINEAR_VELOCITY = 5
DEFAULT_LINEAR_VELOCITY = .25
DEFAULT_SPINDLE_SPEED = 200
# Prefix to be used
PROGRAM_PREFIX = ../../nc_files/

# Introductory graphic
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

USER_COMMAND_FILE=gstatmessages.py

[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 -----------------------------------------------------
[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 --------------------------------------------
[RS274NGC]

# File containing interpreter variables
PARAMETER_FILE = sim.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

# section for main IO controller parameters -----------------------------------
[EMCIO]
# tool table file
TOOL_TABLE = sim.tbl
TOOL_CHANGE_POSITION = 0 0 0
TOOL_CHANGE_QUILL_UP = 1

# Hardware Abstraction Layer 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.hal
HALFILE = sim_spindle_encoder.hal
HALFILE = axis_manualtoolchange.hal
HALFILE = simulated_home.hal
HALFILE = check_xyz_constraints.hal
HALFILE = cooling.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_HALCMD = loadusr qtvcp -a -H panel.hal panel

HALUI = halui

# Trajectory planner section --------------------------------------------------
[TRAJ]
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
MAX_LINEAR_VELOCITY = 4
DEFAULT_LINEAR_ACCELERATION = 100
MAX_LINEAR_ACCELERATION = 100
POSITION_FILE = position.txt

[KINS]
KINEMATICS = trivkins
JOINTS = 3

# Axes sections ---------------
[AXIS_X]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0

[AXIS_Y]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0

[AXIS_Z]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -8.0
MAX_LIMIT = 0.12

# Joints sections -------------
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
FERROR = 0.050
MIN_FERROR = 0.010
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
HOME_IS_SHARED = 1

[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
FERROR = 0.050
MIN_FERROR = 0.010
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -8.0

# Normally the Z max should be 0.000!
# The only reason it's greater than 0 here is so that the splash screen
# gcode will run.
MAX_LIMIT = 0.12

FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 1.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
HOME_IS_SHARED = 1
66 changes: 66 additions & 0 deletions configs/sim/axis/gstatmessages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

from hal_glib import GStat
GSTAT = GStat()
GSTAT.forced_update()
GSTAT.connect('jograte-changed', lambda w, data: vars.jog_speed.set(data))
GSTAT.connect('axis-selection-changed', lambda w,data: select_axis(data))
GSTAT.connect('cycle-start-request', lambda w, state : cycle_start_request(state))
GSTAT.connect('cycle-pause-request', lambda w, state: pause_request(state))
GSTAT.connect('ok-request', lambda w, state: dialog_ext_control(w,1,1))
GSTAT.connect('cancel-request', lambda w, state: dialog_ext_control(w,1,0))
GSTAT.connect('macro-call-request', lambda w, name: request_macro_call(name))
def user_live_update():
GSTAT.run_iteration()

def select_axis(data):
if data is None: return
widget = getattr(widgets, "axis_%s" % data.lower())
widget.focus()
widget.invoke()

def cycle_start_request(state):
print('cycle start',state)
commands.task_run(None)

def pause_request(state):
print('cycle pause',state)
commands.task_pauseresume(None)

def dialog_ext_control(widget,t,state):
print('dialog control',widget,state)

flag = False
for child in root_window.winfo_children():
#print(child)
if isinstance(child, Tkinter.Toplevel):
#print(f"Found a Toplevel window: {child}")
if '.!toplevel' in str(child):
#print('sending command:',child)
for child2 in child.winfo_children():
#print(child2)
if isinstance(child2, Tkinter.Frame):
for child3 in child2.winfo_children():
#print(child3)
if isinstance(child3, Tkinter.Button):
#print(dir(child3))
txt = child3.cget("text")
if txt.lower() == 'ok' and state:
#print('Ok')
child3.invoke()
flag = True
break
elif txt.lower() == 'cancel' and not state:
#print('Cancel')
child3.invoke()
flag = True
break
if flag: break
if flag: break
else:
#print('No window')
# remove one error message
if state == 0:
notifications.clear_one()

def request_macro_call(name):
print('request macro:',name)
24 changes: 24 additions & 0 deletions configs/sim/axis/panel.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
net rate halui.axis.jog-speed panel.jog-rate

net sx halui.axis.x.select panel.axis-x
net sy halui.axis.y.select panel.axis-y
net sz halui.axis.z.select panel.axis-z

net jog-p halui.axis.selected.plus panel.jog-pos
net jog-m halui.axis.selected.minus panel.jog-neg

#net m0 halui.gui.mdi-command-MACRO0 panel.mdi-0
#net m1 halui.gui.mdi-command-MACRO1 panel.mdi-1
#net m2 halui.gui.mdi-command-0 panel.mdi-2

net man panel.manual-mode halui.mode.manual
net mdi panel.mdi-mode halui.mode.mdi
net auto panel.auto-mode halui.mode.auto

net pause halui.cycle.start panel.cycle-start
net start halui.cycle.pause panel.cycle-pause
net abort halui.abort panel.cycle-abort

net cancel halui.gui.cancel panel.cancel
net ok halui.gui.ok panel.ok

Loading
Loading