- added keys for preferences and fixes on all other places
This commit is contained in:
parent
5379b1af88
commit
b1320c4bcb
|
@ -1,5 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.hw.rileylink;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
|
||||
/**
|
||||
* Created by andy on 16/05/2018.
|
||||
*/
|
||||
|
@ -27,9 +29,9 @@ public class RileyLinkConst {
|
|||
|
||||
public class Prefs {
|
||||
|
||||
public static final String PrefPrefix = "pref_rileylink_";
|
||||
public static final String RileyLinkAddress = PrefPrefix + "mac_address"; // pref_rileylink_mac_address
|
||||
|
||||
//public static final String PrefPrefix = "pref_rileylink_";
|
||||
//public static final String RileyLinkAddress = PrefPrefix + "mac_address"; // pref_rileylink_mac_address
|
||||
public static final int RileyLinkAddress = R.string.pref_key_rileylink_mac_address;
|
||||
public static final String LastGoodDeviceCommunicationTime = Prefix + "lastGoodDeviceCommunicationTime";
|
||||
public static final String LastGoodDeviceFrequency = Prefix + "LastGoodDeviceFrequency";
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ public class MedtronicPumpStatus extends PumpStatus {
|
|||
}
|
||||
|
||||
|
||||
private double checkParameterValue(String key, String defaultValue, double defaultValueDouble) {
|
||||
private double checkParameterValue(int key, String defaultValue, double defaultValueDouble) {
|
||||
double val = 0.0d;
|
||||
|
||||
String value = SP.getString(key, defaultValue);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.util;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
|
||||
/**
|
||||
* Created by andy on 5/12/18.
|
||||
*/
|
||||
|
@ -10,15 +12,24 @@ public class MedtronicConst {
|
|||
|
||||
public class Prefs {
|
||||
|
||||
public static final String PrefPrefix = "pref_medtronic_";
|
||||
public static final String PumpSerial = PrefPrefix + "serial";
|
||||
public static final String PumpType = PrefPrefix + "pump_type";
|
||||
public static final String PumpFrequency = PrefPrefix + "frequency";
|
||||
public static final String MaxBolus = PrefPrefix + "max_bolus";
|
||||
public static final String MaxBasal = PrefPrefix + "max_basal";
|
||||
public static final String BolusDelay = PrefPrefix + "bolus_delay";
|
||||
public static final String Encoding = PrefPrefix + "encoding";
|
||||
public static final String BatteryType = PrefPrefix + "battery_type";
|
||||
// public static final String PrefPrefix = "pref_medtronic_";
|
||||
// public static final String PumpSerial = PrefPrefix + "serial";
|
||||
// public static final String PumpType = PrefPrefix + "pump_type";
|
||||
// public static final String PumpFrequency = PrefPrefix + "frequency";
|
||||
// public static final String MaxBolus = PrefPrefix + "max_bolus";
|
||||
// public static final String MaxBasal = PrefPrefix + "max_basal";
|
||||
// public static final String BolusDelay = PrefPrefix + "bolus_delay";
|
||||
// public static final String Encoding = PrefPrefix + "encoding";
|
||||
// public static final String BatteryType = PrefPrefix + "battery_type";
|
||||
|
||||
public static final int PumpSerial = R.string.pref_key_medtronic_serial;
|
||||
public static final int PumpType = R.string.pref_key_medtronic_pump_type;
|
||||
public static final int PumpFrequency = R.string.pref_key_medtronic_frequency;
|
||||
public static final int MaxBolus = R.string.pref_key_medtronic_max_bolus;
|
||||
public static final int MaxBasal = R.string.pref_key_medtronic_max_basal;
|
||||
public static final int BolusDelay = R.string.pref_key_medtronic_bolus_delay;
|
||||
public static final int Encoding = R.string.pref_key_medtronic_encoding;
|
||||
public static final int BatteryType = R.string.pref_key_medtronic_battery_type;
|
||||
}
|
||||
|
||||
public class Statistics {
|
||||
|
|
|
@ -1391,6 +1391,16 @@
|
|||
<string name="description_pump_medtronic">Pump integration for Medtronic, requires RileyLink device and specific Pump Model</string>
|
||||
|
||||
<!-- MDT Configuration -->
|
||||
<string name="pref_key_medtronic_serial">pref_medtronic_serial</string>
|
||||
<string name="pref_key_medtronic_pump_type">pref_medtronic_pump_type</string>
|
||||
<string name="pref_key_medtronic_frequency">pref_medtronic_frequency</string>
|
||||
<string name="pref_key_medtronic_max_bolus">pref_medtronic_max_bolus</string>
|
||||
<string name="pref_key_medtronic_max_basal">pref_medtronic_max_basal</string>
|
||||
<string name="pref_key_medtronic_bolus_delay">pref_medtronic_bolus_delay</string>
|
||||
<string name="pref_key_medtronic_encoding">pref_medtronic_encoding</string>
|
||||
<string name="pref_key_medtronic_battery_type">pref_medtronic_battery_type</string>
|
||||
<string name="pref_key_rileylink_mac_address">pref_rileylink_mac_address</string>
|
||||
|
||||
<string name="medtronic_serial_number">Pump Serial Number</string>
|
||||
<string name="medtronic_pump_type">Pump Type</string>
|
||||
<string name="medtronic_pump_frequency">Pump Frequency</string>
|
||||
|
@ -1494,7 +1504,6 @@
|
|||
<string name="medtronic_error_pump_wrong_max_basal_set">Wrong Max Basal set on Pump (must be %1$.2f).</string>
|
||||
<string name="medtronic_error_operation_not_possible_no_configuration">Operation is not possible.\n\n You need to configure Medtronic Pump first, before you can use this operation.</string>
|
||||
<string name="medtronic_error_pump_24h_time_change_requested">Over 24h Time change was requested.</string>
|
||||
<string name="xxx">xxx</string>
|
||||
|
||||
<!-- MDT History -->
|
||||
<string name="medtronic_history_group_basal">Basals</string>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<EditTextPreference
|
||||
android:defaultValue="000000"
|
||||
android:key="pref_medtronic_serial"
|
||||
android:key="@string/pref_key_medtronic_serial"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="false"
|
||||
android:title="@string/medtronic_serial_number" />
|
||||
|
@ -14,7 +14,7 @@
|
|||
android:defaultValue="1"
|
||||
android:entries="@array/medtronicPumpTypeArray"
|
||||
android:entryValues="@array/medtronicPumpTypeArray"
|
||||
android:key="pref_medtronic_pump_type"
|
||||
android:key="@string/pref_key_medtronic_pump_type"
|
||||
android:title="@string/medtronic_pump_type" />
|
||||
|
||||
|
||||
|
@ -22,13 +22,13 @@
|
|||
android:defaultValue="1"
|
||||
android:entries="@array/medtronicPumpFreqArray"
|
||||
android:entryValues="@array/medtronicPumpFreqArray"
|
||||
android:key="pref_medtronic_frequency"
|
||||
android:key="@string/pref_key_medtronic_frequency"
|
||||
android:selectable="true"
|
||||
android:title="@string/medtronic_pump_frequency" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="35"
|
||||
android:key="pref_medtronic_max_basal"
|
||||
android:key="@string/pref_key_medtronic_max_basal"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
<EditTextPreference
|
||||
android:defaultValue="25"
|
||||
android:key="pref_medtronic_max_bolus"
|
||||
android:key="@string/pref_key_medtronic_max_bolus"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
|
@ -48,7 +48,7 @@
|
|||
android:defaultValue="10"
|
||||
android:entries="@array/medtronicBolusDelay"
|
||||
android:entryValues="@array/medtronicBolusDelay"
|
||||
android:key="pref_medtronic_bolus_delay"
|
||||
android:key="@string/pref_key_medtronic_bolus_delay"
|
||||
android:selectable="true"
|
||||
android:title="@string/medtronic_pump_bolus_delay" />
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
android:defaultValue="@string/medtronic_pump_encoding_4b6b_rileylink"
|
||||
android:entries="@array/medtronicEncoding"
|
||||
android:entryValues="@array/medtronicEncoding"
|
||||
android:key="pref_medtronic_encoding"
|
||||
android:key="@string/pref_key_medtronic_encoding"
|
||||
android:selectable="true"
|
||||
android:title="@string/medtronic_pump_encoding" />
|
||||
|
||||
|
@ -64,7 +64,7 @@
|
|||
android:defaultValue="@string/medtronic_pump_battery_no"
|
||||
android:entries="@array/medtronicBatteryType"
|
||||
android:entryValues="@array/medtronicBatteryType"
|
||||
android:key="pref_medtronic_battery_type"
|
||||
android:key="@string/pref_key_medtronic_battery_type"
|
||||
android:selectable="true"
|
||||
android:title="@string/medtronic_pump_battery_select" />
|
||||
|
||||
|
@ -73,7 +73,7 @@
|
|||
android:enabled="true"
|
||||
android:summary=""
|
||||
android:title="RileyLink Configuration"
|
||||
android:key="pref_rileylink_mac_address">
|
||||
android:key="@string/pref_key_rileylink_mac_address">
|
||||
<intent android:action="info.nightscout.androidaps.plugins.PumpCommon.dialog.RileyLinkBLEScanActivity" />
|
||||
</info.nightscout.androidaps.plugins.pump.common.ui.RileyLinkSelectPreference>
|
||||
|
||||
|
|
Loading…
Reference in a new issue