From 26f6e15a7568b02cf1d8a385b4033df87ce8718b Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Mon, 3 Jun 2019 20:56:40 -0400 Subject: [PATCH] Add YAML output for session slices. --- oscar/tests/sessiontests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/oscar/tests/sessiontests.cpp b/oscar/tests/sessiontests.cpp index cf9539a8..79e46f4b 100644 --- a/oscar/tests/sessiontests.cpp +++ b/oscar/tests/sessiontests.cpp @@ -182,6 +182,21 @@ void SessionToYaml(QString filepath, Session* session) out << " start: " << ts(session->first()) << endl; out << " end: " << ts(session->last()) << endl; + if (!session->m_slices.isEmpty()) { + out << " slices:" << endl; + for (auto & slice : session->m_slices) { + QString s; + switch (slice.status) { + case MaskOn: s = "mask on"; break; + case MaskOff: s = "mask off"; break; + case EquipmentOff: s = "equipment off"; break; + default: s = "unknown"; break; + } + out << " - status: " << s << endl; + out << " start: " << ts(slice.start) << endl; + out << " end: " << ts(slice.end) << endl; + } + } Day day; day.addSession(session); out << " total_time: " << dur(day.total_time()) << endl;