From fd0bd85c6489e769beb5456b43ee8bf96e65b973 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 11 Nov 2022 21:42:50 +0100 Subject: [PATCH] move to interfaces --- .../nightscout/androidaps/MainActivity.kt | 2 +- .../nightscout/androidaps/di/AppModule.kt | 2 +- .../androidaps/di/DataClassesModule.kt | 3 -- .../aps/loop/CarbSuggestionReceiver.kt | 2 +- .../plugins/aps/loop/LoopFragment.kt | 2 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 4 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 6 +-- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 8 ++-- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 6 +-- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 10 ++--- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 6 +-- .../OpenAPSSMBDynamicISFPlugin.kt | 4 +- .../configBuilder/ConfigBuilderPlugin.kt | 2 +- .../plugins/configBuilder/PluginStore.kt | 2 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 2 +- .../general/overview/OverviewFragment.kt | 3 +- .../plugins/general/overview/OverviewMenus.kt | 2 +- .../PersistentNotificationPlugin.kt | 1 + .../wear/wearintegration/DataHandlerMobile.kt | 3 +- .../DataLayerListenerServiceMobile.kt | 2 +- .../IobCobCalculatorPlugin.kt | 3 ++ .../sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../sensitivity/SensitivityAAPSPlugin.kt | 2 +- .../sensitivity/SensitivityOref1Plugin.kt | 2 +- .../SensitivityWeightedAveragePlugin.kt | 2 +- .../androidaps/receivers/KeepAliveWorker.kt | 2 +- .../androidaps/workflow/InvokeLoopWorker.kt | 2 +- .../PrepareIobAutosensGraphDataWorker.kt | 2 +- .../workflow/PreparePredictionsWorker.kt | 2 +- .../PrepareTemporaryTargetDataWorker.kt | 2 +- .../androidaps/data/QuickWizardTest.kt | 2 +- .../AbstractSensitivityPluginTest.kt | 2 +- .../utils/wizard/BolusWizardTest.kt | 2 +- .../nightscout/automation/AutomationPlugin.kt | 2 +- .../automation/actions/ActionLoopDisable.kt | 2 +- .../automation/actions/ActionLoopEnable.kt | 2 +- .../automation/actions/ActionLoopResume.kt | 6 +-- .../automation/actions/ActionLoopSuspend.kt | 2 +- .../automation/AutomationEventTest.kt | 6 +-- .../automation/actions/ActionsTestBase.kt | 2 +- .../automation/triggers/TriggerCOBTest.kt | 2 +- .../extensions/ExtendedBolusExtension.kt | 2 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../nightscout/androidaps/interfaces/APS.kt | 14 ------- .../androidaps/interfaces/ActivePlugin.kt | 1 + .../DetermineBasalAdapterInterface.kt | 37 ------------------- .../androidaps/interfaces/IobCobCalculator.kt | 6 +-- .../androidaps/interfaces/Sensitivity.kt | 2 +- .../plugins/general/overview/OverviewData.kt | 2 +- .../plugins/iob/iobCobCalculator/CobInfo.kt | 30 --------------- .../iob/iobCobCalculator/GlucoseStatus.kt | 28 -------------- .../iobCobCalculator/GlucoseStatusProvider.kt | 5 ++- .../iob/iobCobCalculator/data/AutosensData.kt | 2 +- .../nightscout/core/iob/CobInfoExtension.kt | 27 ++++++++++++++ .../core/iob/GlucoseStatusExtension.kt | 19 ++++++++++ .../nightscout/core/wizard/BolusWizard.kt | 4 +- .../core/wizard/QuickWizardEntry.kt | 2 +- .../iob/iobCalculator/GlucoseStatusTest.kt | 5 ++- .../implementation/BolusTimerImplTest.kt | 2 +- .../implementation/CarbTimerImplTest.kt | 2 +- .../info/nightscout/interfaces/aps/APS.kt | 11 ++++++ .../interfaces/aps}/AutosensResult.kt | 2 +- .../nightscout/interfaces/aps}/BasalData.kt | 2 +- .../interfaces/aps/DetermineBasalAdapter.kt | 37 +++++++++++++++++++ .../info/nightscout/interfaces/aps}/Loop.kt | 3 +- .../info/nightscout/interfaces/iob/CobInfo.kt | 4 ++ .../interfaces/iob/GlucoseStatus.kt | 10 +++++ .../constraints/dstHelper/DstHelperPlugin.kt | 2 +- .../objectives/objectives/Objective0.kt | 2 +- .../general/actions/ActionsFragment.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 3 +- .../xdripStatusline/StatusLinePlugin.kt | 3 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../dstHelper/DstHelperPluginTest.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 4 +- .../info/nightscout/ui/dialogs/LoopDialog.kt | 2 +- .../java/info/nightscout/ui/widget/Widget.kt | 3 +- 77 files changed, 209 insertions(+), 200 deletions(-) delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt create mode 100644 core/core-main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt create mode 100644 core/core-main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt rename {core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator => interfaces/src/main/java/info/nightscout/interfaces/aps}/AutosensResult.kt (89%) rename {core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator => interfaces/src/main/java/info/nightscout/interfaces/aps}/BasalData.kt (62%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt rename {core/core-main/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/aps}/Loop.kt (93%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 0445e6085d..9019df2258 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -36,7 +36,6 @@ import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.databinding.ActivityMainBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.setupwizard.SetupWizardActivity @@ -52,6 +51,7 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.interfaces.plugin.PluginBase diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt index 81d6ffc0f8..513f29088c 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.interfaces.stats.TirCalculator @@ -48,6 +47,7 @@ import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.XDripBroadcast +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.autotune.Autotune import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.maintenance.ImportExportPrefs diff --git a/app/src/main/java/info/nightscout/androidaps/di/DataClassesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/DataClassesModule.kt index d9f182f33d..91a56552a7 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/DataClassesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/DataClassesModule.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.core.wizard.BolusWizard import info.nightscout.core.wizard.QuickWizardEntry @@ -10,8 +9,6 @@ import info.nightscout.core.wizard.QuickWizardEntry @Suppress("unused") abstract class DataClassesModule { - @ContributesAndroidInjector abstract fun glucoseStatusInjector(): GlucoseStatus - @ContributesAndroidInjector abstract fun bolusWizardInjector(): BolusWizard @ContributesAndroidInjector abstract fun quickWizardEntryInjector(): QuickWizardEntry } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt index f1b906476d..865cd09476 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.aps.loop import android.content.Context import android.content.Intent import dagger.android.DaggerBroadcastReceiver -import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.interfaces.aps.Loop import javax.inject.Inject class CarbSuggestionReceiver : DaggerBroadcastReceiver() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index 2f58cff830..23b53cc639 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -14,10 +14,10 @@ import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.LoopFragmentBinding -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt index 89dcbff952..f7ea7b89d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt @@ -22,8 +22,6 @@ import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Loop.LastRun import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui @@ -43,6 +41,8 @@ import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncement import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.aps.APSResult +import info.nightscout.interfaces.aps.Loop +import info.nightscout.interfaces.aps.Loop.LastRun import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.notifications.Notification diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index b42ea6e3d6..400fbe9dcd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -5,15 +5,15 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResultObject import info.nightscout.androidaps.plugins.aps.loop.ScriptReader -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.profile.Profile @@ -38,7 +38,7 @@ import java.nio.charset.StandardCharsets import javax.inject.Inject import kotlin.math.min -class DetermineBasalAdapterAMAJS internal constructor(scriptReader: ScriptReader, injector: HasAndroidInjector) : DetermineBasalAdapterInterface { +class DetermineBasalAdapterAMAJS internal constructor(scriptReader: ScriptReader, injector: HasAndroidInjector) : DetermineBasalAdapter { private val injector: HasAndroidInjector diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index f49229d1f3..70d85c95c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -5,21 +5,21 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.target -import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.Profiler import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.APS +import info.nightscout.interfaces.aps.AutosensResult +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.plugin.PluginBase @@ -73,7 +73,7 @@ class OpenAPSAMAPlugin @Inject constructor( // last values override var lastAPSRun: Long = 0 override var lastAPSResult: DetermineBasalResultAMA? = null - override var lastDetermineBasalAdapter: DetermineBasalAdapterInterface? = null + override var lastDetermineBasalAdapter: DetermineBasalAdapter? = null override var lastAutosensResult: AutosensResult = AutosensResult() override fun specialEnableCondition(): Boolean { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index a79966a8f0..2f9a433a48 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -6,15 +6,15 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResultObject import info.nightscout.androidaps.plugins.aps.loop.ScriptReader -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.profile.Profile @@ -40,7 +40,7 @@ import java.lang.reflect.InvocationTargetException import java.nio.charset.StandardCharsets import javax.inject.Inject -class DetermineBasalAdapterSMBJS internal constructor(private val scriptReader: ScriptReader, private val injector: HasAndroidInjector) : DetermineBasalAdapterInterface { +class DetermineBasalAdapterSMBJS internal constructor(private val scriptReader: ScriptReader, private val injector: HasAndroidInjector) : DetermineBasalAdapter { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var constraintChecker: Constraints diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index f883366489..60306141cc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -7,20 +7,20 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.target -import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.Profiler import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.APS +import info.nightscout.interfaces.aps.AutosensResult +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints @@ -74,7 +74,7 @@ class OpenAPSSMBPlugin @Inject constructor( // last values override var lastAPSRun: Long = 0 override var lastAPSResult: DetermineBasalResultSMB? = null - override var lastDetermineBasalAdapter: DetermineBasalAdapterInterface? = null + override var lastDetermineBasalAdapter: DetermineBasalAdapter? = null override var lastAutosensResult = AutosensResult() override fun specialEnableCondition(): Boolean { @@ -249,5 +249,5 @@ class OpenAPSSMBPlugin @Inject constructor( return maxIob } - fun provideDetermineBasalAdapter(): DetermineBasalAdapterInterface = DetermineBasalAdapterSMBJS(ScriptReader(context), injector) + fun provideDetermineBasalAdapter(): DetermineBasalAdapter = DetermineBasalAdapterSMBJS(ScriptReader(context), injector) } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 4ade7eba58..b092b755e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -6,18 +6,18 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.core.profile.toMgdl import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.profile.Profile @@ -46,7 +46,7 @@ import java.nio.charset.StandardCharsets import javax.inject.Inject import kotlin.math.ln -class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scriptReader: ScriptReader, private val injector: HasAndroidInjector) : DetermineBasalAdapterInterface { +class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scriptReader: ScriptReader, private val injector: HasAndroidInjector) : DetermineBasalAdapter { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var constraintChecker: Constraints diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index 2bd7a483e7..dcf52e25c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -5,7 +5,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin @@ -13,6 +12,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.utils.Profiler import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.aps.DetermineBasalAdapter import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.utils.HardLimits @@ -73,5 +73,5 @@ class OpenAPSSMBDynamicISFPlugin @Inject constructor( override fun specialEnableCondition(): Boolean = buildHelper.isEngineeringMode() && buildHelper.isDev() - override fun provideDetermineBasalAdapter(): DetermineBasalAdapterInterface = DetermineBasalAdapterSMBDynamicISFJS(ScriptReader(context), injector) + override fun provideDetermineBasalAdapter(): DetermineBasalAdapter = DetermineBasalAdapterSMBDynamicISFJS(ScriptReader(context), injector) } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index b99245e27f..fc80eccdac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.configBuilder import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.logging.UserEntryLogger @@ -13,6 +12,7 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.APS import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index 1261fc5833..39b25f594d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.configBuilder -import info.nightscout.androidaps.interfaces.APS 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.Overview +import info.nightscout.interfaces.aps.APS import info.nightscout.interfaces.constraints.Objectives import info.nightscout.interfaces.constraints.Safety import info.nightscout.interfaces.insulin.Insulin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt index e03d7a8803..5dc05bb3c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.extensions.durationInMinutes import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.Intents @@ -19,6 +18,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 340e759662..36f6314915 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -36,7 +36,6 @@ import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB @@ -56,6 +55,7 @@ import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.automation.AutomationPlugin import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.displayText import info.nightscout.core.profile.toSignedUnitsString import info.nightscout.core.profile.toTargetRangeString import info.nightscout.core.profile.toUnits @@ -68,6 +68,7 @@ import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.plugin.PluginBase diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index c19acdccab..3c8a1dd4f9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -12,10 +12,10 @@ import androidx.annotation.StringRes import androidx.appcompat.widget.PopupMenu import com.google.gson.Gson import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventScale diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index c78a4750cb..c2dcca20b2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -15,6 +15,7 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.profile.toSignedUnitsString import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt index b0ec7d2ca1..ddc3f2ef34 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -11,7 +11,6 @@ import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider @@ -21,6 +20,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.core.profile.toMgdl @@ -43,6 +43,7 @@ import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporar import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.plugin.PluginBase diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt index 06d80a31cf..086333c7f2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt @@ -18,7 +18,6 @@ import dagger.android.AndroidInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui import info.nightscout.androidaps.receivers.ReceiverStatusStore @@ -26,6 +25,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 273f63976e..7276f3c5dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -29,6 +29,9 @@ import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.AutosensResult +import info.nightscout.interfaces.aps.BasalData +import info.nightscout.interfaces.iob.CobInfo import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.plugin.PluginBase diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index fb7d67c40b..e25a30bded 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.utils.Round diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index 9f160acc5f..a08f314c90 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -6,11 +6,11 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 6e20c11654..3cb8bad31b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -6,11 +6,11 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index ee617496b4..9a9b030fa5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -7,11 +7,11 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt index 097edccaf3..c693134a3b 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -17,12 +17,12 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.queue.Command diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/InvokeLoopWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/InvokeLoopWorker.kt index afd05522ab..e8a63b86de 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/InvokeLoopWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/InvokeLoopWorker.kt @@ -7,8 +7,8 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.interfaces.aps.Loop import info.nightscout.rx.events.Event import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt index 149297040c..657479be73 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt @@ -18,7 +18,6 @@ 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.PointsWithLabelGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter @@ -26,6 +25,7 @@ import info.nightscout.core.iob.combine import info.nightscout.core.iob.copy import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.profile.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt index 6c39e246f1..6eb9c03f9c 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt @@ -5,7 +5,6 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.OverviewMenus import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface @@ -15,6 +14,7 @@ import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt index 910b863e63..efe07c6fd9 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt @@ -9,13 +9,13 @@ import com.jjoe64.graphview.series.LineGraphSeries import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.target -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.rx.bus.RxBus diff --git a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt index 1bd1a69a08..2bb2dc9f2f 100644 --- a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt @@ -4,9 +4,9 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.core.wizard.QuickWizard import info.nightscout.core.wizard.QuickWizardEntry +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt index d6ea838f24..0eb4f2b261 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt b/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt index ced9257f07..c8df250b78 100644 --- a/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt @@ -6,11 +6,11 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.wizard.BolusWizard import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.iob.IobTotal diff --git a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index 358eb1443a..d32354aace 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -7,7 +7,6 @@ import android.os.SystemClock import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionAlarm import info.nightscout.automation.actions.ActionCarePortalEvent @@ -43,6 +42,7 @@ import info.nightscout.automation.triggers.TriggerTimeRange import info.nightscout.automation.triggers.TriggerWifiSsid import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index 59d6bec54a..a15b2e1943 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -3,12 +3,12 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultObject -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index 6f5a1488af..c833556ce6 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -3,12 +3,12 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultObject -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index add84aeefa..cd76adcbb6 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -3,14 +3,14 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultObject -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt index ed1fa27fed..be967e3a86 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt @@ -4,7 +4,6 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultObject -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration @@ -13,6 +12,7 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus diff --git a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt index 529094192f..33d4f3786c 100644 --- a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt @@ -3,16 +3,16 @@ package info.nightscout.automation import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionLoopEnable import info.nightscout.automation.actions.ActionStopProcessing import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.automation.triggers.TriggerConnectorTest import info.nightscout.automation.triggers.TriggerDummy +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.Loop import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import org.junit.Assert import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 73b44e9a2c..4cbacae15e 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -6,12 +6,12 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.PumpEnactResultObject import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt index 5d362d3657..2eaed607c8 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.automation.elements.Comparator +import info.nightscout.interfaces.iob.CobInfo import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index eefc4c13e9..a0232d3494 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.profile.Profile diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index 125839b5af..4d3d041ea1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.profile.Profile diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt deleted file mode 100644 index 39edbb7884..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt +++ /dev/null @@ -1,14 +0,0 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.interfaces.aps.APSResult - -interface APS { - - val lastAPSResult: APSResult? - val lastAPSRun: Long - var lastDetermineBasalAdapter: DetermineBasalAdapterInterface? - var lastAutosensResult: AutosensResult - - operator fun invoke(initiator: String, tempBasalFallback: Boolean) -} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index cc64c94c9d..feea71f385 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.aps.APS import info.nightscout.interfaces.constraints.Objectives import info.nightscout.interfaces.constraints.Safety import info.nightscout.interfaces.insulin.Insulin diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt deleted file mode 100644 index 46ebf5e61f..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt +++ /dev/null @@ -1,37 +0,0 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.androidaps.plugins.aps.loop.APSResultObject -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.profile.Profile - -interface DetermineBasalAdapterInterface { - - var currentTempParam: String? - var iobDataParam: String? - var glucoseStatusParam: String? - var profileParam: String? - var mealDataParam: String? - var scriptDebug: String - - fun setData(profile: Profile, - maxIob: Double, - maxBasal: Double, - minBg: Double, - maxBg: Double, - targetBg: Double, - basalRate: Double, - iobArray: Array, - glucoseStatus: GlucoseStatus, - mealData: MealData, - autosensDataRatio: Double, - tempTargetSet: Boolean, - microBolusAllowed: Boolean = false, - uamAllowed: Boolean = false, - advancedFiltering: Boolean = false, - isSaveCgmSource: Boolean = false - ) - - operator fun invoke(): APSResultObject? -} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt index 558118c85b..41ddbf4b98 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.BasalData -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo +import info.nightscout.interfaces.aps.BasalData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.aps.AutosensResult +import info.nightscout.interfaces.iob.CobInfo import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.profile.Profile diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt index 4c25455309..4fb892d8ec 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.interfaces.ConfigExportImport +import info.nightscout.interfaces.aps.AutosensResult interface Sensitivity : ConfigExportImport { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index ca0398f969..1473d599bc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -20,7 +20,6 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Fixed 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.ScaledDataPoint -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.iob.round @@ -29,6 +28,7 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.iob.CobInfo import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt deleted file mode 100644 index 59151086ff..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt +++ /dev/null @@ -1,30 +0,0 @@ -package info.nightscout.androidaps.plugins.iob.iobCobCalculator - -import info.nightscout.core.main.R -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper - -/** All COB up to now, including carbs not yet processed by IobCob calculation. */ -class CobInfo(val timestamp: Long, val displayCob: Double?, val futureCarbs: Double) { - - fun generateCOBString(): String { - var cobStringResult = "--g" - if (displayCob != null) { - cobStringResult = DecimalFormatter.to0Decimal(displayCob) - if (futureCarbs > 0) - cobStringResult += "(${DecimalFormatter.to0Decimal(futureCarbs)})" - cobStringResult += "g" - } - return cobStringResult - } - - fun displayText(rh: ResourceHelper, dateUtil: DateUtil, isDev: Boolean): String? = - if (displayCob != null) { - var cobText = rh.gs(R.string.format_carbs, displayCob.toInt()) - if (futureCarbs > 0) cobText += "(" + DecimalFormatter.to0Decimal(futureCarbs) + ")" - // This is only temporary for debugging - if (isDev) cobText += "\n" + dateUtil.timeString(timestamp) - cobText - } else null -} diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt deleted file mode 100644 index f74aa69837..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt +++ /dev/null @@ -1,28 +0,0 @@ -package info.nightscout.androidaps.plugins.iob.iobCobCalculator - -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round - -data class GlucoseStatus( - val glucose: Double, - val noise: Double = 0.0, - val delta: Double = 0.0, - val shortAvgDelta: Double = 0.0, - val longAvgDelta: Double = 0.0, - val date: Long = 0L -) { - - fun log(): String = "Glucose: " + DecimalFormatter.to0Decimal(glucose) + " mg/dl " + - "Noise: " + DecimalFormatter.to0Decimal(noise) + " " + - "Delta: " + DecimalFormatter.to0Decimal(delta) + " mg/dl" + - "Short avg. delta: " + " " + DecimalFormatter.to2Decimal(shortAvgDelta) + " mg/dl " + - "Long avg. delta: " + DecimalFormatter.to2Decimal(longAvgDelta) + " mg/dl" -} - -fun GlucoseStatus.asRounded() = copy( - glucose = Round.roundTo(glucose, 0.1), - noise = Round.roundTo(noise, 0.01), - delta = Round.roundTo(delta, 0.01), - shortAvgDelta = Round.roundTo(shortAvgDelta, 0.01), - longAvgDelta = Round.roundTo(longAvgDelta, 0.01) -) \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt index 522481c899..7dab0d1b8d 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt @@ -2,9 +2,12 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import dagger.Reusable import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.shared.utils.DateUtil +import info.nightscout.core.iob.asRounded +import info.nightscout.core.iob.log +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import kotlin.math.roundToLong diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt index 4406dbf894..69132671bb 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt @@ -5,10 +5,10 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.core.main.R import info.nightscout.database.entities.Carbs import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.AutosensResult import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt b/core/core-main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt new file mode 100644 index 0000000000..ee56c4ba8f --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt @@ -0,0 +1,27 @@ +package info.nightscout.core.iob + +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.main.R +import info.nightscout.interfaces.iob.CobInfo +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil + +fun CobInfo.generateCOBString(): String { + var cobStringResult = "--g" + displayCob?.let { displayCob -> + cobStringResult = DecimalFormatter.to0Decimal(displayCob) + if (futureCarbs > 0) + cobStringResult += "(${DecimalFormatter.to0Decimal(futureCarbs)})" + cobStringResult += "g" + } + return cobStringResult +} + +fun CobInfo.displayText(rh: ResourceHelper, dateUtil: DateUtil, isDev: Boolean): String? = + displayCob?.let { displayCob -> + var cobText = rh.gs(R.string.format_carbs, displayCob.toInt()) + if (futureCarbs > 0) cobText += "(" + DecimalFormatter.to0Decimal(futureCarbs) + ")" + // This is only temporary for debugging + if (isDev) cobText += "\n" + dateUtil.timeString(timestamp) + cobText + } diff --git a/core/core-main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt b/core/core-main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt new file mode 100644 index 0000000000..ddf56a4e53 --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt @@ -0,0 +1,19 @@ +package info.nightscout.core.iob + +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.interfaces.iob.GlucoseStatus +import info.nightscout.interfaces.utils.Round + +fun GlucoseStatus.log(): String = "Glucose: " + DecimalFormatter.to0Decimal(glucose) + " mg/dl " + + "Noise: " + DecimalFormatter.to0Decimal(noise) + " " + + "Delta: " + DecimalFormatter.to0Decimal(delta) + " mg/dl" + + "Short avg. delta: " + " " + DecimalFormatter.to2Decimal(shortAvgDelta) + " mg/dl " + + "Long avg. delta: " + DecimalFormatter.to2Decimal(longAvgDelta) + " mg/dl" + +fun GlucoseStatus.asRounded() = copy( + glucose = Round.roundTo(glucose, 0.1), + noise = Round.roundTo(noise, 0.01), + delta = Round.roundTo(delta, 0.01), + shortAvgDelta = Round.roundTo(shortAvgDelta, 0.01), + longAvgDelta = Round.roundTo(longAvgDelta, 0.01) +) \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt b/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt index 90895b52e1..a3044c945e 100644 --- a/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt +++ b/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt @@ -9,9 +9,7 @@ import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.iob.round @@ -29,8 +27,10 @@ import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorR import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileFunction diff --git a/core/core-main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt b/core/core-main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt index 0944eb1daf..42e6d2e3fe 100644 --- a/core/core-main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt +++ b/core/core-main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt @@ -4,7 +4,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.iob.round import info.nightscout.core.main.R @@ -12,6 +11,7 @@ import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileFunction diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt index c024b526a4..2b89299f4f 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt @@ -3,10 +3,11 @@ package info.nightscout.androidaps.plugins.iob.iobCalculator import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.asRounded +import info.nightscout.core.iob.asRounded +import info.nightscout.core.iob.log import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.iob.GlucoseStatus import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.junit.Assert diff --git a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt index 48c1a56bf8..eaf00a8974 100644 --- a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt @@ -5,13 +5,13 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.rx.bus.RxBus diff --git a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt index 4bdd5355de..dc63f2468b 100644 --- a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt @@ -5,13 +5,13 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.utils.TimerUtil diff --git a/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt new file mode 100644 index 0000000000..3f829ccfb1 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt @@ -0,0 +1,11 @@ +package info.nightscout.interfaces.aps + +interface APS { + + val lastAPSResult: APSResult? + val lastAPSRun: Long + var lastDetermineBasalAdapter: DetermineBasalAdapter? + var lastAutosensResult: AutosensResult + + operator fun invoke(initiator: String, tempBasalFallback: Boolean) +} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt similarity index 89% rename from core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt rename to interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt index f447651e29..3460b3e78e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.iob.iobCobCalculator +package info.nightscout.interfaces.aps import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt similarity index 62% rename from core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt rename to interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt index ffeb031b95..7aa8cb0ffb 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.iob.iobCobCalculator +package info.nightscout.interfaces.aps class BasalData { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt new file mode 100644 index 0000000000..44128b5c14 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt @@ -0,0 +1,37 @@ +package info.nightscout.interfaces.aps + +import info.nightscout.interfaces.iob.GlucoseStatus +import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile + +interface DetermineBasalAdapter { + + var currentTempParam: String? + var iobDataParam: String? + var glucoseStatusParam: String? + var profileParam: String? + var mealDataParam: String? + var scriptDebug: String + + fun setData( + profile: Profile, + maxIob: Double, + maxBasal: Double, + minBg: Double, + maxBg: Double, + targetBg: Double, + basalRate: Double, + iobArray: Array, + glucoseStatus: GlucoseStatus, + mealData: MealData, + autosensDataRatio: Double, + tempTargetSet: Boolean, + microBolusAllowed: Boolean = false, + uamAllowed: Boolean = false, + advancedFiltering: Boolean = false, + isSaveCgmSource: Boolean = false + ) + + operator fun invoke(): APSResult? +} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt similarity index 93% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt rename to interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt index 3542e7fdcd..25e4339f3c 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces.aps import info.nightscout.database.entities.OfflineEvent -import info.nightscout.interfaces.aps.APSResult import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.PumpEnactResult diff --git a/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt new file mode 100644 index 0000000000..35c70f8d5f --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt @@ -0,0 +1,4 @@ +package info.nightscout.interfaces.iob + +/** All COB up to now, including carbs not yet processed by IobCob calculation. */ +class CobInfo(val timestamp: Long, val displayCob: Double?, val futureCarbs: Double) \ No newline at end of file diff --git a/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt new file mode 100644 index 0000000000..c79917d29f --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt @@ -0,0 +1,10 @@ +package info.nightscout.interfaces.iob + +data class GlucoseStatus( + val glucose: Double, + val noise: Double = 0.0, + val delta: Double = 0.0, + val shortAvgDelta: Double = 0.0, + val longAvgDelta: Double = 0.0, + val date: Long = 0L +) \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt index ed064951be..e3ca6e91ba 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.constraints.dstHelper import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.notifications.Notification diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt index 3c0c31a567..d45f07fff4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt @@ -3,9 +3,9 @@ package info.nightscout.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.R import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin diff --git a/plugins/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt index c877607eee..c81ba15896 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt @@ -14,7 +14,6 @@ import info.nightscout.androidaps.extensions.toStringMedium import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck @@ -27,6 +26,7 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.queue.Callback diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 22cc80fcf6..530e50cd27 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -15,7 +15,6 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider @@ -23,6 +22,7 @@ import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.profile.toCurrentUnits import info.nightscout.core.profile.toMgdl @@ -41,6 +41,7 @@ import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.XDripBroadcast +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.notifications.Notification diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index 05d467a85b..093846aa5a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -6,11 +6,12 @@ import android.os.Bundle import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index 07eaf69835..b3f0174833 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -2,10 +2,10 @@ package info.nightscout.plugins.sync.nsclient.extensions import android.os.Build import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.core.iob.json import info.nightscout.database.entities.DeviceStatus +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.pump.Pump import info.nightscout.plugins.configBuilder.RunningConfiguration diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt index 81bbc12a62..7f33043ca5 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.interfaces.aps.Loop import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert diff --git a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index 5b95e1a6c1..c8a8b45400 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -7,10 +7,8 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.PumpEnactResultObject import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository @@ -21,8 +19,10 @@ import info.nightscout.database.impl.transactions.Transaction import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.XDripBroadcast +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.iob.CobInfo import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.ProfileSource diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt index 20dbf1bf44..4ed7e4ac16 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt @@ -12,7 +12,6 @@ import android.view.WindowManager import androidx.fragment.app.FragmentManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog @@ -25,6 +24,7 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.constraints.Objectives diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index 0de0c24c7a..ba720bd3ab 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -18,9 +18,9 @@ import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.core.iob.displayText import info.nightscout.core.profile.toSignedUnitsString import info.nightscout.core.profile.toTargetRangeString import info.nightscout.core.profile.toUnits @@ -28,6 +28,7 @@ import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.aps.VariableSensitivityResult import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.profile.Profile