Round injected Units to Dash tick value 0.05U

This commit is contained in:
Philoul 2022-07-27 22:20:35 +02:00
parent f9bebfccba
commit 28fcdd8ada
3 changed files with 3 additions and 4 deletions

View file

@ -28,7 +28,6 @@
<string name="code_compare">Do the codes displayed on this device and on your pump match?</string>
<string name="insight_pairing">Insight pairing</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2f U / %2$.2f U delivered</string>
<string name="insight_alert_formatter">%1$s: %2$s</string>
<string name="tube_changed">Tube changed</string>
<string name="insightpump_shortname">Sight</string>

View file

@ -46,6 +46,7 @@ import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.Round
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.TimeChangeType
import info.nightscout.androidaps.utils.rx.AapsSchedulers
@ -698,7 +699,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
}
val percent = (waited.toFloat() / estimatedDeliveryTimeSeconds) * 100
updateBolusProgressDialog(
rh.gs(R.string.bolus_delivered, percent*requestedBolusAmount/100, requestedBolusAmount),
rh.gs(R.string.bolus_delivered, Round.roundTo(percent*requestedBolusAmount/100, PodConstants.POD_PULSE_BOLUS_UNITS), requestedBolusAmount),
percent.toInt()
)
}
@ -729,7 +730,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
val remainingUnits = podStateManager.lastBolus!!.bolusUnitsRemaining
val percent = ((requestedBolusAmount - remainingUnits) / requestedBolusAmount) * 100
updateBolusProgressDialog(
rh.gs(R.string.bolus_delivered, requestedBolusAmount - remainingUnits, requestedBolusAmount),
rh.gs(R.string.bolus_delivered, Round.roundTo(requestedBolusAmount - remainingUnits, PodConstants.POD_PULSE_BOLUS_UNITS), requestedBolusAmount),
percent.toInt()
)

View file

@ -46,7 +46,6 @@
<string name="omnipod_dash_unknown">Unknown state for the command</string>
<string name="omnipod_common_history_tbr_value">Rate: %1$.2f U, duration: %2$d minutes</string>
<string name="omnipod_common_history_bolus_value">%1$.2f U</string>
<string name="dash_bolusdelivering">Delivering %1$.2f U</string>
<string name="omnipod_common_alert_delivery_suspended">Insulin delivery is suspended</string>
<string name="omnipod_dash_connection_lost">Lost connection to pod</string>
<string name="omnipod_dash_bolus_already_in_progress">Another bolus is being delivered</string>