[GRASS-SVN] r62466 - in grass/trunk: general/g.mapset general/g.mapsets raster/r.spread raster/r.sun raster3d/r3.in.bin raster3d/r3.out.bin vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 28 17:27:09 PDT 2014


Author: annakrat
Date: 2014-10-28 17:27:09 -0700 (Tue, 28 Oct 2014)
New Revision: 62466

Modified:
   grass/trunk/general/g.mapset/main.c
   grass/trunk/general/g.mapsets/main.c
   grass/trunk/raster/r.spread/main.c
   grass/trunk/raster/r.sun/main.c
   grass/trunk/raster3d/r3.in.bin/main.c
   grass/trunk/raster3d/r3.out.bin/main.c
   grass/trunk/vector/v.distance/main.c
Log:
fix gui layout of modules which had defined guisections but are required at the same time; v.distance now doesn't require dummy column when printing to stdout

Modified: grass/trunk/general/g.mapset/main.c
===================================================================
--- grass/trunk/general/g.mapset/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/general/g.mapset/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -54,7 +54,7 @@
     opt.mapset = G_define_standard_option(G_OPT_M_MAPSET);
     opt.mapset->required = YES;
     opt.mapset->description = _("Name of mapset where to switch");
-    opt.mapset->guisection = _("Settings");
+    opt.mapset->guisection = _("Mapset");
     opt.mapset->gisprompt = "new,mapset,mapset";
 
     opt.location = G_define_option();
@@ -64,7 +64,7 @@
     opt.location->multiple = NO;
     opt.location->key_desc = "name";
     opt.location->description = _("Location name (not location path)");
-    opt.location->guisection = _("Settings");
+    opt.location->guisection = _("Mapset");
 
     opt.gisdbase = G_define_option();
     opt.gisdbase->key = "gisdbase";
@@ -74,7 +74,7 @@
     opt.gisdbase->key_desc = "path";
     opt.gisdbase->label = _("GIS data directory");
     opt.gisdbase->description = _("Full path to the directory where the new location is");
-    opt.gisdbase->guisection = _("Settings");
+    opt.gisdbase->guisection = _("Mapset");
 
     flag.add = G_define_flag();
     flag.add->key = 'c';

Modified: grass/trunk/general/g.mapsets/main.c
===================================================================
--- grass/trunk/general/g.mapsets/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/general/g.mapsets/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -71,7 +71,6 @@
     opt.mapset->required = YES;
     opt.mapset->multiple = YES;
     opt.mapset->description = _("Name(s) of existing mapset(s) to add/remove or set");
-    opt.mapset->guisection = _("Search path");
     
     opt.op = G_define_option();
     opt.op->key = "operation";
@@ -80,7 +79,6 @@
     opt.op->multiple = NO;
     opt.op->options = "set,add,remove";
     opt.op->description = _("Operation to be performed");
-    opt.op->guisection = _("Search path");
     opt.op->answer = "add";
     
     opt.fs = G_define_standard_option(G_OPT_F_SEP);

Modified: grass/trunk/raster/r.spread/main.c
===================================================================
--- grass/trunk/raster/r.spread/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/raster/r.spread/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -121,7 +121,7 @@
     parm.max->type = TYPE_STRING;
     parm.max->required = YES;
     parm.max->gisprompt = "old,cell,raster";
-    parm.max->guisection = _("Input maps");
+    parm.max->guisection = _("Input");
     parm.max->label =
 	_("Raster map containing maximal ROS (cm/min)");
 	parm.max->description =
@@ -133,7 +133,7 @@
     parm.dir->type = TYPE_STRING;
     parm.dir->required = YES;
     parm.dir->gisprompt = "old,cell,raster";
-    parm.dir->guisection = _("Input maps");
+    parm.dir->guisection = _("Input");
     parm.dir->label =
 	_("Raster map containing directions of maximal ROS (degree)");
     parm.dir->description =
@@ -146,7 +146,7 @@
     parm.base->type = TYPE_STRING;
     parm.base->required = YES;
     parm.base->gisprompt = "old,cell,raster";
-    parm.base->guisection = _("Input maps");
+    parm.base->guisection = _("Input");
     parm.base->label =
 	_("Raster map containing base ROS (cm/min)");
     parm.base->description =
@@ -160,8 +160,8 @@
     parm.start->type = TYPE_STRING;
     parm.start->required = YES;
     parm.start->gisprompt = "old,cell,raster";
