From 5fc63d8f166d577508601ae04ef2ad2a24ebdbbc Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 16 Aug 2017 14:17:28 +0200 Subject: [PATCH] restrict DIA for expectedDelta --- .../plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java | 2 +- .../androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java index 6e1070eac3..66696ac9b8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java @@ -208,7 +208,7 @@ public class DetermineBasalAdapterAMAJS { mProfile = new V8Object(mV8rt); mProfile.add("max_iob", maxIob); - mProfile.add("dia", profile.getDia()); + mProfile.add("dia", Math.min(profile.getDia(), 3d)); mProfile.add("type", "current"); mProfile.add("max_daily_basal", profile.getMaxDailyBasal()); mProfile.add("max_basal", maxBasal); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java index 7df122fc92..dc4d2ee70d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java @@ -231,7 +231,7 @@ public class DetermineBasalAdapterMAJS { String units = profile.getUnits(); mProfile.add("max_iob", maxIob); - mProfile.add("dia", profile.getDia()); + mProfile.add("dia", Math.min(profile.getDia(), 3d)); mProfile.add("type", "current"); mProfile.add("max_daily_basal", profile.getMaxDailyBasal()); mProfile.add("max_basal", maxBasal);