From 09e5fdc61b747464f1b7007d8a9879923300d32c Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 30 Jun 2017 11:56:36 +0200 Subject: [PATCH] sensitivity prefs cleanup --- .../info/nightscout/androidaps/MainApp.java | 4 ++-- .../androidaps/PreferencesActivity.java | 9 +++++--- .../IobCobCalculator/AutosensData.java | 4 ++-- .../SensitivityAAPSPlugin.java} | 14 ++++++------- app/src/main/res/values/strings.xml | 5 ++--- ...bsorption.xml => pref_absorption_aaps.xml} | 0 .../main/res/xml/pref_absorption_oref0.xml | 21 +++++++++++++++++++ app/src/main/res/xml/pref_advanced.xml | 12 ----------- 8 files changed, 40 insertions(+), 29 deletions(-) rename app/src/main/java/info/nightscout/androidaps/plugins/{SensitivityMK/SensitivityMKPlugin.java => SensitivityAAPS/SensitivityAAPSPlugin.java} (95%) rename app/src/main/res/xml/{pref_absorption.xml => pref_absorption_aaps.xml} (100%) create mode 100644 app/src/main/res/xml/pref_absorption_oref0.xml diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index b820393c33..257a304ae4 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -48,7 +48,7 @@ import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Fragment; import info.nightscout.androidaps.plugins.PumpDanaRv2.services.DanaRv2ExecutionService; import info.nightscout.androidaps.plugins.PumpMDI.MDIPlugin; import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin; -import info.nightscout.androidaps.plugins.SensitivityMK.SensitivityMKPlugin; +import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin; import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin; import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorFragment; import info.nightscout.androidaps.plugins.SourceGlimp.SourceGlimpPlugin; @@ -100,7 +100,7 @@ public class MainApp extends Application { pluginsList.add(InsulinFastactingFragment.getPlugin()); pluginsList.add(InsulinFastactingProlongedFragment.getPlugin()); pluginsList.add(SensitivityOref0Plugin.getPlugin()); - pluginsList.add(SensitivityMKPlugin.getPlugin()); + pluginsList.add(SensitivityAAPSPlugin.getPlugin()); if (Config.DANAR) pluginsList.add(DanaRFragment.getPlugin()); if (Config.DANAR) pluginsList.add(DanaRKoreanFragment.getPlugin()); if (Config.DANARv2) pluginsList.add(DanaRv2Fragment.getPlugin()); diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index 71c3a3981e..a20b97a701 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -21,7 +21,8 @@ import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugi import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin; import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin; import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin; -import info.nightscout.androidaps.plugins.SensitivityMK.SensitivityMKPlugin; +import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin; +import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin; import info.nightscout.androidaps.plugins.Wear.WearPlugin; import info.nightscout.androidaps.plugins.XDripStatusline.StatuslinePlugin; import info.nightscout.utils.LocaleHelper; @@ -106,8 +107,10 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) addPreferencesFromResource(R.xml.pref_openapsama); } - if (MainApp.getSpecificPlugin(SensitivityMKPlugin.class) != null && MainApp.getSpecificPlugin(SensitivityMKPlugin.class).isEnabled(PluginBase.SENSITIVITY)) - addPreferencesFromResource(R.xml.pref_absorption); + if (MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class) != null && MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class).isEnabled(PluginBase.SENSITIVITY)) + addPreferencesFromResource(R.xml.pref_absorption_aaps); + if (MainApp.getSpecificPlugin(SensitivityOref0Plugin.class) != null && MainApp.getSpecificPlugin(SensitivityOref0Plugin.class).isEnabled(PluginBase.SENSITIVITY)) + addPreferencesFromResource(R.xml.pref_absorption_oref0); if (Config.ALLPREFERENCES) { addPreferencesFromResource(R.xml.pref_profile); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java index 7efcf083b4..9939bd44d1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java @@ -12,7 +12,7 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.interfaces.PluginBase; -import info.nightscout.androidaps.plugins.SensitivityMK.SensitivityMKPlugin; +import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin; import info.nightscout.utils.SP; /** @@ -32,7 +32,7 @@ public class AutosensData { time = t.date; carbs = t.carbs; remaining = t.carbs; - if (MainApp.getSpecificPlugin(SensitivityMKPlugin.class) != null && MainApp.getSpecificPlugin(SensitivityMKPlugin.class).isEnabled(PluginBase.SENSITIVITY)) { + if (MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class) != null && MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class).isEnabled(PluginBase.SENSITIVITY)) { double maxAbsorptionHours = SP.getDouble(R.string.key_absorption_maxtime, 4d); Profile profile = MainApp.getConfigBuilder().getProfile(t.date); double sens = Profile.toMgdl(profile.getIsf(t.date), profile.getUnits()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityMK/SensitivityMKPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/SensitivityMK/SensitivityMKPlugin.java rename to app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java index 5506b2b4c3..f48c8cae5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityMK/SensitivityMKPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.SensitivityMK; +package info.nightscout.androidaps.plugins.SensitivityAAPS; import android.support.v4.util.LongSparseArray; @@ -26,17 +26,17 @@ import info.nightscout.utils.SafeParse; * Created by mike on 24.06.2017. */ -public class SensitivityMKPlugin implements PluginBase, SensitivityInterface{ - private static Logger log = LoggerFactory.getLogger(SensitivityMKPlugin.class); +public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{ + private static Logger log = LoggerFactory.getLogger(SensitivityAAPSPlugin.class); private static boolean fragmentEnabled = true; private static boolean fragmentVisible = false; - static SensitivityMKPlugin plugin = null; + static SensitivityAAPSPlugin plugin = null; - public static SensitivityMKPlugin getPlugin() { + public static SensitivityAAPSPlugin getPlugin() { if (plugin == null) - plugin = new SensitivityMKPlugin(); + plugin = new SensitivityAAPSPlugin(); return plugin; } @@ -52,7 +52,7 @@ public class SensitivityMKPlugin implements PluginBase, SensitivityInterface{ @Override public String getName() { - return MainApp.sResources.getString(R.string.sensitivitymk); + return MainApp.sResources.getString(R.string.sensitivityaaps); } @Override diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1e96680245..78028f6662 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -626,7 +626,6 @@ Invalid profile !!! ProfileSwitch Pump battery age - Updating ... Pump Battery Change Alarm options nsalarm_urgent_high @@ -660,10 +659,10 @@ Sensitivity detection SENS Sensitivity Oref0 - Sensitivity MK + Sensitivity AAPS Absorption settings absorption_maxtime - Meal max absorption time + Meal max absorption time [h] Time in hours where is expected all carbs from meal will be absorbed rangetodisplay Visualize extended bolus as % diff --git a/app/src/main/res/xml/pref_absorption.xml b/app/src/main/res/xml/pref_absorption_aaps.xml similarity index 100% rename from app/src/main/res/xml/pref_absorption.xml rename to app/src/main/res/xml/pref_absorption_aaps.xml diff --git a/app/src/main/res/xml/pref_absorption_oref0.xml b/app/src/main/res/xml/pref_absorption_oref0.xml new file mode 100644 index 0000000000..e163f4cd47 --- /dev/null +++ b/app/src/main/res/xml/pref_absorption_oref0.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/app/src/main/res/xml/pref_advanced.xml b/app/src/main/res/xml/pref_advanced.xml index 3934a15cbf..5395a75f1e 100644 --- a/app/src/main/res/xml/pref_advanced.xml +++ b/app/src/main/res/xml/pref_advanced.xml @@ -115,18 +115,6 @@ android:title="@string/openapsama_bolussnooze_dia_divisor" android:dialogMessage="@string/openapsama_bolussnooze_dia_divisor_summary" android:key="openapsama_bolussnooze_dia_divisor" /> -