[GRASS-SVN] r58923 - grass/branches/develbranch_6/raster/r.li/r.li.setup

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 6 22:49:16 PST 2014


Author: hamish
Date: 2014-02-06 22:49:15 -0800 (Thu, 06 Feb 2014)
New Revision: 58923

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.setup/masked_area_selection.sh
   grass/branches/develbranch_6/raster/r.li/r.li.setup/r.li.setup.procedures.tcl
   grass/branches/develbranch_6/raster/r.li/r.li.setup/square_mouse_selection.sh
   grass/branches/develbranch_6/raster/r.li/r.li.setup/square_query
Log:
fix rectangular query tcl return code,
trivial whitespace and msg cosmetics,
quieten rectangular query shell script,
better defined vector points,
only show area boundaries.


Modified: grass/branches/develbranch_6/raster/r.li/r.li.setup/masked_area_selection.sh
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.setup/masked_area_selection.sh	2014-02-07 06:12:50 UTC (rev 58922)
+++ grass/branches/develbranch_6/raster/r.li/r.li.setup/masked_area_selection.sh	2014-02-07 06:49:15 UTC (rev 58923)
@@ -57,7 +57,7 @@
 #% required: no
 #%end
 #%option
-#% key: west 
+#% key: west
 #% type: string
 #% description: Western edge (use only with the 'f' flag)
 #% required: no
@@ -142,7 +142,8 @@
 if [ -n "$GIS_OPT_vector" ] ; then
     d.vect map="$GIS_OPT_vector" type=area fcolor=none width=2
 fi
-if [ -n "$GIS_OPT_site" ] ; then 
+if [ -n "$GIS_OPT_site" ] ; then
+    d.vect map="$GIS_OPT_site" color=black fcolor=black size=9 icon=basic/circle
     d.vect map="$GIS_OPT_site" color=red fcolor=red size=5 icon=basic/circle
 fi
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.setup/r.li.setup.procedures.tcl
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.setup/r.li.setup.procedures.tcl	2014-02-07 06:12:50 UTC (rev 58922)
+++ grass/branches/develbranch_6/raster/r.li/r.li.setup/r.li.setup.procedures.tcl	2014-02-07 06:49:15 UTC (rev 58923)
@@ -211,7 +211,7 @@
 			file delete $tmp.tmp
 			$button configure -state disabled
 		} else {
-			tk_messageBox -message "Warning sampling frame not set" -type ok -icon warning
+			tk_messageBox -message "Warning: sampling frame not set" -type ok -icon warning
 		}
 	}
 	}
@@ -496,7 +496,7 @@
 						tk_messageBox -message "Selected area saved as sample area" -type ok
 						file delete $env(TMP).tmp
 					} else {
-						tk_messageBox -message "Warning sampling area not set" -type ok -icon warning
+						tk_messageBox -message "Warning: sampling area not set" -type ok -icon warning
 					}
 				}
 			}

Modified: grass/branches/develbranch_6/raster/r.li/r.li.setup/square_mouse_selection.sh
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.setup/square_mouse_selection.sh	2014-02-07 06:12:50 UTC (rev 58922)
+++ grass/branches/develbranch_6/raster/r.li/r.li.setup/square_mouse_selection.sh	2014-02-07 06:49:15 UTC (rev 58923)
@@ -1,4 +1,4 @@
-#!/bin/sh 
+#!/bin/sh
 #
 # This script selects a square area using the mouse
 #
@@ -6,7 +6,7 @@
 # Read the COPYING file that comes with GRASS for details.
 #
 
-#%Module 
+#%Module
 #% description: Select a rectangular area
 #%End
 #%option
@@ -55,7 +55,7 @@
 #% required: no
 #%end
 #%option
-#% key: west 
+#% key: west
 #% type: string
 #% description: Western edge (use only with the 'f' flag)
 #% required: no
@@ -93,7 +93,7 @@
       g.remove region="tmp_rli_sq.$$" --quiet
    fi
 
-   rm -f "$TMP" "$TMP.var" 
+   rm -f "$TMP" "$TMP.var"
 }
 trap "cleanup" 2 3 15
 
@@ -108,9 +108,7 @@
    fi
 done
 
-# open the Xmonitor
-d.mon stop="$XMON"
-d.mon start="$XMON"
+d.mon start="$XMON" --quiet
 
 
 # setup internal region
@@ -135,12 +133,13 @@
 	     e="$GIS_OPT_east" w="$GIS_OPT_west"
 fi
 
-d.rast -o map="$GIS_OPT_raster"
+d.rast -o map="$GIS_OPT_raster" --quiet
 
 if [ -n "$GIS_OPT_vector" ] ; then
-    d.vect map="$GIS_OPT_vector"
+    d.vect map="$GIS_OPT_vector" type=area fcolor=none width=2
 fi
-if [ -n "$GIS_OPT_site" ] ; then 
+if [ -n "$GIS_OPT_site" ] ; then
+    d.vect map="$GIS_OPT_site" color=black fcolor=black size=9 icon=basic/circle
     d.vect map="$GIS_OPT_site" color=red fcolor=red size=5 icon=basic/circle
 fi
 
@@ -156,6 +155,7 @@
 #EOF
 ######
 
+# note if user right clicks to quit without zooming the whole frame is used.
 d.zoom
 
 
@@ -166,12 +166,17 @@
 # ask if it's ok, save 0,1 to the "$name" tmp file
 "$GRASS_WISH" "$f_path/square_query"
 
-read ok < "$TMP.var"
+if [ -e "$name" ] ; then
+   read ok < "$name"
+else
+   ok="-999"
+fi
 
 if [ "$ok" -eq 0 ] ; then
     echo "NO" >> "$GIS_OPT_conf"
 elif [ "$ok" -eq 1 ] ; then
     # write the square boundaries
+    # TODO: is range (0-1, 0-1) valid or a bug?
     eval `g.region -g`
     echo "SQUAREAREA $n|$s|$e|$w|$nsres|$ewres" >> "$GIS_OPT_conf"
 else
@@ -179,7 +184,7 @@
 fi
 
 # close the Xmonitor
-d.mon stop="$XMON"
+d.mon stop="$XMON" --quiet
 
 # clean tmp files and temporary region
 cleanup

Modified: grass/branches/develbranch_6/raster/r.li/r.li.setup/square_query
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.setup/square_query	2014-02-07 06:12:50 UTC (rev 58922)
+++ grass/branches/develbranch_6/raster/r.li/r.li.setup/square_query	2014-02-07 06:49:15 UTC (rev 58923)
@@ -12,17 +12,17 @@
     global env
     wm title . "Select this area"
     wm minsize . 250 100
-    label .label -text "Is this area ok?"
+    label .label -text "\nIs this area ok?"
     pack .label 
     frame .buttons
     pack .buttons
     set val ""
     button .buttons.ok -text "Ok" -command {
-	exec echo 1 > $env(name).var
+	exec echo 1 > $env(name)
 	destroy .
     }
     button .buttons.no -text "No" -command {
-	exec echo 0 > $env(name).var
+	exec echo 0 > $env(name)
 	destroy .
     }
-    grid .buttons.ok .buttons.no
+    grid .buttons.ok .buttons.no -padx 3 -pady 3



More information about the grass-commit mailing list