mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 08:49:20 -05:00
Somewhat functioning temporal browsing, to add: backwardsbrowsing and multithreading
This commit is contained in:
@@ -73,19 +73,20 @@ SunTextureManager::SunTextureManager(){
|
||||
uploadTextureFromName(next);
|
||||
}
|
||||
else {
|
||||
LERROR("Shit already exists!");
|
||||
if (_textureListGPU.find("20" + parseMagnetogramDate(next).substr(0,10)) == _textureListGPU.end()) {
|
||||
LERROR("Texture didn't exist on gpu, uploading it: 20" + parseMagnetogramDate(next).substr(0,10));
|
||||
uploadTextureFromName(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_counter++;
|
||||
|
||||
}
|
||||
|
||||
// not using this right now
|
||||
void SunTextureManager::initialDownloadBatch(){
|
||||
// check what files we have in the synd directory
|
||||
checkFilesInDirectory();
|
||||
|
||||
|
||||
std::string current = getOpenSpaceDateTime();
|
||||
//fetch a list of the textures we need, based on openspace time, from our server
|
||||
@@ -163,7 +164,6 @@ SunTextureManager::SunTextureManager(){
|
||||
void SunTextureManager::uploadTextureFromName(std::string filename){
|
||||
FitsFileReader fitsFileReader(false);
|
||||
|
||||
std::string dateID ="";
|
||||
//const auto tempBild = fitsFileReader.readImageFloat("../../../../../sync/magnetograms/" + filename); // mac
|
||||
const auto tempBild = fitsFileReader.readImageFloat("../../../sync/magnetograms/" + filename);
|
||||
|
||||
@@ -175,11 +175,11 @@ SunTextureManager::SunTextureManager(){
|
||||
fitsImage.push_back((c+stdvalue)/stdvalue);
|
||||
}
|
||||
|
||||
LERROR("laddar upp texture till GPU med id: " + dateID);
|
||||
//LERROR("laddar upp texture till GPU med id: " + dateID);
|
||||
|
||||
auto textureFits = std::make_unique<ghoul::opengl::Texture>(fitsImage.data(), glm::vec3(360, 180, 1),ghoul::opengl::Texture::Format::Red, GL_R32F,GL_FLOAT);
|
||||
textureFits->uploadTexture();
|
||||
|
||||
textureFits->setName(dateID);
|
||||
_textureQueueGPU.push(dateID);
|
||||
_textureListGPU[dateID] = std::move(textureFits);
|
||||
|
||||
|
||||
@@ -46,9 +46,6 @@ public:
|
||||
void initialDownload(std::unique_ptr<ghoul::opengl::Texture>& texture);
|
||||
void checkFilesInDirectory();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void initialDownloadBatch();
|
||||
@@ -66,7 +63,7 @@ private:
|
||||
int _counter = 0;
|
||||
int _counter2 = 0;
|
||||
|
||||
std::thread _dldthread;
|
||||
//std::thread _dldthread;
|
||||
std::string _activeTextureDate = "NODATE";
|
||||
|
||||
const unsigned int _maxTexturesOnGPU = 5; //every texture is around 250kb in size
|
||||
|
||||
Reference in New Issue
Block a user