Added Medtrum pump type etc

This commit is contained in:
jbr7rr 2023-02-18 21:10:50 +01:00
parent 18be54f489
commit 37a6fa9220
5 changed files with 29 additions and 2 deletions

View file

@ -26,6 +26,7 @@ enum class PumpCapability {
YpsomedCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), // BasalRates (separately grouped)
DiaconnCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), //
EopatchCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, BasalRate30min)),
MedtrumCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, BasalRate30min)), // Technically the pump supports ExtendedBolus, but not implemented (yet)
BasalRate_Duration15minAllowed,
BasalRate_Duration30minAllowed,
BasalRate_Duration15and30minAllowed(arrayOf(BasalRate_Duration15minAllowed, BasalRate_Duration30minAllowed)),

View file

@ -391,6 +391,26 @@ enum class PumpType {
isPatchPump = true,
maxReservoirReading = 50,
source = Source.EOPatch2
),
//Medtrum Nano Pump
MEDTRUM_NANO(
description = "Medtrum Nano",
manufacturer = ManufacturerType.Medtrum,
model = "Nano",
bolusSize = 0.05,
specialBolusSize = null,
extendedBolusSettings = DoseSettings(0.05, 30, 8 * 60, 0.05, 30.0),
pumpTempBasalType = PumpTempBasalType.Absolute,
tbrSettings = DoseSettings(0.05, 30, 12 * 60, 0.0, 25.0),
specialBasalDurations = PumpCapability.BasalRate_Duration30minAllowed,
baseBasalMinValue = 0.05,
baseBasalMaxValue = 25.0,
baseBasalStep = 0.05,
baseBasalSpecialSteps = null,
pumpCapability = PumpCapability.MedtrumCapabilities,
isPatchPump = true,
source = Source.Medtrum
);
val description: String
@ -458,6 +478,7 @@ enum class PumpType {
OmnipodEros,
OmnipodDash,
EOPatch2,
Medtrum,
MDI,
VirtualPump,
Unknown

View file

@ -59,6 +59,7 @@ fun PumpType.Companion.fromDbPumpType(pt: InterfaceIDs.PumpType): PumpType =
InterfaceIDs.PumpType.USER -> PumpType.USER
InterfaceIDs.PumpType.DIACONN_G8 -> PumpType.DIACONN_G8
InterfaceIDs.PumpType.EOPATCH2 -> PumpType.EOFLOW_EOPATCH2
InterfaceIDs.PumpType.MEDTRUM -> PumpType.MEDTRUM_NANO
InterfaceIDs.PumpType.CACHE -> PumpType.CACHE
}
@ -117,5 +118,6 @@ fun PumpType.toDbPumpType(): InterfaceIDs.PumpType =
PumpType.USER -> InterfaceIDs.PumpType.USER
PumpType.DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8
PumpType.EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2
PumpType.MEDTRUM_NANO -> InterfaceIDs.PumpType.MEDTRUM
PumpType.CACHE -> InterfaceIDs.PumpType.CACHE
}

View file

@ -43,6 +43,7 @@ data class InterfaceIDs(
MDI,
DIACONN_G8,
EOPATCH2,
MEDTRUM,
USER,
CACHE;

View file

@ -64,6 +64,8 @@ class MedtrumPumpPlugin @Inject constructor(
.description(R.string.medtrum_pump_description), injector, aapsLogger, rh, commandQueue
), Pump {
private var mPumpType: PumpType = PumpType.MEDTRUM_NANO
private val mPumpDescription = PumpDescription(mPumpType)
override fun onStart() {
super.onStart()
@ -175,7 +177,7 @@ class MedtrumPumpPlugin @Inject constructor(
}
override fun model(): PumpType {
return PumpType.GENERIC_AAPS // TODO
return mPumpType
}
override fun serialNumber(): String {
@ -183,7 +185,7 @@ class MedtrumPumpPlugin @Inject constructor(
}
override val pumpDescription: PumpDescription
get() = PumpDescription(PumpType.GENERIC_AAPS) // TODO
get() = mPumpDescription
override fun shortStatus(veryShort: Boolean): String {
return ""// TODO