Somewhat functioning temporal browsing, to add: backwardsbrowsing and multithreading

This commit is contained in:
Kollberg
2019-05-29 16:14:19 -04:00
parent cdf6b25fba
commit 91df0d409a
2 changed files with 7 additions and 10 deletions
+6 -6
View File
@@ -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);
+1 -4
View File
@@ -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