From 60c7a6f2e63839f297d8e434191936d25cf9c067 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sat, 9 Jan 2021 03:00:45 +0100 Subject: [PATCH] wear: forecast below 400 not 300 --- .../info/nightscout/androidaps/watchfaces/BgGraphBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java index 7666dcd907..571306de3d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java @@ -31,6 +31,7 @@ import lecho.lib.hellocharts.model.Viewport; */ public class BgGraphBuilder { public static final double MAX_PREDICTION__TIME_RATIO = (3d / 5); + public static final double UPPER_CUTOFF_SGV = 300; private final long predictionEndTime; private final List predictionsList; private final ArrayList bolusWatchDataList; @@ -317,7 +318,7 @@ public class BgGraphBuilder { long endTime = getPredictionEndTime(); for (BgWatchData bwd : predictionsList) { if (bwd.timestamp <= endTime) { - double value = bwd.sgv < 300 ? bwd.sgv : 300; + double value = Math.min(bwd.sgv, UPPER_CUTOFF_SGV); if (!values.containsKey(bwd.color)) { values.put(bwd.color, new ArrayList<>()); }