Skip to content

Commit 53aec93

Browse files
committed
--minor
1 parent 09278a7 commit 53aec93

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

src/esp/metadata/diagnostics/DatasetDiagnosticsTool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ bool DatasetDiagnosticsTool::setDiagnosticesFromJSON(
4646
ESP_ERROR(Mn::Debug::Flag::NoSpace)
4747
<< msgStr
4848
<< " configuration specifies `request_diagnostics` but specification "
49-
"is unable to be parsed, so diagnostics request is ignored.";
49+
"is unable to be parsed as either a string or an array, so "
50+
"diagnostics request is ignored.";
5051
return false;
5152
} // DatasetDiagnosticsTool::setDiagnosticesFromJSON
5253

src/esp/metadata/diagnostics/DatasetDiagnosticsTool.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,36 @@ class DatasetDiagnosticsTool {
208208
/**
209209
* @brief Set that a save is required. This is to bridge from reading the json
210210
* file into the attributes and registering the attributes to the
211-
* post-registration code.
211+
* post-registration code. True means we corrected dataset components due to
212+
* diagnostic activities and we wish to save those corrected components.
212213
*/
213214
void setSaveRequired(bool saveRequired) {
214215
_requiresCorrectedSave = saveRequired;
215216
}
216217

217218
/**
218-
* @brief Clear any flags set due to specific diagnostics
219+
* @brief Reset the current state of the Diagnostics tool.
220+
*/
221+
void reset() {
222+
clearSaveRequired();
223+
clearDiagnosticFlags();
224+
}
225+
226+
/**
227+
* @brief Clear save flag set due to specific diagnostic conditions
219228
*/
220229
void clearSaveRequired() { _requiresCorrectedSave = false; }
221230

231+
/**
232+
* @brief Clear all existing diagnostic flag settings.
233+
*/
234+
void clearDiagnosticFlags() { _diagnosticsFlags = 0u; }
235+
222236
/**
223237
* @brief Get whether a save is required. This is to bridge from reading the
224238
* json file into the attributes and registering the attributes to the
225-
* post-registration code.
239+
* post-registration code. True means we corrected dataset components due to
240+
* diagnostic activities and we wish to save those corrected components.
226241
*/
227242
bool saveRequired() const { return _requiresCorrectedSave; }
228243

src/esp/metadata/managers/AbstractAttributesManager.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class AbstractAttributesManager : public ManagedFileBasedContainer<T, Access> {
192192
void setValsFromJSONDoc(AttribsPtr attribs,
193193
const io::JsonGenericValue& jsonConfig) {
194194
// Clear diagnostic flags from previous run
195-
this->datasetDiagnostics_->clearSaveRequired();
195+
this->datasetDiagnostics_->reset();
196196
this->setValsFromJSONDocInternal(attribs, jsonConfig);
197197
if (this->datasetDiagnostics_->saveRequired()) {
198198
ESP_WARNING(Mn::Debug::Flag::NoSpace)
@@ -208,18 +208,19 @@ class AbstractAttributesManager : public ManagedFileBasedContainer<T, Access> {
208208
* @brief Configure @ref datasetDiagnostics_ tool based on if passsed jsonConfig
209209
* requests them.
210210
*/
211-
bool setDSDiagnostics(AttribsPtr attribs,
212-
const io::JsonGenericValue& jsonConfig) {
211+
bool setDSDiagnosticsFromJSON(AttribsPtr attribs,
212+
const io::JsonGenericValue& jsonConfig) {
213213
io::JsonGenericValue::ConstMemberIterator jsonIter =
214214
jsonConfig.FindMember("request_diagnostics");
215215
if (jsonIter == jsonConfig.MemberEnd()) {
216216
return false;
217217
}
218218
return this->datasetDiagnostics_->setDiagnosticesFromJSON(
219-
jsonIter->value, Cr::Utility::formatString(
220-
"(setDSDiagnostics) <{}> : {}", this->objectType_,
221-
attribs->getSimplifiedHandle()));
222-
} // setDSDiagnostics
219+
jsonIter->value,
220+
Cr::Utility::formatString("(setDSDiagnosticsFromJSON) <{}> : {}",
221+
this->objectType_,
222+
attribs->getSimplifiedHandle()));
223+
} // setDSDiagnosticsFromJSON
223224

224225
/**
225226
* @brief Merge the passed DatasetDiagnosticsTool settings into

src/esp/metadata/managers/SceneDatasetAttributesManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void SceneDatasetAttributesManager::setValsFromJSONDocInternal(
7070
attributes::SceneDatasetAttributes::ptr dsAttribs,
7171
const io::JsonGenericValue& jsonConfig) {
7272
// check for diagnostics requests
73-
bool dsSet = this->setDSDiagnostics(dsAttribs, jsonConfig);
73+
bool dsSet = this->setDSDiagnosticsFromJSON(dsAttribs, jsonConfig);
7474
ESP_VERY_VERBOSE(Mn::Debug::Flag::NoSpace)
7575
<< "Attempt to set dataset diagnostics was a "
7676
<< (dsSet ? "Success" : "Failure");

0 commit comments

Comments
 (0)