linuxcnc/scripts/gladevcp_demo
Lubomir Rintel a63ec765cb all: update FSF address in GPL 2.0 notices
If you write to 59 Temple Place you're unlikely to get a response.
Let's realign the address with a more up-to-date one from [1].

  [1] https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

This is purely a cosmetic change, doesn't affect the meaning of the
license. Done to make rpmlint happy.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2017-09-15 13:06:22 +02:00

82 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
# This file is used for scripts that demonstrate gladevcp
# The scripts typically use an extension of .demo
# 1) start realtime
# 2) run glacevcp with supplied parameters
# 3) stop realtime
# Copyright: 2014
# Author: Dewey Garrett <dgarrett@panix.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
prog=$(basename $0)
function usage () {
cat <<EOF
Usage:
$prog [gladevcp options]
gladevcp_demo: start realtime and invoke gladevcp
The help for gladvcp shows its options:
gladevcp --help
$(gladevcp -h)
EOF
exit 1
} ;# usage
function popup () {
msg="$*"
wish <<EOF &
wm withdraw .
tk_messageBox \
-title "$prog" \
-message "$msg" \
-icon error \
-type ok
destroy .
EOF
} ;# popup
# begin----------------------------------------------------
REALTIME=$(linuxcnc_var REALTIME)
$REALTIME status >/dev/null
status=$?
if [ $status = 0 ] ; then
msg="$prog: Realtime is already active"
echo "$msg"
popup "$msg"
exit 1
else
$REALTIME start
fi
case $# in
0) usage;;
*) ARGS="$@";;
esac
if [ ! -z "$debug" ] ; then
echo debug=$debug
echo REALTIME=$REALTIME
echo ARGS="$ARGS"
pwd
fi
eval gladevcp "$ARGS"
halrun -U