mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Sessions Overview chart should start at 1
This commit is contained in:
parent
e81705d3c4
commit
1d1d9435c1
@ -1050,6 +1050,7 @@ gGraph::gGraph(gGraphView *graphview,QString title,QString units, int height,sho
|
|||||||
m_selecting_area=m_blockzoom=false;
|
m_selecting_area=m_blockzoom=false;
|
||||||
m_lastx23=0;
|
m_lastx23=0;
|
||||||
|
|
||||||
|
|
||||||
m_quad=new gVertexBuffer(64,GL_QUADS);
|
m_quad=new gVertexBuffer(64,GL_QUADS);
|
||||||
m_quad->forceAntiAlias(true);
|
m_quad->forceAntiAlias(true);
|
||||||
f_miny=f_maxy=0;
|
f_miny=f_maxy=0;
|
||||||
@ -1857,49 +1858,67 @@ void gGraph::ToolTip(QString text, int x, int y, int timeout)
|
|||||||
|
|
||||||
void gGraph::roundY(EventDataType &miny, EventDataType &maxy)
|
void gGraph::roundY(EventDataType &miny, EventDataType &maxy)
|
||||||
{
|
{
|
||||||
|
if (title()=="Sessions") {
|
||||||
|
int i=5;
|
||||||
|
}
|
||||||
int m,t;
|
int m,t;
|
||||||
bool ymin_good=false,ymax_good=false;
|
bool ymin_good=false,ymax_good=false;
|
||||||
if (rec_miny!=rec_maxy) {
|
if (rec_miny!=rec_maxy) {
|
||||||
if (miny>rec_miny) miny=rec_miny;
|
if (miny>rec_miny)
|
||||||
if (maxy<rec_maxy) maxy=rec_maxy;
|
miny=rec_miny;
|
||||||
|
if (maxy<rec_maxy)
|
||||||
|
maxy=rec_maxy;
|
||||||
|
|
||||||
if (miny==rec_miny) ymin_good=true;
|
if (miny==rec_miny)
|
||||||
if (maxy==rec_maxy) ymax_good=true;
|
ymin_good=true;
|
||||||
|
if (maxy==rec_maxy)
|
||||||
|
ymax_good=true;
|
||||||
}
|
}
|
||||||
if (maxy==miny) {
|
if (maxy==miny) {
|
||||||
m=ceil(maxy/2.0);
|
m=ceil(maxy/2.0);
|
||||||
t=m*2;
|
t=m*2;
|
||||||
if (maxy==t) t+=2;
|
if (maxy==t)
|
||||||
if (!ymax_good) maxy=t;
|
t+=2;
|
||||||
|
if (!ymax_good)
|
||||||
|
maxy=t;
|
||||||
|
|
||||||
m=floor(miny/2.0);
|
m=floor(miny/2.0);
|
||||||
t=m*2;
|
t=m*2;
|
||||||
if (miny==t) t-=2;
|
if (miny==t)
|
||||||
if (miny>=0 && t<0) t=0;
|
t-=2;
|
||||||
if (!ymin_good) miny=t;
|
if (miny>=0 && t<0)
|
||||||
|
t=0;
|
||||||
|
if (!ymin_good)
|
||||||
|
miny=t;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxy>=400) {
|
if (maxy>=400) {
|
||||||
m=ceil(maxy/50.0);
|
m=ceil(maxy/50.0);
|
||||||
t=m*50;
|
t=m*50;
|
||||||
if (!ymax_good) maxy=t;
|
if (!ymax_good)
|
||||||
|
maxy=t;
|
||||||
m=floor(miny/50.0);
|
m=floor(miny/50.0);
|
||||||
if (!ymin_good) miny=m*50;
|
if (!ymin_good)
|
||||||
|
miny=m*50;
|
||||||
} else if (maxy>=5) {
|
} else if (maxy>=5) {
|
||||||
m=ceil(maxy/5.0);
|
m=ceil(maxy/5.0);
|
||||||
t=m*5;
|
t=m*5;
|
||||||
if (!ymax_good) maxy=t;
|
if (!ymax_good)
|
||||||
|
maxy=t;
|
||||||
m=floor(miny/5.0);
|
m=floor(miny/5.0);
|
||||||
if (!ymin_good) miny=m*5;
|
if (!ymin_good)
|
||||||
|
miny=m*5;
|
||||||
} else {
|
} else {
|
||||||
if (maxy==miny && maxy==0) {
|
if (maxy==miny && maxy==0) {
|
||||||
maxy=0.5;
|
maxy=0.5;
|
||||||
} else {
|
} else {
|
||||||
//maxy*=4.0;
|
//maxy*=4.0;
|
||||||
//miny*=4.0;
|
//miny*=4.0;
|
||||||
if (!ymax_good) maxy=ceil(maxy);
|
if (!ymax_good)
|
||||||
if (!ymin_good) miny=floor(miny);
|
maxy=ceil(maxy);
|
||||||
|
if (!ymin_good)
|
||||||
|
miny=floor(miny);
|
||||||
//maxy/=4.0;
|
//maxy/=4.0;
|
||||||
//miny/=4.0;
|
//miny/=4.0;
|
||||||
}
|
}
|
||||||
|
@ -188,8 +188,6 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
set->addSlice(CPAP_PresReliefSet,QColor("red"),ST_SETWAVG);
|
set->addSlice(CPAP_PresReliefSet,QColor("red"),ST_SETWAVG);
|
||||||
//set->addSlice(RMS9_EPRSet,QColor("green"),ST_SETWAVG);
|
//set->addSlice(RMS9_EPRSet,QColor("green"),ST_SETWAVG);
|
||||||
//set->addSlice(INTP_SmartFlex,QColor("purple"),ST_SETWAVG);
|
//set->addSlice(INTP_SmartFlex,QColor("purple"),ST_SETWAVG);
|
||||||
SET->setRecMinY(0);
|
|
||||||
SET->setRecMaxY(5);
|
|
||||||
SET->AddLayer(set);
|
SET->AddLayer(set);
|
||||||
|
|
||||||
rr=new SummaryChart(tr("breaths/min"),GT_LINE);
|
rr=new SummaryChart(tr("breaths/min"),GT_LINE);
|
||||||
@ -268,6 +266,10 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
ui->rangeCombo->setCurrentIndex(6);
|
ui->rangeCombo->setCurrentIndex(6);
|
||||||
icon_on=new QIcon(":/icons/session-on.png");
|
icon_on=new QIcon(":/icons/session-on.png");
|
||||||
icon_off=new QIcon(":/icons/session-off.png");
|
icon_off=new QIcon(":/icons/session-off.png");
|
||||||
|
SES->setRecMinY(1);
|
||||||
|
SET->setRecMinY(0);
|
||||||
|
SET->setRecMaxY(5);
|
||||||
|
|
||||||
}
|
}
|
||||||
Overview::~Overview()
|
Overview::~Overview()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user