public static BgReading bgReadingInsertFromG5(double calculated_value, long timestamp) { return bgReadingInsertFromG5(calculated_value, timestamp, null); }
public static BgReading bgReadingInsertFromG5(double calculated_value, long timestamp) { return bgReadingInsertFromG5(calculated_value, timestamp, null); }
public static BgReading bgReadingInsertFromG5(double calculated_value, long timestamp) { return bgReadingInsertFromG5(calculated_value, timestamp, null); }
private static void processBacksies(List<BackFillStream.Backsie> backsies) { boolean changed = false; for (BackFillStream.Backsie backsie : backsies) { final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime()); final long since = JoH.msSince(time); if ((since > HOUR_IN_MS * 6) || (since < 0)) { UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)"); } else { if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) { final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill"); lastGlucoseBgReading = bgr; UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); changed = true; } UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); } } if (changed) { updateStreamedTillTimeForBackfill(); } }
private static void processBacksies(List<BackFillStream.Backsie> backsies) { boolean changed = false; for (BackFillStream.Backsie backsie : backsies) { final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime()); final long since = JoH.msSince(time); if ((since > HOUR_IN_MS * 6) || (since < 0)) { UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)"); } else { if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) { final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill"); lastGlucoseBgReading = bgr; UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); changed = true; } UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); } } if (changed) { updateStreamedTillTimeForBackfill(); } }
private static void processBacksies(List<BackFillStream.Backsie> backsies) { boolean changed = false; for (BackFillStream.Backsie backsie : backsies) { final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime()); final long since = JoH.msSince(time); if ((since > HOUR_IN_MS * 6) || (since < 0)) { UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)"); } else { if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) { final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill"); lastGlucoseBgReading = bgr; UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); changed = true; } UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose())); } } if (changed) { updateStreamedTillTimeForBackfill(); } }
final BgReading bgr = BgReading.bgReadingInsertFromG5(400, timestamp); assertWithMessage("Test result A: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK)) final BgReading bgr = BgReading.bgReadingInsertFromG5(i == 20 ? 100 : 400, timestamp); assertWithMessage("Test result C: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK)) final BgReading bgr = BgReading.bgReadingInsertFromG5(i == 8 ? 100 : 400, timestamp); assertWithMessage("Test result D: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK))
final BgReading bgr = BgReading.bgReadingInsertFromG5(400, timestamp); assertWithMessage("Test result A: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK)) final BgReading bgr = BgReading.bgReadingInsertFromG5(i == 20 ? 100 : 400, timestamp); assertWithMessage("Test result C: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK)) final BgReading bgr = BgReading.bgReadingInsertFromG5(i == 8 ? 100 : 400, timestamp); assertWithMessage("Test result D: " + i + " " + JoH.dateTimeText(timestamp) + " different to expected") .that(PersistentHigh.dataQualityCheck(START_TIME + Constants.MINUTE_IN_MS * 10, HIGH_MARK))
if (glucose.usable() || (glucose.insufficient() && Pref.getBoolean("ob1_g5_use_insufficiently_calibrated", true))) { UserError.Log.d(TAG, "Got usable glucose data from G5!!"); final BgReading bgReading = BgReading.bgReadingInsertFromG5(glucose.glucose, JoH.tsl()); if (bgReading != null) { try {
if (glucose.usable() || (glucose.insufficient() && Pref.getBoolean("ob1_g5_use_insufficiently_calibrated", true))) { UserError.Log.d(TAG, "Got usable glucose data from G5!!"); final BgReading bgReading = BgReading.bgReadingInsertFromG5(glucose.glucose, JoH.tsl()); if (bgReading != null) { try {
if (glucose.usable() || (glucose.insufficient() && Pref.getBoolean("ob1_g5_use_insufficiently_calibrated", true))) { UserError.Log.d(TAG, "Got usable glucose data from G5!!"); final BgReading bgReading = BgReading.bgReadingInsertFromG5(glucose.glucose, JoH.tsl()); if (bgReading != null) { try {