Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple updates aimed at improving the Webview part of dump1090 #24

Closed
wants to merge 10 commits into from

Conversation

wiedehopf
Copy link

@wiedehopf wiedehopf commented Sep 15, 2018

I've written quite extensive commit logs, please feel free to squash them if they are too much.
The patch using the ground track to decide appending positions to the line segments might be a bit strange but it should work great in practice. At least it does for me. If "show all tracks" is on i can now move the map and scroll when before it was very slow.
The third patch commit log claims a performance improvement which is probably not measurable in practice, i'm not practiced in git enough to change it though.

Regards

Let the user control the json history by adjusting interval and size.
Change the json history to be allocated on the heap instead of the stack
as it's no longer static in size.
Also change Webview history loading timeout to scale with the history
size so it does not time out when using large history sizes.
The color of the plane track is changed according to its altitude.
For every change a new OpenLayer Linestring object is created.
Improve performance by only changing color if the altitude changed by
more than 200 feet compared to the color being displayed.
According to my eyes even 500 feet difference does not create a visible
discontinuity in the color of the plane track.
As the altitude readout varies slightly even if a plane is flying level
this reduces the number of linestring objects quite a bit improving
performance.
This actually improves performance as the updateTrack function
is not carried out wrongly when there is no new position.
Also due to this bug the other bug fixed appending the old position
was never reached with the first bug still there.
Intermittent positions are displayed as estimated (dotted) track. The
handling of that feature was confusing and differed significantly
between history and live data.
Clean it up so it works as intended.
The "tail" that is the latest fixed segment is set to the current
position. Therefore tail_update needs to be set to the current time not
head_update. head_update is updated whenever a new position is received
but at the time of the assignment has not been yet assigned the new
value.
To compensate for the somewhat reduced frequency of positions being
saved set the minimum time after which a new position is save to 4
seconds.
Relies on the airplanes providing correct ground track information.
In case they do not they just get updated a little less often so that is
acceptable.
Most airplanes fly straight so decrease the frequency with which their
positions are saved.
For airplane with unkown track, MLAT aircraft and track changes < 1
degree keep the previous update interval. For >1 degree track changes
update every 2 seconds to produce nice curves. Airplanes with constant
track are updated every 16 seconds which should be sufficient and
reduces overall lines in memory improving performance.
head_update saves the timestamp of the plane's current position in the
linestring segments which makes no sense because the position is
not always part of the linestring. Save it as part of the plane object
and call it prev_position_time because it's used as the timestamp of the
previous position of the airplane.
Whenever a point is appended to the current line segment, tail_update is
updated. There is no reason this should stick around after moving
on to the next segment, it is only used to decide if the current point
is to be appended. For consistency add an append_time update when drawing
estimated segments even if it's not needed.
Only draw the new state after the new point, don't assume the new state
for the line to the previous point.
@wiedehopf
Copy link
Author

So after some consideration replacing tail_update and head_update with some other name does not improve things. Detecting track_change seems to work in practice but i want it to be consistent so i need to change old_track only when changing append_time/tail_update.

Up to commit 0b8f923 "Webview: fix append handling" i'm ok with this branch but after that it's no good.
I will make a new branch that is different after this commit and make a new pull request.

@wiedehopf
Copy link
Author

I'm closing this pull request and will send a new one when i'm done cleaning the stuff up in a new branch.

@wiedehopf wiedehopf closed this Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant