rename interfaces, cleanup

This commit is contained in:
Milos Kozak 2021-04-14 00:45:30 +02:00
parent 3aa38d46bb
commit c04993ddad
190 changed files with 528 additions and 752 deletions

View file

@ -39,7 +39,7 @@ import info.nightscout.androidaps.events.EventAppExit
import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.events.EventRebuildTabs
import info.nightscout.androidaps.historyBrowser.HistoryBrowseActivity
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IconsProvider
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.logging.AAPSLogger
@ -83,7 +83,7 @@ class MainActivity : NoSplashAppCompatActivity() {
@Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var nsSettingsStatus: NSSettingsStatus
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var protectionCheck: ProtectionCheck
@Inject lateinit var iconsProvider: IconsProvider

View file

@ -13,7 +13,7 @@ import info.nightscout.androidaps.data.defaultProfile.DefaultProfileDPV
import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding
import info.nightscout.androidaps.db.ProfileSwitch
import info.nightscout.androidaps.dialogs.ProfileViewerDialog
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -39,7 +39,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
@Inject lateinit var localProfilePlugin: LocalProfilePlugin
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var databaseHelper: DatabaseHelperInterface
enum class ProfileType {

View file

@ -8,7 +8,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.defaultProfile.DefaultProfile
import info.nightscout.androidaps.databinding.ActivitySurveyBinding
import info.nightscout.androidaps.dialogs.ProfileViewerDialog
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -24,7 +24,7 @@ import javax.inject.Inject
class SurveyActivity : NoSplashAppCompatActivity() {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var tddCalculator: TddCalculator
@Inject lateinit var tirCalculator: TirCalculator
@Inject lateinit var profileFunction: ProfileFunction

View file

@ -37,7 +37,7 @@ import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.events.EventReloadProfileSwitchData;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.ActivePlugin;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.ProfileStore;
@ -63,7 +63,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
@Inject RxBusWrapper rxBus;
@Inject VirtualPumpPlugin virtualPumpPlugin;
@Inject OpenHumansUploader openHumansUploader;
@Inject ActivePluginProvider activePlugin;
@Inject ActivePlugin activePlugin;
@Inject NSUpload nsUpload;
@Inject DateUtil dateUtil;

View file

@ -75,7 +75,7 @@ open class AppModule {
interface AppBindings {
@Binds fun bindContext(mainApp: MainApp): Context
@Binds fun bindInjector(mainApp: MainApp): HasAndroidInjector
@Binds fun bindActivePluginProvider(pluginStore: PluginStore): ActivePluginProvider
@Binds fun bindActivePluginProvider(pluginStore: PluginStore): ActivePlugin
@Binds fun bindCommandQueueProvider(commandQueue: CommandQueue): CommandQueueProvider
@Binds fun bindConfigInterface(config: Config): ConfigInterface
@Binds fun bindConfigBuilderInterface(configBuilderPlugin: ConfigBuilderPlugin): ConfigBuilder

View file

@ -12,7 +12,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.logging.UserEntryLogger
@ -34,7 +34,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var uel: UserEntryLogger
private var _binding: DialogExtendedbolusBinding? = null

View file

@ -16,7 +16,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction
import info.nightscout.androidaps.databinding.DialogFillBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.logging.LTag
@ -41,7 +41,7 @@ class FillDialog : DialogFragmentWithDate() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var ctx: Context
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var repository: AppRepository

View file

@ -21,7 +21,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction
import info.nightscout.androidaps.databinding.DialogInsulinBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -51,7 +51,7 @@ class InsulinDialog : DialogFragmentWithDate() {
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var ctx: Context
@Inject lateinit var repository: AppRepository
@Inject lateinit var config: Config

View file

@ -43,7 +43,7 @@ class LoopDialog : DaggerDialogFragment() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var configBuilder: ConfigBuilder

View file

@ -12,7 +12,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.databinding.DialogProfileswitchBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
@ -28,7 +28,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var treatmentsPlugin: TreatmentsPlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var uel: UserEntryLogger
private var profileIndex: Int? = null

View file

@ -31,7 +31,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var ctx: Context
@Inject lateinit var uel: UserEntryLogger

View file

@ -17,7 +17,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.databinding.DialogTreatmentBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.logging.LTag
@ -42,7 +42,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var ctx: Context
@Inject lateinit var config: Config

View file

@ -23,7 +23,7 @@ import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.ValueWrapper
import info.nightscout.androidaps.databinding.DialogWizardBinding
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -60,7 +60,7 @@ class WizardDialog : DaggerDialogFragment() {
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var repository: AppRepository
@Inject lateinit var dateUtil: DateUtil

View file

@ -16,7 +16,7 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
import info.nightscout.androidaps.events.EventCustomCalculationFinished
import info.nightscout.androidaps.events.EventRefreshOverview
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -51,7 +51,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var iobCobCalculatorPluginHistory: IobCobCalculatorPluginHistory
@Inject lateinit var treatmentsPluginHistory: TreatmentsPluginHistory
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var overviewMenus: OverviewMenus

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.historyBrowser
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -27,7 +27,7 @@ class IobCobCalculatorPluginHistory @Inject constructor(
sp: SP,
resourceHelper: ResourceHelper,
profileFunction: ProfileFunction,
activePlugin: ActivePluginProvider,
activePlugin: ActivePlugin,
sensitivityOref1Plugin: SensitivityOref1Plugin,
sensitivityAAPSPlugin: SensitivityAAPSPlugin,
sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin,

View file

@ -3,7 +3,7 @@ package info.nightscout.androidaps.historyBrowser
import android.content.Context
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -29,7 +29,7 @@ class TreatmentsPluginHistory @Inject constructor(
context: Context,
sp: SP,
profileFunction: ProfileFunction,
activePlugin: ActivePluginProvider,
activePlugin: ActivePlugin,
nsUpload: NSUpload,
fabricPrivacy: FabricPrivacy,
dateUtil: DateUtil,

View file

@ -76,7 +76,7 @@ open class LoopPlugin @Inject constructor(
private val profileFunction: ProfileFunction,
private val context: Context,
private val commandQueue: CommandQueueProvider,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val virtualPumpPlugin: VirtualPumpPlugin,
private val iobCobCalculator: IobCobCalculator,
private val receiverStatusStore: ReceiverStatusStore,

View file

@ -36,7 +36,7 @@ open class OpenAPSAMAPlugin @Inject constructor(
resourceHelper: ResourceHelper,
private val profileFunction: ProfileFunction,
private val context: Context,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val iobCobCalculator: IobCobCalculator,
private val hardLimits: HardLimits,
private val profiler: Profiler,
@ -53,7 +53,7 @@ open class OpenAPSAMAPlugin @Inject constructor(
.preferencesId(R.xml.pref_openapsama)
.description(R.string.description_ama),
aapsLogger, resourceHelper, injector
), APSInterface {
), APS {
// last values
override var lastAPSRun: Long = 0

View file

@ -6,7 +6,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.IobTotal
import info.nightscout.androidaps.data.MealData
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -16,7 +16,6 @@ import info.nightscout.androidaps.plugins.aps.loop.ScriptReader
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansUploader
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.androidaps.utils.SafeParse
import info.nightscout.androidaps.extensions.convertedToAbsolute
import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes
@ -41,7 +40,7 @@ class DetermineBasalAdapterSMBJS internal constructor(private val scriptReader:
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var activePluginProvider: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var openHumansUploader: OpenHumansUploader
private var profile = JSONObject()
@ -176,7 +175,7 @@ class DetermineBasalAdapterSMBJS internal constructor(private val scriptReader:
advancedFiltering: Boolean,
isSaveCgmSource: Boolean
) {
val pump = activePluginProvider.activePump
val pump = activePlugin.activePump
val pumpBolusStep = pump.pumpDescription.bolusStep
this.profile.put("max_iob", maxIob)
//mProfile.put("dia", profile.getDia());

View file

@ -37,7 +37,7 @@ open class OpenAPSSMBPlugin @Inject constructor(
resourceHelper: ResourceHelper,
private val profileFunction: ProfileFunction,
private val context: Context,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val iobCobCalculator: IobCobCalculator,
private val hardLimits: HardLimits,
private val profiler: Profiler,
@ -55,7 +55,7 @@ open class OpenAPSSMBPlugin @Inject constructor(
.description(R.string.description_smb)
.setDefault(),
aapsLogger, resourceHelper, injector
), APSInterface, ConstraintsInterface {
), APS, ConstraintsInterface {
// last values
override var lastAPSRun: Long = 0

View file

@ -34,7 +34,7 @@ class ConfigBuilderFragment : DaggerFragment() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var configBuilderPlugin: ConfigBuilderPlugin
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var protectionCheck: ProtectionCheck
@Inject lateinit var config: Config
@ -101,18 +101,18 @@ class ConfigBuilderFragment : DaggerFragment() {
private fun updateGUI() {
binding.categories.removeAllViews()
if (!config.NSCLIENT) {
createViewsForPlugins(R.string.configbuilder_profile, R.string.configbuilder_profile_description, PluginType.PROFILE, activePlugin.getSpecificPluginsVisibleInListByInterface(ProfileInterface::class.java, PluginType.PROFILE))
createViewsForPlugins(R.string.configbuilder_profile, R.string.configbuilder_profile_description, PluginType.PROFILE, activePlugin.getSpecificPluginsVisibleInList(PluginType.PROFILE))
}
createViewsForPlugins(R.string.configbuilder_insulin, R.string.configbuilder_insulin_description, PluginType.INSULIN, activePlugin.getSpecificPluginsVisibleInListByInterface(InsulinInterface::class.java, PluginType.INSULIN))
createViewsForPlugins(R.string.configbuilder_insulin, R.string.configbuilder_insulin_description, PluginType.INSULIN, activePlugin.getSpecificPluginsVisibleInList(PluginType.INSULIN))
if (!config.NSCLIENT) {
createViewsForPlugins(R.string.configbuilder_bgsource, R.string.configbuilder_bgsource_description, PluginType.BGSOURCE, activePlugin.getSpecificPluginsVisibleInListByInterface(BgSourceInterface::class.java, PluginType.BGSOURCE))
createViewsForPlugins(R.string.configbuilder_bgsource, R.string.configbuilder_bgsource_description, PluginType.BGSOURCE, activePlugin.getSpecificPluginsVisibleInList(PluginType.BGSOURCE))
createViewsForPlugins(R.string.configbuilder_pump, R.string.configbuilder_pump_description, PluginType.PUMP, activePlugin.getSpecificPluginsVisibleInList(PluginType.PUMP))
}
createViewsForPlugins(R.string.configbuilder_sensitivity, R.string.configbuilder_sensitivity_description, PluginType.SENSITIVITY, activePlugin.getSpecificPluginsVisibleInListByInterface(SensitivityInterface::class.java, PluginType.SENSITIVITY))
createViewsForPlugins(R.string.configbuilder_sensitivity, R.string.configbuilder_sensitivity_description, PluginType.SENSITIVITY, activePlugin.getSpecificPluginsVisibleInList(PluginType.SENSITIVITY))
if (config.APS) {
createViewsForPlugins(R.string.configbuilder_aps, R.string.configbuilder_aps_description, PluginType.APS, activePlugin.getSpecificPluginsVisibleInList(PluginType.APS))
createViewsForPlugins(R.string.configbuilder_loop, R.string.configbuilder_loop_description, PluginType.LOOP, activePlugin.getSpecificPluginsVisibleInList(PluginType.LOOP))
createViewsForPlugins(R.string.constraints, R.string.configbuilder_constraints_description, PluginType.CONSTRAINTS, activePlugin.getSpecificPluginsVisibleInListByInterface(ConstraintsInterface::class.java, PluginType.CONSTRAINTS))
createViewsForPlugins(R.string.constraints, R.string.configbuilder_constraints_description, PluginType.CONSTRAINTS, activePlugin.getSpecificPluginsVisibleInList(PluginType.CONSTRAINTS))
}
createViewsForPlugins(R.string.configbuilder_treatments, R.string.configbuilder_treatments_description, PluginType.TREATMENT, activePlugin.getSpecificPluginsVisibleInList(PluginType.TREATMENT))
createViewsForPlugins(R.string.configbuilder_general, R.string.configbuilder_general_description, PluginType.GENERAL, activePlugin.getSpecificPluginsVisibleInList(PluginType.GENERAL))

View file

@ -29,7 +29,7 @@ class ConfigBuilderPlugin @Inject constructor(
resourceHelper: ResourceHelper,
private val sp: SP,
private val rxBus: RxBusWrapper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val uel: UserEntryLogger,
private val pumpSync: PumpSync
) : PluginBase(PluginDescription()
@ -180,11 +180,11 @@ class ConfigBuilderPlugin @Inject constructor(
fun processOnEnabledCategoryChanged(changedPlugin: PluginBase, type: PluginType?) {
var pluginsInCategory: ArrayList<PluginBase>? = null
when (type) {
PluginType.INSULIN -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(InsulinInterface::class.java)
PluginType.SENSITIVITY -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(SensitivityInterface::class.java)
PluginType.APS -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(APSInterface::class.java)
PluginType.INSULIN -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(Insulin::class.java)
PluginType.SENSITIVITY -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(Sensitivity::class.java)
PluginType.APS -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(APS::class.java)
PluginType.PROFILE -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(ProfileInterface::class.java)
PluginType.BGSOURCE -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(BgSourceInterface::class.java)
PluginType.BGSOURCE -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(BgSource::class.java)
PluginType.TREATMENT -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(TreatmentsInterface::class.java)
PluginType.PUMP -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(PumpInterface::class.java)

View file

@ -11,23 +11,23 @@ import javax.inject.Singleton
class PluginStore @Inject constructor(
private val aapsLogger: AAPSLogger,
private val config: Config
) : ActivePluginProvider {
) : ActivePlugin {
lateinit var plugins: List<@JvmSuppressWildcards PluginBase>
private var activeBgSourceStore: BgSourceInterface? = null
private var activeBgSourceStore: BgSource? = null
private var activePumpStore: PumpInterface? = null
private var activeProfile: ProfileInterface? = null
private var activeAPSStore: APSInterface? = null
private var activeInsulinStore: InsulinInterface? = null
private var activeSensitivityStore: SensitivityInterface? = null
private var activeAPSStore: APS? = null
private var activeInsulinStore: Insulin? = null
private var activeSensitivityStore: Sensitivity? = null
private var activeTreatmentsStore: TreatmentsInterface? = null
fun loadDefaults() {
verifySelectionInCategories()
}
fun getDefaultPlugin(type: PluginType): PluginBase {
private fun getDefaultPlugin(type: PluginType): PluginBase {
for (p in plugins)
if (p.getType() == type && p.isDefault()) return p
throw IllegalStateException("Default plugin not found")
@ -41,14 +41,6 @@ class PluginStore @Inject constructor(
return newList
}
override fun getSpecificPluginsVisibleInList(type: PluginType): ArrayList<PluginBase> {
val newList = ArrayList<PluginBase>()
for (p in plugins) {
if (p.getType() == type) if (p.showInList(type)) newList.add(p)
}
return newList
}
override fun getSpecificPluginsListByInterface(interfaceClass: Class<*>): ArrayList<PluginBase> {
val newList = ArrayList<PluginBase>()
for (p in plugins) {
@ -57,10 +49,10 @@ class PluginStore @Inject constructor(
return newList
}
override fun getSpecificPluginsVisibleInListByInterface(interfaceClass: Class<*>, type: PluginType): ArrayList<PluginBase> {
override fun getSpecificPluginsVisibleInList(type: PluginType): ArrayList<PluginBase> {
val newList = ArrayList<PluginBase>()
for (p in plugins) {
if (p.javaClass != ConfigBuilderPlugin::class.java && interfaceClass.isAssignableFrom(p.javaClass)) if (p.showInList(type)) newList.add(p)
if (p.getType() == type) if (p.showInList(type)) newList.add(p)
}
return newList
}
@ -71,34 +63,34 @@ class PluginStore @Inject constructor(
// PluginType.APS
if (!config.NSCLIENT && !config.PUMPCONTROL) {
pluginsInCategory = getSpecificPluginsList(PluginType.APS)
activeAPSStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APSInterface?
activeAPSStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APS?
if (activeAPSStore == null) {
activeAPSStore = getDefaultPlugin(PluginType.APS) as APSInterface
activeAPSStore = getDefaultPlugin(PluginType.APS) as APS
(activeAPSStore as PluginBase).setPluginEnabled(PluginType.APS, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting APSInterface")
}
setFragmentVisiblities((activeAPSStore as PluginBase).name, pluginsInCategory, PluginType.APS)
setFragmentVisibilities((activeAPSStore as PluginBase).name, pluginsInCategory, PluginType.APS)
}
// PluginType.INSULIN
pluginsInCategory = getSpecificPluginsList(PluginType.INSULIN)
activeInsulinStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.INSULIN) as InsulinInterface?
activeInsulinStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.INSULIN) as Insulin?
if (activeInsulinStore == null) {
activeInsulinStore = getDefaultPlugin(PluginType.INSULIN) as InsulinInterface
activeInsulinStore = getDefaultPlugin(PluginType.INSULIN) as Insulin
(activeInsulinStore as PluginBase).setPluginEnabled(PluginType.INSULIN, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting InsulinInterface")
}
setFragmentVisiblities((activeInsulinStore as PluginBase).name, pluginsInCategory, PluginType.INSULIN)
setFragmentVisibilities((activeInsulinStore as PluginBase).name, pluginsInCategory, PluginType.INSULIN)
// PluginType.SENSITIVITY
pluginsInCategory = getSpecificPluginsList(PluginType.SENSITIVITY)
activeSensitivityStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.SENSITIVITY) as SensitivityInterface?
activeSensitivityStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.SENSITIVITY) as Sensitivity?
if (activeSensitivityStore == null) {
activeSensitivityStore = getDefaultPlugin(PluginType.SENSITIVITY) as SensitivityInterface
activeSensitivityStore = getDefaultPlugin(PluginType.SENSITIVITY) as Sensitivity
(activeSensitivityStore as PluginBase).setPluginEnabled(PluginType.SENSITIVITY, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting SensitivityInterface")
}
setFragmentVisiblities((activeSensitivityStore as PluginBase).name, pluginsInCategory, PluginType.SENSITIVITY)
setFragmentVisibilities((activeSensitivityStore as PluginBase).name, pluginsInCategory, PluginType.SENSITIVITY)
// PluginType.PROFILE
pluginsInCategory = getSpecificPluginsList(PluginType.PROFILE)
@ -108,17 +100,17 @@ class PluginStore @Inject constructor(
(activeProfile as PluginBase).setPluginEnabled(PluginType.PROFILE, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting ProfileInterface")
}
setFragmentVisiblities((activeProfile as PluginBase).name, pluginsInCategory, PluginType.PROFILE)
setFragmentVisibilities((activeProfile as PluginBase).name, pluginsInCategory, PluginType.PROFILE)
// PluginType.BGSOURCE
pluginsInCategory = getSpecificPluginsList(PluginType.BGSOURCE)
activeBgSourceStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.BGSOURCE) as BgSourceInterface?
activeBgSourceStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.BGSOURCE) as BgSource?
if (activeBgSourceStore == null) {
activeBgSourceStore = getDefaultPlugin(PluginType.BGSOURCE) as BgSourceInterface
activeBgSourceStore = getDefaultPlugin(PluginType.BGSOURCE) as BgSource
(activeBgSourceStore as PluginBase).setPluginEnabled(PluginType.BGSOURCE, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting BgInterface")
}
setFragmentVisiblities((activeBgSourceStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
setFragmentVisibilities((activeBgSourceStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
// PluginType.PUMP
pluginsInCategory = getSpecificPluginsList(PluginType.PUMP)
@ -128,7 +120,7 @@ class PluginStore @Inject constructor(
(activePumpStore as PluginBase).setPluginEnabled(PluginType.PUMP, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting PumpInterface")
}
setFragmentVisiblities((activePumpStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
setFragmentVisibilities((activePumpStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
// PluginType.TREATMENT
pluginsInCategory = getSpecificPluginsList(PluginType.TREATMENT)
@ -138,49 +130,10 @@ class PluginStore @Inject constructor(
(activeTreatmentsStore as PluginBase).setPluginEnabled(PluginType.TREATMENT, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting PumpInterface")
}
setFragmentVisiblities((activeTreatmentsStore as PluginBase).name, pluginsInCategory, PluginType.TREATMENT)
setFragmentVisibilities((activeTreatmentsStore as PluginBase).name, pluginsInCategory, PluginType.TREATMENT)
}
/**
* disables the visibility for all fragments of Plugins with the given PluginType
* which are not equally named to the Plugin implementing the given Plugin Interface.
*
* @param pluginInterface
* @param pluginType
* @param <T>
* @return
</T> */
private fun <T> determineActivePlugin(pluginInterface: Class<T>, pluginType: PluginType): T? {
val pluginsInCategory: ArrayList<PluginBase> = getSpecificPluginsListByInterface(pluginInterface)
return determineActivePlugin(pluginsInCategory, pluginType)
}
/**
* disables the visibility for all fragments of Plugins in the given pluginsInCategory
* with the given PluginType which are not equally named to the Plugin implementing the
* given Plugin Interface.
*
*
* TODO we are casting an interface to PluginBase, which seems to be rather odd, since
* TODO the interface is not implementing PluginBase (this is just avoiding errors through
* TODO conventions.
*
* @param pluginsInCategory
* @param pluginType
* @param <T>
* @return
</T> */
private fun <T> determineActivePlugin(pluginsInCategory: ArrayList<PluginBase>,
pluginType: PluginType): T? {
@Suppress("UNCHECKED_CAST")
val activePlugin = getTheOneEnabledInArray(pluginsInCategory, pluginType) as T?
if (activePlugin != null) {
setFragmentVisiblities((activePlugin as PluginBase).name, pluginsInCategory, pluginType)
}
return activePlugin
}
private fun setFragmentVisiblities(activePluginName: String, pluginsInCategory: ArrayList<PluginBase>,
private fun setFragmentVisibilities(activePluginName: String, pluginsInCategory: ArrayList<PluginBase>,
pluginType: PluginType) {
aapsLogger.debug(LTag.CONFIGBUILDER, "Selected interface: $activePluginName")
for (p in pluginsInCategory)
@ -203,22 +156,22 @@ class PluginStore @Inject constructor(
// ***** Interface *****
override val activeBgSource: BgSourceInterface
override val activeBgSource: BgSource
get() = activeBgSourceStore ?: checkNotNull(activeBgSourceStore) { "No bg source selected" }
override val activeProfileInterface: ProfileInterface
get() = activeProfile ?: checkNotNull(activeProfile) { "No profile selected" }
override val activeInsulin: InsulinInterface
override val activeInsulin: Insulin
get() = activeInsulinStore ?: checkNotNull(activeInsulinStore) { "No insulin selected" }
override val activeAPS: APSInterface
override val activeAPS: APS
get() = activeAPSStore ?: checkNotNull(activeAPSStore) { "No APS selected" }
override val activePump: PumpInterface
get() = activePumpStore ?: checkNotNull(activePumpStore) { "No pump selected" }
override val activeSensitivity: SensitivityInterface
override val activeSensitivity: Sensitivity
get() = activeSensitivityStore
?: checkNotNull(activeSensitivityStore) { "No sensitivity selected" }
@ -226,8 +179,8 @@ class PluginStore @Inject constructor(
get() = activeTreatmentsStore
?: checkNotNull(activeTreatmentsStore) { "No treatments selected" }
override val activeOverview: OverviewInterface
get() = getSpecificPluginsListByInterface(OverviewInterface::class.java).first() as OverviewInterface
override val activeOverview: Overview
get() = getSpecificPluginsListByInterface(Overview::class.java).first() as Overview
override fun getPluginsList(): ArrayList<PluginBase> = ArrayList(plugins)

View file

@ -24,7 +24,7 @@ class DstHelperPlugin @Inject constructor(
private var rxBus: RxBusWrapper,
resourceHelper: ResourceHelper,
private var sp: SP,
private var activePlugin: ActivePluginProvider,
private var activePlugin: ActivePlugin,
private var loopPlugin: LoopPlugin
) : PluginBase(PluginDescription()
.mainType(PluginType.CONSTRAINTS)

View file

@ -26,7 +26,7 @@ class ObjectivesPlugin @Inject constructor(
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
resourceHelper: ResourceHelper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val sp: SP,
config: Config,
private val dateUtil: DateUtil,

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginType
@ -14,7 +14,7 @@ import javax.inject.Inject
class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R.string.objectives_0_objective, R.string.objectives_0_gate) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin
@Inject lateinit var treatmentsPlugin: TreatmentsPlugin
@Inject lateinit var loopPlugin: LoopPlugin

View file

@ -35,7 +35,7 @@ class SafetyPlugin @Inject constructor(
private val openAPSAMAPlugin: OpenAPSAMAPlugin,
private val openAPSSMBPlugin: OpenAPSSMBPlugin,
private val sensitivityOref1Plugin: SensitivityOref1Plugin,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val hardLimits: HardLimits,
private val buildHelper: BuildHelper,
private val iobCobCalculator: IobCobCalculator,

View file

@ -26,7 +26,7 @@ import info.nightscout.androidaps.extensions.toStringMedium
import info.nightscout.androidaps.extensions.toStringShort
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.historyBrowser.HistoryBrowseActivity
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -65,7 +65,7 @@ class ActionsFragment : DaggerFragment() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var statusLightHandler: StatusLightHandler
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var buildHelper: BuildHelper

View file

@ -45,7 +45,7 @@ class DataBroadcastPlugin @Inject constructor(
private val defaultValueHelper: DefaultValueHelper,
private val nsDeviceStatus: NSDeviceStatus,
private val loopPlugin: LoopPlugin,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private var receiverStatusStore: ReceiverStatusStore,
private val config: Config,
private val glucoseStatusProvider: GlucoseStatusProvider

View file

@ -4,7 +4,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.DeviceStatus
import info.nightscout.androidaps.database.entities.*
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DataSyncSelector
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -20,7 +20,7 @@ class DataSyncSelectorImplementation @Inject constructor(
private val dateUtil: DateUtil,
private val profileFunction: ProfileFunction,
private val nsClientPlugin: NSClientPlugin,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val appRepository: AppRepository
) : DataSyncSelector {
@ -244,7 +244,7 @@ class DataSyncSelectorImplementation @Inject constructor(
val startId = sp.getLong(R.string.key_ns_glucose_value_last_synced_id, 0)
appRepository.getNextSyncElementGlucoseValue(startId).blockingGet()?.let { gv ->
aapsLogger.info(LTag.DATABASE, "Loading GlucoseValue data Start: $startId ID: ${gv.first.id} HistoryID: ${gv.second} ")
if (activePlugin.activeBgSource.uploadToNs(gv.first)) {
if (activePlugin.activeBgSource.shouldUploadToNs(gv.first)) {
when {
// removed and not uploaded yet = ignore
!gv.first.isValid && gv.first.interfaceIDs.nightscoutId == null -> Any()

View file

@ -95,7 +95,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
@Inject lateinit var statusLightHandler: StatusLightHandler
@Inject lateinit var nsDeviceStatus: NSDeviceStatus
@Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var treatmentsPlugin: TreatmentsPlugin
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var dexcomPlugin: DexcomPlugin

View file

@ -7,7 +7,7 @@ import info.nightscout.androidaps.Config
import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventRefreshOverview
import info.nightscout.androidaps.extensions.*
import info.nightscout.androidaps.interfaces.OverviewInterface
import info.nightscout.androidaps.interfaces.Overview
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -17,7 +17,6 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNo
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.extensions.*
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.sharedPreferences.SP
@ -49,7 +48,7 @@ class OverviewPlugin @Inject constructor(
.preferencesId(R.xml.pref_overview)
.description(R.string.description_overview),
aapsLogger, resourceHelper, injector
), OverviewInterface {
), Overview {
private var disposable: CompositeDisposable = CompositeDisposable()

View file

@ -8,7 +8,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.ValueWrapper
import info.nightscout.androidaps.database.entities.TherapyEvent
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants
@ -26,7 +26,7 @@ class StatusLightHandler @Inject constructor(
private val resourceHelper: ResourceHelper,
private val sp: SP,
private val dateUtil: DateUtil,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val warnColors: WarnColors,
private val config: Config,
private val repository: AppRepository

View file

@ -43,7 +43,7 @@ class GraphData(
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var databaseHelper: DatabaseHelperInterface
@Inject lateinit var repository: AppRepository
@Inject lateinit var dateUtil: DateUtil

View file

@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions
import android.graphics.Color
import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.database.entities.Bolus
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.resources.ResourceHelper
@ -12,7 +12,7 @@ import javax.inject.Inject
class BolusDataPoint @Inject constructor(
val data: Bolus,
private val resourceHelper: ResourceHelper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val defaultValueHelper: DefaultValueHelper
) : DataPointWithLabelInterface {

View file

@ -35,7 +35,7 @@ class PersistentNotificationPlugin @Inject constructor(
private val aapsSchedulers: AapsSchedulers,
private val profileFunction: ProfileFunction,
private val fabricPrivacy: FabricPrivacy,
private val activePlugins: ActivePluginProvider,
private val activePlugins: ActivePlugin,
private val iobCobCalculator: IobCobCalculator,
private val rxBus: RxBusWrapper,
private val context: Context,

View file

@ -70,7 +70,7 @@ class SmsCommunicatorPlugin @Inject constructor(
private val rxBus: RxBusWrapper,
private val profileFunction: ProfileFunction,
private val fabricPrivacy: FabricPrivacy,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val commandQueue: CommandQueueProvider,
private val loopPlugin: LoopPlugin,
private val iobCobCalculator: IobCobCalculator,

View file

@ -5,7 +5,7 @@ import android.os.PowerManager
import android.os.SystemClock
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -37,7 +37,7 @@ class TidepoolUploader @Inject constructor(
private val resourceHelper: ResourceHelper,
private val sp: SP,
private val uploadChunk: UploadChunk,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val dateUtil: DateUtil
) {

View file

@ -4,7 +4,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.TemporaryBasal
import info.nightscout.androidaps.db.ProfileSwitch
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -28,7 +28,7 @@ class UploadChunk @Inject constructor(
private val rxBus: RxBusWrapper,
private val aapsLogger: AAPSLogger,
private val profileFunction: ProfileFunction,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val databaseHelper: DatabaseHelperInterface,
private val repository: AppRepository,
private val dateUtil: DateUtil

View file

@ -69,7 +69,7 @@ class ActionStringHandler @Inject constructor(
private val wearPlugin: WearPlugin,
private val fabricPrivacy: FabricPrivacy,
private val commandQueue: CommandQueueProvider,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val iobCobCalculator: IobCobCalculator,
private val localInsightPlugin: LocalInsightPlugin,
private val danaRPlugin: DanaRPlugin,

View file

@ -40,7 +40,7 @@ import info.nightscout.androidaps.database.entities.GlucoseValue;
import info.nightscout.androidaps.database.entities.TemporaryBasal;
import info.nightscout.androidaps.extensions.GlucoseValueExtensionKt;
import info.nightscout.androidaps.extensions.TemporaryBasalExtensionKt;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.ActivePlugin;
import info.nightscout.androidaps.interfaces.IobCobCalculator;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.ProfileFunction;
@ -72,7 +72,7 @@ public class WatchUpdaterService extends WearableListenerService implements Goog
@Inject public ProfileFunction profileFunction;
@Inject public DefaultValueHelper defaultValueHelper;
@Inject public NSDeviceStatus nsDeviceStatus;
@Inject public ActivePluginProvider activePlugin;
@Inject public ActivePlugin activePlugin;
@Inject public LoopPlugin loopPlugin;
@Inject public IobCobCalculator iobCobCalculator;
@Inject public AppRepository repository;

View file

@ -31,7 +31,7 @@ class StatusLinePlugin @Inject constructor(
private val aapsSchedulers: AapsSchedulers,
private val context: Context,
private val fabricPrivacy: FabricPrivacy,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val loopPlugin: LoopPlugin,
private val iobCobCalculator: IobCobCalculator,
private val rxBus: RxBusWrapper,

View file

@ -7,7 +7,7 @@ import com.jjoe64.graphview.GraphView
import com.jjoe64.graphview.series.DataPoint
import com.jjoe64.graphview.series.LineGraphSeries
import info.nightscout.androidaps.database.entities.Bolus
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.utils.T
import java.util.*
import kotlin.math.floor
@ -18,7 +18,7 @@ class ActivityGraph : GraphView {
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
fun show(insulin: InsulinInterface) {
fun show(insulin: Insulin) {
removeAllSeries()
mSecondScale = null
val hours = floor(insulin.dia + 1).toLong()

View file

@ -7,13 +7,13 @@ import android.view.ViewGroup
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.InsulinFragmentBinding
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.utils.resources.ResourceHelper
import javax.inject.Inject
class InsulinFragment : DaggerFragment() {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var resourceHelper: ResourceHelper
private var _binding: InsulinFragmentBinding? = null

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.insulin
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -19,7 +19,7 @@ class InsulinLyumjevPlugin @Inject constructor(
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_LYUMJEV
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_LYUMJEV
override val friendlyName get(): String = resourceHelper.gs(R.string.lyumjev)
override fun configuration(): JSONObject = JSONObject()

View file

@ -4,8 +4,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.Iob
import info.nightscout.androidaps.database.entities.Bolus
import info.nightscout.androidaps.db.Treatment
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -36,7 +35,7 @@ abstract class InsulinOrefBasePlugin(
.shortName(R.string.insulin_shortname)
.visibleByDefault(false),
aapsLogger, resourceHelper, injector
), InsulinInterface {
), Insulin {
private var lastWarned: Long = 0
override val dia
@ -67,26 +66,6 @@ abstract class InsulinOrefBasePlugin(
return profile?.dia ?: MIN_DIA
}
override fun iobCalcForTreatment(treatment: Treatment, time: Long, dia: Double): Iob {
val result = Iob()
val peak = peak
if (treatment.insulin != 0.0) {
val bolusTime = treatment.date
val t = (time - bolusTime) / 1000.0 / 60.0
val td = dia * 60 //getDIA() always >= MIN_DIA
val tp = peak.toDouble()
// force the IOB to 0 if over DIA hours have passed
if (t < td) {
val tau = tp * (1 - tp / td) / (1 - 2 * tp / td)
val a = 2 * tau / td
val S = 1 / (1 - a + (1 + a) * Math.exp(-td / tau))
result.activityContrib = treatment.insulin * (S / Math.pow(tau, 2.0)) * t * (1 - t / td) * Math.exp(-t / tau)
result.iobContrib = treatment.insulin * (1 - S * (1 - a) * ((Math.pow(t, 2.0) / (tau * td * (1 - a)) - t / tau - 1) * Math.exp(-t / tau) + 1))
}
}
return result
}
override fun iobCalcForTreatment(bolus: Bolus, time: Long, dia: Double): Iob {
val result = Iob()
val peak = peak

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.insulin
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -26,7 +26,7 @@ class InsulinOrefFreePeakPlugin @Inject constructor(
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_FREE_PEAK
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_FREE_PEAK
override val friendlyName get(): String = resourceHelper.gs(R.string.free_peak_oref)

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.insulin
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -22,7 +22,7 @@ class InsulinOrefRapidActingPlugin @Inject constructor(
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_RAPID_ACTING
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_RAPID_ACTING
override val friendlyName get(): String = resourceHelper.gs(R.string.rapid_acting_oref)
override fun configuration(): JSONObject = JSONObject()

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.insulin
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.InsulinInterface
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -22,7 +22,7 @@ class InsulinOrefUltraRapidActingPlugin @Inject constructor(
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_ULTRA_RAPID_ACTING
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_ULTRA_RAPID_ACTING
override val friendlyName get(): String = resourceHelper.gs(R.string.ultrarapid_oref)
override fun configuration(): JSONObject = JSONObject()

View file

@ -52,7 +52,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
private val sp: SP,
resourceHelper: ResourceHelper,
private val profileFunction: ProfileFunction,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val sensitivityOref1Plugin: SensitivityOref1Plugin,
private val sensitivityAAPSPlugin: SensitivityAAPSPlugin,
private val sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin,

View file

@ -11,7 +11,7 @@ import info.nightscout.androidaps.database.ValueWrapper
import info.nightscout.androidaps.events.Event
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.extensions.target
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -56,7 +56,7 @@ class IobCobOref1Thread internal constructor(
@Inject lateinit var context: Context
@Inject lateinit var sensitivityAAPSPlugin: SensitivityAAPSPlugin
@Inject lateinit var sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var profiler: Profiler
@Inject lateinit var fabricPrivacy: FabricPrivacy

View file

@ -9,7 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.events.Event
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -55,7 +55,7 @@ class IobCobThread @Inject internal constructor(
@Inject lateinit var context: Context
@Inject lateinit var sensitivityAAPSPlugin: SensitivityAAPSPlugin
@Inject lateinit var sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var profiler: Profiler
@Inject lateinit var fabricPrivacy: FabricPrivacy

View file

@ -17,7 +17,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.databinding.LocalprofileFragmentBinding
import info.nightscout.androidaps.dialogs.ProfileSwitchDialog
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -36,7 +36,7 @@ class LocalProfileFragment : DaggerFragment() {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var localProfilePlugin: LocalProfilePlugin
@Inject lateinit var hardLimits: HardLimits

View file

@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.SensitivityInterface
import info.nightscout.androidaps.interfaces.Sensitivity
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
@ -22,7 +22,7 @@ abstract class AbstractSensitivityPlugin(
aapsLogger: AAPSLogger,
resourceHelper: ResourceHelper,
val sp: SP
) : PluginBase(pluginDescription, aapsLogger, resourceHelper, injector), SensitivityInterface {
) : PluginBase(pluginDescription, aapsLogger, resourceHelper, injector), Sensitivity {
abstract override fun detectSensitivity(ads: AutosensDataStore, fromTime: Long, toTime: Long): AutosensResult
@ -46,11 +46,11 @@ abstract class AbstractSensitivityPlugin(
//If not-excluded data <= MIN_HOURS -> don't do Autosens
//If not-excluded data >= MIN_HOURS_FULL_AUTOSENS -> full Autosens
//Between MIN_HOURS and MIN_HOURS_FULL_AUTOSENS: gradually increase autosens
val autosensContrib = (min(max(SensitivityInterface.MIN_HOURS, deviationsArraySize / 12.0),
SensitivityInterface.MIN_HOURS_FULL_AUTOSENS) - SensitivityInterface.MIN_HOURS) / (SensitivityInterface.MIN_HOURS_FULL_AUTOSENS - SensitivityInterface.MIN_HOURS)
val autosensContrib = (min(max(Sensitivity.MIN_HOURS, deviationsArraySize / 12.0),
Sensitivity.MIN_HOURS_FULL_AUTOSENS) - Sensitivity.MIN_HOURS) / (Sensitivity.MIN_HOURS_FULL_AUTOSENS - Sensitivity.MIN_HOURS)
ratio = autosensContrib * (ratio - 1) + 1
if (autosensContrib != 1.0) {
ratioLimit += "(" + deviationsArraySize + " of " + SensitivityInterface.MIN_HOURS_FULL_AUTOSENS * 12 + " values) "
ratioLimit += "(" + deviationsArraySize + " of " + Sensitivity.MIN_HOURS_FULL_AUTOSENS * 12 + " values) "
}
if (ratio != rawRatio) {
ratioLimit += "Ratio limited from $rawRatio to $ratio"

View file

@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.SensitivityInterface.SensitivityType
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore

View file

@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.SensitivityInterface.SensitivityType
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults

View file

@ -13,7 +13,7 @@ import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.SensitivityInterface.SensitivityType
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore

View file

@ -29,7 +29,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.extensions.directionToIcon
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.extensions.valueToUnitsString
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
@ -49,7 +49,7 @@ class BGSourceFragment : DaggerFragment() {
@Inject lateinit var repository: AppRepository
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
private val disposable = CompositeDisposable()
private val millsToThePast = T.hours(12).msecs()

View file

@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -51,7 +51,7 @@ class DexcomPlugin @Inject constructor(
.preferencesId(R.xml.pref_bgsourcedexcom)
.description(R.string.description_source_dexcom),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
init {
if (!config.NSCLIENT) {
@ -63,7 +63,7 @@ class DexcomPlugin @Inject constructor(
return true
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
(glucoseValue.sourceSensor == GlucoseValue.SourceSensor.DEXCOM_G6_NATIVE ||
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.DEXCOM_G5_NATIVE ||
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.DEXCOM_NATIVE_UNKNOWN)

View file

@ -11,7 +11,7 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.entities.TherapyEvent
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -41,11 +41,11 @@ class EversensePlugin @Inject constructor(
.preferencesId(R.xml.pref_bgsource)
.description(R.string.description_source_eversense),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
override var sensorBatteryLevel = -1
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.EVERSENSE && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
// cannot be inner class because of needed injection

View file

@ -9,7 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -35,7 +35,7 @@ class GlimpPlugin @Inject constructor(
.preferencesId(R.xml.pref_bgsource)
.description(R.string.description_source_glimp),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
// cannot be inner class because of needed injection
class GlimpWorker(
@ -83,7 +83,7 @@ class GlimpPlugin @Inject constructor(
}
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.GLIMP && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
}

View file

@ -9,7 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -38,7 +38,7 @@ class MM640gPlugin @Inject constructor(
.pluginName(R.string.MM640g)
.description(R.string.description_source_mm640g),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
// cannot be inner class because of needed injection
class MM640gWorker(
@ -107,7 +107,7 @@ class MM640gPlugin @Inject constructor(
}
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.MM_600_SERIES && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
}

View file

@ -10,7 +10,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -44,7 +44,7 @@ class NSClientSourcePlugin @Inject constructor(
.pluginName(R.string.nsclientbg)
.description(R.string.description_source_ns_client),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
private var lastBGTimeStamp: Long = 0
private var isAdvancedFilteringEnabled = false
@ -61,7 +61,7 @@ class NSClientSourcePlugin @Inject constructor(
return isAdvancedFilteringEnabled
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean = false
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean = false
private fun detectSource(glucoseValue: GlucoseValue) {
if (glucoseValue.timestamp > lastBGTimeStamp) {

View file

@ -10,7 +10,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -39,7 +39,7 @@ class PoctechPlugin @Inject constructor(
.preferencesId(R.xml.pref_bgsource)
.description(R.string.description_source_poctech),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
// cannot be inner class because of needed injection
class PoctechWorker(
@ -98,7 +98,7 @@ class PoctechPlugin @Inject constructor(
}
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.POCTECH_NATIVE && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
}

View file

@ -7,7 +7,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -48,7 +48,7 @@ class RandomBgPlugin @Inject constructor(
.preferencesId(R.xml.pref_bgsource)
.description(R.string.description_source_randombg),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
private val loopHandler: Handler = Handler(HandlerThread(RandomBgPlugin::class.java.simpleName + "Handler").also { it.start() }.looper)
private lateinit var refreshLoop: Runnable
@ -74,7 +74,7 @@ class RandomBgPlugin @Inject constructor(
return true
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.RANDOM && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
override fun onStart() {

View file

@ -9,7 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -36,7 +36,7 @@ class TomatoPlugin @Inject constructor(
.shortName(R.string.tomato_short)
.description(R.string.description_source_tomato),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
// cannot be inner class because of needed injection
class TomatoWorker(
@ -85,7 +85,7 @@ class TomatoPlugin @Inject constructor(
}
}
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean =
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.LIBRE_1_TOMATO && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
}

View file

@ -9,7 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSourceInterface
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
@ -33,12 +33,12 @@ class XdripPlugin @Inject constructor(
.pluginName(R.string.xdrip)
.description(R.string.description_source_xdrip),
aapsLogger, resourceHelper, injector
), BgSourceInterface {
), BgSource {
private var advancedFiltering = false
override var sensorBatteryLevel = -1
override fun uploadToNs(glucoseValue: GlucoseValue): Boolean = false
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean = false
override fun advancedFilteringSupported(): Boolean {
return advancedFiltering

View file

@ -10,7 +10,7 @@ import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.TreatmentsFragmentBinding
import info.nightscout.androidaps.events.EventExtendedBolusChange
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.treatments.fragments.*
@ -29,7 +29,7 @@ class TreatmentsFragment : DaggerFragment() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var buildHelper: BuildHelper

View file

@ -23,7 +23,7 @@ import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventReloadProfileSwitchData;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.ActivePlugin;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
@ -54,7 +54,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
private final RxBusWrapper rxBus;
private final ResourceHelper resourceHelper;
private final ProfileFunction profileFunction;
private final ActivePluginProvider activePlugin;
private final ActivePlugin activePlugin;
private final NSUpload nsUpload;
private final FabricPrivacy fabricPrivacy;
private final DateUtil dateUtil;
@ -77,7 +77,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
Context context,
SP sp,
ProfileFunction profileFunction,
ActivePluginProvider activePlugin,
ActivePlugin activePlugin,
NSUpload nsUpload,
FabricPrivacy fabricPrivacy,
DateUtil dateUtil,

View file

@ -24,7 +24,7 @@ import info.nightscout.androidaps.databinding.TreatmentsBolusCarbsItemBinding
import info.nightscout.androidaps.dialogs.WizardInfoDialog
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.events.EventTreatmentChange
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -63,7 +63,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var repository: AppRepository
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
class MealLink(
val bolus: Bolus? = null,

View file

@ -23,7 +23,7 @@ import info.nightscout.androidaps.events.EventExtendedBolusChange
import info.nightscout.androidaps.extensions.iobCalc
import info.nightscout.androidaps.extensions.isInProgress
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -47,7 +47,7 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
private val millsToThePast = T.days(30).msecs()
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var aapsLogger: AAPSLogger

View file

@ -27,7 +27,7 @@ import info.nightscout.androidaps.extensions.iobCalc
import info.nightscout.androidaps.extensions.toStringFull
import info.nightscout.androidaps.extensions.toTemporaryBasal
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
@ -53,7 +53,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var aapsSchedulers: AapsSchedulers

View file

@ -18,7 +18,7 @@ import info.nightscout.androidaps.dialogs.BolusProgressDialog
import info.nightscout.androidaps.events.EventBolusRequested
import info.nightscout.androidaps.events.EventNewBasalProfile
import info.nightscout.androidaps.events.EventProfileNeedsUpdate
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -56,7 +56,7 @@ open class CommandQueue @Inject constructor(
private val resourceHelper: ResourceHelper,
private val constraintChecker: ConstraintChecker,
private val profileFunction: ProfileFunction,
private val activePlugin: Lazy<ActivePluginProvider>,
private val activePlugin: Lazy<ActivePlugin>,
private val context: Context,
private val sp: SP,
private val buildHelper: BuildHelper,

View file

@ -7,7 +7,7 @@ import android.os.SystemClock
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -22,7 +22,7 @@ class QueueThread internal constructor(
context: Context,
private val aapsLogger: AAPSLogger,
private val rxBus: RxBusWrapper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val resourceHelper: ResourceHelper,
private val sp: SP
) : Thread() {

View file

@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.dialogs.BolusProgressDialog
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
@ -19,7 +19,7 @@ class CommandBolus(
) : Command(injector, type, callback) {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.deliverTreatment(detailedBolusInfo)

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -11,7 +11,7 @@ class CommandCancelExtendedBolus constructor(
callback: Callback?
) : Command(injector, CommandType.EXTENDEDBOLUS, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.cancelExtendedBolus()

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -12,7 +12,7 @@ class CommandCancelTempBasal(
callback: Callback?
) : Command(injector, CommandType.TEMPBASAL, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.cancelTempBasal(enforceNew)

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -12,7 +12,7 @@ class CommandCustomCommand(
callback: Callback?
) : Command(injector, CommandType.CUSTOM_COMMAND, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val result = activePlugin.activePump.executeCustomCommand(customCommand)

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -13,7 +13,7 @@ class CommandExtendedBolus constructor(
callback: Callback?
) : Command(injector, CommandType.EXTENDEDBOLUS, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.setExtendedBolus(insulin, durationInMinutes)

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -12,7 +12,7 @@ class CommandInsightSetTBROverNotification constructor(
callback: Callback?
) : Command(injector, CommandType.INSIGHT_SET_TBR_OVER_ALARM, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DanaRInterface
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
@ -12,7 +12,7 @@ class CommandLoadEvents(
callback: Callback?
) : Command(injector, CommandType.LOAD_EVENTS, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DanaRInterface
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
@ -13,7 +13,7 @@ class CommandLoadHistory(
callback: Callback?
) : Command(injector, CommandType.LOAD_HISTORY, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -11,7 +11,7 @@ class CommandLoadTDDs(
callback: Callback?
) : Command(injector, CommandType.LOAD_TDD, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.LocalAlertUtils
@ -15,7 +15,7 @@ class CommandReadStatus(
callback: Callback?
) : Command(injector, CommandType.READSTATUS, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var localAlertUtils: LocalAlertUtils
override fun execute() {

View file

@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.DateUtil
@ -18,7 +18,7 @@ class CommandSMBBolus(
) : Command(injector, CommandType.SMB_BOLUS, callback) {
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r: PumpEnactResult

View file

@ -5,7 +5,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.db.Source
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.logging.LTag
@ -20,7 +20,7 @@ class CommandSetProfile constructor(
) : Command(injector, CommandType.BASAL_PROFILE, callback) {
@Inject lateinit var smsCommunicatorPlugin: SmsCommunicatorPlugin
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
override fun execute() {

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.DanaRInterface
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
@ -12,7 +12,7 @@ class CommandSetUserSettings(
callback: Callback?
) : Command(injector, CommandType.SET_USER_SETTINGS, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -11,7 +11,7 @@ class CommandStartPump(
callback: Callback?
) : Command(injector, CommandType.START_PUMP, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -11,7 +11,7 @@ class CommandStopPump(
callback: Callback?
) : Command(injector, CommandType.STOP_PUMP, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val pump = activePlugin.activePump

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.PumpSync
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
@ -18,7 +18,7 @@ class CommandTempBasalAbsolute(
callback: Callback?
) : Command(injector, CommandType.TEMPBASAL, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.setTempBasalAbsolute(absoluteRate, durationInMinutes, profile, enforceNew, tbrType)

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.PumpSync
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
@ -18,7 +18,7 @@ class CommandTempBasalPercent(
callback: Callback?
) : Command(injector, CommandType.TEMPBASAL, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
override fun execute() {
val r = activePlugin.activePump.setTempBasalPercent(percent, durationInMinutes, profile, enforceNew, tbrType)

View file

@ -18,7 +18,7 @@ import info.nightscout.androidaps.Config
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.events.EventProfileNeedsUpdate
import info.nightscout.androidaps.extensions.buildDeviceStatus
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -64,7 +64,7 @@ class KeepAliveReceiver : DaggerBroadcastReceiver() {
@Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var runningConfiguration: RunningConfiguration
@Inject lateinit var receiverStatusStore: ReceiverStatusStore

View file

@ -4,7 +4,7 @@ import android.content.Context
import android.content.Intent
import com.google.gson.Gson
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.PumpInterface
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.BundleLogger
@ -15,7 +15,7 @@ import javax.inject.Inject
class TimeDateOrTZChangeReceiver : DaggerBroadcastReceiver() {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
val gson: Gson = Gson()
private var isDST = false

View file

@ -47,7 +47,7 @@ class SWDefinition @Inject constructor(
private val sp: SP,
private val profileFunction: ProfileFunction,
private val localProfilePlugin: LocalProfilePlugin,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val commandQueue: CommandQueueProvider,
private val objectivesPlugin: ObjectivesPlugin,
private val configBuilder: ConfigBuilder,
@ -269,13 +269,13 @@ class SWDefinition @Inject constructor(
.add(SWFragment(injector, this)
.add(NSProfileFragment()))
.validator { nsProfilePlugin.profile != null && nsProfilePlugin.profile!!.getDefaultProfile() != null && nsProfilePlugin.profile!!.getDefaultProfile()!!.isValid("StartupWizard") }
.visibility { nsProfilePlugin.isEnabled(PluginType.PROFILE) }
.visibility { nsProfilePlugin.isEnabled() }
private val screenLocalProfile = SWScreen(injector, R.string.localprofile)
.skippable(false)
.add(SWFragment(injector, this)
.add(LocalProfileFragment()))
.validator { localProfilePlugin.profile?.getDefaultProfile()?.isValid("StartupWizard") == true }
.visibility { localProfilePlugin.isEnabled(PluginType.PROFILE) }
.visibility { localProfilePlugin.isEnabled() }
private val screenProfileSwitch = SWScreen(injector, R.string.careportal_profileswitch)
.skippable(false)
.add(SWInfoText(injector)

View file

@ -5,7 +5,7 @@ import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -32,7 +32,7 @@ class LocalAlertUtils @Inject constructor(
private val sp: SP,
private val rxBus: RxBusWrapper,
private val resourceHelper: ResourceHelper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val profileFunction: ProfileFunction,
private val iobCobCalculator: IobCobCalculator,
private val smsCommunicatorPlugin: SmsCommunicatorPlugin,

View file

@ -6,7 +6,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.Bolus
import info.nightscout.androidaps.db.TDD
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.IobCobCalculator
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
@ -22,7 +22,7 @@ import javax.inject.Inject
class TddCalculator @Inject constructor(
private val aapsLogger: AAPSLogger,
private val resourceHelper: ResourceHelper,
private val activePlugin: ActivePluginProvider,
private val activePlugin: ActivePlugin,
private val profileFunction: ProfileFunction,
private val dateUtil: DateUtil,
private val iobCobCalculator: IobCobCalculator,

View file

@ -53,7 +53,7 @@ class BolusWizard @Inject constructor(
@Inject lateinit var sp: SP
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var iobCobCalculator: IobCobCalculator

View file

@ -8,7 +8,6 @@ import info.nightscout.androidaps.db.ProfileSwitch
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.resources.ResourceHelper
import org.json.JSONObject
@ -20,7 +19,7 @@ import org.powermock.core.classloader.annotations.PrepareForTest
@PrepareForTest(FabricPrivacy::class)
open class TestBaseWithProfile : TestBase() {
@Mock lateinit var activePluginProvider: ActivePluginProvider
@Mock lateinit var activePluginProvider: ActivePlugin
@Mock lateinit var resourceHelper: ResourceHelper
@Mock lateinit var treatmentsInterface: TreatmentsInterface
@Mock lateinit var iobCobCalculator: IobCobCalculator

View file

@ -55,7 +55,7 @@ import java.util.*
UserEntryLogger::class, LoggerUtils::class, AppRepository::class)
class ConstraintsCheckerTest : TestBaseWithProfile() {
@Mock lateinit var activePlugin: ActivePluginProvider
@Mock lateinit var activePlugin: ActivePlugin
@Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin
@Mock lateinit var sp: SP
@Mock lateinit var commandQueue: CommandQueueProvider

View file

@ -13,7 +13,6 @@ import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.receivers.ReceiverStatusStore
@ -41,7 +40,7 @@ class LoopPluginTest : TestBase() {
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var context: Context
@Mock lateinit var commandQueue: CommandQueueProvider
@Mock lateinit var activePlugin: ActivePluginProvider
@Mock lateinit var activePlugin: ActivePlugin
@Mock lateinit var treatmentsPlugin: TreatmentsPlugin
@Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin
@Mock lateinit var iobCobCalculator: IobCobCalculator

Some files were not shown because too many files have changed in this diff Show more