From 724c1edfd59a5d54a6022ceb17972e103b1df69b Mon Sep 17 00:00:00 2001 From: Tim Gunn <2896311+Tornado-Tim@users.noreply.github.com> Date: Fri, 29 Nov 2019 20:23:30 +1300 Subject: [PATCH] Add Noise to be used later when needed --- .../plugins/iob/iobCobCalculator/GlucoseStatus.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.java index 159c5865af..512c22d2e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.java @@ -21,6 +21,7 @@ import info.nightscout.androidaps.utils.Round; public class GlucoseStatus { private static Logger log = LoggerFactory.getLogger(GlucoseStatus.class); public double glucose = 0d; + public double noise = 0d; public double delta = 0d; public double avgdelta = 0d; public double short_avgdelta = 0d; @@ -30,6 +31,7 @@ public class GlucoseStatus { public String log() { return "Glucose: " + DecimalFormatter.to0Decimal(glucose) + " mg/dl " + + "Noise: " + DecimalFormatter.to0Decimal(noise) + " " + "Delta: " + DecimalFormatter.to0Decimal(delta) + " mg/dl" + "Short avg. delta: " + " " + DecimalFormatter.to2Decimal(short_avgdelta) + " mg/dl " + "Long avg. delta: " + DecimalFormatter.to2Decimal(long_avgdelta) + " mg/dl"; @@ -40,6 +42,7 @@ public class GlucoseStatus { public GlucoseStatus round() { this.glucose = Round.roundTo(this.glucose, 0.1); + this.noise = Round.roundTo(this.noise, 0.1); this.delta = Round.roundTo(this.delta, 0.01); this.avgdelta = Round.roundTo(this.avgdelta, 0.01); this.short_avgdelta = Round.roundTo(this.short_avgdelta, 0.01); @@ -89,6 +92,7 @@ public class GlucoseStatus { if (sizeRecords == 1) { GlucoseStatus status = new GlucoseStatus(); status.glucose = now.value; + status.noise = 0d; status.short_avgdelta = 0d; status.delta = 0d; status.long_avgdelta = 0d; @@ -148,6 +152,7 @@ public class GlucoseStatus { GlucoseStatus status = new GlucoseStatus(); status.glucose = now.value; status.date = now_date; + status.noise = 0d; //for now set to nothing as not all CGMs report noise status.short_avgdelta = average(short_deltas);