Added unknown Apnea to AHI barchart

This commit is contained in:
Mark Watkins 2011-09-03 12:34:42 +10:00
parent 0822f0cba4
commit f9b58e5ac2
3 changed files with 7 additions and 5 deletions

View File

@ -121,6 +121,7 @@ void gBarChart::paint(gGraph & w,int left, int top, int width, int height)
EventDataType maxy=m_maxy;
EventDataType miny=m_miny;
// make this a reusable function in gGraph
int m;
if (maxy>500) {
m=ceil(maxy/100.0);
@ -200,8 +201,8 @@ void gBarChart::paint(gGraph & w,int left, int top, int width, int height)
if (g!=d.value().end()) {
if (code==EmptyChannel) continue;
//look up it's color key
QColor col=m_colors[j];
QColor col2=Qt::white;
QColor & col=m_colors[j];
static QColor col2=QColor(220,220,220,255);
tmp=g.value(); //(g.value()/float(total));
h=tmp*ymult; //(float(total)*ymult); // height of chunk
@ -222,7 +223,7 @@ void gBarChart::paint(gGraph & w,int left, int top, int width, int height)
}
if (total_days>0) {
float val=total_val/float(total_days);
QString z="AHI="+QString::number(val,'f',2)+" days="+QString::number(total_days,'f',0);
QString z="AHI="+QString::number(val,'f',2)+" days="+QString::number(total_days,'f',0)+" This is going in overview later";
w.renderText(z,left,top-1);
// val = AHI for selected area.

View File

@ -152,14 +152,14 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
int m=(j/60000L) % 60L;
int h=((j/3600000L)-utcoff) % 24L;
int s=(j/1000L) % 60L;
static QString dow[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
int d=(j/86400000) % 7;
if (fitmode==0) {
int d=(j/1000);
QDateTime dt=QDateTime::fromTime_t(d);
tmpstr=dt.toString("MMM dd");
//} else if (fitmode==0) {
// static QString dow[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
// int d=(j/86400000) % 7;
// tmpstr=QString("%1 %2:%3").arg(dow[d]).arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0'));
} else if (fitmode==1) { // minute
tmpstr=QString("%1:%2").arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0'));

View File

@ -108,6 +108,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
bc=new gBarChart();
bc->setProfile(profile);
bc->addSlice(CPAP_Hypopnea,QColor("blue"));
bc->addSlice(CPAP_Apnea,QColor("dark green"));
bc->addSlice(CPAP_Obstructive,QColor("#40c0ff"));
bc->addSlice(CPAP_ClearAirway,QColor("purple"));
BC->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin);