From a24cbfda500aaead3a049571b2d55432902336ae Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 1 Aug 2017 17:37:32 +0200 Subject: [PATCH] Disconnect pump: cancel temp before setting new to make sure it will last as expected --- .../androidaps/plugins/Overview/OverviewFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 71f205551e..94472ce9f4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -506,6 +506,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, sHandler.post(new Runnable() { @Override public void run() { + MainApp.getConfigBuilder().cancelTempBasal(); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 30); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -520,6 +521,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, sHandler.post(new Runnable() { @Override public void run() { + MainApp.getConfigBuilder().cancelTempBasal(); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -534,6 +536,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, sHandler.post(new Runnable() { @Override public void run() { + MainApp.getConfigBuilder().cancelTempBasal(); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 2 * 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -548,6 +551,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, sHandler.post(new Runnable() { @Override public void run() { + MainApp.getConfigBuilder().cancelTempBasal(); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 3 * 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror));