deviations < 2 as equal

This commit is contained in:
Milos Kozak 2017-05-04 21:09:17 +02:00
parent db5dcc0064
commit 645bcdbb8a
2 changed files with 6 additions and 3 deletions

View file

@ -60,4 +60,7 @@ public class Constants {
//Screen: Threshold for width to go into small width layout //Screen: Threshold for width to go into small width layout
public static final int SMALL_WIDTH = 320; public static final int SMALL_WIDTH = 320;
//Autosens
public static final double DEVIATION_TO_BE_EQUAL = 2.0;
} }

View file

@ -308,10 +308,10 @@ public class IobCobCalculatorPlugin implements PluginBase {
// calculate autosens only without COB // calculate autosens only without COB
if (autosensData.cob <= 0) { if (autosensData.cob <= 0) {
if (deviation > 0) { if (Math.abs(deviation) < Constants.DEVIATION_TO_BE_EQUAL) {
autosensData.pastSensitivity += "+";
} else if (deviation == 0) {
autosensData.pastSensitivity += "="; autosensData.pastSensitivity += "=";
} else if (deviation > 0) {
autosensData.pastSensitivity += "+";
} else { } else {
autosensData.pastSensitivity += "-"; autosensData.pastSensitivity += "-";
} }