[GRASS-SVN] r60789 - grass/trunk/raster/r.topmodel

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 11 00:02:46 PDT 2014


Author: hcho
Date: 2014-06-11 00:02:46 -0700 (Wed, 11 Jun 2014)
New Revision: 60789

Modified:
   grass/trunk/raster/r.topmodel/file_io.c
   grass/trunk/raster/r.topmodel/infiltration.c
   grass/trunk/raster/r.topmodel/main.c
   grass/trunk/raster/r.topmodel/topmodel.c
Log:
r.topmodel: translate fatal errors and warnings

Modified: grass/trunk/raster/r.topmodel/file_io.c
===================================================================
--- grass/trunk/raster/r.topmodel/file_io.c	2014-06-11 06:53:39 UTC (rev 60788)
+++ grass/trunk/raster/r.topmodel/file_io.c	2014-06-11 07:02:46 UTC (rev 60789)
@@ -97,7 +97,7 @@
     }
     if (params.qs0 == 0.0) {
 	fclose(fp);
-	G_fatal_error("parameters.qs0 cannot be 0.0");
+	G_fatal_error(_("%s cannot be 0"), "parameters.qs0");
 	exit(EXIT_FAILURE);
     }
     for (; !feof(fp);) {

Modified: grass/trunk/raster/r.topmodel/infiltration.c
===================================================================
--- grass/trunk/raster/r.topmodel/infiltration.c	2014-06-11 06:53:39 UTC (rev 60788)
+++ grass/trunk/raster/r.topmodel/infiltration.c	2014-06-11 07:02:46 UTC (rev 60789)
@@ -66,7 +66,7 @@
 	}
 	if (i == MAXITER)
 	    G_warning(
-		_("Maximum number of iterations exceeded at timestep %d."),
+		_("Maximum number of iterations exceeded at timestep %d"),
 		timestep);
 
 	pt = t - input.dt + (f - cumf) / R;
@@ -105,7 +105,7 @@
 	    break;
     }
     if (i == MAXITER)
-	G_warning(_("Maximum number of iterations exceeded at timestep %d."),
+	G_warning(_("Maximum number of iterations exceeded at timestep %d"),
 			timestep);
 
     if (f < cumf + R * input.dt) {

Modified: grass/trunk/raster/r.topmodel/main.c
===================================================================
--- grass/trunk/raster/r.topmodel/main.c	2014-06-11 06:53:39 UTC (rev 60788)
+++ grass/trunk/raster/r.topmodel/main.c	2014-06-11 07:02:46 UTC (rev 60789)
@@ -146,13 +146,15 @@
 	outtopidxstats = params.outtopidxstats->answer;
 
 	if (ntopidxclasses <= 0)
-	    G_fatal_error(_("ntopidxclasses must be positive."));
+	    G_fatal_error(_("%s must be positive"), "ntopidxclasses");
 
 	create_topidxstats(topidx, ntopidxclasses, outtopidxstats);
     } else if (params.topidx->answer) {
-	G_warning(_("Ignoring topidx because outtopidxstats is not specified."));
+	G_warning(_("Ignoring %s because %s is not specified"),
+			params.topidx->key, params.outtopidxstats->key);
     } else if (params.outtopidxstats->answer) {
-	G_warning(_("Ignoring outtopidxstats because topidx is not specified."));
+	G_warning(_("Ignoring %s because %s is not specified"),
+			params.outtopidxstats->key, params.topidx->key);
     }
 
     if (flags.preprocess->answer)

Modified: grass/trunk/raster/r.topmodel/topmodel.c
===================================================================
--- grass/trunk/raster/r.topmodel/topmodel.c	2014-06-11 06:53:39 UTC (rev 60788)
+++ grass/trunk/raster/r.topmodel/topmodel.c	2014-06-11 07:02:46 UTC (rev 60789)
@@ -1,6 +1,7 @@
 #include <math.h>
 #include <grass/raster.h>
 #include <grass/spawn.h>
+#include <grass/glocale.h>
 #include "global.h"
 
 void create_topidxstats(char *topidx, int ntopidxclasses, char *outtopidxstats)
@@ -17,7 +18,7 @@
     G_verbose_message("r.stats -Anc %s %s %s ...", input, output, nsteps);
 
     if (G_spawn("r.stats", "r.stats", "-Anc", input, output, nsteps, NULL) != 0)
-	G_fatal_error("r.stats failed");
+	G_fatal_error(_("Unable to run %s"), "r.stats");
 }
 
 /* Calculate the areal average of topographic index */



More information about the grass-commit mailing list