V3.1.2 - Made fall alarms latch, irrespective of the latch alarm setting - this is because falls are transitory so to be useful the alarm has to latch so the user can tell what caused the beep.
This commit is contained in:
@@ -626,7 +626,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
acceptAlarmButton.setText("Accept Alarm");
|
||||
acceptAlarmButton.setBackgroundColor(Color.DKGRAY);
|
||||
if (mConnection.mBound)
|
||||
if (mConnection.mSdServer.isLatchAlarms()) {
|
||||
if ((mConnection.mSdServer.isLatchAlarms())
|
||||
|| mConnection.mSdServer.mSdData.mFallActive) {
|
||||
acceptAlarmButton.setEnabled(true);
|
||||
} else {
|
||||
acceptAlarmButton.setEnabled(false);
|
||||
|
||||
@@ -520,8 +520,11 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
long fallWindowSamp = (mFallWindow*mSdData.mSampleFreq)/1000; // Convert ms to samples.
|
||||
Log.v(TAG, "check_fall() - fallWindowSamp=" +fallWindowSamp);
|
||||
// Move window through sample buffer, checking for fall.
|
||||
mSdData.fallAlarmStanding = false;
|
||||
// Note - not resetting fallAlarmStanding means that fall alarms will always latch until the 'Accept Alarm' button
|
||||
// is pressed.
|
||||
//mSdData.fallAlarmStanding = false;
|
||||
if (mFallActive) {
|
||||
mSdData.mFallActive = true;
|
||||
for (i = 0; i < mSdData.mNsamp - fallWindowSamp; i++) { // i = window start point
|
||||
// Find max and min acceleration within window.
|
||||
minAcc = mSdData.rawData[i];
|
||||
@@ -538,6 +541,7 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mSdData.mFallActive = false;
|
||||
Log.v(TAG,"check_fall - mFallActive is false - doing nothing");
|
||||
}
|
||||
//if (debug) APP_LOG(APP_LOG_LEVEL_DEBUG,"check_fall() - minAcc=%d, maxAcc=%d",
|
||||
|
||||
Reference in New Issue
Block a user