[Xastir] interrupting a map redraw?

Curt Mills, WE7U hacker at tc.fluke.com
Mon Jul 7 14:23:17 EDT 2003


On Mon, 7 Jul 2003, J. Lance Cotton wrote:

> I got the "new code" last night from CVS. I went ahead and ran the migrate and
> fix-cfg scripts which initially presented some problems until I did a "make
> distclean" in the xastir sources and re-ran ./bootstrap.sh and all that jazz.

Ok.  That's my normal method of operation these days, running
bootstrap.sh/configure and then continuing.

I just tweaked the fix-cfg script so that it moves the
selected_maps.sys file to selected_maps.sys.backup (effectively
removing your current selection of maps), and removes the
map_index.sys file entirely.  That should help people that are still
having trouble with the maps during the conversion.  Upon starting
the new Xastir, you reindex all maps and you should be up and
running.

Details are in the "UPGRADE" file after you do a "cvs update".


> Now is works great. I really like the interruptable map redraws. I've tested
> with various combinations of zooming and panning for a map set consisting of
> shapefiles and one GNIS map with up to 8 commands "queued up". No problems.

The way it works now:  da_input() or da_resize() are callback
routines called by X11 when pointer/keyboard or window resize events
occur.  The math for doing the zoom/pan/resize gets done in these
routines, flags are set to ask Xastir to do the redraw, and then
da_input/da_resize exit (back to X11).  These two routines used to
actually do the redraw as well, but they don't anymore.

Later on, Xastir comes along in the main.c:UpdateTime() function,
finds the flags set, and starts the map redraw.  In the map_load
functions and some of the map drawing functions, X11 is asked to
check it's input queue and process events and the
interrupt_drawing_now flag is checked to see if any new input came
in.  If so, the load_maps and map drawing functions clean up and
exit immediately.

The end result is that you can interrupt at any time (but it doesn't
in the middle of loading a map, you have to be between map files),
and only the math for the zoom/pan/resize gets done immediately.
After all pointer/keyboard/resize events are processed, the map
drawing takes place.  You can still have map draw start in between
your events, but at the end of each map file, more events will be
caught and processed, then map drawing will start from scratch again.

For those with uP experience, the da_input() and da_resize()
functions are like interrupt handlers:  We now do the minimum
possible there, then let the main thread handle the map drawing
functions on it's own time.

-- 
Curt Mills, WE7U                    hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto:    A tax on people who are bad at math!"
"Windows:  Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir mailing list