diff --git a/app/src/main/java/info/nightscout/androidaps/Config.java b/app/src/main/java/info/nightscout/androidaps/Config.java index 5b3a489129..e6c06583c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/Config.java +++ b/app/src/main/java/info/nightscout/androidaps/Config.java @@ -31,19 +31,16 @@ public class Config { public static final boolean detailedLog = true; public static final boolean logFunctionCalls = true; - public static final boolean logIncommingBG = true; public static final boolean logIncommingData = true; public static final boolean logAPSResult = true; public static final boolean logPumpComm = true; public static final boolean logPrefsChange = true; public static final boolean logConfigBuilder = true; public static final boolean logConstraintsChanges = true; - public static final boolean logTempBasalsCut = true; public static final boolean logNSUpload = true; public static final boolean logPumpActions = true; - public static final boolean logSMSComm = true; public static final boolean logCongigBuilderActions = true; - public static final boolean logAutosensData = false; + public static final boolean logAutosensData = true; // DanaR specific public static final boolean logDanaBTComm = true; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index 60779e85aa..da1b4e119a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -416,6 +416,7 @@ public class IobCobCalculatorPlugin implements PluginBase { autosensData.nonEqualDeviation = true; } else { autosensData.pastSensitivity += "-"; + autosensData.nonEqualDeviation = true; } autosensData.nonCarbsDeviation = true; } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java index f48c8cae5e..9f0dc9a21f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java @@ -5,6 +5,7 @@ import android.support.v4.util.LongSparseArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -107,8 +108,6 @@ public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{ if (age.equals(MainApp.sResources.getString(R.string.key_child))) defaultHours = 4; int hoursForDetection = SP.getInt(R.string.key_openapsama_autosens_period, defaultHours); - long now = System.currentTimeMillis(); - if (autosensDataTable == null || autosensDataTable.size() < 4) { log.debug("No autosens data available"); return new AutosensResult(); @@ -137,7 +136,7 @@ public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{ continue; } - if (autosensData.time > now - hoursForDetection * 60 * 60 * 1000L) + if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L) deviationsArray.add(autosensData.nonEqualDeviation ? autosensData.deviation : 0d); if (deviationsArray.size() > hoursForDetection * 60 / 5) deviationsArray.remove(0); @@ -187,7 +186,8 @@ public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{ log.debug(ratioLimit); } - log.error("Sensitivity to: " + new Date(toTime).toLocaleString() + " percentile: " + percentile); + log.debug("Sensitivity to: " + new Date(toTime).toLocaleString() + " percentile: " + percentile + " ratio: " + ratio); + log.debug("Sensitivity to: deviations " + Arrays.toString(deviations)); AutosensResult output = new AutosensResult(); output.ratio = Round.roundTo(ratio, 0.01); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java index 5ccc9107b0..4face65ced 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java @@ -136,7 +136,7 @@ public class SensitivityOref0Plugin implements PluginBase, SensitivityInterface continue; } - if (autosensData.time > now - hoursForDetection * 60 * 60 * 1000L) + if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L) deviationsArray.add(autosensData.nonEqualDeviation ? autosensData.deviation : 0d); if (deviationsArray.size() > hoursForDetection * 60 / 5) deviationsArray.remove(0);