summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kuzminsky <seb@highlab.com>2014-05-30 09:30:14 -0600
committerSebastian Kuzminsky <seb@highlab.com>2014-05-30 09:30:14 -0600
commitb1ea71d51037f0dfb048301ed18582ad2a280ec0 (patch)
tree9c32f971d364f2cac667b94ec0dc87d07e0071ad
parent94cc15180bf615c6d806408ab03e6b4e27775fdb (diff)
parent66576c49773ad804c13754555b45e619b7e21a16 (diff)
downloadlinuxcnc-b1ea71d51037f0dfb048301ed18582ad2a280ec0.tar.gz
linuxcnc-b1ea71d51037f0dfb048301ed18582ad2a280ec0.zip
Merge remote-tracking branch 'origin/v2.5_branch' into 2.6
-rw-r--r--docs/src/config/ini_config.txt1
-rw-r--r--docs/src/gui/axis.txt6
-rw-r--r--src/hal/utils/comp.g4
-rw-r--r--tests/comp/.gitignore1
-rw-r--r--tests/comp/expected0
-rw-r--r--tests/comp/names_dont_match.comp6
-rw-r--r--tests/comp/names_match.comp6
-rwxr-xr-xtests/comp/test.sh27
8 files changed, 49 insertions, 2 deletions
diff --git a/docs/src/config/ini_config.txt b/docs/src/config/ini_config.txt
index 7960f9f0c..78f42b583 100644
--- a/docs/src/config/ini_config.txt
+++ b/docs/src/config/ini_config.txt
@@ -69,6 +69,7 @@ The following sections are used by LinuxCNC:
* '[<<sub:AXIS-section,AXIS_n>>]' individual axis variables
* '[<<sub:EMCIO-Section,EMCIO>>]' settings used by the I/O Controller
+[[sub:ini-variables]]
=== Variables
A variable line is made up of a variable name, an equals sign (=), and
diff --git a/docs/src/gui/axis.txt b/docs/src/gui/axis.txt
index 2b5ccb115..d89da3019 100644
--- a/docs/src/gui/axis.txt
+++ b/docs/src/gui/axis.txt
@@ -156,8 +156,10 @@ Do not use 'Run From Selected Line' if your g code program contains subroutines.
* 'Paste to MDI history' - Paste from the clipboard to the MDI history window
-* 'Calibration' - Starts a PID tuning assistant, which is mainly for servo systems.
- Some things can be changed on a stepper system.
+* 'Calibration' - Starts the Servo Axis Calibration assistant.
+ Calibration reads the HAL file and for every 'setp' that uses a variable
+ from the ini file that is in an [AXIS_n] section it creates an entry that
+ can be edited and tested.
* 'Show HAL Configuration' - Opens the HAL Configuration window where you can
monitor HAL Components, Pins, Parameters, Signals, Functions, and Threads.
diff --git a/src/hal/utils/comp.g b/src/hal/utils/comp.g
index e9bf7406d..75971a96d 100644
--- a/src/hal/utils/comp.g
+++ b/src/hal/utils/comp.g
@@ -886,6 +886,10 @@ def process(filename, mode, outfilename):
os.path.splitext(os.path.basename(filename))[0] + ".c")
a, b = parse(filename)
+ base_name = os.path.splitext(os.path.basename(outfilename))[0]
+ if comp_name != base_name:
+ raise SystemExit, "Component name (%s) does not match filename (%s)" % (comp_name, base_name)
+
f = open(outfilename, "w")
if options.get("userinit") and not options.get("userspace"):
diff --git a/tests/comp/.gitignore b/tests/comp/.gitignore
new file mode 100644
index 000000000..12fa1117a
--- /dev/null
+++ b/tests/comp/.gitignore
@@ -0,0 +1 @@
+names_match.c
diff --git a/tests/comp/expected b/tests/comp/expected
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/comp/expected
diff --git a/tests/comp/names_dont_match.comp b/tests/comp/names_dont_match.comp
new file mode 100644
index 000000000..7c719c2e1
--- /dev/null
+++ b/tests/comp/names_dont_match.comp
@@ -0,0 +1,6 @@
+component wrong_name;
+license "GPL";
+pin out bit out;
+function _ nofp;
+;;
+FUNCTION(_) {}
diff --git a/tests/comp/names_match.comp b/tests/comp/names_match.comp
new file mode 100644
index 000000000..3114ec4f4
--- /dev/null
+++ b/tests/comp/names_match.comp
@@ -0,0 +1,6 @@
+component names_match;
+license "GPL";
+pin out bit out;
+function _ nofp;
+;;
+FUNCTION(_) {}
diff --git a/tests/comp/test.sh b/tests/comp/test.sh
new file mode 100755
index 000000000..da73b5fee
--- /dev/null
+++ b/tests/comp/test.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -x
+
+# this one must succeed
+rm -f names_match.c
+comp names_match.comp
+if [ $? -ne 0 ]; then
+ echo 'comp failed to process names_match.comp'
+ exit 1
+fi
+if [ ! -f names_match.c ]; then
+ echo 'comp failed to produce names_match.c'
+ exit 1
+fi
+
+# this one must fail
+rm -f names_dont_match.c
+comp names_dont_match.comp
+if [ $? -eq 0 ]; then
+ echo 'comp erroneously accepted names_dont_match.comp'
+ exit 1
+fi
+if [ -f names_dont_match.c ]; then
+ echo 'comp erroneously produced names_dont_match.c'
+ exit 1
+fi
+