Merge pull request #155 from OpenSeizureDetector/HR-activation-toggling
Hr activation toggling
This commit is contained in:
@@ -146,13 +146,16 @@ public class SdAlgHr {
|
|||||||
|
|
||||||
private boolean checkAdaptiveHr(double hrVal) {
|
private boolean checkAdaptiveHr(double hrVal) {
|
||||||
boolean retVal;
|
boolean retVal;
|
||||||
|
retVal = false;
|
||||||
|
|
||||||
|
if (mAdaptiveHrAlarmActive) {
|
||||||
double hrThreshMin;
|
double hrThreshMin;
|
||||||
double hrThreshMax;
|
double hrThreshMax;
|
||||||
double avHr = getAdaptiveHrAverage();
|
double avHr = getAdaptiveHrAverage();
|
||||||
hrThreshMin = avHr - mAdaptiveHrAlarmThresh;
|
hrThreshMin = avHr - mAdaptiveHrAlarmThresh;
|
||||||
hrThreshMax = avHr + mAdaptiveHrAlarmThresh;
|
hrThreshMax = avHr + mAdaptiveHrAlarmThresh;
|
||||||
|
|
||||||
retVal = false;
|
|
||||||
if (hrVal < hrThreshMin) {
|
if (hrVal < hrThreshMin) {
|
||||||
retVal = true;
|
retVal = true;
|
||||||
}
|
}
|
||||||
@@ -160,15 +163,15 @@ public class SdAlgHr {
|
|||||||
retVal = true;
|
retVal = true;
|
||||||
}
|
}
|
||||||
Log.d(TAG, "checkAdaptiveHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + hrThreshMin + ", " + hrThreshMax + "): Alarm=" + retVal);
|
Log.d(TAG, "checkAdaptiveHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + hrThreshMin + ", " + hrThreshMax + "): Alarm=" + retVal);
|
||||||
|
}
|
||||||
return (retVal);
|
return (retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkAverageHr(double hrVal) {
|
private boolean checkAverageHr(double hrVal) {
|
||||||
boolean retVal;
|
boolean retVal;
|
||||||
double avHr = getAverageHrAverage();
|
|
||||||
|
|
||||||
retVal = false;
|
retVal = false;
|
||||||
|
if (mAverageHrAlarmActive) {
|
||||||
|
double avHr = getAverageHrAverage();
|
||||||
if (avHr < mAverageHrAlarmThreshMin) {
|
if (avHr < mAverageHrAlarmThreshMin) {
|
||||||
retVal = true;
|
retVal = true;
|
||||||
}
|
}
|
||||||
@@ -176,6 +179,7 @@ public class SdAlgHr {
|
|||||||
retVal = true;
|
retVal = true;
|
||||||
}
|
}
|
||||||
Log.d(TAG, "checkAverageHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + mAverageHrAlarmThreshMin + ", " + mAverageHrAlarmThreshMin + "): Alarm=" + retVal);
|
Log.d(TAG, "checkAverageHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + mAverageHrAlarmThreshMin + ", " + mAverageHrAlarmThreshMin + "): Alarm=" + retVal);
|
||||||
|
}
|
||||||
return (retVal);
|
return (retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,6 +199,7 @@ public class SdAlgHr {
|
|||||||
retVal.add(checkSimpleHr(hrVal));
|
retVal.add(checkSimpleHr(hrVal));
|
||||||
retVal.add(checkAdaptiveHr(hrVal));
|
retVal.add(checkAdaptiveHr(hrVal));
|
||||||
retVal.add(checkAverageHr(hrVal));
|
retVal.add(checkAverageHr(hrVal));
|
||||||
|
|
||||||
return (retVal);
|
return (retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user