Commit 1f8937f9 authored by Purves, Murray's avatar Purves, Murray
Browse files

WIP error tracking on SpectrumSPEStream.i.hh

parent a4f5bcca
Pipeline #16164 failed with stages
in 7 minutes and 57 seconds
......@@ -292,12 +292,27 @@ void SpectrumSPEStream<data_type>::readData(std::ifstream &stream,
firstChannel = std::stoi(trim_string(parts[0]));
totalEntries = std::stoi(trim_string(parts[1]));
// Read the rest of the entries
radix(" ");
for (int entry = 0; entry < totalEntries; ++entry)
{
std::getline(stream, line);
countsByChannel.push_back(std::stoi(trim_string(line)));
try
{
countsByChannel.push_back(std::stoi(trim_string(line)));
}
catch (...)
{
radix_line(" Error encountered parsing entry "
<< entry << "; line was: " << line);
radix_line(" Setting counts to 0");
countsByChannel.push_back(0);
}
radix_block(if (entry % 1000 == 0) {
radix("|");
} else if (entry % 100 == 0) { radix("."); });
}
radix_line(" Read in " << countsByChannel.size() << " channel entries");
radix_line("\n Read in " << countsByChannel.size() << " channel entries");
}
template <typename data_type>
......
  • @jap the test is for some reason failing to read the spectrum file past a specific line - text editor indicates stuff is there but its not seeing it

  • Check string data for '\0' null character. This can a lot of issues.

Markdown is supported
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