mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Mark any PRS1 sessions with empty slices as summary and skip event or waveform data.
If there are no mask-on slices of nonzero duration, then there's not any meaningful event or waveform data for the session. There is occasionally some fragmentary data, but it's always less than 1 second. When such fragmentary waveform data is present, it only contains 1-3 nonzero samples, corresponding to 0.2s - 0.6s of data, which suggests that the mask-on slice was really that long rather than precisely 0. As a result, it appears that the timestamps of the mask-on/mask-off slices are just the current value of the machine's internal clock, which only has 1-second resolution. But rather than embark on herculean efforts to derive a sub-second slice duration from (only occasionally present) event or waveform data, we just treat the session as having no detailed data.
This commit is contained in:
parent
959cc3ef92
commit
06adbc1e72
@ -7221,12 +7221,6 @@ bool PRS1Import::ParseSession(void)
|
||||
break;
|
||||
}
|
||||
|
||||
// If there's nothing beyond the compliance or summary (no event or waveform data), mark this session as
|
||||
// a summary.
|
||||
if (m_event_chunks.count() == 0 && m_wavefiles.isEmpty() && oxifile.isEmpty()) {
|
||||
session->setSummaryOnly(true);
|
||||
}
|
||||
|
||||
// Import the slices into the session
|
||||
for (auto & slice : m_slices) {
|
||||
// Filter out 0-length slices, since they cause problems for Day::total_time().
|
||||
@ -7241,6 +7235,14 @@ bool PRS1Import::ParseSession(void)
|
||||
}
|
||||
}
|
||||
|
||||
// If are no mask-on slices, then there's not any meaningful event or waveform data for the session.
|
||||
// If there's no no event or waveform data, mark this session as a summary.
|
||||
if (session->m_slices.count() == 0 || (m_event_chunks.count() == 0 && m_wavefiles.isEmpty() && oxifile.isEmpty())) {
|
||||
session->setSummaryOnly(true);
|
||||
save = true;
|
||||
break; // and skip the occasional fragmentary event or waveform data
|
||||
}
|
||||
|
||||
// TODO: There should be a way to distinguish between no-data-to-import vs. parsing errors
|
||||
// (once we figure out what's benign and what isn't).
|
||||
if (m_event_chunks.count() > 0) {
|
||||
|
@ -195,10 +195,14 @@ void SessionToYaml(QString filepath, Session* session, bool ok)
|
||||
out << " end: " << ts(slice.end) << endl;
|
||||
}
|
||||
}
|
||||
qint64 total_time = 0;
|
||||
if (session->first() != 0) {
|
||||
Day day;
|
||||
day.addSession(session);
|
||||
out << " total_time: " << dur(day.total_time()) << endl;
|
||||
total_time = day.total_time();
|
||||
day.removeSession(session);
|
||||
}
|
||||
out << " total_time: " << dur(total_time) << endl;
|
||||
|
||||
out << " settings:" << endl;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user