Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cd8849f
hal_glib -add a function to run the gobject mainloop once
c-morley Sep 27, 2025
05ae1eb
hal_glib -add function to process one ZMQ message
c-morley Jul 9, 2026
ec23790
hal_glib - add soft key messages
c-morley Jul 15, 2026
be0d7e0
add python3-zmq package for halui
c-morley Feb 2, 2026
e49f8d0
add python3-zmq to python3 depends
c-morley Feb 8, 2026
17c361b
halui initial testing of embedded python halui
c-morley Aug 16, 2025
5c2b24c
makefile - add halui's bridgeui folder
c-morley Feb 9, 2026
659ece4
halui -add an angular jograte pin and send angular jograte messages
c-morley Apr 10, 2026
86d1314
halui -use angular jograte pin/messages for angular axis
c-morley Apr 12, 2026
56cd744
bridge -look for macro commands too
c-morley Jul 3, 2026
1e3b9c6
hal_bridge -add a warning if the write address is already used
c-morley Jul 3, 2026
190eb34
halui -add reload display and shutdown pins
c-morley Jul 9, 2026
7e20c6e
halui -add softkey pins and message
c-morley Jul 15, 2026
e87fc00
gladevcp -speedcontrol: put Gstat status in the loop
c-morley Aug 16, 2025
6904f05
gladevcp -gth_action: add ability to run new style INI MDI commands
c-morley Sep 1, 2025
14b6969
qtvcp/gladevcp -action: add ability; return to mode after INI mdi
c-morley Sep 2, 2025
7f13703
gladevcp -speedcontrol -add angular jograte type
c-morley Apr 10, 2026
ff5531a
gladevcp -speedcontrol: add angular jograte command
c-morley Apr 12, 2026
2c3cfe1
gladevcp -hal_gremlin: clear the plot if reloading the screen
c-morley Jul 9, 2026
be29d12
gladevcp gtk_action -get shutdown to work reliably
c-morley Jul 10, 2026
fb58d41
qtvcp -dialog widget: add status message control of tool change dialog
c-morley Sep 1, 2025
d5cfc80
qtvcp -baseclass: register dialogs for later checks
c-morley Dec 14, 2025
69cf20b
qtvcp -axis tool button: allow for MPG selection
c-morley May 28, 2026
2eab89c
qtvcp -dialog_widget: check ZMQ messages directly
c-morley Jul 9, 2026
676c6fe
iniinfo -parse ini commands in a better way
c-morley Sep 1, 2025
c4491ea
qtdragon -adjust external pause message to toggle
c-morley Aug 22, 2025
32e62c8
qtdragon metric -add a control panel
c-morley Aug 23, 2025
1c85e81
qtdragon -update test config test panel
c-morley Sep 1, 2025
b5c817c
qtdragon -test files update
c-morley Sep 6, 2025
8e022b6
qtdragon -add halui test sim
c-morley Sep 27, 2025
4aa13ad
test panel - qtdragon: make mode buttons not checkable
c-morley Jul 16, 2026
11e4724
qtdragon -add mpg_select button logic control
c-morley Dec 13, 2025
41ab29b
sim panel -add scale buttons and MPG dial
c-morley Dec 13, 2025
05b9cb0
qtdragon -find the currently visible dialog to send messages to
c-morley Dec 14, 2025
409a63d
gmoccapy -sim: add MPG button on VCP panel
c-morley Mar 15, 2026
12385a9
qtdragon -fix MPG selection from panel
c-morley Mar 15, 2026
a62d575
qtdragon sim -fix goto user macro
c-morley May 28, 2026
1bf6858
qtdragon -external run of macros, use cycle start for MDI running
c-morley Jul 3, 2026
376ca70
qtdragon sim -add a macro command to run from the panel
c-morley Jul 3, 2026
bcb4791
qtdragon -update sim control panel
c-morley Jul 9, 2026
76736b0
qtdragon -add basic support for softkeys for Tab selection
c-morley Jul 10, 2026
2318054
gmoccapy/hal_bridge -allow hal_bridge to call macros in gmoccapy
c-morley Jul 27, 2025
55bc828
gmoccapy -ability to run INI MDI commands using HAL bridge
c-morley Jul 31, 2025
fb60aaf
gmoccapy -sample config: add INI MDI commands to test with
c-morley Jul 31, 2025
dbe034b
gmoccapy -add gstat message control of start and pause
c-morley Sep 1, 2025
fe6852d
gmoccapy -add a halui test config with a sim test panel
c-morley Sep 1, 2025
bd885af
gmoccapy -used new mode return INI MDI function
c-morley Sep 2, 2025
1188e4c
test panel - gmoccapy: make mode buttons not checkable
c-morley Jul 16, 2026
a90ca00
gmoccapy -getinfo.py: fix macro search title
c-morley Oct 18, 2025
4a48cd2
gmoccapy -change system dialog to accept halui messages
c-morley Dec 14, 2025
058ed3e
gmoccapy -change warning dialogs to accept HALUI messages
c-morley Dec 27, 2025
b6af008
gmoccapy -set jog speed control widget to use messages
c-morley Feb 1, 2026
cc9f778
gmoccapy -use halui message to cancel notifications
c-morley Feb 1, 2026
f00e5a8
gmoccapy -can submit the current MDI command from HALUI
c-morley Feb 7, 2026
d60759b
gmoccapy -update external pause/start behavior
c-morley Apr 4, 2026
014af87
gmoccapy -entry dialog respond to halui, add non blocking wait code
c-morley Apr 10, 2026
7296438
gmoccapy -update the angular speedcontrol to new angular type
c-morley Apr 10, 2026
11b5c5b
gmoccapy -update vcp panel for angular axes
c-morley Apr 12, 2026
326c5c5
gmoccapy -add a 4 axis halui test config
c-morley Apr 12, 2026
e41af0e
gmoccapy -fix merge error
c-morley Jun 25, 2026
cf02b84
gmoccapy -update sample control panel
c-morley Jul 9, 2026
15eff2b
gmoccapy -honour shutdown request
c-morley Jul 9, 2026
d8f1a9e
gmoccapy -respond to softkeys and make exit do shutdown
c-morley Jul 10, 2026
57a7c60
gmoccapy -update simulated control panels MPG jog
c-morley Jul 10, 2026
3971d71
gmoccapy -add MPG input to zoom and scroll
c-morley Jul 10, 2026
62866b9
gmoccapy -sim: connect GUI MPG signals
c-morley Jul 10, 2026
76105fd
axis sim -add a sim test for halui messages
c-morley Sep 27, 2025
b936cf9
axis -add softkey, exit and reload actions
c-morley Jul 16, 2026
4ad3a65
axis -allow MPG scrolling of gcode
c-morley Jul 17, 2026
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
115 changes: 115 additions & 0 deletions configs/sim/axis/gstatmessages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

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))
GSTAT.connect('softkey-pressed', lambda w,data: softkey_pressed(data))
GSTAT.connect('shutdown-request', lambda w : General_Halt())
GSTAT.connect('reload-display', lambda w : commands.clear_live_plot())

