diff --git a/Graphs/gSummaryChart.cpp b/Graphs/gSummaryChart.cpp index 9429dd15..9a348872 100644 --- a/Graphs/gSummaryChart.cpp +++ b/Graphs/gSummaryChart.cpp @@ -22,6 +22,7 @@ SummaryChart::SummaryChart(Profile *p,QString label,GraphType type) lines->forceAntiAlias(false); m_empty=true; hl_day=-1; + m_machinetype=MT_CPAP; } SummaryChart::~SummaryChart() { @@ -69,6 +70,7 @@ void SummaryChart::SetDay(Day * nullday) type=m_type[j]; for (int i=0;imachine_type()!=m_machinetype) continue; if (type==ST_HOURS || day->channelExists(code) || day->settingExists(code)) { // too many lookups happening here.. stop the crap.. m_days[dn]=day; switch(m_type[j]) { diff --git a/Graphs/gSummaryChart.h b/Graphs/gSummaryChart.h index 21277bcd..fc5b4fcf 100644 --- a/Graphs/gSummaryChart.h +++ b/Graphs/gSummaryChart.h @@ -25,6 +25,8 @@ class SummaryChart:public Layer virtual bool isEmpty() { return m_empty; } void addSlice(ChannelID code, QColor color, SummaryType type) { m_codes.push_back(code); m_colors.push_back(color); m_type.push_back(type); } void deselect() { hl_day=-1; } + void setMachineType(MachineType type) { m_machinetype=type; } + MachineType machineType() { return m_machinetype; } protected: Qt::Orientation m_orientation; @@ -49,6 +51,7 @@ class SummaryChart:public Layer int hl_day; gGraph * graph; GraphType m_graphtype; + MachineType m_machinetype; virtual bool mouseMoveEvent(QMouseEvent * event); virtual bool mousePressEvent(QMouseEvent * event); virtual bool mouseReleaseEvent(QMouseEvent * event); diff --git a/SleepLib/day.h b/SleepLib/day.h index 617535cc..e2349e8b 100644 --- a/SleepLib/day.h +++ b/SleepLib/day.h @@ -55,7 +55,7 @@ public: qint64 total_time(); // in milliseconds - EventDataType hours() { return EventDataType(double(total_time())/3600000.0); } + EventDataType hours() { return double(total_time())/3600000.0; } Session *operator [](int i) { return sessions[i]; }