Commit graph

546 commits

Author SHA1 Message Date
Sebastian Kuzminsky
0ab1301a61 fix halfile parsing for calibration dialog
Accept both spaces and tab characters as word separators.  It used to
only accept spaces.

Thanks to Roguish for the bug report and Jeff Epler for the fix.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2014-09-10 17:32:06 -06:00
Dewey Garrett
615e834819 emccalib: fix for bug 389 (not writing file)
thanks to jepler
2014-08-11 14:15:35 -07:00
Jeff Epler
004e78453e pickconfig: speed automatic closing of other branches
By deferring the treeclose/treeopen until idle, the work isn't done
each time a single tree node is opened/closed.  Doing this work
repeatedly (with included "update" command) caused the automatic closing
to take an appreciable amount of time, particularly on slower machines.
2014-06-11 17:54:26 -05:00
Dewey Garrett
136e2d0316 pickconfig: always allow make_shortcut (#372)
minor: eliminate unneeded global (::writeanyway)
       and clarify name (forcecopy)
2014-05-22 21:24:49 -07:00
Dewey Garrett
27ae7c7509 emccalib.tcl: improve noncompatible ini message 2014-04-22 08:25:20 -07:00
Dewey Garrett
ef7d8bf0d0 configs/apps: new directory and .demo support
A new file type (.demo) in the configs tree is supported by the linuxcnc
script and the configuration selector (pickconfig.tcl).  A .demo file
must be executable and is typically implemented as a shell script that
invokes an application with appropriate parameters.

This facility makes it possible to demonstrate apps related to linuxcnc
using pickconfig without starting linuxcnc or requiring a complete ini
file.

Thanks to Chris Morley for suggestion

Details:
    Modify pickconfig to support .demo files
       Use noforcecopy for .demo files which should not be copied to
       a user dir
    Provide .demo apps for halrun,info,parport,xhc-hb04
    Provide .demo apps for gladevcp,pyvcp
    New script: linuxcnc_var and removal of several scripts/*.in.
    Rename latency scripts for consistency (and reduce merge overwrites).
    Remove latencyplot from menu.
    Moved gladevcp demo apps from root/gladevcp to configs/apps/gladevcp
       The root/gladevcp/ examples were orphans and didn't work with
          the configuration selector
       Change .py files so persistent files are named .save instead of
          .ini to avoid conflict with .ini files which the configuration
          selector presumes are working configs.
       Rebranding in some py files
       Some clarifications within copied README files
       Consolidate by-widgets dir
    Update docs
       New doc for configuration selector (needs formatting)
       Update for configs tree rearrangement
    Rename 2 non working sim .ini files to .ini.notworking
2014-03-22 06:13:56 -07:00
Dewey Garrett
3b26624ce9 ngcgui-gcmc: examples: option for mm or inch
also:
add cpocket.gcmc
ensure_units: debug prints iff verbose exists
ngcgui.tcl fix max_len_msg
2014-03-08 22:45:29 -07:00
Dewey Garrett
bc1880c064 emccalib: user message if expanded ini file
+bugfix: handle parsing of sectionnames with trailing whitespace
2014-03-06 15:04:56 -07:00
Dewey Garrett
4a8a50154a emccalib: user message if ini file not compatible
show message and exit if ini file not compatible with emccalib

comment out old debug prints
don't require space in ini file equal line:
      e.g,. accept P=value instead of requiring P =[ ]value
2014-03-06 15:04:56 -07:00
Dewey Garrett
f86290abf6 ngcgui-gcmc: gcmc related bug fixes
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
2014-03-04 09:22:09 -07:00
Dewey Garrett
b64d749707 ngcgui-gcmc programmable involute-gear example
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
2014-03-03 11:18:43 -07:00
Dewey Garrett
1cbe86cf18 ngcgui-gcmc: always pass floating point
avoid subtle problems with gcmc using integers
2014-03-03 11:18:34 -07:00
Dewey Garrett
183efb3e9d ngcgui: support gcmc include path
with:
[DISPLAY]GCMC_INCLUDE_PATH = dir1:dir2:...
2014-02-23 17:40:33 -07:00
Dewey Garrett
afbb3fb62f pickconfig: fix typo not found in rip build
thanks to seb's buildbots for finding my packaging mistakes
2014-02-17 19:27:01 -07:00
Dewey Garrett
c437dee723 pickconfig: avoid error attempting to create link
for a nonexisting target
2014-02-17 17:16:53 -07:00
Dewey Garrett
9e6628caba ngcgui: workaround reassignment of fd2
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
2014-02-17 17:16:42 -07:00
Dewey Garrett
aa05c938ae ngcgui: support tilde expansion in PROGRAM_PREFIX 2014-02-15 21:43:32 -07:00
Dewey Garrett
56fdc0ee40 ngcgui: normalize filenames for tilde expansion
when using Ctrl-u etc
2014-02-15 09:45:23 -07:00
Dewey Garrett
be56120d44 ngcgui: remove deprecated globals entry boxes
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
2014-02-11 20:19:16 -07:00
Dewey Garrett
f4e16c6ce1 ngcgui: bug fixes for gcmc usage
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
2014-02-11 20:01:18 -07:00
Dewey Garrett
555c0fc623 ngcgui: make .gcmc files visible in open dialogs 2014-02-10 10:14:00 -07:00
Dewey Garrett
9f6c219475 halshow: eliminate unused ref to a -ini option
eliminate in callers: axis.tcl, mini.tcl, tklinuxcnc.tcl

the switch statement that included "-ini" breaks with tclsh8.4
2014-02-09 18:34:54 -07:00
Dewey Garrett
7bdd488c0d ngcgui,pyngcgui: support gcmc files
(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)
2014-02-06 19:24:03 -07:00
Dewey Garrett
658dfbd385 halshow: make it available as standalone utility
that can accept a watchlist

Usage:
  halshow [Options] [watchfile]
  Options:
           --help  (this help)

Notes:
       Create watchfile in halshow using: 'File/Save Watch List'
       linuxcnc must be running for standalone usage
2014-02-05 21:53:11 -07:00
Dewey Garrett
14623525d9 pickconfig: support _lib additions
If a directory named *_lib is added to configs/nc_files,
then create proper symlink for it when installing
a new user configuration.

minor: rename somes vars for clarity
2013-12-18 17:39:50 -07:00
Dewey Garrett
cd7c804920 pickconfig: bugfix for debug_pickconfig
initialize ::myconfigs_node
and eliminate unneeded, duplicated var ::myconfigs

i think bug occurs only for
  rip with debug_pickconfig environmental set
2013-12-16 13:17:47 -07:00
Dewey Garrett
d30d38cdeb pickconfig: noshow detail if selected not visible
also: show current selection in titlebar

minor: make a debug print conditional on verbose
2013-12-12 19:07:12 -07:00
Dewey Garrett
55248ce47e pickconfig: some cleanup 2013-12-11 18:47:08 -07:00
Dewey Garrett
086bf4c786 rearrange: pickconfig: dont reformat
Inconsistent README and .txt formatting worked poorly after
wm resize allowed by prior commit.  This change removes
regsub reformat and relies on paragraphs (without breaks)
in files for display.
2013-12-11 18:08:39 -07:00
Dewey Garrett
8d90ebb51f pickconfig: deeper search for ini files
a subdir will not be copied to user configs if it or
any children contain ini files since such a directory
will be considered a potential config and included
in picker tree
2013-12-10 06:47:04 -07:00
Dewey Garrett
bb774fe143 pickconfig: ignore nonexisting dirs in CONFIG_DIR
Makefile.inc.in includes:
    /usr/local/etc/emc2/configs
in:
    EMC2_SYSTEM_CONFIG_DIR
but the directory doesnt exist and is not created
so: don't show nonexisting dirs
2013-12-10 05:59:35 -07:00
Dewey Garrett
59778cf5ae rearrange: conform ini files for flat user dir
pickconfig.tcl now makes a flat directory structure when
copying files to ~linuxcnc/configs.

This makes for a simpler user configs directory and
facilitates rearranging directories in the distro config
tree.

This change makes ini files refer to ../../nc_files throughout
so that they can work in both rip builds and installed debs.

see also configs/maintainer.txt

also: pickconfig.tcl: remove ::copy_special_subdirs
2013-12-09 16:17:20 -07:00
Dewey Garrett
7ccb61d9f1 pickconfig: support exclude list
all directories below root/configs are candidates for
config presentation provided:
  1) they contain an ini file (or a child contains an ini file)
  2) they are not on the ::exclude_list

currently only item is 'common'

This provision guards against an ini file being added to
configs/common
2013-12-09 14:57:46 -07:00
Dewey Garrett
3d20f7e37f pickconfig: begin flat user configs
Also add info file:
     configs/maintainer.txt (never copied to user dirs by pickconfig.tcl)
2013-12-09 12:34:36 -07:00
Dewey Garrett
f94595c520 pickconfig: support flat or hierachical user dir
set by ::make_flat_user_dirs

Current usage has been hierarchical.
This change supports future use of a flat user dir for configs.

also:
  1) when copying to user dir, never copy an nc_files dir
     since it is handled elsewhere
  2) change some var names for readibility
2013-12-08 12:13:40 -07:00
Dewey Garrett
a241478b24 pickconfig: allow window resize 2013-12-07 13:04:33 -07:00
Dewey Garrett
d290b308fc pickconfig: provide default_start_node
if no ~/.linuxcncrc, go to hardcoded default_start_node
2013-12-07 12:49:41 -07:00
Dewey Garrett
5844030ee1 pickconfig: follow nested symlinks correctly
also: clarify env for debug_pickconfig
2013-12-07 10:50:49 -06:00
Dewey Garrett
0e7d1501f1 pickconfig: show files before directories 2013-12-07 10:50:46 -06:00
Dewey Garrett
8b554285c2 pickconfig: preferred names on sample configs only 2013-12-07 10:50:37 -06:00
Dewey Garrett
b633b0be18 pickconfig: reorder dir display for preferred
1) reorder display of directories to show preferred items first
2) change openmode to simplify first view
   but go to last_ini if available
3) display text when selecting top nodes too
4) add some notes
2013-12-07 10:50:08 -06:00
Dewey Garrett
bc1bc54174 make: eliminate unneeded copies
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
2013-12-01 11:15:45 -07:00
Dewey Garrett
0e76abfb3b ngcgui,pyngcgui: add nom2 option
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
2013-08-25 06:34:37 -07:00
Sebastian Kuzminsky
6dfcae3876 Merge branch 'v2.5_branch' 2013-03-09 00:39:55 -07:00
Dewey Garrett
b5bca20c2c twopass.tcl: improve error reporting
in proc source_the_files:
  1) catch error and report without traceback
  2) identify original file if it was converted
  3) allow detection of error in more than one file

in proc hal_to_tcl:
  catch and report file open errors without traceback
2013-03-05 09:11:52 -06:00
Dewey Garrett
2e7b21969b twopass.tcl: reduce unneeded verbose printing
When [HAL]TWOPASS=verbose is specified, prints are made comparing
lines that are altered when converting from hal to tcl.  This patch
reduces the output by avoiding printing differences that occur
because of leading or trailing whitespace differences only.
2013-03-05 09:11:52 -06:00
Sebastian Kuzminsky
97a7c51655 Merge remote-tracking branch 'origin/v2.5_branch'
Conflicts:
	debian/control.in
	docs/src/Submakefile
	docs/src/gcode/m-code.txt
	docs/src/gcode/o-code.txt
	docs/src/gcode/overview.txt
	src/po/fr.po
2013-02-12 23:38:34 -07:00
Dewey Garrett
1e955fb86f pickconfig.tcl: improve readme.ngc
The auto-generated file named readme.ngc is put in the user nc_files directory.
It can run as a simple gcode file and displays debug messages that show
the linuxcnc version and identifies important directories for the user.

With this change, the file can also run as an ngcgui compatible subfile.
2013-02-01 13:06:17 -06:00
Michael Haberler
26577cbc89 Merge branch 'v2.5_branch' 2012-07-20 22:57:20 +02:00
Dewey Garrett
145c609f49 Several fixes to emccalib
Inifile values were not handled correctly for multiple HALFILEs
because the call to the halcmdSubstitute proc when reading halfile
substituted for instances of [SECTION]VAR which were needed later
to make entries for multiple tabs.

two small bugs within halcmdSubstitue masked bad behavior for single
HALFILE examples
2012-07-09 08:51:36 -05:00
Michael Haberler
0587bea0c5 Merge branch 'v2.5_branch'
Conflicts:
	docs/src/gcode/gcode.txt
	docs/src/gcode/overview.txt
2012-05-31 18:40:34 +02:00
Dewey Garrett
8feb761ae3 ngcgui.tcl: show fullpath for dirs in path err message 2012-05-24 14:28:43 -05:00
Dewey Garrett
0950430970 ngcgui.tcl: ignore built-in readonly global variables
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
2012-05-24 14:28:43 -05:00
Jeff Epler
10d8caf753 Merge remote-tracking branch 'origin/v2.5_branch'
Conflicts:
	lib/python/rs274/glcanon.py
	src/po/fr.po
2012-03-16 19:55:22 -05:00
Dewey Garrett
2d1de3d8a0 ngcgui.tcl: report wrongly included subroutines
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
2012-03-13 12:43:54 -05:00
Dewey Garrett
2a4efd4642 pickconfig.tcl: handle reselecting existing config
tcl mkdir does not give error if dir exists so
explicitly dectect dir existence
2012-03-13 12:43:45 -05:00
Sebastian Kuzminsky
0bb57e9df3 Merge remote branch 'origin/v2.5_branch'
Conflicts:
	src/emc/task/emccanon.cc
2012-02-04 14:29:39 -07:00
Dewey Garrett
11066f42e3 pickconfig: rebranded install: notice old install
Context:
  new deb install (from buildbot) with an existing ~/emc2 dir

Behavior
  copies config files to $linuxcnc::USER_CONFIG_DIR = ~/linuxcnc/configs
                                                        ^^^^^^^^
  however, if ncfiles == ~/emc2/nc_files exists,
           then symbolic links are not created.

Change:  rebrand to linuxcnc
         and if ~/emc2/nc_files exists, issue a popup message to user
2012-02-03 11:12:29 -06:00
Michael Haberler
cf41ac29cf Merge branch 'v2.5_branch' 2012-01-27 20:16:12 +01:00
Dewey Garrett
c9996a74e5 ngcgui minor rebranding update 2012-01-25 07:15:56 -06:00
Dewey Garrett
ab078fcf48 ngcgui: warn for absolute file spec conflict
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.
2012-01-25 07:15:56 -06:00
Jeff Epler
f02f871af7 don't crash when the source lives at ~/linuxcnc 2012-01-23 20:37:23 -06:00
Jeff Epler
f074bdb96c Merge remote branch 'origin/v2.5_branch'
Conflicts:
	docs/src/gcode/tool_compensation.txt
2012-01-22 12:57:38 -06:00
Jeff Epler
88eb36751f rename TkLinuxCNC's resource file 2012-01-21 17:04:33 -06:00
Jeff Epler
d65fcc3c56 whoops, restore reference to not-yet-renamed variable 2012-01-21 17:04:33 -06:00
Jeff Epler
973d39fecc a few more LinuxCNCs in tcl 2012-01-21 16:31:23 -06:00
Sebastian Kuzminsky
b9baa4d105 Merge remote branch 'origin/v2.5_branch'
Conflicts:
	docs/src/gcode/overview.txt
	scripts/linuxcnc.in
2012-01-21 12:40:55 -07:00
Jeff Epler
4d6de540ee pickconfig: refer to linuxcncrc, LinuxCNC 2012-01-21 10:13:38 -06:00
Jeff Epler
baf62b8e43 pickconfig: don't use fixed font everywhere
commit 0d938107 changed everything to a fixed font, but the
change message indicates that the goal was to affect only
the "detail_box" text widget.  Tweak the resource settings so
that a fixed font is only selected for Text widgets.
2012-01-21 10:13:37 -06:00
Jeff Epler
e153441b22 refer to LINUXCNC_CONFIG_PATH 2012-01-21 10:13:37 -06:00
Jeff Epler
c70673eda0 refer to LINUXCNC_EMCSH 2012-01-21 10:13:36 -06:00
Jeff Epler
1173b36fc1 refer to linuxcncmkdesktop 2012-01-21 10:13:36 -06:00
Sebastian Kuzminsky
7c133fabd3 rename: make axis run again when packaged 2012-01-20 22:13:39 -07:00
Jeff Epler
65cf9ebed4 Merge remote-tracking branch 'origin/v2.5_branch'
Conflicts:
	docs/man/man9/motion.9
	docs/src/Submakefile
	docs/src/gcode/overview.txt
	scripts/linuxcnc.in
	src/Makefile
	src/emc/rs274ngc/Submakefile
	src/emc/task/Submakefile
	src/emc/usr_intf/emcsh.cc
2012-01-18 17:06:00 -06:00
Dewey Garrett
93ba7d81b6 ngcgui: rebranding
update copyright date
2012-01-18 14:05:39 -06:00
Dewey Garrett
7e396dfc1c ngcgui.tcl: remove unused alternate behavior 2012-01-18 14:05:39 -06:00
Dewey Garrett
cc5e7aae2a ngcgui.tcl: more internationalization items 2012-01-18 14:05:39 -06:00
Jeff Epler
51fc09fd2d Rename many user visible parts to "linuxcnc"
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.
2012-01-18 11:25:09 -06:00
Jeff Epler
a8f6875d90 Merge remote-tracking branch 'origin/v2.5_branch'
Conflicts:
	docs/src/index.tmpl
	tcl/bin/halshow.tcl
2012-01-16 18:05:58 -06:00
Jeff Epler
d18db48da4 halshow: fix squashed widgets 2012-01-16 16:08:06 -06:00
Michael Geszkiewicz
a2fd523040 ngcgui: Make few buttons translatable
Signed-off-by: Michael Geszkiewicz <micges@wp.pl>
2012-01-16 16:53:55 +01:00
Dewey Garrett
2b7c8153ca halshow.tcl: refactor: use implicit global names
remove global declarations and use :: names for globals

minor: eliminate unused globals thisvar, newmodvar
2012-01-16 07:42:52 -06:00
Dewey Garrett
5ccd826016 halshow.tcl: improve text displays
formerly: fixed height caused displacement of other widgets
2012-01-16 07:42:51 -06:00
Dewey Garrett
1f3c2cd88a ngcgui: change name of feature var
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
2011-12-31 05:33:14 -06:00
Dewey Garrett
30a2719a7c ngcgui: bugfix
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
2011-12-29 05:05:31 -06:00
Dewey Garrett
c1401c5972 gladevcp: create gladevcp_lib
sim/gladevcp/inifiles use [RS274NGC]SUBROUTINE_PATH to find subroutines

This patch creates a gladevcp_lib directory so that ini file items
that specify [RS274NGC]SUBROUTINE_PATH with relative path items
can be resolved in both run-in-place (RIP) configurations and
with configurations copied by pickconfig.tcl for packaged builds.

The naming conventions used are the same as for ngcgui_lib
2011-12-28 08:13:00 -06:00
Dewey Garrett
4d4634b34b ngcgui: warn when file not in search path
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.
2011-12-28 05:17:02 -06:00
Dewey Garrett
e66986571c pickconfig.tcl and configs/sim/*: fix for packaged build
Allowing subdirectories was working for RIP but not a packaged build

1) pickconfig: when copying files, if inifile configdir
   has linked files, copy the linked files

2) pickconfig: when creating user configurations, create directories
   at the same nesting level as originally specified for the ini file
   relative to the directory from the $emc::CONFIG_DIR list
   so that ini file items which specify relative links will
   work in both run-in-place and packaged builds

3) configs/sim/*.ini: change ini file items for .hal and .tbl
   files to point to files within the inifile directory itself
   and create links for these files to an ancestor directory.
   This supports sharing of files for all the config/sim
   configurations and operation with run-in-place or packaged builds

4) pickconfig: (minor fix) avoid infinite loop when trying to mkdir

5) config/sim/*/*.ini: (minor fix) remove commented reference to
   nonexistent file gamepad.hal

6) ngcgui_lathe.ini: (minor fix) remove bogus item in SUBROUTINE_PATH
2011-12-27 18:51:23 -06:00
Dewey Garrett
a6e493256b pickconfig: make leaf display comply with prior appearance
don't display the ".ini" on trea leaves
2011-11-11 08:41:47 -06:00
Dewey Garrett
0d938107ad pickconfig: use emc::standard_fixed_font for detail_box
This makes it easier to line up text when preparing
README and xxx.txt files that correspond to xxx.ini files
in the config directories
2011-11-08 07:01:34 -06:00
Dewey Garrett
4b4e9923ff pickconfig: show minimal tree when starting
There are many configs avaialable so this patch
makes the last picked ini item visible
but collapses the rest of the tree
2011-11-08 07:01:34 -06:00
Dewey Garrett
7f8f6d9e06 pickconfig: improve detail_box text display
former behavior: no details were shown when a directory node clicked
new behavior:    show README in directory (if it exists) when a directory
                 node is clicked.

Note: the script also supports use of .txt files corresponding to .ini
      files but this feature doesn't seem to be used
2011-11-08 07:01:34 -06:00
Dewey Garrett
f535aaf434 pickconfig: support recursion into directories 2011-11-08 07:01:34 -06:00
Dewey Garrett
fe042995f8 pickconfig: fix var name error 2011-11-08 07:01:34 -06:00
Dewey Garrett
188597c5d9 pickconfig: minor refactor, use implicit global naming 2011-11-08 07:01:34 -06:00
Dewey Garrett
503f204b79 twopass: Add options for debugging
Support option handling as specified by keywords in the [HAL]TWOPASS
ini file item.  Example:
 [HAL]
 TWOPASS = on,verbose,nodelete

Options:
  verbose:  extra reporting including comparison of lines
            with ini file items that converted from hal files
            to tcl global variable format
  nodelete: do not delete the temporary tcl files converted from hal files
2011-10-26 21:18:09 -05:00
Dewey Garrett
ea08d3202c twopass.tcl: improve parsing of ini file items
Parse more occurrences of: "[SECTION]item "
Lines with more than one ini file item like:
  net name.[STANZA1]item1 <= [STANZA2]item2 => [STANZA2]item3
are now supported.

Note that the trailing space (or end-of-line) is used in finding
ini file item occurrences and this precludes support of lines with an
item embedded _within_ text like:
  net name.[STANZA1]item1.morestuff [STANZA2]item2
This will be reported as an error since
   [STANZA]item1.morestuff does not likely exist
2011-10-26 21:18:09 -05:00
Dewey Garrett
219ba2d5d7 twopass.tcl: support debug=dbg specifier
The pid component supports an option debug=dbg.
In the pid code, if the dbg >0, extra pins are exported
for all instances.

Here, twopass.tcl is modified so that occurrences of debug=dbg on
multiple loadrt lines are handled by ORing the values for
each line.  This maintains compatibility with the pid component
usage.

example:
   loadrt pid names=aa1 debug=0
   loadrt pid names=aa2 debug=1
   loadrt pid names=aa3 debug=0

will result in dbg = 0|1|0 = 1 and cause export of extra pins for all
pid instances.
2011-08-17 21:55:00 -05:00
Dewey Garrett
f6ca5a4ae1 twopass.tcl: support num_chan= options
Support hal components that use num_chan= instead of count=
2011-08-17 21:55:00 -05:00
Dewey Garrett
893952151f ngcgui: support search path for filenames
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.
2011-07-18 20:07:09 -05:00
Dewey Garrett
ad9349098a ngcgui: internationalization provisions 2011-07-12 11:07:24 -05:00
Dewey Garrett
a8cb306bfd pickconfig.tcl: link ngcgui_lib for package compatibility
The demo files for ngcgui (ngcgui_simple.ini, ngcgui.ini, ngcgui_lathe.ini)
point to configuration files like:

   NGCGUI_SUBFILE = ../../nc_files/ngcgui_lib/simp.ngc

This works as is with RIP builds.

For packages, pickconfig.tcl creates a link for examples like:

  ~/emc2/nc_files/examples -> /usr/share/emc/ncfiles

This patch alters pickconfig.tcl so it creates another similar link:

  ~/emc2/nc_files/ngcgui_lib -> /usr/share/emc/ncfiles/ngcgui_lib

maintaining the relative locations used in the ngcgui*.ini files
2011-07-09 22:06:53 -05:00
Dewey Garrett
41929a66e2 ngcgui.tcl: bugfix for numbered params in range 31-99 or 3digit
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
2011-07-06 08:16:10 -05:00
Dewey Garrett
614fd57275 ngcgui for v2.5
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
2011-06-08 08:01:06 -05:00
Dewey Garrett
7a09df425e twopass.tcl: ignore hal trailing comments
In the built-in conversion of a halfile to a (transient) tcl file,
trailing comments in halfile lines like:
  sets thesig 1 #comment
are separated with a ";" for tcl compatibiltiy, like:
  sets thesig 1 ;#comment
2011-01-27 10:29:08 -06:00
Dewey Garrett
26e02895ee twopass hal configuration
Allows multiple loadrt calls for same module

An earlier commit, aefefc1d9e, allows tcl scripts be used to configure
hal (jepler 8/19/2009 -- bravo!). A new directory is created, configs/simtcl,
for simulator examples that use .tcl files for hal configuration.

This patch uses the presence of an inifile entry [HAL]TWOPASS=anything to
direct a two-pass hal configuration using the files specified by
[HAL]HALFILE.  These HALFILE files can be existing .hal files or preferably
.tcl files which are very similar but allow use of programming constructions
like conditionals and loops.

  example:  HALFILE=twopass_demo.tcl
       or:  HALFILE=../sim/core_sim.hal

The principal script, twopass.tcl reads the HALFILE files in two passes.

In the first pass (pass0), no hal commands are executed but loadrt and loadusr
calls are consolidated.  This allows entry of loadrt calls for a given module
in multiple places using either the "count=" or "names=" specifiers (but not
simultaneously on a given module as they are mutually exclusive).

For compatibilty with existing .hal files, when .hal HALFILE files are
specified, they are first read and the [SECTION]ITEM specifiers are rewritten
as $::SECTION(ITEM) for tcl compatibility.  This step is not manifest to the
user.  The .hal files are also checked for hal commands which conflict in name
with tcl commands and warnings are issued to denote potential problems.

Since no hal commands are executed in pass0, the hal state cannot be
interrogated in any useful way.  At the conclusion of pass0, all the combined
loadrt and loadusr commands are executed.

In the second pass (pass1), the HAL[HALFILE] files are read again and all
commands except the loadrt and loadusr commands are executed (unless they are
for modules that were not detected in pass0).  A function (named
"::tp::passnumber") is available for use in tcl HALFILE files for debugging.

In the second pass, the addf functions are executed in the order of occurrence.
Since the order of the addf functions may be very important, the user must
manage this sequence.  A convenient method is to put all addf calls in one
place in the desired order.  An alternative method is to use the "position"
argument in the addf call.

Two demo/test cases based on sim/axis.ini and its three hal files
(core_sim.hal,axis_manualtoolchange.hal,simulated_home.hal)
are included:

twopass_compat.ini  uses unmodified hal files that are transcribed
                    transparently for tcl compatibility

twopass_demo.ini    uses a tcl configuration file with both loadrt "count="
                    and "names=" methods on different modules

Notes:
  1) Using the form "loadrt modname count=n" requires the user to manage
     the order and identity of the n modname items created.  Modules
     are created numbered 0 to n-1 and the user must keep track of the
     ordering.

     It is advantageous to use the form "loadrt modname names=namea,nameb ..."
     With this method, the user has explicit control of the component
     names and can use multiple loadrt lines even in different files.
     For example:

         filea
            loadrt flipflop names=ff1,ff2
         ...
         fileb
            loadrt flipflop names=ff9
         ...
         filec
            addf ff9 servo-thread
            addf ff2 servo-thread
            addf ff1 servo-thread

     With this method, configuration files can become more modular and
     readable while supporting an overall strategy for ordering the execution
     of the components.

  2) In executing [HAL]HALFILE tcl scripts, the tcl "puts" command will
     print during each pass.  The user can alter this behavior using procs:
        ::tp::passnumber   returns 0 | 1 for the current pass number
        ::tp::no_puts      disable the tcl "puts" command
        ::tp::alter_puts   alters  the tcl "puts" command so that it
                           reports <pass0> or <pass1>
        ::tp::restore_puts restores the tcl "puts" command
2011-01-14 07:40:40 -06:00
Jeff Epler
10164302e1 halshow: remove debug output 2011-01-01 10:42:51 -06:00
Jeff Epler
ccfa8c2037 pickconfig: make files writable
explicitly make all copied files user-writable.

[file copy] copies the file mode, so if the original was not writable
then the copy will not be writable for [put_file_contents] or for
later user modification.
2010-11-29 22:02:21 -06:00
Jeff Epler
75ea5e7605 halshow: permit an unlimited number of levels
ongoing work on hostmot2 8i20 support has led to names like
    hm2_5i23.0.sserial.0.port.0.8i20.angle
which made halshow grumpy because it had a hardcoded limit of 5
tree levels.  Generalize halshow so that an unlimited number of levels
will work.
2010-10-19 20:18:53 -05:00
Jeff Epler
e3ac9c5508 tkemc: show coordinate system in offset widget 2010-09-08 11:42:39 -05:00
Al Smart
59da961619 tkemc: add some padding 2010-09-08 11:19:06 -05:00
Al Smart
ecbe2a8ad0 tkemc: get rid of unneeded 'upvar's
refer to global variables by using the $:: notation instead
2010-09-08 11:19:02 -05:00
Jeff Epler
773c1ff07d tkemc: visual improvements
* get rid of undesirable ridge border on jog speed controls
* align jog controls to the top of their area, not center
  (better appearance when there are no angular axes)
2010-08-31 09:49:37 -05:00
Al Smart
ff39c661a9 tkemc: show work offsets for all axes 2010-08-31 09:49:37 -05:00
Jeff Epler
9407cf49c9 Merge remote branch 'origin/v2.4_branch' 2010-08-27 09:43:30 -05:00
Jeff Epler
3ebd186f26 tkemc: fix radiobutton appearance
A difference between tk8.4 and tk8.5 radiobuttons meant that
on Ubuntu 10.04 it was not possible to see whether a radiobutton
was selected or not selected.

After this change, the background of the checkbutton's indicator is
blue and its indicator dot is white.  This seems most in keeping with
the tkemc white-on-blue style.
2010-08-27 09:42:36 -05:00
Alfred Smart
edc3a7718c make Set Coordinates display axis needed 2010-08-27 09:40:30 -05:00
Jeff Epler
39f51c797b tkemc: simplify worldlabellist, axiscoordmap
since 4b9ca027 worldlabellist always held all the axis letters A...W and
the axiscoordmap was always 0...8.  The padding to at least 9 items
also became unneeded.

In this case, the initialization code can be greatly simplified.
2010-08-27 09:40:29 -05:00
Chris Radek
87f9510792 remove unused/mistaken code 2010-08-23 15:09:31 -05:00
Alfred Smart
4b9ca0270a make tkemc display only axis needed & show MACHINE from ini 2010-08-23 15:09:31 -05:00
Chris Radek
13cb58dc26 Merge remote branch 'origin/v2.4_branch'
Conflicts:
	src/emc/rs274ngc/interp_o_word.cc
2010-08-13 21:53:13 -05:00
Jeff Epler
99ca8582d1 clean up debugging print 2010-08-12 21:26:39 -05:00
Jeff Epler
0282ba7307 Merge remote branch 'origin/v2.4_branch'
Conflicts:
	share/axis/tcl/axis.tcl
2010-07-29 14:51:50 -05:00
Jeff Epler
26344a5fec emccalib: Fix second and subsequent tabs
The fix in 2f96e7c39f was incorrect, because the "match found" test
for [string match] is different than for [lsearch -regexp].
2010-07-27 13:40:16 -05:00
Dewey Garrett
c27d6ca41a halshow: only show Save when appropriate 2010-06-29 12:58:42 -05:00
Dewey Garrett
907ad600c5 halshow: add menu options for load/save/exit 2010-06-29 11:52:55 -05:00
Jeff Epler
1fd5c420f2 Merge remote branch 'origin/v2.4_branch' 2010-06-26 20:00:40 -05:00
Jeff Epler
8a00e9b8a8 Don't present an option that doesn't work
Running a configuration from a read-only location won't work
(axis crashes outright, and with tkemc offsets are totally broken
since the var file can't be written).  So, don't offer the user the
"run without copying" option.
2010-06-24 10:59:02 -04:00
Jeff Epler
167ec44a7a make desktop files executable to placate lucid
while we agree it's utterly insane to require .desktop files to be
executable (because they won't do the right thing when executed
from the shell), it's apparently some kind of security measure.  Without
this, double clicking a desktop emc icon doesn't work.
2010-06-24 10:59:01 -04:00
Chris Radek
3b250c9907 Merge remote branch 'origin/v2.4_branch'
Conflicts:
	src/hal/components/stepgen.c
2010-06-18 10:14:49 -05:00
Jeff Epler
2f96e7c39f emccalib: fix crash 'unmatched open quote in list'
lsearch must be used only for arguments which are guaranteed to have
proper tcl "list" structure.  The halfile construct
    loadrt hal_parport cfg="0x378 out  "
does not.  Treat the hal file lines like free-form text instead,
and use glob-style [string match] which does not place any restrictions
on the form of the string argument.
2010-06-14 06:55:29 -05:00
Dewey Garrett
e929b2f785 tkemc: make lsearch compatible with tcl8.4
lsearch -nocase is apparently new in tcl8.5
2010-06-07 11:49:35 -05:00
Dewey Garrett
c58b548d01 tkemc: display and entry of all tool offsets 2010-05-31 18:30:38 -05:00
Dewey Garrett
48fff363cb tcl packages for use by external tcl programs
Locate emc.so, hal.so, emc.tcl and a new pkgIndex.tcl file in a directory that
is a subdir of a directory included in the tcl auto_path list as configured for
the tcl/tk packages in the ubuntu distribution.

For a conventional build with --prefix=/usr, the chosen parent dir is:
   /usr/lib/tcltk
and the shared library files will be located in the subdir:
   /usr/lib/tcltk/emc2

With these changes, aan external tcl program should be able to say:
   package require Emc 1.0
and/or
   package require Hal 1.0

For this normal case, no extra configuration is required.

For an installed emc built with --prefix=/otherlocation, the using
application must modify the tcl auto_path list:
  e.g., lappend auto_path /otherlocation/lib/tcltk
or set the TCLLIBPATH appropriately
  e.g., export TCLLIBPATH=/otherlocation/lib/tcltk

For a run-in-place build of emc, '. scripts/emc-environment' to set
TCLLIBPATH appropriately.
2010-05-31 18:22:20 -05:00
Jeff Epler
f69625b9d0 Merge remote branch 'origin/v2.4_branch'
Conflicts:
	VERSION
	debian/changelog
	src/emc/usr_intf/axis/scripts/axis.py
	src/hal/user_comps/devices/Submakefile
2010-05-30 14:01:21 -05:00
Dewey Garrett
c33d8d61a0 remove inappropriate execute permissions
this eliminates bogus menu options for tkemc/Scripts menu in
run-in-place build
2010-05-19 14:44:37 -05:00
Jeff Epler
76a676aa2d Merge remote branch 'origin/v2.4_branch'
Conflicts:
	VERSION
	debian/changelog
2010-05-18 17:16:06 -05:00
Dewey Garrett
29393fe2a3 tkemc: make the tool items more like axis
add item: File/Reload Tool Table remove item: View/Tools...
2010-05-10 20:39:52 -05:00
Dewey Garrett
f9cd27781b tkemc: fix tool editor
use correct name for default tooleditor (tooledit,not tooledit.tcl) and
fix exec line for tooleditor
2010-05-10 20:39:52 -05:00
Jeff Epler
bae5891822 Merge remote branch 'jepler/glrefactor' 2010-02-05 16:35:29 -06:00
Jeff Epler
8206287dd8 USER_CONFIG_DIR is a better way to name this location 2010-01-28 07:59:55 -06:00
Jeff Epler
bec97ff71e close right directory even for RIP 2010-01-28 07:59:55 -06:00
Jeff Epler
b83b1e2547 correctly track whether there are nonsample configs 2010-01-28 07:59:55 -06:00
Jeff Epler
853d893e60 describe directories even for RIP 2010-01-28 07:59:54 -06:00
Jeff Epler
a570537b04 dir is guaranteed to be normalized 2010-01-28 07:59:54 -06:00
Jeff Epler
1f6cd76c5c get config dir list from emc.tcl
this is better than the one from the commandline, because
it is guaranteed to be normalized by emc.tcl
2010-01-28 07:59:53 -06:00
Jeff Epler
078101f485 make sure to always describe directory 2010-01-28 07:59:53 -06:00
Jeff Epler
cf28af957c provide tcl with info about config directories 2010-01-28 07:59:53 -06:00
Alex Joni
a5133a5231 fix incremental steps for mini based on mm/inch 2010-01-08 00:05:09 +02:00
Jeff Epler
a48c1c4a2b use tk8.5 standard font family names 2009-12-18 22:02:19 -06:00