making dataStart and dataEnd compulsory, also adding testSpecification

This commit is contained in:
Lovisa Hassler
2018-12-12 19:31:19 -05:00
parent 5b6a43038d
commit c6fc822077
2 changed files with 28 additions and 9 deletions

View File

@@ -157,6 +157,12 @@ RenderableSignals::RenderableSignals(const ghoul::Dictionary& dictionary)
, _spacingSizeFactor(SpacingSizeInfo, 0.0f, 0.0f, 10.0f)
, _fadeFactor(FadeFactorInfo, 0.5f, 0.1f, 0.5f)
{
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"RenderableSignals"
);
if (dictionary.hasKeyAndValue<ghoul::Dictionary>(SiteColorsInfo.identifier)) {
ghoul::Dictionary siteColorDictionary = dictionary.value<ghoul::Dictionary>(SiteColorsInfo.identifier);
std::vector<std::string> siteNames = siteColorDictionary.keys();

View File

@@ -28,9 +28,9 @@
namespace {
constexpr openspace::properties::Property::PropertyInfo ObjectIdentifierInfo = {
"ObjectIdentifier",
"Object Identifier",
"Identifier of the object that this translation is applied to."
"ObjectIdentifier",
"Object Identifier",
"Identifier of the object that this translation is applied to."
};
} // namespace
@@ -56,6 +56,20 @@ documentation::Documentation RadecTranslation::Documentation() {
new StringVerifier,
Optional::No,
ObjectIdentifierInfo.description
},
{
keyDataStart,
new StringVerifier,
Optional::No,
"The start of the timeframe we expect to have data for, "
"no warnings will be thrown outside this timesframe."
},
{
keyDataEnd,
new StringVerifier,
Optional::No,
"The end of the timeframe we expect to have data for, "
"no warnings will be thrown outside this timesframe."
}
}
};
@@ -66,18 +80,17 @@ RadecTranslation::RadecTranslation() = default;
RadecTranslation::RadecTranslation(const ghoul::Dictionary& dictionary)
: RadecTranslation()
{
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"RadecTranslation"
);
std::unique_ptr<ghoul::Dictionary> dictionaryPtr = std::make_unique<ghoul::Dictionary>(dictionary);
_dataStart = Time::convertTime(dictionaryPtr->value<std::string>(keyDataStart));
_dataEnd = double(Time::convertTime(dictionaryPtr->value<std::string>(keyDataEnd)));
extractData(dictionaryPtr);
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"RadecTranslation"
);
}
void RadecTranslation::extractData(std::unique_ptr<ghoul::Dictionary> &dictionary){