[GRASS-SVN] r29474 - grass/trunk/scripts/d.redraw

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 18 23:07:18 EST 2007


Author: hamish
Date: 2007-12-18 23:07:18 -0500 (Tue, 18 Dec 2007)
New Revision: 29474

Modified:
   grass/trunk/scripts/d.redraw/d.redraw
Log:
new -a and -r flags to redraw all frames, and redraw all frames
using using the current region (instead of maintaining individual
regions for each frame). The -r flag still needs some work to
get it right, in parallel with d.save.


Modified: grass/trunk/scripts/d.redraw/d.redraw
===================================================================
--- grass/trunk/scripts/d.redraw/d.redraw	2007-12-18 18:07:04 UTC (rev 29473)
+++ grass/trunk/scripts/d.redraw/d.redraw	2007-12-19 04:07:18 UTC (rev 29474)
@@ -17,7 +17,17 @@
 #% description: Redraws the current display frame in the GRASS monitor
 #% keywords: display
 #%End
+#%flag
+#% key: a
+#% description: Redraw all frames
+#%end
+#%flag
+#% key: r
+#% description: Do not preserve individual regions when redrawing all frames
+#%end
 
+
+
 if [ -z "$GISBASE" ] ; then
     echo "You must be in GRASS GIS to run this program." 1>&2
     exit 1
@@ -28,12 +38,26 @@
   if [ "$1" != "@ARGS_PARSED@" ] ; then
     exec g.parser "$0" "$@"
   fi
+else
+  # no args given
+  GIS_FLAG_A=0
+  GIS_FLAG_R=0
 fi
 
-dsave=`d.save -o`
+
+if [ "$GIS_FLAG_A" -eq 0 ] ; then
+   dsave=`d.save -o`
+else
+   if [ "$GIS_FLAG_R" -eq 0 ] ; then
+      dsave=`d.save -a`
+   else
+      dsave=`d.save -a | grep -v '^g.region'`
+   fi
+fi
+
 # With -x flag, d.redraw behaves as if it actually stops and restarts monitor,
 # which is good for PNG non-white transparency and d.mvmon.
 d.erase -x
 eval "$dsave"
 
-exit 0
+exit



More information about the grass-commit mailing list