mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Fix gcc compile error introduced by a4296b5e
.
Also make it easier to test OSCAR calculations performed after import.
This commit is contained in:
parent
d631a77b5b
commit
2281209a20
@ -1254,8 +1254,7 @@ protected:
|
||||
}
|
||||
EventDataType findValueAtOrBefore(qint64 time)
|
||||
{
|
||||
// curTime is always <= time, due to eventlist first/last search and m_curEvent reset.
|
||||
qint64 curTime = m_curEventList->time(m_curEvent);
|
||||
// m_curEvent is always <= time, due to eventlist first/last search and m_curEvent reset.
|
||||
for (quint32 i = m_curEvent + 1; i < m_curEventList->count(); i++) {
|
||||
qint64 nextTime = m_curEventList->time(i);
|
||||
if (nextTime > time) {
|
||||
@ -1264,7 +1263,6 @@ protected:
|
||||
}
|
||||
// else nextTime <= time, advance
|
||||
m_curEvent = i;
|
||||
curTime = nextTime;
|
||||
}
|
||||
EventDataType result = m_curEventList->data(m_curEvent);
|
||||
return result;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "../SleepLib/importcontext.h"
|
||||
|
||||
#define TESTDATA_PATH "./testdata/"
|
||||
//#define TEST_OSCAR_CALCS
|
||||
|
||||
static PRS1Loader* s_loader = nullptr;
|
||||
static void iterateTestCards(const QString & root, void (*action)(const QString &));
|
||||
@ -24,6 +25,12 @@ void PRS1Tests::initTestCase(void)
|
||||
{
|
||||
p_profile = new Profile(TESTDATA_PATH "profile/", false);
|
||||
|
||||
#ifdef TEST_OSCAR_CALCS
|
||||
p_pref = new Preferences("Preferences");
|
||||
p_pref->Open();
|
||||
AppSetting = new AppWideSetting(p_pref);
|
||||
#endif
|
||||
|
||||
schema::init();
|
||||
PRS1Loader::Register();
|
||||
s_loader = dynamic_cast<PRS1Loader*>(lookupLoader(prs1_class_name));
|
||||
@ -33,6 +40,9 @@ void PRS1Tests::cleanupTestCase(void)
|
||||
{
|
||||
delete p_profile;
|
||||
p_profile = nullptr;
|
||||
#ifdef TEST_OSCAR_CALCS
|
||||
delete p_pref;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +127,10 @@ void parseAndEmitSessionYaml(const QString & path)
|
||||
// Emit the parsed session data to compare against our regression benchmarks
|
||||
Session* session = import->session;
|
||||
QString outpath = prs1OutputPath(path, m->serial(), session->session(), "-session.yml");
|
||||
#ifdef TEST_OSCAR_CALCS
|
||||
session->s_events_loaded = true;
|
||||
session->UpdateSummaries();
|
||||
#endif
|
||||
SessionToYaml(outpath, session, ok);
|
||||
|
||||
delete session;
|
||||
|
@ -196,6 +196,8 @@ static QString eventChannel(ChannelID i)
|
||||
CHANNELNAME(CPAP_FLG);
|
||||
CHANNELNAME(CPAP_AHI);
|
||||
CHANNELNAME(CPAP_TgMV);
|
||||
// Calculated channels
|
||||
CHANNELNAME(CPAP_RDI);
|
||||
s = hex(i);
|
||||
qDebug() << "event channel" << qPrintable(s);
|
||||
} while(false);
|
||||
|
Loading…
Reference in New Issue
Block a user