preferences cleanup

This commit is contained in:
Milos Kozak 2018-04-24 00:11:52 +02:00
parent c15a4b5efe
commit c490499d03
21 changed files with 440 additions and 219 deletions

View file

@ -23,10 +23,12 @@ import info.nightscout.androidaps.plugins.NSClientInternal.NSClientPlugin;
import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin;
import info.nightscout.androidaps.plugins.OpenAPSMA.OpenAPSMAPlugin;
import info.nightscout.androidaps.plugins.OpenAPSSMB.OpenAPSSMBPlugin;
import info.nightscout.androidaps.plugins.PumpCombo.ComboPlugin;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin;
import info.nightscout.androidaps.plugins.PumpInsight.InsightPlugin;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin;
import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin;
@ -156,6 +158,8 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
addPreferencesFromResourceIfEnabled(DanaRKoreanPlugin.getPlugin(), PluginType.PUMP);
addPreferencesFromResourceIfEnabled(DanaRv2Plugin.getPlugin(), PluginType.PUMP);
addPreferencesFromResourceIfEnabled(DanaRSPlugin.getPlugin(), PluginType.PUMP);
addPreferencesFromResourceIfEnabled(InsightPlugin.getPlugin(), PluginType.PUMP);
addPreferencesFromResourceIfEnabled(ComboPlugin.getPlugin(), PluginType.PUMP);
if (DanaRPlugin.getPlugin().isEnabled(PluginType.PROFILE)
|| DanaRKoreanPlugin.getPlugin().isEnabled(PluginType.PROFILE)
@ -177,7 +181,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
if (!Config.NSCLIENT && !Config.G5UPLOADER) {
addPreferencesFromResource(R.xml.pref_others);
}
addPreferencesFromResource(R.xml.pref_advanced);
addPreferencesFromResource(R.xml.pref_datachoices);
addPreferencesFromResourceIfEnabled(WearPlugin.getPlugin(), PluginType.GENERAL);
addPreferencesFromResourceIfEnabled(StatuslinePlugin.getPlugin(), PluginType.GENERAL);

View file

@ -212,7 +212,7 @@ public class DetermineBasalAdapterAMAJS {
mProfile.put("skip_neutral_temps", true);
mProfile.put("current_basal", basalrate);
mProfile.put("temptargetSet", tempTargetSet);
mProfile.put("autosens_adjust_targets", SP.getBoolean("openapsama_autosens_adjusttargets", true));
mProfile.put("autosens_adjust_targets", SP.getBoolean(R.string.key_openapsama_autosens_adjusttargets, true));
//align with max-absorption model in AMA sensitivity
if(mealData.usedMinCarbsImpact > 0){
mProfile.put("min_5m_carbimpact", mealData.usedMinCarbsImpact);
@ -243,7 +243,7 @@ public class DetermineBasalAdapterAMAJS {
mGlucoseStatus = new JSONObject();
mGlucoseStatus.put("glucose", glucoseStatus.glucose);
if (SP.getBoolean("always_use_shortavg", false)) {
if (SP.getBoolean(R.string.key_always_use_shortavg, false)) {
mGlucoseStatus.put("delta", glucoseStatus.short_avgdelta);
} else {
mGlucoseStatus.put("delta", glucoseStatus.delta);

View file

@ -18,6 +18,7 @@ import java.lang.reflect.InvocationTargetException;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.GlucoseStatus;
import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.MealData;
@ -197,7 +198,7 @@ public class DetermineBasalAdapterMAJS {
mGlucoseStatus = new JSONObject();
mGlucoseStatus.put("glucose", glucoseStatus.glucose);
if (SP.getBoolean("always_use_shortavg", false)) {
if (SP.getBoolean(R.string.key_always_use_shortavg, false)) {
mGlucoseStatus.put("delta", glucoseStatus.short_avgdelta);
} else {
mGlucoseStatus.put("delta", glucoseStatus.delta);

View file

@ -262,7 +262,7 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("current_basal", basalrate);
mProfile.put("temptargetSet", tempTargetSet);
mProfile.put("autosens_max", SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2")));
mProfile.put("autosens_max", SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_max, "1.2")));
if (units.equals(Constants.MMOL)) {
mProfile.put("out_units", "mmol/L");
@ -288,7 +288,7 @@ public class DetermineBasalAdapterSMBJS {
mGlucoseStatus = new JSONObject();
mGlucoseStatus.put("glucose", glucoseStatus.glucose);
if (SP.getBoolean("always_use_shortavg", false)) {
if (SP.getBoolean(R.string.key_always_use_shortavg, false)) {
mGlucoseStatus.put("delta", glucoseStatus.short_avgdelta);
} else {
mGlucoseStatus.put("delta", glucoseStatus.delta);

View file

@ -139,8 +139,8 @@ public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInte
log.debug(sensResult);
double rawRatio = ratio;
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2")));
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_min, "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_max, "1.2")));
if (ratio != rawRatio) {
ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio;

View file

@ -150,8 +150,8 @@ public class SensitivityOref0Plugin extends PluginBase implements SensitivityInt
ratio = 1 + (basalOff / profile.getMaxDailyBasal());
double rawRatio = ratio;
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2")));
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_min, "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_max, "1.2")));
if (ratio != rawRatio) {
ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio;

View file

@ -159,8 +159,8 @@ public class SensitivityWeightedAveragePlugin extends PluginBase implements Sens
log.debug(sensResult);
double rawRatio = ratio;
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2")));
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_min, "0.7")));
ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString(R.string.key_openapsama_autosens_max, "1.2")));
if (ratio != rawRatio) {
ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio;

View file

@ -181,7 +181,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
// instead of dividing the DIA that only worked on the bilinear curves,
// multiply the time the treatment is seen active.
long timeSinceTreatment = time - t.date;
long snoozeTime = t.date + (long) (timeSinceTreatment * SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0));
long snoozeTime = t.date + (long) (timeSinceTreatment * SP.getDouble(R.string.key_openapsama_bolussnooze_dia_divisor, 2.0));
Iob bIOB = t.iobCalc(snoozeTime, dia);
total.bolussnooze += bIOB.iobContrib;
}

View file

@ -432,13 +432,14 @@
<string name="profile">Profile</string>
<string name="openapsama_max_daily_safety_multiplier_summary">Default value: 3 This is a key OpenAPS safety cap. What this does is limit your basals to be 3x (in this people) your biggest basal rate. You likely will not need to change this, but you should be aware thats what is discussed about “3x max daily; 4x current” for safety caps.</string>
<string name="openapsama_current_basal_safety_multiplier_summary">Default value: 4 This is the other half of the key OpenAPS safety caps, and the other half of “3x max daily; 4x current” of the safety caps. This means your basal, regardless of max basal set on your pump, cannot be any higher than this number times the current level of your basal. This is to prevent people from getting into dangerous territory by setting excessively high max basals before understanding how the algorithm works. Again, the default is 4x; most people will never need to adjust this and are instead more likely to need to adjust other settings if they feel like they are “running into” this safety cap.</string>
<string name="openapsama_autosens_max" translatable="false">autosens_max</string>
<string name="key_openapsama_autosens_max" translatable="false">autosens_max</string>
<string name="openapsama_autosens_max_summary">Default value: 1.2\nThis is a multiplier cap for autosens (and soon autotune) to set a 20% max limit on how high the autosens ratio can be, which in turn determines how high autosens can adjust basals, how low it can adjust ISF, and how low it can set the BG target.</string>
<string name="openapsama_autosens_min" translatable="false">autosens_min</string>
<string name="key_openapsama_autosens_min" translatable="false">autosens_min</string>
<string name="openapsama_autosens_min_summary">Default value: 0.7\nThe other side of the autosens safety limits, putting a cap on how low autosens can adjust basals, and how high it can adjust ISF and BG targets.</string>
<string name="openapsama_autosens_adjusttargets" translatable="false">autosens_adjust_targets</string>
<string name="key_openapsama_autosens_adjusttargets" translatable="false">autosens_adjust_targets</string>
<string name="openapsama_autosens_adjusttargets">Autosens adjust targets too</string>
<string name="openapsama_autosens_adjusttargets_summary">Default value: true\nThis is used to allow autosens to adjust BG targets, in addition to ISF and basals.</string>
<string name="openapsama_bolussnooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
<string name="key_openapsama_bolussnooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Default value: 2\nBolus snooze is enacted after you do a meal bolus, so the loop wont counteract with low temps when youve just eaten. The example here and default is 2; so a 3 hour DIA means that bolus snooze will be gradually phased out over 1.5 hours (3DIA/2).</string>
<string name="openapsama_min_5m_carbimpact" translatable="false">min_5m_carbimpact</string>
<string name="openapsama_min_5m_carbimpact_summary">Default value: 3.0 This is a setting for default carb absorption impact per 5 minutes. The default is an expected 3mg/dl/5min. This affects how fast COB are decayed, and how much carb absorption is assumed in calculating future predicted BG, when BG is falling more than expected, or not rising as much as expected.</string>
@ -1024,4 +1025,10 @@
<string name="connectionsettings_title">Connection settings</string>
<string name="ns_wifi_allowedssids">Allowed SSIDs (semicolon separated)</string>
<string name="ns_allowroaming">Allow connection in roaming</string>
<string name="key_always_use_shortavg" translatable="false">always_use_shortavg</string>
<string name="openapsama_autosens_max">Max autosens ratio</string>
<string name="openapsama_autosens_min">Min autosens ratio</string>
<string name="openapsama_bolussnooze_dia_divisor">Bolus snooze dia divisor</string>
<string name="openapsama_max_daily_safety_multiplier">Max daily safety multiplier</string>
<string name="openapsama_current_basal_safety_multiplier">Current basal safety multiplier</string>
</resources>

View file

@ -1,26 +1,25 @@
<?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="numericRange"
validate:minNumber="4"
validate:maxNumber="10"
android:digits="0123456789.,"
android:defaultValue="6"
android:selectAllOnFocus="true"
android:inputType="number"
android:maxLines="20"
android:title="@string/absorption_maxtime_title"
android:dialogMessage="@string/absorption_maxtime_summary"
android:key="@string/key_absorption_maxtime" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:maxNumber="24"
android:defaultValue="6"
android:dialogMessage="@string/absorption_maxtime_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_absorption_maxtime"
android:maxLines="20"
android:selectAllOnFocus="true"
android:title="@string/absorption_maxtime_title"
validate:maxNumber="10"
validate:minNumber="4"
validate:testType="numericRange"
validate:testType="numericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="24"
android:dialogMessage="@string/openapsama_autosens_period_summary"
android:digits="0123456789"
@ -29,7 +28,42 @@
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_period" />
android:title="@string/openapsama_autosens_period"
validate:maxNumber="24"
validate:minNumber="4"
validate:testType="numericRange" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="1.2"
android:dialogMessage="@string/openapsama_autosens_max_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_autosens_max"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_max"
validate:floatmaxNumber="3"
validate:floatminNumber="0.5"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="0.7"
android:dialogMessage="@string/openapsama_autosens_min_summary"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_autosens_min"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_min"
validate:floatmaxNumber="1.0"
validate:floatminNumber="0.1"
validate:testType="floatNumericRange" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,34 +1,68 @@
<?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="12.0"
android:defaultValue="8.0"
android:dialogMessage="@string/openapsama_min_5m_carbimpact_summary"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_min_5m_carbimpact"
android:maxLines="20"
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="@string/key_openapsama_min_5m_carbimpact" />
validate:floatmaxNumber="12.0"
validate:floatminNumber="0.1"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="numericRange"
validate:minNumber="4"
validate:maxNumber="10"
android:digits="0123456789.,"
android:defaultValue="6"
android:selectAllOnFocus="true"
android:inputType="number"
android:maxLines="20"
android:title="@string/absorption_cutoff_title"
android:dialogMessage="@string/absorption_cutoff_summary"
android:key="@string/key_absorption_cutoff" />
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_absorption_cutoff"
android:maxLines="20"
android:selectAllOnFocus="true"
android:title="@string/absorption_cutoff_title"
validate:maxNumber="10"
validate:minNumber="4"
validate:testType="numericRange" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="1.2"
android:dialogMessage="@string/openapsama_autosens_max_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_autosens_max"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_max"
validate:floatmaxNumber="3"
validate:floatminNumber="0.5"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="0.7"
android:dialogMessage="@string/openapsama_autosens_min_summary"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_autosens_min"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_min"
validate:floatmaxNumber="1.0"
validate:floatminNumber="0.1"
validate:testType="floatNumericRange" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,106 +0,0 @@
<?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="advanced"
android:title="@string/advancedsettings_title">
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/openapsma">
<SwitchPreference
android:defaultValue="false"
android:key="always_use_shortavg"
android:summary="@string/always_use_shortavg_summary"
android:title="@string/always_use_shortavg" />
</PreferenceCategory>
<PreferenceCategory android:title="OpenAPS preferences.json">
<Preference android:summary="@string/openapsama_link_to_preferncejson_doc_txt">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/openapsama_link_to_preferncejson_doc" />
</Preference>
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="3"
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_max_daily_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:title="@string/key_openapsama_max_daily_safety_multiplier"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="numericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="4"
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_current_basal_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/key_openapsama_current_basal_safety_multiplier"
validate:floatmaxNumber="10"
validate:floatminNumber="1"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="1.2"
android:dialogMessage="@string/openapsama_autosens_max_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="openapsama_autosens_max"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_max"
validate:floatmaxNumber="3"
validate:floatminNumber="0.5"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="0.7"
android:dialogMessage="@string/openapsama_autosens_min_summary"
android:inputType="numberDecimal"
android:key="openapsama_autosens_min"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_autosens_min"
validate:floatmaxNumber="1.0"
validate:floatminNumber="0.1"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="2"
android:dialogMessage="@string/openapsama_bolussnooze_dia_divisor_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="openapsama_bolussnooze_dia_divisor"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_bolussnooze_dia_divisor"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="floatNumericRange" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:title="@string/btwatchdog_title"
android:summary="@string/btwatchdog_summary"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/data_choices">
<SwitchPreference
android:defaultValue="true"
android:key="enable_fabric"
android:title="@string/fabric_upload"
android:summary="@string/allow_automated_crash_reporting"/>
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="danar"
android:title="@string/danar_pump_settings">
<info.nightscout.androidaps.plugins.PumpDanaR.BluetoothDevicePreference
@ -10,17 +10,16 @@
android:title="@string/danar_bt_name_title" />
<EditTextPreference
android:title="@string/danar_password_title"
android:inputType="numberPassword"
android:key="@string/key_danar_password"
android:inputType="numberPassword">
</EditTextPreference>
android:title="@string/danar_password_title"/>
<ListPreference
android:title="@string/bolusspeed"
android:key="@string/key_danars_bolusspeed"
android:defaultValue="0"
android:entries="@array/danaSpeedArray"
android:entryValues="@array/danaSpeedValues"/>
android:entryValues="@array/danaSpeedValues"
android:key="@string/key_danars_bolusspeed"
android:title="@string/bolusspeed" />
<SwitchPreference
android:defaultValue="false"
@ -33,6 +32,20 @@
android:key="@string/key_danar_visualizeextendedaspercentage"
android:title="@string/danar_visualizeextendedaspercentage_title" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:summary="@string/btwatchdog_summary"
android:title="@string/btwatchdog_title" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,27 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="danar"
android:title="@string/danar_pump_settings">
<info.nightscout.androidaps.plugins.PumpDanaR.BluetoothDevicePreference
android:dialogTitle="@string/danar_bt_name_title"
android:key="@string/key_danar_bt_name"
android:title="@string/danar_bt_name_title" />
<EditTextPreference
android:title="@string/danar_password_title"
android:inputType="numberPassword"
android:key="@string/key_danar_password"
android:inputType="numberPassword">
</EditTextPreference>
android:title="@string/danar_password_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_danar_useextended"
android:title="@string/danar_useextended_title" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_danar_useextended"
android:key="@string/key_danar_visualizeextendedaspercentage"
android:title="@string/danar_visualizeextendedaspercentage_title" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:summary="@string/btwatchdog_summary"
android:title="@string/btwatchdog_title" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,33 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/danarspump">
<PreferenceCategory android:title="@string/danarspump">
<Preference
android:key="blescannner"
android:title="@string/pairpump">
<intent android:action="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity"/>
<intent android:action="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity" />
</Preference>
<EditTextPreference
android:key="@string/key_danars_name"
android:selectable="false"
android:persistent="false"
android:title="@string/selectedpump"
android:summary=""/>
android:selectable="false"
android:summary=""
android:title="@string/selectedpump" />
<EditTextPreference
android:title="@string/danar_password_title"
android:inputType="textCapCharacters"
android:key="@string/key_danar_password"
android:inputType="textCapCharacters">
</EditTextPreference>
android:title="@string/danar_password_title"/>
<ListPreference
android:title="@string/bolusspeed"
android:key="@string/key_danars_bolusspeed"
android:defaultValue="0"
android:entries="@array/danaSpeedArray"
android:entryValues="@array/danaSpeedValues"/>
android:entryValues="@array/danaSpeedValues"
android:key="@string/key_danars_bolusspeed"
android:title="@string/bolusspeed" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:summary="@string/btwatchdog_summary"
android:title="@string/btwatchdog_title" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="danar"
android:title="@string/danar_pump_settings">
<info.nightscout.androidaps.plugins.PumpDanaR.BluetoothDevicePreference
@ -12,7 +12,7 @@
<EditTextPreference
android:inputType="numberPassword"
android:key="@string/key_danar_password"
android:title="@string/danar_password_title"></EditTextPreference>
android:title="@string/danar_password_title" />
<ListPreference
android:defaultValue="0"
@ -21,6 +21,20 @@
android:key="@string/key_danars_bolusspeed"
android:title="@string/bolusspeed" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:summary="@string/btwatchdog_summary"
android:title="@string/btwatchdog_title" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/data_choices">
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/data_choices">
<SwitchPreference
android:defaultValue="true"
android:key="enable_fabric"
android:summary="@string/allow_automated_crash_reporting"
android:title="@string/fabric_upload" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,27 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="insightpump"
android:title="@string/insightpump">
<SwitchPreference
android:defaultValue="false"
android:key="insight_always_connected"
android:summary="@string/not_recommended_due_to_battery_drain"
android:title="@string/insight_stay_always_connected" />
<SwitchPreference
android:defaultValue="true"
android:key="insight_preemptive_connect"
android:summary="@string/automatically_connect_when"
android:title="@string/connect_preemptively" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_real_tbr_cancel"
android:summary="@string/insight_actually_cancel_tbr_summary"
android:title="@string/insight_use_real_tbr_cancels" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_automatic_careportal_events"
android:summary="@string/automatically_upload_insulin_cannula_and_battery_changes_to_nightscout"
android:title="@string/automatic_careportal_events" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<PreferenceCategory android:title="@string/bluetooth">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_btwatchdog"
android:summary="@string/btwatchdog_summary"
android:title="@string/btwatchdog_title" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
<SwitchPreference
android:defaultValue="false"
android:key="insight_always_connected"
android:title="@string/insight_stay_always_connected"
android:summary="@string/not_recommended_due_to_battery_drain"/>
<SwitchPreference
android:defaultValue="true"
android:key="insight_preemptive_connect"
android:title="@string/connect_preemptively"
android:summary="@string/automatically_connect_when"/>
<SwitchPreference
android:defaultValue="false"
android:key="insight_real_tbr_cancel"
android:title="@string/insight_use_real_tbr_cancels"
android:summary="@string/insight_actually_cancel_tbr_summary"/>
<SwitchPreference
android:defaultValue="false"
android:key="insight_automatic_careportal_events"
android:title="@string/automatic_careportal_events"
android:summary="@string/automatically_upload_insulin_cannula_and_battery_changes_to_nightscout"/>
</PreferenceScreen>

View file

@ -7,26 +7,86 @@
<EditTextPreference
android:defaultValue="1"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:key="@string/key_openapsma_max_basal"
android:numeric="decimal"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:title="@string/openapsma_maxbasal_title" />
<EditTextPreference
android:defaultValue="1.5"
android:dialogMessage="@string/openapsma_maxiob_summary"
android:key="@string/key_openapsma_max_iob"
android:numeric="decimal"
android:dialogMessage="@string/openapsma_maxiob_summary"
android:title="@string/openapsma_maxiob_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_openapsama_useautosens"
android:title="@string/openapsama_useautosens" />
<SwitchPreference
android:defaultValue="true"
android:key="openapsama_autosens_adjusttargets"
android:key="@string/key_openapsama_autosens_adjusttargets"
android:summary="@string/openapsama_autosens_adjusttargets_summary"
android:title="@string/openapsama_autosens_adjusttargets" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<Preference android:summary="@string/openapsama_link_to_preferncejson_doc_txt">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/openapsama_link_to_preferncejson_doc" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_always_use_shortavg"
android:summary="@string/always_use_shortavg_summary"
android:title="@string/always_use_shortavg" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="3"
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_max_daily_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:title="@string/openapsama_max_daily_safety_multiplier"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="numericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="4"
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_current_basal_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_current_basal_safety_multiplier"
validate:floatmaxNumber="10"
validate:floatminNumber="1"
validate:testType="floatNumericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="2"
android:dialogMessage="@string/openapsama_bolussnooze_dia_divisor_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_bolussnooze_dia_divisor"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_bolussnooze_dia_divisor"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="floatNumericRange" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -1,20 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="openaps"
android:title="@string/openapsma">
<EditTextPreference
android:defaultValue="1"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:key="@string/key_openapsma_max_basal"
android:numeric="decimal"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:title="@string/openapsma_maxbasal_title" />
<EditTextPreference
android:defaultValue="1.5"
android:dialogMessage="@string/openapsma_maxiob_summary"
android:key="@string/key_openapsma_max_iob"
android:numeric="decimal"
android:dialogMessage="@string/openapsma_maxiob_summary"
android:title="@string/openapsma_maxiob_title" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<Preference android:summary="@string/openapsama_link_to_preferncejson_doc_txt">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/openapsama_link_to_preferncejson_doc" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_always_use_shortavg"
android:summary="@string/always_use_shortavg_summary"
android:title="@string/always_use_shortavg" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="2"
android:dialogMessage="@string/openapsama_bolussnooze_dia_divisor_summary"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:key="@string/key_openapsama_bolussnooze_dia_divisor"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_bolussnooze_dia_divisor"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="floatNumericRange" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -4,57 +4,67 @@
<PreferenceCategory
android:key="openapssmb"
android:title="@string/openapssmb">
<EditTextPreference
android:defaultValue="1"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:key="@string/key_openapsma_max_basal"
android:numeric="decimal"
android:dialogMessage="@string/openapsma_maxbasal_summary"
android:title="@string/openapsma_maxbasal_title" />
<EditTextPreference
android:defaultValue="3"
android:dialogMessage="@string/openapssmb_maxiob_summary"
android:key="@string/key_openapssmb_max_iob"
android:numeric="decimal"
android:dialogMessage="@string/openapssmb_maxiob_summary"
android:title="@string/openapssmb_maxiob_title" />
<SwitchPreference
android:defaultValue="false"
android:key="openapsama_useautosens"
android:title="@string/openapsama_useautosens" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_use_smb"
android:summary="@string/enablesmb_summary"
android:title="@string/enablesmb" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_use_smb"
android:key="@string/key_enableSMB_with_COB"
android:summary="@string/enablesmbwithcob_summary"
android:title="@string/enablesmbwithcob"
android:dependency="@string/key_use_smb"/>
android:title="@string/enablesmbwithcob" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_use_smb"
android:key="@string/key_enableSMB_with_temptarget"
android:summary="@string/enablesmbwithtemptarget_summary"
android:title="@string/enablesmbwithtemptarget"
android:dependency="@string/key_use_smb"/>
android:title="@string/enablesmbwithtemptarget" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_use_smb"
android:key="@string/key_allowSMB_with_high_temptarget"
android:summary="@string/enablesmbwithhightemptarget_summary"
android:title="@string/enablesmbwithhightemptarget"
android:dependency="@string/key_use_smb"/>
android:title="@string/enablesmbwithhightemptarget" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_use_smb"
android:key="@string/key_enableSMB_always"
android:summary="@string/enablesmbalways_summary"
android:title="@string/enablesmbalways"
android:dependency="@string/key_use_smb"/>
android:title="@string/enablesmbalways" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_use_smb"
android:key="@string/key_enableSMB_after_carbs"
android:summary="@string/enablesmbaftercarbs_summary"
android:title="@string/enablesmbaftercarbs"
android:dependency="@string/key_use_smb"/>
android:title="@string/enablesmbaftercarbs" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="30"
android:dialogMessage="@string/smbmaxminutes"
@ -68,12 +78,56 @@
validate:maxNumber="120"
validate:minNumber="15"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_use_uam"
android:summary="@string/enableuam_summary"
android:title="@string/enableuam" />
<PreferenceScreen android:title="@string/advancedsettings_title">
<Preference android:summary="@string/openapsama_link_to_preferncejson_doc_txt">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/openapsama_link_to_preferncejson_doc" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_always_use_shortavg"
android:summary="@string/always_use_shortavg_summary"
android:title="@string/always_use_shortavg" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="3"
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_max_daily_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:title="@string/openapsama_max_daily_safety_multiplier"
validate:maxNumber="10"
validate:minNumber="1"
validate:testType="numericRange" />
<com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="4"
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
android:digits="0123456789.,"
android:inputType="number"
android:key="@string/key_openapsama_current_basal_safety_multiplier"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/openapsama_current_basal_safety_multiplier"
validate:floatmaxNumber="10"
validate:floatminNumber="1"
validate:testType="floatNumericRange" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>