fix warnings
This commit is contained in:
parent
2dee60b4e0
commit
8184500467
1 changed files with 9 additions and 8 deletions
|
@ -100,22 +100,23 @@ class ProgramBasalCommand private constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildCommand(): ProgramBasalCommand {
|
override fun buildCommand(): ProgramBasalCommand {
|
||||||
requireNotNull(basalProgram) { "basalProgram can not be null" }
|
val program = requireNotNull(basalProgram) { "basalProgram can not be null" }
|
||||||
requireNotNull(programReminder) { "programReminder can not be null" }
|
val reminder = requireNotNull(programReminder) { "programReminder can not be null" }
|
||||||
requireNotNull(currentTime) { "currentTime can not be null" }
|
val time = requireNotNull(currentTime) { "currentTime can not be null" }
|
||||||
val pulsesPerSlot = ProgramBasalUtil.mapBasalProgramToPulsesPerSlot(basalProgram!!)
|
|
||||||
val currentSlot = ProgramBasalUtil.calculateCurrentSlot(pulsesPerSlot, currentTime)
|
val pulsesPerSlot = ProgramBasalUtil.mapBasalProgramToPulsesPerSlot(program)
|
||||||
|
val currentSlot = ProgramBasalUtil.calculateCurrentSlot(pulsesPerSlot, time)
|
||||||
val checksum = ProgramBasalUtil.calculateChecksum(pulsesPerSlot, currentSlot)
|
val checksum = ProgramBasalUtil.calculateChecksum(pulsesPerSlot, currentSlot)
|
||||||
val longInsulinProgramElements: List<BasalInsulinProgramElement> =
|
val longInsulinProgramElements: List<BasalInsulinProgramElement> =
|
||||||
mapTenthPulsesPerSlotToLongInsulinProgramElements(
|
mapTenthPulsesPerSlotToLongInsulinProgramElements(
|
||||||
ProgramBasalUtil.mapBasalProgramToTenthPulsesPerSlot(basalProgram!!)
|
ProgramBasalUtil.mapBasalProgramToTenthPulsesPerSlot(program)
|
||||||
)
|
)
|
||||||
val shortInsulinProgramElements = ProgramBasalUtil.mapPulsesPerSlotToShortInsulinProgramElements(
|
val shortInsulinProgramElements = ProgramBasalUtil.mapPulsesPerSlotToShortInsulinProgramElements(
|
||||||
pulsesPerSlot
|
pulsesPerSlot
|
||||||
)
|
)
|
||||||
val currentBasalInsulinProgramElement = ProgramBasalUtil.calculateCurrentLongInsulinProgramElement(
|
val currentBasalInsulinProgramElement = ProgramBasalUtil.calculateCurrentLongInsulinProgramElement(
|
||||||
longInsulinProgramElements,
|
longInsulinProgramElements,
|
||||||
currentTime
|
time
|
||||||
)
|
)
|
||||||
val interlockCommand = ProgramInsulinCommand(
|
val interlockCommand = ProgramInsulinCommand(
|
||||||
uniqueId!!, sequenceNumber!!, multiCommandFlag, nonce!!,
|
uniqueId!!, sequenceNumber!!, multiCommandFlag, nonce!!,
|
||||||
|
@ -128,7 +129,7 @@ class ProgramBasalCommand private constructor(
|
||||||
sequenceNumber!!,
|
sequenceNumber!!,
|
||||||
multiCommandFlag,
|
multiCommandFlag,
|
||||||
longInsulinProgramElements,
|
longInsulinProgramElements,
|
||||||
programReminder!!,
|
reminder,
|
||||||
currentBasalInsulinProgramElement.index,
|
currentBasalInsulinProgramElement.index,
|
||||||
currentBasalInsulinProgramElement.remainingTenthPulses,
|
currentBasalInsulinProgramElement.remainingTenthPulses,
|
||||||
currentBasalInsulinProgramElement.delayUntilNextTenthPulseInUsec
|
currentBasalInsulinProgramElement.delayUntilNextTenthPulseInUsec
|
||||||
|
|
Loading…
Reference in a new issue