ResMed Start & End time calculations fix

This commit is contained in:
Mark Watkins 2011-07-02 18:37:24 +10:00
parent 28b6171f60
commit 40bb6f32af
2 changed files with 13 additions and 17 deletions

View File

@ -673,14 +673,6 @@ void gGraphWindow::resizeGL(int w, int h)
void gGraphWindow::Render(float w, float h)
{
/*glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, 0, height, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();*/
if (m_gradient_background) {
glBegin(GL_QUADS);
glColor4f(1.0,1.0,1.0,.5); // Gradient start
@ -692,10 +684,8 @@ void gGraphWindow::Render(float w, float h)
glVertex2f(w, h);
glEnd();
} else {
glClearColor(255,255,255,0);
glClear(GL_COLOR_BUFFER_BIT ); //| GL_DEPTH_BUFFER_BIT
// glClear(GL_COLOR_BUFFER_BIT);
}
@ -718,9 +708,9 @@ void gGraphWindow::paintGL()
if (m_mouseLDown) {
if (m_mouseRBrect.width()>0)
glDisable(GL_DEPTH_TEST);
//glDisable(GL_DEPTH_TEST);
RoundedRectangle(m_mouseRBrect.x(),m_mouseRBrect.y(),m_mouseRBrect.width(),m_mouseRBrect.height(),5,QColor(50,50,50,128));
glEnable(GL_DEPTH_TEST);
//glEnable(GL_DEPTH_TEST);
}
glEnable(GL_DEPTH_TEST);

View File

@ -359,6 +359,12 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf)
recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords()*2;
totaldur=edf.GetNumDataRecords()*edf.GetDuration();
totaldur/=3600.0;
if (!sess->first().isValid()) {
sess->set_first(edf.startdate);
sess->set_last(edf.startdate.addMSecs(totaldur*1000.0));
sess->set_hours(totaldur/3600.0);
}
//t.sprintf("EVE: %li %.2f",recs,totaldur);
//qDebug() << edf.edfsignals[s]->label << " " << t;
data=(char *)edf.edfsignals[s]->data;
@ -456,11 +462,11 @@ bool ResmedLoader::LoadBRP(Session *sess,EDFParser &edf)
qDebug() << "Unknown Signal " << edf.edfsignals[s]->label;
continue;
}
sess->set_first(edf.startdate);
QDateTime e=edf.startdate.addSecs(duration);
sess->set_last(e);
//duration/=3600.0;
sess->set_hours(duration/3600.0);
if (!sess->first().isValid()) {
sess->set_first(edf.startdate);
sess->set_last(edf.startdate.addMSecs(duration*1000.0));
sess->set_hours(duration/3600.0);
}
Waveform *w=new Waveform(edf.startdate,code,edf.edfsignals[s]->data,recs,duration,edf.edfsignals[s]->digital_minimum,edf.edfsignals[s]->digital_maximum);
edf.edfsignals[s]->data=NULL; // so it doesn't get deleted when edf gets trashed.
sess->AddWaveform(w);