public static Sensor createDefaultIfMissing() { final Sensor sensor = currentSensor(); if (sensor == null) { Sensor.create(JoH.tsl()); } return currentSensor(); }
public static Sensor createDefaultIfMissing() { final Sensor sensor = currentSensor(); if (sensor == null) { Sensor.create(JoH.tsl()); } return currentSensor(); }
public static Sensor createDefaultIfMissing() { final Sensor sensor = currentSensor(); if (sensor == null) { Sensor.create(JoH.tsl()); } return currentSensor(); }
if ((sensor == null) && (is_follower)) { Sensor.create(Math.round(JoH.ts())); // no sensor? no problem, create virtual one for follower sensor = Sensor.currentSensor();
if ((sensor == null) && (is_follower)) { Sensor.create(Math.round(JoH.ts())); // no sensor? no problem, create virtual one for follower sensor = Sensor.currentSensor();
if ((sensor == null) && (is_follower)) { Sensor.create(Math.round(JoH.ts())); // no sensor? no problem, create virtual one for follower sensor = Sensor.currentSensor();
Sensor.create(JoH.tsl() - HOUR_IN_MS * 3); isSensorActive = Sensor.isActive();
Sensor.create(JoH.tsl() - HOUR_IN_MS * 3); isSensorActive = Sensor.isActive();
public static void startSensorForTime(long startTime) { Sensor.create(startTime); UserError.Log.ueh("NEW SENSOR", "Sensor started at " + JoH.dateTimeText(startTime)); JoH.static_toast_long(gs(R.string.new_sensor_started)); startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_SYNC_SENSOR, TAG); LibreAlarmReceiver.clearSensorStats(); // TODO this is just a timer and could be confusing - consider removing this notification // JoH.scheduleNotification(xdrip.getAppContext(), "Sensor should be ready", xdrip.getAppContext().getString(R.string.please_enter_two_calibrations_to_get_started), 60 * 130, Home.SENSOR_READY_ID); // reverse libre hacky workaround Treatments.SensorStart((DexCollectionType.hasLibre() ? startTime + (3600000) : startTime)); CollectionServiceStarter.restartCollectionServiceBackground(); Ob1G5StateMachine.startSensor(startTime); JoH.clearCache(); Home.staticRefreshBGCharts(); }
public static void startSensorForTime(long startTime) { Sensor.create(startTime); UserError.Log.ueh("NEW SENSOR", "Sensor started at " + JoH.dateTimeText(startTime)); JoH.static_toast_long(gs(R.string.new_sensor_started)); startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_SYNC_SENSOR, TAG); LibreAlarmReceiver.clearSensorStats(); // TODO this is just a timer and could be confusing - consider removing this notification // JoH.scheduleNotification(xdrip.getAppContext(), "Sensor should be ready", xdrip.getAppContext().getString(R.string.please_enter_two_calibrations_to_get_started), 60 * 130, Home.SENSOR_READY_ID); // reverse libre hacky workaround Treatments.SensorStart((DexCollectionType.hasLibre() ? startTime + (3600000) : startTime)); CollectionServiceStarter.restartCollectionServiceBackground(); Ob1G5StateMachine.startSensor(startTime); JoH.clearCache(); Home.staticRefreshBGCharts(); }
assertWithMessage("No sensor ok time should fail").that(PersistentHigh.dataQualityCheck(START_TIME, HIGH_MARK)).isFalse(); assertWithMessage("No sensor ok time should fail 2").that(PersistentHigh.dataQualityCheck(JoH.tsl(), HIGH_MARK)).isFalse(); Sensor.create(1005); assertWithMessage("Predating sensor should fail").that(PersistentHigh.dataQualityCheck(1000, HIGH_MARK)).isFalse(); assertWithMessage("Post sensor start no data should fail").that(PersistentHigh.dataQualityCheck(JoH.tsl(), HIGH_MARK)).isFalse(); Sensor.create(START_TIME); Sensor.create(START_TIME); Sensor.create(START_TIME);
assertWithMessage("No sensor ok time should fail").that(PersistentHigh.dataQualityCheck(START_TIME, HIGH_MARK)).isFalse(); assertWithMessage("No sensor ok time should fail 2").that(PersistentHigh.dataQualityCheck(JoH.tsl(), HIGH_MARK)).isFalse(); Sensor.create(1005); assertWithMessage("Predating sensor should fail").that(PersistentHigh.dataQualityCheck(1000, HIGH_MARK)).isFalse(); assertWithMessage("Post sensor start no data should fail").that(PersistentHigh.dataQualityCheck(JoH.tsl(), HIGH_MARK)).isFalse(); Sensor.create(START_TIME); Sensor.create(START_TIME); Sensor.create(START_TIME);