Skip to content

Commit

Permalink
Infrequent calibration fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Oct 27, 2016
1 parent c8a5c6b commit bc2417c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -628,9 +628,10 @@ private static void calculate_w_l_s(boolean extended) {
}

// less than 5 calibrations in last 4 days? cast the net wider if in extended mode
if ((calibrations.size() < 5) && extended) {
final int ccount = calibrations.size();
if ((ccount < 5) && extended) {
calibrations = allForSensorLimited(5);
if (calibrations.size() >= 5) {
if (calibrations.size() > ccount) {
Home.toaststaticnext("Calibrated using data beyond last 4 days");
}
}
@@ -1058,7 +1059,6 @@ public static List<Calibration> allForSensorLimited(int limit) {
.where("Sensor = ? ", sensor.getId())
.where("slope_confidence != 0")
.where("sensor_confidence != 0")
.where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 4)))
.orderBy("timestamp desc")
.limit(limit)
.execute();

0 comments on commit bc2417c

Please sign in to comment.