Merge branch 'meallink' into meallink_ValueWithUnit
This commit is contained in:
commit
16959d4de9
|
@ -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;
|
||||||
|
|
|
@ -12,6 +12,9 @@ import info.nightscout.androidaps.utils.TimeChangeType
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This interface defines the communication from AAPS-core to pump drivers.
|
||||||
|
* Pump drivers communicate data changes back to AAPS-core using {@link info.nightscout.androidaps.interfaces.PumpSync}.
|
||||||
|
*
|
||||||
* Created by mike on 04.06.2016.
|
* Created by mike on 04.06.2016.
|
||||||
*/
|
*/
|
||||||
interface PumpInterface {
|
interface PumpInterface {
|
||||||
|
|
|
@ -3,6 +3,22 @@ package info.nightscout.androidaps.interfaces
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface allows pump drivers to push data changes (creation and update of treatments) back to AAPS-core.
|
||||||
|
*
|
||||||
|
* Intended use cases for handling bolus treatments:
|
||||||
|
*
|
||||||
|
* - for pumps that have a reliable history that can be read and which therefore issue a bolus on the pump,
|
||||||
|
* read the history back and add new bolus entries on the pump, the method [syncBolusWithPumpId]
|
||||||
|
* are used to inform AAPS-core of a new bolus.
|
||||||
|
* [VirtualPumpPlugin](info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin) is a pump driver that
|
||||||
|
* takes this approach.
|
||||||
|
* - for pumps that don't support history or take rather long to complete a bolus, the methods
|
||||||
|
* [addBolusWithTempId] and [syncBolusWithTempId] provide a mechanism to notify AAPS-core of a started
|
||||||
|
* bolus, so AAPS-core can operate under the assumption the bolus will be delivered and effect IOB until delivery
|
||||||
|
* completed. Upon completion, the pump driver will call the second method to turn a temporary bolus into a finished
|
||||||
|
* bolus.
|
||||||
|
*/
|
||||||
interface PumpSync {
|
interface PumpSync {
|
||||||
/**
|
/**
|
||||||
* Create bolus with temporary id
|
* Create bolus with temporary id
|
||||||
|
|
|
@ -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