diff --git a/docs/src/checkref b/docs/src/checkref index 0779bd4140d..ca467ebd1d3 100755 --- a/docs/src/checkref +++ b/docs/src/checkref @@ -23,7 +23,7 @@ for F in $FILES; do OUT=.checklink.$LANGUAGE.$(basename $F).tmp rm -f $OUT linuxcnc-checklink --quiet --exclude "(http|https|irc)://" $F 2>&1 | tee $OUT - egrep -q 'List of (broken links and other issues|duplicate and empty anchors)' $OUT + grep -E -q 'List of (broken links and other issues|duplicate and empty anchors)' $OUT if [ $? -ne 1 ]; then BAD_LINKS=1 fi diff --git a/docs/src/gui/qtvcp-vismach.adoc b/docs/src/gui/qtvcp-vismach.adoc index 2bc95917c1b..7d97fe00ca4 100644 --- a/docs/src/gui/qtvcp-vismach.adoc +++ b/docs/src/gui/qtvcp-vismach.adoc @@ -172,6 +172,9 @@ It is much easier to move while building if the origin of the model is at a rota Alternatively parts can be _created inside the model script from a range of shape primitives_. +*`assembly = collction([part1,part2,part3])`*:: + Collection is a general container of related parts + Many shapes are _created at the origin_ and need to be _moved to the required location_ after creation. *`cylinder = CylinderX(x1, r1, x2, r2)`*:: @@ -210,9 +213,6 @@ part4 = Collection([part1, part2]) Parts may need to be moved in the Vismach space to assemble the model. The origin does not move - Translate() and Rotate() move the Collection as you add parts, relative to a stationary origin. -//FIXME unclear -They may also need to be moved to create the animation as the animation rotation axis is created at the origin (but moves with the Part). - [[sub:qtvcp:vismach:translate]] === Translating Model parts @@ -227,7 +227,6 @@ They may also need to be moved to create the animation as the animation rotation [[sec:qtvcp:vismach:animate]] == Animating Parts -//FIXME 2 or 3 functions ? HalToolCylinder not documented here ? To *animate the model controlled by the values of HAL pins* there are four functions: `HalTranslate`, `HalRotate`, `HalToolCylinder` and `HalToolTriangle`. @@ -305,7 +304,7 @@ toolshape = Color([1, 1, 0, 1],[HalToolTriangle()]) ---- === HAL Adjustable Primitives -All primitives can have HAL pin names substituted for coordinates. + +All shape primitives can have HAL pin names substituted for coordinates. + Either by adding the component object as the first variable and substituting the pinname string for a coordinate, or + by substituting the full component/pinname string for a coordinate. + @@ -396,8 +395,8 @@ Sets the _display color of the part_. + *`part = Color([_colorspec_], [_part_])`*:: Note that unlike the other functions, the part definition comes second in this case. + - `_colorspec_`;; Three RGB values and opacity. + - For example [1,0,0,0.5] for a 50% opacity red. + `_colorspec_`;; Three (0-1.0) RGB values and opacity. [R,G,B,A] + + For example [1.0,0,0,0.5] for a 50% opacity red. === HALColorFlip Sets the _display color of the part based on a designated HAL bit pin state_. + @@ -405,8 +404,8 @@ Sets the _display color of the part based on a designated HAL bit pin state_. + *`part = HALColorFlip([_colorspec_], [_colorspec_], [_part_], hal_comp, hal_pin)`*:: Note that unlike the other functions, the part definition comes second in this case. + - `_colorspec_`;; Three RGB values and opacity. + - For example [1,0,0,0.5] for a 50% opacity red. + `_colorspec_`;; Three (0-1.0) RGB values and opacity. + + For example [1.0,0,0,0.5] for a 50% opacity red. `hal_comp`;; The _HAL component Object_ or None. + In QtVCP if you are reading _system pins_ directly, then the component argument is set to `None`. + `hal_pin`;; The _name of the BIT HAL IN pin_ that will change the color. + @@ -462,6 +461,20 @@ Some of the available HalHUD function: + * add_pin(text, format, pinname) * set_text_color(red, green, blue) +=== HideCollection + + HideCollection is a container that uses a HAL pin to control display of the contained parts. + + A logic high on the HAL pin will hide the contained parts. + +[source,python] +---- +comp.newpin("hide-chuck", hal.HAL_BIT, hal.HAL_IN) +# +chuckassembly = HideCollection([chuckassembly],comp,'hide-chuck') +# also can be used like this +chuckassembly = HideCollection([chuckassembly],None,'myvismach.hide-chuck') +---- + === Capture This sets the current position in the model. diff --git a/lib/python/qtvcp/lib/qt_vismach/primitives.py b/lib/python/qtvcp/lib/qt_vismach/primitives.py index 5f3666db680..178176b12cd 100644 --- a/lib/python/qtvcp/lib/qt_vismach/primitives.py +++ b/lib/python/qtvcp/lib/qt_vismach/primitives.py @@ -125,6 +125,25 @@ def set_volume(self, vol): self.vol = vol; +class HideCollection(Collection): + def __init__(self, parts, comp, var): + self.parts = parts + self.comp = comp + self.var = var + self.vol = 0 + + def traverse(self): + try: + if self.comp is None: + v = bool(hal.get_value(self.var)) + else: + v = bool(self.comp[self.var]) + except: + v = 0 + if v: + return + super(HideCollection,self).traverse() + class Translate(Collection): def __init__(self, parts, x, y, z): self.parts = parts diff --git a/scripts/githelper.sh b/scripts/githelper.sh index ede5ad65486..283192d2f13 100644 --- a/scripts/githelper.sh +++ b/scripts/githelper.sh @@ -16,7 +16,7 @@ function githelper() { if [ -z "$1" ]; then - GIT_BRANCH=$(git branch | egrep '^\*' | cut -d ' ' -f 2) + GIT_BRANCH=$(git branch | grep -E '^\*' | cut -d ' ' -f 2) if [ "$GIT_BRANCH" = "(no" ]; then echo "'git branch' says we're not on a branch, pass one in as an argument" > /dev/null 1>&2 return diff --git a/scripts/swish b/scripts/swish index adaec6f7323..59037dc5cd6 100755 --- a/scripts/swish +++ b/scripts/swish @@ -59,7 +59,7 @@ Usage: by swish is grepped for this pattern, and matching lines are printed. By default, $b attempts to turn swish-pattern into a grep-pattern, but this only works if swish-pattern is a simple - word. For more information about grep patterns, see 'man egrep' + word. For more information about grep patterns, see 'man grep' EOF exit 1 } @@ -69,7 +69,7 @@ while getopts "hRF:" opt do case "$opt" in R) FORCEREBUILD=1 ;; - F) FILEFILTER="egrep -z -e $OPTARG" ;; + F) FILEFILTER="grep -E -z -e $OPTARG" ;; h|?) usage ;; esac done @@ -91,9 +91,9 @@ fi if ! [ -z "$FILEFILTER" ]; then swish-e -f $SWISHINDEX -H0 -x '\0' -w "$PAT" \ | $FILEFILTER | makerelative \ - | xargs -0 egrep -Hnis -e "$REGEXP" + | xargs -0 grep -E -Hnis -e "$REGEXP" else swish-e -f $SWISHINDEX -H0 -x '\0' -w "$PAT" \ | makerelative \ - | xargs -0 egrep -Hnis -e "$REGEXP" + | xargs -0 grep -E -Hnis -e "$REGEXP" fi diff --git a/src/configure.ac b/src/configure.ac index 1e1f2c31d9d..d17b1d1f3d9 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -73,7 +73,6 @@ fi AC_SUBST([EMC2VERSION]) AC_PATH_PROG(GREP, grep) -AC_PATH_PROG(EGREP, egrep) # # check for pkg-config @@ -690,7 +689,7 @@ fe () { # Fully expand argument. Example: # ${datadir} -> ${datarootdir} -> ${prefix}/share -> /usr/local case "$1" in - *\$*) eval fe \""$1"\" ;; + *\$*) eval fe "\"$1\"" ;; *) echo "$1" ;; esac } diff --git a/src/hal/classicladder/classicladder_gtk.c b/src/hal/classicladder/classicladder_gtk.c index 2c2f365df11..78432570c5a 100644 --- a/src/hal/classicladder/classicladder_gtk.c +++ b/src/hal/classicladder/classicladder_gtk.c @@ -176,7 +176,7 @@ void GetTheSizesForRung( void ) // size of the page or block changed ? if ( InfosGene->PageHeight!=PageHeightBak || InfosGene->BlockHeight!=BlockHeightBak ) - UpdateVScrollBar( TRUE/*AutoSelectCurrentRung*/ ); + UpdateVScrollBar( /*AutoSelectCurrentRung*/ ); PageHeightBak = InfosGene->PageHeight; BlockHeightBak = InfosGene->BlockHeight; } diff --git a/src/hal/classicladder/manager_gtk.c b/src/hal/classicladder/manager_gtk.c index 8602c65e4a3..5f5441c7781 100644 --- a/src/hal/classicladder/manager_gtk.c +++ b/src/hal/classicladder/manager_gtk.c @@ -69,7 +69,7 @@ void RefreshSectionSelected( ) EditorButtonsAccordingSectionType( ); //XXX search functionality, not implemented in LinuxCNC. //EnableDisableMenusAccordingSectionType( ); - UpdateVScrollBar( TRUE/*AutoSelectCurrentRung*/ ); + UpdateVScrollBar( /*AutoSelectCurrentRung*/ ); } void ManagerDisplaySections( char ForgetSectionSelected ) diff --git a/src/hal/classicladder/socket_modbus_master.c b/src/hal/classicladder/socket_modbus_master.c index 74194d94134..1eb86cce900 100644 --- a/src/hal/classicladder/socket_modbus_master.c +++ b/src/hal/classicladder/socket_modbus_master.c @@ -122,7 +122,7 @@ void ConfigSerialModbusMaster( void ) int Error = 0; if ( ModbusConfig.ModbusSerialPortNameUsed[ 0 ]!='\0' ) { - if ( !SerialOpen( ModbusConfig.ModbusSerialPortNameUsed, ModbusConfig.ModbusSerialSpeed ) ) + if ( !SerialOpen( /*ModbusConfig.ModbusSerialPortNameUsed, ModbusConfig.ModbusSerialSpeed*/ ) ) { Error = -1; printf(_("INFO CLASSICLADDER---I/O Modbus master Data bits %i Stop bits %i Parity %i\n"),ModbusConfig.ModbusSerialDataBits,ModbusConfig.ModbusSerialStopBits,ModbusConfig.ModbusSerialParity); diff --git a/src/hal/utils/halrmt.c b/src/hal/utils/halrmt.c index 9ceac8cb9da..73f0f18e9e1 100644 --- a/src/hal/utils/halrmt.c +++ b/src/hal/utils/halrmt.c @@ -308,6 +308,7 @@ #include "inifile.h" // iniFind() from libnml #endif #include +*/ /*********************************************************************** * LOCAL FUNCTION DECLARATIONS * diff --git a/tests/module-loading/rtapi-app-main-fails/checkresult b/tests/module-loading/rtapi-app-main-fails/checkresult index c9eb377ab28..5b646386e8d 100755 --- a/tests/module-loading/rtapi-app-main-fails/checkresult +++ b/tests/module-loading/rtapi-app-main-fails/checkresult @@ -7,13 +7,13 @@ if [ ! -f $STDERR ]; then fi # Linux spelling of ERANGE -if egrep -q 'rtapi_app_main_fails.* Numerical result out of range' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Numerical result out of range' $STDERR; then echo "loadrt found the test component, and it failed to load" exit 0 fi # FreeBSD spelling of ERANGE -if egrep -q 'rtapi_app_main_fails.* Result too large' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Result too large' $STDERR; then echo "loadrt found the test component, and it failed to load" exit 0 fi diff --git a/tests/module-loading/shared-test.sh b/tests/module-loading/shared-test.sh index 94a28c1a1ca..4f5780138b4 100644 --- a/tests/module-loading/shared-test.sh +++ b/tests/module-loading/shared-test.sh @@ -3,7 +3,7 @@ halrun setup.hal > hal-output 2>&1 RESULT=$? -NUM_PINS=$(cat hal-output | egrep $(cat PIN_NAME_REGEX) | wc -l) +NUM_PINS=$(cat hal-output | grep -E $(cat PIN_NAME_REGEX) | wc -l) if [ $RESULT -ne $(cat RESULT) ]; then exit 1