limit msg length for popups when errant input to gcmc compiler
typo on strip()
for detecting options comment, split on // not /
minor: ngcgui.txt update
new: involute-gear.gcmc adapted for ngcgui from B. Stultien's example
new: ensure_mode.gcmd include file to resolve potential conflict
with preamble and gcmc code (gcmc wins)
with updates:
1) popup msg error if entry box for gcmc not a number
2) allow comment after tag when tagging a gcmc option
3) handle gcmc_include_path for new custom tab additions
4) incorporate ensure_mode in .gcmc examples
5) update ngcgui.txt for ensure_mode
Replace puts stderr with stdout to avoid problems when
file descriptor 2 is reassigned by embedding axis app.
Original puts stderr can be restored when the inadvertent
loss of stderr is solved
This was never a good idea, was undocumented, and noted as
deprecated in docs/src/gui/ngcgui.txt.
The plentiful availability of global-named-readonly-parameters
in the master branch makes support even more problematic
1) decline gcmc file if not in linuxcnc path
2) if not embedded and gcmc file, use file dir as outdir with message
3) remove leftover id of gcmc file when not found
(squashed commits from test branch: dgarr/ngcgui-gcmc)
Add support for [py]ngcgui to read .gcmc input files for the gcmc
compiler and make tab pages with entry boxes for tagged variables.
A tabpage 'info' message and compiler options can be specified
by tags too.
Ref: gcmc (G-Code Meta Compiler) http://www.vagrearg.org/content/gcmc
Note: gcmc version 1.4.3 or later must be installed separately and
available in the user PATH
--------------------------------------------------------------------
Tag formats (simplified):
Variable:
//ngcgui: vname [= value , [comment text]]
Info message:
//ngcgui: info: text message
Option:
//ngcgui: -optioname [optionvalue]
--------------------------------------------------------------------
When a feature for a gcmc tab page is created, the variables
and options are passed to the compiler and a gcode subroutine
file is produced and placed at the head of the linuxcnc subroutine
search path. These files are purged at each ngcgui restart
that uses .gcmc files.
--------------------------------------------------------------------
Example ini files for axis, touchy, and gscreen:
configs/sim/axis/ngcgui/ngcgui_gcmc.ini
configs/sim/axis/ngcgui/pyngcgui_gcmc.ini
configs/sim/touchy/ngcgui/pyngcgui_touchy_gcmc.ini
configs/sim/gscreen/ngcgui/pyngcgui_gscreen_gcmc.ini
Example gcmc files:
nc_files/gcmc_lib/drill.gcmc
nc_files/gcmc_lib/square.gcmc
nc_files/gcmc_lib/star.gcmc (Bertho Stultiens)
nc_files/gcmc_lib/wheels.gcmc (Alan Battersby)
use make to create simple standalone executable files for
ngcgui,pyngcgui,gremlin_view,tooledit
instead of copying files from source tree
to add this patch, you may need to rm existing files:
lib/python/gremlin_view.py
lib/python/pyngcgui.py
share/linuxcnc/gremlin_view.ui
By default, [py]ngcgui terminates created ngc files with M2.
M2 (Program End) has a number of defined side effects that
may not be wanted. This patch provides an option (nom2) such
that the created ngc file is started and ended with a single
percent (%) character and no terminating M2.
Option format:
command_line: -N | --nom2
Inifile:
NGCGUI_OPTS = ... nom2 ...
(Note: [py]ngcgui has always ignored M2 lines that follow an
endsub in the subroutines it processes)
thanks to Rick (rng3) for the suggestion
And note that support of global variables as input parameters
(a deprecated feature) is marked as a declining feature
to be removed for the 2.6 release
detect inclusion of numbered subroutine
if a numbered subroutine is included in a _named_ subroutine file,
execution seems to stop when the endsub is encountered
Example (2.5)
$ cat prog1.ngc
o<suba> call
M2
$ cat suba.ngc
o<suba> sub
(print, before o100)
o100 sub
(print, this is suba)
o100 endsub
o100 call
(print, after o100)
o<suba> endsub
When prog1.ngc is executed, the prints are:
before o100
this is suba
nothing is executed after the o100 endsub
Expected ini parameters for specifying files are:
[RS274NGC]SUBROUTINE_PATH
and
[DISPLAY]NGCGUI_SUBFILE -- as a filename only
Unexpected usage: user specifies [DISPLAY]NGCGUI_SUBFILE as
an absolute filename
This fails, as expected, if absolute filename is not in search path.
Change is to warn if user specifies an absolute filename that doses not resolve
to the search path and simultaneously has a file by that name in the search
path.
this includes the main script, some of the GUIs, the Python module,
the Tcl package, some image fies.
On a sim system, axis, tkemc, xemc all start. runtests pass.
a system with realtime wasn't yet tested.
packaging probably requires additional changes and was not yet tested.
global feature name changed from #<_feature> to #<_feature:> to be more
consistent with ngcgui recommended practice
minor: use any,color,override for transient indication of
use of entrykeybinding
minor: fix name on hole_circle.ngc
symptom: when specifying a single "Custom" tab, an error
occurred because ::ngc(any,custom,color) was not set yet
fix: invoke initgui earlier for embedded page
symptom: with option new, new tab could not find file
in search path because fullpath was passed
fix: use file tail to support search
When ngcgui is embedded in axis, a user can use the gui filechooser to browse
and select a file that is not in the search path ([RS274NGC]SUBROUTINE_PATH)
When the processed file is sent to emc (via axis) it won't run because the
subroutine is not found in the search path. (If the subfile contains no calls
to other routines, it can be made to run by activating the checkbox for
"Expand subroutine"))
Detect that file is not in search path and inform user.
Related change: ngcgui_ttt places its generated subfiles in /tmp so that they
will be purged (ubuntu: /etc/default/rcS:TMPTIME) and uses the
expandsubroutines option so that the subfile does not need to be in the search
path ([RS274NGC]SUBROUTINE_PATH). A new option, nopathcheck, is used by
ngcgui_ttt to avoid warnings on the search path restriction.
For ngcgui tab pages embedded in axis gui, use a search path for the
filename items:
[DISPLAY]NGCGUI_PREAMBLE, NGCGUI_SUBFILE, NGCGUI_POSTAMBLE, TTT_PREAMBLE
If a filename is specified with an initial "/" character, only the absolute
filename is considered.
When the file is specified as a relative filename (first character is not a "/"),
the search order is:
[DISPLAY]PROGRAM_PREFIX
[RS274NGC]SUBROUTINE_PATH
First file found in the search wins.
Thanks to Seb Kuzminsky for the suggestion.
misplaced bracket prevented exclusion of these numbered params
in handling of special association lines for positional parameters.
error report: _tkinter.TclError: can't read ""num02" : no such variable
thanks to Bob Palmer for bug report
ngcgui is a subroutine utility for writing and using emc subroutines
ngcgui can run as a standalone application or be embedded in
multiple tab pages in the axis gui
Support two new tcl packages that create axis gui tab pages
Ngcgui (ngcgui subroutine utility)
Ngcguittt (ngcgui interface for truetype-tracer)
new: tcl/ngcgui_app.tcl -- tcl package for [DISPLAY]TKPKG = Ngcgui
new: tcl/ngcgui_ttt.tcl -- tcl package for [DISPLAY]TKPKG = Ngcguittt
new: tcl/ngcgui.tcl -- ngcgui namespace, procs, and standalone
updated: tcl/pkgIndex.tcl -- tcl index for new tcl packages
new: configs/sim/ngcgui*.ini -- example ini files
new: nc_files/ngcgui_lib -- ngcgui compatible library
requires libtk-img (tcl Img package)
requires truetype-tracer v4 to use Ngcguittt