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
Map overview #149
Map overview #149
Conversation
Awesome! Really neat.
|
Thank you for your sugesstions! But I have one question about general concept of preview image: I planned to have preview image generated for all saved .ulog files - it is generated when someone visit the plot page. So browse page should be loaded as fast as possible independet to generation time. (I will write script which generate preview images for all existing logs which can be run when server idle) Other suggestions are clear, i will implement them. |
-> reduce Map Zoom -> do not render line in for loop (I can use Map.to_pixel for arrays)
the map is now generatd faster. Other problem is that Im not able to get continues integration tests to work, because im not familiar with pipenv and I have only python 3.5 |
I agree we should not generate them during a browse page request, it would be too slow. However since it's not immediately required after upload when loading the plot page, I also don't want to add more delay to that. This is why I suggested to do it on idle (something like this), and/or asynchronous (e.g. in a separate process).
No worries, I can look into that. |
I moved generation to upload page (only when public) and i tried to run it in sepate task, but im, not sure if my code is corect - im not familiar with tornado async api (and i dont know much about async task programing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is good. It's now run after the upload request finished and before the plot page is loaded - which is ok, as it's below 1 second now.
One thing I noticed is that the 'Not rendered / No GPS' label is zoomed as well. Is there a way to disable that?
@@ -0,0 +1,24 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this script executable? -> chmod +x generate_overview_img.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course
Ok, It is solved by generating other html, when preview image doesnt exist. I did not found any solution with CSS - for aligement I need display: block - but it is applied to alt text too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have it now, thanks for your efforts.
For CI there are some errors:
plot_app/overview_generator.py:13:0: C0103: Argument name "z" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)
plot_app/overview_generator.py:19:4: C0103: Variable name "sx" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)
plot_app/overview_generator.py:19:8: C0103: Variable name "sy" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)
plot_app/overview_generator.py:52:8: C0103: Variable name "z" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)
plot_app/overview_generator.py:54:12: C0103: Variable name "z" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)
Can you either rename them or add them as exceptions in https://github.com/PX4/flight_review/blob/master/pylintrc#L102? Either way is fine with me.
Im stil not able to get Pipfile compatible with requirementes.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI passes, so it's good to go
It's working: https://logs.px4.io/browse. |
Thank you for your help. |
This Improvement of Browse page add small pre-generated image of map with GPS track.
It can improve orientation in logs on browse page.
Overview image is generated when user visits plot_app page for first time and the image is saved in data/img direcotry.