public static void delete_by_timestamp(long timestamp, int accuracy, boolean from_interactive) { final Treatments t = byTimestamp(timestamp, accuracy); // do we need to alter default accuracy? if (t != null) { Log.d(TAG, "Deleting treatment closest to: " + JoH.dateTimeText(timestamp) + " matches uuid: " + t.uuid); delete_by_uuid(t.uuid, from_interactive); } else { Log.e(TAG, "Couldn't find a treatment near enough to " + JoH.dateTimeText(timestamp) + " to delete!"); } }
public static synchronized void invalidateAllForSensor() { final List<Calibration> cals = allForSensorLimited(9999999); if (cals != null) { for (Calibration cal : cals) { cal.invalidate(); } } JoH.clearCache(); String msg = "Deleted all calibrations for sensor"; Log.ueh(TAG, msg); JoH.static_toast_long(msg); }
public static InitialDataQuality getInitialDataQuality() { // get uncalculated data JoH.clearCache(); final List<BgReading> uncalculated = BgReading.latestUnCalculated(3); return getInitialDataQuality(uncalculated); }
DataRequester(Context context, String thispath, byte[] thispayload) { path = thispath; payload = thispayload; if (JoH.quietratelimit("db-init",10)) { Sensor.InitDb(context);//ensure database has already been initialized } Log.d(TAG, "DataRequester DataRequester: " + thispath + " lastRequest:" + JoH.dateTimeText(lastRequest)); }
static double getCarbsToRaiseByMmolBetweenTwoTimes(double mmol, double whennow, double whenthen) { double result = (getCarbsToRaiseByMmol(mmol, whennow) + getCarbsToRaiseByMmol(mmol, whenthen)) / 2; UserError.Log.d(TAG, "GetCarbsToRaiseByMmolBetweenTwoTimes: " + JoH.qs(mmol) + " result: " + JoH.qs(result)); return result; }
public static void updateBatteryLevel(int sensorBatteryLevel, boolean from_sync) { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { Log.d("Sensor","Cant sync battery level from master as sensor data is null"); return; } updateBatteryLevel(sensor, sensorBatteryLevel, from_sync); }
public static boolean alertSnoozeOver() { ActiveBgAlert activeBgAlert = getOnly(); if (activeBgAlert == null) { // no alert exists, so snoozing is over... (this should not happen) Log.wtf(TAG, "ActiveBgAlert getOnly returning null (we have just checked it)"); return true; } return activeBgAlert.ready_to_alarm(); }
public static void UpdateBgVal(long timestamp, double calculated_value) { LibreBlock libreBlock = getForTimestamp(timestamp); if (libreBlock == null) { return; } Log.e(TAG, "Updating bg for timestamp " + timestamp); libreBlock.calculated_bg = calculated_value; libreBlock.save(); }
public static void delete_by_timestamp(long timestamp, int accuracy, boolean from_interactive) { final Treatments t = byTimestamp(timestamp, accuracy); // do we need to alter default accuracy? if (t != null) { Log.d(TAG, "Deleting treatment closest to: " + JoH.dateTimeText(timestamp) + " matches uuid: " + t.uuid); delete_by_uuid(t.uuid, from_interactive); } else { Log.e(TAG, "Couldn't find a treatment near enough to " + JoH.dateTimeText(timestamp) + " to delete!"); } }
public static synchronized void invalidateAllForSensor() { final List<Calibration> cals = allForSensorLimited(9999999); if (cals != null) { for (Calibration cal : cals) { cal.invalidate(); } } String msg = "Deleted all calibrations for sensor"; Log.ueh(TAG, msg); JoH.static_toast_long(msg); }
public static InitialDataQuality getInitialDataQuality() { // get uncalculated data JoH.clearCache(); final List<BgReading> uncalculated = BgReading.latestUnCalculated(3); return getInitialDataQuality(uncalculated); }
static double getCarbsToRaiseByMmolBetweenTwoTimes(double mmol, double whennow, double whenthen) { double result = (getCarbsToRaiseByMmol(mmol, whennow) + getCarbsToRaiseByMmol(mmol, whenthen)) / 2; UserError.Log.d(TAG, "GetCarbsToRaiseByMmolBetweenTwoTimes: " + JoH.qs(mmol) + " result: " + JoH.qs(result)); return result; }
public static void delete_by_timestamp(long timestamp, int accuracy, boolean from_interactive) { final Treatments t = byTimestamp(timestamp, accuracy); // do we need to alter default accuracy? if (t != null) { Log.d(TAG, "Deleting treatment closest to: " + JoH.dateTimeText(timestamp) + " matches uuid: " + t.uuid); delete_by_uuid(t.uuid, from_interactive); } else { Log.e(TAG, "Couldn't find a treatment near enough to " + JoH.dateTimeText(timestamp) + " to delete!"); } }
public static synchronized void invalidateAllForSensor() { final List<Calibration> cals = allForSensorLimited(9999999); if (cals != null) { for (Calibration cal : cals) { cal.invalidate(); } } JoH.clearCache(); String msg = "Deleted all calibrations for sensor"; Log.ueh(TAG, msg); JoH.static_toast_long(msg); }
public static InitialDataQuality getInitialDataQuality() { // get uncalculated data JoH.clearCache(); final List<BgReading> uncalculated = BgReading.latestUnCalculated(3); return getInitialDataQuality(uncalculated); }