mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 19:50:45 +00:00
userEventDuplicates stub stuff (currently hidden), disabled zlib gzbuffer usage as ubuntu has a outdated zlib.
This commit is contained in:
parent
a7dc182975
commit
47b160e907
@ -1858,9 +1858,6 @@ void gGraph::ToolTip(QString text, int x, int y, int timeout)
|
|||||||
|
|
||||||
void gGraph::roundY(EventDataType &miny, EventDataType &maxy)
|
void gGraph::roundY(EventDataType &miny, EventDataType &maxy)
|
||||||
{
|
{
|
||||||
if (title()=="Sessions") {
|
|
||||||
int i=5;
|
|
||||||
}
|
|
||||||
int m,t;
|
int m,t;
|
||||||
bool ymin_good=false,ymax_good=false;
|
bool ymin_good=false,ymax_good=false;
|
||||||
if (rec_miny!=rec_maxy) {
|
if (rec_miny!=rec_maxy) {
|
||||||
|
@ -555,6 +555,7 @@ void FlowParser::flagEvents()
|
|||||||
double st,mt,et, dur;
|
double st,mt,et, dur;
|
||||||
qint64 len;
|
qint64 len;
|
||||||
|
|
||||||
|
bool allowDuplicates=PROFILE.cpap->userEventDuplicates();
|
||||||
|
|
||||||
for (int i=0;i<numbreaths;i++) {
|
for (int i=0;i<numbreaths;i++) {
|
||||||
mx=breaths[i].max;
|
mx=breaths[i].max;
|
||||||
@ -562,6 +563,8 @@ void FlowParser::flagEvents()
|
|||||||
br.push_back(qAbs(mx));
|
br.push_back(qAbs(mx));
|
||||||
br.push_back(qAbs(mn));
|
br.push_back(qAbs(mn));
|
||||||
}
|
}
|
||||||
|
EventList * uf2=m_session->AddEventList(CPAP_UserFlag2,EVL_Event);
|
||||||
|
EventList * uf3=m_session->AddEventList(CPAP_UserFlag3,EVL_Event);
|
||||||
|
|
||||||
const EventDataType perc=0.6;
|
const EventDataType perc=0.6;
|
||||||
int idx=float(br.size())*perc;
|
int idx=float(br.size())*perc;
|
||||||
@ -618,6 +621,11 @@ void FlowParser::flagEvents()
|
|||||||
bend.push_back(be1);
|
bend.push_back(be1);
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
st=start + bs1 * m_rate;
|
||||||
|
et=start + be1 * m_rate;
|
||||||
|
uf2->AddEvent(st,0);
|
||||||
|
uf3->AddEvent(et,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -626,8 +634,6 @@ void FlowParser::flagEvents()
|
|||||||
//EventDataType v;
|
//EventDataType v;
|
||||||
int bsize=bstart.size();
|
int bsize=bstart.size();
|
||||||
EventList * uf1=NULL;
|
EventList * uf1=NULL;
|
||||||
// EventList * uf2=m_session->AddEventList(CPAP_UserFlag2,EVL_Event);
|
|
||||||
// EventList * uf3=m_session->AddEventList(CPAP_UserFlag3,EVL_Event);
|
|
||||||
|
|
||||||
for (int i=0;i<bsize-1;i++) {
|
for (int i=0;i<bsize-1;i++) {
|
||||||
bs=bend[i];
|
bs=bend[i];
|
||||||
@ -638,7 +644,7 @@ void FlowParser::flagEvents()
|
|||||||
len=et-st;
|
len=et-st;
|
||||||
dur=len/1000.0;
|
dur=len/1000.0;
|
||||||
if (dur>=duration) {
|
if (dur>=duration) {
|
||||||
if (!SearchApnea(m_session,et-len/2,15000)) {
|
if (allowDuplicates || !SearchApnea(m_session,et-len/2,15000)) {
|
||||||
if (!uf1) {
|
if (!uf1) {
|
||||||
uf1=m_session->AddEventList(CPAP_UserFlag1,EVL_Event);
|
uf1=m_session->AddEventList(CPAP_UserFlag1,EVL_Event);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ bool EDFParser::Open(QString name)
|
|||||||
}
|
}
|
||||||
gzread(f,(char *)&header,EDFHeaderSize);
|
gzread(f,(char *)&header,EDFHeaderSize);
|
||||||
buffer=new char [datasize];
|
buffer=new char [datasize];
|
||||||
gzbuffer(f,65536*2);
|
//gzbuffer(f,65536*2);
|
||||||
gzread(f,buffer,datasize);
|
gzread(f,buffer,datasize);
|
||||||
gzclose(f);
|
gzclose(f);
|
||||||
} else {
|
} else {
|
||||||
|
@ -71,7 +71,7 @@ bool MachineLoader::compressFile(QString inpath, QString outpath)
|
|||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
gzFile gz=gzopen(outpath.toAscii(),"wb");
|
gzFile gz=gzopen(outpath.toAscii(),"wb");
|
||||||
gzbuffer(gz,65536*2);
|
//gzbuffer(gz,65536*2);
|
||||||
if (!gz) {
|
if (!gz) {
|
||||||
qDebug() << "compressFile() Couldn't open" << outpath <<"for writing";
|
qDebug() << "compressFile() Couldn't open" << outpath <<"for writing";
|
||||||
delete buf;
|
delete buf;
|
||||||
|
@ -919,6 +919,7 @@ const char * STR_CS_DateDiagnosed="DateDiagnosed";
|
|||||||
const char * STR_CS_UserEventFlagging="UserEventFlagging";
|
const char * STR_CS_UserEventFlagging="UserEventFlagging";
|
||||||
const char * STR_CS_UserFlowRestriction="UserFlowRestriction";
|
const char * STR_CS_UserFlowRestriction="UserFlowRestriction";
|
||||||
const char * STR_CS_UserEventDuration="UserEventDuration";
|
const char * STR_CS_UserEventDuration="UserEventDuration";
|
||||||
|
const char * STR_CS_UserEventDuplicates="UserEventDuplicates";
|
||||||
const char * STR_CS_AHIWindow="AHIWindow";
|
const char * STR_CS_AHIWindow="AHIWindow";
|
||||||
const char * STR_CS_AHIReset="AHIReset";
|
const char * STR_CS_AHIReset="AHIReset";
|
||||||
|
|
||||||
|
@ -345,6 +345,7 @@ extern const char * STR_CS_DateDiagnosed;
|
|||||||
extern const char * STR_CS_UserEventFlagging;
|
extern const char * STR_CS_UserEventFlagging;
|
||||||
extern const char * STR_CS_UserFlowRestriction;
|
extern const char * STR_CS_UserFlowRestriction;
|
||||||
extern const char * STR_CS_UserEventDuration;
|
extern const char * STR_CS_UserEventDuration;
|
||||||
|
extern const char * STR_CS_UserEventDuplicates;
|
||||||
extern const char * STR_CS_AHIWindow;
|
extern const char * STR_CS_AHIWindow;
|
||||||
extern const char * STR_CS_AHIReset;
|
extern const char * STR_CS_AHIReset;
|
||||||
|
|
||||||
@ -372,6 +373,7 @@ public:
|
|||||||
if (!m_profile->contains(STR_CS_DateDiagnosed)) (*m_profile)[STR_CS_DateDiagnosed]=QDate();
|
if (!m_profile->contains(STR_CS_DateDiagnosed)) (*m_profile)[STR_CS_DateDiagnosed]=QDate();
|
||||||
if (!m_profile->contains(STR_CS_UserFlowRestriction)) (*m_profile)[STR_CS_UserFlowRestriction]=20.0;
|
if (!m_profile->contains(STR_CS_UserFlowRestriction)) (*m_profile)[STR_CS_UserFlowRestriction]=20.0;
|
||||||
if (!m_profile->contains(STR_CS_UserEventDuration)) (*m_profile)[STR_CS_UserEventDuration]=10.0;
|
if (!m_profile->contains(STR_CS_UserEventDuration)) (*m_profile)[STR_CS_UserEventDuration]=10.0;
|
||||||
|
if (!m_profile->contains(STR_CS_UserEventDuplicates)) (*m_profile)[STR_CS_UserEventDuplicates]=false;
|
||||||
if (!m_profile->contains(STR_CS_UserEventFlagging)) (*m_profile)[STR_CS_UserEventFlagging]=false;
|
if (!m_profile->contains(STR_CS_UserEventFlagging)) (*m_profile)[STR_CS_UserEventFlagging]=false;
|
||||||
if (!m_profile->contains(STR_CS_AHIWindow)) (*m_profile)[STR_CS_AHIWindow]=60.0;
|
if (!m_profile->contains(STR_CS_AHIWindow)) (*m_profile)[STR_CS_AHIWindow]=60.0;
|
||||||
if (!m_profile->contains(STR_CS_AHIReset)) (*m_profile)[STR_CS_AHIReset]=false;
|
if (!m_profile->contains(STR_CS_AHIReset)) (*m_profile)[STR_CS_AHIReset]=false;
|
||||||
@ -396,6 +398,7 @@ public:
|
|||||||
QDate dateDiagnosed() { return (*m_profile)[STR_CS_DateDiagnosed].toDate(); }
|
QDate dateDiagnosed() { return (*m_profile)[STR_CS_DateDiagnosed].toDate(); }
|
||||||
double userFlowRestriction() { return (*m_profile)[STR_CS_UserFlowRestriction].toDouble(); }
|
double userFlowRestriction() { return (*m_profile)[STR_CS_UserFlowRestriction].toDouble(); }
|
||||||
double userEventDuration() { return (*m_profile)[STR_CS_UserEventDuration].toDouble(); }
|
double userEventDuration() { return (*m_profile)[STR_CS_UserEventDuration].toDouble(); }
|
||||||
|
bool userEventDuplicates() { return (*m_profile)[STR_CS_UserEventDuplicates].toBool(); }
|
||||||
double AHIWindow() { return (*m_profile)[STR_CS_AHIWindow].toDouble(); }
|
double AHIWindow() { return (*m_profile)[STR_CS_AHIWindow].toDouble(); }
|
||||||
bool AHIReset() { return (*m_profile)[STR_CS_AHIReset].toBool(); }
|
bool AHIReset() { return (*m_profile)[STR_CS_AHIReset].toBool(); }
|
||||||
bool userEventFlagging() { return (*m_profile)[STR_CS_UserEventFlagging].toBool(); }
|
bool userEventFlagging() { return (*m_profile)[STR_CS_UserEventFlagging].toBool(); }
|
||||||
@ -418,6 +421,7 @@ public:
|
|||||||
void setAHIWindow(double window) { (*m_profile)[STR_CS_AHIWindow]=window; }
|
void setAHIWindow(double window) { (*m_profile)[STR_CS_AHIWindow]=window; }
|
||||||
void setAHIReset(bool reset) { (*m_profile)[STR_CS_AHIReset]=reset; }
|
void setAHIReset(bool reset) { (*m_profile)[STR_CS_AHIReset]=reset; }
|
||||||
void setUserEventFlagging(bool flagging) { (*m_profile)[STR_CS_UserEventFlagging]=flagging; }
|
void setUserEventFlagging(bool flagging) { (*m_profile)[STR_CS_UserEventFlagging]=flagging; }
|
||||||
|
void setUserEventDuplicates(bool dup) { (*m_profile)[STR_CS_UserEventDuplicates]=dup; }
|
||||||
|
|
||||||
Profile *m_profile;
|
Profile *m_profile;
|
||||||
};
|
};
|
||||||
|
@ -200,6 +200,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
ui->customEventGroupbox->setChecked(profile->cpap->userEventFlagging());
|
ui->customEventGroupbox->setChecked(profile->cpap->userEventFlagging());
|
||||||
ui->apneaDuration->setValue(profile->cpap->userEventDuration());
|
ui->apneaDuration->setValue(profile->cpap->userEventDuration());
|
||||||
ui->apneaFlowRestriction->setValue(profile->cpap->userFlowRestriction());
|
ui->apneaFlowRestriction->setValue(profile->cpap->userFlowRestriction());
|
||||||
|
ui->userEventDuplicates->setChecked(profile->cpap->userEventDuplicates());
|
||||||
|
ui->userEventDuplicates->setVisible(false);
|
||||||
|
|
||||||
ui->eventTable->setColumnWidth(0,40);
|
ui->eventTable->setColumnWidth(0,40);
|
||||||
ui->eventTable->setColumnWidth(1,55);
|
ui->eventTable->setColumnWidth(1,55);
|
||||||
@ -297,6 +299,7 @@ bool PreferencesDialog::Save()
|
|||||||
}
|
}
|
||||||
if (profile->cpap->userEventFlagging() &&
|
if (profile->cpap->userEventFlagging() &&
|
||||||
(profile->cpap->userEventDuration()!=ui->apneaDuration->value() ||
|
(profile->cpap->userEventDuration()!=ui->apneaDuration->value() ||
|
||||||
|
profile->cpap->userEventDuplicates()!=ui->userEventDuplicates->isChecked() ||
|
||||||
profile->cpap->userFlowRestriction()!=ui->apneaFlowRestriction->value()))
|
profile->cpap->userFlowRestriction()!=ui->apneaFlowRestriction->value()))
|
||||||
recalc_events=true;
|
recalc_events=true;
|
||||||
|
|
||||||
@ -383,6 +386,7 @@ bool PreferencesDialog::Save()
|
|||||||
|
|
||||||
profile->cpap->setUserEventDuration(ui->apneaDuration->value());
|
profile->cpap->setUserEventDuration(ui->apneaDuration->value());
|
||||||
profile->cpap->setUserFlowRestriction(ui->apneaFlowRestriction->value());
|
profile->cpap->setUserFlowRestriction(ui->apneaFlowRestriction->value());
|
||||||
|
profile->cpap->setUserEventDuplicates(ui->userEventDuplicates->isChecked());
|
||||||
|
|
||||||
PREF[STR_GEN_SkipLogin]=ui->skipLoginScreen->isChecked();
|
PREF[STR_GEN_SkipLogin]=ui->skipLoginScreen->isChecked();
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="importTab">
|
<widget class="QWidget" name="importTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -820,6 +820,13 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1" colspan="4">
|
||||||
|
<widget class="QCheckBox" name="userEventDuplicates">
|
||||||
|
<property name="text">
|
||||||
|
<string>Allow duplicates near machine events.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user