From ba83f7f499cff46094e45c3720d0fd8d0b80a4dc Mon Sep 17 00:00:00 2001 From: TebbeUbben Date: Sun, 8 Apr 2018 13:43:37 +0200 Subject: [PATCH] Correct lastDataTime handling --- .../androidaps/plugins/PumpInsight/InsightPlugin.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java index 21a59c326f..6cc856d46f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java @@ -242,7 +242,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai // TODO review if (!Config.NSCLIENT && !Config.G5UPLOADER) NSUpload.uploadDeviceStatus(); - lastDataTime = new Date(); } @Override @@ -283,7 +282,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai public void getPumpStatus() { log("getPumpStatus"); - lastDataTime = new Date(); if (Connector.get().isPumpConnected()) { log("is connected.. requesting status"); final UUID uuid = aSyncTaskRunner(new StatusTaskRunner(connector.getServiceConnector()), "Status"); @@ -439,7 +437,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai updateGui(); connector.tryToGetPumpStatusAgain(); - lastDataTime = new Date(); connector.requestHistorySync(30000); if (result.success) while (true) { @@ -538,8 +535,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai if (Config.logPumpComm) log.debug("Setting temp basal absolute: " + pumpEnactResult.success); - lastDataTime = new Date(); - updateGui(); connector.requestHistorySync(5000); @@ -621,7 +616,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai TemporaryBasal tempStop = new TemporaryBasal().date(System.currentTimeMillis()).source(Source.USER); TreatmentsPlugin.getPlugin().addToHistoryTempBasal(tempStop); } - lastDataTime = new Date(); updateGui(); if (Config.logPumpComm) log.debug("Canceling temp basal: "); // TODO get more info @@ -950,6 +944,7 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai singleMessageTaskRunner.fetch(new TaskRunner.ResultCallback() { @Override public void onResult(Object o) { + lastDataTime = new Date(); log(name + " success"); event.response_object = o; if (o instanceof BolusMessage) { @@ -988,6 +983,7 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai task.fetch(new TaskRunner.ResultCallback() { @Override public void onResult(Object o) { + lastDataTime = new Date(); log(name + " success"); event.response_object = o; event.success = true;