Fixes to prevent crashes when data is not available

This commit is contained in:
Alexander Bock
2015-06-22 14:44:31 +02:00
parent 943ab69c69
commit 072a6d3cc1
8 changed files with 38 additions and 73 deletions
+4 -2
View File
@@ -118,7 +118,7 @@ std::string LabelParser::encode(std::string line) {
return "";
}
void LabelParser::create(){
bool LabelParser::create() {
auto imageComparer = [](const Image &a, const Image &b)->bool{
return a.startTime < b.startTime;
};
@@ -132,7 +132,7 @@ void LabelParser::create(){
ghoul::filesystem::Directory sequenceDir(_fileName, true);
if (!FileSys.directoryExists(sequenceDir)) {
LERROR("Could not load Label Directory '" << sequenceDir.path() << "'");
return;
return false;
}
std::vector<std::string> sequencePaths = sequenceDir.read(true, false); // check inputs
for (auto path : sequencePaths){
@@ -255,6 +255,7 @@ void LabelParser::create(){
////print all
for (auto target : _subsetMap){
_instrumentTimes.push_back(std::make_pair(lblName, _subsetMap[target.first]._range));
// std::string min, max;
// SpiceManager::ref().getDateFromET(target.second._range._min, min);
// SpiceManager::ref().getDateFromET(target.second._range._max, max);
@@ -281,6 +282,7 @@ void LabelParser::create(){
sendPlaybookInformation(PlaybookIdentifierName);
return true;
}
void LabelParser::createImage(Image& image, double startTime, double stopTime, std::vector<std::string> instr, std::string targ, std::string pot) {