Browse Source

v.mkgrid: finish progress (G_percent) info, be less verbose about progress (merge https://trac.osgeo.org/grass/changeset/66422 from trunk)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@66423 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 years ago
parent
commit
17bb1cfd2c
2 changed files with 9 additions and 5 deletions
  1. 3 1
      vector/v.mkgrid/main.c
  2. 6 4
      vector/v.mkgrid/write_grid.c

+ 3 - 1
vector/v.mkgrid/main.c

@@ -413,7 +413,7 @@ int main(int argc, char *argv[])
 	}
 
 	/* Create a grid of label points at the centres of the grid cells */
-	G_verbose_message(_("Creating centroids..."));
+	G_message(_("Creating centroids..."));
 
 	/* Write out centroids and attributes */
 	/* If the output id is lines it skips to add centroids and attributes
@@ -423,6 +423,7 @@ int main(int argc, char *argv[])
             db_begin_transaction(Driver);
 	    attCount = 0;
 	    for (i = 0; i < grid_info.num_rows; ++i) {
+                G_percent(i, grid_info.num_rows, 2);
 	        for (j = 0; j < grid_info.num_cols; ++j) {
 		    double x, y;
 
@@ -464,6 +465,7 @@ int main(int argc, char *argv[])
 		    attCount++;
 	        }
 	    }
+            G_percent(1, 1, 1);
 	}
     }
     db_commit_transaction(Driver);

+ 6 - 4
vector/v.mkgrid/write_grid.c

@@ -65,7 +65,7 @@ int write_grid(struct grid_description *grid_info, struct Map_info *Map, int nbr
      y_len = height / (1. * nbreaks + 1);
 
     /* write out all the vector lengths (x vectors) of the entire grid  */
-    G_verbose_message(_("Writing out vector rows..."));
+    G_message(_("Writing out vector rows..."));
     y = grid_info->south;
     for (i = 0; i < num_v_rows; ++i) {
 	double startx;
@@ -101,9 +101,10 @@ int write_grid(struct grid_description *grid_info, struct Map_info *Map, int nbr
 	}
 	y += height;
     }
-
+    G_percent(1, 1, 1);
+    
     /* write out all the vector widths (y vectors) of the entire grid  */
-    G_verbose_message(_("Writing out vector columns..."));
+    G_message(_("Writing out vector columns..."));
     x = grid_info->west;
     for (i = 0; i < num_v_cols; ++i) {
         double starty;
@@ -138,7 +139,8 @@ int write_grid(struct grid_description *grid_info, struct Map_info *Map, int nbr
 	}
 	x += width;
     }
-
+    G_percent(1, 1, 1);
+    
     /* new with Vlib */
     Vect_destroy_line_struct(Points);