[GRASS-dev] [bug #5098] (grass) gis.m; tcltk error when zooming to map with name which exists in more than one mapset

this bug's URL: http://intevation.de/rt/webrt?serial_num=5098
-------------------------------------------------------------------------

Subject: gis.m; tcltk error when zooming to map with name which exists in more than one mapset

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060904

When there are two maps with the same name in more than one of the accessible mapsets, then gis.m throws below tcltk error when I try to "zoom to selected map". To reproduce in spearfish, just copy any map from the PERMANENT mapset to the user1 mapset using the same name and then display it and zoom to it. If I enter @mapsetname (i.e. @user1) after the map name zooming to the map works.

It is probably just a question of catching the WARNING message and ignoring it, or of adding the @mapsetname automatically (default to current mapset if not set otherwise).

BTW, I find the warning message a bit weird: when I display roads from user1 I get the message "WARNING: 'vector/roads' was found in more mapsets (also found in user1)". In my understanding this should read "... (also found in PERMANENT)...

WARNING: 'vector/roads' was found in more mapsets (also found in user1).
WARNING: 'vector/roads' was found in more mapsets (also found in user1).
    while executing
"close $input"
    (procedure "MapCanvas::zoom_gregion" line 11)
    invoked from within
"MapCanvas::zoom_gregion $mon [list "vect=$map"]"
    (procedure "MapCanvas::zoom_map" line 48)
    invoked from within
"MapCanvas::zoom_map $mon"
    invoked from within
".mapcan(1).mf.topf.tb0.mapzoom.zm invoke active"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke active]"
    (procedure "tk::MenuInvoke" line 50)
    invoked from within
"tk::MenuInvoke .mapcan(1).mf.topf.tb0.mapzoom.zm 1"
    (command bound to event)

Moritz

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=5098
-------------------------------------------------------------------------

Subject: gis.m; tcltk error when zooming to map with name which exists in more than one mapset

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060904

When there are two maps with the same name in more than one of the
accessible mapsets, then gis.m throws below tcltk error when I try to
"zoom to selected map". To reproduce in spearfish, just copy any map
from the PERMANENT mapset to the user1 mapset using the same name and
then display it and zoom to it. If I enter @mapsetname (i.e. @user1)
after the map name zooming to the map works.

It is probably just a question of catching the WARNING message and
ignoring it, or of adding the @mapsetname automatically (default to
current mapset if not set otherwise).

Whenever any Tcl/Tk code runs a GRASS command, it needs to use
"2>@stdout". Tcl treats it as an error if anything is written to
stderr.

Genuine errors will still be detected by a non-zero exit code.

--
Glynn Clements <glynn@gclements.plus.com>

Maceij has reported this too.

I'm trying to do a bunch of comprehensive bug fixes (they never seem to end)
to gism. I think I've fixed this one.

I was finally able to reproduce a strange one that he also reported about
zooming when 2 or more map display are visible. Reproducing it on my Mac was
difficult, but fixing this was much harder. But I think I got it.

This has involved changing most of the many global variables floating around
to ones tied to local name spaces, and replacing other variables with arrays
indexed by active display monitor.

I hope to get this committed either tomorrow or Wednesday.

Hopefully, this will make the whole system more robust.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Request Tracker <grass-bugs@intevation.de>
Reply-To: Request Tracker <grass-bugs@intevation.de>
Date: Mon, 4 Sep 2006 18:13:15 +0200 (CEST)
To: <grass-dev@grass.itc.it>
Subject: [GRASS-dev] [bug #5098] (grass) gis.m; tcltk error when zooming to
map with name which exists in more than one mapset

this bug's URL: http://intevation.de/rt/webrt?serial_num=5098
-------------------------------------------------------------------------

Subject: gis.m; tcltk error when zooming to map with name which exists in more
than one mapset

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060904

When there are two maps with the same name in more than one of the accessible
mapsets, then gis.m throws below tcltk error when I try to "zoom to selected
map". To reproduce in spearfish, just copy any map from the PERMANENT mapset
to the user1 mapset using the same name and then display it and zoom to it. If
I enter @mapsetname (i.e. @user1) after the map name zooming to the map works.

It is probably just a question of catching the WARNING message and ignoring
it, or of adding the @mapsetname automatically (default to current mapset if
not set otherwise).

BTW, I find the warning message a bit weird: when I display roads from user1 I
get the message "WARNING: 'vector/roads' was found in more mapsets (also found
in user1)". In my understanding this should read "... (also found in
PERMANENT)...

WARNING: 'vector/roads' was found in more mapsets (also found in user1).
WARNING: 'vector/roads' was found in more mapsets (also found in user1).
    while executing
"close $input"
    (procedure "MapCanvas::zoom_gregion" line 11)
    invoked from within
"MapCanvas::zoom_gregion $mon [list "vect=$map"]"
    (procedure "MapCanvas::zoom_map" line 48)
    invoked from within
"MapCanvas::zoom_map $mon"
    invoked from within
".mapcan(1).mf.topf.tb0.mapzoom.zm invoke active"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke active]"
    (procedure "tk::MenuInvoke" line 50)
    invoked from within
