Commit 929ae46a authored by Nick Draper's avatar Nick Draper
Browse files

Correct logic error in the reading of the validity walues

parent 25f7d6b3
......@@ -338,11 +338,11 @@ createTimeSeriesValidityFilter(::NeXus::File &file,
bool invalidDataFound = false;
boolValues.reserve(values.size());
// convert the integer values to boolean with 0=valid data
// convert the integer values to boolean with 0=invalid data
for (size_t i = 0; i < values.size(); i++) {
bool boolValue = (values[i] != 0);
boolValues.emplace_back(boolValue);
if ((boolValue) && (!invalidDataFound)) {
bool isInvalidData = (values[i] == 0);
boolValues.emplace_back(!isInvalidData);
if (isInvalidData && !invalidDataFound) {
invalidDataFound = true;
}
}
......
......@@ -321,7 +321,7 @@ public:
auto pclog2 = dynamic_cast<TimeSeriesProperty<bool> *>(run.getLogData(
LogManager::getInvalidValuesFilterLogName("cryo_temp2")));
std::vector<bool> correct2{true, true, true};
std::vector<bool> correct2{false, false, false};
TS_ASSERT_EQUALS(pclog2->valuesAsVector(), correct2);
// force the filtering by passing in an empty log
......
445c0c8fbafe7856c957359af9736c91
7a4aa8c1ee760eb1a496637ac16ae59e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment