mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-19 04:00:45 +00:00
Try showing some events counts in TAP chart
This commit is contained in:
parent
ed5a539584
commit
eb369ef8b0
@ -277,8 +277,64 @@ void MinutesAtPressure::paint(QPainter &painter, gGraph &graph, const QRegion &r
|
|||||||
xp+=xstep;
|
xp+=xstep;
|
||||||
lastyp = yp;
|
lastyp = yp;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double estep = float(height) / ipap.peakevents;
|
||||||
|
|
||||||
|
|
||||||
|
if (ipap.peakevents>0) {
|
||||||
|
for (int k=0; k<ipap.chans.size(); ++k) {
|
||||||
|
ChannelID ch = ipap.chans.at(k);
|
||||||
|
//(ch != CPAP_AHI) &&
|
||||||
|
if ((ch != CPAP_Hypopnea) && (ch != CPAP_Obstructive) && (ch != CPAP_ClearAirway) && (ch != CPAP_Apnea)) continue;
|
||||||
|
schema::Channel & chan = schema::channel[ch];
|
||||||
|
QColor col = chan.defaultColor();
|
||||||
|
col.setAlpha(48);
|
||||||
|
painter.setPen(col);
|
||||||
|
|
||||||
|
xp = left;
|
||||||
|
lastyp = bottom - (float(ipap.events[ch][min-1]) * estep);
|
||||||
|
for (int i=min; i<max; ++i) {
|
||||||
|
p0 = ipap.events[ch][i-1];
|
||||||
|
p1 = ipap.events[ch][i];
|
||||||
|
p2 = ipap.events[ch][i+1];
|
||||||
|
p3 = ipap.events[ch][i+1];
|
||||||
|
yp = bottom - (float(p1) * estep);
|
||||||
|
painter.drawLine(xp, lastyp, xp+xstep, yp);
|
||||||
|
lastyp = yp;
|
||||||
|
xp += xstep;
|
||||||
|
|
||||||
|
float s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.2),0.0f);
|
||||||
|
yp = qMax(bottom-height, float(bottom - (s2 * estep)));
|
||||||
|
painter.drawLine(xp, lastyp, xp+xstep, yp);
|
||||||
|
|
||||||
|
lastyp = yp;
|
||||||
|
xp += xstep;
|
||||||
|
s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.4),0.0f);
|
||||||
|
yp = qMax(bottom-height, float(bottom - (s2 * estep)));
|
||||||
|
painter.drawLine(xp, lastyp, xp+xstep, yp);
|
||||||
|
lastyp = yp;
|
||||||
|
xp += xstep;
|
||||||
|
|
||||||
|
s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.6),0.0f);
|
||||||
|
yp = qMax(bottom-height, float(bottom - (s2 * estep)));
|
||||||
|
painter.drawLine(xp, lastyp, xp+xstep, yp);
|
||||||
|
xp+=xstep;
|
||||||
|
lastyp = yp;
|
||||||
|
|
||||||
|
s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.8),0.0f);
|
||||||
|
yp = qMax(bottom-height, float(bottom - (s2 * estep)));
|
||||||
|
painter.drawLine(xp, lastyp, xp+xstep, yp);
|
||||||
|
xp+=xstep;
|
||||||
|
lastyp = yp;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (epap.min_pressure) {
|
if (epap.min_pressure) {
|
||||||
xp=left, lastyp = bottom - (float(epap.times[min]) * ystep);
|
xp=left, lastyp = bottom - (float(epap.times[min]) * ystep);
|
||||||
painter.setPen(Qt::blue);
|
painter.setPen(Qt::blue);
|
||||||
@ -686,13 +742,13 @@ void RecalcMAP::updateTimes(PressureInfo & info, Session * sess)
|
|||||||
|
|
||||||
lasttime = time;
|
lasttime = time;
|
||||||
lastdata = data;
|
lastdata = data;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (time > maxx) {
|
if (time > maxx) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (lasttime < maxx) {
|
if ((lasttime < maxx) || (lastdata == data)) {
|
||||||
d1 = qMax(lasttime, minx);
|
d1 = qMax(lasttime, minx);
|
||||||
d2 = qMin(maxx, EL->last());
|
d2 = qMin(maxx, EL->last());
|
||||||
|
|
||||||
|
@ -477,6 +477,7 @@ void loadChannels()
|
|||||||
chan->setEnabled(enabled);
|
chan->setEnabled(enabled);
|
||||||
chan->setDefaultColor(color);
|
chan->setDefaultColor(color);
|
||||||
|
|
||||||
|
// Don't import channel descriptions if event renaming is turned off. (helps pick up new translations)
|
||||||
if (PREF[STR_PREF_AllowEventRenaming].toBool()) {
|
if (PREF[STR_PREF_AllowEventRenaming].toBool()) {
|
||||||
chan->setFullname(fullname);
|
chan->setFullname(fullname);
|
||||||
chan->setLabel(label);
|
chan->setLabel(label);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>845</width>
|
<width>847</width>
|
||||||
<height>656</height>
|
<height>656</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="importTab">
|
<widget class="QWidget" name="importTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -1736,7 +1736,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_51">
|
<widget class="QLabel" name="eventsWarningLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -1815,7 +1815,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_56">
|
<widget class="QLabel" name="waveformsWarningLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
Loading…
Reference in New Issue
Block a user