"tk::MenuInvoke .mapcan(1).mf.topf.tb0.mapzoom.zm 1"
    (command bound to event)

Moritz

-------------------------------------------- Managed by Request Tracker

I'm doing a bunch of fixes (they never seem to end do they?) prompted by a
weird bug report by Maciej about odd behavior zooming between two map
displays. This was tricky to reproduce on my Mac and much more difficult to
fix. I think I got it, but it involved changing most of the many global
variables floating around to variables within local namespaces, and indexing
more variables by active display monitor.

I also found and dispatched a few other hidden bugs and bugs waiting to
happen.

I've fixed this one too I hope. Maciej and other have reported it before,
but it has been intermittent on my Mac--making a fix difficult.

This cleanup should make the whole application more robust.

I want to commit all this tomorrow or on Wednesday (depending on my schedule
and access to the cvs tomorrow).

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Request Tracker <grass-bugs@intevation.de>
Reply-To: Request Tracker <grass-bugs@intevation.de>
Date: Mon, 4 Sep 2006 18:13:15 +0200 (CEST)
To: <grass-dev@grass.itc.it>
Subject: [GRASS-dev] [bug #5098] (grass) gis.m; tcltk error when zooming to
map with name which exists in more than one mapset

BTW, I find the warning message a bit weird: when I display roads from user1 I
get the message "WARNING: 'vector/roads' was found in more mapsets (also found
in user1)". In my understanding this should read "... (also found in
PERMANENT)...

Michael Barton wrote:

Maceij has reported this too.

I'm trying to do a bunch of comprehensive bug fixes (they never seem to end)
to gism.

:wink:

I think I've fixed this one.

I was finally able to reproduce a strange one that he also reported about
zooming when 2 or more map display are visible. Reproducing it on my Mac was
difficult, but fixing this was much harder. But I think I got it.

This has involved changing most of the many global variables floating around
to ones tied to local name spaces, and replacing other variables with arrays
indexed by active display monitor.

I hope to get this committed either tomorrow or Wednesday.

I will be glad to test it but I'm away 05-09 Sept. and *propably* will
not have an Internet connection during that time. Yet if the meeting is
boring and there's net available I could entertain myself a bit testing
the gis.m :). We'll see.

Cheers,
Maciek

On Mon, Sep 04, 2006 at 06:41:59PM +0100, Glynn Clements wrote:

Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=5098
> -------------------------------------------------------------------------
>
> Subject: gis.m; tcltk error when zooming to map with name which exists in more than one mapset
>
> Platform: GNU/Linux/x86
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> GRASS Version: cvs_head_20060904
>
> When there are two maps with the same name in more than one of the
> accessible mapsets, then gis.m throws below tcltk error when I try to
> "zoom to selected map". To reproduce in spearfish, just copy any map
> from the PERMANENT mapset to the user1 mapset using the same name and
> then display it and zoom to it. If I enter @mapsetname (i.e. @user1)
> after the map name zooming to the map works.
>
> It is probably just a question of catching the WARNING message and
> ignoring it, or of adding the @mapsetname automatically (default to
> current mapset if not set otherwise).

Whenever any Tcl/Tk code runs a GRASS command, it needs to use
"2>@stdout". Tcl treats it as an error if anything is written to
stderr.

Genuine errors will still be detected by a non-zero exit code.

Are all GRASS commands called by grass-xterm-wrapper and grass-run.sh?
If so, can we just move this redirection to grass-xterm-wrapper so that
Windows users are happy? $mingw test for separate redirection is ugly.

Huidae

Huidae Cho wrote:

> > this bug's URL: http://intevation.de/rt/webrt?serial_num=5098
> > -------------------------------------------------------------------------
> >
> > Subject: gis.m; tcltk error when zooming to map with name which exists in more than one mapset
> >
> > Platform: GNU/Linux/x86
> > grass obtained from: CVS
> > grass binary for platform: Compiled from Sources
> > GRASS Version: cvs_head_20060904
> >
> > When there are two maps with the same name in more than one of the
> > accessible mapsets, then gis.m throws below tcltk error when I try to
> > "zoom to selected map". To reproduce in spearfish, just copy any map
> > from the PERMANENT mapset to the user1 mapset using the same name and
> > then display it and zoom to it. If I enter @mapsetname (i.e. @user1)
> > after the map name zooming to the map works.
> >
> > It is probably just a question of catching the WARNING message and
> > ignoring it, or of adding the @mapsetname automatically (default to
> > current mapset if not set otherwise).
>
> Whenever any Tcl/Tk code runs a GRASS command, it needs to use
> "2>@stdout". Tcl treats it as an error if anything is written to
> stderr.
>
> Genuine errors will still be detected by a non-zero exit code.

Are all GRASS commands called by grass-xterm-wrapper and grass-run.sh?

No. Those are only used for commands which need to be run in an xterm
because they interact with the user via a terminal. They aren't used
for modules which can operate without user interaction (i.e. the
majority of GRASS modules).

--
Glynn Clements <glynn@gclements.plus.com>