Fixed latch alarm timer (fixes #146)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
OpenSeizureDetector Android App - Change Log
|
OpenSeizureDetector Android App - Change Log
|
||||||
============================================
|
============================================
|
||||||
|
V4.2.3b - fixed latched alarms (Issue #146)
|
||||||
V4.2.2 - Added support for PineTime OSD Status reporting.
|
V4.2.2 - Added support for PineTime OSD Status reporting.
|
||||||
V4.2.1 - Added support for PineTime wathes using the Bluetooth Data Source
|
V4.2.1 - Added support for PineTime wathes using the Bluetooth Data Source
|
||||||
V4.1.0 - Added experimental support for neural network based seizure detector.
|
V4.1.0 - Added experimental support for neural network based seizure detector.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:versionCode="136"
|
android:versionCode="137"
|
||||||
android:versionName="4.2.2">
|
android:versionName="4.2.3b">
|
||||||
<!-- 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" />
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
mUtil.showToast(getString(R.string.SMSAlarmDisabledNotSendingMsg));
|
mUtil.showToast(getString(R.string.SMSAlarmDisabledNotSendingMsg));
|
||||||
Log.v(TAG, "mSMSAlarm is false - not sending");
|
Log.v(TAG, "mSMSAlarm is false - not sending");
|
||||||
}
|
}
|
||||||
|
Log.v(TAG,"calling startLatchTimer()");
|
||||||
startLatchTimer();
|
startLatchTimer();
|
||||||
}
|
}
|
||||||
// Handle fall alarm
|
// Handle fall alarm
|
||||||
@@ -782,7 +782,6 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fault
|
// Fault
|
||||||
if ((sdData.alarmState) == 4 || (sdData.alarmState == 7) || (sdData.mHRFaultStanding) || (sdData.mHrFrozenFaultStanding)) {
|
if ((sdData.alarmState) == 4 || (sdData.alarmState == 7) || (sdData.mHRFaultStanding) || (sdData.mHrFrozenFaultStanding)) {
|
||||||
sdData.alarmPhrase = "FAULT";
|
sdData.alarmPhrase = "FAULT";
|
||||||
@@ -1007,15 +1006,20 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
private void startLatchTimer() {
|
private void startLatchTimer() {
|
||||||
if (mLatchAlarms) {
|
if (mLatchAlarms) {
|
||||||
if (mLatchAlarmTimer != null) {
|
if (mLatchAlarmTimer != null) {
|
||||||
Log.v(TAG, "startLatchTimer -timer already running - cancelling it");
|
Log.i(TAG, "startLatchTimer -timer already running - cancelling it");
|
||||||
mLatchAlarmTimer.cancel();
|
mLatchAlarmTimer.cancel();
|
||||||
mLatchAlarmTimer = null;
|
mLatchAlarmTimer = null;
|
||||||
}
|
}
|
||||||
Log.v(TAG, "startLatchTimer() - starting alarm latch release timer to time out in " + mLatchAlarmPeriod + " sec");
|
Log.i(TAG, "startLatchTimer() - starting alarm latch release timer to time out in " + mLatchAlarmPeriod + " sec");
|
||||||
// set timer to timeout after mLatchAlarmPeriod, and Tick() function to be called every second.
|
// set timer to timeout after mLatchAlarmPeriod, and Tick() function to be called every second.
|
||||||
mLatchAlarmTimer =
|
// We need to start the timer on the UI thread to get it to work for some reason - I don't know why!
|
||||||
new LatchAlarmTimer(mLatchAlarmPeriod * 1000, 1000);
|
runOnUiThread(new Runnable() {
|
||||||
mLatchAlarmTimer.start();
|
public void run() {
|
||||||
|
mLatchAlarmTimer =
|
||||||
|
new LatchAlarmTimer(mLatchAlarmPeriod * 1000, 1000);
|
||||||
|
mLatchAlarmTimer.start();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG, "startLatchTimer() - Latch Alarms disabled - not doing anything");
|
Log.v(TAG, "startLatchTimer() - Latch Alarms disabled - not doing anything");
|
||||||
}
|
}
|
||||||
@@ -1457,7 +1461,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
// called after startTime ms.
|
// called after startTime ms.
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
Log.v(TAG, "LatchAlarmTimer.onFinish()");
|
Log.i(TAG, "LatchAlarmTimer.onFinish()");
|
||||||
// Do the equivalent of accept alarm push button.
|
// Do the equivalent of accept alarm push button.
|
||||||
acceptAlarm();
|
acceptAlarm();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user