mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-13 17:20:51 +00:00
SummaryChart highlight improvement, Details tab tooltip position, SearchEvent optimisation.
This commit is contained in:
parent
b626cd0200
commit
0b3d47a7f0
@ -391,6 +391,13 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
if (x2<x1)
|
if (x2<x1)
|
||||||
goto jumpnext;
|
goto jumpnext;
|
||||||
|
|
||||||
|
|
||||||
|
if (zd==hl_day) {
|
||||||
|
QColor col=QColor("red");
|
||||||
|
col.setAlpha(64);
|
||||||
|
quads->add(x1-1,top,x1-1,top+height,x2,top+height,x2,top,col.rgba());
|
||||||
|
}
|
||||||
|
|
||||||
if (m_graphtype==GT_SESSIONS) {
|
if (m_graphtype==GT_SESSIONS) {
|
||||||
int j;
|
int j;
|
||||||
QHash<int,QHash<short,EventDataType> >::iterator times=m_times.find(zd);
|
QHash<int,QHash<short,EventDataType> >::iterator times=m_times.find(zd);
|
||||||
|
@ -21,6 +21,8 @@ bool SearchApnea(Session *session, qint64 time, qint64 dist=15000)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Support function for calcRespRate()
|
// Support function for calcRespRate()
|
||||||
int filterFlow(Session *session, EventList *in, EventList *out, EventList *tv, EventList *mv, double rate)
|
int filterFlow(Session *session, EventList *in, EventList *out, EventList *tv, EventList *mv, double rate)
|
||||||
{
|
{
|
||||||
|
@ -153,12 +153,6 @@ bool Session::StoreSummary(QString filename)
|
|||||||
out << m_timesummary;
|
out << m_timesummary;
|
||||||
out << m_gain;
|
out << m_gain;
|
||||||
|
|
||||||
// First output the Machine Code and type for each summary record
|
|
||||||
/* for (QHash<ChannelID,QVariant>::iterator i=settings.begin(); i!=settings.end(); i++) {
|
|
||||||
ChannelID mc=i.key();
|
|
||||||
out << (qint16)mc;
|
|
||||||
out << i.value();
|
|
||||||
} */
|
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -218,7 +212,6 @@ bool Session::LoadSummary(QString filename)
|
|||||||
in >> s_first; // Start time
|
in >> s_first; // Start time
|
||||||
in >> s_last; // Duration // (16bit==Limited to 18 hours)
|
in >> s_last; // Duration // (16bit==Limited to 18 hours)
|
||||||
|
|
||||||
|
|
||||||
QHash<ChannelID,EventDataType> cruft;
|
QHash<ChannelID,EventDataType> cruft;
|
||||||
|
|
||||||
if (version<7) {
|
if (version<7) {
|
||||||
@ -256,11 +249,6 @@ bool Session::LoadSummary(QString filename)
|
|||||||
}
|
}
|
||||||
ztmp.clear();
|
ztmp.clear();
|
||||||
in >> ztmp; // 90p
|
in >> ztmp; // 90p
|
||||||
// Ignore this
|
|
||||||
// for (QHash<QString,EventDataType>::iterator i=ztmp.begin();i!=ztmp.end();i++) {
|
|
||||||
// code=schema::channel[i.key()].id();
|
|
||||||
// m_90p[code]=i.value();
|
|
||||||
// }
|
|
||||||
ztmp.clear();
|
ztmp.clear();
|
||||||
in >> ztmp; // min
|
in >> ztmp; // min
|
||||||
for (QHash<QString,EventDataType>::iterator i=ztmp.begin();i!=ztmp.end();i++) {
|
for (QHash<QString,EventDataType>::iterator i=ztmp.begin();i!=ztmp.end();i++) {
|
||||||
@ -673,23 +661,12 @@ void Session::updateCountSummary(ChannelID code)
|
|||||||
time=start + *tptr++;
|
time=start + *tptr++;
|
||||||
raw=*dptr++;
|
raw=*dptr++;
|
||||||
|
|
||||||
//raw=e.raw(j);
|
|
||||||
valsum[raw]++;
|
valsum[raw]++;
|
||||||
// vsi=valsum.find(raw);
|
|
||||||
// if (vsi==valsum.end()) {
|
|
||||||
// valsum[raw]=1;
|
|
||||||
// }
|
|
||||||
// else vsi.value()++;
|
|
||||||
|
|
||||||
//time=e.time(j);
|
|
||||||
|
|
||||||
// elapsed time in seconds since last event
|
// elapsed time in seconds since last event
|
||||||
len=(time-lasttime) / 1000L;
|
len=(time-lasttime) / 1000L;
|
||||||
|
|
||||||
timesum[lastraw]+=len;
|
timesum[lastraw]+=len;
|
||||||
// tsi=timesum.find(lastraw);
|
|
||||||
// if (tsi==timesum.end()) timesum[raw]=len;
|
|
||||||
// else tsi.value()+=len;
|
|
||||||
|
|
||||||
lastraw=raw;
|
lastraw=raw;
|
||||||
lasttime=time;
|
lasttime=time;
|
||||||
@ -735,30 +712,26 @@ void Session::UpdateSummaries()
|
|||||||
sph(id);
|
sph(id);
|
||||||
avg(id);
|
avg(id);
|
||||||
wavg(id);
|
wavg(id);
|
||||||
// p90(id);
|
|
||||||
// p95(id);
|
|
||||||
// median(id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (channelExists(CPAP_Obstructive)) {
|
|
||||||
setCph(CPAP_AHI,cph(CPAP_Obstructive)+cph(CPAP_Hypopnea)+cph(CPAP_ClearAirway));
|
|
||||||
setSph(CPAP_AHI,sph(CPAP_Obstructive)+sph(CPAP_Hypopnea)+sph(CPAP_ClearAirway));
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::SearchEvent(ChannelID code, qint64 time, qint64 dist)
|
bool Session::SearchEvent(ChannelID code, qint64 time, qint64 dist)
|
||||||
{
|
{
|
||||||
qint64 t;
|
qint64 t,start;
|
||||||
QHash<ChannelID,QVector<EventList *> >::iterator it;
|
QHash<ChannelID,QVector<EventList *> >::iterator it;
|
||||||
it=eventlist.find(code);
|
it=eventlist.find(code);
|
||||||
|
quint32 * tptr;
|
||||||
|
int cnt;
|
||||||
if (it!=eventlist.end()) {
|
if (it!=eventlist.end()) {
|
||||||
for (int i=0;i<it.value().size();i++) {
|
for (int i=0;i<it.value().size();i++) {
|
||||||
EventList *el=it.value()[i];
|
EventList *el=it.value()[i];
|
||||||
for (unsigned j=0;j<el->count();j++) {
|
start=el->first();
|
||||||
t=el->time(j);
|
tptr=el->rawTime();
|
||||||
if (qAbs(time-t)<dist)
|
cnt=el->count();
|
||||||
|
for (unsigned j=0;j<cnt;j++) {
|
||||||
|
t=start + *tptr++;
|
||||||
|
if (qAbs(time - t) < dist)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
daily.cpp
14
daily.cpp
@ -827,29 +827,29 @@ void Daily::Load(QDate date)
|
|||||||
QString cs;
|
QString cs;
|
||||||
if (!isBrick) {
|
if (!isBrick) {
|
||||||
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
cs="4 width='100%' align=center>";
|
cs="4 width='70%' align=center>";
|
||||||
} else cs="2 width='50%'>";
|
} else cs="2 width='50%'>";
|
||||||
html+="<tr><td colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>";
|
html+="<tr><td colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>";
|
||||||
|
|
||||||
if (PROFILE.general->calculateRDI()) {
|
if (PROFILE.general->calculateRDI()) {
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='#'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='#'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#F88017").arg("black").arg(tr("RDI")).arg(schema::channel[CPAP_RDI].description()).arg(ahi,0,'f',2);
|
.arg("#F88017").arg("black").arg(tr("RDI")).arg(schema::channel[CPAP_RDI].description()).arg(ahi,0,'f',2);
|
||||||
} else {
|
} else {
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='#'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='#'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#F88017").arg("black").arg(tr("AHI")).arg(schema::channel[CPAP_AHI].description()).arg(ahi,0,'f',2);
|
.arg("#F88017").arg("black").arg(tr("AHI")).arg(schema::channel[CPAP_AHI].description()).arg(ahi,0,'f',2);
|
||||||
//html+="<tr><td align='left' bgcolor='#F88017'><b><font color='black'><a class=info href='#'>"+tr("AHI")+"<span class='classic'>"+schema::channel[CPAP_AHI].description()+"</span></a></font></b></td><td width=20% bgcolor='#F88017'><b><font color='black'>"+QString().sprintf("%.2f",ahi)+"</font></b></td></tr>\n";
|
//html+="<tr><td align='left' bgcolor='#F88017'><b><font color='black'><a class=info href='#'>"+tr("AHI")+"<span class='classic'>"+schema::channel[CPAP_AHI].description()+"</span></a></font></b></td><td width=20% bgcolor='#F88017'><b><font color='black'>"+QString().sprintf("%.2f",ahi)+"</font></b></td></tr>\n";
|
||||||
}
|
}
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#4040ff").arg("white").arg(tr("Hypopnea")).arg(schema::channel[CPAP_Hypopnea].description()).arg(hi,0,'f',2).arg(CPAP_Hypopnea);
|
.arg("#4040ff").arg("white").arg(tr("Hypopnea")).arg(schema::channel[CPAP_Hypopnea].description()).arg(hi,0,'f',2).arg(CPAP_Hypopnea);
|
||||||
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#208020").arg("black")
|
.arg("#208020").arg("black")
|
||||||
.arg(tr("Apnea")).arg(schema::channel[CPAP_Apnea].description()).arg(uai,0,'f',2).arg(CPAP_Apnea);
|
.arg(tr("Apnea")).arg(schema::channel[CPAP_Apnea].description()).arg(uai,0,'f',2).arg(CPAP_Apnea);
|
||||||
}
|
}
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#40afbf").arg("black").arg(tr("Obstructive")).arg(schema::channel[CPAP_Obstructive].description()).arg(oai,0,'f',2).arg(CPAP_Obstructive);
|
.arg("#40afbf").arg("black").arg(tr("Obstructive")).arg(schema::channel[CPAP_Obstructive].description()).arg(oai,0,'f',2).arg(CPAP_Obstructive);
|
||||||
|
|
||||||
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
|
||||||
.arg("#b254cd").arg("black").arg(tr("Clear Airway")).arg(schema::channel[CPAP_ClearAirway].description()).arg(cai,0,'f',2).arg(CPAP_ClearAirway);
|
.arg("#b254cd").arg("black").arg(tr("Clear Airway")).arg(schema::channel[CPAP_ClearAirway].description()).arg(cai,0,'f',2).arg(CPAP_ClearAirway);
|
||||||
html+="</table></td>";
|
html+="</table></td>";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user