move to interfaces
This commit is contained in:
parent
fd0bd85c64
commit
6fab5a9b8d
|
@ -35,7 +35,6 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
||||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||||
import info.nightscout.androidaps.databinding.ActivityMainBinding
|
import info.nightscout.androidaps.databinding.ActivityMainBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils
|
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils
|
||||||
import info.nightscout.androidaps.setupwizard.SetupWizardActivity
|
import info.nightscout.androidaps.setupwizard.SetupWizardActivity
|
||||||
|
@ -54,6 +53,7 @@ import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.locale.LocaleHelper
|
import info.nightscout.interfaces.locale.LocaleHelper
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
||||||
|
|
|
@ -13,7 +13,6 @@ import com.jjoe64.graphview.GraphView
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
|
import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||||
|
@ -22,6 +21,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.interfaces.BuildHelper
|
import info.nightscout.interfaces.BuildHelper
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
||||||
import info.nightscout.rx.events.EventCustomCalculationFinished
|
import info.nightscout.rx.events.EventCustomCalculationFinished
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package info.nightscout.androidaps.activities
|
package info.nightscout.androidaps.activities
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -8,8 +8,6 @@ import dagger.Provides
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.MainApp
|
import info.nightscout.androidaps.MainApp
|
||||||
import info.nightscout.androidaps.implementations.ActivityNamesImpl
|
import info.nightscout.androidaps.implementations.ActivityNamesImpl
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator
|
import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator
|
||||||
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
||||||
import info.nightscout.androidaps.interfaces.stats.TirCalculator
|
import info.nightscout.androidaps.interfaces.stats.TirCalculator
|
||||||
|
@ -50,7 +48,9 @@ import info.nightscout.interfaces.XDripBroadcast
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.autotune.Autotune
|
import info.nightscout.interfaces.autotune.Autotune
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
|
|
|
@ -15,11 +15,11 @@ import androidx.lifecycle.Lifecycle
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.databinding.OpenapsFragmentBinding
|
import info.nightscout.androidaps.databinding.OpenapsFragmentBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
||||||
import info.nightscout.androidaps.utils.JSONFormatter
|
import info.nightscout.androidaps.utils.JSONFormatter
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
|
|
@ -20,8 +20,6 @@ import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.convertedToPercent
|
import info.nightscout.androidaps.extensions.convertedToPercent
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui
|
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
|
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
|
||||||
|
@ -45,7 +43,9 @@ import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.aps.Loop.LastRun
|
import info.nightscout.interfaces.aps.Loop.LastRun
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -5,7 +5,6 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
||||||
|
@ -14,6 +13,7 @@ import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
import info.nightscout.interfaces.iob.MealData
|
import info.nightscout.interfaces.iob.MealData
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
|
|
|
@ -5,8 +5,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.target
|
import info.nightscout.androidaps.extensions.target
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.OpenAPSFragment
|
import info.nightscout.androidaps.plugins.aps.OpenAPSFragment
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
||||||
|
@ -22,6 +20,8 @@ import info.nightscout.interfaces.aps.AutosensResult
|
||||||
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -5,8 +5,6 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
||||||
|
@ -15,8 +13,10 @@ import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
import info.nightscout.interfaces.iob.MealData
|
import info.nightscout.interfaces.iob.MealData
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
|
|
@ -7,8 +7,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.target
|
import info.nightscout.androidaps.extensions.target
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.OpenAPSFragment
|
import info.nightscout.androidaps.plugins.aps.OpenAPSFragment
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
|
||||||
|
@ -24,6 +22,8 @@ import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -5,8 +5,6 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
||||||
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
||||||
|
@ -18,8 +16,10 @@ import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
import info.nightscout.interfaces.iob.MealData
|
import info.nightscout.interfaces.iob.MealData
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.utils.Round
|
import info.nightscout.interfaces.utils.Round
|
||||||
|
|
|
@ -4,8 +4,6 @@ import android.content.Context
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
|
@ -14,6 +12,8 @@ import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.BuildHelper
|
import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.utils.HardLimits
|
import info.nightscout.interfaces.utils.HardLimits
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -19,13 +19,13 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||||
import info.nightscout.androidaps.databinding.ConfigbuilderFragmentBinding
|
import info.nightscout.androidaps.databinding.ConfigbuilderFragmentBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
||||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES
|
import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.interfaces.BuildHelper
|
import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
|
|
|
@ -3,8 +3,6 @@ package info.nightscout.androidaps.plugins.configBuilder
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
|
@ -13,7 +11,9 @@ import info.nightscout.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.database.entities.ValueWithUnit
|
import info.nightscout.database.entities.ValueWithUnit
|
||||||
import info.nightscout.interfaces.ConfigBuilder
|
import info.nightscout.interfaces.ConfigBuilder
|
||||||
import info.nightscout.interfaces.aps.APS
|
import info.nightscout.interfaces.aps.APS
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity
|
||||||
import info.nightscout.interfaces.insulin.Insulin
|
import info.nightscout.interfaces.insulin.Insulin
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package info.nightscout.androidaps.plugins.configBuilder
|
package info.nightscout.androidaps.plugins.configBuilder
|
||||||
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.Overview
|
import info.nightscout.interfaces.Overview
|
||||||
import info.nightscout.interfaces.aps.APS
|
import info.nightscout.interfaces.aps.APS
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity
|
||||||
import info.nightscout.interfaces.constraints.Objectives
|
import info.nightscout.interfaces.constraints.Objectives
|
||||||
import info.nightscout.interfaces.constraints.Safety
|
import info.nightscout.interfaces.constraints.Safety
|
||||||
import info.nightscout.interfaces.insulin.Insulin
|
import info.nightscout.interfaces.insulin.Insulin
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.profile.ProfileSource
|
import info.nightscout.interfaces.profile.ProfileSource
|
||||||
|
|
|
@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.configBuilder
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged
|
import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged
|
||||||
import info.nightscout.androidaps.extensions.fromConstant
|
import info.nightscout.androidaps.extensions.fromConstant
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.database.entities.ProfileSwitch
|
import info.nightscout.database.entities.ProfileSwitch
|
||||||
|
@ -13,6 +12,7 @@ import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.profile.ProfileStore
|
import info.nightscout.interfaces.profile.ProfileStore
|
||||||
|
|
|
@ -8,8 +8,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.durationInMinutes
|
import info.nightscout.androidaps.extensions.durationInMinutes
|
||||||
import info.nightscout.androidaps.extensions.toStringFull
|
import info.nightscout.androidaps.extensions.toStringFull
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.receivers.Intents
|
import info.nightscout.androidaps.receivers.Intents
|
||||||
|
@ -19,6 +17,8 @@ import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.core.iob.round
|
import info.nightscout.core.iob.round
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -13,7 +13,6 @@ import info.nightscout.androidaps.dana.database.DanaHistoryDatabase
|
||||||
import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding
|
import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding
|
||||||
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
|
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
|
||||||
import info.nightscout.androidaps.insight.database.InsightDatabase
|
import info.nightscout.androidaps.insight.database.InsightDatabase
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
|
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
|
@ -26,6 +25,7 @@ import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.entities.UserEntry.Action
|
import info.nightscout.database.entities.UserEntry.Action
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
import info.nightscout.interfaces.sync.DataSyncSelector
|
import info.nightscout.interfaces.sync.DataSyncSelector
|
||||||
|
|
|
@ -34,8 +34,6 @@ import info.nightscout.androidaps.events.EventNewBG
|
||||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||||
import info.nightscout.androidaps.extensions.directionToIcon
|
import info.nightscout.androidaps.extensions.directionToIcon
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification
|
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB
|
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB
|
||||||
|
@ -71,6 +69,8 @@ import info.nightscout.interfaces.GlucoseUnit
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
|
|
|
@ -10,8 +10,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.toStringShort
|
import info.nightscout.androidaps.extensions.toStringShort
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
|
@ -20,6 +18,8 @@ import info.nightscout.core.iob.round
|
||||||
import info.nightscout.core.profile.toSignedUnitsString
|
import info.nightscout.core.profile.toSignedUnitsString
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.NotificationHolder
|
import info.nightscout.interfaces.NotificationHolder
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -9,8 +9,6 @@ import info.nightscout.androidaps.extensions.toStringShort
|
||||||
import info.nightscout.androidaps.extensions.total
|
import info.nightscout.androidaps.extensions.total
|
||||||
import info.nightscout.androidaps.extensions.valueToUnits
|
import info.nightscout.androidaps.extensions.valueToUnits
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
|
@ -46,6 +44,8 @@ import info.nightscout.interfaces.GlucoseUnit
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
|
|
|
@ -16,8 +16,6 @@ import com.google.android.gms.wearable.Wearable
|
||||||
import com.google.android.gms.wearable.WearableListenerService
|
import com.google.android.gms.wearable.WearableListenerService
|
||||||
import dagger.android.AndroidInjection
|
import dagger.android.AndroidInjection
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
||||||
import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui
|
import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui
|
||||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||||
|
@ -26,6 +24,8 @@ import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||||
|
|
||||||
|
import info.nightscout.database.entities.Carbs
|
||||||
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
import info.nightscout.rx.logging.LTag
|
||||||
|
import info.nightscout.shared.sharedPreferences.SP
|
||||||
|
import info.nightscout.shared.utils.DateUtil
|
||||||
|
|
||||||
|
fun fromCarbs(t: Carbs, isAAPSOrWeighted: Boolean, profileFunction: ProfileFunction, aapsLogger: AAPSLogger, dateUtil: DateUtil, sp: SP): AutosensData.CarbsInPast {
|
||||||
|
val time = t.timestamp
|
||||||
|
val carbs = t.amount
|
||||||
|
val remaining = t.amount
|
||||||
|
val min5minCarbImpact: Double
|
||||||
|
val profile = profileFunction.getProfile(t.timestamp)
|
||||||
|
if (isAAPSOrWeighted && profile != null) {
|
||||||
|
val maxAbsorptionHours = sp.getDouble(info.nightscout.core.main.R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)
|
||||||
|
val sens = profile.getIsfMgdl(t.timestamp)
|
||||||
|
val ic = profile.getIc(t.timestamp)
|
||||||
|
min5minCarbImpact = t.amount / (maxAbsorptionHours * 60 / 5) * sens / ic
|
||||||
|
aapsLogger.debug(
|
||||||
|
LTag.AUTOSENS,
|
||||||
|
"""Min 5m carbs impact for ${carbs}g @${dateUtil.dateAndTimeString(t.timestamp)} for ${maxAbsorptionHours}h calculated to $min5minCarbImpact ISF: $sens IC: $ic"""
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
min5minCarbImpact = sp.getDouble(info.nightscout.core.main.R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)
|
||||||
|
}
|
||||||
|
return AutosensData.CarbsInPast(time, carbs, min5minCarbImpact, remaining)
|
||||||
|
}
|
|
@ -10,10 +10,7 @@ import info.nightscout.androidaps.events.EventNewHistoryData
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.iobCalc
|
import info.nightscout.androidaps.extensions.iobCalc
|
||||||
import info.nightscout.androidaps.extensions.toTemporaryBasal
|
import info.nightscout.androidaps.extensions.toTemporaryBasal
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
|
||||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
|
@ -29,11 +26,15 @@ import info.nightscout.database.entities.interfaces.end
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
import info.nightscout.interfaces.aps.BasalData
|
import info.nightscout.interfaces.aps.BasalData
|
||||||
import info.nightscout.interfaces.iob.CobInfo
|
import info.nightscout.interfaces.iob.CobInfo
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
import info.nightscout.interfaces.iob.MealData
|
import info.nightscout.interfaces.iob.MealData
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
@ -93,7 +94,7 @@ class IobCobCalculatorPlugin @Inject constructor(
|
||||||
private var iobTable = LongSparseArray<IobTotal>() // oldest at index 0
|
private var iobTable = LongSparseArray<IobTotal>() // oldest at index 0
|
||||||
private var basalDataTable = LongSparseArray<BasalData>() // oldest at index 0
|
private var basalDataTable = LongSparseArray<BasalData>() // oldest at index 0
|
||||||
|
|
||||||
override var ads: AutosensDataStore = AutosensDataStore()
|
override var ads: AutosensDataStore = AutosensDataStoreObject()
|
||||||
|
|
||||||
private val dataLock = Any()
|
private val dataLock = Any()
|
||||||
private var thread: Thread? = null
|
private var thread: Thread? = null
|
||||||
|
|
|
@ -8,10 +8,8 @@ import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.target
|
import info.nightscout.androidaps.extensions.target
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
||||||
|
@ -24,8 +22,11 @@ import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.interfaces.BuildHelper
|
import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.events.Event
|
import info.nightscout.rx.events.Event
|
||||||
|
@ -64,7 +65,6 @@ class IobCobOref1Worker(
|
||||||
@Inject lateinit var dateUtil: DateUtil
|
@Inject lateinit var dateUtil: DateUtil
|
||||||
@Inject lateinit var repository: AppRepository
|
@Inject lateinit var repository: AppRepository
|
||||||
@Inject lateinit var dataWorkerStorage: DataWorkerStorage
|
@Inject lateinit var dataWorkerStorage: DataWorkerStorage
|
||||||
@Inject lateinit var calculationWorkflow: CalculationWorkflow
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
(context.applicationContext as HasAndroidInjector).androidInjector().inject(this)
|
(context.applicationContext as HasAndroidInjector).androidInjector().inject(this)
|
||||||
|
@ -127,7 +127,7 @@ class IobCobOref1Worker(
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.AUTOSENS, "Processing calculation thread: ${data.from} ($i/${bucketedData.size})")
|
aapsLogger.debug(LTag.AUTOSENS, "Processing calculation thread: ${data.from} ($i/${bucketedData.size})")
|
||||||
val sens = profile.getIsfMgdl(bgTime)
|
val sens = profile.getIsfMgdl(bgTime)
|
||||||
val autosensData = AutosensData(data.injector)
|
val autosensData = AutosensDataObject(data.injector)
|
||||||
autosensData.time = bgTime
|
autosensData.time = bgTime
|
||||||
if (previous != null) autosensData.activeCarbsList = previous.cloneCarbsList() else autosensData.activeCarbsList = ArrayList()
|
if (previous != null) autosensData.activeCarbsList = previous.cloneCarbsList() else autosensData.activeCarbsList = ArrayList()
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class IobCobOref1Worker(
|
||||||
for (recentCarbTreatment in recentCarbTreatments) {
|
for (recentCarbTreatment in recentCarbTreatments) {
|
||||||
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
||||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||||
autosensData.activeCarbsList.add(autosensData.CarbsInPast(recentCarbTreatment, isAAPSOrWeighted))
|
autosensData.activeCarbsList.add(fromCarbs(recentCarbTreatment, isAAPSOrWeighted, profileFunction, aapsLogger, dateUtil, sp))
|
||||||
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,8 @@ import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
||||||
|
@ -22,8 +20,11 @@ import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.BuildHelper
|
import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.events.Event
|
import info.nightscout.rx.events.Event
|
||||||
|
@ -121,7 +122,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.AUTOSENS, "Processing calculation thread: ${data.from} ($i/${bucketedData.size})")
|
aapsLogger.debug(LTag.AUTOSENS, "Processing calculation thread: ${data.from} ($i/${bucketedData.size})")
|
||||||
val sens = profile.getIsfMgdl(bgTime)
|
val sens = profile.getIsfMgdl(bgTime)
|
||||||
val autosensData = AutosensData(data.injector)
|
val autosensData = AutosensDataObject(data.injector)
|
||||||
autosensData.time = bgTime
|
autosensData.time = bgTime
|
||||||
if (previous != null) autosensData.activeCarbsList = previous.cloneCarbsList() else autosensData.activeCarbsList = ArrayList()
|
if (previous != null) autosensData.activeCarbsList = previous.cloneCarbsList() else autosensData.activeCarbsList = ArrayList()
|
||||||
|
|
||||||
|
@ -197,7 +198,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
||||||
for (recentCarbTreatment in recentCarbTreatments) {
|
for (recentCarbTreatment in recentCarbTreatments) {
|
||||||
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
||||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||||
autosensData.activeCarbsList.add(autosensData.CarbsInPast(recentCarbTreatment, isAAPSOrWeighted))
|
autosensData.activeCarbsList.add(fromCarbs(recentCarbTreatment, isAAPSOrWeighted, profileFunction, aapsLogger, dateUtil, sp))
|
||||||
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.sensitivity
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.utils.Round
|
import info.nightscout.interfaces.utils.Round
|
||||||
|
@ -47,7 +47,7 @@ abstract class AbstractSensitivityPlugin(
|
||||||
//If not-excluded data >= MIN_HOURS_FULL_AUTOSENS -> full Autosens
|
//If not-excluded data >= MIN_HOURS_FULL_AUTOSENS -> full Autosens
|
||||||
//Between MIN_HOURS and MIN_HOURS_FULL_AUTOSENS: gradually increase autosens
|
//Between MIN_HOURS and MIN_HOURS_FULL_AUTOSENS: gradually increase autosens
|
||||||
val autosensContrib = (min(max(Sensitivity.MIN_HOURS, deviationsArraySize / 12.0),
|
val autosensContrib = (min(max(Sensitivity.MIN_HOURS, deviationsArraySize / 12.0),
|
||||||
Sensitivity.MIN_HOURS_FULL_AUTOSENS) - Sensitivity.MIN_HOURS) / (Sensitivity.MIN_HOURS_FULL_AUTOSENS - Sensitivity.MIN_HOURS)
|
Sensitivity.MIN_HOURS_FULL_AUTOSENS) - Sensitivity.MIN_HOURS) / (Sensitivity.MIN_HOURS_FULL_AUTOSENS - Sensitivity.MIN_HOURS)
|
||||||
ratio = autosensContrib * (ratio - 1) + 1
|
ratio = autosensContrib * (ratio - 1) + 1
|
||||||
if (autosensContrib != 1.0) {
|
if (autosensContrib != 1.0) {
|
||||||
ratioLimit += "(" + deviationsArraySize + " of " + Sensitivity.MIN_HOURS_FULL_AUTOSENS * 12 + " values) "
|
ratioLimit += "(" + deviationsArraySize + " of " + Sensitivity.MIN_HOURS_FULL_AUTOSENS * 12 + " values) "
|
||||||
|
|
|
@ -4,13 +4,13 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.core.profile.secondsFromMidnight
|
import info.nightscout.core.profile.secondsFromMidnight
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity.SensitivityType
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
|
|
|
@ -4,14 +4,14 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.core.profile.secondsFromMidnight
|
import info.nightscout.core.profile.secondsFromMidnight
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity.SensitivityType
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
|
|
|
@ -5,13 +5,13 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.core.profile.secondsFromMidnight
|
import info.nightscout.core.profile.secondsFromMidnight
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity.SensitivityType
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
|
|
|
@ -15,14 +15,14 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.BuildConfig
|
import info.nightscout.androidaps.BuildConfig
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.LocalAlertUtils
|
import info.nightscout.interfaces.LocalAlertUtils
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import dagger.android.DaggerBroadcastReceiver
|
import dagger.android.DaggerBroadcastReceiver
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Pump
|
import info.nightscout.interfaces.pump.Pump
|
||||||
import info.nightscout.interfaces.utils.TimeChangeType
|
import info.nightscout.interfaces.utils.TimeChangeType
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
|
|
@ -10,7 +10,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
|
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||||
|
@ -36,6 +35,7 @@ import info.nightscout.interfaces.ConfigBuilder
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.constraints.Objectives
|
import info.nightscout.interfaces.constraints.Objectives
|
||||||
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.queue.CommandQueue
|
import info.nightscout.interfaces.queue.CommandQueue
|
||||||
|
|
|
@ -11,8 +11,6 @@ import androidx.work.WorkManager
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.events.EventNewHistoryData
|
import info.nightscout.androidaps.events.EventNewHistoryData
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Worker
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Worker
|
||||||
|
@ -20,6 +18,8 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOrefWorker
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.events.Event
|
import info.nightscout.rx.events.Event
|
||||||
|
|
|
@ -6,9 +6,9 @@ import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.events.EventNewBG
|
import info.nightscout.androidaps.events.EventNewBG
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.rx.events.Event
|
import info.nightscout.rx.events.Event
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,13 @@ import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.database.impl.AppRepository
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
import info.nightscout.shared.utils.DateUtil
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
import info.nightscout.shared.utils.DateUtil
|
||||||
|
import loadBgData
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class LoadBgDataWorker(
|
class LoadBgDataWorker(
|
||||||
|
|
|
@ -9,11 +9,11 @@ import androidx.work.workDataOf
|
||||||
import com.jjoe64.graphview.series.LineGraphSeries
|
import com.jjoe64.graphview.series.LineGraphSeries
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -5,7 +5,6 @@ import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
||||||
|
@ -15,6 +14,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.core.profile.fromMgdlToUnits
|
import info.nightscout.core.profile.fromMgdlToUnits
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.utils.Round
|
import info.nightscout.interfaces.utils.Round
|
||||||
|
|
|
@ -5,12 +5,12 @@ import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.InMemoryGlucoseValueDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.InMemoryGlucoseValueDataPoint
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -10,7 +10,6 @@ import com.jjoe64.graphview.series.BarGraphSeries
|
||||||
import com.jjoe64.graphview.series.LineGraphSeries
|
import com.jjoe64.graphview.series.LineGraphSeries
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||||
|
@ -18,6 +17,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Devia
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
||||||
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||||
|
@ -27,6 +27,7 @@ import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
import info.nightscout.interfaces.aps.SMBDefaults
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
@ -146,7 +147,7 @@ class PrepareIobAutosensGraphDataWorker(
|
||||||
val iob = data.iobCobCalculator.calculateFromTreatmentsAndTemps(time, profile)
|
val iob = data.iobCobCalculator.calculateFromTreatmentsAndTemps(time, profile)
|
||||||
val baseBasalIob = data.iobCobCalculator.calculateAbsoluteIobFromBaseBasals(time)
|
val baseBasalIob = data.iobCobCalculator.calculateAbsoluteIobFromBaseBasals(time)
|
||||||
val absIob = IobTotal.combine(iob, baseBasalIob)
|
val absIob = IobTotal.combine(iob, baseBasalIob)
|
||||||
val autosensData = adsData.getAutosensDataAtTime(time)
|
val autosensData = adsData.getAutosensDataAtTime(time) as AutosensDataObject?
|
||||||
if (abs(lastIob - iob.iob) > 0.02) {
|
if (abs(lastIob - iob.iob) > 0.02) {
|
||||||
if (abs(lastIob - iob.iob) > 0.2) iobArray.add(ScaledDataPoint(time, lastIob, data.overviewData.iobScale))
|
if (abs(lastIob - iob.iob) > 0.2) iobArray.add(ScaledDataPoint(time, lastIob, data.overviewData.iobScale))
|
||||||
iobArray.add(ScaledDataPoint(time, iob.iob, data.overviewData.iobScale))
|
iobArray.add(ScaledDataPoint(time, iob.iob, data.overviewData.iobScale))
|
||||||
|
|
|
@ -5,7 +5,6 @@ import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.BolusDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.BolusDataPoint
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.CarbsDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.CarbsDataPoint
|
||||||
|
@ -23,6 +22,7 @@ import info.nightscout.database.entities.Bolus
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.utils.Round
|
import info.nightscout.interfaces.utils.Round
|
||||||
|
|
|
@ -5,13 +5,13 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
import info.nightscout.database.entities.EffectiveProfileSwitch
|
import info.nightscout.database.entities.EffectiveProfileSwitch
|
||||||
import info.nightscout.database.entities.embedments.InsulinConfiguration
|
import info.nightscout.database.entities.embedments.InsulinConfiguration
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.profile.ProfileStore
|
import info.nightscout.interfaces.profile.ProfileStore
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -30,6 +30,7 @@ import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.constraints.Objectives
|
import info.nightscout.interfaces.constraints.Objectives
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
|
|
|
@ -6,14 +6,14 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||||
|
|
|
@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.configBuilder
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -4,7 +4,6 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.HardLimitsMock
|
import info.nightscout.androidaps.HardLimitsMock
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
|
@ -14,6 +13,7 @@ import info.nightscout.interfaces.BuildHelper
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||||
import info.nightscout.interfaces.utils.HardLimits
|
import info.nightscout.interfaces.utils.HardLimits
|
||||||
|
|
|
@ -3,9 +3,9 @@ package info.nightscout.androidaps.plugins.sensitivity
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
|
import info.nightscout.interfaces.aps.Sensitivity
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -4,16 +4,16 @@ import android.content.Context
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStoreObject
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.wizard.BolusWizard
|
import info.nightscout.core.wizard.BolusWizard
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||||
|
@ -43,7 +43,7 @@ class BolusWizardTest : TestBase() {
|
||||||
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
||||||
@Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin
|
@Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin
|
||||||
@Mock lateinit var dateUtil: DateUtil
|
@Mock lateinit var dateUtil: DateUtil
|
||||||
@Mock lateinit var autosensDataStore: AutosensDataStore
|
@Mock lateinit var autosensDataStore: AutosensDataStoreObject
|
||||||
|
|
||||||
val injector = HasAndroidInjector {
|
val injector = HasAndroidInjector {
|
||||||
AndroidInjector {
|
AndroidInjector {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.os.HandlerThread
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.automation.actions.Action
|
import info.nightscout.automation.actions.Action
|
||||||
import info.nightscout.automation.actions.ActionAlarm
|
import info.nightscout.automation.actions.ActionAlarm
|
||||||
import info.nightscout.automation.actions.ActionCarePortalEvent
|
import info.nightscout.automation.actions.ActionCarePortalEvent
|
||||||
|
@ -44,6 +43,7 @@ import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.plugin.PluginType
|
import info.nightscout.interfaces.plugin.PluginType
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.elements.InputProfileName
|
import info.nightscout.automation.elements.InputProfileName
|
||||||
|
@ -13,6 +12,7 @@ import info.nightscout.automation.elements.LayoutBuilder
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.database.entities.ValueWithUnit
|
import info.nightscout.database.entities.ValueWithUnit
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.utils.JsonHelper
|
import info.nightscout.interfaces.utils.JsonHelper
|
||||||
|
|
|
@ -4,13 +4,13 @@ import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.elements.InputDuration
|
import info.nightscout.automation.elements.InputDuration
|
||||||
import info.nightscout.automation.elements.InputProfileName
|
import info.nightscout.automation.elements.InputProfileName
|
||||||
import info.nightscout.automation.elements.LabelWithElement
|
import info.nightscout.automation.elements.LabelWithElement
|
||||||
import info.nightscout.automation.elements.LayoutBuilder
|
import info.nightscout.automation.elements.LayoutBuilder
|
||||||
import info.nightscout.interfaces.autotune.Autotune
|
import info.nightscout.interfaces.autotune.Autotune
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.utils.JsonHelper
|
import info.nightscout.interfaces.utils.JsonHelper
|
||||||
|
|
|
@ -5,7 +5,6 @@ import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.extensions.friendlyDescription
|
import info.nightscout.androidaps.extensions.friendlyDescription
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.elements.ComparatorExists
|
import info.nightscout.automation.elements.ComparatorExists
|
||||||
|
@ -23,6 +22,7 @@ import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction
|
import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -6,9 +6,9 @@ import android.widget.AdapterView
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.Spinner
|
import android.widget.Spinner
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
||||||
class InputProfileName(private val rh: ResourceHelper, private val activePlugin: ActivePlugin, val name: String = "", private val addActive: Boolean = false) : Element() {
|
class InputProfileName(private val rh: ResourceHelper, private val activePlugin: ActivePlugin, val name: String = "", private val addActive: Boolean = false) : Element() {
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ import android.widget.TextView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.google.common.base.Optional
|
import com.google.common.base.Optional
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.dialogs.ChooseTriggerDialog
|
import info.nightscout.automation.dialogs.ChooseTriggerDialog
|
||||||
|
@ -19,6 +17,8 @@ import info.nightscout.automation.events.EventTriggerClone
|
||||||
import info.nightscout.automation.events.EventTriggerRemove
|
import info.nightscout.automation.events.EventTriggerRemove
|
||||||
import info.nightscout.automation.services.LastLocationDataContainer
|
import info.nightscout.automation.services.LastLocationDataContainer
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
|
|
@ -4,12 +4,12 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.core.fabric.FabricPrivacy
|
import info.nightscout.core.fabric.FabricPrivacy
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.profile.ProfileStore
|
import info.nightscout.interfaces.profile.ProfileStore
|
||||||
|
|
|
@ -5,7 +5,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.TestPumpPlugin
|
import info.nightscout.androidaps.TestPumpPlugin
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.automation.triggers.Trigger
|
import info.nightscout.automation.triggers.Trigger
|
||||||
import info.nightscout.database.entities.OfflineEvent
|
import info.nightscout.database.entities.OfflineEvent
|
||||||
|
@ -13,6 +12,7 @@ import info.nightscout.interfaces.ConfigBuilder
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.automation.triggers
|
package info.nightscout.automation.triggers
|
||||||
|
|
||||||
import com.google.common.base.Optional
|
import com.google.common.base.Optional
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.elements.Comparator
|
import info.nightscout.automation.elements.Comparator
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
@ -58,7 +58,7 @@ class TriggerAutosensValueTest : TriggerTestBase() {
|
||||||
t.autosens.value = 390.0
|
t.autosens.value = 390.0
|
||||||
t.comparator.value = Comparator.Compare.IS_EQUAL_OR_LESSER
|
t.comparator.value = Comparator.Compare.IS_EQUAL_OR_LESSER
|
||||||
Assert.assertTrue(t.shouldRun())
|
Assert.assertTrue(t.shouldRun())
|
||||||
`when`(autosensDataStore.getLastAutosensData(anyObject(), anyObject(), anyObject())).thenReturn(AutosensData(injector))
|
`when`(autosensDataStore.getLastAutosensData(anyObject(), anyObject(), anyObject())).thenReturn(AutosensDataObject(injector))
|
||||||
t = TriggerAutosensValue(injector)
|
t = TriggerAutosensValue(injector)
|
||||||
t.autosens.value = 80.0
|
t.autosens.value = 80.0
|
||||||
t.comparator.value = Comparator.Compare.IS_EQUAL_OR_LESSER
|
t.comparator.value = Comparator.Compare.IS_EQUAL_OR_LESSER
|
||||||
|
@ -110,7 +110,7 @@ class TriggerAutosensValueTest : TriggerTestBase() {
|
||||||
`when`(dateUtil.now()).thenReturn(now)
|
`when`(dateUtil.now()).thenReturn(now)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateAutosensData(): AutosensData {
|
private fun generateAutosensData(): AutosensDataObject {
|
||||||
return AutosensData(injector)
|
return AutosensDataObject(injector)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,13 +5,13 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.TestPumpPlugin
|
import info.nightscout.androidaps.TestPumpPlugin
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStoreObject
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.automation.AutomationPlugin
|
import info.nightscout.automation.AutomationPlugin
|
||||||
import info.nightscout.automation.services.LastLocationDataContainer
|
import info.nightscout.automation.services.LastLocationDataContainer
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginDescription
|
import info.nightscout.interfaces.plugin.PluginDescription
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.shared.sharedPreferences.SP
|
import info.nightscout.shared.sharedPreferences.SP
|
||||||
|
@ -25,7 +25,7 @@ open class TriggerTestBase : TestBaseWithProfile() {
|
||||||
@Mock lateinit var locationDataContainer: LastLocationDataContainer
|
@Mock lateinit var locationDataContainer: LastLocationDataContainer
|
||||||
@Mock lateinit var activePlugin: ActivePlugin
|
@Mock lateinit var activePlugin: ActivePlugin
|
||||||
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
||||||
@Mock lateinit var autosensDataStore: AutosensDataStore
|
@Mock lateinit var autosensDataStore: AutosensDataStoreObject
|
||||||
@Mock lateinit var context: Context
|
@Mock lateinit var context: Context
|
||||||
@Mock lateinit var automationPlugin: AutomationPlugin
|
@Mock lateinit var automationPlugin: AutomationPlugin
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import dagger.Module
|
||||||
import dagger.android.ContributesAndroidInjector
|
import dagger.android.ContributesAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
|
@ -13,7 +13,7 @@ abstract class CoreDataClassesModule {
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun pumpEnactResultInjector(): PumpEnactResultObject
|
@ContributesAndroidInjector abstract fun pumpEnactResultInjector(): PumpEnactResultObject
|
||||||
@ContributesAndroidInjector abstract fun apsResultInjector(): APSResultObject
|
@ContributesAndroidInjector abstract fun apsResultInjector(): APSResultObject
|
||||||
@ContributesAndroidInjector abstract fun autosensDataInjector(): AutosensData
|
@ContributesAndroidInjector abstract fun autosensDataInjector(): AutosensDataObject
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStoreObject
|
@ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStoreObject
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package info.nightscout.androidaps.extensions
|
package info.nightscout.androidaps.extensions
|
||||||
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.database.entities.Bolus
|
import info.nightscout.database.entities.Bolus
|
||||||
import info.nightscout.interfaces.insulin.Insulin
|
import info.nightscout.interfaces.insulin.Insulin
|
||||||
import info.nightscout.interfaces.iob.Iob
|
import info.nightscout.interfaces.iob.Iob
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
|
|
||||||
fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob {
|
fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob {
|
||||||
if (!isValid || type == Bolus.Type.PRIMING ) return Iob()
|
if (!isValid || type == Bolus.Type.PRIMING ) return Iob()
|
||||||
|
|
|
@ -4,15 +4,15 @@ import android.text.Spanned
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.convertedToPercent
|
import info.nightscout.androidaps.extensions.convertedToPercent
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.interfaces.aps.APSResult
|
import info.nightscout.interfaces.aps.APSResult
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||||
import info.nightscout.interfaces.utils.HtmlHelper.fromHtml
|
import info.nightscout.interfaces.utils.HtmlHelper.fromHtml
|
||||||
|
|
|
@ -12,15 +12,12 @@ import info.nightscout.androidaps.extensions.isInProgress
|
||||||
import info.nightscout.androidaps.extensions.toStringFull
|
import info.nightscout.androidaps.extensions.toStringFull
|
||||||
import info.nightscout.androidaps.extensions.toStringShort
|
import info.nightscout.androidaps.extensions.toStringShort
|
||||||
import info.nightscout.androidaps.extensions.valueToUnits
|
import info.nightscout.androidaps.extensions.valueToUnits
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DeviationDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DeviationDataPoint
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.core.iob.round
|
import info.nightscout.core.iob.round
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
|
@ -28,8 +25,11 @@ import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.entities.TemporaryTarget
|
import info.nightscout.database.entities.TemporaryTarget
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
import info.nightscout.interfaces.iob.CobInfo
|
import info.nightscout.interfaces.iob.CobInfo
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.iob.IobTotal
|
import info.nightscout.interfaces.iob.IobTotal
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package info.nightscout.androidaps.plugins.general.overview.graphExtensions
|
package info.nightscout.androidaps.plugins.general.overview.graphExtensions
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.database.entities.Bolus
|
import info.nightscout.database.entities.Bolus
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
||||||
class BolusDataPoint(
|
class BolusDataPoint(
|
||||||
|
|
|
@ -3,12 +3,10 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||||
import androidx.collection.LongSparseArray
|
import androidx.collection.LongSparseArray
|
||||||
import androidx.collection.size
|
import androidx.collection.size
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated
|
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
import info.nightscout.interfaces.iob.InMemoryGlucoseValue
|
import info.nightscout.interfaces.iob.InMemoryGlucoseValue
|
||||||
import info.nightscout.rx.bus.RxBus
|
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
import info.nightscout.shared.utils.DateUtil
|
import info.nightscout.shared.utils.DateUtil
|
||||||
|
@ -17,44 +15,44 @@ import kotlin.math.abs
|
||||||
import kotlin.math.roundToLong
|
import kotlin.math.roundToLong
|
||||||
|
|
||||||
@OpenForTesting
|
@OpenForTesting
|
||||||
class AutosensDataStore {
|
class AutosensDataStoreObject : AutosensDataStore {
|
||||||
|
|
||||||
private val dataLock = Any()
|
override val dataLock = Any()
|
||||||
var lastUsed5minCalculation: Boolean? = null // true if used 5min bucketed data
|
override var lastUsed5minCalculation: Boolean? = null // true if used 5min bucketed data
|
||||||
|
|
||||||
// we need to make sure that bucketed_data will always have the same timestamp for correct use of cached values
|
// we need to make sure that bucketed_data will always have the same timestamp for correct use of cached values
|
||||||
// once referenceTime != null all bucketed data should be (x * 5min) from referenceTime
|
// once referenceTime != null all bucketed data should be (x * 5min) from referenceTime
|
||||||
var referenceTime: Long = -1
|
var referenceTime: Long = -1
|
||||||
|
|
||||||
var bgReadings: List<GlucoseValue> = listOf() // newest at index 0
|
override var bgReadings: List<GlucoseValue> = listOf() // newest at index 0
|
||||||
@Synchronized set
|
@Synchronized set
|
||||||
@Synchronized get
|
@Synchronized get
|
||||||
|
|
||||||
var autosensDataTable = LongSparseArray<AutosensData>() // oldest at index 0
|
override var autosensDataTable = LongSparseArray<AutosensData>() // oldest at index 0
|
||||||
@Synchronized set
|
@Synchronized set
|
||||||
@Synchronized get
|
@Synchronized get
|
||||||
|
|
||||||
var bucketedData: MutableList<InMemoryGlucoseValue>? = null
|
override var bucketedData: MutableList<InMemoryGlucoseValue>? = null
|
||||||
@Synchronized set
|
@Synchronized set
|
||||||
@Synchronized get
|
@Synchronized get
|
||||||
|
|
||||||
fun clone(): AutosensDataStore =
|
override fun clone(): AutosensDataStore =
|
||||||
AutosensDataStore().also {
|
AutosensDataStoreObject().also {
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
it.bgReadings = this.bgReadings.toMutableList()
|
it.bgReadings = this.bgReadings.toMutableList()
|
||||||
it.autosensDataTable = LongSparseArray<AutosensData>(this.autosensDataTable.size).apply { putAll(this@AutosensDataStore.autosensDataTable) }
|
it.autosensDataTable = LongSparseArray<AutosensData>(this.autosensDataTable.size).apply { putAll(this@AutosensDataStoreObject.autosensDataTable) }
|
||||||
it.bucketedData = this.bucketedData?.toMutableList()
|
it.bucketedData = this.bucketedData?.toMutableList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getBucketedDataTableCopy(): MutableList<InMemoryGlucoseValue>? = synchronized(dataLock) { bucketedData?.toMutableList() }
|
override fun getBucketedDataTableCopy(): MutableList<InMemoryGlucoseValue>? = synchronized(dataLock) { bucketedData?.toMutableList() }
|
||||||
fun getBgReadingsDataTableCopy(): List<GlucoseValue> = synchronized(dataLock) { bgReadings.toMutableList() }
|
override fun getBgReadingsDataTableCopy(): List<GlucoseValue> = synchronized(dataLock) { bgReadings.toMutableList() }
|
||||||
|
|
||||||
fun reset() {
|
override fun reset() {
|
||||||
synchronized(autosensDataTable) { autosensDataTable = LongSparseArray() }
|
synchronized(autosensDataTable) { autosensDataTable = LongSparseArray() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun newHistoryData(time: Long, aapsLogger: AAPSLogger, dateUtil: DateUtil) {
|
override fun newHistoryData(time: Long, aapsLogger: AAPSLogger, dateUtil: DateUtil) {
|
||||||
synchronized(autosensDataTable) {
|
synchronized(autosensDataTable) {
|
||||||
for (index in autosensDataTable.size() - 1 downTo 0) {
|
for (index in autosensDataTable.size() - 1 downTo 0) {
|
||||||
if (autosensDataTable.keyAt(index) > time) {
|
if (autosensDataTable.keyAt(index) > time) {
|
||||||
|
@ -68,7 +66,7 @@ class AutosensDataStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
// roundup to whole minute
|
// roundup to whole minute
|
||||||
fun roundUpTime(time: Long): Long {
|
override fun roundUpTime(time: Long): Long {
|
||||||
return if (time % 60000 == 0L) time else (time / 60000 + 1) * 60000
|
return if (time % 60000 == 0L) time else (time / 60000 + 1) * 60000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +75,7 @@ class AutosensDataStore {
|
||||||
*
|
*
|
||||||
* @return GlucoseValue or null
|
* @return GlucoseValue or null
|
||||||
*/
|
*/
|
||||||
fun lastBg(): GlucoseValue? =
|
override fun lastBg(): GlucoseValue? =
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
if (bgReadings.isNotEmpty()) bgReadings[0]
|
if (bgReadings.isNotEmpty()) bgReadings[0]
|
||||||
else null
|
else null
|
||||||
|
@ -88,12 +86,12 @@ class AutosensDataStore {
|
||||||
*
|
*
|
||||||
* @return GlucoseValue or null
|
* @return GlucoseValue or null
|
||||||
*/
|
*/
|
||||||
fun actualBg(): GlucoseValue? {
|
override fun actualBg(): GlucoseValue? {
|
||||||
val lastBg = lastBg() ?: return null
|
val lastBg = lastBg() ?: return null
|
||||||
return if (lastBg.timestamp > System.currentTimeMillis() - T.mins(9).msecs()) lastBg else null
|
return if (lastBg.timestamp > System.currentTimeMillis() - T.mins(9).msecs()) lastBg else null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun lastDataTime(dateUtil: DateUtil): String =
|
override fun lastDataTime(dateUtil: DateUtil): String =
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
if (autosensDataTable.size() > 0) dateUtil.dateAndTimeAndSecondsString(autosensDataTable.valueAt(autosensDataTable.size() - 1).time)
|
if (autosensDataTable.size() > 0) dateUtil.dateAndTimeAndSecondsString(autosensDataTable.valueAt(autosensDataTable.size() - 1).time)
|
||||||
else "autosensDataTable empty"
|
else "autosensDataTable empty"
|
||||||
|
@ -107,7 +105,7 @@ class AutosensDataStore {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAutosensDataAtTime(fromTime: Long): AutosensData? {
|
override fun getAutosensDataAtTime(fromTime: Long): AutosensData? {
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
val now = System.currentTimeMillis()
|
val now = System.currentTimeMillis()
|
||||||
if (fromTime > now) return null
|
if (fromTime > now) return null
|
||||||
|
@ -116,7 +114,7 @@ class AutosensDataStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLastAutosensData(reason: String, aapsLogger: AAPSLogger, dateUtil: DateUtil): AutosensData? {
|
override fun getLastAutosensData(reason: String, aapsLogger: AAPSLogger, dateUtil: DateUtil): AutosensData? {
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
if (autosensDataTable.size() < 1) {
|
if (autosensDataTable.size() < 1) {
|
||||||
aapsLogger.debug(LTag.AUTOSENS, "AUTOSENSDATA null: autosensDataTable empty ($reason)")
|
aapsLogger.debug(LTag.AUTOSENS, "AUTOSENSDATA null: autosensDataTable empty ($reason)")
|
||||||
|
@ -156,21 +154,6 @@ class AutosensDataStore {
|
||||||
return someTime + diff
|
return someTime + diff
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadBgData(to: Long, repository: AppRepository, aapsLogger: AAPSLogger, dateUtil: DateUtil, rxBus: RxBus) {
|
|
||||||
synchronized(dataLock) {
|
|
||||||
val start = to - T.hours((24 + 10 /* max dia */).toLong()).msecs()
|
|
||||||
// there can be some readings with time in close future (caused by wrong time setting on sensor)
|
|
||||||
// so add 2 minutes
|
|
||||||
bgReadings = repository
|
|
||||||
.compatGetBgReadingsDataFromTime(start, to + T.mins(2).msecs(), false)
|
|
||||||
.blockingGet()
|
|
||||||
.filter { it.value >= 39 }
|
|
||||||
aapsLogger.debug(LTag.AUTOSENS) { "BG data loaded. Size: ${bgReadings.size} Start date: ${dateUtil.dateAndTimeString(start)} End date: ${dateUtil.dateAndTimeString(to)}" }
|
|
||||||
createBucketedData(aapsLogger, dateUtil)
|
|
||||||
rxBus.send(EventBucketedDataCreated())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isAbout5minData(aapsLogger: AAPSLogger): Boolean {
|
fun isAbout5minData(aapsLogger: AAPSLogger): Boolean {
|
||||||
synchronized(dataLock) {
|
synchronized(dataLock) {
|
||||||
if (bgReadings.size < 3) return true
|
if (bgReadings.size < 3) return true
|
||||||
|
@ -196,7 +179,7 @@ class AutosensDataStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createBucketedData(aapsLogger: AAPSLogger, dateUtil: DateUtil) {
|
override fun createBucketedData(aapsLogger: AAPSLogger, dateUtil: DateUtil) {
|
||||||
val fiveMinData = isAbout5minData(aapsLogger)
|
val fiveMinData = isAbout5minData(aapsLogger)
|
||||||
if (lastUsed5minCalculation != null && lastUsed5minCalculation != fiveMinData) {
|
if (lastUsed5minCalculation != null && lastUsed5minCalculation != fiveMinData) {
|
||||||
// changing mode => clear cache
|
// changing mode => clear cache
|
||||||
|
@ -340,7 +323,7 @@ class AutosensDataStore {
|
||||||
bucketedData = bData
|
bucketedData = bData
|
||||||
}
|
}
|
||||||
|
|
||||||
fun slowAbsorptionPercentage(timeInMinutes: Int): Double {
|
override fun slowAbsorptionPercentage(timeInMinutes: Int): Double {
|
||||||
var sum = 0.0
|
var sum = 0.0
|
||||||
var count = 0
|
var count = 0
|
||||||
val valuesToProcess = timeInMinutes / 5
|
val valuesToProcess = timeInMinutes / 5
|
|
@ -1,10 +1,10 @@
|
||||||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||||
|
|
||||||
import dagger.Reusable
|
import dagger.Reusable
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.core.iob.asRounded
|
import info.nightscout.core.iob.asRounded
|
||||||
import info.nightscout.core.iob.log
|
import info.nightscout.core.iob.log
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
import info.nightscout.shared.utils.DateUtil
|
import info.nightscout.shared.utils.DateUtil
|
||||||
|
|
|
@ -6,10 +6,9 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataP
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.database.entities.Carbs
|
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.aps.AutosensData
|
||||||
import info.nightscout.interfaces.aps.AutosensResult
|
import info.nightscout.interfaces.aps.AutosensResult
|
||||||
import info.nightscout.interfaces.aps.SMBDefaults
|
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
@ -20,7 +19,7 @@ import java.util.Locale
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
class AutosensData(injector: HasAndroidInjector) : DataPointWithLabelInterface {
|
class AutosensDataObject(injector: HasAndroidInjector) : DataPointWithLabelInterface, AutosensData {
|
||||||
|
|
||||||
@Inject lateinit var aapsLogger: AAPSLogger
|
@Inject lateinit var aapsLogger: AAPSLogger
|
||||||
@Inject lateinit var sp: SP
|
@Inject lateinit var sp: SP
|
||||||
|
@ -28,70 +27,41 @@ class AutosensData(injector: HasAndroidInjector) : DataPointWithLabelInterface {
|
||||||
@Inject lateinit var profileFunction: ProfileFunction
|
@Inject lateinit var profileFunction: ProfileFunction
|
||||||
@Inject lateinit var dateUtil: DateUtil
|
@Inject lateinit var dateUtil: DateUtil
|
||||||
|
|
||||||
inner class CarbsInPast {
|
override var time = 0L
|
||||||
|
override var bg = 0.0 // mgdl
|
||||||
var time: Long
|
|
||||||
var carbs: Double
|
|
||||||
var min5minCarbImpact = 0.0
|
|
||||||
var remaining: Double
|
|
||||||
|
|
||||||
constructor(t: Carbs, isAAPSOrWeighted: Boolean) {
|
|
||||||
time = t.timestamp
|
|
||||||
carbs = t.amount
|
|
||||||
remaining = t.amount
|
|
||||||
val profile = profileFunction.getProfile(t.timestamp)
|
|
||||||
if (isAAPSOrWeighted && profile != null) {
|
|
||||||
val maxAbsorptionHours = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)
|
|
||||||
val sens = profile.getIsfMgdl(t.timestamp)
|
|
||||||
val ic = profile.getIc(t.timestamp)
|
|
||||||
min5minCarbImpact = t.amount / (maxAbsorptionHours * 60 / 5) * sens / ic
|
|
||||||
aapsLogger.debug(
|
|
||||||
LTag.AUTOSENS,
|
|
||||||
"""Min 5m carbs impact for ${carbs}g @${dateUtil.dateAndTimeString(t.timestamp)} for ${maxAbsorptionHours}h calculated to $min5minCarbImpact ISF: $sens IC: $ic"""
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
min5minCarbImpact = sp.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal constructor(other: CarbsInPast) {
|
|
||||||
time = other.time
|
|
||||||
carbs = other.carbs
|
|
||||||
min5minCarbImpact = other.min5minCarbImpact
|
|
||||||
remaining = other.remaining
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun toString(): String =
|
|
||||||
String.format(Locale.ENGLISH, "CarbsInPast: time: %s carbs: %.02f min5minCI: %.02f remaining: %.2f", dateUtil.dateAndTimeString(time), carbs, min5minCarbImpact, remaining)
|
|
||||||
}
|
|
||||||
|
|
||||||
var time = 0L
|
|
||||||
var bg = 0.0 // mgdl
|
|
||||||
var chartTime: Long = 0
|
var chartTime: Long = 0
|
||||||
var pastSensitivity = ""
|
override var pastSensitivity = ""
|
||||||
var deviation = 0.0
|
override var deviation = 0.0
|
||||||
var validDeviation = false
|
override var validDeviation = false
|
||||||
var activeCarbsList: MutableList<CarbsInPast> = ArrayList()
|
var activeCarbsList: MutableList<AutosensData.CarbsInPast> = ArrayList()
|
||||||
var absorbed = 0.0
|
var absorbed = 0.0
|
||||||
var carbsFromBolus = 0.0
|
override var carbsFromBolus = 0.0
|
||||||
var cob = 0.0
|
override var cob = 0.0
|
||||||
var bgi = 0.0
|
var bgi = 0.0
|
||||||
var delta = 0.0
|
var delta = 0.0
|
||||||
var avgDelta = 0.0
|
var avgDelta = 0.0
|
||||||
var avgDeviation = 0.0
|
override var avgDeviation = 0.0
|
||||||
var autosensResult = AutosensResult()
|
override var autosensResult = AutosensResult()
|
||||||
var slopeFromMaxDeviation = 0.0
|
override var slopeFromMaxDeviation = 0.0
|
||||||
var slopeFromMinDeviation = 999.0
|
override var slopeFromMinDeviation = 999.0
|
||||||
var usedMinCarbsImpact = 0.0
|
override var usedMinCarbsImpact = 0.0
|
||||||
var failOverToMinAbsorptionRate = false
|
override var failOverToMinAbsorptionRate = false
|
||||||
|
|
||||||
// Oref1
|
// Oref1
|
||||||
var absorbing = false
|
override var absorbing = false
|
||||||
var mealCarbs = 0.0
|
override var mealCarbs = 0.0
|
||||||
var mealStartCounter = 999
|
override var mealStartCounter = 999
|
||||||
var type = ""
|
override var type = ""
|
||||||
var uam = false
|
override var uam = false
|
||||||
var extraDeviation: MutableList<Double> = ArrayList()
|
override var extraDeviation: MutableList<Double> = ArrayList()
|
||||||
|
private fun fromCarbsInPast(other: AutosensData.CarbsInPast): AutosensData.CarbsInPast =
|
||||||
|
AutosensData.CarbsInPast(
|
||||||
|
time = other.time,
|
||||||
|
carbs = other.carbs,
|
||||||
|
min5minCarbImpact = other.min5minCarbImpact,
|
||||||
|
remaining = other.remaining
|
||||||
|
)
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return String.format(
|
return String.format(
|
||||||
Locale.ENGLISH,
|
Locale.ENGLISH,
|
||||||
|
@ -113,10 +83,10 @@ class AutosensData(injector: HasAndroidInjector) : DataPointWithLabelInterface {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun cloneCarbsList(): MutableList<CarbsInPast> {
|
override fun cloneCarbsList(): MutableList<AutosensData.CarbsInPast> {
|
||||||
val newActiveCarbsList: MutableList<CarbsInPast> = ArrayList()
|
val newActiveCarbsList: MutableList<AutosensData.CarbsInPast> = ArrayList()
|
||||||
for (c in activeCarbsList) {
|
for (c in activeCarbsList) {
|
||||||
newActiveCarbsList.add(CarbsInPast(c))
|
newActiveCarbsList.add(fromCarbsInPast(c))
|
||||||
}
|
}
|
||||||
return newActiveCarbsList
|
return newActiveCarbsList
|
||||||
}
|
}
|
|
@ -12,12 +12,12 @@ import android.widget.EditText
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import info.nightscout.core.main.R
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
||||||
import info.nightscout.androidaps.utils.CryptoUtil
|
import info.nightscout.androidaps.utils.CryptoUtil
|
||||||
import info.nightscout.androidaps.utils.ToastUtils
|
import info.nightscout.androidaps.utils.ToastUtils
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.AlertDialogHelper
|
import info.nightscout.androidaps.utils.alertDialogs.AlertDialogHelper
|
||||||
|
import info.nightscout.core.main.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.shared.sharedPreferences.SP
|
import info.nightscout.shared.sharedPreferences.SP
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated
|
||||||
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||||
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
import info.nightscout.rx.logging.LTag
|
||||||
|
import info.nightscout.shared.utils.DateUtil
|
||||||
|
import info.nightscout.shared.utils.T
|
||||||
|
|
||||||
|
fun AutosensDataStore.loadBgData(to: Long, repository: AppRepository, aapsLogger: AAPSLogger, dateUtil: DateUtil, rxBus: RxBus) {
|
||||||
|
synchronized(dataLock) {
|
||||||
|
val start = to - T.hours((24 + 10 /* max dia */).toLong()).msecs()
|
||||||
|
// there can be some readings with time in close future (caused by wrong time setting on sensor)
|
||||||
|
// so add 2 minutes
|
||||||
|
bgReadings = repository
|
||||||
|
.compatGetBgReadingsDataFromTime(start, to + T.mins(2).msecs(), false)
|
||||||
|
.blockingGet()
|
||||||
|
.filter { it.value >= 39 }
|
||||||
|
aapsLogger.debug(LTag.AUTOSENS) { "BG data loaded. Size: ${bgReadings.size} Start date: ${dateUtil.dateAndTimeString(start)} End date: ${dateUtil.dateAndTimeString(to)}" }
|
||||||
|
createBucketedData(aapsLogger, dateUtil)
|
||||||
|
rxBus.send(EventBucketedDataCreated())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import androidx.collection.ArrayMap
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileStore
|
import info.nightscout.interfaces.profile.ProfileStore
|
||||||
import info.nightscout.interfaces.profile.PureProfile
|
import info.nightscout.interfaces.profile.PureProfile
|
||||||
import info.nightscout.interfaces.utils.HardLimits
|
import info.nightscout.interfaces.utils.HardLimits
|
||||||
|
|
|
@ -7,8 +7,6 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.formatColor
|
import info.nightscout.androidaps.extensions.formatColor
|
||||||
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
||||||
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
|
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
|
@ -31,6 +29,8 @@ import info.nightscout.interfaces.aps.Loop
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
|
|
|
@ -3,7 +3,6 @@ package info.nightscout.core.wizard
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.valueToUnits
|
import info.nightscout.androidaps.extensions.valueToUnits
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.iob.round
|
import info.nightscout.core.iob.round
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
|
@ -12,6 +11,7 @@ import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.interfaces.aps.Loop
|
import info.nightscout.interfaces.aps.Loop
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
|
|
|
@ -5,11 +5,11 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.ProfileSealed
|
import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.profile.ProfileStore
|
import info.nightscout.interfaces.profile.ProfileStore
|
||||||
|
|
|
@ -6,7 +6,6 @@ import info.nightscout.androidaps.HardLimitsMock
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.TestPumpPlugin
|
import info.nightscout.androidaps.TestPumpPlugin
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.core.profile.fromMgdlToUnits
|
import info.nightscout.core.profile.fromMgdlToUnits
|
||||||
import info.nightscout.core.profile.toMgdl
|
import info.nightscout.core.profile.toMgdl
|
||||||
|
@ -16,6 +15,7 @@ import info.nightscout.core.profile.toUnits
|
||||||
import info.nightscout.core.profile.toUnitsString
|
import info.nightscout.core.profile.toUnitsString
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.GlucoseUnit
|
import info.nightscout.interfaces.GlucoseUnit
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.utils.HardLimits
|
import info.nightscout.interfaces.utils.HardLimits
|
||||||
import info.nightscout.rx.TestAapsSchedulers
|
import info.nightscout.rx.TestAapsSchedulers
|
||||||
|
|
|
@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.aps.loop
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.database.entities.TemporaryBasal
|
import info.nightscout.database.entities.TemporaryBasal
|
||||||
import info.nightscout.interfaces.aps.APSResult
|
import info.nightscout.interfaces.aps.APSResult
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.interfaces.pump.defs.PumpType
|
import info.nightscout.interfaces.pump.defs.PumpType
|
||||||
import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble
|
import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package info.nightscout.androidaps.plugins.iob.iobCalculator
|
package info.nightscout.androidaps.plugins.iob.iobCalculator
|
||||||
|
|
||||||
import info.nightscout.androidaps.TestBase
|
import info.nightscout.androidaps.TestBase
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStoreObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.iob.asRounded
|
import info.nightscout.core.iob.asRounded
|
||||||
import info.nightscout.core.iob.log
|
import info.nightscout.core.iob.log
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
import info.nightscout.shared.utils.DateUtil
|
import info.nightscout.shared.utils.DateUtil
|
||||||
import info.nightscout.shared.utils.T
|
import info.nightscout.shared.utils.T
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
|
@ -24,7 +24,7 @@ class GlucoseStatusTest : TestBase() {
|
||||||
|
|
||||||
@Mock lateinit var dateUtil: DateUtil
|
@Mock lateinit var dateUtil: DateUtil
|
||||||
@Mock lateinit var iobCobCalculatorPlugin: IobCobCalculator
|
@Mock lateinit var iobCobCalculatorPlugin: IobCobCalculator
|
||||||
@Mock lateinit var autosensDataStore: AutosensDataStore
|
@Mock lateinit var autosensDataStore: AutosensDataStoreObject
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun prepare() {
|
fun prepare() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ class AutosensDataStoreTest : TestBase() {
|
||||||
|
|
||||||
lateinit var dateUtil: DateUtil
|
lateinit var dateUtil: DateUtil
|
||||||
|
|
||||||
private val autosensDataStore = AutosensDataStore()
|
private val autosensDataStore = AutosensDataStoreObject()
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun mock() {
|
fun mock() {
|
||||||
|
|
|
@ -14,12 +14,12 @@ import android.provider.Settings
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult
|
import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.utils.ToastUtils
|
import info.nightscout.androidaps.utils.ToastUtils
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
import info.nightscout.interfaces.AndroidPermission
|
import info.nightscout.interfaces.AndroidPermission
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package info.nightscout.implementation
|
package info.nightscout.implementation
|
||||||
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
|
@ -15,6 +14,7 @@ import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.LocalAlertUtils
|
import info.nightscout.interfaces.LocalAlertUtils
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package info.nightscout.implementation.constraints
|
package info.nightscout.implementation.constraints
|
||||||
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package info.nightscout.implementation.pump
|
package info.nightscout.implementation.pump
|
||||||
|
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
|
@ -35,6 +34,7 @@ import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransact
|
||||||
import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction
|
import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction
|
||||||
import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction
|
import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
|
|
|
@ -11,7 +11,6 @@ import info.nightscout.androidaps.data.ProfileSealed
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.dialogs.BolusProgressDialog
|
import info.nightscout.androidaps.dialogs.BolusProgressDialog
|
||||||
import info.nightscout.androidaps.extensions.getCustomizedName
|
import info.nightscout.androidaps.extensions.getCustomizedName
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
|
@ -46,6 +45,7 @@ import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.constraints.Constraint
|
import info.nightscout.interfaces.constraints.Constraint
|
||||||
import info.nightscout.interfaces.constraints.Constraints
|
import info.nightscout.interfaces.constraints.Constraints
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||||
|
|
|
@ -8,12 +8,12 @@ import android.os.SystemClock
|
||||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||||
import info.nightscout.androidaps.extensions.safeDisable
|
import info.nightscout.androidaps.extensions.safeDisable
|
||||||
import info.nightscout.androidaps.extensions.safeEnable
|
import info.nightscout.androidaps.extensions.safeEnable
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
import info.nightscout.interfaces.AndroidPermission
|
import info.nightscout.interfaces.AndroidPermission
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.CommandQueue
|
import info.nightscout.interfaces.queue.CommandQueue
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.events.EventQueueChanged
|
import info.nightscout.rx.events.EventQueueChanged
|
||||||
|
|
|
@ -3,9 +3,9 @@ package info.nightscout.implementation.queue.commands
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.dialogs.BolusProgressDialog
|
import info.nightscout.androidaps.dialogs.BolusProgressDialog
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.interfaces.queue.CustomCommand
|
import info.nightscout.interfaces.queue.CustomCommand
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Insight
|
import info.nightscout.interfaces.pump.Insight
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Dana
|
import info.nightscout.interfaces.pump.Dana
|
||||||
import info.nightscout.interfaces.pump.Diaconn
|
import info.nightscout.interfaces.pump.Diaconn
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Dana
|
import info.nightscout.interfaces.pump.Dana
|
||||||
import info.nightscout.interfaces.pump.Diaconn
|
import info.nightscout.interfaces.pump.Diaconn
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
import info.nightscout.interfaces.LocalAlertUtils
|
import info.nightscout.interfaces.LocalAlertUtils
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||||
import info.nightscout.interfaces.pump.PumpEnactResult
|
import info.nightscout.interfaces.pump.PumpEnactResult
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.plugin.PluginBase
|
import info.nightscout.interfaces.plugin.PluginBase
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Dana
|
import info.nightscout.interfaces.pump.Dana
|
||||||
import info.nightscout.interfaces.pump.Diaconn
|
import info.nightscout.interfaces.pump.Diaconn
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Insight
|
import info.nightscout.interfaces.pump.Insight
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.Insight
|
import info.nightscout.interfaces.pump.Insight
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
import info.nightscout.interfaces.queue.Command
|
import info.nightscout.interfaces.queue.Command
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.implementation.queue.commands
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.data.PumpEnactResultObject
|
import info.nightscout.androidaps.data.PumpEnactResultObject
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.Profile
|
import info.nightscout.interfaces.profile.Profile
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
import info.nightscout.interfaces.queue.Callback
|
import info.nightscout.interfaces.queue.Callback
|
||||||
|
|
|
@ -10,8 +10,6 @@ import android.widget.TableRow
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import info.nightscout.androidaps.extensions.toTableRow
|
import info.nightscout.androidaps.extensions.toTableRow
|
||||||
import info.nightscout.androidaps.extensions.toTableRowHeader
|
import info.nightscout.androidaps.extensions.toTableRowHeader
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
|
||||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|
||||||
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
import info.nightscout.androidaps.interfaces.stats.TddCalculator
|
||||||
import info.nightscout.database.entities.Bolus
|
import info.nightscout.database.entities.Bolus
|
||||||
import info.nightscout.database.entities.TotalDailyDose
|
import info.nightscout.database.entities.TotalDailyDose
|
||||||
|
@ -19,6 +17,8 @@ import info.nightscout.database.entities.embedments.InterfaceIDs
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.ValueWrapper
|
import info.nightscout.database.impl.ValueWrapper
|
||||||
import info.nightscout.implementation.R
|
import info.nightscout.implementation.R
|
||||||
|
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||||
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.ProfileFunction
|
import info.nightscout.interfaces.profile.ProfileFunction
|
||||||
import info.nightscout.interfaces.utils.MidnightTime
|
import info.nightscout.interfaces.utils.MidnightTime
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue