From 0655e4e6765ccfeaf2b3d2fd5172bb17a1cf44cf Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sat, 13 Jan 2018 16:28:34 +0100 Subject: [PATCH 1/3] SMB: clean up APSResult.toSpanned a bit. (cherry picked from commit 10d7c79) --- .../androidaps/plugins/Loop/APSResult.java | 43 +++++++++++++------ app/src/main/res/values/strings.xml | 1 + 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java index 6e81c1a619..dc408c443e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java @@ -42,14 +42,24 @@ public class APSResult { public String toString() { final PumpInterface pump = ConfigBuilderPlugin.getActivePump(); if (changeRequested) { + String ret; + // rate if (rate == 0 && duration == 0) - return MainApp.sResources.getString(R.string.canceltemp); + ret = MainApp.sResources.getString(R.string.canceltemp) + "\n"; + else if (rate == -1) + ret = MainApp.sResources.getString(R.string.let_tbr_run) + "\n"; else - return MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h " + - "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%)\n" + - MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to0Decimal(duration) + " min\n" + - (smb != 0 ? ("SMB: " + DecimalFormatter.to2Decimal(smb) + " U\n") : "") + - MainApp.sResources.getString(R.string.reason) + ": " + reason; + ret = MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h " + + "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%) \n" + + MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to2Decimal(duration) + " min\n"; + + // smb + if (smb != 0) + ret += ("SMB: " + DecimalFormatter.to2Decimal(smb) + " U\n"); + + // reason + ret += MainApp.sResources.getString(R.string.reason) + ": " + reason; + return ret; } else return MainApp.sResources.getString(R.string.nochangerequested); } @@ -57,14 +67,23 @@ public class APSResult { public Spanned toSpanned() { final PumpInterface pump = ConfigBuilderPlugin.getActivePump(); if (changeRequested) { - String ret = ""; - if (rate == 0 && duration == 0) ret = MainApp.sResources.getString(R.string.canceltemp); + String ret; + // rate + if (rate == 0 && duration == 0) + ret = MainApp.sResources.getString(R.string.canceltemp) + "
"; + else if (rate == -1) + ret = MainApp.sResources.getString(R.string.let_tbr_run) + "
"; else ret = "" + MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h " + - "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%)
" + - "" + MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to2Decimal(duration) + " min
" + - (smb != 0 ? ("" + "SMB" + ": " + DecimalFormatter.to2Decimal(smb) + " U
") : "") + - "" + MainApp.sResources.getString(R.string.reason) + ": " + reason.replace("<", "<").replace(">", ">"); + "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%)
" + + "" + MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to2Decimal(duration) + " min
"; + + // smb + if (smb != 0) + ret += ("" + "SMB" + ": " + DecimalFormatter.to2Decimal(smb) + " U
"); + + // reason + ret += "" + MainApp.sResources.getString(R.string.reason) + ": " + reason.replace("<", "<").replace(">", ">"); return Html.fromHtml(ret); } else return Html.fromHtml(MainApp.sResources.getString(R.string.nochangerequested)); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 08f8786f0a..9b73a8a04d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -887,5 +887,6 @@ Enable SMB when there is temp target active (eating soon, exercise) Enable SMB with high temp targets Enable SMB when there is high temp target active (exercise) + Let current temp run From 6fa1badcdb278013c2d25f7f9622b7d5703f9f33 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sat, 27 Jan 2018 06:36:04 +0100 Subject: [PATCH 2/3] Clean up parsing of SMB result and applying the requests. --- .../ConfigBuilder/ConfigBuilderPlugin.java | 74 +++++++---------- .../androidaps/plugins/Loop/APSResult.java | 17 ++-- .../androidaps/plugins/Loop/LoopPlugin.java | 4 +- .../OpenAPSAMA/DetermineBasalResultAMA.java | 14 ++-- .../plugins/OpenAPSAMA/OpenAPSAMAPlugin.java | 7 +- .../OpenAPSMA/DetermineBasalResultMA.java | 15 ++-- .../plugins/OpenAPSMA/OpenAPSMAPlugin.java | 6 +- .../OpenAPSSMB/DetermineBasalResultSMB.java | 82 ++++++++++--------- .../plugins/OpenAPSSMB/OpenAPSSMBPlugin.java | 11 +-- .../plugins/Overview/OverviewFragment.java | 5 +- .../plugins/Wear/ActionStringHandler.java | 2 +- 11 files changed, 113 insertions(+), 124 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index afe9563797..66082b6da7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -357,13 +357,8 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr /** * expect absolute request and allow both absolute and percent response based on pump capabilities - * - * @param request - * @return true if command is going to be executed - * false if error */ - - public boolean applyAPSRequest(APSResult request, Callback callback) { + public void applyAPSRequest(APSResult request, Callback callback) { PumpInterface pump = getActivePump(); request.rate = applyBasalConstraints(request.rate); @@ -372,7 +367,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr if (callback != null) { callback.result(new PumpEnactResult().comment(MainApp.sResources.getString(R.string.pumpNotInitialized)).enacted(false).success(false)).run(); } - return false; + return; } if (pump.isSuspended()) { @@ -380,46 +375,41 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr if (callback != null) { callback.result(new PumpEnactResult().comment(MainApp.sResources.getString(R.string.pumpsuspended)).enacted(false).success(false)).run(); } - return false; + return; } if (Config.logCongigBuilderActions) log.debug("applyAPSRequest: " + request.toString()); - if ((request.rate == 0 && request.duration == 0) || Math.abs(request.rate - pump.getBaseBasalRate()) < pump.getPumpDescription().basalStep) { - if (isTempBasalInProgress()) { + + if (request.tbrRequested) { + if ((request.rate == 0 && request.duration == 0) || Math.abs(request.rate - pump.getBaseBasalRate()) < pump.getPumpDescription().basalStep) { + if (isTempBasalInProgress()) { + if (Config.logCongigBuilderActions) + log.debug("applyAPSRequest: cancelTempBasal()"); + getCommandQueue().cancelTempBasal(false, callback); + } else { + if (Config.logCongigBuilderActions) + log.debug("applyAPSRequest: Basal set correctly"); + if (callback != null) { + callback.result(new PumpEnactResult().absolute(request.rate).duration(0).enacted(false).success(true).comment("Basal set correctly")).run(); + } + } + } else if (isTempBasalInProgress() + && getTempBasalRemainingMinutesFromHistory() > 5 + && Math.abs(request.rate - getTempBasalAbsoluteRateHistory()) < pump.getPumpDescription().basalStep) { if (Config.logCongigBuilderActions) - log.debug("applyAPSRequest: cancelTempBasal()"); - getCommandQueue().cancelTempBasal(false, callback); - if (request.smb == 0) - return true; + log.debug("applyAPSRequest: Temp basal set correctly"); + if (callback != null) { + callback.result(new PumpEnactResult().absolute(getTempBasalAbsoluteRateHistory()).duration(getTempBasalFromHistory(System.currentTimeMillis()).getPlannedRemainingMinutes()).enacted(false).success(true).comment("Temp basal set correctly")).run(); + } } else { if (Config.logCongigBuilderActions) - log.debug("applyAPSRequest: Basal set correctly"); - if (callback != null) { - callback.result(new PumpEnactResult().absolute(request.rate).duration(0).enacted(false).success(true).comment("Basal set correctly")).run(); - } - if (request.smb == 0) - return false; + log.debug("applyAPSRequest: setTempBasalAbsolute()"); + getCommandQueue().tempBasalAbsolute(request.rate, request.duration, false, callback); } - } else if (isTempBasalInProgress() - && getTempBasalRemainingMinutesFromHistory() > 5 - && Math.abs(request.rate - getTempBasalAbsoluteRateHistory()) < pump.getPumpDescription().basalStep) { - if (Config.logCongigBuilderActions) - log.debug("applyAPSRequest: Temp basal set correctly"); - if (callback != null) { - callback.result(new PumpEnactResult().absolute(getTempBasalAbsoluteRateHistory()).duration(getTempBasalFromHistory(System.currentTimeMillis()).getPlannedRemainingMinutes()).enacted(false).success(true).comment("Temp basal set correctly")).run(); - } - if (request.smb == 0) - return false; - } else { - if (Config.logCongigBuilderActions) - log.debug("applyAPSRequest: setTempBasalAbsolute()"); - getCommandQueue().tempBasalAbsolute(request.rate, request.duration, false, callback); - - if (request.smb == 0) return true; } - log.debug("SMB requested in config is: " + request.smb); - if (request.smb != 0) { + + if (request.bolusRequested) { long lastBolusTime = getLastBolusTime(); if (lastBolusTime != 0 && lastBolusTime + 3 * 60 * 1000 > System.currentTimeMillis()) { log.debug("SMB requsted but still in 3 min interval"); @@ -430,17 +420,11 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr detailedBolusInfo.isSMB = true; detailedBolusInfo.source = Source.USER; detailedBolusInfo.deliverAt = request.deliverAt; - boolean smbDelivered = getCommandQueue().bolus(detailedBolusInfo, callback); - if (smbDelivered) - return true; - else - return false; + getCommandQueue().bolus(detailedBolusInfo, callback); } } - return true; } - /** * Constraints interface **/ diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java index dc408c443e..b531a5263d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java @@ -31,7 +31,8 @@ public class APSResult { public String reason; public double rate; public int duration; - public boolean changeRequested = false; + public boolean tbrRequested = false; + public boolean bolusRequested = false; public IobTotal iob; public JSONObject json = new JSONObject(); public boolean hasPredictions = false; @@ -41,7 +42,7 @@ public class APSResult { @Override public String toString() { final PumpInterface pump = ConfigBuilderPlugin.getActivePump(); - if (changeRequested) { + if (isChangeRequested()) { String ret; // rate if (rate == 0 && duration == 0) @@ -66,7 +67,7 @@ public class APSResult { public Spanned toSpanned() { final PumpInterface pump = ConfigBuilderPlugin.getActivePump(); - if (changeRequested) { + if (isChangeRequested()) { String ret; // rate if (rate == 0 && duration == 0) @@ -94,10 +95,11 @@ public class APSResult { public APSResult clone() { APSResult newResult = new APSResult(); - newResult.reason = new String(reason); + newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; + newResult.tbrRequested = tbrRequested; + newResult.bolusRequested = bolusRequested; newResult.iob = iob; return newResult; } @@ -105,7 +107,7 @@ public class APSResult { public JSONObject json() { JSONObject json = new JSONObject(); try { - if (changeRequested) { + if (isChangeRequested()) { json.put("rate", rate); json.put("duration", duration); json.put("reason", reason); @@ -213,4 +215,7 @@ public class APSResult { return latest; } + public boolean isChangeRequested() { + return tbrRequested || bolusRequested; + } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java index 7d372aa3d8..d8c1433290 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java @@ -315,7 +315,7 @@ public class LoopPlugin implements PluginBase { } if (constraintsInterface.isClosedModeEnabled()) { - if (result.changeRequested) { + if (result.isChangeRequested()) { final PumpEnactResult waiting = new PumpEnactResult(); final PumpEnactResult previousResult = lastRun.setByPump; waiting.queued = true; @@ -339,7 +339,7 @@ public class LoopPlugin implements PluginBase { lastRun.source = null; } } else { - if (result.changeRequested && allowNotification) { + if (result.isChangeRequested() && allowNotification) { NotificationCompat.Builder builder = new NotificationCompat.Builder(MainApp.instance().getApplicationContext()); builder.setSmallIcon(R.drawable.notif_icon) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java index 9f532e3daf..4525929223 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java @@ -22,7 +22,7 @@ public class DetermineBasalResultAMA extends APSResult { json = j; if (result.containsKey("error")) { reason = result.get("error").toString(); - changeRequested = false; + tbrRequested = false; rate = -1; duration = -1; } else { @@ -32,19 +32,20 @@ public class DetermineBasalResultAMA extends APSResult { if (result.containsKey("rate")) { rate = (Double) result.get("rate"); if (rate < 0d) rate = 0d; - changeRequested = true; + tbrRequested = true; } else { rate = -1; - changeRequested = false; + tbrRequested = false; } if (result.containsKey("duration")) { duration = ((Double) result.get("duration")).intValue(); //changeRequested as above } else { duration = -1; - changeRequested = false; + tbrRequested = false; } } + bolusRequested = false; } public DetermineBasalResultAMA() { @@ -54,13 +55,12 @@ public class DetermineBasalResultAMA extends APSResult { @Override public DetermineBasalResultAMA clone() { DetermineBasalResultAMA newResult = new DetermineBasalResultAMA(); - newResult.reason = new String(reason); + newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; + newResult.tbrRequested = tbrRequested; newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; try { newResult.json = new JSONObject(json.toString()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java index 4a12212cc2..b2d0990eda 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java @@ -30,7 +30,6 @@ import info.nightscout.utils.NSUpload; import info.nightscout.utils.Profiler; import info.nightscout.utils.Round; import info.nightscout.utils.SP; -import info.nightscout.utils.SafeParse; import info.nightscout.utils.ToastUtils; /** @@ -244,15 +243,15 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { Profiler.log(log, "AMA calculation", start); // Fix bug determine basal if (determineBasalResultAMA.rate == 0d && determineBasalResultAMA.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultAMA.changeRequested = false; + determineBasalResultAMA.tbrRequested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultAMA.rate == 0 && determineBasalResultAMA.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultAMA.changeRequested = false; + determineBasalResultAMA.tbrRequested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1) - determineBasalResultAMA.changeRequested = false; + determineBasalResultAMA.tbrRequested = false; } determineBasalResultAMA.iob = iobArray[0]; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java index 2182e28e5c..b106ec4149 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java @@ -6,7 +6,6 @@ import org.mozilla.javascript.NativeObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.plugins.Loop.APSResult; public class DetermineBasalResultMA extends APSResult { @@ -21,7 +20,7 @@ public class DetermineBasalResultMA extends APSResult { json = j; if (result.containsKey("error")) { reason = (String) result.get("error"); - changeRequested = false; + tbrRequested = false; rate = -1; duration = -1; mealAssist = ""; @@ -32,17 +31,17 @@ public class DetermineBasalResultMA extends APSResult { if (result.containsKey("rate")) { rate = (Double) result.get("rate"); if (rate < 0d) rate = 0d; - changeRequested = true; + tbrRequested = true; } else { rate = -1; - changeRequested = false; + tbrRequested = false; } if (result.containsKey("duration")) { duration = ((Double) result.get("duration")).intValue(); //changeRequested as above } else { duration = -1; - changeRequested = false; + tbrRequested = false; } if (result.containsKey("mealAssist")) { mealAssist = result.get("mealAssist").toString(); @@ -59,10 +58,10 @@ public class DetermineBasalResultMA extends APSResult { newResult.reason = new String(reason); newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; + newResult.tbrRequested = isChangeRequested(); newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; + newResult.tbrRequested = isChangeRequested(); try { newResult.json = new JSONObject(json.toString()); @@ -71,7 +70,7 @@ public class DetermineBasalResultMA extends APSResult { } newResult.eventualBG = eventualBG; newResult.snoozeBG = snoozeBG; - newResult.mealAssist = new String(mealAssist); + newResult.mealAssist = mealAssist; return newResult; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java index d56dc44b89..134637d6ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java @@ -229,15 +229,15 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface { DetermineBasalResultMA determineBasalResultMA = determineBasalAdapterMAJS.invoke(); // Fix bug determinef basal if (determineBasalResultMA.rate == 0d && determineBasalResultMA.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultMA.changeRequested = false; + determineBasalResultMA.tbrRequested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultMA.rate == 0 && determineBasalResultMA.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultMA.changeRequested = false; + determineBasalResultMA.tbrRequested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1) - determineBasalResultMA.changeRequested = false; + determineBasalResultMA.tbrRequested = false; } determineBasalResultMA.iob = iobTotal; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java index 62aa9ed247..51e1cf2938 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java @@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.OpenAPSSMB; import org.json.JSONException; import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Date; @@ -9,8 +11,12 @@ import info.nightscout.androidaps.plugins.Loop.APSResult; import info.nightscout.utils.DateUtil; public class DetermineBasalResultSMB extends APSResult { + private static final Logger log = LoggerFactory.getLogger(DetermineBasalResultSMB.class); + public double eventualBG; public double snoozeBG; + public double insulinReq; + public double carbsReq; public DetermineBasalResultSMB(JSONObject result) { this(); @@ -19,46 +25,42 @@ public class DetermineBasalResultSMB extends APSResult { try { if (result.has("error")) { reason = result.getString("error"); - changeRequested = false; + return; + } + + reason = result.getString("reason"); + if (result.has("eventualBG")) eventualBG = result.getDouble("eventualBG"); + if (result.has("snoozeBG")) snoozeBG = result.getDouble("snoozeBG"); + if (result.has("insulinReq")) insulinReq = result.getDouble("insulinReq"); + if (result.has("carbsReq")) carbsReq = result.getDouble("carbsReq"); + + if (result.has("rate") && result.has("duration")) { + tbrRequested = true; + rate = result.getDouble("rate"); + if (rate < 0d) rate = 0d; + duration = result.getInt("duration"); + } else { rate = -1; duration = -1; + } + + if (result.has("units")) { + bolusRequested = true; + smb = result.getDouble("units"); } else { - reason = result.getString("reason"); - if (result.has("eventualBG")) eventualBG = result.getDouble("eventualBG"); - if (result.has("snoozeBG")) snoozeBG = result.getDouble("snoozeBG"); - if (result.has("rate")) { - rate = result.getDouble("rate"); - if (rate < 0d) rate = 0d; - changeRequested = true; - } else { - rate = -1; - changeRequested = false; - } - if (result.has("duration")) { - duration = result.getInt("duration"); - //changeRequested as above - } else { - duration = -1; - changeRequested = false; - } - if (result.has("units")) { - changeRequested = true; - smb = result.getDouble("units"); - } else { - smb = 0d; - //changeRequested as above - } - if (result.has("deliverAt")) { - String date = result.getString("deliverAt"); - try { - deliverAt = DateUtil.fromISODateString(date).getTime(); - } catch (Exception e) { - e.printStackTrace(); - } + smb = 0d; + } + + if (result.has("deliverAt")) { + String date = result.getString("deliverAt"); + try { + deliverAt = DateUtil.fromISODateString(date).getTime(); + } catch (Exception e) { + log.warn("Error parsing 'deliverAt' date: " + date, e); } } } catch (JSONException e) { - e.printStackTrace(); + log.error("Error parsing determine-basal result JSON", e); } } @@ -69,10 +71,11 @@ public class DetermineBasalResultSMB extends APSResult { @Override public DetermineBasalResultSMB clone() { DetermineBasalResultSMB newResult = new DetermineBasalResultSMB(); - newResult.reason = new String(reason); + newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.changeRequested = changeRequested; + newResult.tbrRequested = tbrRequested; + newResult.bolusRequested = bolusRequested; newResult.rate = rate; newResult.duration = duration; newResult.smb = smb; @@ -81,7 +84,7 @@ public class DetermineBasalResultSMB extends APSResult { try { newResult.json = new JSONObject(json.toString()); } catch (JSONException e) { - e.printStackTrace(); + log.error("Error clone parsing determine-basal result", e); } newResult.eventualBG = eventualBG; newResult.snoozeBG = snoozeBG; @@ -92,10 +95,9 @@ public class DetermineBasalResultSMB extends APSResult { @Override public JSONObject json() { try { - JSONObject ret = new JSONObject(this.json.toString()); - return ret; + return new JSONObject(this.json.toString()); } catch (JSONException e) { - e.printStackTrace(); + log.error("Error converting determine-basal result to JSON", e); } return null; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java index be600ee9e2..66974038ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java @@ -246,17 +246,18 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface { DetermineBasalResultSMB determineBasalResultSMB = determineBasalAdapterSMBJS.invoke(); Profiler.log(log, "SMB calculation", start); + // TODO still needed with oref1? // Fix bug determine basal if (determineBasalResultSMB.rate == 0d && determineBasalResultSMB.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultSMB.changeRequested = false; + determineBasalResultSMB.tbrRequested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultSMB.rate == 0 && determineBasalResultSMB.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultSMB.changeRequested = false; + determineBasalResultSMB.tbrRequested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - pump.getBaseBasalRate()) < 0.1) { - determineBasalResultSMB.changeRequested = false; + determineBasalResultSMB.tbrRequested = false; } } @@ -278,11 +279,11 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface { } // safety checks - public static boolean checkOnlyHardLimits(Double value, String valueName, double lowLimit, double highLimit) { + private static boolean checkOnlyHardLimits(Double value, String valueName, double lowLimit, double highLimit) { return value.equals(verifyHardLimits(value, valueName, lowLimit, highLimit)); } - public static Double verifyHardLimits(Double value, String valueName, double lowLimit, double highLimit) { + private static Double verifyHardLimits(Double value, String valueName, double lowLimit, double highLimit) { Double newvalue = value; if (newvalue < lowLimit || newvalue > highLimit) { newvalue = Math.max(newvalue, lowLimit); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 261686bbb4..13b81fe8be 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -93,7 +93,6 @@ import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.events.EventNewOpenLoopNotification; import info.nightscout.androidaps.plugins.NSClientInternal.broadcasts.BroadcastAckAlarm; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSDeviceStatus; -import info.nightscout.androidaps.plugins.OpenAPSAMA.DetermineBasalResultAMA; import info.nightscout.androidaps.plugins.Overview.Dialogs.CalibrationDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.ErrorHelperActivity; import info.nightscout.androidaps.plugins.Overview.Dialogs.NewTreatmentDialog; @@ -674,7 +673,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, if (ConfigBuilderPlugin.getActiveLoop() != null) { ConfigBuilderPlugin.getActiveLoop().invoke("Accept temp button", false); final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun; - if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) { + if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.isChangeRequested()) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle(getContext().getString(R.string.confirmation)); builder.setMessage(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed); @@ -1105,7 +1104,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, boolean showAcceptButton = !MainApp.getConfigBuilder().isClosedModeEnabled(); // Open mode needed showAcceptButton = showAcceptButton && finalLastRun != null && finalLastRun.lastAPSRun != null; // aps result must exist showAcceptButton = showAcceptButton && (finalLastRun.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result - showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.changeRequested; // change is requested + showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.isChangeRequested(); // change is requested if (showAcceptButton && pump.isInitialized() && !pump.isSuspended() && ConfigBuilderPlugin.getActiveLoop() != null) { acceptTempLayout.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index da276af3c2..fbec0a2308 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -503,7 +503,7 @@ public class ActionStringHandler { return "Last result not available!"; } - if (!result.changeRequested) { + if (!result.isChangeRequested()) { ret += MainApp.sResources.getString(R.string.nochangerequested) + "\n"; } else if (result.rate == 0 && result.duration == 0) { ret += MainApp.sResources.getString(R.string.canceltemp) + "\n"; From 449dbd79f742c7a28a347d3fd0442597aab0f92b Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sat, 27 Jan 2018 22:06:57 +0100 Subject: [PATCH 3/3] Rename TBR to 'temp basal' --- .../plugins/ConfigBuilder/ConfigBuilderPlugin.java | 2 +- .../androidaps/plugins/Loop/APSResult.java | 10 +++++----- .../plugins/OpenAPSAMA/DetermineBasalResultAMA.java | 10 +++++----- .../plugins/OpenAPSAMA/OpenAPSAMAPlugin.java | 6 +++--- .../plugins/OpenAPSMA/DetermineBasalResultMA.java | 12 ++++++------ .../plugins/OpenAPSMA/OpenAPSMAPlugin.java | 6 +++--- .../plugins/OpenAPSSMB/DetermineBasalResultSMB.java | 4 ++-- .../plugins/OpenAPSSMB/OpenAPSSMBPlugin.java | 6 +++--- app/src/main/res/values/strings.xml | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 66082b6da7..881529edc6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -381,7 +381,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr if (Config.logCongigBuilderActions) log.debug("applyAPSRequest: " + request.toString()); - if (request.tbrRequested) { + if (request.tempBasalReqested) { if ((request.rate == 0 && request.duration == 0) || Math.abs(request.rate - pump.getBaseBasalRate()) < pump.getPumpDescription().basalStep) { if (isTempBasalInProgress()) { if (Config.logCongigBuilderActions) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java index b531a5263d..1550edd192 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java @@ -31,7 +31,7 @@ public class APSResult { public String reason; public double rate; public int duration; - public boolean tbrRequested = false; + public boolean tempBasalReqested = false; public boolean bolusRequested = false; public IobTotal iob; public JSONObject json = new JSONObject(); @@ -48,7 +48,7 @@ public class APSResult { if (rate == 0 && duration == 0) ret = MainApp.sResources.getString(R.string.canceltemp) + "\n"; else if (rate == -1) - ret = MainApp.sResources.getString(R.string.let_tbr_run) + "\n"; + ret = MainApp.sResources.getString(R.string.let_temp_basal_run) + "\n"; else ret = MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h " + "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%) \n" + @@ -73,7 +73,7 @@ public class APSResult { if (rate == 0 && duration == 0) ret = MainApp.sResources.getString(R.string.canceltemp) + "
"; else if (rate == -1) - ret = MainApp.sResources.getString(R.string.let_tbr_run) + "
"; + ret = MainApp.sResources.getString(R.string.let_temp_basal_run) + "
"; else ret = "" + MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h " + "(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%)
" + @@ -98,7 +98,7 @@ public class APSResult { newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.tbrRequested = tbrRequested; + newResult.tempBasalReqested = tempBasalReqested; newResult.bolusRequested = bolusRequested; newResult.iob = iob; return newResult; @@ -216,6 +216,6 @@ public class APSResult { } public boolean isChangeRequested() { - return tbrRequested || bolusRequested; + return tempBasalReqested || bolusRequested; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java index 4525929223..50dde42674 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java @@ -22,7 +22,7 @@ public class DetermineBasalResultAMA extends APSResult { json = j; if (result.containsKey("error")) { reason = result.get("error").toString(); - tbrRequested = false; + tempBasalReqested = false; rate = -1; duration = -1; } else { @@ -32,17 +32,17 @@ public class DetermineBasalResultAMA extends APSResult { if (result.containsKey("rate")) { rate = (Double) result.get("rate"); if (rate < 0d) rate = 0d; - tbrRequested = true; + tempBasalReqested = true; } else { rate = -1; - tbrRequested = false; + tempBasalReqested = false; } if (result.containsKey("duration")) { duration = ((Double) result.get("duration")).intValue(); //changeRequested as above } else { duration = -1; - tbrRequested = false; + tempBasalReqested = false; } } bolusRequested = false; @@ -58,7 +58,7 @@ public class DetermineBasalResultAMA extends APSResult { newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.tbrRequested = tbrRequested; + newResult.tempBasalReqested = tempBasalReqested; newResult.rate = rate; newResult.duration = duration; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java index b2d0990eda..14d5396817 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java @@ -243,15 +243,15 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { Profiler.log(log, "AMA calculation", start); // Fix bug determine basal if (determineBasalResultAMA.rate == 0d && determineBasalResultAMA.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultAMA.tbrRequested = false; + determineBasalResultAMA.tempBasalReqested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultAMA.rate == 0 && determineBasalResultAMA.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultAMA.tbrRequested = false; + determineBasalResultAMA.tempBasalReqested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1) - determineBasalResultAMA.tbrRequested = false; + determineBasalResultAMA.tempBasalReqested = false; } determineBasalResultAMA.iob = iobArray[0]; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java index b106ec4149..3f40c02980 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalResultMA.java @@ -20,7 +20,7 @@ public class DetermineBasalResultMA extends APSResult { json = j; if (result.containsKey("error")) { reason = (String) result.get("error"); - tbrRequested = false; + tempBasalReqested = false; rate = -1; duration = -1; mealAssist = ""; @@ -31,17 +31,17 @@ public class DetermineBasalResultMA extends APSResult { if (result.containsKey("rate")) { rate = (Double) result.get("rate"); if (rate < 0d) rate = 0d; - tbrRequested = true; + tempBasalReqested = true; } else { rate = -1; - tbrRequested = false; + tempBasalReqested = false; } if (result.containsKey("duration")) { duration = ((Double) result.get("duration")).intValue(); //changeRequested as above } else { duration = -1; - tbrRequested = false; + tempBasalReqested = false; } if (result.containsKey("mealAssist")) { mealAssist = result.get("mealAssist").toString(); @@ -58,10 +58,10 @@ public class DetermineBasalResultMA extends APSResult { newResult.reason = new String(reason); newResult.rate = rate; newResult.duration = duration; - newResult.tbrRequested = isChangeRequested(); + newResult.tempBasalReqested = isChangeRequested(); newResult.rate = rate; newResult.duration = duration; - newResult.tbrRequested = isChangeRequested(); + newResult.tempBasalReqested = isChangeRequested(); try { newResult.json = new JSONObject(json.toString()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java index 134637d6ae..3119a17a96 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java @@ -229,15 +229,15 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface { DetermineBasalResultMA determineBasalResultMA = determineBasalAdapterMAJS.invoke(); // Fix bug determinef basal if (determineBasalResultMA.rate == 0d && determineBasalResultMA.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultMA.tbrRequested = false; + determineBasalResultMA.tempBasalReqested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultMA.rate == 0 && determineBasalResultMA.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultMA.tbrRequested = false; + determineBasalResultMA.tempBasalReqested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1) - determineBasalResultMA.tbrRequested = false; + determineBasalResultMA.tempBasalReqested = false; } determineBasalResultMA.iob = iobTotal; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java index 51e1cf2938..0320b3633d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalResultSMB.java @@ -35,7 +35,7 @@ public class DetermineBasalResultSMB extends APSResult { if (result.has("carbsReq")) carbsReq = result.getDouble("carbsReq"); if (result.has("rate") && result.has("duration")) { - tbrRequested = true; + tempBasalReqested = true; rate = result.getDouble("rate"); if (rate < 0d) rate = 0d; duration = result.getInt("duration"); @@ -74,7 +74,7 @@ public class DetermineBasalResultSMB extends APSResult { newResult.reason = reason; newResult.rate = rate; newResult.duration = duration; - newResult.tbrRequested = tbrRequested; + newResult.tempBasalReqested = tempBasalReqested; newResult.bolusRequested = bolusRequested; newResult.rate = rate; newResult.duration = duration; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java index 66974038ee..f056a9c607 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java @@ -249,15 +249,15 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface { // TODO still needed with oref1? // Fix bug determine basal if (determineBasalResultSMB.rate == 0d && determineBasalResultSMB.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) - determineBasalResultSMB.tbrRequested = false; + determineBasalResultSMB.tempBasalReqested = false; // limit requests on openloop mode if (!MainApp.getConfigBuilder().isClosedModeEnabled()) { if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultSMB.rate == 0 && determineBasalResultSMB.duration == 0) { // going to cancel } else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) { - determineBasalResultSMB.tbrRequested = false; + determineBasalResultSMB.tempBasalReqested = false; } else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - pump.getBaseBasalRate()) < 0.1) { - determineBasalResultSMB.tbrRequested = false; + determineBasalResultSMB.tempBasalReqested = false; } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9b73a8a04d..d73e795b8a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -887,6 +887,6 @@ Enable SMB when there is temp target active (eating soon, exercise) Enable SMB with high temp targets Enable SMB when there is high temp target active (exercise) - Let current temp run + Let current temp basal run