-    parm.start->guisection = _("Input maps");
-    parm.start->description =
+    parm.start->guisection = _("Input");
+    parm.start->label =
 	_("Raster map containing starting sources");
     parm.start->description =
 	_("Name of an existing raster map layer in the "
@@ -173,7 +173,7 @@
     parm.spotdist->key = "spot_dist";
     parm.spotdist->type = TYPE_STRING;
     parm.spotdist->gisprompt = "old,cell,raster";
-    parm.spotdist->guisection = _("Input maps");
+    parm.spotdist->guisection = _("Input");
     parm.spotdist->label =
 	_("Raster map containing maximal spotting distance (m, required with -s)");
     parm.spotdist->description =
@@ -185,7 +185,7 @@
     parm.velocity->key = "w_speed";
     parm.velocity->type = TYPE_STRING;
     parm.velocity->gisprompt = "old,cell,raster";
-    parm.velocity->guisection = _("Input maps");
+    parm.velocity->guisection = _("Input");
     parm.velocity->label =
 	_("Raster map containing midflame wind speed (ft/min, required with -s)");
     parm.velocity->description =
@@ -197,7 +197,7 @@
     parm.mois->key = "f_mois";
     parm.mois->type = TYPE_STRING;
     parm.mois->gisprompt = "old,cell,raster";
-    parm.mois->guisection = _("Input maps");
+    parm.mois->guisection = _("Input");
     parm.mois->label =
 	_("Raster map containing fine fuel moisture of the cell receiving a spotting firebrand (%, required with -s)");
     parm.mois->description =
@@ -210,7 +210,7 @@
     parm.least->type = TYPE_STRING;
     parm.least->key_desc = "odd int";
     parm.least->options = "3,5,7,9,11,13,15";
-    parm.least->description =
+    parm.least->label =
 	_("Basic sampling window size needed to meet certain accuracy (3)"); /* TODO: what is 3 here? default? */
     parm.least->description =
 	_("An odd integer ranging 3 - 15 indicating "
@@ -247,7 +247,7 @@
     parm.time_lag->key = "lag";
     parm.time_lag->type = TYPE_STRING;
     parm.time_lag->key_desc = "int (>= 0)"; /* TODO: move to ->options */
-    parm.time_lag->description =
+    parm.time_lag->label =
 	_("Simulating time duration LAG (fill the region) (min)"); /* TODO: what does this mean? */
     parm.time_lag->description =
 	_("A non-negative integer specifying the simulating "
@@ -273,7 +273,7 @@
     parm.out->type = TYPE_STRING;
     parm.out->required = YES;
     parm.out->gisprompt = "new,cell,raster";
-    parm.out->guisection = _("Output maps");
+    parm.out->guisection = _("Output");
     parm.out->label =
 	_("Raster map to contain output spread time (min)");
     parm.out->description =
@@ -285,7 +285,7 @@
     parm.x_out->key = "x_output";
     parm.x_out->type = TYPE_STRING;
     parm.x_out->gisprompt = "new,cell,raster";
-    parm.x_out->guisection = _("Output maps");
+    parm.x_out->guisection = _("Output");
     parm.x_out->label =
 	_("Name of raster map to contain X back coordinates");
     parm.x_out->description =
@@ -297,7 +297,7 @@
     parm.y_out->key = "y_output";
     parm.y_out->type = TYPE_STRING;
     parm.y_out->gisprompt = "new,cell,raster";
-    parm.y_out->guisection = _("Output maps");
+    parm.y_out->guisection = _("Output");
     parm.y_out->label =
 	_("Name of raster map to contain Y back coordinates");
     parm.y_out->description =
@@ -305,15 +305,13 @@
 	  "the results of backlink information in UTM northing coordinates for each "
 	  "cell.");
 
+#if 0
     flag.display = G_define_flag();
     flag.display->key = 'd';
-#if 0
     flag.display->label = _("DISPLAY 'live' spread process on screen");
     flag.display->description =
 	_("Display the 'live' simulation on screen. A graphics window "
 	  "must be opened and selected before using this option.");
-#else
-    flag.display->description = _("Live display - disabled and depreciated");
 #endif
 
     flag.spotting = G_define_flag();
@@ -339,11 +337,8 @@
     /* FIXME - allow seed to be specified for repeatability */
     G_srand48_auto();
 
-    display = flag.display->answer;
-#if 1
-    if (display)
-	G_fatal_error(_("The display feature is disabled"));
-#endif
+    display = NULL;
+
     spotting = flag.spotting->answer;
 
     max_layer = parm.max->answer;

Modified: grass/trunk/raster/r.sun/main.c
===================================================================
--- grass/trunk/raster/r.sun/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/raster/r.sun/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -257,7 +257,7 @@
     parm.elevin->gisprompt = "old,cell,raster";
     parm.elevin->description =
 	_("Name of the input elevation raster map [meters]");
-    parm.elevin->guisection = _("Input options");
+    parm.elevin->guisection = _("Input");
 
     parm.aspin = G_define_option();
     parm.aspin->key = "aspect";
@@ -266,7 +266,7 @@
     parm.aspin->gisprompt = "old,cell,raster";
     parm.aspin->description =
 	_("Name of the input aspect map (terrain aspect or azimuth of the solar panel) [decimal degrees]");
-    parm.aspin->guisection = _("Input options");
+    parm.aspin->guisection = _("Input");
 
     parm.aspect = G_define_option();
     parm.aspect->key = "aspect_value";
@@ -275,7 +275,7 @@
     parm.aspect->required = NO;
     parm.aspect->description =
 	_("A single value of the orientation (aspect), 270 is south");
-    parm.aspect->guisection = _("Input options");
+    parm.aspect->guisection = _("Input");
 
     parm.slopein = G_define_option();
     parm.slopein->key = "slope";
@@ -284,7 +284,7 @@
     parm.slopein->gisprompt = "old,cell,raster";
     parm.slopein->description =
 	_("Name of the input slope raster map (terrain slope or solar panel inclination) [decimal degrees]");
-    parm.slopein->guisection = _("Input options");
+    parm.slopein->guisection = _("Input");
 
     parm.slope = G_define_option();
     parm.slope->key = "slope_value";
@@ -292,7 +292,7 @@
     parm.slope->answer = SLOPE;
     parm.slope->required = NO;
     parm.slope->description = _("A single value of inclination (slope)");
-    parm.slope->guisection = _("Input options");
+    parm.slope->guisection = _("Input");
 
     parm.linkein = G_define_option();
     parm.linkein->key = "linke";
@@ -301,7 +301,7 @@
     parm.linkein->gisprompt = "old,cell,raster";
     parm.linkein->description =
 	_("Name of the Linke atmospheric turbidity coefficient input raster map [-]");
-    parm.linkein->guisection = _("Input options");
+    parm.linkein->guisection = _("Input");
 
     if (parm.linkein->answer == NULL) {
 	parm.lin = G_define_option();
@@ -311,7 +311,7 @@
 	parm.lin->required = NO;
 	parm.lin->description =
 	    _("A single value of the Linke atmospheric turbidity coefficient [-]");
-	parm.lin->guisection = _("Input options");
+	parm.lin->guisection = _("Input");
     }
 
     parm.albedo = G_define_option();
@@ -321,7 +321,7 @@
     parm.albedo->gisprompt = "old,cell,raster";
     parm.albedo->description =
 	_("Name of the ground albedo coefficient input raster map [-]");
-    parm.albedo->guisection = _("Input options");
+    parm.albedo->guisection = _("Input");
 
     if (parm.albedo->answer == NULL) {
 	parm.alb = G_define_option();
@@ -331,7 +331,7 @@
 	parm.alb->required = NO;
 	parm.alb->description =
 	    _("A single value of the ground albedo coefficient [-]");
-	parm.alb->guisection = _("Input options");
+	parm.alb->guisection = _("Input");
     }
 
     parm.latin = G_define_option();
@@ -341,7 +341,7 @@
     parm.latin->gisprompt = "old,cell,raster";
     parm.latin->description =
 	_("Name of input raster map containing latitudes [decimal degrees]");
-    parm.latin->guisection = _("Input options");
+    parm.latin->guisection = _("Input");
 
     parm.longin = G_define_option();
     parm.longin->key = "long";
@@ -350,7 +350,7 @@
     parm.longin->gisprompt = "old,cell,raster";
     parm.longin->description =
 	_("Name of input raster map containing longitudes [decimal degrees]");
-    parm.longin->guisection = _("Input options");
+    parm.longin->guisection = _("Input");
 
     parm.coefbh = G_define_option();
     parm.coefbh->key = "coef_bh";
@@ -359,7 +359,7 @@
     parm.coefbh->gisprompt = "old,cell,raster";
     parm.coefbh->description =
 	_("Name of real-sky beam radiation coefficient (thick cloud) input raster map [0-1]");
-    parm.coefbh->guisection = _("Input options");
+    parm.coefbh->guisection = _("Input");
 
     parm.coefdh = G_define_option();
     parm.coefdh->key = "coef_dh";
@@ -368,14 +368,14 @@
     parm.coefdh->gisprompt = "old,cell,raster";
     parm.coefdh->description =
 	_("Name of real-sky diffuse radiation coefficient (haze) input raster map [0-1]");
-    parm.coefdh->guisection = _("Input options");
+    parm.coefdh->guisection = _("Input");
 
     parm.horizon = G_define_standard_option(G_OPT_R_BASENAME_INPUT);
     parm.horizon->key = "horizon_basename";
     parm.horizon->required = NO;
     parm.horizon->gisprompt = "old,cell,raster";
     parm.horizon->description = _("The horizon information input map basename");
-    parm.horizon->guisection = _("Input options");
+    parm.horizon->guisection = _("Input");
 
     parm.horizonstep = G_define_option();
     parm.horizonstep->key = "horizon_step";
@@ -383,7 +383,7 @@
     parm.horizonstep->required = NO;
     parm.horizonstep->description =
 	_("Angle step size for multidirectional horizon [degrees]");
-    parm.horizonstep->guisection = _("Input options");
+    parm.horizonstep->guisection = _("Input");
 
     parm.incidout = G_define_option();
     parm.incidout->key = "incidout";
@@ -392,7 +392,7 @@
     parm.incidout->gisprompt = "new,cell,raster";
     parm.incidout->description =
 	_("Output incidence angle raster map (mode 1 only)");
-    parm.incidout->guisection = _("Output options");
+    parm.incidout->guisection = _("Output");
 
     parm.beam_rad = G_define_option();
     parm.beam_rad->key = "beam_rad";
@@ -401,7 +401,7 @@
     parm.beam_rad->gisprompt = "new,cell,raster";
     parm.beam_rad->description =
 	_("Output beam irradiance [W.m-2] (mode 1) or irradiation raster map [Wh.m-2.day-1] (mode 2)");
-    parm.beam_rad->guisection = _("Output options");
+    parm.beam_rad->guisection = _("Output");
 
     parm.diff_rad = G_define_option();
     parm.diff_rad->key = "diff_rad";
@@ -410,7 +410,7 @@
     parm.diff_rad->gisprompt = "new,cell,raster";
     parm.diff_rad->description =
 	_("Output diffuse irradiance [W.m-2] (mode 1) or irradiation raster map [Wh.m-2.day-1] (mode 2)");
-    parm.diff_rad->guisection = _("Output options");
+    parm.diff_rad->guisection = _("Output");
 
     parm.refl_rad = G_define_option();
     parm.refl_rad->key = "refl_rad";
@@ -419,7 +419,7 @@
     parm.refl_rad->gisprompt = "new,cell,raster";
     parm.refl_rad->description =
 	_("Output ground reflected irradiance [W.m-2] (mode 1) or irradiation raster map [Wh.m-2.day-1] (mode 2)");
-    parm.refl_rad->guisection = _("Output options");
+    parm.refl_rad->guisection = _("Output");
 
     parm.glob_rad = G_define_option();
     parm.glob_rad->key = "glob_rad";
@@ -428,7 +428,7 @@
     parm.glob_rad->gisprompt = "new,cell,raster";
     parm.glob_rad->description =
 	_("Output global (total) irradiance/irradiation [W.m-2] (mode 1) or irradiance/irradiation raster map [Wh.m-2.day-1] (mode 2)");
-    parm.glob_rad->guisection = _("Output options");
+    parm.glob_rad->guisection = _("Output");
 
     parm.insol_time = G_define_option();
     parm.insol_time->key = "insol_time";
@@ -437,7 +437,7 @@
     parm.insol_time->gisprompt = "new,cell,raster";
     parm.insol_time->description =
 	_("Output insolation time raster map [h] (mode 2 only)");
-    parm.insol_time->guisection = _("Output options");
+    parm.insol_time->guisection = _("Output");
 
     parm.day = G_define_option();
     parm.day->key = "day";
@@ -445,6 +445,7 @@
     parm.day->required = YES;
     parm.day->description = _("No. of day of the year (1-365)");
     parm.day->options = "1-365";
+    parm.day->guisection = _("Time");
 
     parm.step = G_define_option();
     parm.step->key = "step";
@@ -453,6 +454,7 @@
     parm.step->required = NO;
     parm.step->description =
 	_("Time step when computing all-day radiation sums [decimal hours]");
+    parm.step->guisection = _("Time");
 
     parm.declin = G_define_option();
     parm.declin->key = "declination";
@@ -469,6 +471,7 @@
     parm.ltime->description =
 	_("Local (solar) time (to be set for mode 1 only) [decimal hours]");
     parm.ltime->options = "0-24";
+    parm.ltime->guisection = _("Time");
 
     /*
      * parm.startTime = G_define_option();
@@ -506,8 +509,8 @@
     parm.civilTime->required = NO;
     parm.civilTime->description =
 	_("Civil time zone value, if none, the time will be local solar time");
+    parm.civilTime->guisection = _("Time");
 
-
     flag.noshade = G_define_flag();
     flag.noshade->key = 'p';
     flag.noshade->description =

Modified: grass/trunk/raster3d/r3.in.bin/main.c
===================================================================
--- grass/trunk/raster3d/r3.in.bin/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/raster3d/r3.in.bin/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -266,7 +266,6 @@
 	parm.bytes->required = YES;
 	parm.bytes->options = "1,2,4,8";
 	parm.bytes->description = _("Number of bytes per cell in binary file");
-	parm.bytes->guisection = _("Settings");
 
 	parm.order = G_define_option();
 	parm.order->key = "order";
@@ -349,7 +348,6 @@
 	parm.null->type = TYPE_DOUBLE;
 	parm.null->required = NO;
 	parm.null->description = _("Set Value to NULL");
-	parm.null->guisection = _("Settings");
 
 	flag.row = G_define_flag();
 	flag.row->key = 'r';
@@ -369,7 +367,6 @@
 	flag.sign = G_define_flag();
 	flag.sign->key = 's';
 	flag.sign->description = _("Signed data (two's complement)");
-	flag.sign->guisection = _("Settings");
 
 	if (G_parser(argc, argv))
 		exit(EXIT_FAILURE);

Modified: grass/trunk/raster3d/r3.out.bin/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.bin/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/raster3d/r3.out.bin/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -225,7 +225,6 @@
 	parm.bytes->required = YES;
 	parm.bytes->options = "1,2,4,8";
 	parm.bytes->description = _("Number of bytes per cell in binary file");
-	parm.bytes->guisection = _("Settings");
 
 	parm.order = G_define_option();
 	parm.order->key = "order";

Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c	2014-10-28 23:47:49 UTC (rev 62465)
+++ grass/trunk/vector/v.distance/main.c	2014-10-29 00:27:09 UTC (rev 62466)
@@ -153,6 +153,7 @@
     opt.upload->type = TYPE_STRING;
     opt.upload->required = YES;
     opt.upload->multiple = YES;
+    opt.upload->guisection = _("From");
     opt.upload->options = "cat,dist,to_x,to_y,to_along,to_angle,to_attr";
     opt.upload->description =
 	_("Values describing the relation between two nearest features");
@@ -184,7 +185,7 @@
     opt.upload->descriptions = desc;
 
     opt.column = G_define_standard_option(G_OPT_DB_COLUMN);
-    opt.column->required = YES;
+    opt.column->required = NO;
     opt.column->multiple = YES;
     opt.column->description =
 	_("Column name(s) where values specified by 'upload' option will be uploaded");
@@ -224,6 +225,9 @@
     sprintf(buf1, "%s,%s", opt.to_field->key, opt.to_column->key);
     opt.to->guidependency = G_store(buf1);
     opt.to_field->guidependency = G_store(opt.to_column->key);
+    
+    G_option_exclusive(opt.column, flag.print, NULL);
+    G_option_required(opt.column, flag.print, NULL);
 
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
@@ -287,7 +291,7 @@
     Upload[i].upload = END;
     /* read columns */
     i = 0;
-    while (opt.column->answers[i]) {
+    while (opt.column->answer && opt.column->answers[i]) {
 	if (Upload[i].upload == END) {
 	    G_warning(_("Too many column names"));
 	    break;
@@ -295,7 +299,7 @@
 	Upload[i].column = G_store(opt.column->answers[i]);
 	i++;
     }
-    if (Upload[i].upload != END)
+    if (opt.column->answer && Upload[i].upload != END)
 	G_fatal_error(_("Not enough column names"));
 
     sep = G_option_to_separator(opt.sep);



More information about the grass-commit mailing list