global last_mpg
last_mpg = 0
mpg_enabled = 0

def user_hal_pins():
comp.newpin('mpg-enable', hal.HAL_BIT, hal.HAL_IN)
comp.newpin('mpg-in', hal.HAL_S32, hal.HAL_IN)
comp.ready()

def user_live_update():
GSTAT.run_iteration()
global mpg_enabled
try:
if comp['mpg-enable'] or mpg_enabled:
global last_mpg
if comp['mpg-in'] == last_mpg: return
if comp['mpg-in'] > last_mpg:scroll_up(None)
if comp['mpg-in'] < last_mpg:scroll_down(None)
last_mpg = comp['mpg-in']
except Exception as e:
print(e)

def select_axis(data):
global mpg_enabled
if data is None: return
if data =='MPG0':
mpg_enabled = True
return
mpg_enabled = False
if data.upper() =='NONE':
return
try:
widget = getattr(widgets, "axis_%s" % data.lower())
widget.focus()
widget.invoke()
except:
pass

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)

# external request for a softkey press from HALUI/halbridge
def softkey_pressed(index):

if index == 0:
root_window.tk.call('.pane.top.tabs','raise','manual')
elif index == 1:
root_window.tk.call('.pane.top.tabs','raise','mdi')
elif index == 2:
root_window.tk.call('.pane.top.right','raise','preview')
elif index == 3:
root_window.tk.call('.pane.top.right','raise','numbers')
elif index == 4:
root_window.tk.call('.pane.top.right','raise','user_0')
else:
print(f'Softkey index:{index}')
53 changes: 53 additions & 0 deletions configs/sim/axis/panel.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
net rate halui.axis.jog-speed panel.jog-rate

net sx halui.axis.x.select panel.axis-x
net sx axis.x.jog-enable
net sy halui.axis.y.select panel.axis-y
net sy axis.y.jog-enable
net sz halui.axis.z.select panel.axis-z
net sz axis.z.jog-enable
net sgui halui.mpg-select.0 panel.select-gui0

net mpg-scale axis.x.jog-scale panel.mpg-scale
net mpg-scale axis.y.jog-scale
net mpg-scale axis.z.jog-scale

net mpg-count panel.mpg-wheel-s
net mpg-count axisui.mpg-in
net mpg-count axis.x.jog-counts
net mpg-count axis.y.jog-counts
net mpg-count axis.z.jog-counts

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

net softkey0 halui.gui.softkey-0 panel.softkey-0
net softkey1 halui.gui.softkey-1 panel.softkey-1
net softkey2 halui.gui.softkey-2 panel.softkey-2
net softkey3 halui.gui.softkey-3 panel.softkey-3
net softkey4 halui.gui.softkey-4 panel.softkey-4
net softkey5 halui.gui.softkey-5 panel.softkey-5
net softkey6 halui.gui.softkey-6 panel.softkey-6
net softkey7 halui.gui.softkey-7 panel.softkey-7
net softkey8 halui.gui.softkey-8 panel.softkey-8
net softkey9 halui.gui.softkey-9 panel.softkey-9
net softkey10 halui.gui.softkey-10 panel.softkey-10
net softkey11 halui.gui.softkey-11 panel.softkey-11

net exit halui.gui.shutdown panel.exit
net reload halui.gui.reload-display panel.reload
Loading
Loading