diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 99f318c5a1..72a7a74248 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -554,11 +554,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) { ConfigBuilderPlugin configBuilderPlugin = MainApp.getConfigBuilder(); insulin = configBuilderPlugin.applyBolusConstraints(insulin); - // needs to be rounded to 0.1 - insulin = Round.roundTo(insulin, 0.1d); + // needs to be rounded + insulin = Round.roundTo(insulin, getPumpDescription().extendedBolusStep); PumpEnactResult result = new PumpEnactResult(); - if (getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < 0.1d) { + if (getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) { result.enacted = false; result.success = true; result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); @@ -567,12 +567,12 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf result.isPercent = false; result.isTempCancel = false; if (Config.logPumpActions) - log.debug("setExtendedBolus: Correct extended bolus already set"); + log.debug("setExtendedBolus: Correct extended bolus already set. Current: " + getDanaRPump().extendedBolusAmount + " Asked: " + insulin); return result; } int durationInHalfHours = Math.max(durationInMinutes / 30, 1); boolean connectionOK = sExecutionService.extendedBolus(insulin, durationInHalfHours); - if (connectionOK && getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < 0.1d) { + if (connectionOK && getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) { result.enacted = true; result.success = true; result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index e4a3d06959..02fe206197 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -554,11 +554,11 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) { ConfigBuilderPlugin configBuilderPlugin = MainApp.getConfigBuilder(); insulin = configBuilderPlugin.applyBolusConstraints(insulin); - // needs to be rounded to 0.1 - insulin = Round.roundTo(insulin, 0.1d); + // needs to be rounded + insulin = Round.roundTo(insulin, getPumpDescription().extendedBolusStep); PumpEnactResult result = new PumpEnactResult(); - if (getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < 0.1d) { + if (getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) { result.enacted = false; result.success = true; result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); @@ -567,12 +567,12 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints result.isPercent = false; result.isTempCancel = false; if (Config.logPumpActions) - log.debug("setExtendedBolus: Correct extended bolus already set"); + log.debug("setExtendedBolus: Correct extended bolus already set. Current: " + getDanaRPump().extendedBolusAmount + " Asked: " + insulin); return result; } int durationInHalfHours = Math.max(durationInMinutes / 30, 1); boolean connectionOK = sExecutionService.extendedBolus(insulin, durationInHalfHours); - if (connectionOK && getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < 0.1d) { + if (connectionOK && getDanaRPump().isExtendedInProgress && Math.abs(getDanaRPump().extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) { result.enacted = true; result.success = true; result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); 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 62d68ebb23..2df6dfc6be 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 @@ -99,6 +99,7 @@ public class OverviewFragment extends Fragment { TextView arrowView; TextView timeAgoView; TextView deltaView; + TextView avgdeltaView; TextView runningTempView; TextView baseBasalView; TextView activeProfileView; @@ -143,6 +144,7 @@ public class OverviewFragment extends Fragment { arrowView = (TextView) view.findViewById(R.id.overview_arrow); timeAgoView = (TextView) view.findViewById(R.id.overview_timeago); deltaView = (TextView) view.findViewById(R.id.overview_delta); + avgdeltaView = (TextView) view.findViewById(R.id.overview_avgdelta); runningTempView = (TextView) view.findViewById(R.id.overview_runningtemp); baseBasalView = (TextView) view.findViewById(R.id.overview_basebasal); activeProfileView = (TextView) view.findViewById(R.id.overview_activeprofile); @@ -570,8 +572,11 @@ public class OverviewFragment extends Fragment { bgView.setText(lastBG.valueToUnitsToString(profile.getUnits())); arrowView.setText(lastBG.directionToSymbol()); DatabaseHelper.GlucoseStatus glucoseStatus = MainApp.getDbHelper().getGlucoseStatusData(); - if (glucoseStatus != null) + if (glucoseStatus != null){ deltaView.setText("Δ " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units); + avgdeltaView.setText("øΔ " + NSProfile.toUnitsString(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, units) + " " + units); + } + BgReading.units = profile.getUnits(); } else return; diff --git a/app/src/main/res/layout/overview_fragment.xml b/app/src/main/res/layout/overview_fragment.xml index 0ed8929ff2..c6ba630b63 100644 --- a/app/src/main/res/layout/overview_fragment.xml +++ b/app/src/main/res/layout/overview_fragment.xml @@ -32,7 +32,7 @@ android:layout_gravity="top|left" android:gravity="center_vertical" android:text="00.0" - android:textSize="80dp" + android:textSize="70dp" android:textStyle="bold" /> + + +