diff --git a/data/assets/examples/urlsynchronization.asset b/data/assets/examples/urlsynchronization.asset index 1286bdd9b8..630eb4762b 100644 --- a/data/assets/examples/urlsynchronization.asset +++ b/data/assets/examples/urlsynchronization.asset @@ -3,15 +3,15 @@ local assetHelper = asset.require("util/asset_helper") asset.syncedResource({ - Type = "UrlSynchronization", Name = "Example Single", + Type = "UrlSynchronization", Identifier = "example_single", Url = "http://celestrak.com/NORAD/elements/geo.txt" }) asset.syncedResource({ - Type = "UrlSynchronization", Name = "Example Multiple", + Type = "UrlSynchronization", Identifier = "example_multiple", Url = { "http://celestrak.com/NORAD/elements/stations.txt", @@ -20,23 +20,23 @@ asset.syncedResource({ }) asset.syncedResource({ - Type = "UrlSynchronization", Name = "Example Large", + Type = "UrlSynchronization", Identifier = "example_large", Url = "http://ipv4.download.thinkbroadband.com/100MB.zip", Override = true }) asset.syncedResource({ - Type = "UrlSynchronization", Name = "Example Medium", + Type = "UrlSynchronization", Identifier = "example_medium", Url = "http://ipv4.download.thinkbroadband.com/5MB.zip", Override = true }) asset.syncedResource({ - Type = "UrlSynchronization", Name = "Example No ident", + Type = "UrlSynchronization", Url = "http://ipv4.download.thinkbroadband.com/5MB.zip" }) diff --git a/ext/ghoul b/ext/ghoul index 1c8513b4ae..a796b61604 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 1c8513b4ae8bd59245b6d9d80fb42fe3bb42e2d2 +Subproject commit a796b61604af408329f5b605d39fe8b56b46df8a diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index 517d5b8aa5..6fa4b418df 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -174,7 +174,7 @@ documentation::Documentation DashboardItemAngle::Documentation() { } DashboardItemAngle::DashboardItemAngle(ghoul::Dictionary dictionary) - : DashboardItem("Distance") + : DashboardItem("Angle") , _fontName(FontNameInfo, KeyFontMono) , _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f) , _source{ diff --git a/modules/imgui/src/guipropertycomponent.cpp b/modules/imgui/src/guipropertycomponent.cpp index 1669b9f84a..174796859b 100644 --- a/modules/imgui/src/guipropertycomponent.cpp +++ b/modules/imgui/src/guipropertycomponent.cpp @@ -98,8 +98,8 @@ namespace { node.children.begin(), node.children.end(), [p = *path.begin()](const std::unique_ptr& c) { - return c.get()->path == p; - } + return c.get()->path == p; + } ); TreeNode* n; @@ -112,7 +112,6 @@ namespace { std::unique_ptr newNode = std::make_unique(*path.begin()); n = newNode.get(); node.children.push_back(std::move(newNode)); - } // Recurse into the tree and chop off the first path diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index 2d5e02a9c5..9d78fee550 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -51,6 +51,7 @@ #include namespace { + constexpr const char* KeyBody = "Body"; constexpr const char* KeyGeometry = "Geometry"; constexpr const char* KeyRadius = "Radius"; constexpr const char* _loggerCat = "RenderablePlanet"; @@ -118,7 +119,15 @@ documentation::Documentation RenderablePlanet::Documentation() { new DoubleVerifier, Optional::Yes, "Specifies the radius of the planet. If this value is not specified, it " - "will try to query the SPICE library for radius values." + "will try to query the SPICE library for radius values using the body " + "key." + }, + { + KeyBody, + new StringVerifier, + Optional::Yes, + "If that radius is not specified, this name is used to query the SPICE " + "library for the radius values." }, { ColorTextureInfo.identifier, @@ -178,11 +187,6 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) , _shadowEnabled(false) , _time(0.f) { - ghoul_precondition( - dictionary.hasKeyAndValue(SceneGraphNode::KeyName), - "RenderablePlanet needs the name to be specified" - ); - documentation::testSpecificationAndThrow( Documentation(), dictionary, @@ -197,19 +201,32 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) // If the user specified a radius, we want to use this _planetRadius = static_cast(dictionary.value(KeyRadius)); } - else if (SpiceManager::ref().hasValue(name, "RADII") ) { + else { + if (!dictionary.hasKey(KeyBody)) { + documentation::TestResult res; + res.success = false; + documentation::TestResult::Offense offense = { + fmt::format("{} or {}", KeyRadius, KeyBody), + documentation::TestResult::Offense::Reason::MissingKey + }; + res.offenses.push_back(std::move(offense)); + throw documentation::SpecificationError( + std::move(res), + std::move("RenderablePlanet") + ); + } + + const std::string body = dictionary.value(KeyBody); + // If the user didn't specfify a radius, but Spice has a radius, we can use this glm::dvec3 radius; - SpiceManager::ref().getValue(name, "RADII", radius); + SpiceManager::ref().getValue(body, "RADII", radius); radius *= 1000.0; // Spice gives radii in KM. std::swap(radius[1], radius[2]); // z is equivalent to y in our coordinate system geomDict.setValue(KeyRadius, radius); _planetRadius = static_cast((radius.x + radius.y + radius.z) / 3.0); } - else { - LERRORC("RenderablePlanet", "Missing radius specification"); - } _geometry = planetgeometry::PlanetGeometry::createFromDictionary(geomDict); diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index 292939f768..e248838cbe 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -153,7 +153,8 @@ documentation::Documentation ProjectionComponent::Documentation() { { keySequenceType, new StringInListVerifier( - { sequenceTypeImage, sequenceTypePlaybook, sequenceTypeHybrid } + { sequenceTypeImage, sequenceTypePlaybook, sequenceTypeHybrid, + sequenceTypeInstrumentTimes } ), Optional::Yes, "This value determines which type of sequencer is used for generating " diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 2c00efaaa3..b30d62e5fe 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -143,7 +143,7 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary) } } - if (_startTime != "" && _endTime != "") { + if (!_startTime.empty() && !_endTime.empty()) { _hasTimeInterval = true; } diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index ab32cbf98c..3aa1d5192a 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -84,6 +84,7 @@ int loadScheduledScript(lua_State* L) { }); } + lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; }