moving the objectidentifier to radecmanager

This commit is contained in:
Lovisa Hassler
2018-12-05 18:32:43 -05:00
parent 691e641a71
commit e621b8012b
4 changed files with 12 additions and 12 deletions

View File

@@ -26,11 +26,16 @@
namespace openspace {
constexpr const char* _loggerCat = "RadecManager";
constexpr const char* KeyIdentifier = "ObjectIdentifier";
RadecManager::RadecManager() = default;
bool RadecManager::extractMandatoryInfoFromDictionary(const char* identifier, std::unique_ptr<ghoul::Dictionary> &dictionary){
bool dataFilesSuccess = DataFileHelper::checkFileNames(identifier, dictionary, _dataFiles);
return dataFilesSuccess;
bool RadecManager::extractMandatoryInfoFromDictionary(const char* identifier, std::unique_ptr<ghoul::Dictionary> &dictionary){
if (dictionary->hasKeyAndValue<std::string>(KeyIdentifier)) {
objectIdentifier = dictionary->value<std::string>(KeyIdentifier);
}
bool dataFilesSuccess = DataFileHelper::checkFileNames(identifier, dictionary, _dataFiles);
return dataFilesSuccess;
}
bool RadecManager::correctHour(double time) const{

View File

@@ -48,6 +48,8 @@ namespace openspace {
mutable Position position;
mutable glm::vec3 currentMinute;
mutable double activeMinute = 0;
/* Identifier for object using the translation, used for logging */
std::string objectIdentifier;
/*Used to check if the loaded file is still relevant or if we should look for another one. */
mutable double _checkFileTime;

View File

@@ -37,7 +37,6 @@ namespace {
namespace openspace {
constexpr const char* _loggerCat = "RadecTranslation";
constexpr const char* KeyIdentifier = "ObjectIdentifier";
documentation::Documentation RadecTranslation::Documentation() {
using namespace documentation;
@@ -67,10 +66,6 @@ RadecTranslation::RadecTranslation(const ghoul::Dictionary& dictionary)
{
std::unique_ptr<ghoul::Dictionary> dictionaryPtr = std::make_unique<ghoul::Dictionary>(dictionary);
if (dictionary.hasKeyAndValue<std::string>(KeyIdentifier)) {
_objectIdentifier = dictionary.value<std::string>(KeyIdentifier);
}
extractData(dictionaryPtr);
documentation::testSpecificationAndThrow(
@@ -85,10 +80,10 @@ void RadecTranslation::extractData(std::unique_ptr<ghoul::Dictionary> &dictionar
constexpr const char* _identifier = "RadecTranslation";
if (!radecManager.extractMandatoryInfoFromDictionary(_identifier, dictionary)) {
LERROR(fmt::format("{}: Did not manage to extract data for {}.", _identifier, _objectIdentifier.c_str()));
LERROR(fmt::format("{}: Did not manage to extract data for {}.", _identifier, radecManager.objectIdentifier.c_str()));
}
else {
LDEBUG(fmt::format("{}: Successfully read data for {}.", _identifier, _objectIdentifier.c_str()));
LDEBUG(fmt::format("{}: Successfully read data for {}.", _identifier, radecManager.objectIdentifier.c_str()));
}
}

View File

@@ -58,8 +58,6 @@ private:
RadecManager radecManager;
mutable glm::vec3 _position;
/* Identifier for object using the translation, used for logging */
std::string _objectIdentifier;
glm::dmat4 _rotEquatorialSphere = { -0.05487554, 0.4941095, -0.8676661, 0.0,
-0.8734371 , -0.4448296, -0.1980764, 0.0,