mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Added unknown Apnea to AHI barchart
This commit is contained in:
parent
0822f0cba4
commit
f9b58e5ac2
@ -121,6 +121,7 @@ void gBarChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
EventDataType maxy=m_maxy;
|
EventDataType maxy=m_maxy;
|
||||||
EventDataType miny=m_miny;
|
EventDataType miny=m_miny;
|
||||||
|
|
||||||
|
// make this a reusable function in gGraph
|
||||||
int m;
|
int m;
|
||||||
if (maxy>500) {
|
if (maxy>500) {
|
||||||
m=ceil(maxy/100.0);
|
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 (g!=d.value().end()) {
|
||||||
if (code==EmptyChannel) continue;
|
if (code==EmptyChannel) continue;
|
||||||
//look up it's color key
|
//look up it's color key
|
||||||
QColor col=m_colors[j];
|
QColor & col=m_colors[j];
|
||||||
QColor col2=Qt::white;
|
static QColor col2=QColor(220,220,220,255);
|
||||||
|
|
||||||
tmp=g.value(); //(g.value()/float(total));
|
tmp=g.value(); //(g.value()/float(total));
|
||||||
h=tmp*ymult; //(float(total)*ymult); // height of chunk
|
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) {
|
if (total_days>0) {
|
||||||
float val=total_val/float(total_days);
|
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);
|
w.renderText(z,left,top-1);
|
||||||
|
|
||||||
// val = AHI for selected area.
|
// val = AHI for selected area.
|
||||||
|
@ -152,14 +152,14 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
|
|||||||
int m=(j/60000L) % 60L;
|
int m=(j/60000L) % 60L;
|
||||||
int h=((j/3600000L)-utcoff) % 24L;
|
int h=((j/3600000L)-utcoff) % 24L;
|
||||||
int s=(j/1000L) % 60L;
|
int s=(j/1000L) % 60L;
|
||||||
|
static QString dow[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
|
||||||
|
int d=(j/86400000) % 7;
|
||||||
|
|
||||||
if (fitmode==0) {
|
if (fitmode==0) {
|
||||||
int d=(j/1000);
|
int d=(j/1000);
|
||||||
QDateTime dt=QDateTime::fromTime_t(d);
|
QDateTime dt=QDateTime::fromTime_t(d);
|
||||||
tmpstr=dt.toString("MMM dd");
|
tmpstr=dt.toString("MMM dd");
|
||||||
//} else if (fitmode==0) {
|
//} 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'));
|
// 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
|
} else if (fitmode==1) { // minute
|
||||||
tmpstr=QString("%1:%2").arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0'));
|
tmpstr=QString("%1:%2").arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0'));
|
||||||
|
@ -108,6 +108,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
|
|||||||
bc=new gBarChart();
|
bc=new gBarChart();
|
||||||
bc->setProfile(profile);
|
bc->setProfile(profile);
|
||||||
bc->addSlice(CPAP_Hypopnea,QColor("blue"));
|
bc->addSlice(CPAP_Hypopnea,QColor("blue"));
|
||||||
|
bc->addSlice(CPAP_Apnea,QColor("dark green"));
|
||||||
bc->addSlice(CPAP_Obstructive,QColor("#40c0ff"));
|
bc->addSlice(CPAP_Obstructive,QColor("#40c0ff"));
|
||||||
bc->addSlice(CPAP_ClearAirway,QColor("purple"));
|
bc->addSlice(CPAP_ClearAirway,QColor("purple"));
|
||||||
BC->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin);
|
BC->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin);
|
||||||
|
Loading…
Reference in New Issue
Block a user