More empty overview bug fixes

This commit is contained in:
Mark Watkins 2011-12-05 21:17:28 +10:00
parent 084f63a645
commit 8315057a0a
4 changed files with 35 additions and 37 deletions

View File

@ -2306,7 +2306,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
QMouseEvent e(event->type(),p,event->button(),event->buttons(),event->modifiers());
m_graphs[i]->mouseMoveEvent(&e);
if (x<=titleWidth+(gYAxis::Margin-5)) {
if (!m_button_down && (x<=titleWidth+(gYAxis::Margin-5))) {
//qDebug() << "Hovering over" << m_graphs[i]->title();
if (m_graphsbytitle["Event Flags"]==m_graphs[i]) {
QVector<Layer *> & layers=m_graphs[i]->layers();

View File

@ -54,6 +54,10 @@ void SummaryChart::SetDay(Day * nullday)
EventDataType tmp,tmp2,total;
ChannelID code;
m_goodcodes.resize(m_codes.size());
for (int i=0;i<m_codes.size();i++) {
m_goodcodes[i]=false;
}
m_fday=0;
qint64 tt,zt;
m_empty=true;
@ -70,7 +74,7 @@ void SummaryChart::SetDay(Day * nullday)
bool fnd=false;
if (m_graphtype==GT_SESSIONS) {
for (int i=0;i<m_codes.size();i++)
m_goodcodes[m_codes[i]]=true;
m_goodcodes[i]=true;
for (int i=0;i<d.value().size();i++) { // for each day
day=d.value()[i];
if (!day) continue;
@ -143,7 +147,7 @@ void SummaryChart::SetDay(Day * nullday)
m_values[dn][j+1]=tmp;
if (tmp<m_miny) m_miny=tmp;
if (tmp>m_maxy) m_maxy=tmp;
m_goodcodes[code]=true;
m_goodcodes[j]=true;
fnd=true;
break;
}
@ -157,21 +161,14 @@ void SummaryChart::SetDay(Day * nullday)
if (total<m_miny) m_miny=total;
if (total>m_maxy) m_maxy=total;
}
m_empty=false;
//m_empty=false;
} else m_hours[dn]=0;
}
}
if (m_graphtype!=GT_SESSIONS)
for (int j=0;j<m_codes.size();j++) { // for each code slice
ChannelID code=m_codes[j];
if (!m_goodcodes.contains(code)) {
m_goodcodes[code]=false;
} else {
if (type==ST_HOURS || type==ST_SESSIONS || m_zeros[j]) continue;
//code=="Weight" ||
//code=="BMI" ||
//code=="ZombieMeter") continue; // too many lookups happening here.. stop the crap..
for (QMap<QDate,QVector<Day *> >::iterator d=PROFILE.daylist.begin();d!=PROFILE.daylist.end();d++) {
tt=QDateTime(d.key(),QTime(0,0,0),Qt::UTC).toTime_t();
@ -192,12 +189,10 @@ void SummaryChart::SetDay(Day * nullday)
break;
}
}
//m_empty=false;
}
}
m_empty=true;
for (int i=0;i<m_goodcodes.size();i++) {
if (m_goodcodes[m_codes[i]]) {
if (m_goodcodes[i]) {
m_empty=false;
break;
}
@ -318,6 +313,7 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
} else {
totalvalues[i]=0;
}
if (!m_goodcodes[i]) continue;
// lastvalues[i]=0;
lastX[i]=px;
if (d!=m_values.end()) {
@ -399,6 +395,7 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
short j=g.key();
if (!j) continue;
j--;
if (!m_goodcodes[j]) continue;
tmp=g.value();
@ -474,8 +471,8 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
for (int j=0;j<m_codes.size();j++) {
if (totalcounts[j]==0) continue;
if (!m_goodcodes[j]) continue;
ChannelID code=m_codes[j];
if (!m_goodcodes.contains(code) || !m_goodcodes[code]) continue;
a=schema::channel[code].label();
a+=" ";
switch(m_type[j]) {
@ -652,6 +649,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
} else {
QString a;
for (int i=0;i<m_type.size();i++) {
if (m_goodcodes[i]) continue;
switch(m_type[i]) {
case ST_WAVG: a="W-avg"; break;
case ST_AVG: a="Avg"; break;

View File

@ -33,7 +33,7 @@ class SummaryChart:public Layer
QVector<QColor> m_colors;
QVector<ChannelID> m_codes;
QHash<ChannelID,bool> m_goodcodes;
QVector<bool> m_goodcodes;
QVector<bool> m_zeros;
QVector<SummaryType> m_type;
QHash<int,QHash<short,EventDataType> > m_values;

View File

@ -164,10 +164,10 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
set=new SummaryChart("",GT_LINE);
//set->addSlice("SysOneResistSet",QColor("grey"),ST_SETAVG);
set->addSlice("HumidSet",QColor("blue"),ST_SETWAVG,false);
set->addSlice("FlexSet",QColor("red"),ST_SETWAVG,false);
set->addSlice("EPR",QColor("red"),ST_SETWAVG,false);
set->addSlice("SmartFlex",QColor("red"),ST_SETWAVG,false);
set->addSlice("HumidSet",QColor("blue"),ST_SETWAVG,true);
set->addSlice("FlexSet",QColor("red"),ST_SETWAVG,true);
set->addSlice("EPR",QColor("green"),ST_SETWAVG,true);
set->addSlice("SmartFlex",QColor("purple"),ST_SETWAVG,true);
SET->setRecMinY(0);
SET->setRecMaxY(5);
SET->AddLayer(set);