Medtrum: Support for 300U
This commit is contained in:
parent
d6e6a98642
commit
b87f41a363
7 changed files with 13 additions and 6 deletions
|
@ -413,6 +413,7 @@ enum class PumpType {
|
||||||
maxReservoirReading = 400,
|
maxReservoirReading = 400,
|
||||||
source = Source.Medtrum
|
source = Source.Medtrum
|
||||||
),
|
),
|
||||||
|
MEDTRUM_300U(description = "Medtrum 300U", model = "300U", parent = MEDTRUM_NANO),
|
||||||
MEDTRUM_UNTESTED(description = "Medtrum untested", model = "untested", parent = MEDTRUM_NANO);
|
MEDTRUM_UNTESTED(description = "Medtrum untested", model = "untested", parent = MEDTRUM_NANO);
|
||||||
|
|
||||||
val description: String
|
val description: String
|
||||||
|
|
|
@ -59,7 +59,8 @@ fun PumpType.Companion.fromDbPumpType(pt: InterfaceIDs.PumpType): PumpType =
|
||||||
InterfaceIDs.PumpType.USER -> PumpType.USER
|
InterfaceIDs.PumpType.USER -> PumpType.USER
|
||||||
InterfaceIDs.PumpType.DIACONN_G8 -> PumpType.DIACONN_G8
|
InterfaceIDs.PumpType.DIACONN_G8 -> PumpType.DIACONN_G8
|
||||||
InterfaceIDs.PumpType.EOPATCH2 -> PumpType.EOFLOW_EOPATCH2
|
InterfaceIDs.PumpType.EOPATCH2 -> PumpType.EOFLOW_EOPATCH2
|
||||||
InterfaceIDs.PumpType.MEDTRUM -> PumpType.MEDTRUM_NANO
|
InterfaceIDs.PumpType.MEDTRUM_NANO -> PumpType.MEDTRUM_NANO
|
||||||
|
InterfaceIDs.PumpType.MEDTRUM_300U -> PumpType.MEDTRUM_300U
|
||||||
InterfaceIDs.PumpType.MEDTRUM_UNTESTED -> PumpType.MEDTRUM_UNTESTED
|
InterfaceIDs.PumpType.MEDTRUM_UNTESTED -> PumpType.MEDTRUM_UNTESTED
|
||||||
InterfaceIDs.PumpType.CACHE -> PumpType.CACHE
|
InterfaceIDs.PumpType.CACHE -> PumpType.CACHE
|
||||||
}
|
}
|
||||||
|
@ -80,6 +81,7 @@ fun PumpType.Source.toDbSource(): UserEntry.Sources =
|
||||||
PumpType.Source.OmnipodEros -> UserEntry.Sources.OmnipodEros
|
PumpType.Source.OmnipodEros -> UserEntry.Sources.OmnipodEros
|
||||||
PumpType.Source.OmnipodDash -> UserEntry.Sources.OmnipodDash
|
PumpType.Source.OmnipodDash -> UserEntry.Sources.OmnipodDash
|
||||||
PumpType.Source.EOPatch2 -> UserEntry.Sources.EOPatch2
|
PumpType.Source.EOPatch2 -> UserEntry.Sources.EOPatch2
|
||||||
|
PumpType.Source.Medtrum -> UserEntry.Sources.Medtrum
|
||||||
PumpType.Source.MDI -> UserEntry.Sources.MDI
|
PumpType.Source.MDI -> UserEntry.Sources.MDI
|
||||||
PumpType.Source.VirtualPump -> UserEntry.Sources.VirtualPump
|
PumpType.Source.VirtualPump -> UserEntry.Sources.VirtualPump
|
||||||
else -> UserEntry.Sources.Unknown
|
else -> UserEntry.Sources.Unknown
|
||||||
|
@ -119,7 +121,8 @@ fun PumpType.toDbPumpType(): InterfaceIDs.PumpType =
|
||||||
PumpType.USER -> InterfaceIDs.PumpType.USER
|
PumpType.USER -> InterfaceIDs.PumpType.USER
|
||||||
PumpType.DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8
|
PumpType.DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8
|
||||||
PumpType.EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2
|
PumpType.EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2
|
||||||
PumpType.MEDTRUM_NANO -> InterfaceIDs.PumpType.MEDTRUM
|
PumpType.MEDTRUM_NANO -> InterfaceIDs.PumpType.MEDTRUM_NANO
|
||||||
|
PumpType.MEDTRUM_300U -> InterfaceIDs.PumpType.MEDTRUM_300U
|
||||||
PumpType.MEDTRUM_UNTESTED -> InterfaceIDs.PumpType.MEDTRUM_UNTESTED
|
PumpType.MEDTRUM_UNTESTED -> InterfaceIDs.PumpType.MEDTRUM_UNTESTED
|
||||||
PumpType.CACHE -> InterfaceIDs.PumpType.CACHE
|
PumpType.CACHE -> InterfaceIDs.PumpType.CACHE
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@ data class UserEntry(
|
||||||
OmnipodEros,
|
OmnipodEros,
|
||||||
OmnipodDash, //No entry currently
|
OmnipodDash, //No entry currently
|
||||||
EOPatch2,
|
EOPatch2,
|
||||||
|
Medtrum,
|
||||||
MDI,
|
MDI,
|
||||||
VirtualPump,
|
VirtualPump,
|
||||||
SMS, //From SMS plugin
|
SMS, //From SMS plugin
|
||||||
|
|
|
@ -43,7 +43,8 @@ data class InterfaceIDs(
|
||||||
MDI,
|
MDI,
|
||||||
DIACONN_G8,
|
DIACONN_G8,
|
||||||
EOPATCH2,
|
EOPATCH2,
|
||||||
MEDTRUM,
|
MEDTRUM_NANO,
|
||||||
|
MEDTRUM_300U,
|
||||||
MEDTRUM_UNTESTED,
|
MEDTRUM_UNTESTED,
|
||||||
USER,
|
USER,
|
||||||
CACHE;
|
CACHE;
|
||||||
|
|
|
@ -186,12 +186,12 @@ import kotlin.math.abs
|
||||||
}
|
}
|
||||||
|
|
||||||
when (medtrumPump.pumpType()) {
|
when (medtrumPump.pumpType()) {
|
||||||
PumpType.MEDTRUM_NANO -> {
|
PumpType.MEDTRUM_NANO, PumpType.MEDTRUM_300U -> {
|
||||||
alarmSetting?.entries = arrayOf(allAlarmEntries[6], allAlarmEntries[7]) // "Beep", "Silent"
|
alarmSetting?.entries = arrayOf(allAlarmEntries[6], allAlarmEntries[7]) // "Beep", "Silent"
|
||||||
alarmSetting?.entryValues = arrayOf(allAlarmValues[6], allAlarmValues[7]) // "6", "7"
|
alarmSetting?.entryValues = arrayOf(allAlarmValues[6], allAlarmValues[7]) // "6", "7"
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
// Use Nano settings for unknown pumps
|
// Use Nano settings for unknown pumps
|
||||||
alarmSetting?.entries = arrayOf(allAlarmEntries[6], allAlarmEntries[7]) // "Beep", "Silent"
|
alarmSetting?.entries = arrayOf(allAlarmEntries[6], allAlarmEntries[7]) // "Beep", "Silent"
|
||||||
alarmSetting?.entryValues = arrayOf(allAlarmValues[6], allAlarmValues[7]) // "6", "7"
|
alarmSetting?.entryValues = arrayOf(allAlarmValues[6], allAlarmValues[7]) // "6", "7"
|
||||||
|
|
|
@ -294,6 +294,7 @@ class MedtrumPump @Inject constructor(
|
||||||
fun pumpType(type: Int): PumpType =
|
fun pumpType(type: Int): PumpType =
|
||||||
when (type) {
|
when (type) {
|
||||||
MedtrumSnUtil.MD_0201, MedtrumSnUtil.MD_8201 -> PumpType.MEDTRUM_NANO
|
MedtrumSnUtil.MD_0201, MedtrumSnUtil.MD_8201 -> PumpType.MEDTRUM_NANO
|
||||||
|
MedtrumSnUtil.MD_8301 -> PumpType.MEDTRUM_300U
|
||||||
else -> PumpType.MEDTRUM_UNTESTED
|
else -> PumpType.MEDTRUM_UNTESTED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
<string name="medtrum">Medtrum</string>
|
<string name="medtrum">Medtrum</string>
|
||||||
<string name="medtrum_pump_shortname">MT</string>
|
<string name="medtrum_pump_shortname">MT</string>
|
||||||
<string name="medtrum_pump_description">Pump integration for Medtrum Nano</string>
|
<string name="medtrum_pump_description">Pump integration for Medtrum Nano and Medtrum 300U</string>
|
||||||
<string name="medtrum_pump_setting">Medtrum pump settings</string>
|
<string name="medtrum_pump_setting">Medtrum pump settings</string>
|
||||||
<string name="pump_error">Pump error: %1$s !! </string>
|
<string name="pump_error">Pump error: %1$s !! </string>
|
||||||
<string name="pump_is_suspended">Pump is suspended</string>
|
<string name="pump_is_suspended">Pump is suspended</string>
|
||||||
|
|
Loading…
Reference in a new issue