From f9bebfccbaf58eef77959495d5cecaf9138fd898 Mon Sep 17 00:00:00 2001 From: Philoul Date: Tue, 26 Jul 2022 22:31:52 +0200 Subject: [PATCH] Dash Bolus delivered ptogress dialog --- insight/build.gradle | 1 + .../androidaps/plugins/pump/insight/LocalInsightPlugin.java | 6 +++--- .../plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 4 ++-- pump-common/src/main/res/values/strings.xml | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/insight/build.gradle b/insight/build.gradle index 623c52532a..5e69a77ba6 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -25,6 +25,7 @@ android { dependencies { implementation project(':core') implementation project(':shared') + implementation project(':pump-common') api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 517d1c7ec4..503b68e53f 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -590,7 +590,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.getId()); final EventOverviewBolusProgress bolusingEvent = EventOverviewBolusProgress.INSTANCE; bolusingEvent.setT(t); - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, 0d, insulin)); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, 0d, insulin)); bolusingEvent.setPercent(0); rxBus.send(bolusingEvent); int trials = 0; @@ -629,14 +629,14 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai trials = -1; int percentBefore = bolusingEvent.getPercent(); bolusingEvent.setPercent((int) (100D / activeBolus.getInitialAmount() * (activeBolus.getInitialAmount() - activeBolus.getRemainingAmount()))); - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, activeBolus.getInitialAmount() - activeBolus.getRemainingAmount(), activeBolus.getInitialAmount())); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, activeBolus.getInitialAmount() - activeBolus.getRemainingAmount(), activeBolus.getInitialAmount())); if (percentBefore != bolusingEvent.getPercent()) rxBus.send(bolusingEvent); } else { synchronized ($bolusLock) { if (bolusCancelled || trials == -1 || trials++ >= 5) { if (!bolusCancelled) { - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, insulin, insulin)); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, insulin, insulin)); bolusingEvent.setPercent(100); rxBus.send(bolusingEvent); } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 84aa19951d..afbd388401 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -698,7 +698,7 @@ class OmnipodDashPumpPlugin @Inject constructor( } val percent = (waited.toFloat() / estimatedDeliveryTimeSeconds) * 100 updateBolusProgressDialog( - rh.gs(R.string.dash_bolusdelivering, requestedBolusAmount), + rh.gs(R.string.bolus_delivered, percent*requestedBolusAmount/100, requestedBolusAmount), percent.toInt() ) } @@ -729,7 +729,7 @@ class OmnipodDashPumpPlugin @Inject constructor( val remainingUnits = podStateManager.lastBolus!!.bolusUnitsRemaining val percent = ((requestedBolusAmount - remainingUnits) / requestedBolusAmount) * 100 updateBolusProgressDialog( - rh.gs(R.string.bolusdelivering, requestedBolusAmount), + rh.gs(R.string.bolus_delivered, requestedBolusAmount - remainingUnits, requestedBolusAmount), percent.toInt() ) diff --git a/pump-common/src/main/res/values/strings.xml b/pump-common/src/main/res/values/strings.xml index 8bbb70d064..d51c9755f6 100644 --- a/pump-common/src/main/res/values/strings.xml +++ b/pump-common/src/main/res/values/strings.xml @@ -7,6 +7,7 @@ OK Pump Serial Number + %1$.2f U / %2$.2f U delivered