mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-19 04:00:45 +00:00
ResMed Start & End time calculations fix
This commit is contained in:
parent
28b6171f60
commit
40bb6f32af
@ -673,14 +673,6 @@ void gGraphWindow::resizeGL(int w, int h)
|
|||||||
|
|
||||||
void gGraphWindow::Render(float w, float 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) {
|
if (m_gradient_background) {
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glColor4f(1.0,1.0,1.0,.5); // Gradient start
|
glColor4f(1.0,1.0,1.0,.5); // Gradient start
|
||||||
@ -692,10 +684,8 @@ void gGraphWindow::Render(float w, float h)
|
|||||||
glVertex2f(w, h);
|
glVertex2f(w, h);
|
||||||
glEnd();
|
glEnd();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
glClearColor(255,255,255,0);
|
glClearColor(255,255,255,0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT ); //| GL_DEPTH_BUFFER_BIT
|
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_mouseLDown) {
|
||||||
if (m_mouseRBrect.width()>0)
|
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));
|
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);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
@ -359,6 +359,12 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf)
|
|||||||
recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords()*2;
|
recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords()*2;
|
||||||
totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
||||||
totaldur/=3600.0;
|
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);
|
//t.sprintf("EVE: %li %.2f",recs,totaldur);
|
||||||
//qDebug() << edf.edfsignals[s]->label << " " << t;
|
//qDebug() << edf.edfsignals[s]->label << " " << t;
|
||||||
data=(char *)edf.edfsignals[s]->data;
|
data=(char *)edf.edfsignals[s]->data;
|
||||||
@ -456,11 +462,11 @@ bool ResmedLoader::LoadBRP(Session *sess,EDFParser &edf)
|
|||||||
qDebug() << "Unknown Signal " << edf.edfsignals[s]->label;
|
qDebug() << "Unknown Signal " << edf.edfsignals[s]->label;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!sess->first().isValid()) {
|
||||||
sess->set_first(edf.startdate);
|
sess->set_first(edf.startdate);
|
||||||
QDateTime e=edf.startdate.addSecs(duration);
|
sess->set_last(edf.startdate.addMSecs(duration*1000.0));
|
||||||
sess->set_last(e);
|
|
||||||
//duration/=3600.0;
|
|
||||||
sess->set_hours(duration/3600.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);
|
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.
|
edf.edfsignals[s]->data=NULL; // so it doesn't get deleted when edf gets trashed.
|
||||||
sess->AddWaveform(w);
|
sess->AddWaveform(w);
|
||||||
|
Loading…
Reference in New Issue
Block a user