From f89301a70a7e4cfaf7e007d90a8dbc03a90303cd Mon Sep 17 00:00:00 2001 From: Ylva Selling Date: Wed, 27 Apr 2022 17:13:24 -0400 Subject: [PATCH] Move check for image collection is loaded in order to improve interaction --- modules/skybrowser/skybrowsermodule_lua.inl | 4 ---- modules/skybrowser/src/wwtcommunicator.cpp | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index e4f0264cad..882e4dfe3d 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -52,10 +52,6 @@ namespace { if (module->isCameraInSolarSystem()) { TargetBrowserPair* selected = module->getPair(module->selectedBrowserId()); if (selected) { - if (!selected->isImageCollectionLoaded()) { - LINFO("Image collection is not yet loaded to AAS WorldWide Telescope"); - return; - } const ImageData& image = module->getWwtDataHandler()->getImage(imageIndex); // Load image into browser std::string str = image.name; diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index c334b8aec5..91b555ad59 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -48,7 +48,11 @@ void WwtCommunicator::selectImage(const std::string& url, int i) { if (it == _selectedImages.end()) { // Push newly selected image to front _selectedImages.push_front(i); - addImageLayerToWwt(url, i); + + // If wwt has not loaded the collection yet, wait with passing the message + if (_isImageCollectionLoaded) { + addImageLayerToWwt(url, i); + } } }