Fixed Overview pressure for CPAP mode, and fixed Graph Visiblity Combo

This commit is contained in:
Mark Watkins 2012-01-03 22:03:37 +10:00
parent 30f060c2dc
commit ad04a37791
2 changed files with 11 additions and 9 deletions

View File

@ -55,15 +55,15 @@ void SummaryChart::SetDay(Day * nullday)
int dn; int dn;
EventDataType tmp,tmp2,total; EventDataType tmp,tmp2,total;
ChannelID code; ChannelID code;
CPAPMode cpapmode=(CPAPMode)(int)PROFILE.calcSettingsMax(CPAP_Mode,MT_CPAP,PROFILE.FirstDay(MT_CPAP),PROFILE.LastDay(MT_CPAP));
if (m_label==STR_TR_Pressure) { if (m_label==STR_TR_Pressure) {
CPAPMode mode=(CPAPMode)(int)PROFILE.calcSettingsMax(CPAP_Mode,MT_CPAP,PROFILE.FirstDay(MT_CPAP),PROFILE.LastDay(MT_CPAP));
m_codes.clear(); m_codes.clear();
m_colors.clear(); m_colors.clear();
m_type.clear(); m_type.clear();
//m_zeros.clear(); //m_zeros.clear();
m_typeval.clear(); m_typeval.clear();
if (mode>=MODE_ASV) { if (cpapmode>=MODE_ASV) {
addSlice(CPAP_EPAP,QColor("green"),ST_SETMIN); addSlice(CPAP_EPAP,QColor("green"),ST_SETMIN);
addSlice(CPAP_IPAPLo,QColor("light blue"),ST_SETMIN); addSlice(CPAP_IPAPLo,QColor("light blue"),ST_SETMIN);
@ -71,13 +71,13 @@ void SummaryChart::SetDay(Day * nullday)
addSlice(CPAP_IPAP,QColor("dark cyan"),ST_PERC,0.95); addSlice(CPAP_IPAP,QColor("dark cyan"),ST_PERC,0.95);
//addSlice(CPAP_IPAP,QColor("light blue"),ST_PERC,0.95); //addSlice(CPAP_IPAP,QColor("light blue"),ST_PERC,0.95);
addSlice(CPAP_IPAPHi,QColor("blue"),ST_SETMAX); addSlice(CPAP_IPAPHi,QColor("blue"),ST_SETMAX);
} else if (mode>=MODE_BIPAP) { } else if (cpapmode>=MODE_BIPAP) {
addSlice(CPAP_EPAP,QColor("green"),ST_SETMIN); addSlice(CPAP_EPAP,QColor("green"),ST_SETMIN);
addSlice(CPAP_EPAP,QColor("light green"),ST_PERC,0.95); addSlice(CPAP_EPAP,QColor("light green"),ST_PERC,0.95);
addSlice(CPAP_IPAP,QColor("light cyan"),ST_PERC,0.5); addSlice(CPAP_IPAP,QColor("light cyan"),ST_PERC,0.5);
addSlice(CPAP_IPAP,QColor("light blue"),ST_PERC,0.95); addSlice(CPAP_IPAP,QColor("light blue"),ST_PERC,0.95);
addSlice(CPAP_IPAP,QColor("blue"),ST_SETMAX); addSlice(CPAP_IPAP,QColor("blue"),ST_SETMAX);
} else if (mode>=MODE_APAP) { } else if (cpapmode>=MODE_APAP) {
addSlice(CPAP_PressureMin,QColor("orange"),ST_SETMIN); addSlice(CPAP_PressureMin,QColor("orange"),ST_SETMIN);
addSlice(CPAP_Pressure,QColor("dark green"),ST_PERC,0.5); addSlice(CPAP_Pressure,QColor("dark green"),ST_PERC,0.5);
addSlice(CPAP_Pressure,QColor("grey"),ST_PERC,0.95); addSlice(CPAP_Pressure,QColor("grey"),ST_PERC,0.95);
@ -180,13 +180,12 @@ void SummaryChart::SetDay(Day * nullday)
day->hasData(code,type); day->hasData(code,type);
if (code==CPAP_Pressure) { if (code==CPAP_Pressure) {
if (mode==MODE_CPAP) { if ((cpapmode>MODE_CPAP) && (mode==MODE_CPAP)) {
hascode=false; hascode=false;
if ((type==ST_PERC) && (m_typeval[j]==0.5)) { if ((type==ST_PERC) && (m_typeval[j]==0.5)) {
type=ST_SETWAVG; type=ST_SETWAVG;
hascode=true; hascode=true;
} }
} else { } else {
type=m_type[j]; type=m_type[j];
} }

View File

@ -312,8 +312,8 @@ void Overview::updateGraphCombo()
gGraph *g; gGraph *g;
for (int i=0;i<GraphView->size();i++) { for (int i=0;i<GraphView->size();i++) {
g=(*GraphView)[i]; g=(*GraphView)[i];
if (g->isEmpty()) if (g->isEmpty()) continue;
continue;
if (g->visible()) { if (g->visible()) {
ui->graphCombo->addItem(*icon_on,g->title(),true); ui->graphCombo->addItem(*icon_on,g->title(),true);
} else { } else {
@ -501,6 +501,9 @@ void Overview::on_graphCombo_activated(int index)
} else { } else {
ui->graphCombo->setItemIcon(index,*icon_off); ui->graphCombo->setItemIcon(index,*icon_off);
} }
(*GraphView)[index]->setVisible(b); QString s=ui->graphCombo->currentText();
gGraph *g=GraphView->findGraph(s);
g->setVisible(b);
GraphView->updateScale();
GraphView->redraw(); GraphView->redraw();
} }