Stop SummaryCharts getting screwed up by Journal objects, etc..

This commit is contained in:
Mark Watkins 2011-10-02 15:06:58 +10:00
parent 591b73e7f3
commit 8778349e18
3 changed files with 6 additions and 1 deletions

View File

@ -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;i<d.value().size();i++) {
day=d.value()[i];
if (day->machine_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]) {

View File

@ -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);

View File

@ -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]; }