merge into dagger

This commit is contained in:
Tim Gunn 2020-04-05 14:22:19 +12:00
parent 0a8d456d01
commit 1509fe2dea
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -27,6 +27,7 @@ import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.sharedPreferences.SP; import info.nightscout.androidaps.utils.sharedPreferences.SP;
/** /**
* Created by mike on 19.06.2018. * Created by mike on 19.06.2018.
*/ */
@ -165,12 +166,10 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
for (int i = 0; i < deviationsHour.size(); i++) { for (int i = 0; i < deviationsHour.size(); i++) {
ArrayList deviations = deviationsHour.get(i); ArrayList deviations = deviationsHour.get(i);
if (L.isEnabled(L.AUTOSENS)) getAapsLogger().debug(LTag.AUTOSENS,"Using most recent " + deviations.size() + " deviations");
log.debug("Using most recent " + deviations.size() + " deviations");
if (deviations.size() < deviationCategory.get(i)) { if (deviations.size() < deviationCategory.get(i)) {
int pad = (int) Math.round((1 - (double) deviations.size() / deviationCategory.get(i)) * 18); int pad = (int) Math.round((1 - (double) deviations.size() / deviationCategory.get(i)) * 18);
if (L.isEnabled(L.AUTOSENS)) getAapsLogger().debug(LTag.AUTOSENS,"Adding " + pad + " more zero deviations");
log.debug("Adding " + pad + " more zero deviations");
for (int d = 0; d < pad; d++) { ; for (int d = 0; d < pad; d++) { ;
deviations.add(0d); deviations.add(0d);
} }
@ -197,7 +196,7 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
double sens = profile.getIsfMgdl(); double sens = profile.getIsfMgdl();
if (L.isEnabled(L.AUTOSENS))
getAapsLogger().debug(LTag.AUTOSENS,"Records: " + index + " " + pastSensitivity); getAapsLogger().debug(LTag.AUTOSENS,"Records: " + index + " " + pastSensitivity);
Arrays.sort(deviations); Arrays.sort(deviations);
@ -216,7 +215,6 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
sensResult+= "Sensitivity normal"; sensResult+= "Sensitivity normal";
} }
if (L.isEnabled(L.AUTOSENS))
getAapsLogger().debug(LTag.AUTOSENS,sensResult); getAapsLogger().debug(LTag.AUTOSENS,sensResult);
double ratio = 1 + (basalOff / profile.getMaxDailyBasal()); double ratio = 1 + (basalOff / profile.getMaxDailyBasal());
@ -239,9 +237,10 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
AutosensResult output = fillResult(ratioArray.get(key), current.cob, pastSensitivityArray.get(key), ratioLimitArray.get(key), AutosensResult output = fillResult(ratioArray.get(key), current.cob, pastSensitivityArray.get(key), ratioLimitArray.get(key),
sensResultArray.get(key)+comparison, deviationsHour.get(key).size()); sensResultArray.get(key)+comparison, deviationsHour.get(key).size());
if (L.isEnabled(L.AUTOSENS)) getAapsLogger().debug(LTag.AUTOSENS, "Sensitivity to: "
getAapsLogger().debug(LTag.AUTOSENS, message+" Sensitivity to: {} ratio: {} mealCOB: {}", + DateUtil.dateAndTimeString(toTime) +
new Date(toTime).toLocaleString(), output.ratio, current.cob); " ratio: " + output.ratio
+ " mealCOB: " + current.cob);
return output; return output;
} }