diff --git a/SleepLib/calcs.cpp b/SleepLib/calcs.cpp
index 753997c0..d8c09b69 100644
--- a/SleepLib/calcs.cpp
+++ b/SleepLib/calcs.cpp
@@ -330,6 +330,7 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
if (calcResp) {
RR=m_session->AddEventList(CPAP_RespRate,EVL_Event);
minrr=RR->Min(), maxrr=RR->Max();
+ RR->setGain(0.2);
RR->setFirst(time+minute);
RR->getData().resize(nm);
RR->getTime().resize(nm);
@@ -340,6 +341,7 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
int rr_count=0;
double len, st2,et2,adj, stmin, b, rr=0;
+ double len2;
int idx;
@@ -371,6 +373,7 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
if (calcTv) {
TV=m_session->AddEventList(CPAP_TidalVolume,EVL_Event);
mintv=TV->Min(), maxtv=TV->Max();
+ TV->setGain(20);
TV->setFirst(start);
TV->getData().resize(nm);
TV->getTime().resize(nm);
@@ -465,7 +468,8 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
stmin=start;
len=et-stmin;
rr=0;
- if (len >= minute) {
+ len2=0;
+ //if ( len >= minute) {
//et2=et;
// Step back through last minute and count breaths
@@ -481,10 +485,17 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
st2=stmin;
adj=et2 - st2;
b=(1.0 / len) * adj;
- } else b=1;
+ len2+=adj;
+ } else {
+ b=1;
+ len2+=len;
+ }
+
rr+=b;
}
-
+ if (len2 < minute) {
+ rr*=minute/len2;
+ }
// Calculate min & max
if (rr < minrr)
minrr=rr;
@@ -500,7 +511,7 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
rr_count++;
//rr->AddEvent(et,br * 50.0);
- }
+ //}
}
if (calcMv && calcResp && calcTv) {
mv=(tv/1000.0) * rr;
@@ -513,7 +524,6 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
/////////////////////////////////////////////////////////////////////
if (calcResp) {
- RR->setGain(0.2);
RR->setMin(minrr);
RR->setMax(maxrr);
RR->setFirst(start);
@@ -525,7 +535,6 @@ void FlowParser::calc(bool calcResp, bool calcTv, bool calcTi, bool calcTe, bool
/////////////////////////////////////////////////////////////////////
if (calcTv) {
- TV->setGain(20);
TV->setMin(mintv);
TV->setMax(maxtv);
TV->setFirst(start);
diff --git a/UpdaterWindow.cpp b/UpdaterWindow.cpp
index 41c2f431..cd251560 100644
--- a/UpdaterWindow.cpp
+++ b/UpdaterWindow.cpp
@@ -226,6 +226,12 @@ void UpdaterWindow::ParseUpdateXML(QIODevice * dev)
}
}
}
+ if (!upq && !upd) {
+ mainwin->Notify(tr("No new updates were found for your platform."),tr("SleepyHead Updates"),5000);
+ PREF[STR_GEN_UpdatesLastChecked]=QDateTime::currentDateTime();
+ close();
+ return;
+ }
if (upq && (upq->version > QT_VERSION_STR)) {
updates.push_back(upq);
diff --git a/update.xml b/update.xml
index 8314d162..f8a7c0fe 100644
--- a/update.xml
+++ b/update.xml
@@ -7,19 +7,9 @@
hash="ed0312c0f9a51e8774e6556f83b13df8d4195d2b"/>
-
-
- Some bug fixes to the beta, and a test of the auto-updater.
- Adds some new functionality to the updater, so test updates can be delivered with out affecting other users.
- Please proceed with caution. If unsure, wait for feedback in the forums..
-
-
-
-
+
Some bug fixes to the beta, and a test of the auto-updater.
Adds some new functionality to the updater, so test updates can be delivered with out affecting other users.
@@ -28,10 +18,7 @@
This is an updater test, though it does deliver some important bug fixes to the beta..
- This message will change when it's ready to grab.. (it might work now)
- Linux Rules. But you already knew that!
- Always remember to write-protect your SD card, as MacOSX occasionally likes to eat them.
Nothing particularly platform relevant to this Windows build