Merge branch 'dev' into feat/cannula-usage
This commit is contained in:
commit
d1d74048f1
|
@ -7,6 +7,8 @@ plugins {
|
|||
id 'kotlinx-serialization'
|
||||
id 'com.google.gms.google-services'
|
||||
id 'com.google.firebase.crashlytics'
|
||||
id 'com.vanniktech.dependency.graph.generator'
|
||||
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
|
@ -229,8 +231,6 @@ dependencies {
|
|||
// MainApp
|
||||
api "com.uber.rxdogtag2:rxdogtag:2.0.1"
|
||||
|
||||
// DataLayerListenerService
|
||||
api "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
|
|
|
@ -143,29 +143,6 @@
|
|||
android:resource="@xml/filepaths" />
|
||||
</provider>
|
||||
|
||||
<service
|
||||
android:name=".plugins.general.wear.wearintegration.DataLayerListenerServiceMobile"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" />
|
||||
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" />
|
||||
<data
|
||||
android:host="*"
|
||||
android:scheme="wear" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<!-- listeners receive events that match the action and data filters -->
|
||||
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:pathPrefix="@string/path_rx_bridge"
|
||||
android:scheme="wear" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".services.AlarmSoundService"
|
||||
android:enabled="true"
|
||||
|
@ -176,10 +153,6 @@
|
|||
|
||||
<service android:name=".plugins.general.persistentNotification.DummyService" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.SingleFragmentActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".plugins.general.maintenance.activities.LogSettingActivity"
|
||||
android:exported="false" />
|
||||
|
|
|
@ -32,13 +32,12 @@ import com.joanzapata.iconify.Iconify
|
|||
import com.joanzapata.iconify.fonts.FontAwesomeModule
|
||||
import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.databinding.ActivityMainBinding
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.configuration.setupwizard.SetupWizardActivity
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import info.nightscout.core.ui.UIRunnable
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
import info.nightscout.core.ui.locale.LocaleHelper
|
||||
import info.nightscout.core.ui.toast.ToastUtils
|
||||
import info.nightscout.core.utils.CryptoUtil
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
|
@ -50,7 +49,7 @@ import info.nightscout.interfaces.AndroidPermission
|
|||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.core.ui.locale.LocaleHelper
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.maintenance.PrefFileListProvider
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
|
@ -68,6 +67,7 @@ import info.nightscout.rx.events.EventRebuildTabs
|
|||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.ui.activities.ProfileHelperActivity
|
||||
import info.nightscout.ui.activities.SingleFragmentActivity
|
||||
import info.nightscout.ui.activities.StatsActivity
|
||||
import info.nightscout.ui.activities.TreatmentsActivity
|
||||
import info.nightscout.ui.tabs.TabPageAdapter
|
||||
|
|
|
@ -16,14 +16,13 @@ import androidx.work.WorkManager
|
|||
import dagger.android.AndroidInjector
|
||||
import dagger.android.DaggerApplication
|
||||
import info.nightscout.androidaps.di.DaggerAppComponent
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.receivers.BTReceiver
|
||||
import info.nightscout.androidaps.receivers.ChargingStateReceiver
|
||||
import info.nightscout.androidaps.receivers.KeepAliveWorker
|
||||
import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.androidaps.utils.ProcessLifecycleListener
|
||||
import info.nightscout.core.ui.locale.LocaleHelper
|
||||
import info.nightscout.core.utils.receivers.NetworkChangeReceiver
|
||||
import info.nightscout.core.versionChecker.VersionCheckerUtils
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
|
@ -32,10 +31,11 @@ import info.nightscout.database.impl.AppRepository
|
|||
import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction
|
||||
import info.nightscout.database.impl.transactions.VersionChangeTransaction
|
||||
import info.nightscout.implementation.db.CompatDBHelper
|
||||
import info.nightscout.implementation.plugin.PluginStore
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.ConfigBuilder
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.core.ui.locale.LocaleHelper
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationStore
|
||||
|
|
|
@ -16,13 +16,13 @@ import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
|
|||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
||||
import info.nightscout.rx.events.EventCustomCalculationFinished
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package info.nightscout.androidaps.activities
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.implementation.overview.OverviewDataImpl
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
|
|
|
@ -23,9 +23,8 @@ import info.nightscout.androidaps.danar.DanaRPlugin
|
|||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploaderPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.combov2.ComboV2Plugin
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin
|
||||
|
@ -33,6 +32,7 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.automation.AutomationPlugin
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
import info.nightscout.implementation.plugin.PluginStore
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
|
|
@ -5,9 +5,9 @@ import dagger.android.ContributesAndroidInjector
|
|||
import info.nightscout.androidaps.MainActivity
|
||||
import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
|
||||
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity
|
||||
import info.nightscout.ui.activities.SingleFragmentActivity
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -10,11 +10,11 @@ import info.nightscout.androidaps.MainApp
|
|||
import info.nightscout.androidaps.implementations.ActivityNamesImpl
|
||||
import info.nightscout.androidaps.implementations.ConfigImpl
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctionImpl
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefsImpl
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflowImpl
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.implementation.constraints.ConstraintsImpl
|
||||
import info.nightscout.interfaces.Config
|
||||
|
@ -36,6 +36,7 @@ import info.nightscout.interfaces.utils.HardLimits
|
|||
import info.nightscout.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.plugins.general.autotune.AutotunePlugin
|
||||
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
|
@ -98,7 +99,6 @@ open class AppModule {
|
|||
|
||||
@Binds fun bindContext(mainApp: MainApp): Context
|
||||
@Binds fun bindInjector(mainApp: MainApp): HasAndroidInjector
|
||||
@Binds fun bindActivePlugin(pluginStore: PluginStore): ActivePlugin
|
||||
@Binds fun bindConfigInterface(config: ConfigImpl): Config
|
||||
|
||||
@Binds fun bindConfigBuilderInterface(configBuilderPlugin: ConfigBuilderPlugin): ConfigBuilder
|
||||
|
@ -109,6 +109,7 @@ open class AppModule {
|
|||
@Binds fun bindSmsCommunicatorInterface(smsCommunicatorPlugin: SmsCommunicatorPlugin): SmsCommunicator
|
||||
@Binds fun bindDataSyncSelectorInterface(dataSyncSelectorImplementation: DataSyncSelectorImplementation): DataSyncSelector
|
||||
@Binds fun bindActivityNamesInterface(activityNames: ActivityNamesImpl): ActivityNames
|
||||
@Binds fun bindCalculationWorkflowInterface(calculationWorkflow: CalculationWorkflowImpl): CalculationWorkflow
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment
|
|||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearFragment
|
||||
import info.nightscout.plugins.general.wear.WearFragment
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -10,14 +10,11 @@ import info.nightscout.androidaps.danar.DanaRPlugin
|
|||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploaderPlugin
|
||||
import info.nightscout.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.plugins.general.dataBroadcaster.DataBroadcastPlugin
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin
|
||||
import info.nightscout.androidaps.plugins.general.persistentNotification.PersistentNotificationPlugin
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.combov2.ComboV2Plugin
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin
|
||||
|
@ -25,11 +22,9 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin
|
||||
import info.nightscout.automation.AutomationPlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
|
@ -42,6 +37,7 @@ import info.nightscout.plugins.constraints.storage.StorageConstraintPlugin
|
|||
import info.nightscout.plugins.constraints.versionChecker.VersionCheckerPlugin
|
||||
import info.nightscout.plugins.general.actions.ActionsPlugin
|
||||
import info.nightscout.plugins.general.autotune.AutotunePlugin
|
||||
import info.nightscout.plugins.general.dataBroadcaster.DataBroadcastPlugin
|
||||
import info.nightscout.plugins.general.food.FoodPlugin
|
||||
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin
|
||||
|
@ -50,6 +46,7 @@ import info.nightscout.plugins.insulin.InsulinLyumjevPlugin
|
|||
import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin
|
||||
import info.nightscout.plugins.insulin.InsulinOrefRapidActingPlugin
|
||||
import info.nightscout.plugins.insulin.InsulinOrefUltraRapidActingPlugin
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.AidexPlugin
|
||||
|
@ -66,6 +63,9 @@ import info.nightscout.plugins.source.XdripPlugin
|
|||
import info.nightscout.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.plugins.sync.tidepool.TidepoolPlugin
|
||||
import info.nightscout.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin
|
||||
import javax.inject.Qualifier
|
||||
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -3,7 +3,6 @@ package info.nightscout.androidaps.di
|
|||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
|
||||
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobile
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.automation.services.LocationService
|
||||
import info.nightscout.plugins.general.overview.notifications.DismissNotificationService
|
||||
|
@ -16,5 +15,4 @@ abstract class ServicesModule {
|
|||
@ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService
|
||||
@ContributesAndroidInjector abstract fun contributesDummyService(): DummyService
|
||||
@ContributesAndroidInjector abstract fun contributesLocationService(): LocationService
|
||||
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile
|
||||
}
|
|
@ -2,8 +2,19 @@ package info.nightscout.androidaps.di
|
|||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.*
|
||||
import info.nightscout.androidaps.workflow.*
|
||||
import info.nightscout.androidaps.workflow.InvokeLoopWorker
|
||||
import info.nightscout.androidaps.workflow.LoadBgDataWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareBasalDataWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareBgDataWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareBucketedDataWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareIobAutosensGraphDataWorker
|
||||
import info.nightscout.androidaps.workflow.PreparePredictionsWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareTemporaryTargetDataWorker
|
||||
import info.nightscout.androidaps.workflow.PrepareTreatmentsDataWorker
|
||||
import info.nightscout.androidaps.workflow.UpdateGraphWorker
|
||||
import info.nightscout.androidaps.workflow.UpdateIobCobSensWorker
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobOref1Worker
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobOrefWorker
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -9,11 +9,12 @@ import androidx.fragment.app.FragmentManager
|
|||
import info.nightscout.androidaps.MainActivity
|
||||
import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||
import info.nightscout.androidaps.activities.MyPreferenceFragment
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.interfaces.ui.ActivityNames
|
||||
import info.nightscout.ui.activities.BolusProgressHelperActivity
|
||||
import info.nightscout.ui.activities.ErrorHelperActivity
|
||||
import info.nightscout.ui.activities.SingleFragmentActivity
|
||||
import info.nightscout.ui.activities.TDDStatsActivity
|
||||
import info.nightscout.ui.dialogs.BolusProgressDialog
|
||||
import info.nightscout.ui.dialogs.CareDialog
|
||||
|
@ -34,6 +35,7 @@ class ActivityNamesImpl @Inject constructor() : ActivityNames {
|
|||
override val errorHelperActivity: Class<*> = ErrorHelperActivity::class.java
|
||||
override val bolusProgressHelperActivity: Class<*> = BolusProgressHelperActivity::class.java
|
||||
override val singleFragmentActivity: Class<*> = SingleFragmentActivity::class.java
|
||||
override val preferencesActivity: Class<*> = PreferencesActivity::class.java
|
||||
override val myPreferenceFragment: Class<*> = MyPreferenceFragment::class.java
|
||||
|
||||
override fun runAlarm(ctx: Context, status: String, title: String, @RawRes soundId: Int) {
|
||||
|
|
|
@ -17,7 +17,6 @@ import androidx.core.content.ContextCompat
|
|||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.databinding.ConfigbuilderFragmentBinding
|
||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
|
@ -32,6 +31,7 @@ import info.nightscout.rx.bus.RxBus
|
|||
import info.nightscout.rx.events.EventRebuildTabs
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.ui.activities.SingleFragmentActivity
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -3,16 +3,17 @@ package info.nightscout.androidaps.plugins.configBuilder
|
|||
import androidx.fragment.app.FragmentActivity
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.implementation.plugin.PluginStore
|
||||
import info.nightscout.interfaces.ConfigBuilder
|
||||
import info.nightscout.interfaces.aps.APS
|
||||
import info.nightscout.interfaces.aps.Sensitivity
|
||||
import info.nightscout.interfaces.insulin.Insulin
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginDescription
|
||||
|
|
|
@ -4,9 +4,9 @@ import info.nightscout.androidaps.extensions.fromConstant
|
|||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.profile.ProfileSealed
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.ProfileSwitch
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
|
|
|
@ -8,12 +8,10 @@ import android.view.ViewGroup
|
|||
import androidx.core.text.toSpanned
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.dana.database.DanaHistoryDatabase
|
||||
import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding
|
||||
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
|
||||
import info.nightscout.androidaps.insight.database.InsightDatabase
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase
|
||||
|
@ -24,6 +22,7 @@ import info.nightscout.database.entities.UserEntry.Action
|
|||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.maintenance.ImportExportPrefs
|
||||
import info.nightscout.interfaces.protection.ProtectionCheck
|
||||
import info.nightscout.interfaces.protection.ProtectionCheck.Protection.PREFERENCES
|
||||
|
@ -37,6 +36,7 @@ import info.nightscout.rx.logging.AAPSLogger
|
|||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.ui.activities.SingleFragmentActivity
|
||||
import io.reactivex.rxjava3.core.Completable
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
|
|
@ -13,7 +13,6 @@ import info.nightscout.androidaps.extensions.storeDouble
|
|||
import info.nightscout.androidaps.extensions.storeInt
|
||||
import info.nightscout.androidaps.extensions.storeString
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
|
@ -26,6 +25,7 @@ import info.nightscout.interfaces.plugin.PluginType
|
|||
import info.nightscout.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventDismissNotification
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||
|
|
@ -10,14 +10,17 @@ import androidx.work.WorkInfo
|
|||
import androidx.work.WorkManager
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Worker
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOrefWorker
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.workflow.CalculationWorkflow.Companion.JOB
|
||||
import info.nightscout.core.workflow.CalculationWorkflow.Companion.MAIN_CALCULATION
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobOref1Worker
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.IobCobOrefWorker
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
||||
|
@ -28,7 +31,6 @@ import info.nightscout.rx.events.EventPreferenceChange
|
|||
import info.nightscout.rx.events.EventTherapyEventChange
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
|
@ -37,7 +39,7 @@ import javax.inject.Inject
|
|||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class CalculationWorkflow @Inject constructor(
|
||||
class CalculationWorkflowImpl @Inject constructor(
|
||||
aapsSchedulers: AapsSchedulers,
|
||||
rh: ResourceHelper,
|
||||
rxBus: RxBus,
|
||||
|
@ -46,17 +48,9 @@ class CalculationWorkflow @Inject constructor(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val dateUtil: DateUtil,
|
||||
private val sensitivityOref1Plugin: SensitivityOref1Plugin,
|
||||
private val dataWorkerStorage: DataWorkerStorage,
|
||||
private val activePlugin: ActivePlugin
|
||||
) {
|
||||
|
||||
companion object {
|
||||
|
||||
const val MAIN_CALCULATION = "calculation"
|
||||
const val HISTORY_CALCULATION = "history_calculation"
|
||||
const val JOB = "job"
|
||||
}
|
||||
) : CalculationWorkflow {
|
||||
|
||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||
|
||||
|
@ -65,26 +59,10 @@ class CalculationWorkflow @Inject constructor(
|
|||
private val overviewData: OverviewData
|
||||
get() = (iobCobCalculator as IobCobCalculatorPlugin).overviewData
|
||||
|
||||
enum class ProgressData(private val pass: Int, val percentOfTotal: Int) {
|
||||
PREPARE_BASAL_DATA(0, 5),
|
||||
PREPARE_TEMPORARY_TARGET_DATA(1, 5),
|
||||
PREPARE_TREATMENTS_DATA(2, 5),
|
||||
IOB_COB_OREF(3, 74),
|
||||
PREPARE_IOB_AUTOSENS_DATA(4, 10),
|
||||
DRAW(5, 1);
|
||||
|
||||
fun finalPercent(progress: Int): Int {
|
||||
var total = 0
|
||||
for (i in values()) if (i.pass < pass) total += i.percentOfTotal
|
||||
total += (percentOfTotal.toDouble() * progress / 100.0).toInt()
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
// Verify definition
|
||||
var sumPercent = 0
|
||||
for (pass in ProgressData.values()) sumPercent += pass.percentOfTotal
|
||||
for (pass in CalculationWorkflow.ProgressData.values()) sumPercent += pass.percentOfTotal
|
||||
require(sumPercent == 100)
|
||||
|
||||
disposable += rxBus
|
||||
|
@ -131,7 +109,7 @@ class CalculationWorkflow @Inject constructor(
|
|||
|
||||
}
|
||||
|
||||
fun stopCalculation(job: String, from: String) {
|
||||
override fun stopCalculation(job: String, from: String) {
|
||||
aapsLogger.debug(LTag.AUTOSENS, "Stopping calculation thread: $from")
|
||||
WorkManager.getInstance(context).cancelUniqueWork(job)
|
||||
val workStatus = WorkManager.getInstance(context).getWorkInfosForUniqueWork(job).get()
|
||||
|
@ -140,7 +118,7 @@ class CalculationWorkflow @Inject constructor(
|
|||
aapsLogger.debug(LTag.AUTOSENS, "Calculation thread stopped: $from")
|
||||
}
|
||||
|
||||
fun runCalculation(
|
||||
override fun runCalculation(
|
||||
job: String,
|
||||
iobCobCalculator: IobCobCalculator,
|
||||
overviewData: OverviewData,
|
||||
|
@ -195,7 +173,7 @@ class CalculationWorkflow @Inject constructor(
|
|||
.build()
|
||||
)
|
||||
.then(
|
||||
if (sensitivityOref1Plugin.isEnabled())
|
||||
if (activePlugin.activeSensitivity.isOref1)
|
||||
OneTimeWorkRequest.Builder(IobCobOref1Worker::class.java)
|
||||
.setInputData(dataWorkerStorage.storeInputData(IobCobOref1Worker.IobCobOref1WorkerData(injector, iobCobCalculator, from, end, limitDataToOldestAvailable, cause)))
|
||||
.build()
|
|
@ -9,12 +9,13 @@ import androidx.work.workDataOf
|
|||
import com.jjoe64.graphview.series.LineGraphSeries
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.graph.data.ScaledDataPoint
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -12,7 +12,6 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.graph.data.DataPointWithLabelInterface
|
||||
import info.nightscout.core.graph.data.DeviationDataPoint
|
||||
|
@ -23,14 +22,16 @@ import info.nightscout.core.graph.data.ScaledDataPoint
|
|||
import info.nightscout.core.iob.combine
|
||||
import info.nightscout.core.iob.copy
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.AutosensResult
|
||||
import info.nightscout.interfaces.aps.SMBDefaults
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.iob.IobTotal
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
|
|
@ -9,14 +9,15 @@ import com.jjoe64.graphview.series.LineGraphSeries
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.extensions.target
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -5,7 +5,6 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.graph.data.BolusDataPoint
|
||||
import info.nightscout.core.graph.data.CarbsDataPoint
|
||||
|
@ -15,6 +14,7 @@ import info.nightscout.core.graph.data.ExtendedBolusDataPoint
|
|||
import info.nightscout.core.graph.data.PointsWithLabelGraphSeries
|
||||
import info.nightscout.core.graph.data.TherapyEventDataPoint
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
|
@ -25,6 +25,7 @@ import info.nightscout.interfaces.profile.DefaultValueHelper
|
|||
import info.nightscout.interfaces.profile.Profile
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.utils.Round
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
|
|
|
@ -6,7 +6,8 @@ import androidx.work.WorkerParameters
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
<string name="description_config_builder">Used for configuring the active plugins</string>
|
||||
<string name="description_overview">Displays the current state of your loop and buttons for most common actions</string>
|
||||
<string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string>
|
||||
<string name="description_wear">Monitor and control AAPS using your WearOS watch.</string>
|
||||
<string name="delta">Delta</string>
|
||||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="overview">Overview</string>
|
||||
|
@ -81,17 +80,12 @@
|
|||
<string name="low_mark">LOW mark</string>
|
||||
<string name="high_mark">HIGH mark</string>
|
||||
<string name="wear">Wear</string>
|
||||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
<string name="ongoingnotificaction">Ongoing Notification</string>
|
||||
<string name="old_data">OLD DATA</string>
|
||||
<string name="configbuilder_shortname">CONF</string>
|
||||
<string name="overview_shortname">HOME</string>
|
||||
<string name="treatments_shortname">TREAT</string>
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
<string name="short_tabtitles">Shorten tab titles</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="nosuccess">not successful - please check phone</string>
|
||||
<string name="restartingapp">Exiting application to apply settings.</string>
|
||||
<string name="enablesuperbolus">Enable superbolus in wizard</string>
|
||||
<string name="enablesuperbolus_summary">Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY!</string>
|
||||
|
@ -128,16 +122,12 @@
|
|||
<string name="activity_target">activity target</string>
|
||||
<string name="hypo_duration">hypo duration</string>
|
||||
<string name="hypo_target">hypo target</string>
|
||||
<string name="wearcontrol_title">Controls from Watch</string>
|
||||
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
|
||||
<string name="gradually_increase_notification_volume">Gradually increase the volume for alerts and notifications</string>
|
||||
<string name="localalertsettings_title">Local alerts</string>
|
||||
<string name="enable_missed_bg_readings_alert">Alert if no BG data is received</string>
|
||||
<string name="enable_pump_unreachable_alert">Alert if pump is unreachable</string>
|
||||
<string name="pump_unreachable_threshold">Pump unreachable threshold [min]</string>
|
||||
<string name="enable_carbs_req_alert">Alert if carbs are required</string>
|
||||
<string name="wear_detailed_delta_title">Show detailed delta</string>
|
||||
<string name="wear_detailed_delta_summary">Show delta with one more decimal place</string>
|
||||
<string name="overview_editquickwizard_usebg">BG calculation</string>
|
||||
<string name="overview_editquickwizard_usebolusiob">Bolus IOB calculation</string>
|
||||
<string name="overview_editquickwizard_usebasaliob">Basal IOB calculation</string>
|
||||
|
@ -160,10 +150,6 @@
|
|||
<string name="carb_increment_button_message">Number of carbs to add when button is pressed</string>
|
||||
<string name="insulin_increment_button_message">Amount of insulin to add when button is pressed</string>
|
||||
<string name="error_starting_cgm">Could not launch CGM application. Make sure it is installed.</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="wear_predictions_summary">Show the predictions on the watchface.</string>
|
||||
<string name="wear_predictions_title">Predictions</string>
|
||||
<string name="g5appnotdetected">Please update your Dexcom app to supported version</string>
|
||||
<string name="dexcom_app_not_installed">Dexcom app is not installed.</string>
|
||||
<string name="overview_show_activity">Activity</string>
|
||||
|
@ -174,7 +160,6 @@
|
|||
<string name="overview_show_iob">Insulin On Board</string>
|
||||
<string name="overview_show_basals">Basals</string>
|
||||
<string name="engineering_mode_enabled">Engineering mode enabled</string>
|
||||
<string name="iobcobcalculator" translatable="false">IobCobCalculator</string>
|
||||
<string name="overview_show_notes_field_in_dialogs_title">Show notes field in treatment dialogs</string>
|
||||
<string name="firstinsulinincrement">First insulin increment</string>
|
||||
<string name="secondinsulinincrement">Second insulin increment</string>
|
||||
|
@ -183,17 +168,8 @@
|
|||
<string name="secondcarbsincrement">Second carbs increment</string>
|
||||
<string name="thirdcarbsincrement">Third carbs increment</string>
|
||||
<string name="cgm">CGM</string>
|
||||
<string name="key_wearwizard_bg" translatable="false">wearwizard_bg</string>
|
||||
<string name="key_wearwizard_tt" translatable="false">wearwizard_tt</string>
|
||||
<string name="key_wearwizard_trend" translatable="false">wearwizard_trend</string>
|
||||
<string name="key_wearwizard_cob" translatable="false">wearwizard_cob</string>
|
||||
<string name="key_wearwizard_iob" translatable="false">wearwizard_iob</string>
|
||||
<string name="wear_wizard_settings_summary">Calculations included in the Wizard result:</string>
|
||||
<string name="wear_display_settings">Display Settings</string>
|
||||
<string name="wear_general_settings">General Settings</string>
|
||||
<string name="open_navigation">Open navigation</string>
|
||||
<string name="close_navigation">Close navigation</string>
|
||||
<string name="nav_plugin_preferences">Plugin preferences</string>
|
||||
<string name="key_keep_screen_on" translatable="false">keep_screen_on</string>
|
||||
<string name="remove_items">Remove items</string>
|
||||
<string name="sort_items">Sort items</string>
|
||||
|
@ -216,16 +192,12 @@
|
|||
<string name="miscellaneous">Miscellaneous</string>
|
||||
<string name="nav_logsettings">Log settings</string>
|
||||
<string name="resettodefaults">Reset to defaults</string>
|
||||
<string name="sendlogfiles">Send today\'s log files to developers along with this time. Unexpected situation.</string>
|
||||
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
|
||||
<string name="profile_total">== ∑ %1$s U</string>
|
||||
<string name="deliverpartofboluswizard">Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm.</string>
|
||||
<string name="unitsnosemicolon">Units</string>
|
||||
<string name="key_wear_detailediob" translatable="false">wear_detailediob</string>
|
||||
<string name="key_wear_showbgi" translatable="false">wear_showbgi</string>
|
||||
<string name="show_removed">Show removed</string>
|
||||
<string name="clearqueueconfirm">Clear queue? All data in queue will be lost!</string>
|
||||
<string name="key_wear_detailed_delta" translatable="false">wear_detailed_delta</string>
|
||||
<string name="chartmenu">Chart menu</string>
|
||||
<string name="overview_show_predictions">Predictions</string>
|
||||
<string name="overview_show_treatments">Treatments</string>
|
||||
|
@ -249,26 +221,13 @@
|
|||
<string name="a11y_dialog">dialog</string>
|
||||
<string name="not_available_full">Not available</string>
|
||||
<!-- WEAR OS-->
|
||||
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
|
||||
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_unit_error">Different units used on watch and phone!</string>
|
||||
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_min_bg_error">Min-BG out of range!</string>
|
||||
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
|
||||
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
|
||||
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
|
||||
<string name="wear_action_tempt_preset_message">Temptarget:\nReason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
|
||||
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
|
||||
<string name="wizard_result">Calc. Wizard:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
|
||||
<string name="overview_editquickwizard_show_on_device">Show entry on device:</string>
|
||||
<string name="quick_wizard_not_available">Selected quickwizard no longer available, please refresh your tile</string>
|
||||
<string name="wear_unknown_action_string">Unknown action command:</string>
|
||||
<string name="overview_editquickwizard_percentage">Percentage</string>
|
||||
<string name="app_default">Application default</string>
|
||||
<string name="remove_selected_items">Remove selected items</string>
|
||||
<string name="count_selected">%1$d selected</string>
|
||||
<string name="sort_label">Sort</string>
|
||||
<string name="loop_status">Loop status</string>
|
||||
<string name="graph_scale">Graph scale</string>
|
||||
<string name="a11y_open_settings">open settings</string>
|
||||
<string name="device_all">All</string>
|
||||
|
@ -279,7 +238,6 @@
|
|||
<string name="a11y_drag_and_drop_handle">drag and drop handle</string>
|
||||
<string name="search">Search</string>
|
||||
|
||||
<string name="no_watch_connected">(No Watch Connected)</string>
|
||||
<string name="database_cleanup">Database cleanup</string>
|
||||
<string name="cleanup_db_confirm">Do you want to cleanup the database?\nIt will remove tracked changes and historic data older than 3 months.</string>
|
||||
<string name="cleared_entries">Cleared entries</string>
|
||||
|
|
|
@ -32,6 +32,8 @@ class AbstractSensitivityPluginTest : TestBase() {
|
|||
get() = Sensitivity.SensitivityType.UNKNOWN
|
||||
|
||||
override fun maxAbsorptionHours(): Double = 8.0
|
||||
override val isMinCarbsAbsorptionDynamic: Boolean = true
|
||||
override val isOref1: Boolean = true
|
||||
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ buildscript {
|
|||
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||
classpath 'com.hiya:jacoco-android:0.2'
|
||||
classpath "com.vanniktech:gradle-dependency-graph-generator-plugin:0.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,12 +14,11 @@ apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
|||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':graphview')
|
||||
implementation project(':app-wear-shared:rx')
|
||||
implementation project(':app-wear-shared:shared')
|
||||
implementation project(':database:entities')
|
||||
implementation project(':database:impl')
|
||||
implementation project(':interfaces')
|
||||
implementation project(':core:graph')
|
||||
implementation project(':core:ui')
|
||||
implementation project(':core:utils')
|
||||
|
||||
|
|
|
@ -1,20 +1,8 @@
|
|||
package info.nightscout.core.pump
|
||||
|
||||
import com.google.gson.Gson
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction
|
||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||
|
||||
fun DetailedBolusInfo.insertCarbsTransaction(): InsertOrUpdateCarbsTransaction {
|
||||
if (carbs == 0.0) throw IllegalStateException("carbs == 0.0")
|
||||
return InsertOrUpdateCarbsTransaction(createCarbs()!!)
|
||||
}
|
||||
|
||||
fun DetailedBolusInfo.insertBolusTransaction(): InsertOrUpdateBolusTransaction {
|
||||
if (insulin == 0.0) throw IllegalStateException("insulin == 0.0")
|
||||
return InsertOrUpdateBolusTransaction(createBolus()!!)
|
||||
}
|
||||
|
||||
fun DetailedBolusInfo.toJsonString(): String = Gson().toJson(this)
|
||||
|
||||
// Cannot access Companion extension from java so create common
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.google.common.base.Joiner
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
||||
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.core.iob.round
|
||||
import info.nightscout.core.main.R
|
||||
|
@ -18,16 +17,16 @@ import info.nightscout.database.entities.TemporaryTarget
|
|||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction
|
||||
import info.nightscout.interfaces.BolusTimer
|
||||
import info.nightscout.interfaces.CarbTimer
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.interfaces.db.PersistenceLayer
|
||||
import info.nightscout.interfaces.iob.GlucoseStatus
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
@ -48,8 +47,6 @@ import info.nightscout.shared.interfaces.ResourceHelper
|
|||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import java.util.LinkedList
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.abs
|
||||
|
@ -76,10 +73,9 @@ class BolusWizard @Inject constructor(
|
|||
@Inject lateinit var carbTimer: CarbTimer
|
||||
@Inject lateinit var bolusTimer: BolusTimer
|
||||
@Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider
|
||||
@Inject lateinit var repository: AppRepository
|
||||
@Inject lateinit var activityNames: ActivityNames
|
||||
@Inject lateinit var persistenceLayer: PersistenceLayer
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
||||
var timeStamp : Long
|
||||
|
||||
|
@ -495,12 +491,7 @@ class BolusWizard @Inject constructor(
|
|||
}
|
||||
})
|
||||
}
|
||||
disposable += repository.runTransactionForResult(InsertOrUpdateBolusCalculatorResultTransaction(bolusCalculatorResult!!))
|
||||
.subscribe(
|
||||
{ result -> result.inserted.forEach { inserted -> aapsLogger.debug(LTag.DATABASE, "Inserted bolusCalculatorResult $inserted") } },
|
||||
{ aapsLogger.error(LTag.DATABASE, "Error while saving bolusCalculatorResult", it) }
|
||||
)
|
||||
|
||||
bolusCalculatorResult?.let { persistenceLayer.insertOrUpdate(it) }
|
||||
}
|
||||
if (useAlarm && carbs > 0 && carbTime > 0) {
|
||||
carbTimer.scheduleTimeToEatReminder(T.mins(carbTime.toLong()).secs().toInt())
|
||||
|
|
|
@ -7,10 +7,10 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv
|
|||
import info.nightscout.core.iob.round
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.utils.MidnightUtils
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.GlucoseValue
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.db.PersistenceLayer
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
@ -32,7 +32,7 @@ class QuickWizardEntry @Inject constructor(private val injector: HasAndroidInjec
|
|||
@Inject lateinit var profileFunction: ProfileFunction
|
||||
@Inject lateinit var loop: Loop
|
||||
@Inject lateinit var iobCobCalculator: IobCobCalculator
|
||||
@Inject lateinit var repository: AppRepository
|
||||
@Inject lateinit var persistenceLayer: PersistenceLayer
|
||||
@Inject lateinit var dateUtil: DateUtil
|
||||
@Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider
|
||||
|
||||
|
@ -109,7 +109,7 @@ class QuickWizardEntry @Inject constructor(private val injector: HasAndroidInjec
|
|||
fun isActive(): Boolean = time.secondsFromMidnight() >= validFrom() && time.secondsFromMidnight() <= validTo() && forDevice(DEVICE_PHONE)
|
||||
|
||||
fun doCalc(profile: Profile, profileName: String, lastBG: GlucoseValue, _synchronized: Boolean): BolusWizard {
|
||||
val dbRecord = repository.getTemporaryTargetActiveAt(dateUtil.now()).blockingGet()
|
||||
val dbRecord = persistenceLayer.getTemporaryTargetActiveAt(dateUtil.now()).blockingGet()
|
||||
val tempTarget = if (dbRecord is ValueWrapper.Existing) dbRecord.value else null
|
||||
//BG
|
||||
var bg = 0.0
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package info.nightscout.core.workflow
|
||||
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.rx.events.Event
|
||||
|
||||
interface CalculationWorkflow {
|
||||
companion object {
|
||||
|
||||
const val MAIN_CALCULATION = "calculation"
|
||||
const val HISTORY_CALCULATION = "history_calculation"
|
||||
const val JOB = "job"
|
||||
}
|
||||
|
||||
enum class ProgressData(private val pass: Int, val percentOfTotal: Int) {
|
||||
PREPARE_BASAL_DATA(0, 5),
|
||||
PREPARE_TEMPORARY_TARGET_DATA(1, 5),
|
||||
PREPARE_TREATMENTS_DATA(2, 5),
|
||||
IOB_COB_OREF(3, 74),
|
||||
PREPARE_IOB_AUTOSENS_DATA(4, 10),
|
||||
DRAW(5, 1);
|
||||
|
||||
fun finalPercent(progress: Int): Int {
|
||||
var total = 0
|
||||
for (i in values()) if (i.pass < pass) total += i.percentOfTotal
|
||||
total += (percentOfTotal.toDouble() * progress / 100.0).toInt()
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
fun stopCalculation(job: String, from: String)
|
||||
fun runCalculation(
|
||||
job: String,
|
||||
iobCobCalculator: IobCobCalculator,
|
||||
overviewData: OverviewData,
|
||||
from: String,
|
||||
end: Long,
|
||||
bgDataReload: Boolean,
|
||||
limitDataToOldestAvailable: Boolean,
|
||||
cause: Event?,
|
||||
runLoop: Boolean
|
||||
)
|
||||
}
|
|
@ -9,8 +9,11 @@ import android.graphics.PorterDuff;
|
|||
import android.graphics.Rect;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.BlendModeColorFilterCompat;
|
||||
import androidx.core.graphics.BlendModeCompat;
|
||||
|
||||
import com.jjoe64.graphview.GraphView;
|
||||
import com.jjoe64.graphview.series.BaseSeries;
|
||||
|
@ -95,6 +98,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
|||
* @param canvas canvas to draw on
|
||||
* @param isSecondScale whether it is the second scale
|
||||
*/
|
||||
@SuppressWarnings({"deprecation"})
|
||||
@Override
|
||||
public void draw(GraphView graphView, Canvas canvas, boolean isSecondScale) {
|
||||
// Convert the sp to pixels
|
||||
|
@ -246,7 +250,11 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
|||
} else if (value.getShape() == Shape.PROFILE) {
|
||||
Drawable drawable = ContextCompat.getDrawable(graphView.getContext(), R.drawable.ic_ribbon_profile);
|
||||
assert drawable != null;
|
||||
drawable.setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
drawable.setColorFilter (BlendModeColorFilterCompat.createBlendModeColorFilterCompat(Color.WHITE, BlendModeCompat.MULTIPLY));
|
||||
} else {
|
||||
drawable.setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
drawable.setBounds(
|
||||
(int) (endX - drawable.getIntrinsicWidth() / 2),
|
||||
(int) (endY - drawable.getIntrinsicHeight() / 2),
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
<string name="profile_set_ok">Basal profile in pump updated</string>
|
||||
<string name="invalid_input">Invalid input data</string>
|
||||
<string name="bolus_delivering">Delivering %1$.2f U</string>
|
||||
<string name="constraint_applied">Constraint applied!</string>
|
||||
<string name="tempbasals_iobtotal_label_string">Total IOB:</string>
|
||||
<string name="tt_label">TT</string>
|
||||
|
||||
<!-- Locale -->
|
||||
<string name="key_language" translatable="false">language</string>
|
||||
|
|
|
@ -103,4 +103,16 @@
|
|||
<string name="key_email_for_crash_report" translatable="false">email_for_crash_report</string>
|
||||
<string name="key_openapsama_autosens_period" translatable="false">openapsama_autosens_period</string>
|
||||
<string name="key_enable_fabric" translatable="false">enable_fabric2</string>
|
||||
<string name="key_high_temptarget_raises_sensitivity" translatable="false">high_temptarget_raises_sensitivity</string>
|
||||
<string name="key_low_temptarget_lowers_sensitivity" translatable="false">low_temptarget_lowers_sensitivity</string>
|
||||
<string name="key_openapsama_bolus_snooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
|
||||
<string name="key_wear_detailediob" translatable="false">wear_detailediob</string>
|
||||
<string name="key_wear_showbgi" translatable="false">wear_showbgi</string>
|
||||
<string name="key_wear_detailed_delta" translatable="false">wear_detailed_delta</string>
|
||||
<string name="key_wearwizard_bg" translatable="false">wearwizard_bg</string>
|
||||
<string name="key_wearwizard_tt" translatable="false">wearwizard_tt</string>
|
||||
<string name="key_wearwizard_trend" translatable="false">wearwizard_trend</string>
|
||||
<string name="key_wearwizard_cob" translatable="false">wearwizard_cob</string>
|
||||
<string name="key_wearwizard_iob" translatable="false">wearwizard_iob</string>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,6 @@
|
|||
package info.nightscout.database
|
||||
|
||||
sealed class ValueWrapper<T> {
|
||||
data class Existing<T>(val value: T) : ValueWrapper<T>()
|
||||
class Absent<T> : ValueWrapper<T>()
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.database.impl
|
||||
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.annotations.DbOpenForTesting
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.BolusCalculatorResult
|
||||
|
@ -949,7 +950,3 @@ inline fun <reified T : Any> Maybe<T>.toWrappedSingle(): Single<ValueWrapper<T>>
|
|||
.switchIfEmpty(Maybe.just(ValueWrapper.Absent()))
|
||||
.toSingle()
|
||||
|
||||
sealed class ValueWrapper<T> {
|
||||
data class Existing<T>(val value: T) : ValueWrapper<T>()
|
||||
class Absent<T> : ValueWrapper<T>()
|
||||
}
|
3
dependencyGraph.bat
Normal file
3
dependencyGraph.bat
Normal file
|
@ -0,0 +1,3 @@
|
|||
call gradlew generateProjectDependencyGraph
|
||||
build\reports\project-dependency-graph\project-dependency-graph.png
|
||||
call gradlew --stop
|
|
@ -1,17 +1,17 @@
|
|||
package info.nightscout.implementation
|
||||
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.implementation
|
||||
|
||||
import dagger.Reusable
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.database.entities.OfflineEvent
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
|
@ -10,9 +11,8 @@ import info.nightscout.database.entities.ValueWithUnit
|
|||
import info.nightscout.interfaces.Translator
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Reusable
|
||||
class TranslatorImpl @Inject internal constructor(
|
||||
private val rh: ResourceHelper
|
||||
) : Translator {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.implementation
|
||||
|
||||
import dagger.Reusable
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.database.entities.UserEntry
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
|
@ -16,10 +17,9 @@ import info.nightscout.shared.utils.DateUtil
|
|||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@OpenForTesting
|
||||
@Singleton
|
||||
@Reusable
|
||||
class UserEntryLoggerImpl @Inject constructor(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val repository: AppRepository,
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package info.nightscout.implementation.db
|
||||
|
||||
import dagger.Reusable
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.BolusCalculatorResult
|
||||
import info.nightscout.database.entities.Carbs
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction
|
||||
import info.nightscout.interfaces.db.PersistenceLayer
|
||||
import info.nightscout.interfaces.pump.PumpEnactResult
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
||||
@Reusable
|
||||
class PersistenceLayerImpl @Inject constructor(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val repository: AppRepository
|
||||
) : PersistenceLayer {
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
||||
override fun insertOrUpdate(bolusCalculatorResult: BolusCalculatorResult) {
|
||||
disposable += repository.runTransactionForResult(InsertOrUpdateBolusCalculatorResultTransaction(bolusCalculatorResult))
|
||||
.subscribe(
|
||||
{ result -> result.inserted.forEach { inserted -> aapsLogger.debug(LTag.DATABASE, "Inserted bolusCalculatorResult $inserted") } },
|
||||
{ aapsLogger.error(LTag.DATABASE, "Error while saving bolusCalculatorResult", it) }
|
||||
)
|
||||
}
|
||||
|
||||
override fun insertOrUpdateBolus(bolus: Bolus) {
|
||||
disposable += repository.runTransactionForResult(InsertOrUpdateBolusTransaction(bolus))
|
||||
.subscribe(
|
||||
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") } },
|
||||
{ aapsLogger.error(LTag.DATABASE, "Error while saving bolus", it) }
|
||||
)
|
||||
}
|
||||
|
||||
override fun insertOrUpdateCarbs(carbs: Carbs, callback: Callback?, injector: HasAndroidInjector?) {
|
||||
disposable += repository.runTransactionForResult(InsertOrUpdateCarbsTransaction(carbs))
|
||||
.subscribe(
|
||||
{ result ->
|
||||
result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") }
|
||||
injector?.let { injector ->
|
||||
callback?.result(PumpEnactResult(injector).enacted(false).success(true))?.run()
|
||||
}
|
||||
|
||||
}, {
|
||||
aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it)
|
||||
injector?.let { injector ->
|
||||
callback?.result(PumpEnactResult(injector).enacted(false).success(false))?.run()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun getTemporaryTargetActiveAt(timestamp: Long): Single<ValueWrapper<TemporaryTarget>> = repository.getTemporaryTargetActiveAt(timestamp)
|
||||
}
|
|
@ -1,17 +1,8 @@
|
|||
package info.nightscout.implementation.di
|
||||
|
||||
import android.content.Context
|
||||
import dagger.Binds
|
||||
import dagger.Lazy
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Reusable
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.utils.CryptoUtil
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.versionChecker.VersionCheckerUtils
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.implementation.AndroidPermissionImpl
|
||||
import info.nightscout.implementation.BolusTimerImpl
|
||||
import info.nightscout.implementation.CarbTimerImpl
|
||||
|
@ -23,9 +14,11 @@ import info.nightscout.implementation.TrendCalculatorImpl
|
|||
import info.nightscout.implementation.UserEntryLoggerImpl
|
||||
import info.nightscout.implementation.XDripBroadcastImpl
|
||||
import info.nightscout.implementation.androidNotification.NotificationHolderImpl
|
||||
import info.nightscout.implementation.db.PersistenceLayerImpl
|
||||
import info.nightscout.implementation.logging.LoggerUtilsImpl
|
||||
import info.nightscout.implementation.maintenance.PrefFileListProviderImpl
|
||||
import info.nightscout.implementation.overview.OverviewDataImpl
|
||||
import info.nightscout.implementation.plugin.PluginStore
|
||||
import info.nightscout.implementation.profiling.ProfilerImpl
|
||||
import info.nightscout.implementation.protection.PasswordCheckImpl
|
||||
import info.nightscout.implementation.protection.ProtectionCheckImpl
|
||||
|
@ -42,17 +35,16 @@ import info.nightscout.implementation.stats.TirCalculatorImpl
|
|||
import info.nightscout.interfaces.AndroidPermission
|
||||
import info.nightscout.interfaces.BolusTimer
|
||||
import info.nightscout.interfaces.CarbTimer
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.interfaces.Translator
|
||||
import info.nightscout.interfaces.XDripBroadcast
|
||||
import info.nightscout.interfaces.db.PersistenceLayer
|
||||
import info.nightscout.interfaces.logging.LoggerUtils
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.maintenance.PrefFileListProvider
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.profiling.Profiler
|
||||
import info.nightscout.interfaces.protection.PasswordCheck
|
||||
import info.nightscout.interfaces.protection.ProtectionCheck
|
||||
|
@ -64,17 +56,10 @@ import info.nightscout.interfaces.queue.CommandQueue
|
|||
import info.nightscout.interfaces.stats.DexcomTirCalculator
|
||||
import info.nightscout.interfaces.stats.TddCalculator
|
||||
import info.nightscout.interfaces.stats.TirCalculator
|
||||
import info.nightscout.interfaces.storage.Storage
|
||||
import info.nightscout.interfaces.ui.IconsProvider
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.interfaces.utils.TrendCalculator
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module(
|
||||
includes = [
|
||||
|
@ -85,87 +70,25 @@ import javax.inject.Singleton
|
|||
@Suppress("unused")
|
||||
open class ImplementationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideResources(context: Context, fabricPrivacy: FabricPrivacy): ResourceHelper =
|
||||
ResourceHelperImpl(context, fabricPrivacy)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideHardLimits(aapsLogger: AAPSLogger, rxBus: RxBus, sp: SP, rh: ResourceHelper, context: Context, repository: AppRepository): HardLimits =
|
||||
HardLimitsImpl(aapsLogger, rxBus, sp, rh, context, repository)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideWarnColors(rh: ResourceHelper): WarnColors = WarnColorsImpl(rh)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun provideProfiler(aapsLogger: AAPSLogger): Profiler = ProfilerImpl(aapsLogger)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideLoggerUtils(prefFileListProvider: PrefFileListProvider): LoggerUtils = LoggerUtilsImpl(prefFileListProvider)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun providePasswordCheck(sp: SP, cryptoUtil: CryptoUtil): PasswordCheck = PasswordCheckImpl(sp, cryptoUtil)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun provideProtectionCheck(sp: SP, passwordCheck: PasswordCheck, dateUtil: DateUtil): ProtectionCheck = ProtectionCheckImpl(sp, passwordCheck, dateUtil)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun provideDefaultValueHelper(sp: SP, profileFunction: ProfileFunction): DefaultValueHelper = DefaultValueHelperImpl(sp, profileFunction)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun provideTranslator(rh: ResourceHelper): Translator = TranslatorImpl(rh)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideTemporaryBasalStorage(aapsLogger: AAPSLogger): TemporaryBasalStorage = TemporaryBasalStorageImpl(aapsLogger)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideDetailedBolusInfoStorage(aapsLogger: AAPSLogger): DetailedBolusInfoStorage = DetailedBolusInfoStorageImpl(aapsLogger)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun provideUserEntryLogger(
|
||||
aapsLogger: AAPSLogger,
|
||||
repository: AppRepository,
|
||||
aapsSchedulers: AapsSchedulers,
|
||||
dateUtil: DateUtil
|
||||
): UserEntryLogger = UserEntryLoggerImpl(aapsLogger, repository, aapsSchedulers, dateUtil)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideOverviewData(
|
||||
aapsLogger: AAPSLogger,
|
||||
rh: ResourceHelper,
|
||||
dateUtil: DateUtil,
|
||||
sp: SP,
|
||||
activePlugin: ActivePlugin,
|
||||
defaultValueHelper: DefaultValueHelper,
|
||||
profileFunction: ProfileFunction,
|
||||
repository: AppRepository
|
||||
): OverviewData = OverviewDataImpl(aapsLogger, rh, dateUtil, sp, activePlugin, defaultValueHelper, profileFunction, repository)
|
||||
|
||||
@Provides
|
||||
@Reusable
|
||||
fun providePrefFileListProvider(
|
||||
rh: ResourceHelper,
|
||||
config: Lazy<Config>,
|
||||
encryptedPrefsFormat: EncryptedPrefsFormat,
|
||||
storage: Storage,
|
||||
versionCheckerUtils: VersionCheckerUtils,
|
||||
context: Context
|
||||
): PrefFileListProvider = PrefFileListProviderImpl(rh, config, encryptedPrefsFormat, storage, versionCheckerUtils, context)
|
||||
|
||||
@Module
|
||||
interface Bindings {
|
||||
@Binds fun bindPersistenceLayer(persistenceLayerImpl: PersistenceLayerImpl): PersistenceLayer
|
||||
@Binds fun bindActivePlugin(pluginStore: PluginStore): ActivePlugin
|
||||
@Binds fun bindPrefFileListProvider(prefFileListProviderImpl: PrefFileListProviderImpl): PrefFileListProvider
|
||||
@Binds fun bindOverviewData(overviewData: OverviewDataImpl): OverviewData
|
||||
@Binds fun bindUserEntryLogger(userEntryLoggerImpl: UserEntryLoggerImpl): UserEntryLogger
|
||||
@Binds fun bindDetailedBolusInfoStorage(detailedBolusInfoStorageImpl: DetailedBolusInfoStorageImpl): DetailedBolusInfoStorage
|
||||
@Binds fun bindTemporaryBasalStorage(temporaryBasalStorageImpl: TemporaryBasalStorageImpl): TemporaryBasalStorage
|
||||
@Binds fun bindTranslator(translatorImpl: TranslatorImpl): Translator
|
||||
@Binds fun bindDefaultValueHelper(defaultValueHelperImpl: DefaultValueHelperImpl): DefaultValueHelper
|
||||
@Binds fun bindProtectionCheck(protectionCheckImpl: ProtectionCheckImpl): ProtectionCheck
|
||||
@Binds fun bindPasswordCheck(passwordCheckImpl: PasswordCheckImpl): PasswordCheck
|
||||
@Binds fun bindLoggerUtils(loggerUtilsImpl: LoggerUtilsImpl): LoggerUtils
|
||||
@Binds fun bindProfiler(profilerImpl: ProfilerImpl): Profiler
|
||||
@Binds fun bindWarnColors(warnColorsImpl: WarnColorsImpl): WarnColors
|
||||
@Binds fun bindHardLimits(hardLimitsImpl: HardLimitsImpl): HardLimits
|
||||
@Binds fun bindResourceHelper(resourceHelperImpl: ResourceHelperImpl): ResourceHelper
|
||||
|
||||
@Binds fun bindTrendCalculatorInterface(trendCalculator: TrendCalculatorImpl): TrendCalculator
|
||||
@Binds fun bindTddCalculatorInterface(tddCalculator: TddCalculatorImpl): TddCalculator
|
||||
@Binds fun bindTirCalculatorInterface(tirCalculator: TirCalculatorImpl): TirCalculator
|
||||
|
|
|
@ -3,6 +3,7 @@ package info.nightscout.implementation.maintenance
|
|||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import dagger.Lazy
|
||||
import dagger.Reusable
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat
|
||||
import info.nightscout.core.main.R
|
||||
|
@ -24,12 +25,11 @@ import org.joda.time.LocalDateTime
|
|||
import org.joda.time.format.DateTimeFormat
|
||||
import java.io.File
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.math.abs
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@OpenForTesting
|
||||
@Singleton
|
||||
@Reusable
|
||||
class PrefFileListProviderImpl @Inject constructor(
|
||||
private val rh: ResourceHelper,
|
||||
private val config: Lazy<Config>,
|
||||
|
|
|
@ -21,10 +21,10 @@ import info.nightscout.core.graph.data.Scale
|
|||
import info.nightscout.core.graph.data.ScaledDataPoint
|
||||
import info.nightscout.core.iob.round
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.GlucoseValue
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.AutosensData
|
||||
import info.nightscout.interfaces.iob.CobInfo
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
package info.nightscout.implementation.plugin
|
||||
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.ConfigBuilder
|
||||
import info.nightscout.interfaces.Overview
|
||||
import info.nightscout.interfaces.aps.APS
|
||||
import info.nightscout.interfaces.aps.Sensitivity
|
||||
|
@ -57,7 +58,7 @@ class PluginStore @Inject constructor(
|
|||
override fun getSpecificPluginsListByInterface(interfaceClass: Class<*>): ArrayList<PluginBase> {
|
||||
val newList = ArrayList<PluginBase>()
|
||||
for (p in plugins) {
|
||||
if (p.javaClass != ConfigBuilderPlugin::class.java && interfaceClass.isAssignableFrom(p.javaClass)) newList.add(p)
|
||||
if (!interfaceClass.isAssignableFrom(ConfigBuilder::class.java) && interfaceClass.isAssignableFrom(p.javaClass)) newList.add(p)
|
||||
}
|
||||
return newList
|
||||
}
|
||||
|
@ -204,4 +205,4 @@ class PluginStore @Inject constructor(
|
|||
|
||||
override fun getPluginsList(): ArrayList<PluginBase> = ArrayList(plugins)
|
||||
|
||||
}
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.implementation.profiling
|
||||
|
||||
import dagger.Reusable
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.interfaces.profiling.Profiler
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@OpenForTesting
|
||||
@Singleton
|
||||
@Reusable
|
||||
class ProfilerImpl @Inject constructor(val aapsLogger: AAPSLogger) : Profiler {
|
||||
|
||||
override fun log(lTag: LTag, function: String, start: Long) {
|
||||
|
|
|
@ -12,15 +12,15 @@ import android.widget.EditText
|
|||
import android.widget.TextView
|
||||
import androidx.annotation.StringRes
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.Reusable
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.ui.toast.ToastUtils
|
||||
import info.nightscout.core.utils.CryptoUtil
|
||||
import info.nightscout.interfaces.protection.PasswordCheck
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Reusable
|
||||
class PasswordCheckImpl @Inject constructor(
|
||||
private val sp: SP,
|
||||
private val cryptoUtil: CryptoUtil
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.implementation.protection
|
||||
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import dagger.Reusable
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.protection.PasswordCheck
|
||||
import info.nightscout.interfaces.protection.ProtectionCheck
|
||||
|
@ -8,9 +9,8 @@ import info.nightscout.shared.sharedPreferences.SP
|
|||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Reusable
|
||||
class ProtectionCheckImpl @Inject constructor(
|
||||
private val sp: SP,
|
||||
private val passwordCheck: PasswordCheck,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.implementation.pump
|
||||
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.pump.fromDbPumpType
|
||||
import info.nightscout.core.pump.toDbPumpType
|
||||
import info.nightscout.core.pump.toDbSource
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.Carbs
|
||||
import info.nightscout.database.entities.ExtendedBolus
|
||||
|
@ -16,7 +16,6 @@ import info.nightscout.database.entities.UserEntry
|
|||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.database.entities.embedments.InterfaceIDs
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.impl.transactions.InsertBolusWithTempIdTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertIfNewByTimestampCarbsTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction
|
||||
|
@ -33,6 +32,7 @@ import info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransacti
|
|||
import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction
|
||||
import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction
|
||||
import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
|
|
|
@ -12,13 +12,12 @@ import info.nightscout.androidaps.annotations.OpenForTesting
|
|||
import info.nightscout.androidaps.extensions.getCustomizedName
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.profile.ProfileSealed
|
||||
import info.nightscout.core.pump.insertCarbsTransaction
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.EffectiveProfileSwitch
|
||||
import info.nightscout.database.entities.ProfileSwitch
|
||||
import info.nightscout.database.entities.interfaces.end
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.implementation.R
|
||||
import info.nightscout.implementation.queue.commands.CommandBolus
|
||||
import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus
|
||||
|
@ -41,6 +40,7 @@ import info.nightscout.interfaces.AndroidPermission
|
|||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.interfaces.db.PersistenceLayer
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
@ -68,7 +68,6 @@ import info.nightscout.shared.sharedPreferences.SP
|
|||
import info.nightscout.shared.utils.DateUtil
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import io.reactivex.rxjava3.kotlin.subscribeBy
|
||||
import java.util.LinkedList
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
@ -92,7 +91,8 @@ class CommandQueueImplementation @Inject constructor(
|
|||
private val repository: AppRepository,
|
||||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val androidPermission: AndroidPermission,
|
||||
private val activityNames: ActivityNames
|
||||
private val activityNames: ActivityNames,
|
||||
private val persistenceLayer: PersistenceLayer
|
||||
) : CommandQueue {
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
@ -230,7 +230,7 @@ class CommandQueueImplementation @Inject constructor(
|
|||
val tempCommandQueue = CommandQueueImplementation(
|
||||
injector, aapsLogger, rxBus, aapsSchedulers, rh,
|
||||
constraintChecker, profileFunction, activePlugin, context, sp,
|
||||
config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames
|
||||
config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames, persistenceLayer
|
||||
)
|
||||
tempCommandQueue.readStatus(reason, callback)
|
||||
tempCommandQueue.disposable.clear()
|
||||
|
@ -266,18 +266,7 @@ class CommandQueueImplementation @Inject constructor(
|
|||
carbsRunnable = Runnable {
|
||||
aapsLogger.debug(LTag.PUMPQUEUE, "Going to store carbs")
|
||||
detailedBolusInfo.carbs = originalCarbs
|
||||
disposable += repository.runTransactionForResult(detailedBolusInfo.insertCarbsTransaction())
|
||||
.subscribeBy(
|
||||
onSuccess = { result ->
|
||||
result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") }
|
||||
callback?.result(PumpEnactResult(injector).enacted(false).success(true))?.run()
|
||||
|
||||
},
|
||||
onError = {
|
||||
aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it)
|
||||
callback?.result(PumpEnactResult(injector).enacted(false).success(false))?.run()
|
||||
}
|
||||
)
|
||||
persistenceLayer.insertOrUpdateCarbs(detailedBolusInfo.createCarbs(), callback, injector)
|
||||
}
|
||||
// Do not process carbs anymore
|
||||
detailedBolusInfo.carbs = 0.0
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.implementation.queue.commands
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.implementation.R
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
|
|
|
@ -8,11 +8,11 @@ import android.view.ViewGroup
|
|||
import android.widget.TableLayout
|
||||
import android.widget.TableRow
|
||||
import android.widget.TextView
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.TotalDailyDose
|
||||
import info.nightscout.database.entities.embedments.InterfaceIDs
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.implementation.R
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
|
|
|
@ -8,9 +8,9 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.TestPumpPlugin
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.implementation.R
|
||||
import info.nightscout.implementation.queue.commands.CommandBolus
|
||||
import info.nightscout.implementation.queue.commands.CommandCustomCommand
|
||||
|
|
|
@ -100,4 +100,15 @@ object Constants {
|
|||
* so we add leeway to still accept given amount of older tokens
|
||||
*/
|
||||
const val OTP_ACCEPT_OLD_TOKENS_COUNT = 1
|
||||
|
||||
/**
|
||||
* Button increments
|
||||
*/
|
||||
const val INSULIN_PLUS1_DEFAULT = 0.5
|
||||
const val INSULIN_PLUS2_DEFAULT = 1.0
|
||||
const val INSULIN_PLUS3_DEFAULT = 2.0
|
||||
const val CARBS_FAV1_DEFAULT = 5
|
||||
const val CARBS_FAV2_DEFAULT = 10
|
||||
const val CARBS_FAV3_DEFAULT = 20
|
||||
|
||||
}
|
|
@ -21,6 +21,8 @@ interface Sensitivity : ConfigExportImport {
|
|||
fun detectSensitivity(ads: AutosensDataStore, fromTime: Long, toTime: Long): AutosensResult
|
||||
fun maxAbsorptionHours(): Double
|
||||
|
||||
val isMinCarbsAbsorptionDynamic: Boolean
|
||||
val isOref1: Boolean
|
||||
companion object {
|
||||
|
||||
const val MIN_HOURS = 1.0
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package info.nightscout.interfaces.db
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.BolusCalculatorResult
|
||||
import info.nightscout.database.entities.Carbs
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
|
||||
interface PersistenceLayer {
|
||||
|
||||
fun insertOrUpdate(bolusCalculatorResult: BolusCalculatorResult)
|
||||
fun insertOrUpdateCarbs(carbs: Carbs, callback: Callback? = null, injector: HasAndroidInjector? = null)
|
||||
fun insertOrUpdateBolus(bolus: Bolus)
|
||||
|
||||
fun getTemporaryTargetActiveAt(timestamp: Long): Single<ValueWrapper<TemporaryTarget>>
|
||||
}
|
|
@ -97,7 +97,7 @@ class DetailedBolusInfo {
|
|||
glucoseType = glucoseType?.toDbMeterType()
|
||||
)
|
||||
|
||||
fun createBolus(): Bolus? =
|
||||
fun createBolus(): Bolus =
|
||||
if (insulin != 0.0)
|
||||
Bolus(
|
||||
timestamp = bolusTimestamp ?: timestamp,
|
||||
|
@ -105,9 +105,9 @@ class DetailedBolusInfo {
|
|||
type = bolusType.toDBbBolusType(),
|
||||
notes = notes,
|
||||
)
|
||||
else null
|
||||
else throw IllegalStateException("insulin == 0.0")
|
||||
|
||||
fun createCarbs(): Carbs? =
|
||||
fun createCarbs(): Carbs =
|
||||
if (carbs != 0.0)
|
||||
Carbs(
|
||||
timestamp = carbsTimestamp ?: timestamp,
|
||||
|
@ -115,7 +115,7 @@ class DetailedBolusInfo {
|
|||
duration = carbsDuration,
|
||||
notes = notes,
|
||||
)
|
||||
else null
|
||||
else throw IllegalStateException("carbs == 0.0")
|
||||
|
||||
fun copy(): DetailedBolusInfo {
|
||||
val n = DetailedBolusInfo()
|
||||
|
|
|
@ -17,6 +17,7 @@ interface ActivityNames {
|
|||
val errorHelperActivity: Class<*>
|
||||
val bolusProgressHelperActivity: Class<*>
|
||||
val singleFragmentActivity: Class<*>
|
||||
val preferencesActivity: Class<*>
|
||||
val myPreferenceFragment: Class<*>
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,8 @@ import info.nightscout.androidaps.extensions.target
|
|||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.core.utils.MidnightUtils
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.APS
|
||||
import info.nightscout.interfaces.aps.AutosensResult
|
||||
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||
|
|
|
@ -8,8 +8,8 @@ import info.nightscout.androidaps.annotations.OpenForTesting
|
|||
import info.nightscout.androidaps.extensions.target
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.core.utils.MidnightUtils
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.APS
|
||||
import info.nightscout.interfaces.aps.AutosensResult
|
||||
import info.nightscout.interfaces.aps.DetermineBasalAdapter
|
||||
|
|
|
@ -20,13 +20,10 @@
|
|||
<string name="key_carbsReqThreshold" translatable="false">carbsReqThreshold</string>
|
||||
<string name="key_openapssmb_max_iob" translatable="false">openapsmb_max_iob</string>
|
||||
<string name="key_lgs_threshold" translatable="false">lgsThreshold</string>
|
||||
<string name="key_high_temptarget_raises_sensitivity" translatable="false">high_temptarget_raises_sensitivity</string>
|
||||
<string name="key_low_temptarget_lowers_sensitivity" translatable="false">low_temptarget_lowers_sensitivity</string>
|
||||
<string name="key_DynISFAdjust" translatable="false">DynISFAdjust</string>
|
||||
<string name="key_adjust_sensitivity" translatable="false">dynisf_adjust_sensitivity</string>
|
||||
<string name="key_openapsma_max_basal" translatable="false">openapsma_max_basal</string>
|
||||
<string name="key_openapsama_use_autosens" translatable="false">openapsama_useautosens</string>
|
||||
<string name="key_openapsama_bolus_snooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
|
||||
|
||||
<string name="dynisf_adjust_sensitivity">Adjust sensitivity and BG</string>
|
||||
<string name="DynISFAdjust_title" formatted="false">DynamicISF Adjustment Factor %</string>
|
||||
|
|
|
@ -3,13 +3,13 @@ package info.nightscout.automation.triggers
|
|||
import android.widget.LinearLayout
|
||||
import com.google.common.base.Optional
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.automation.R
|
||||
import info.nightscout.automation.elements.Comparator
|
||||
import info.nightscout.automation.elements.InputDuration
|
||||
import info.nightscout.automation.elements.LabelWithElement
|
||||
import info.nightscout.automation.elements.LayoutBuilder
|
||||
import info.nightscout.automation.elements.StaticLabel
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.interfaces.utils.JsonHelper.safeGetString
|
||||
|
|
|
@ -3,14 +3,13 @@ package info.nightscout.automation.triggers
|
|||
import android.widget.LinearLayout
|
||||
import com.google.common.base.Optional
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.automation.R
|
||||
import info.nightscout.automation.elements.ComparatorExists
|
||||
import info.nightscout.automation.elements.LayoutBuilder
|
||||
import info.nightscout.automation.elements.StaticLabel
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
||||
import org.json.JSONObject
|
||||
|
||||
class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import info.nightscout.automation.elements.InputBg
|
|||
import info.nightscout.automation.elements.LabelWithElement
|
||||
import info.nightscout.automation.elements.LayoutBuilder
|
||||
import info.nightscout.automation.elements.StaticLabel
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.GlucoseUnit
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.automation.triggers
|
||||
|
||||
import com.google.common.base.Optional
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.automation.elements.Comparator
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import org.json.JSONException
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.automation.triggers
|
||||
|
||||
import com.google.common.base.Optional
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.automation.R
|
||||
import info.nightscout.automation.elements.Comparator
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.interfaces.GlucoseUnit
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
|
|
|
@ -59,4 +59,7 @@ dependencies {
|
|||
// Food
|
||||
api "androidx.work:work-runtime:$work_version"
|
||||
api "androidx.work:work-runtime-ktx:$work_version"
|
||||
|
||||
// DataLayerListenerService
|
||||
api "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
|
||||
}
|
|
@ -26,6 +26,31 @@
|
|||
android:name=".sync.nsclient.services.NSClientService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<service
|
||||
android:name=".general.wear.wearintegration.DataLayerListenerServiceMobile"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" />
|
||||
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" />
|
||||
<data
|
||||
android:host="*"
|
||||
android:scheme="wear" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<!-- listeners receive events that match the action and data filters -->
|
||||
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:pathPrefix="@string/path_rx_bridge"
|
||||
android:scheme="wear" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -16,16 +16,15 @@ import info.nightscout.androidaps.annotations.OpenForTesting
|
|||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||
import info.nightscout.androidaps.extensions.convertedToPercent
|
||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.ReceiverStatusStore
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.OfflineEvent
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction
|
||||
import info.nightscout.interfaces.Config
|
||||
|
@ -36,6 +35,7 @@ import info.nightscout.interfaces.aps.Loop.LastRun
|
|||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
|
|
|
@ -15,7 +15,8 @@ import dagger.Module
|
|||
SkinsModule::class,
|
||||
SkinsUiModule::class,
|
||||
LoopModule::class,
|
||||
ActionsModule::class
|
||||
ActionsModule::class,
|
||||
WearModule::class
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.general.wear.wearintegration.DataLayerListenerServiceMobile
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class WearModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile
|
||||
}
|
|
@ -12,18 +12,18 @@ import androidx.core.content.ContextCompat
|
|||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.extensions.toStringMedium
|
||||
import info.nightscout.androidaps.extensions.toStringShort
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.core.ui.UIRunnable
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
import info.nightscout.core.ui.elements.SingleClickButton
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.aps.Loop
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.protection.ProtectionCheck
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.general.wear
|
||||
package info.nightscout.plugins.general.wear
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.databinding.WearFragmentBinding
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.plugins.databinding.WearFragmentBinding
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
|
@ -1,15 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.general.wear
|
||||
package info.nightscout.plugins.general.wear
|
||||
|
||||
import android.content.Context
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataHandlerMobile
|
||||
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginDescription
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.aps.loop.events.EventLoopUpdateGui
|
||||
import info.nightscout.plugins.general.wear.wearintegration.DataHandlerMobile
|
||||
import info.nightscout.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
||||
|
@ -37,7 +37,7 @@ class WearPlugin @Inject constructor(
|
|||
private val rxBus: RxBus,
|
||||
private val context: Context,
|
||||
private val dataHandlerMobile: DataHandlerMobile,
|
||||
val dataLayerListenerServiceMobileHelper: DataLayerListenerServiceMobileHelper
|
||||
private val dataLayerListenerServiceMobileHelper: DataLayerListenerServiceMobileHelper
|
||||
|
||||
) : PluginBase(
|
||||
PluginDescription()
|
||||
|
@ -65,7 +65,7 @@ class WearPlugin @Inject constructor(
|
|||
event.resultSuccess?.let {
|
||||
val status =
|
||||
if (it) rh.gs(R.string.success)
|
||||
else rh.gs(R.string.nosuccess)
|
||||
else rh.gs(R.string.no_success)
|
||||
if (isEnabled()) rxBus.send(EventMobileToWear(EventData.BolusProgress(percent = 100, status = status)))
|
||||
}
|
||||
}, fabricPrivacy::logException)
|
|
@ -1,14 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.general.wear.wearintegration
|
||||
package info.nightscout.plugins.general.wear.wearintegration
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||
import info.nightscout.androidaps.extensions.toStringShort
|
||||
import info.nightscout.androidaps.extensions.valueToUnits
|
||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.core.graph.data.GlucoseValueDataPoint
|
||||
|
@ -20,6 +18,7 @@ import info.nightscout.core.utils.receivers.ReceiverStatusStore
|
|||
import info.nightscout.core.wizard.BolusWizard
|
||||
import info.nightscout.core.wizard.QuickWizard
|
||||
import info.nightscout.core.wizard.QuickWizardEntry
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.GlucoseValue
|
||||
import info.nightscout.database.entities.TemporaryBasal
|
||||
|
@ -29,7 +28,6 @@ import info.nightscout.database.entities.UserEntry
|
|||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.database.entities.interfaces.end
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
||||
import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction
|
||||
import info.nightscout.interfaces.Config
|
||||
|
@ -39,6 +37,7 @@ import info.nightscout.interfaces.aps.Loop
|
|||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
||||
|
@ -50,6 +49,7 @@ import info.nightscout.interfaces.queue.CommandQueue
|
|||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.interfaces.utils.TrendCalculator
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
|
@ -61,8 +61,6 @@ import info.nightscout.shared.interfaces.ResourceHelper
|
|||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.ui.dialogs.CarbsDialog
|
||||
import info.nightscout.ui.dialogs.InsulinDialog
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import java.text.DateFormat
|
||||
|
@ -149,7 +147,7 @@ class DataHandlerMobile @Inject constructor(
|
|||
rxBus.send(
|
||||
EventMobileToWear(
|
||||
EventData.ConfirmAction(
|
||||
rh.gs(R.string.medtronic_pump_status).uppercase(),
|
||||
rh.gs(R.string.pump_status).uppercase(),
|
||||
activePlugin.activePump.shortStatus(false),
|
||||
returnCommand = null
|
||||
)
|
||||
|
@ -730,10 +728,10 @@ class DataHandlerMobile @Inject constructor(
|
|||
bolusPercentage = sp.getInt(R.string.key_boluswizard_percentage, 100),
|
||||
maxCarbs = sp.getInt(R.string.key_treatmentssafety_maxcarbs, 48),
|
||||
maxBolus = sp.getDouble(R.string.key_treatmentssafety_maxbolus, 3.0),
|
||||
insulinButtonIncrement1 = sp.getDouble(R.string.key_insulin_button_increment_1, InsulinDialog.PLUS1_DEFAULT),
|
||||
insulinButtonIncrement2 = sp.getDouble(R.string.key_insulin_button_increment_2, InsulinDialog.PLUS2_DEFAULT),
|
||||
carbsButtonIncrement1 = sp.getInt(R.string.key_carbs_button_increment_1, CarbsDialog.FAV1_DEFAULT),
|
||||
carbsButtonIncrement2 = sp.getInt(R.string.key_carbs_button_increment_2, CarbsDialog.FAV2_DEFAULT)
|
||||
insulinButtonIncrement1 = sp.getDouble(R.string.key_insulin_button_increment_1, Constants.INSULIN_PLUS1_DEFAULT),
|
||||
insulinButtonIncrement2 = sp.getDouble(R.string.key_insulin_button_increment_2, Constants.INSULIN_PLUS2_DEFAULT),
|
||||
carbsButtonIncrement1 = sp.getInt(R.string.key_carbs_button_increment_1, Constants.CARBS_FAV1_DEFAULT),
|
||||
carbsButtonIncrement2 = sp.getInt(R.string.key_carbs_button_increment_2, Constants.CARBS_FAV2_DEFAULT)
|
||||
)
|
||||
)
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.wear.wearintegration
|
||||
package info.nightscout.plugins.general.wear.wearintegration
|
||||
|
||||
import android.os.Binder
|
||||
import android.os.Handler
|
||||
|
@ -15,8 +15,6 @@ import com.google.android.gms.wearable.PutDataMapRequest
|
|||
import com.google.android.gms.wearable.Wearable
|
||||
import com.google.android.gms.wearable.WearableListenerService
|
||||
import dagger.android.AndroidInjection
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.ReceiverStatusStore
|
||||
|
@ -27,6 +25,8 @@ import info.nightscout.interfaces.iob.IobCobCalculator
|
|||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventMobileToWear
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.wear.wearintegration
|
||||
package info.nightscout.plugins.general.wear.wearintegration
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||
package info.nightscout.plugins.iob.iobCobCalculator
|
||||
|
||||
import info.nightscout.database.entities.Carbs
|
||||
import info.nightscout.interfaces.Constants
|
|
@ -1,13 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||
package info.nightscout.plugins.iob.iobCobCalculator
|
||||
|
||||
import androidx.collection.LongSparseArray
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||
import info.nightscout.androidaps.extensions.iobCalc
|
||||
import info.nightscout.androidaps.extensions.toTemporaryBasal
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStoreObject
|
||||
import info.nightscout.core.graph.OverviewData
|
||||
import info.nightscout.core.iob.combine
|
||||
import info.nightscout.core.iob.copy
|
||||
|
@ -15,12 +14,13 @@ import info.nightscout.core.iob.determineBasalJson
|
|||
import info.nightscout.core.iob.plus
|
||||
import info.nightscout.core.iob.round
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.ExtendedBolus
|
||||
import info.nightscout.database.entities.TemporaryBasal
|
||||
import info.nightscout.database.entities.interfaces.end
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.aps.AutosensData
|
||||
import info.nightscout.interfaces.aps.AutosensDataStore
|
||||
|
@ -38,6 +38,7 @@ import info.nightscout.interfaces.profile.Profile
|
|||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.interfaces.utils.MidnightTime
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
||||
|
@ -82,7 +83,7 @@ class IobCobCalculatorPlugin @Inject constructor(
|
|||
) : PluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.GENERAL)
|
||||
.pluginName(R.string.iobcobcalculator)
|
||||
.pluginName(R.string.iob_cob_calculator)
|
||||
.showInList(false)
|
||||
.neverVisible(true)
|
||||
.alwaysEnabled(true),
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||
package info.nightscout.plugins.iob.iobCobCalculator
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
|
@ -6,16 +6,14 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.extensions.target
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.aps.AutosensData
|
||||
|
@ -26,13 +24,13 @@ import info.nightscout.interfaces.plugin.ActivePlugin
|
|||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.profiling.Profiler
|
||||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
||||
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
|
@ -56,8 +54,6 @@ class IobCobOref1Worker(
|
|||
@Inject lateinit var rh: ResourceHelper
|
||||
@Inject lateinit var profileFunction: ProfileFunction
|
||||
@Inject lateinit var context: Context
|
||||
@Inject lateinit var sensitivityAAPSPlugin: SensitivityAAPSPlugin
|
||||
@Inject lateinit var sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin
|
||||
@Inject lateinit var activePlugin: ActivePlugin
|
||||
@Inject lateinit var config: Config
|
||||
@Inject lateinit var profiler: Profiler
|
||||
|
@ -167,7 +163,7 @@ class IobCobOref1Worker(
|
|||
aapsLogger.debug(LTag.AUTOSENS, {autosensDataTable.toString()})
|
||||
aapsLogger.debug(LTag.AUTOSENS, {bucketedData.toString()})
|
||||
//aapsLogger.debug(LTag.AUTOSENS, iobCobCalculatorPlugin.getBgReadingsDataTable().toString())
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.sendlogfiles), Notification.LOW)
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.send_logfiles), Notification.LOW)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
sp.putBoolean("log_AUTOSENS", true)
|
||||
break
|
||||
|
@ -190,7 +186,7 @@ class IobCobOref1Worker(
|
|||
aapsLogger.debug(autosensDataTable.toString())
|
||||
aapsLogger.debug(bucketedData.toString())
|
||||
//aapsLogger.debug(iobCobCalculatorPlugin.getBgReadingsDataTable().toString())
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.sendlogfiles), Notification.LOW)
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.send_logfiles), Notification.LOW)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
sp.putBoolean("log_AUTOSENS", true)
|
||||
break
|
||||
|
@ -202,7 +198,7 @@ class IobCobOref1Worker(
|
|||
val recentCarbTreatments = repository.getCarbsDataFromTimeToTimeExpanded(bgTime - T.mins(5).msecs(), bgTime, true).blockingGet()
|
||||
for (recentCarbTreatment in recentCarbTreatments) {
|
||||
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||
val isAAPSOrWeighted = activePlugin.activeSensitivity.isMinCarbsAbsorptionDynamic
|
||||
autosensData.activeCarbsList.add(fromCarbs(recentCarbTreatment, isAAPSOrWeighted, profileFunction, aapsLogger, dateUtil, sp))
|
||||
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
||||
}
|
||||
|
@ -227,7 +223,7 @@ class IobCobOref1Worker(
|
|||
autosensData.type = previous.type
|
||||
autosensData.uam = previous.uam
|
||||
}
|
||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||
val isAAPSOrWeighted = activePlugin.activeSensitivity.isMinCarbsAbsorptionDynamic
|
||||
autosensData.removeOldCarbs(bgTime, isAAPSOrWeighted)
|
||||
autosensData.cob += autosensData.carbsFromBolus
|
||||
autosensData.mealCarbs += autosensData.carbsFromBolus
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
|
||||
package info.nightscout.plugins.iob.iobCobCalculator
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
|
@ -6,13 +6,11 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
|
@ -24,13 +22,13 @@ import info.nightscout.interfaces.plugin.ActivePlugin
|
|||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.profiling.Profiler
|
||||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
||||
import info.nightscout.rx.events.EventAutosensCalculationFinished
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
|
@ -52,8 +50,6 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
@Inject lateinit var rh: ResourceHelper
|
||||
@Inject lateinit var profileFunction: ProfileFunction
|
||||
@Inject lateinit var context: Context
|
||||
@Inject lateinit var sensitivityAAPSPlugin: SensitivityAAPSPlugin
|
||||
@Inject lateinit var sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin
|
||||
@Inject lateinit var activePlugin: ActivePlugin
|
||||
@Inject lateinit var config: Config
|
||||
@Inject lateinit var profiler: Profiler
|
||||
|
@ -162,7 +158,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
aapsLogger.debug(LTag.AUTOSENS, autosensDataTable.toString())
|
||||
aapsLogger.debug(LTag.AUTOSENS, bucketedData.toString())
|
||||
//aapsLogger.debug(LTag.AUTOSENS, data.iobCobCalculatorPlugin.getBgReadingsDataTable().toString())
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.sendlogfiles), Notification.LOW)
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.send_logfiles), Notification.LOW)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
sp.putBoolean("log_AUTOSENS", true)
|
||||
break
|
||||
|
@ -185,7 +181,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
aapsLogger.debug(autosensDataTable.toString())
|
||||
aapsLogger.debug(bucketedData.toString())
|
||||
//aapsLogger.debug(data.iobCobCalculatorPlugin.getBgReadingsDataTable().toString())
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.sendlogfiles), Notification.LOW)
|
||||
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.send_logfiles), Notification.LOW)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
sp.putBoolean("log_AUTOSENS", true)
|
||||
break
|
||||
|
@ -197,7 +193,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
val recentCarbTreatments = repository.getCarbsDataFromTimeToTimeExpanded(bgTime - T.mins(5).msecs(), bgTime, true).blockingGet()
|
||||
for (recentCarbTreatment in recentCarbTreatments) {
|
||||
autosensData.carbsFromBolus += recentCarbTreatment.amount
|
||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||
val isAAPSOrWeighted = activePlugin.activeSensitivity.isMinCarbsAbsorptionDynamic
|
||||
autosensData.activeCarbsList.add(fromCarbs(recentCarbTreatment, isAAPSOrWeighted, profileFunction, aapsLogger, dateUtil, sp))
|
||||
autosensData.pastSensitivity += "[" + DecimalFormatter.to0Decimal(recentCarbTreatment.amount) + "g]"
|
||||
}
|
||||
|
@ -206,7 +202,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
if (previous != null && previous.cob > 0) {
|
||||
// calculate sum of min carb impact from all active treatments
|
||||
var totalMinCarbsImpact = 0.0
|
||||
if (sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()) {
|
||||
if (activePlugin.activeSensitivity.isMinCarbsAbsorptionDynamic) {
|
||||
//when the impact depends on a max time, sum them up as smaller carb sizes make them smaller
|
||||
for (ii in autosensData.activeCarbsList.indices) {
|
||||
val c = autosensData.activeCarbsList[ii]
|
||||
|
@ -227,7 +223,7 @@ class IobCobOrefWorker @Inject internal constructor(
|
|||
autosensData.deductAbsorbedCarbs()
|
||||
autosensData.usedMinCarbsImpact = totalMinCarbsImpact
|
||||
}
|
||||
val isAAPSOrWeighted = sensitivityAAPSPlugin.isEnabled() || sensitivityWeightedAveragePlugin.isEnabled()
|
||||
val isAAPSOrWeighted = activePlugin.activeSensitivity.isMinCarbsAbsorptionDynamic
|
||||
autosensData.removeOldCarbs(bgTime, isAAPSOrWeighted)
|
||||
autosensData.cob += autosensData.carbsFromBolus
|
||||
autosensData.deviation = deviation
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.iob.iobCobCalculator.events
|
||||
package info.nightscout.plugins.iob.iobCobCalculator.events
|
||||
|
||||
import info.nightscout.androidaps.workflow.CalculationWorkflow
|
||||
import info.nightscout.core.workflow.CalculationWorkflow
|
||||
import info.nightscout.rx.events.Event
|
||||
|
||||
class EventIobCalculationProgress(val pass: CalculationWorkflow.ProgressData, val progressPct: Int, val cause: Event?) : Event()
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.plugins.sync.nsclient
|
||||
|
||||
import info.nightscout.androidaps.extensions.toJson
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.Bolus
|
||||
import info.nightscout.database.entities.BolusCalculatorResult
|
||||
import info.nightscout.database.entities.Carbs
|
||||
|
@ -15,7 +16,6 @@ import info.nightscout.database.entities.TemporaryBasal
|
|||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.interfaces.sync.DataSyncSelector
|
||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.plugins.ui
|
|||
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.database.ValueWrapper
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.pump.WarnColors
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="2dp"
|
||||
tools:context=".plugins.general.wear.WearFragment">
|
||||
tools:context="info.nightscout.plugins.general.wear.WearFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/connected_device"
|
|
@ -585,4 +585,42 @@
|
|||
<string name="data_broadcaster" translatable="false">Data Broadcaster</string>
|
||||
<string name="cannula_usage">usage:</string>
|
||||
|
||||
<!-- Iob-->
|
||||
<string name="send_logfiles">Send today\'s log files to developers along with this time. Unexpected situation.</string>
|
||||
<string name="iob_cob_calculator" translatable="false">IobCobCalculator</string>
|
||||
|
||||
<!-- Wear-->
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
<string name="description_wear">Monitor and control AAPS using your WearOS watch.</string>
|
||||
<string name="no_watch_connected">(No Watch Connected)</string>
|
||||
<string name="pump_status">Pump status</string>
|
||||
<string name="loop_status">Loop status</string>
|
||||
<string name="wizard_result">Calc. Wizard:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
|
||||
<string name="quick_wizard_not_available">Selected quickwizard no longer available, please refresh your tile</string>
|
||||
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
|
||||
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
|
||||
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_unit_error">Different units used on watch and phone!</string>
|
||||
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_min_bg_error">Min-BG out of range!</string>
|
||||
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
|
||||
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
|
||||
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
|
||||
<string name="wear_action_tempt_preset_message">Temptarget:\nReason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
|
||||
<string name="no_success">not successful - please check phone</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="wearcontrol_title">Controls from Watch</string>
|
||||
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
|
||||
<string name="wear_wizard_settings_summary">Calculations included in the Wizard result:</string>
|
||||
<string name="wear_display_settings">Display Settings</string>
|
||||
<string name="wear_general_settings">General Settings</string>
|
||||
<string name="wear_detailed_delta_title">Show detailed delta</string>
|
||||
<string name="wear_detailed_delta_summary">Show delta with one more decimal place</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="wear_predictions_summary">Show the predictions on the watchface.</string>
|
||||
<string name="wear_predictions_title">Predictions</string>
|
||||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
android:defaultValue="false"
|
||||
android:dependency="@string/key_wearwizard_bg"
|
||||
android:key="@string/key_wearwizard_tt"
|
||||
android:title="@string/treatments_wizard_tt_label" />
|
||||
android:title="@string/tt_label" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
|
@ -140,6 +140,8 @@ class SensitivityAAPSPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
override fun maxAbsorptionHours(): Double = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)
|
||||
override val isMinCarbsAbsorptionDynamic: Boolean = true
|
||||
override val isOref1: Boolean = false
|
||||
|
||||
override val id: SensitivityType
|
||||
get() = SensitivityType.SENSITIVITY_AAPS
|
||||
|
|
|
@ -205,6 +205,8 @@ class SensitivityOref1Plugin @Inject constructor(
|
|||
}
|
||||
|
||||
override fun maxAbsorptionHours(): Double = sp.getDouble(R.string.key_absorption_cutoff, Constants.DEFAULT_MAX_ABSORPTION_TIME)
|
||||
override val isMinCarbsAbsorptionDynamic: Boolean = false
|
||||
override val isOref1: Boolean = true
|
||||
|
||||
override fun configuration(): JSONObject {
|
||||
val c = JSONObject()
|
||||
|
|
|
@ -160,6 +160,8 @@ class SensitivityWeightedAveragePlugin @Inject constructor(
|
|||
}
|
||||
|
||||
override fun maxAbsorptionHours(): Double = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)
|
||||
override val isMinCarbsAbsorptionDynamic: Boolean = true
|
||||
override val isOref1: Boolean = false
|
||||
|
||||
override val id: SensitivityType
|
||||
get() = SensitivityType.SENSITIVITY_WEIGHTED
|
||||
|
|
|
@ -7,8 +7,8 @@ import info.nightscout.androidaps.plugins.pump.eopatch.event.EventDialog
|
|||
import info.nightscout.androidaps.plugins.pump.eopatch.event.EventProgressDialog
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.AlarmDialog
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ProgressDialogHelper
|
||||
import info.nightscout.core.ui.R
|
||||
import info.nightscout.core.ui.activities.DialogAppCompatActivity
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui
|
|||
|
||||
import android.os.Bundle
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ActivationNotCompleteDialog
|
||||
import info.nightscout.core.ui.R
|
||||
import info.nightscout.core.ui.activities.DialogAppCompatActivity
|
||||
import info.nightscout.core.main.R
|
||||
|
||||
class DialogHelperActivity : DialogAppCompatActivity() {
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ import androidx.databinding.ViewDataBinding
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.dagger.EopatchPluginQualifier
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.ui.R
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.ViewGroup
|
|||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmProcess
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmProcess
|
||||
|
@ -19,10 +18,11 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager
|
|||
import info.nightscout.androidaps.plugins.pump.eopatch.databinding.DialogAlarmBinding
|
||||
import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.core.ui.R
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.Disposable
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
@ -44,11 +44,15 @@
|
|||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name="info.nightscout.ui.activities.TreatmentsActivity"
|
||||
android:name=".activities.TreatmentsActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name="info.nightscout.ui.activities.ProfileHelperActivity"
|
||||
android:name=".activities.ProfileHelperActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activities.SingleFragmentActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue