Commit graph

465 commits

Author SHA1 Message Date
Dewey Garrett
9ea8327293 twopass,bugfix: support all ini var substitutions
types that are accepted by halcmd.c, namely:
   [SECTION]VAR<whitespace>
   [SECTION](VAR)<any char>

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2016-09-25 12:06:19 -07:00
Sebastian Kuzminsky
01e4bb6889 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-06-08 11:19:03 -06:00
Sebastian Kuzminsky
f1f7b27885 tklinuxcnc UI: rebranding
Get the LinuxCNC version number from the rebranded environment variable
(LINUXCNCVERSION), not the old one (EMC2VERSION).

Fixes #64.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-03 08:25:32 -06:00
Sebastian Kuzminsky
8dfa610c3f Merge remote-tracking branch 'origin/2.6' into 2.7
Conflicts:
	src/rtapi/uspace_common.h
2015-12-27 10:52:33 -07:00
Dewey Garrett
b336895116 mini.tcl: remove duplicate geo mgmt of widget
is detected as error with tk8.6:

  "Error in startup script: cannot use geometry manager grid
   inside .top.left which already has slaves managed by pack"

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2015-12-22 21:59:07 -06:00
Dewey Garrett
422500160a twopass.tcl: use proc find_file_in_hallib_path
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-08-01 11:29:42 -07:00
Dewey Garrett
70c89f55f9 emccalib.tcl: find halfiles using hallib proc
that implements rule for HALLIB_PATH=.:$HALLIB_DIR (like linuxcnc.in)

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-07-31 15:34:44 -07:00
Dewey Garrett
f85632ebad emccalib: donot give up if a halfile not found
bugfix:
In a sim config, a halfile may not be found by emccalib
even though it was found by the linuxcnc script using
halfile search rules (HALLIB_PATH=.:HALLIB_DIR).
Such halfiles files are not (currently) considered to contain
tunable items but their absence should not cause emccalib.tcl
to skip loading other halfiles which may include tunable items.

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-05-03 09:12:57 -07:00
Dewey Garrett
2f78543991 emccalib.tcl: ignore LIB: hal files
as they should not include tunable items
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-04-17 16:42:27 -07:00
Dewey Garrett
d95dd4e1fd Merge remote-tracking branch 'origin/2.6' into 2.7
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-04-17 16:42:03 -07:00
Dewey Garrett
453533f50d emccalib.tcl: allow whitespace on detected setp lines
leading whitespace caused relevant setp lines to be ignored
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-04-17 13:06:04 -07:00
Dewey Garrett
d6330e363a Merge branch '2.6' into 2.7
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-03-25 20:39:23 -07:00
Dewey Garrett
6c947aa07f tooledit.tcl: typo in switch
thanks to jepler for spotting it
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-03-25 20:38:21 -07:00
Dewey Garrett
828bd50477 twopass: use auto_path to allow non-builtins
Also:
  make sure LINUXCNC_TCL_DIR (exported from linuxcnc script)
  is first in ::auto_path  in case run-in-place with a installed
  deb on same system

  hal_to_tcl: prepend conflict words with 'hal'
              to eliminate err message and change
              msg for WARNING to NOTE
minor:
  do not error if zero modules encountered
  eliminate trick for parray (no longer necessary)
  add notes for nochange,cmds
  fix typo on err message in prep_the_files proc

With this commit, twopass halfiles (haltcl) can use Tk widgets
for messages etc. (but note that the main app will not start
until tk windows are closed unless a separate process is started)

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-01-24 15:13:55 -07:00
Dewey Garrett
a8bef41745 halcheck: library halfile to check common errors
suggested by Peter Wallace
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-01-19 18:35:58 -07:00
Dewey Garrett
b92baa8b3c hallib: relocate common halfiles to lib/hallib
Eliminates multiple file copies and removes unneeded sym links by
taking advantage of the search path (HALLIB_PATH) used by the
linuxcnc script

0) move most configs/common/*.hal files to lib/hallib/
1) eliminate copy_configs etc. from Makefile
2) remove sym links that are no longer needed for
   the relocated hal files
3) also move most-used halfiles (not managed by make)
     simulated_home.hal
     sim_spindle_encoder.hal
     locking_indexer.hal
     lathe.hal
     gantrysim.hal
     simulated-gantry-home.hal
     simulated_limits.hal
     tripodsim.hal
     servo_sim.hal
4) lib/hallib/README: update and reorganize
5) pickconfig: make convenience link for HALLIB_DIR
   The linuxcnc script prints the name of halfiles when they
   are found using the search path (.:HALLIB_DIR) but the
   HALLIB_DIR pathname may be long so this patch has pickconfig.tcl
   make a sym link in the copied config directory
   A user can use the link to copy a halfile to make local modifications,
    for example:
    $ cd  ~/linuxcnc/configs/sim.config.name # sim config created by pickconfig
    $ cp hallib/halfilename halfilename      # copy lib file for local mods
6) update docs: Running-linuxCNC.txt

Notes:
a) affected configs require no changes as the linuxcnc script will
   find files using HALLIB_PATH (defined in scripts/linuxcnc.in)
b) postgui halfiles are not affected since processing depends on gui
c) not working (but has not for a long time):
   configs/sim/axis/remap/iocontrol-removed/iocontrol-removed.ini

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-01-10 13:59:32 -07:00
Dewey Garrett
2764db701c twopass.tcl: handle haltcl files with args
also: parse ini file like haltcl does
      allow use of parray with twopass processing
      protect unknown command from recursion in pass0

hookup_moveoff.tcl: improve comment on twopass compatibility

xhc-hb04.tcl: make quiet file-specific

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2014-12-26 15:44:02 -07:00
Dewey Garrett
8b44ccfa6a hallib: support for system-wide halfiles
1) HALLIB_DIR: new directory for system-wide hal files (*.hal,*.tcl and
   supporting files).
   Locations:
             RIP: HALLIB = lib/hallib/
             DEB: HALLIB = /usr/share/linuxcnc/hallib/

2) HALLIB_PATH: search path for locating halfiles:
   HALLIB_PATH = .:HALLIB_DIR (e.g., ini directory then system library)

3) LIB: prefix to explicitly specify a system library halfile (with
   no search of the ini file directory)
   [HAL]
   ...
   HALFILE = LIB:filename.[hal|tcl]
   ...

This patch addresses a general issue of the multiple copies (or links) of
halfiles throughout the config tree and makes it simple to explicitly specify a
library halfile so that a user does not need to copy these files when modifying
a configuration.  For example, one can instruct a user with:
   'Include the line HALFILE = LIB:xhc-hb04.tcl in the [HAL] stanza of
    your ini file'

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2014-12-16 19:33:51 -07:00
Dewey Garrett
5760eaf349 emccalib.tcl: enable search in POSTGUI_HALFILEs
ini hal pins don't exist when [HAL]HALFILEs are executed
but do exist when [HAL]POSTGUI_HALFILES are executed

also: modify example configs/sim/axis/ini_hal_demo.ini
      to demonstrate ability to use calibration for
      ini hal pins

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2014-09-30 08:27:36 -06:00
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