[GRASS-SVN] r33782 - in grass/branches/develbranch_6/display: d.rast d.vect

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 9 04:41:41 EDT 2008


Author: martinl
Date: 2008-10-09 04:41:41 -0400 (Thu, 09 Oct 2008)
New Revision: 33782

Modified:
   grass/branches/develbranch_6/display/d.rast/main.c
   grass/branches/develbranch_6/display/d.vect/plot1.c
Log:
d.rast: more guisections ('Query')


Modified: grass/branches/develbranch_6/display/d.rast/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.rast/main.c	2008-10-09 08:35:21 UTC (rev 33781)
+++ grass/branches/develbranch_6/display/d.rast/main.c	2008-10-09 08:41:41 UTC (rev 33782)
@@ -64,6 +64,7 @@
     catlist->required = NO;
     catlist->multiple = YES;
     catlist->description = _("List of categories to be displayed (INT maps)");
+    catlist->guisection = _("Query");
 
     vallist = G_define_option();
     vallist->key = "vallist";
@@ -72,6 +73,7 @@
     vallist->required = NO;
     vallist->multiple = YES;
     vallist->description = _("List of values to be displayed (FP maps)");
+    vallist->guisection = _("Query");
 
     bg = G_define_option();
     bg->key = "bg";
@@ -87,6 +89,7 @@
     flag_i = G_define_flag();
     flag_i->key = 'i';
     flag_i->description = _("Invert catlist");
+    flag_i->guisection = _("Query");
 
     flag_x = G_define_flag();
     flag_x->key = 'x';

Modified: grass/branches/develbranch_6/display/d.vect/plot1.c
===================================================================
--- grass/branches/develbranch_6/display/d.vect/plot1.c	2008-10-09 08:35:21 UTC (rev 33781)
+++ grass/branches/develbranch_6/display/d.vect/plot1.c	2008-10-09 08:41:41 UTC (rev 33782)
@@ -145,7 +145,8 @@
     dbCatValArray cvarr_rgb, cvarr_width;
     dbCatVal *cv_rgb = NULL, *cv_width = NULL;
     int nrec_rgb = 0, nrec_width = 0;
-
+    int nerror_rgb;
+    
     int open_db;
     int custom_rgb = FALSE;
     char colorstring[12];	/* RRR:GGG:BBB */
@@ -154,6 +155,8 @@
     unsigned char which;
     int width;
 
+    nerror_rgb = 0;
+    
     line_color = G_malloc(sizeof(RGBA_Color));
     fill_color = G_malloc(sizeof(RGBA_Color));
     primary_color = G_malloc(sizeof(RGBA_Color));
@@ -204,7 +207,7 @@
 	/* for reading RRR:GGG:BBB color strings from table */
 
 	if (rgb_column == NULL || *rgb_column == '\0')
-	    G_fatal_error(_("Color definition column not specified."));
+	    G_fatal_error(_("Color definition column not specified"));
 
 	db_CatValArray_init(&cvarr_rgb);
 
@@ -279,7 +282,7 @@
 	if (Vect_level(Map) >= 2) {
 	    line++;
 	    if (line > nlines)
-		return 0;
+		break;
 	    if (!Vect_line_alive(Map, line))
 		continue;
 	    ltype = Vect_read_line(Map, Points, Cats, line);
@@ -291,7 +294,7 @@
 		G_warning(_("Unable to read vector map"));
 		return -1;
 	    case -2:		/* EOF */
-		return 0;
+		break;
 	    }
 	}
 
@@ -381,15 +384,18 @@
 			}
 			else {
 			    custom_rgb = FALSE;
-			    G_warning(_("Error in color definition column (%s), element %d "
-				       "with cat %d: colorstring [%s]"),
-				      rgb_column, line, cat, colorstring);
+			    G_important_message(_("Error in color definition column '%s', feature id %d "
+						  "with cat %d: colorstring '%s'"),
+						rgb_column, line, cat, colorstring);
+			    nerror_rgb++;
 			}
 		    }
 		    else {
 			custom_rgb = FALSE;
-			G_warning(_("Error in color definition column (%s), element %d with cat %d"),
-				  rgb_column, line, cat);
+			G_important_message(_("Error in color definition column '%s', feature id %d "
+					      "with cat %d"),
+					    rgb_column, line, cat);
+			nerror_rgb++;
 		    }
 		}
 	    }			/* end if cat */
@@ -520,6 +526,11 @@
 	}
     }
 
+    if (nerror_rgb > 0) {
+	G_warning(_("Error in color definition column '%s': %d features affected"),
+		  rgb_column, nerror_rgb);
+    }
+    
     Vect_destroy_line_struct(Points);
     Vect_destroy_cats_struct(Cats);
 



More information about the grass-commit mailing list