sensitivity prefs cleanup

This commit is contained in:
Milos Kozak 2017-06-30 11:56:36 +02:00
parent 96e4a25f9e
commit 09e5fdc61b
8 changed files with 40 additions and 29 deletions

View file

@ -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());

View file

@ -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);
}

View file

@ -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());

View file

@ -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

View file

@ -626,7 +626,6 @@
<string name="invalidprofile">Invalid profile !!!</string>
<string name="profileswitch">ProfileSwitch</string>
<string name="careportal_pbage_label">Pump battery age</string>
<string name="updating">Updating ...</string>
<string name="careportal_pumpbatterychange">Pump Battery Change</string>
<string name="ns_alarmoptions">Alarm options</string>
<string name="key_nsalarm_urgent_high" translatable="false">nsalarm_urgent_high</string>
@ -660,10 +659,10 @@
<string name="configbuilder_sensitivity">Sensitivity detection</string>
<string name="sensitivity_shortname">SENS</string>
<string name="sensitivityoref0">Sensitivity Oref0</string>
<string name="sensitivitymk">Sensitivity MK</string>
<string name="sensitivityaaps">Sensitivity AAPS</string>
<string name="absorptionsettings_title">Absorption settings</string>
<string name="key_absorption_maxtime" translatable="false">absorption_maxtime</string>
<string name="absorption_maxtime_title">Meal max absorption time</string>
<string name="absorption_maxtime_title">Meal max absorption time [h]</string>
<string name="absorption_maxtime_summary">Time in hours where is expected all carbs from meal will be absorbed</string>
<string name="key_rangetodisplay" translatable="false">rangetodisplay</string>
<string name="danar_visualizeextendedaspercentage_title">Visualize extended bolus as %</string>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="absorption"
android:title="@string/absorptionsettings_title">
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="floatNumericRange"
validate:floatminNumber="0.1"
validate:floatmaxNumber="5.0"
android:defaultValue="3.0"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="numberDecimal"
android:maxLines="20"
android:title="@string/openapsama_min_5m_carbimpact"
android:dialogMessage="@string/openapsama_min_5m_carbimpact_summary"
android:key="openapsama_min_5m_carbimpact" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -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" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="floatNumericRange"
validate:floatminNumber="0.1"
validate:floatmaxNumber="5.0"
android:defaultValue="3.0"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="numberDecimal"
android:maxLines="20"
android:title="@string/openapsama_min_5m_carbimpact"
android:dialogMessage="@string/openapsama_min_5m_carbimpact_summary"
android:key="openapsama_min_5m_carbimpact" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/profile">