This commit is contained in:
Milos Kozak 2020-07-24 07:48:00 +02:00
commit f9806162e1
5 changed files with 27 additions and 29 deletions

View file

@ -1,6 +1,6 @@
# AndroidAPS
* Check the wiki: http://wiki.androidaps.org
* Check the wiki: https://androidaps.readthedocs.io
* Everyone whos been looping with AndroidAPS needs to fill out the form after 3 days of looping https://docs.google.com/forms/d/14KcMjlINPMJHVt28MDRupa4sz4DDIooI4SrW0P3HSN8/viewform?c=0&w=1
[![Gitter](https://badges.gitter.im/MilosKozak/AndroidAPS.svg)](https://gitter.im/MilosKozak/AndroidAPS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

View file

@ -63,13 +63,12 @@ class MaintenancePlugin @Inject constructor(
}
//todo replace this with a call on startup of the application, specifically to remove
// unnecessary garbage from the log exports
// unnecessary garbage from the log exports
fun deleteLogs() {
val logDirectory = LoggerUtils.getLogDirectory()
LoggerUtils.getLogDirectory()?.let { logDirectory ->
val logDir = File(logDirectory)
val files = logDir.listFiles { _: File?, name: String ->
(name.startsWith("AndroidAPS")
&& name.endsWith(".zip"))
(name.startsWith("AndroidAPS") && name.endsWith(".zip"))
}
Arrays.sort(files) { f1: File, f2: File -> f1.name.compareTo(f2.name) }
var delFiles = listOf(*files)
@ -90,6 +89,7 @@ class MaintenancePlugin @Inject constructor(
exportDir.delete()
}
}
}
/**
* returns a list of log files. The number of returned logs is given via the amount

View file

@ -20,8 +20,7 @@ abstract class AbstractSensitivityPlugin(
pluginDescription: PluginDescription,
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
resourceHelper:
ResourceHelper,
resourceHelper: ResourceHelper,
val sp: SP
) : PluginBase(pluginDescription, aapsLogger, resourceHelper, injector), SensitivityInterface {

View file

@ -36,7 +36,6 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
@Singleton
public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
private SP sp;
private ProfileFunction profileFunction;
private DateUtil dateUtil;
@ -57,7 +56,6 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
.description(R.string.description_sensitivity_aaps),
injector, aapsLogger, resourceHelper, sp
);
this.sp = sp;
this.profileFunction = profileFunction;
this.dateUtil = dateUtil;
}
@ -66,12 +64,12 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
public AutosensResult detectSensitivity(IobCobCalculatorInterface iobCobCalculatorPlugin, long fromTime, long toTime) {
LongSparseArray<AutosensData> autosensDataTable = iobCobCalculatorPlugin.getAutosensDataTable();
String age = sp.getString(R.string.key_age, "");
String age = getSp().getString(R.string.key_age, "");
int defaultHours = 24;
if (age.equals(getResourceHelper().gs(R.string.key_adult))) defaultHours = 24;
if (age.equals(getResourceHelper().gs(R.string.key_teenage))) defaultHours = 4;
if (age.equals(getResourceHelper().gs(R.string.key_child))) defaultHours = 4;
int hoursForDetection = sp.getInt(R.string.key_openapsama_autosens_period, defaultHours);
int hoursForDetection = getSp().getInt(R.string.key_openapsama_autosens_period, defaultHours);
Profile profile = profileFunction.getProfile();

View file

@ -88,6 +88,7 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval {
}
public CareportalEvent(NSMbg mbg) {
this();
date = mbg.date;
eventType = MBG;
json = mbg.json;