A more boring ResMed pressure graph

This commit is contained in:
Mark Watkins 2011-07-01 12:52:02 +10:00
parent 9ad2bd1850
commit 81936d63ad
3 changed files with 15 additions and 9 deletions

View File

@ -488,6 +488,7 @@ void ResmedLoader::ToTimeDelta(Machine *mach,Session *sess,EDFParser &edf, qint1
last=c; last=c;
} }
sess->AddEvent(new Event(tt,code,&c,1)); // add one at the end..
} }
bool ResmedLoader::LoadSAD(Machine *mach,Session *sess,EDFParser &edf) bool ResmedLoader::LoadSAD(Machine *mach,Session *sess,EDFParser &edf)
{ {
@ -497,6 +498,11 @@ bool ResmedLoader::LoadSAD(Machine *mach,Session *sess,EDFParser &edf)
bool ResmedLoader::LoadPLD(Machine *mach,Session *sess,EDFParser &edf) bool ResmedLoader::LoadPLD(Machine *mach,Session *sess,EDFParser &edf)
{ {
// Is it save to assume the order does not change here?
enum PLDType { MaskPres=0, TherapyPres, ExpPress, Leak, RR, Vt, Mv, SnoreIndex, FFLIndex, U1, U2 };
//qDebug(edf.edfsignals[MaskPres]->label.toLatin1());
QString t; QString t;
for (int s=0;s<edf.GetNumSignals();s++) { for (int s=0;s<edf.GetNumSignals();s++) {
long recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords(); long recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords();
@ -507,12 +513,15 @@ bool ResmedLoader::LoadPLD(Machine *mach,Session *sess,EDFParser &edf)
sess->set_hours(duration/3600.0); sess->set_hours(duration/3600.0);
} }
MachineCode code; MachineCode code;
// if (s==TherapyPres) {
// for (int i=0;i<recs;i++) qDebug("%04i %i",i,edf.edfsignals[s]->data[i]);
// } else
if (edf.edfsignals[s]->label=="Snore Index") { if (edf.edfsignals[s]->label=="Snore Index") {
code=CPAP_Snore; code=CPAP_Snore;
ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration); ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration);
} else if (edf.edfsignals[s]->label=="Mask Pres") { } else if (edf.edfsignals[s]->label=="Therapy Pres") {
code=CPAP_Pressure; code=CPAP_Pressure;
ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration,50.0); ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration,100.0); //50.0
} else if (edf.edfsignals[s]->label=="MV") { } else if (edf.edfsignals[s]->label=="MV") {
code=CPAP_MinuteVentilation; code=CPAP_MinuteVentilation;
//ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration,1.0); //ToTimeDelta(mach,sess,edf,edf.edfsignals[s]->data, code,recs,duration,1.0);

View File

@ -650,10 +650,12 @@ void Daily::Load(QDate date)
MV->show(); MV->show();
TV->show(); TV->show();
RR->show(); RR->show();
FLG->show();
} else { } else {
MV->hide(); MV->hide();
TV->hide(); TV->hide();
RR->hide(); RR->hide();
FLG->hide();
} }
if (oxi) { if (oxi) {

View File

@ -95,9 +95,8 @@ void MainWindow::Startup()
daily=new Daily(ui->tabWidget,shared_context); daily=new Daily(ui->tabWidget,shared_context);
ui->tabWidget->addTab(daily,tr("Daily")); ui->tabWidget->addTab(daily,tr("Daily"));
// Disabled Overview until I want to actually look at it again. :) overview=new Overview(ui->tabWidget,shared_context);
//overview=new Overview(ui->tabWidget,shared_context); ui->tabWidget->addTab(overview,tr("Overview"));
//ui->tabWidget->addTab(overview,tr("Overview"));
qprogress->hide(); qprogress->hide();
qstatus->setText(tr("Ready")); qstatus->setText(tr("Ready"));
@ -107,7 +106,6 @@ void MainWindow::on_action_Import_Data_triggered()
{ {
QStringList dirNames; QStringList dirNames;
QFileDialog qfd(this); QFileDialog qfd(this);
//qfddir = QFileDialog::getOpenFileName(this,tr("Import Folder"), "", tr("Folders"));
qfd.setFileMode(QFileDialog::DirectoryOnly); qfd.setFileMode(QFileDialog::DirectoryOnly);
if (qfd.exec()) { if (qfd.exec()) {
@ -148,11 +146,8 @@ void MainWindow::on_homeButton_clicked()
{ {
QString file="qrc:/docs/index.html"; QString file="qrc:/docs/index.html";
QUrl url(file); QUrl url(file);
//QResource res(file);
//QByteArray html((const char*)res.data(), res.size());
ui->webView->setUrl(url); ui->webView->setUrl(url);
ui->webView->load(url); ui->webView->load(url);
//ui->webView->setHtml(url); //QString(html));
} }
void MainWindow::on_backButton_clicked() void MainWindow::on_backButton_clicked()