diff --git a/daily.cpp b/daily.cpp index ac1833fb..3156e349 100644 --- a/daily.cpp +++ b/daily.cpp @@ -191,7 +191,8 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw) SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,true))); PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy,Qt::darkBlue,false))); - SPO2->forceMinY(60); + SPO2->forceMaxY(100); + SPO2->forceMinY(70); PULSE->forceMinY(40); for (int i=0;iAddLayer(new gYAxis(),LayerLeft,gYAxis::Margin); @@ -608,21 +609,25 @@ void Daily::Load(QDate date) html+="SessionIDDateStartEnd"; QDateTime fd,ld; bool corrupted_waveform=false; - for (QVector::iterator s=cpap->begin();s!=cpap->end();s++) { - fd=QDateTime::fromTime_t((*s)->first()/1000L); - ld=QDateTime::fromTime_t((*s)->last()/1000L); - QHash::iterator i=(*s)->settings.find("BrokenWaveform"); - if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true; - tmp.sprintf(("%08i"+fd.date().toString(Qt::SystemLocaleShortDate)+""+fd.toString("HH:mm ")+""+ld.toString("HH:mm")+"").toLatin1(),(*s)->session()); - html+=tmp; + if (cpap) { + for (QVector::iterator s=cpap->begin();s!=cpap->end();s++) { + fd=QDateTime::fromTime_t((*s)->first()/1000L); + ld=QDateTime::fromTime_t((*s)->last()/1000L); + QHash::iterator i=(*s)->settings.find("BrokenWaveform"); + if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true; + tmp.sprintf(("%08i"+fd.date().toString(Qt::SystemLocaleShortDate)+""+fd.toString("HH:mm ")+""+ld.toString("HH:mm")+"").toLatin1(),(*s)->session()); + html+=tmp; + } } - for (QVector::iterator s=oxi->begin();s!=oxi->end();s++) { - fd=QDateTime::fromTime_t((*s)->first()/1000L); - ld=QDateTime::fromTime_t((*s)->last()/1000L); - QHash::iterator i=(*s)->settings.find("BrokenWaveform"); - if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true; - tmp.sprintf(("%08i"+fd.date().toString(Qt::SystemLocaleShortDate)+""+fd.toString("HH:mm ")+""+ld.toString("HH:mm")+"").toLatin1(),(*s)->session()); - html+=tmp; + if (oxi) { + for (QVector::iterator s=oxi->begin();s!=oxi->end();s++) { + fd=QDateTime::fromTime_t((*s)->first()/1000L); + ld=QDateTime::fromTime_t((*s)->last()/1000L); + QHash::iterator i=(*s)->settings.find("BrokenWaveform"); + if ((i!=(*s)->settings.end()) && i.value().toBool()) corrupted_waveform=true; + tmp.sprintf(("%08i"+fd.date().toString(Qt::SystemLocaleShortDate)+""+fd.toString("HH:mm ")+""+ld.toString("HH:mm")+"").toLatin1(),(*s)->session()); + html+=tmp; + } } html+=""; if (corrupted_waveform) { diff --git a/oximetry.cpp b/oximetry.cpp index f6167490..23ef89cf 100644 --- a/oximetry.cpp +++ b/oximetry.cpp @@ -182,7 +182,7 @@ void Oximetry::on_RunButton_toggled(bool checked) ev_spo2->getTime().clear(); ev_spo2->setCount(0); - lasttime=qint64(QDateTime::currentDateTime().toTime_t())*1000L; // utc?? + lasttime=QDateTime::currentDateTime().toTime_t()*1000L; // utc?? starttime=lasttime; session->SetSessionID(lasttime/1000L); diff --git a/oximetry.h b/oximetry.h index b99cf0b4..77c95c28 100644 --- a/oximetry.h +++ b/oximetry.h @@ -66,7 +66,7 @@ private: QextSerialPort *port; QString portname; PORTMODE portmode; - qint64 lasttime,starttime; + double lasttime,starttime; int lastpulse, lastspo2; Machine * mach;