merge: profile is not an interface

This commit is contained in:
Andrei Vereha 2021-05-02 10:37:06 +02:00
parent 2ae9f399aa
commit dd8ebded1a
2 changed files with 5 additions and 6 deletions

View file

@ -482,7 +482,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
},
onError = { throwable ->
aapsLogger.error(LTag.PUMP, "Error in deactivatePod", throwable)
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.message))
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.toString()))
},
onComplete = {
aapsLogger.debug("deactivatePod completed")

View file

@ -1,14 +1,13 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.util
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram
import java.util.*
import kotlin.math.roundToInt
fun mapProfileToBasalProgram(profile: Profile): BasalProgram {
val basalValues = profile.basalValues
?: throw IllegalArgumentException("Basal values can not be null")
val basalValues = profile.getBasalValues()
if (basalValues.isEmpty()) {
throw IllegalArgumentException("Basal values should contain values")
}
@ -35,7 +34,7 @@ fun mapProfileToBasalProgram(profile: Profile): BasalProgram {
BasalProgram.Segment(
(previousBasalValue.timeAsSeconds / 1800).toShort(),
startSlotIndex,
(PumpType.Omnipod_Dash.determineCorrectBasalSize(previousBasalValue.value) * 100).roundToInt()
(PumpType.OMNIPOD_DASH.determineCorrectBasalSize(previousBasalValue.value) * 100).roundToInt()
)
)
}
@ -55,7 +54,7 @@ fun mapProfileToBasalProgram(profile: Profile): BasalProgram {
BasalProgram.Segment(
(previousBasalValue!!.timeAsSeconds / 1800).toShort(),
48,
(PumpType.Omnipod_Dash.determineCorrectBasalSize(previousBasalValue.value) * 100).roundToInt()
(PumpType.OMNIPOD_DASH.determineCorrectBasalSize(previousBasalValue.value) * 100).roundToInt()
)
)