[GRASS-dev] GRASS 7 raster coding best practices

Hamish hamish_b at yahoo.com
Sat May 3 23:50:09 EDT 2008


Yann Chemin wrote:
> > I could not find it for parameters in float format (G_OPT_F_INPUT?)

lib/gis/parser.c already defines G_OPT_F_* for input and output files,
and field separators for those files. Don't use that for floating point
input values.

> > for example...
...
>        input = G_define_option(G_OPT_F(D?)_INPUT) ;
>        input->key        =_("parameter");
>        input->type       = TYPE_DOUBLE;
>        input->required   = YES;
>        input->gisprompt  =_("value, parameter");
>        input->description=_("Value of the parameter");
>        /*input->answer     =_("0.000");*/


the only thing I see there that is a candidate for reuse as part of a
default macro is input->type=TYPE_DOUBLE. The others are all module
option dependent, e.g. "input->key =_("parameter");" is vague enough to
be useless in practice.

input->gisprompt is wrong, have a look at the GRASS 5 programmers manual
for a nice write up about what that is for (maybe in the GRASS 6 one too,
I'm not sure)


>        input->guisection = _("Required");

FWIW I consider this to be redundant noise. If it is wished that the
module GUI(s) group required options in the first tab then they should
extract that from the input->required field.



Hamish





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the grass-dev mailing list