Commit graph

29438 commits

Author SHA1 Message Date
Andrew Davie
9f0bcf3257 MINIMAL code set for GPX line drawing
Has all the structure of the classes needed for extension to arrows/markers/whatever.
However, this is just the minimal subset of those base classes required to implement the line drawing functionality
with the asynchronous resampling, and fully compatible with 'current track' which is NOT resampled in any way.

These files are a branch from the prior pull request, and hopefully will make everyone more comfortable about including
the code. The altitude and speed displays, all the bells and whistles - that can come later if needed.
2016-04-04 00:30:07 +10:00
Andrew Davie
ceddb50e60 Minimised calls to getPixXFromLatLon and getPixYFromLatLon during main draw loop
In the drawing loop, culling was performed on pixel boundaries based on x/y positions compared to the tileBox x/y position,
however calculating these from lat/lon was quite a slow process involving calls to getPixXFromLatLon and getPixYFromLatLon
which in turn had a horrendous amount of calculations happening. But since the tileBox has lat/lon and the pixel/lines being
drawn also have lat/lon it seems reasonable - despite potential spherical issues on lat/lon coordinates (?) to just use the
lat/lon as a visibility cull. So, that's what I've done and it does seem to work OK.  Heaps faster; aside from the actual
line draw we're talking a couple orders of magnitude improvement in speed.  Getting really zippy now, even when drawing
groups super big tracks, and I mean big - hundredsof thousands of points big.

The video at https://youtu.be/J1ppW3_hWds shows well over a thousand kilometers of tracks, 230 thousand points.
2016-04-03 23:31:15 +10:00
Andrew Davie
209203acd3 Resample of Arrows, Speed, Altitude and Conveyor enabled
By enabling on-zoom resampling of arrows, speed, altitude and conveyor data it is possible to more effectively
tailor the visuals of these renderers. For example, the altitude and speed are point-reduced based on zoom, and now
look much cleaner at low zoom values.  Likewise, the arrows are now rendered at consistent size regardless of
zoom. Also, the conveyor segments are similar length onscreen regardless of zoom. During a zoom change, the
prevoiusly resampled track is killed, so there is a brief flash while the appropriate track is resampled. This
appeared visually better than drawing the old track with incorrect spacing/scaling.
2016-04-03 03:40:56 +10:00
Andrew Davie
3e13d309f6 "Massive" optimisation - on-demand culling for GPX tracks
A bit of inspiration; rather than trigger the culling for tracks when they are loaded and every time you zoom
(i.e, creating the resampled or simplified tracks such as standard track (Ramer Douglas Peucer line reduction), arrows,
speed, markers (all resample)... now the system uses the bounding rectangle of the original track to trigger the cull(s)
only when the track is onscreen and viewable. This now allows dozens of tracks to be loaded without initial slowdown
caused by all those resamplers and cullers running in the background. It's an on-demand system, in other words.

So, whereas previously if you had 20 GPX tracks loaded, and you zoomed in/out, then all 20 of those tracks would start
a Ramer-Douglas-Peucer resize, which would significantly slow down the whole thing (even though they are asynchronous
they do take a toll on performance).  Now, when you zoom in/out, only visible tracks (or ones which become visible)
will start the RDP resize.
2016-04-03 01:04:26 +11:00
Andrew Davie
66128c8c66 Merge remote-tracking branch 'upstream/master' 2016-04-02 22:07:21 +11:00
Andrew Davie
e88c37599a visible render layers changed 2016-04-02 20:44:16 +11:00
Andrew Davie
ff29a1a744 Optimisation. Line culler slightly quicker. 2016-04-02 20:30:59 +11:00
Andrew Davie
6371dd2da4 reconfigured to display speed render 2016-04-02 18:57:56 +11:00
Andrew Davie
4474c9421a Optimised. Checked/fixed 0/1 point boundary conditions. Fixed speed.
I've done quite a bit of refactoring on the asynchronous resamplers to optimise the code. I've also checked carefully
the boundary cases of 0 and 1 point lists and ensured that they operate OK. Fixed up the speed resampler, which was
placing results in the wrong list :)
2016-04-02 18:51:20 +11:00
Andrew Davie
aac22d9e41 Changed culled to always non-null 2016-04-02 14:04:26 +11:00
Franco
e9668d1461 Translated using Weblate (Spanish (Argentina))
Currently translated at 100.0% (1956 of 1956 strings)
2016-04-01 21:02:45 +02:00
sonora
180f5c3714 test something 2016-04-01 17:38:27 +02:00
sonora
12815491d9 hide notification if nothing is ongoing 2016-04-01 17:15:15 +02:00
Andrew Davie
b7d826483c Paint/context preserving local state
I got to thinking that the paint variable state should be preserved after the drawing functions did their stuff. Saving
and restoring individual values inside each function was getting messy, so I implemented a local paint variable which
was updated with the important stuff from the passed-in paints. The local variable is now used for all painting/drawing
and the original paint guaranteed unchanged. I could see issues elsewhere if I changed something and other code
was assuming it was already set.  So, quite a bit of fiddling with the code to get this working, but now it's clean.

I also did a bit of work on the arrows - see video at https://youtu.be/wvE9HUDMqSM

Basically they're much nicer, but also they are coloured. It's just an experimental thing, where the colour is based
upon the distance along the track; using the same rainbow scaling as the altitude display does; that is... purple up
to red.
2016-04-02 01:55:58 +11:00
sonora
e868ebce01 remove notification line breaks for now 2016-04-01 16:47:15 +02:00
jan madsen
8dfb592b2c Translated using Weblate (Danish)
Currently translated at 100.0% (1956 of 1956 strings)
2016-04-01 16:44:54 +02:00
xmd5a
e027289d28 Update strings 2016-04-01 17:22:29 +03:00
sonora
e020df1bde small fix 2016-04-01 16:06:19 +02:00
sonora
82545c0fda see if notification takes line breaks 2016-04-01 15:59:29 +02:00
sonora
8aaaab9bad try improve weird notification behavior, particularly for GPX recording 2016-04-01 15:49:10 +02:00
GaidamakUA
5bde48b2e6 Fixed menu for configure screen. 2016-04-01 15:56:11 +03:00
Alexey Kulish
2c74e887a1 Fix https://github.com/osmandapp/Osmand/issues/2389 2016-04-01 13:04:09 +03:00
Alexey Kulish
bf1dac5b06 Fix https://github.com/osmandapp/Osmand/issues/2393 2016-04-01 12:40:37 +03:00
GaidamakUA
332167378c Partially fixed layout for configure map. 2016-04-01 12:08:20 +03:00
GaidamakUA
47cbc0771e Fixes #2387. All GPX tracks no longer selected by default. 2016-04-01 11:31:07 +03:00
Weblate
7e3e8293d2 Merge remote-tracking branch 'origin/master' 2016-04-01 10:05:23 +02:00
Hinagiku Zeppeki
f67893cf78 Translated using Weblate (Japanese)
Currently translated at 99.9% (1952 of 1953 strings)
2016-04-01 10:05:13 +02:00
Xosé Calvo
e7e4f642d8 Translated using Weblate (Galician)
Currently translated at 95.5% (1866 of 1953 strings)
2016-04-01 10:05:12 +02:00
GaidamakUA
3da81e2a48 Fixes #2390. And some cleanup. 2016-04-01 11:04:21 +03:00
Andrew Davie
778a243cdf Bugfix: Current Track disappeared when starting point wandered offscreen
The 'bounds' that I had implemeted earlier described the minimal rectangle inside which a whole track was contained. This
bounding rectangle was used to quickly cull all track types at draw-time. And it worked well... too well!  The current track
is continually adding points to itself, so its bounds need to be recalculated regularly, not just at startup like other
track types.

So, I've implemented a new Renderable, 'CurrentTrack' which does the special handling for that type of track. It is
smart in that it only recalculates/updates bounding rectangle on the newly added points, so it's very quick. I tested
it on my phone and it appears to be working OK.

Other minor adjustments here and there as I tweak things.
2016-04-01 17:00:02 +11:00
Andrew Davie
3fc4702c9e Epsilon for line simplification was using incorrect value - now much nicer
Fixed a bug related to the distance used for line reduction. The previous value of zoom was being used, instead
of the new value. This kind of explains why I could see line reduction changes more than I though I should have
been able to. Now it's looking very nice. I don't think there will be many more changes. If any.
2016-04-01 04:22:31 +11:00
Andrew Davie
160f280ee1 minor fixup - make sure Conveyor Render checks the track limits early-on 2016-04-01 04:09:36 +11:00
Andrew Davie
71e84acc9f Final pass clean-up on code. It's done.
I've been through and cleaned up the code - minor improvements and cleanups. I'm happy with it and will I stop making
changes and wait for review. I also now understand how git branches work :) so I will work on my own branch.
I hope that this addition makes it into OsmAnd; I'm confident that it is robust and well written.
There will probably be a bug or two, but relatively minor I am sure.
2016-04-01 03:29:05 +11:00
Andrew Davie
112ffdd69a Final pass clean-up on code. It's done.
I've been through and cleaned up the code - minor improvements and cleanups.
It's done. Now that I'm happy with it I propose to stop making changes and wait for review.
I also now understand how git branches work, so I will work on my own branch.
I hope that this addition makes it into OsmAnd; I'm confident that it is robust and well written.
2016-04-01 02:48:03 +11:00
GaidamakUA
15ee1beed9 Made description clickable. 2016-03-31 18:47:08 +03:00
GaidamakUA
a3ca01255d Description initialization. 2016-03-31 17:50:12 +03:00
GaidamakUA
d9f7ac5a50 New icons for widgets. 2016-03-31 17:41:09 +03:00
GaidamakUA
88cffc0740 Added description as indication that view is collapsed. 2016-03-31 17:33:46 +03:00
Andrew Davie
7ee1cae93c Prevented current track from participating in line reduction
The current track is constantly changing. It is not suitable for the line culling stuff, so that track is detected
and special-cased.
2016-04-01 01:18:20 +11:00
Dmitriy Prodchenko
2600377b9a New icons for Configure Screen. 2016-03-31 16:46:55 +03:00
GaidamakUA
fe2f690aba Fixes #2394. Problem with 2.3 compatibility. 2016-03-31 16:09:25 +03:00
GaidamakUA
6dbf547579 Small changes. 2016-03-31 16:09:25 +03:00
GaidamakUA
413aad56a9 Fixed bug with changing all instances of drawable. 2016-03-31 16:09:25 +03:00
GaidamakUA
a0f78e64a8 Deprecation of IconsCacheMethods. 2016-03-31 16:09:25 +03:00
Weblate
47b71145da Merge remote-tracking branch 'origin/master' 2016-03-31 14:49:04 +02:00
Ajeje Brazorf
b81ecbc5c3 Translated using Weblate (Sardinian)
Currently translated at 70.2% (1734 of 2469 strings)
2016-03-31 14:49:03 +02:00
CJTmmr
18a84398e5 Translated using Weblate (Dutch)
Currently translated at 100.0% (1953 of 1953 strings)
2016-03-31 14:48:52 +02:00
Dmitriy Prodchenko
d259c3b0da Fix arrow height for lanes widget. 2016-03-31 15:48:33 +03:00
Andrew Davie
7e9afc68d6 Arrows renderer now working reasonably well.
I put a bit of effort into "pretty". Also, arrows are not displayed until a particular zoom level.
Sample video of this version with the following renderers active: rainbow altitude band, original track, distance
markers and arrows. See video at https://youtu.be/FNui0zxJGJI

Seems to be pretty solid for all renderers. Speed is good. This is close to a "final" version.
2016-03-31 22:57:04 +11:00
Andrew Davie
e8e6ca2854 Found/fixed crash bug in Altitude renderer
Out of memory bug happened occasionally - now fixed by writing to original canvas instead of creating its own
bitmap buffer. It's going to be a lot quicker, too. Since the altitude band is now solid, though, it should be
in the renderer list before the standard track segment.

I have also done some work on the distance/marker renderer, and that is enabled in this update. It draws the
distance (km) as a marker and number over the top of each track.

I went for a ride on my motorbike today to check out how some of the changes work. The "current track" stuff
is hopeless, so that needs to be fixed. Basically I was trying to NOT resample the current track, as it
causes all sorts of speed issues when points are continually added and resamples are continually fired. But
my change clearly didn't work properly so I will revisit that shortly.

I do urge anyone testing to try with a GPX track which has elevation data - the rainbow track backing is
quite nice I think... I hope others like it.

As a side note; I found out how to get the exception log - I have to setup an email account on my emulator
to get it to work.
2016-03-31 20:04:00 +11:00