Fixed but in seizure detection algorithm that meant that the alarmRatioThreshold only really increased in units of 10 (if you specified 50 to 59, it would only alarm if the actual ratio exceeded 60).

This commit is contained in:
Graham Jones
2022-02-18 22:35:07 +00:00
parent fb4ea0dcad
commit 4872178845
3 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="uk.org.openseizuredetector" package="uk.org.openseizuredetector"
android:versionCode="92" android:versionCode="92"
android:versionName="4.0.0h"> android:versionName="4.0.0i">
<!-- android:allowBackup="false" --> <!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -478,9 +478,9 @@ public abstract class SdDataSource {
*/ */
private void alarmCheck() { private void alarmCheck() {
boolean inAlarm; boolean inAlarm;
Log.v(TAG, "alarmCheck()"); Log.v(TAG, "alarmCheck() - roiPower="+mSdData.roiPower+" specPower="+ mSdData.specPower+" ratio="+10*mSdData.roiPower/ mSdData.specPower);
// Is the current set of data representing an alarm state? // Is the current set of data representing an alarm state?
if ((mSdData.roiPower > mAlarmThresh) && (10 * (mSdData.roiPower / mSdData.specPower) > mAlarmRatioThresh)) { if ((mSdData.roiPower > mAlarmThresh) && ((10 * mSdData.roiPower / mSdData.specPower) > mAlarmRatioThresh)) {
inAlarm = true; inAlarm = true;
} else { } else {
inAlarm = false; inAlarm = false;
@@ -510,7 +510,7 @@ public abstract class SdDataSource {
} }
} }
Log.v(TAG, "alarmCheck(): inAlarm=" + inAlarm + ", alarmState = " + mSdData.alarmState + " alarmCount=" + mAlarmCount + " mAlarmTime=" + mAlarmTime); Log.v(TAG, "alarmCheck(): inAlarm=" + inAlarm + ", alarmState = " + mSdData.alarmState + " alarmCount=" + mAlarmCount + " mWarnTime=" + mWarnTime+ " mAlarmTime=" + mAlarmTime);
} }

View File

@@ -202,7 +202,7 @@ public class SdWebServer extends NanoHTTPD {
} else { } else {
Log.v(TAG, "WebServer.serve() - Unknown uri -" + Log.v(TAG, "WebServer.serve() - Unknown uri -" +
uri); uri);
answer = "{'msg' : 'Unknown URI: '}"; answer = "{'msg' : 'Unknown URI: "+uri+"'}";
} }
} }
res = new NanoHTTPD.Response(answer); res = new NanoHTTPD.Response(answer);