Merge pull request #155 from OpenSeizureDetector/HR-activation-toggling

Hr activation toggling
This commit is contained in:
Graham Jones
2024-03-23 20:05:11 +00:00
committed by GitHub

View File

@@ -146,13 +146,16 @@ public class SdAlgHr {
private boolean checkAdaptiveHr(double hrVal) {
boolean retVal;
retVal = false;
if (mAdaptiveHrAlarmActive) {
double hrThreshMin;
double hrThreshMax;
double avHr = getAdaptiveHrAverage();
hrThreshMin = avHr - mAdaptiveHrAlarmThresh;
hrThreshMax = avHr + mAdaptiveHrAlarmThresh;
retVal = false;
if (hrVal < hrThreshMin) {
retVal = true;
}
@@ -160,15 +163,15 @@ public class SdAlgHr {
retVal = true;
}
Log.d(TAG, "checkAdaptiveHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + hrThreshMin + ", " + hrThreshMax + "): Alarm=" + retVal);
}
return (retVal);
}
private boolean checkAverageHr(double hrVal) {
boolean retVal;
double avHr = getAverageHrAverage();
retVal = false;
if (mAverageHrAlarmActive) {
double avHr = getAverageHrAverage();
if (avHr < mAverageHrAlarmThreshMin) {
retVal = true;
}
@@ -176,6 +179,7 @@ public class SdAlgHr {
retVal = true;
}
Log.d(TAG, "checkAverageHr() - hrVal=" + hrVal + ", avHr=" + avHr + ", thresholds=(" + mAverageHrAlarmThreshMin + ", " + mAverageHrAlarmThreshMin + "): Alarm=" + retVal);
}
return (retVal);
}
@@ -195,6 +199,7 @@ public class SdAlgHr {
retVal.add(checkSimpleHr(hrVal));
retVal.add(checkAdaptiveHr(hrVal));
retVal.add(checkAverageHr(hrVal));
return (retVal);
}