Treatment cleanup
This commit is contained in:
parent
699413dd6f
commit
46793abbfc
|
@ -19,8 +19,7 @@ class WizardElement(carbs: Carbs)
|
||||||
val fake = Bolus(
|
val fake = Bolus(
|
||||||
amount = 0.0001,
|
amount = 0.0001,
|
||||||
timestamp = carbs.timestamp,
|
timestamp = carbs.timestamp,
|
||||||
type = Bolus.Type.NORMAL,
|
type = Bolus.Type.NORMAL
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
bolus = BolusElement(fake) // fake insulin record
|
bolus = BolusElement(fake) // fake insulin record
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,7 @@ class ActivityGraph : GraphView {
|
||||||
val bolus = Bolus(
|
val bolus = Bolus(
|
||||||
timestamp = 0,
|
timestamp = 0,
|
||||||
amount = 1.0,
|
amount = 1.0,
|
||||||
type = Bolus.Type.NORMAL,
|
type = Bolus.Type.NORMAL
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
val activityArray: MutableList<DataPoint> = ArrayList()
|
val activityArray: MutableList<DataPoint> = ArrayList()
|
||||||
val iobArray: MutableList<DataPoint> = ArrayList()
|
val iobArray: MutableList<DataPoint> = ArrayList()
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -52,12 +51,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.Constants
|
import info.nightscout.androidaps.Constants
|
||||||
import info.nightscout.androidaps.data.Iob
|
import info.nightscout.androidaps.data.Iob
|
||||||
|
import info.nightscout.androidaps.database.entities.Bolus
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||||
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
|
||||||
import info.nightscout.androidaps.plugins.insulin.InsulinOrefBasePlugin.Companion.MIN_DIA
|
import info.nightscout.androidaps.plugins.insulin.InsulinOrefBasePlugin.Companion.MIN_DIA
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
@ -69,12 +69,6 @@ class InsulinOrefBasePluginTest {
|
||||||
|
|
||||||
private var injector: HasAndroidInjector = HasAndroidInjector {
|
private var injector: HasAndroidInjector = HasAndroidInjector {
|
||||||
AndroidInjector {
|
AndroidInjector {
|
||||||
if (it is Treatment) {
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.activePlugin = activePlugin
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,31 +94,32 @@ class InsulinOrefBasePluginTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testIobCalcForTreatment() {
|
fun testIobCalcForTreatment() {
|
||||||
val treatment = Treatment(injector) //TODO: this should be a separate sut. I'd prefer a separate class.
|
val treatment = Bolus(timestamp = 0, amount = 10.0, type = Bolus.Type.NORMAL)
|
||||||
val expected = Iob()
|
val expected = Iob()
|
||||||
Assert.assertEquals(expected, sut.iobCalcForTreatment(treatment, 0, 0.0))
|
Assert.assertEquals(expected.iobContrib, sut.iobCalcForTreatment(treatment, 0, 0.0).iobContrib, 0.001)
|
||||||
|
Assert.assertEquals(expected.activityContrib, sut.iobCalcForTreatment(treatment, 0, 0.0).activityContrib, 0.001)
|
||||||
testPeak = 30
|
testPeak = 30
|
||||||
testUserDefinedDia = 4.0
|
testUserDefinedDia = 4.0
|
||||||
val time = System.currentTimeMillis()
|
val time = System.currentTimeMillis()
|
||||||
// check directly after bolus
|
// check directly after bolus
|
||||||
treatment.date = time
|
treatment.timestamp = time
|
||||||
treatment.insulin = 10.0
|
treatment.amount = 10.0
|
||||||
Assert.assertEquals(10.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
Assert.assertEquals(10.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||||
// check after 1 hour
|
// check after 1 hour
|
||||||
treatment.date = time - 1 * 60 * 60 * 1000 // 1 hour
|
treatment.timestamp = time - 1 * 60 * 60 * 1000 // 1 hour
|
||||||
treatment.insulin = 10.0
|
treatment.amount = 10.0
|
||||||
Assert.assertEquals(3.92, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
Assert.assertEquals(3.92, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||||
// check after 2 hour
|
// check after 2 hour
|
||||||
treatment.date = time - 2 * 60 * 60 * 1000 // 1 hour
|
treatment.timestamp = time - 2 * 60 * 60 * 1000 // 2 hours
|
||||||
treatment.insulin = 10.0
|
treatment.amount = 10.0
|
||||||
Assert.assertEquals(0.77, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
Assert.assertEquals(0.77, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||||
// check after 3 hour
|
// check after 3 hour
|
||||||
treatment.date = time - 3 * 60 * 60 * 1000 // 1 hour
|
treatment.timestamp = time - 3 * 60 * 60 * 1000 // 3 hours
|
||||||
treatment.insulin = 10.0
|
treatment.amount = 10.0
|
||||||
Assert.assertEquals(0.10, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
Assert.assertEquals(0.10, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||||
// check after dia
|
// check after dia
|
||||||
treatment.date = time - 4 * 60 * 60 * 1000
|
treatment.timestamp = time - 4 * 60 * 60 * 1000 // 4 hours
|
||||||
treatment.insulin = 10.0
|
treatment.amount = 10.0
|
||||||
Assert.assertEquals(0.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
Assert.assertEquals(0.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -119,8 +119,7 @@ class CommandQueueTest : TestBaseWithProfile() {
|
||||||
Bolus(
|
Bolus(
|
||||||
timestamp = Calendar.getInstance().also { it.set(2000, 0, 1) }.timeInMillis,
|
timestamp = Calendar.getInstance().also { it.set(2000, 0, 1) }.timeInMillis,
|
||||||
type = Bolus.Type.NORMAL,
|
type = Bolus.Type.NORMAL,
|
||||||
amount = 0.0,
|
amount = 0.0
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
`when`(profileFunction.getProfile()).thenReturn(validProfile)
|
`when`(profileFunction.getProfile()).thenReturn(validProfile)
|
||||||
|
|
|
@ -5,7 +5,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -54,12 +53,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@ class TriggerBolusAgoTest : TriggerTestBase() {
|
||||||
Bolus(
|
Bolus(
|
||||||
timestamp = now,
|
timestamp = now,
|
||||||
amount = 0.0,
|
amount = 0.0,
|
||||||
type = Bolus.Type.NORMAL,
|
type = Bolus.Type.NORMAL
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
) // Set last bolus time to now
|
) // Set last bolus time to now
|
||||||
`when`(dateUtil._now()).thenReturn(now + 10 * 60 * 1000) // set current time to now + 10 min
|
`when`(dateUtil._now()).thenReturn(now + 10 * 60 * 1000) // set current time to now + 10 min
|
||||||
|
@ -64,8 +63,7 @@ class TriggerBolusAgoTest : TriggerTestBase() {
|
||||||
Bolus(
|
Bolus(
|
||||||
timestamp = 0L,
|
timestamp = 0L,
|
||||||
amount = 0.0,
|
amount = 0.0,
|
||||||
type = Bolus.Type.NORMAL,
|
type = Bolus.Type.NORMAL
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
) // Set last bolus time to 0
|
) // Set last bolus time to 0
|
||||||
t = TriggerBolusAgo(injector).comparator(Comparator.Compare.IS_NOT_AVAILABLE)
|
t = TriggerBolusAgo(injector).comparator(Comparator.Compare.IS_NOT_AVAILABLE)
|
||||||
|
|
|
@ -106,8 +106,7 @@ class DetailedBolusInfo {
|
||||||
Bolus(
|
Bolus(
|
||||||
timestamp = bolusTimestamp ?: timestamp,
|
timestamp = bolusTimestamp ?: timestamp,
|
||||||
amount = insulin,
|
amount = insulin,
|
||||||
type = bolusType.toDBbBolusType(),
|
type = bolusType.toDBbBolusType()
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
else null
|
else null
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper;
|
||||||
import info.nightscout.androidaps.utils.JsonHelper;
|
import info.nightscout.androidaps.utils.JsonHelper;
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper;
|
import info.nightscout.androidaps.utils.resources.ResourceHelper;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@DatabaseTable(tableName = Treatment.TABLE_TREATMENTS)
|
@DatabaseTable(tableName = Treatment.TABLE_TREATMENTS)
|
||||||
public class Treatment implements DataPointWithLabelInterface, DbObjectBase {
|
public class Treatment implements DataPointWithLabelInterface, DbObjectBase {
|
||||||
@Inject public DefaultValueHelper defaultValueHelper;
|
@Inject public DefaultValueHelper defaultValueHelper;
|
||||||
|
|
|
@ -31,8 +31,7 @@ class PumpSyncImplementation @Inject constructor(
|
||||||
temporaryId = temporaryId,
|
temporaryId = temporaryId,
|
||||||
pumpType = pumpType.toDbPumpType(),
|
pumpType = pumpType.toDbPumpType(),
|
||||||
pumpSerial = pumpSerial
|
pumpSerial = pumpSerial
|
||||||
),
|
)
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
repository.runTransactionForResult(InsertPumpBolusWithTempIdTransaction(bolus))
|
repository.runTransactionForResult(InsertPumpBolusWithTempIdTransaction(bolus))
|
||||||
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
||||||
|
@ -53,8 +52,7 @@ class PumpSyncImplementation @Inject constructor(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = pumpType.toDbPumpType(),
|
pumpType = pumpType.toDbPumpType(),
|
||||||
pumpSerial = pumpSerial
|
pumpSerial = pumpSerial
|
||||||
),
|
)
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
repository.runTransactionForResult(SyncPumpBolusWithTempIdTransaction(bolus, type?.toDBbBolusType()))
|
repository.runTransactionForResult(SyncPumpBolusWithTempIdTransaction(bolus, type?.toDBbBolusType()))
|
||||||
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
||||||
|
@ -74,8 +72,7 @@ class PumpSyncImplementation @Inject constructor(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = pumpType.toDbPumpType(),
|
pumpType = pumpType.toDbPumpType(),
|
||||||
pumpSerial = pumpSerial
|
pumpSerial = pumpSerial
|
||||||
),
|
)
|
||||||
isBasalInsulin = false
|
|
||||||
)
|
)
|
||||||
repository.runTransactionForResult(SyncPumpBolusTransaction(bolus, type?.toDBbBolusType()))
|
repository.runTransactionForResult(SyncPumpBolusTransaction(bolus, type?.toDBbBolusType()))
|
||||||
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
||||||
|
|
|
@ -57,8 +57,7 @@ fun bolusFromJson(jsonObject: JSONObject): Bolus? {
|
||||||
timestamp = timestamp,
|
timestamp = timestamp,
|
||||||
amount = amount,
|
amount = amount,
|
||||||
type = type,
|
type = type,
|
||||||
isValid = isValid,
|
isValid = isValid
|
||||||
isBasalInsulin = false
|
|
||||||
).also {
|
).also {
|
||||||
it.interfaceIDs.nightscoutId = id
|
it.interfaceIDs.nightscoutId = id
|
||||||
it.interfaceIDs.pumpId = pumpId
|
it.interfaceIDs.pumpId = pumpId
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -52,12 +51,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -52,12 +51,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -52,12 +51,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.db.ProfileSwitch
|
import info.nightscout.androidaps.db.ProfileSwitch
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ConfigInterface
|
import info.nightscout.androidaps.interfaces.ConfigInterface
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -52,12 +51,6 @@ open class TestBaseWithProfile : TestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.dateUtil = dateUtil
|
it.dateUtil = dateUtil
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.activePlugin = activePluginProvider
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.danars.DanaRSTestBase
|
import info.nightscout.androidaps.danars.DanaRSTestBase
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||||
|
@ -32,12 +31,6 @@ class DanaRSPacketNotifyDeliveryCompleteTest : DanaRSTestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.danaPump = danaPump
|
it.danaPump = danaPump
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.activePlugin = activePlugin
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.danars.DanaRSTestBase
|
import info.nightscout.androidaps.danars.DanaRSTestBase
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||||
|
@ -31,12 +30,6 @@ class DanaRsPacketBolusSetStepBolusStopTest : DanaRSTestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.danaPump = danaPump
|
it.danaPump = danaPump
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.activePlugin = activePlugin
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.danars.DanaRSTestBase
|
import info.nightscout.androidaps.danars.DanaRSTestBase
|
||||||
import info.nightscout.androidaps.db.Treatment
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
|
@ -42,12 +41,6 @@ class DanaRsPacketNotifyDeliveryRateDisplayTest : DanaRSTestBase() {
|
||||||
it.resourceHelper = resourceHelper
|
it.resourceHelper = resourceHelper
|
||||||
it.danaPump = danaPump
|
it.danaPump = danaPump
|
||||||
}
|
}
|
||||||
if (it is Treatment) {
|
|
||||||
it.defaultValueHelper = defaultValueHelper
|
|
||||||
it.resourceHelper = resourceHelper
|
|
||||||
it.profileFunction = profileFunction
|
|
||||||
it.activePlugin = activePlugin
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ data class Bolus(
|
||||||
override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(),
|
override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(),
|
||||||
var amount: Double,
|
var amount: Double,
|
||||||
var type: Type,
|
var type: Type,
|
||||||
var isBasalInsulin: Boolean,
|
var isBasalInsulin: Boolean = false,
|
||||||
@Embedded
|
@Embedded
|
||||||
var insulinConfiguration: InsulinConfiguration? = null
|
var insulinConfiguration: InsulinConfiguration? = null
|
||||||
) : TraceableDBEntry, DBEntryWithTime {
|
) : TraceableDBEntry, DBEntryWithTime {
|
||||||
|
|
Loading…
Reference in a new issue