Opened 11 years ago

Closed 11 years ago

#1882 closed defect (fixed)

new query display needs to update on mouse click

Reported by: cmbarton Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: wxGUI Version: svn-trunk
Keywords: query Cc:
CPU: Unspecified Platform: Unspecified

Description

The new query display is very nice. It is much more readable than previous output.

But it needs to update each time you click on a new cell or feature. Currently, you must close the display and click on a new cell/feature to see the value of that cell/feature.

I assume that the plan is for it to update or maybe even accumulate values so that you can see the result of multiple mouse clicks. But that part is not working.

Michael

Change History (21)

comment:1 by annakrat, 11 years ago

Keywords: query added

Updating on mouse click should already work. Maybe some problem on Mac again? Is there any error?

comment:2 by cmbarton, 11 years ago

No error. Just no update.

Michael

in reply to:  1 comment:3 by lucadelu, 11 years ago

Replying to annakrat:

Updating on mouse click should already work. Maybe some problem on Mac again? Is there any error?

On Debian it is working well.

Luca

comment:4 by cmbarton, 11 years ago

We should see if it is out on Windows too or just Mac.

Michael

in reply to:  4 comment:5 by hellik, 11 years ago

Replying to cmbarton:

We should see if it is out on Windows too or just Mac.

tested with

GRASS version: 7.0.svn                                                          
GRASS SVN Revision: 54994                                                       
Build Date: 2013-02-11                                                          
GIS Library Revision: 52468 (2012-07-27)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ.4: 4.8.0                                                                   
GEOS: 3.3.6dev                                                                  
SQLite: 3.7.10                                                                  
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W) 

d.rast map=elevation

clicking on the map display, the output window pops up, but there is no output value of queried raster.

Helmut

comment:6 by annakrat, 11 years ago

I have fixed the problem on Windows already (r54995), it was related to something different. So let's see tomorrow.

Anna

in reply to:  6 comment:7 by hellik, 11 years ago

Replying to annakrat:

I have fixed the problem on Windows already (r54995), it was related to something different. So let's see tomorrow.

ah, ok, I'll test it.

Helmut

comment:8 by cmbarton, 11 years ago

The query also does not show the coordinates of the cell clicked, at least in my display. I'll see what it is like with a version tomorrow.

Michael

in reply to:  8 comment:9 by annakrat, 11 years ago

Replying to cmbarton:

The query also does not show the coordinates of the cell clicked, at least in my display. I'll see what it is like with a version tomorrow.

I added the coordinates in r55003.

in reply to:  6 comment:10 by hellik, 11 years ago

Replying to annakrat:

I have fixed the problem on Windows already (r54995), it was related to something different. So let's see tomorrow.

it works nicely with the latest osgeo4w-wingrass7-nightly build.

thanks Helmut

comment:11 by cmbarton, 11 years ago

The coordinates show up fine but no update. If you can point me to the relevant mouse binding code, I could see if I can fix it.

Michael

in reply to:  11 comment:12 by annakrat, 11 years ago

Replying to cmbarton:

The coordinates show up fine but no update. If you can point me to the relevant mouse binding code, I could see if I can fix it.

That would be great because I don't know what could be the problem. The code doing the query is in mapdisp/frame.py in QueryMap method which is called from Query method. This is called from mapdisp/mapwindow.py, line 1187. So I would put some prints and see where it is blocked.

Thanks, Anna

comment:13 by cmbarton, 11 years ago

The important thing is that the query works. But it is not triggering an update to the new query output window. Does that happen in the same Query method? Or is it somewhere else?

Michael

in reply to:  13 comment:14 by annakrat, 11 years ago

Replying to cmbarton:

The important thing is that the query works. But it is not triggering an update to the new query output window. Does that happen in the same Query method? Or is it somewhere else?

The update is in the QueryMap line 734:

        if self.dialogs['query']:
            self.dialogs['query'].Raise()
            self.dialogs['query'].SetData(result)

comment:15 by cmbarton, 11 years ago

Thanks. I'll take a look as soon as I can.

Michael

comment:16 by cmbarton, 11 years ago

It is in line 1187 of mapwindow.py

Change it from:

self.frame.Query(self.mousebegin[0],self.mousebegin[1])

to

self.frame.Query(self.mouseend[0],self.mouseend[1])

and it works fine. It should work fine on other platforms too, but you should check.

Michael

comment:17 by cmbarton, 11 years ago

OK. So that didn't show up well when it formatted. I'll try again.

Change 'begin' to 'end' in line 1187.

self.frame.Query(self.mouse['begin'][0],self.mouse['begin'][1])

to

[[[ self.frame.Query(self.mouseend[0],self.mouseend[1]) ]]]

in reply to:  17 comment:18 by cmbarton, 11 years ago

Oh well, hopefully you get the idea in spite of the formatting in Trak.

comment:19 by annakrat, 11 years ago

I changed it to the 'end' coordinates because it makes sense. However, I still don't understand how it is connected to the update problem.

Anna

comment:20 by cmbarton, 11 years ago

mousebegin is supposed to be the first coordinate pair for something like a rubber band line or box and mouseend subsequent coordinates. While mousebegin coordinates update somewhere else. It looks like only mouseend coordinates are updated in the method for line 1187. So the coordinates only update with mouseend, no new coordinates passed, no update. Either the query call needed to be moved to the method that updates mousebegin or the mouseend coordinates needed to be passed to the query call. I'm not sure why it worked in Linux and Windows as it was. Oh well, the mysteries of a highly complex system. Cheers.

Michael

comment:21 by cmbarton, 11 years ago

Resolution: fixed
Status: newclosed

works fine now. Closing ticket. Thanks again.

Note: See TracTickets for help on using tickets.