mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 04:49:12 -06:00
Download image in ISWAManager
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
// * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
// * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
// ****************************************************************************************/
|
||||
|
||||
#include <modules/iswa/rendering/textureplane.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
@@ -157,20 +156,9 @@ void TexturePlane::setParent(){
|
||||
}
|
||||
|
||||
void TexturePlane::updateTexture(){
|
||||
int imageSize = 1024;
|
||||
DownloadManager::FileFuture* future;
|
||||
future = DlManager.downloadFile(
|
||||
ISWAManager::ref().iSWAurl(_cygnetId.value()),
|
||||
absPath(_path.value()),
|
||||
true,
|
||||
[](const DownloadManager::FileFuture& f){
|
||||
std::cout<<"download finished"<<std::endl;
|
||||
}
|
||||
);
|
||||
|
||||
DownloadManager::FileFuture* future = ISWAManager::ref().downloadImage(_cygnetId.value(), absPath(_path.value()));
|
||||
if(future){
|
||||
_futureTexture = future;
|
||||
imageSize-=1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,6 +68,18 @@ namespace openspace{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DownloadManager::FileFuture* ISWAManager::downloadImage(int id, std::string path){
|
||||
return DlManager.downloadFile(
|
||||
iSWAurl(id),
|
||||
path,
|
||||
true,
|
||||
[](const DownloadManager::FileFuture& f){
|
||||
std::cout<<"download finished"<<std::endl;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
std::string ISWAManager::iSWAurl(int id){
|
||||
std::string url = "http://iswa2.ccmc.gsfc.nasa.gov/IswaSystemWebApp/iSWACygnetStreamer?timestamp=";
|
||||
std::string t = Time::ref().currentTimeUTC();
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <ghoul/designpattern/singleton.h>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <openspace/engine/downloadmanager.h>
|
||||
|
||||
namespace openspace {
|
||||
class ISWACygnet;
|
||||
|
||||
@@ -37,9 +39,11 @@ public:
|
||||
ISWAManager();
|
||||
~ISWAManager();
|
||||
std::shared_ptr<ISWACygnet> createISWACygnet(std::string);
|
||||
std::string iSWAurl(int);
|
||||
DownloadManager::FileFuture* downloadImage(int, std::string);
|
||||
void downloadData();
|
||||
|
||||
private:
|
||||
std::string iSWAurl(int);
|
||||
std::map<std::string, std::string> _month;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user