Closed TheFridge76 closed 3 years ago
Thank you very much for this awesome addition! Could you please merge the current develop
? You'll need to rebuild the externals. Also the CEF version changed, so maybe you have to delete build\windows-externals-Release\cef
.
You may also add this plugin to the list of plugins in the README.md :smile:
I just tested this on Linux and all seems to work nicely. I'll look at the code hopefully later this week - here are some initial observations / suggestions:
layers
icon would be more fitting than panorama
.cache/<csp-plugin-name>/whatever
. So the LOD-Bodies would write to cache/csp-lod-bodies/
and your plugin would write to cache/csp-wms-overlays/capability-cache
and to cache/csp-wms-overlays/texture-cache
. This way we only have one top-level cache directory! Thank you once more for this great addition!
Thanks for your feedback on the plugin! To address some of your suggestions:
Have you checked the Downloader
class? It already supports parallel downloads and some progress output. It's used here: https://github.com/cosmoscout/cosmoscout-vr/blob/develop/src/cosmoscout/Application.cpp#L330
Regarding the cache: I think we should just change the default configuration and moving it to share/cache
seems reasonable!
It also appears to me that the capabilities cache is outdated quite frequently. If you download the capabilities in parallel we could maybe try not to cache this? Most awesome solution would be to parse the capabilities document directly after downloading directly in the download thread. Only once this is finished, the UI should be filled with the newly available data sets. This way the plugin loading would be much faster!
The capability cache does bring some load time improvements at least when frequently restarting CosmoScout, so I don't think we should stop caching the capabilities. The NASA NEO server unfortunately does not specify a sequence number, so its capabilites have to be downloaded each time the plugin is loaded, but both the NASA SVS server and the DWD server profited from using the cache in a short test I did:
Server | without Cache | with Cache |
---|---|---|
NEO | 1.7-2.9s | - |
SVS | 4.4-5s | 1,7-2s |
DWD | 5.9-6s | 0.5-0.7s |
I'm sorry, but I didn't quite get the second part of your comment: Do you suggest to proceed with the initialization of CosmoScout while the capabilities are downloaded and parsed in the background? If we added more work to be done to the download threads, this would also mean that the Downloader
class can't be used anymore, right?
I just tested this with the DWD server. The update sequence number is not changed when the time ranges change. It still reports 13431
as it did this morning. However, the valid time dimensions for various layers have changed in the mean time. So for example, the "Niederschlag" layer only shows the most recent data if I delete the cache by hand.
And yes, you're right using the Downloader
wouldn't be straight-forward anymore. You would either have to copy the relevant code from this class (it's not much. actually just a combination of the Threadpool
and cs::utils::filesystem::downloadFile()
) or you launch a new parsing thread once the download finished...
What do you think?
Ah, right! I guess with DWD not updating the updateSequence often enough the caching would only be useful for the SVS server. In this case I think it makes sense to remove the capability caching for now.
I'll work on implementing the parallel download in the next days. I think using Threadpool
it should be quite straight-forward. However, as I'm downloading the file directly to in-memory streams I will keep using the manual curlpp request setup instead of cs::utils::filesystem::downloadFile()
(Maybe a method for downloading files to any std::ostream
should be added to cs::utils
at some point?)
Currently https://gitlab.com/libtiff/libtiff is not available. See https://github.com/cosmoscout/cosmoscout-vr/pull/244.
I played around a bit and it seems pretty stable now. I applied the automatic fixes from clang-format
and clang-tidy
. The only thing I would suggest is to remove "https://svs.gsfc.nasa.gov/cgi-bin/wms"
from the default config as it causes several warnings during startup which is not-so-good for the user experience.
Pull Request Test Coverage Report for Build 689344976
💛 - Coveralls