[PATCH] Work on a dive localisation tool using GPS coordinates

Dirk Hohndel dirk at hohndel.org
Sun Jan 13 16:37:17 PST 2013


Pierre-Yves <pingou at pingoured.fr> writes:

> On Sun, Jan 13, 2013 at 10:05:24AM -0800, Dirk Hohndel wrote:
>> b) stay with the Ctrl^M (or Log menu) approach, but again as the current
>> dive changes, have the map shift and zoom to the active dive site.
>
> Hi Dirk
>
> I am trying to work on this part and I think I am close to have something
> working but I'm having problem finding the place where I should place the call
> to refresh the map window when changing the selected dive.

There isn't a simple place to do so. Because multiple parts of the code
could make changes that might require a redraw of the screen we call the
redraw code whenever it seems that a redraw might be required.

> I tried to put the call in the "repaint_dive" function of gtk-gui.c but it seems
> to be invocated twice when I change the selected dive, this seems to break my
> code :/

Yes, that would have been one of the spots that I would have
recommended. I'm somewhat unsurprised that it gets called more than
ones. I noticed when debugging my deco code that we appeared to do
unnecessary redraws.

I'll try to look into this and see if it's something obviously
redundant, but ideally your code would do something like this:

if (same_gps_as_last_time)
   return;
draw_new_map();

>> PPS: the map window doesn't respond to any of the usual keyboard driven
>> ways to close it (hit ESC or Ctrl^W). That also should be addressed
>
> I've fixed this based on the code from statistics.c.

Excellent.

/D


More information about the subsurface mailing list