From 645bcdbb8a249ce8a0a9a0dd398dcdb599e4a04f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 4 May 2017 21:09:17 +0200 Subject: [PATCH] deviations < 2 as equal --- app/src/main/java/info/nightscout/androidaps/Constants.java | 3 +++ .../plugins/IobCobCalculator/IobCobCalculatorPlugin.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 5149528372..ade1571bae 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -60,4 +60,7 @@ public class Constants { //Screen: Threshold for width to go into small width layout public static final int SMALL_WIDTH = 320; + + //Autosens + public static final double DEVIATION_TO_BE_EQUAL = 2.0; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index cda6af287a..0e9e4512ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -308,10 +308,10 @@ public class IobCobCalculatorPlugin implements PluginBase { // calculate autosens only without COB if (autosensData.cob <= 0) { - if (deviation > 0) { - autosensData.pastSensitivity += "+"; - } else if (deviation == 0) { + if (Math.abs(deviation) < Constants.DEVIATION_TO_BE_EQUAL) { autosensData.pastSensitivity += "="; + } else if (deviation > 0) { + autosensData.pastSensitivity += "+"; } else { autosensData.pastSensitivity += "-"; }