XTicker alignment fix attemp #1

This commit is contained in:
Mark Watkins 2011-09-18 13:47:53 +10:00
parent fb9143ef8f
commit 83de75c3df
3 changed files with 30 additions and 9 deletions

View File

@ -388,6 +388,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
day=m_days[zd];
QString z=dt.toString(Qt::SystemLocaleShortDate);
// Day * day=m_days[hl_day];
//EventDataType val;
@ -399,12 +400,34 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
int m=(t / 60) % 60;
int s=t % 60;
val.sprintf("%02i:%02i",h,m);
} else val=QString::number(d.value()[0],'f',2);
} else
val=QString::number(d.value()[0],'f',2);
z+="\r\n"+m_label+"="+val;
} else {
val=QString::number(d.value()[1],'f',2);
QString a;
for (int i=0;i<m_type.size();i++) {
switch(m_type[i]) {
case ST_WAVG: a="W-avg"; break;
case ST_AVG: a="Avg"; break;
case ST_90P: a="90%"; break;
case ST_MIN: a="Min"; break;
case ST_MAX: a="Max"; break;
case ST_CPH: a=""; break;
case ST_SPH: a="%"; break;
case ST_HOURS: a="Hours"; break;
default:
break;
}
if (day && day->channelExists(m_codes[i])) {
schema::Channel & chan=schema::channel[m_codes[i]];
val=QString::number(d.value()[i+1],'f',2);
z+="\r\n"+chan.label()+" "+a+"="+val;
}
}
}
QString z=dt.toString(Qt::SystemLocaleShortDate)+"\r\n"+m_label+"="+val;//+"\nAHI="+QString::number(day->cph(CPAP_AHI));
graph->ToolTip(z,x,y,2200);
return true;
} else {

View File

@ -168,7 +168,7 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
if (!m_utcfix) j+=tz_offset;
int ms=j % 1000;
int m=(j/60000L) % 60L;
int h=((j/3600000L)-utcoff) % 24L;
int h=(j/3600000L) % 24L;
int s=(j/1000L) % 60L;
static QString dow[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
int d=(j/86400000) % 7;

View File

@ -338,14 +338,12 @@ bool Day::channelExists(ChannelID id)
}
bool Day::channelHasData(ChannelID id)
{
bool r=false;
for (int i=0;i<sessions.size();i++) {
if (sessions[i]->channelExists(id)) {
r=true;
break;
if (!sessions[i]->channelExists(id)) {
return false;
}
}
return r;
return true;
}
void Day::OpenEvents()