diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt index 13079e418c..c12909848c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt @@ -29,7 +29,7 @@ import kotlin.math.ceil import kotlin.math.roundToInt @Singleton -class AutotuneIob @Inject constructor( +open class AutotuneIob @Inject constructor( private val aapsLogger: AAPSLogger, private val repository: AppRepository, private val profileFunction: ProfileFunction, @@ -41,10 +41,10 @@ class AutotuneIob @Inject constructor( private val nsTreatments = ArrayList() private var dia: Double = Constants.defaultDIA - var boluses: MutableList = ArrayList() + var boluses: ArrayList = ArrayList() var meals = ArrayList() lateinit var glucose: List // newest at index 0 - private lateinit var tempBasals: MutableList + private lateinit var tempBasals: ArrayList var startBG: Long = 0 var endBG: Long = 0 private fun range(): Long = (60 * 60 * 1000L * dia + T.hours(2).msecs()).toLong() @@ -225,7 +225,7 @@ class AutotuneIob @Inject constructor( } } - fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal { + open fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal { val bolusIob = getCalculationToTimeTreatments(time, localInsulin).round() return bolusIob } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePrep.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePrep.kt index 9e0b5d704f..edba396893 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePrep.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePrep.kt @@ -302,7 +302,7 @@ class AutotunePrep @Inject constructor( // Then, calculate carb absorption for that 5m interval using the deviation. if (mealCOB > 0) { - val ci = Math.max(deviation, sp.getDouble("openapsama_min_5m_carbimpact", 3.0)) + val ci = Math.max(deviation, sp.getDouble(R.string.key_openapsama_min_5m_carbimpact, 3.0)) val absorbed = ci * tunedprofile.ic / sens // Store the COB, and use it as the starting point for the next data point. mealCOB = Math.max(0.0, mealCOB - absorbed)