Opened 7 years ago

Closed 7 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 Changed 7 years ago by annakrat

Keywords: query added

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

comment:2 Changed 7 years ago by cmbarton

No error. Just no update.

Michael

comment:3 in reply to:  1 Changed 7 years ago by lucadelu

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 Changed 7 years ago by cmbarton

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

Michael

comment:5 in reply to:  4 Changed 7 years ago by hellik

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 Changed 7 years ago by annakrat

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

Anna

comment:7 in reply to:  6 Changed 7 years ago by hellik

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 Changed 7 years ago by 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.

Michael

comment:9 in reply to:  8 Changed 7 years ago by annakrat

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.

comment:10 in reply to:  6 Changed 7 years ago by hellik

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 Changed 7 years ago by 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.

Michael

comment:12 in reply to:  11 Changed 7 years ago by annakrat

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 Changed 7 years ago by 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?

Michael

comment:14 in reply to:  13 Changed 7 years ago by annakrat

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 Changed 7 years ago by cmbarton

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

Michael

comment:16 Changed 7 years ago by cmbarton

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 Changed 7 years ago by cmbarton

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]) ]]]

comment:18 in reply to:  17 Changed 7 years ago by cmbarton

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

comment:19 Changed 7 years ago by annakrat

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 Changed 7 years ago by cmbarton

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 Changed 7 years ago by cmbarton

Resolution: fixed
Status: newclosed

works fine now. Closing ticket. Thanks again.

Note: See TracTickets for help on using tickets.