more workflow cleanup

This commit is contained in:
Milos Kozak 2023-09-27 09:54:28 +02:00
parent fc707cd11a
commit 7760014eea
13 changed files with 32 additions and 21 deletions

View file

@ -15,7 +15,7 @@ import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.database.impl.AppRepository import app.aaps.database.impl.AppRepository
import app.aaps.implementation.overview.OverviewDataImpl import app.aaps.implementation.overview.OverviewDataImpl
import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton

View file

@ -2,15 +2,13 @@ package app.aaps.di
import android.content.Context import android.content.Context
import app.aaps.MainApp import app.aaps.MainApp
import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.implementations.ConfigImpl
import app.aaps.implementations.InstantiatorImpl
import app.aaps.implementations.UiInteractionImpl
import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.objects.Instantiator import app.aaps.core.interfaces.objects.Instantiator
import app.aaps.core.interfaces.plugin.PluginBase import app.aaps.core.interfaces.plugin.PluginBase
import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.workflow.CalculationWorkflowImpl import app.aaps.implementations.ConfigImpl
import app.aaps.implementations.InstantiatorImpl
import app.aaps.implementations.UiInteractionImpl
import dagger.Binds import dagger.Binds
import dagger.Lazy import dagger.Lazy
import dagger.Module import dagger.Module
@ -51,7 +49,6 @@ open class AppModule {
@Binds fun bindConfigInterface(config: ConfigImpl): Config @Binds fun bindConfigInterface(config: ConfigImpl): Config
@Binds fun bindActivityNames(activityNames: UiInteractionImpl): UiInteraction @Binds fun bindActivityNames(activityNames: UiInteractionImpl): UiInteraction
@Binds fun bindCalculationWorkflow(calculationWorkflow: CalculationWorkflowImpl): CalculationWorkflow
@Binds fun bindInstantiator(instantiatorImpl: InstantiatorImpl): Instantiator @Binds fun bindInstantiator(instantiatorImpl: InstantiatorImpl): Instantiator
} }

View file

@ -20,7 +20,6 @@ import app.aaps.plugins.insulin.InsulinLyumjevPlugin
import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin
import app.aaps.plugins.insulin.InsulinOrefRapidActingPlugin import app.aaps.plugins.insulin.InsulinOrefRapidActingPlugin
import app.aaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin import app.aaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin
import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.plugins.main.general.actions.ActionsPlugin import app.aaps.plugins.main.general.actions.ActionsPlugin
import app.aaps.plugins.main.general.food.FoodPlugin import app.aaps.plugins.main.general.food.FoodPlugin
import app.aaps.plugins.main.general.overview.OverviewPlugin import app.aaps.plugins.main.general.overview.OverviewPlugin
@ -28,6 +27,7 @@ import app.aaps.plugins.main.general.persistentNotification.PersistentNotificati
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin
import app.aaps.plugins.main.general.wear.WearPlugin import app.aaps.plugins.main.general.wear.WearPlugin
import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.plugins.main.profile.ProfilePlugin import app.aaps.plugins.main.profile.ProfilePlugin
import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin
import app.aaps.plugins.sensitivity.SensitivityOref1Plugin import app.aaps.plugins.sensitivity.SensitivityOref1Plugin

View file

@ -7,7 +7,7 @@ import app.aaps.core.interfaces.profile.ProfileStore
import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.implementation.profile.ProfileStoreObject import app.aaps.implementation.profile.ProfileStoreObject
import app.aaps.plugins.aps.APSResultObject import app.aaps.plugins.aps.APSResultObject
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataObject
import dagger.Reusable import dagger.Reusable
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import org.json.JSONObject import org.json.JSONObject

View file

@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers
import app.aaps.plugins.automation.R import app.aaps.plugins.automation.R
import app.aaps.plugins.automation.elements.Comparator import app.aaps.plugins.automation.elements.Comparator
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataObject
import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat
import org.json.JSONObject import org.json.JSONObject
import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions

View file

@ -2,11 +2,11 @@ package app.aaps.plugins.main.di
import app.aaps.core.interfaces.iob.IobCobCalculator import app.aaps.core.interfaces.iob.IobCobCalculator
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
import app.aaps.plugins.main.general.persistentNotification.DummyService import app.aaps.plugins.main.general.persistentNotification.DummyService
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
import app.aaps.plugins.main.general.wear.WearFragment import app.aaps.plugins.main.general.wear.WearFragment
import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataObject
import dagger.Binds import dagger.Binds
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector

View file

