1
0
mirror of https://gitlab.com/pholy/OSCAR-code.git synced 2025-04-08 12:10:43 +00:00

Always create CSR event list

This commit is contained in:
Phil Olynyk 2022-02-17 20:59:16 -05:00
parent d38d2c8404
commit 51e0a7b06d

View File

@ -2812,7 +2812,8 @@ bool ResmedLoader::LoadCSL(Session *sess, const QString & path)
time.start();
#endif
EventList *CSR = nullptr;
// Always create CSR event list so that overview always finds something
EventList *CSR = sess->AddEventList(CPAP_CSR, EVL_Event);
// Allow for empty sessions..
qint64 csr_starts = 0;
@ -2830,9 +2831,9 @@ bool ResmedLoader::LoadCSL(Session *sess, const QString & path)
if (anno->text == "CSR Start") {
csr_starts = tt;
} else if (anno->text == "CSR End") {
if ( ! CSR) {
CSR = sess->AddEventList(CPAP_CSR, EVL_Event);
}
// if ( ! CSR) {
// CSR = sess->AddEventList(CPAP_CSR, EVL_Event);
// }
if (csr_starts > 0) {
if (sess->checkInside(csr_starts)) {
CSR->AddEvent(tt, double(tt - csr_starts) / 1000.0);