Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
887d344
add bridgeui folder for HALUI
c-morley Aug 16, 2025
8e37015
halui initial testing of embedded python halui
c-morley Aug 3, 2025
80babde
halui -inject socket axis selection
c-morley Aug 16, 2025
6fe1296
gladevcp -speedcontrol: put Gstat status in the loop
c-morley Aug 16, 2025
7217bbb
bridge -remove HAL pin code, get MDI commands working
c-morley Aug 20, 2025
1d0dbc5
halui -code clenup, GUI based MDI command feature
c-morley Aug 20, 2025
927e717
halui -add cycle start cycle pause pins
c-morley Aug 22, 2025
f7f19e9
qtdragon -adjust external pause message to toggle
c-morley Aug 22, 2025
d1da33e
gmoccapy/hal_bridge -allow hal_bridge to call macros in gmoccapy
c-morley Jul 27, 2025
1432d46
gmoccapy -ability to run INI MDI commands using HAL bridge
c-morley Jul 31, 2025
4e83fb2
gmoccapy -sample config: add INI MDI commands to test with
c-morley Jul 31, 2025
0958c89
halui -add gui ok/canel pins
c-morley Aug 23, 2025
f8c6bfe
hal_glib -add ok and cancel messages
c-morley Aug 23, 2025
7f63bf7
qtdragon -react to ok and cancel messages
c-morley Aug 23, 2025
f6aec0a
qtdragon metric -add a control panel
c-morley Aug 23, 2025
af864dc
iniinfo -parse ini commands in a better way
c-morley Sep 1, 2025
cc0d6ce
gladevcp -gth_action: add ability to run new style INI MDI commands
c-morley Sep 1, 2025
776fad6
qtvcp -dialog widget: add status message control of tool change dialog
c-morley Sep 1, 2025
04302d0
qtdragon -add status control of toolchange dialog
c-morley Sep 1, 2025
b35b580
gmoccapy -add gstat message control of start and pause
c-morley Sep 1, 2025
161e252
gmoccapy -add a halui test config with a sim test panel
c-morley Sep 1, 2025
1e67e35
qtdragon -update test config test panel
c-morley Sep 1, 2025
ad63462
qtvcp/gladevcp -action: add ability; return to mode after INI mdi
c-morley Sep 2, 2025
51b3366
gmoccapy -used new mode return INI MDI function
c-morley Sep 2, 2025
ca045bf
halui -fix memory leaks
c-morley Sep 6, 2025
995ea77
qtdragon -test files update
c-morley Sep 6, 2025
0626aff
hal_glib -add a function to run the gobject mainloop once
c-morley Sep 27, 2025
c3d9729
axis sinm -add a sim test for halui messages
c-morley Sep 27, 2025
3c9e488
qtdragon -add halui test sim
c-morley Sep 27, 2025
5fdba0c
test panel - make mode buttons not checkable
c-morley Oct 18, 2025
e953f30
gmoccapy -getinfo.py: fix macro search title
c-morley Oct 18, 2025
4d554f8
halui switch u32 to s32
c-morley Nov 15, 2025
4ce34f1
halui -add mpg_select0 pin
c-morley Dec 13, 2025
0f6ac8e
qtdragon -add mpg_select button logic control
c-morley Dec 13, 2025
5203648
sim panel -add scale buttons and MPG dial
c-morley Dec 13, 2025
416fcaa
qtvcp -baseclass: register dialogs for later checks
c-morley Dec 14, 2025
7dfd7d0
qtdragon -find the currently visible dialog to send messages to
c-morley Dec 14, 2025
d8199f7
gmoccapy -change system dialog to accept halui messages
c-morley Dec 14, 2025
66794ad
gmoccapy -change warning dialogs to accept HALUI messages
c-morley Dec 27, 2025
fa47845
gmoccapy -set jog speed control widget to use messages
c-morley Feb 1, 2026
98dd380
gmoccapy -use halui message to cancel notifications
c-morley Feb 1, 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
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