From 6f7cfdd06dba07907a8dd4781182d12e9d4424b5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 22 Nov 2020 14:13:29 +0100 Subject: [PATCH] report failed TBR properly --- .../nightscout/androidaps/plugins/aps/loop/LoopPlugin.java | 3 +++ .../java/info/nightscout/androidaps/data/PumpEnactResult.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java index 0040dbc6fc..a4b96354fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java @@ -551,6 +551,9 @@ public class LoopPlugin extends PluginBase implements LoopInterface { rxBus.send(new EventLoopUpdateGui()); } }); + } else { + lastRun.setTbrSetByPump(result); + lastRun.setLastTBRRequest(lastRun.getLastAPSRun()); } rxBus.send(new EventLoopUpdateGui()); } diff --git a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java b/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java index 16c3707536..cb44e77486 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java +++ b/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java @@ -170,7 +170,9 @@ public class PumpEnactResult { ret += "
" + resourceHelper.gs(R.string.absolute) + ": " + DecimalFormatter.to2Decimal(absolute) + " U/h"; } } else { - ret += "
" + resourceHelper.gs(R.string.comment) + ": " + comment; + ret += "
" + resourceHelper.gs(R.string.success) + ": " + success; + if (!comment.isEmpty()) + ret += "
" + resourceHelper.gs(R.string.comment) + ": " + comment; } return ret; }