@ -1,4 +1,4 @@
package app.aaps.plugins.iob.iobCobCalculator package app.aaps.plugins.main.iob.iobCobCalculator
import androidx.collection.LongSparseArray import androidx.collection.LongSparseArray
import app.aaps.annotations.OpenForTesting import app.aaps.annotations.OpenForTesting
@ -50,8 +50,8 @@ import app.aaps.database.entities.ExtendedBolus
import app.aaps.database.entities.TemporaryBasal import app.aaps.database.entities.TemporaryBasal
import app.aaps.database.entities.interfaces.end import app.aaps.database.entities.interfaces.end
import app.aaps.database.impl.AppRepository import app.aaps.database.impl.AppRepository
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject
import app.aaps.plugins.main.R import app.aaps.plugins.main.R
import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataStoreObject
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign

View file

@ -1,4 +1,4 @@
package app.aaps.plugins.iob.iobCobCalculator.data package app.aaps.plugins.main.iob.iobCobCalculator.data
import app.aaps.core.interfaces.aps.AutosensData import app.aaps.core.interfaces.aps.AutosensData
import app.aaps.core.interfaces.aps.AutosensResult import app.aaps.core.interfaces.aps.AutosensResult

View file

@ -1,4 +1,4 @@
package app.aaps.plugins.iob.iobCobCalculator.data package app.aaps.plugins.main.iob.iobCobCalculator.data
import androidx.collection.LongSparseArray import androidx.collection.LongSparseArray
import androidx.collection.size import androidx.collection.size

View file

@ -9,8 +9,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.T import app.aaps.core.interfaces.utils.T
import app.aaps.database.entities.GlucoseValue import app.aaps.database.entities.GlucoseValue
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataObject
import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataStoreObject
import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.impl.utils.DateUtilImpl
import app.aaps.shared.tests.TestBase import app.aaps.shared.tests.TestBase
import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat

View file

@ -23,4 +23,5 @@ dependencies {
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':database:entities') implementation project(':database:entities')
implementation project(':database:impl') implementation project(':database:impl')
implementation project(':plugins:main')
} }

View file

@ -29,7 +29,7 @@ import app.aaps.core.main.workflow.CalculationWorkflow.Companion.MAIN_CALCULATIO
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.PASS import app.aaps.core.main.workflow.CalculationWorkflow.Companion.PASS
import app.aaps.core.utils.receivers.DataWorkerStorage import app.aaps.core.utils.receivers.DataWorkerStorage
import app.aaps.core.utils.worker.then import app.aaps.core.utils.worker.then
import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.workflow.iob.IobCobOref1Worker import app.aaps.workflow.iob.IobCobOref1Worker
import app.aaps.workflow.iob.IobCobOrefWorker import app.aaps.workflow.iob.IobCobOrefWorker
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
@ -62,7 +62,7 @@ class CalculationWorkflowImpl @Inject constructor(
init { init {
// Verify definition // Verify definition
var sumPercent = 0 var sumPercent = 0
for (pass in CalculationWorkflow.ProgressData.values()) sumPercent += pass.percentOfTotal for (pass in CalculationWorkflow.ProgressData.entries) sumPercent += pass.percentOfTotal
require(sumPercent == 100) require(sumPercent == 100)
disposable += rxBus disposable += rxBus

View file

@ -1,5 +1,7 @@
package app.aaps.workflow.di package app.aaps.workflow.di
import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.workflow.CalculationWorkflowImpl
import app.aaps.workflow.DummyWorker import app.aaps.workflow.DummyWorker
import app.aaps.workflow.InvokeLoopWorker import app.aaps.workflow.InvokeLoopWorker
import app.aaps.workflow.LoadBgDataWorker import app.aaps.workflow.LoadBgDataWorker
@ -15,13 +17,24 @@ import app.aaps.workflow.UpdateIobCobSensWorker
import app.aaps.workflow.UpdateWidgetWorker import app.aaps.workflow.UpdateWidgetWorker
import app.aaps.workflow.iob.IobCobOref1Worker import app.aaps.workflow.iob.IobCobOref1Worker
import app.aaps.workflow.iob.IobCobOrefWorker import app.aaps.workflow.iob.IobCobOrefWorker
import dagger.Binds
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
@Module
@Suppress("unused") @Suppress("unused")
@Module(
includes = [
WorkflowModule.WorkflowBindings::class
]
)
abstract class WorkflowModule { abstract class WorkflowModule {
@Module
interface WorkflowBindings {
@Binds fun bindCalculationWorkflow(calculationWorkflow: CalculationWorkflowImpl): CalculationWorkflow
}
@ContributesAndroidInjector abstract fun iobCobWorkerInjector(): IobCobOrefWorker @ContributesAndroidInjector abstract fun iobCobWorkerInjector(): IobCobOrefWorker
@ContributesAndroidInjector abstract fun iobCobOref1WorkerInjector(): IobCobOref1Worker @ContributesAndroidInjector abstract fun iobCobOref1WorkerInjector(): IobCobOref1Worker
@ContributesAndroidInjector abstract fun prepareIobAutosensDataWorkerInjector(): PrepareIobAutosensGraphDataWorker @ContributesAndroidInjector abstract fun prepareIobAutosensDataWorkerInjector(): PrepareIobAutosensGraphDataWorker