Changeset 34366


Ignore:
Timestamp:
Nov 18, 2008, 5:27:00 AM (16 years ago)
Author:
martinl
Message:

r.recode: standardize messages

disable interactive mode

Location:
grass/branches/develbranch_6/raster/r.recode
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • grass/branches/develbranch_6/raster/r.recode/main.c

    r32583 r34366  
    77 *               Jan-Oliver Wagner <jan intevation.de>
    88 * PURPOSE:      Recode categorical raster maps
    9  * COPYRIGHT:    (C) 1999-2006 by the GRASS Development Team
     9 * COPYRIGHT:    (C) 1999-2008 by the GRASS Development Team
    1010 *
    1111 *               This program is free software under the GNU General Public
     
    3535
    3636    /* any interaction must run in a term window */
    37     G_putenv("GRASS_UI_TERM", "1");
     37    /* G_putenv("GRASS_UI_TERM", "1"); */
    3838
    3939    G_gisinit(argv[0]);
    4040
    4141    module = G_define_module();
    42     module->keywords = _("raster");
     42    module->keywords = _("raster, recode category");
    4343    module->description = _("Recodes categorical raster maps.");
    4444
     
    4848    parm.output = G_define_standard_option(G_OPT_R_OUTPUT);
    4949
    50     parm.rules = G_define_option();
     50    parm.rules = G_define_standard_option(G_OPT_F_INPUT);
    5151    parm.rules->key = "rules";
    52     parm.rules->type = TYPE_STRING;
    53     parm.rules->description = _("File containing recode rules");
    54     parm.rules->key_desc = "name";
    55     parm.rules->gisprompt = "old_file,file,input";
     52    parm.rules->label = _("File containing recode rules");
     53    parm.rules->required = NO;
    5654
    5755    parm.title = G_define_option();
     
    9290        srcfp = fopen(parm.rules->answer, "r");
    9391        if (!srcfp)
    94             G_fatal_error(_("Cannot open rules file <%s>"),
     92            G_fatal_error(_("Unable to open rules file <%s>"),
    9593                          parm.rules->answer);
    9694    }
     
    108106    do_recode();
    109107
     108    G_done_msg(_("Raster map <%s> created."),
     109               result);
     110   
    110111    exit(EXIT_SUCCESS);
    111112}
  • grass/branches/develbranch_6/raster/r.recode/read_rules.c

    r32583 r34366  
    1717    if (inp_type != CELL_TYPE) {
    1818        if (G_read_fp_range(name, mapset, &drange) <= 0)
    19             G_fatal_error(_("Unable to read f_range for map %s"), name);
     19            G_fatal_error(_("Unable to read fp range of raster map <%s>"),
     20                          G_fully_qualified_name(name, mapset));
    2021
    2122        G_get_fp_range_min_max(&drange, &old_dmin, &old_dmax);
    2223        if (G_is_d_null_value(&old_dmin) || G_is_d_null_value(&old_dmax))
    23             G_message(_("Data range is empty"));
     24            G_important_message(_("Data range of raster map <%s> is empty"),
     25                                G_fully_qualified_name(name, mapset));
    2426        else {
    2527            sprintf(buff, "%.10f", old_dmin);
     
    2729            G_trim_decimal(buff);
    2830            G_trim_decimal(buff2);
    29             G_message(_("Data range of %s is %s to %s (entire map)"), name,
    30                       buff, buff2);
     31            G_message(_("Data range of raster map <%s> is %s to %s (entire map)"),
     32                      G_fully_qualified_name(name, mapset), buff, buff2);
    3133        }
    3234    }
    3335    if (G_read_range(name, mapset, &range) <= 0)
    34         G_fatal_error(_("Unable to read range for map <%s>"), name);
     36        G_fatal_error(_("Unable to read range of raster map <%s>"),
     37                      G_fully_qualified_name(name, mapset));
    3538
    3639    G_get_range_min_max(&range, &old_min, &old_max);
    3740    if (G_is_c_null_value(&old_min) || G_is_c_null_value(&old_max))
    38         G_message(_("Integer data range of %s is empty"), name);
     41        G_important_message(_("Integer data range of raster map <%s> is empty"),
     42                            G_fully_qualified_name(name, mapset));
    3943    else
    40         G_message(_("Integer data range of %s is %d to %d"),
    41                   name, (int)old_min, (int)old_max);
     44        G_message(_("Integer data range of raster mao <%s> is %d to %d"),
     45                  G_fully_qualified_name(name, mapset), (int) old_min, (int) old_max);
    4246
    4347    return 0;
     
    121125            }
    122126            else
    123                 G_message(_("%s is not a valid rule"), buf);
     127                G_message(_("'%s' is not a valid rule"), buf);
    124128            break;
    125129        }                       /* switch */
  • grass/branches/develbranch_6/raster/r.recode/recode.c

    r32527 r34366  
    11#include <stdio.h>
     2
     3#include <grass/glocale.h>
     4
    25#include "global.h"
    36
     
    4346    in_fd = G_open_cell_old(name, mapset);
    4447    if (in_fd < 0)
    45         G_fatal_error("Can't open input map");
     48        G_fatal_error(_("Unable to open raster map <%s>"),
     49                      G_fully_qualified_name(name, mapset));
    4650
    4751    out_fd = G_open_raster_new(result, out_type);
Note: See TracChangeset for help on using the changeset viewer.