Skip to content

Commit

Permalink
Forecast Low alarm improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Nov 9, 2016
1 parent 5637fe8 commit de702f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public BgGraphBuilder(Context context, long start, long end, int numValues, bool
}
}
calibrations = Calibration.latestForGraph(numValues, start, end);
treatments = Treatments.latestForGraph(numValues, start, end);
treatments = Treatments.latestForGraph(numValues, start, end + (120 * 60 * 1000));
this.context = context;
this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
this.highMark = tolerantParseDouble(prefs.getString("highValue", "170"));
Expand Down Expand Up @@ -1404,7 +1404,7 @@ public static synchronized double getCurrentLowOccursAt() {
if (low_occurs_at_processed_till_timestamp < last_bg_reading_timestamp) {
Log.d(TAG, "Recalculating lowOccursAt: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp));
// new only the last hour worth of data for this
(new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 12, true)).addBgReadingValues();
(new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(false);
} else {
Log.d(TAG, "Cached current low timestamp ok: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp));
}
Expand Down

0 comments on commit de702f0

Please sign in to comment.