From 8e8fbf1b6f8a923eae67487d2070e3fa3e7437c7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 23 Nov 2022 15:32:06 +0100 Subject: [PATCH] UserEntryLogger interface --- .../nightscout/androidaps/MainActivity.kt | 2 +- .../info/nightscout/androidaps/MainApp.kt | 2 +- .../configBuilder/ConfigBuilderPlugin.kt | 2 +- .../maintenance/ImportExportPrefsImpl.kt | 2 +- .../maintenance/MaintenanceFragment.kt | 2 +- .../general/overview/OverviewFragment.kt | 2 +- .../wear/wearintegration/DataHandlerMobile.kt | 2 +- .../plugins/aps/loop/LoopPluginTest.kt | 4 +- .../configBuilder/ConfigBuilderPluginTest.kt | 2 +- .../nightscout/core/wizard/BolusWizard.kt | 2 +- .../core-main/src/main/res/values/strings.xml | 4 - .../src/main/res/drawable/ic_eopatch2_128.xml | 0 .../src/main/res/raw/error.mp3 | Bin core/ui/src/main/res/values/strings.xml | 6 + .../impl/transactions/UserEntryTransaction.kt | 25 +- .../implementation/LocalAlertUtilsImpl.kt | 2 +- .../implementation/UserEntryLoggerImpl.kt | 34 ++- .../implementation/di/ImplementationModule.kt | 12 + .../pump/PumpSyncImplementation.kt | 2 +- .../interfaces/logging/UserEntryLogger.kt | 19 ++ .../general/autotune/AutotuneFragment.kt | 2 +- .../general/autotune/AutotunePlugin.kt | 2 +- .../automation/AutomationFragment.kt | 2 +- .../actions/ActionCarePortalEvent.kt | 2 +- .../automation/actions/ActionLoopDisable.kt | 2 +- .../automation/actions/ActionLoopEnable.kt | 2 +- .../automation/actions/ActionLoopResume.kt | 2 +- .../automation/actions/ActionLoopSuspend.kt | 2 +- .../automation/actions/ActionProfileSwitch.kt | 2 +- .../actions/ActionProfileSwitchPercent.kt | 2 +- .../actions/ActionStartTempTarget.kt | 2 +- .../actions/ActionStopTempTarget.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 2 +- .../nightscout/plugins/aps/loop/LoopPlugin.kt | 2 +- .../objectives/ObjectivesFragment.kt | 2 +- .../general/actions/ActionsFragment.kt | 2 +- .../plugins/general/food/FoodFragment.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 2 +- .../activities/SmsCommunicatorOtpActivity.kt | 2 +- .../plugins/profile/ProfileFragment.kt | 2 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 2 +- .../plugins/source/BGSourceFragment.kt | 2 +- .../nightscout/plugins/source/DexcomPlugin.kt | 2 +- .../plugins/source/GlunovoPlugin.kt | 2 +- .../plugins/source/IntelligoPlugin.kt | 2 +- .../plugins/sync/nsShared/NSClientFragment.kt | 2 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 235 +++++++++++------- .../sync/nsclient/data/NSSettingsStatus.kt | 2 +- .../workers/NSClientAddUpdateWorker.kt | 2 +- .../workers/ProcessTreatmentsWorker.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 2 +- .../plugins/pump/combo/ComboPlugin.java | 2 +- .../plugins/pump/combov2/ComboV2Plugin.kt | 2 +- .../androidaps/dana/DanaFragment.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 2 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 4 +- .../androidaps/danar/AbstractDanaRPlugin.java | 2 +- .../androidaps/danar/DanaRPlugin.java | 2 +- .../androidaps/danar/comm/MsgBolusProgress.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 4 +- .../danars/activities/EnterPinActivity.kt | 2 +- .../DanaRSPacketNotifyDeliveryComplete.kt | 2 +- .../DanaRSPacketNotifyDeliveryRateDisplay.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 2 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 12 +- .../ble/task/InternalSuspendedTask.java | 2 +- .../pump/eopatch/ble/task/PauseBasalTask.java | 2 +- .../pump/eopatch/ble/task/StopBasalTask.java | 2 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 2 +- .../plugins/pump/common/PumpPluginAbstract.kt | 2 +- .../ui/activities/ProfileHelperActivity.kt | 2 +- .../nightscout/ui/activities/StatsActivity.kt | 2 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 2 +- .../fragments/TreatmentsCareportalFragment.kt | 2 +- .../TreatmentsExtendedBolusesFragment.kt | 2 +- .../TreatmentsProfileSwitchFragment.kt | 2 +- .../fragments/TreatmentsTempTargetFragment.kt | 2 +- .../TreatmentsTemporaryBasalsFragment.kt | 2 +- .../fragments/TreatmentsUserEntryFragment.kt | 2 +- .../nightscout/ui/alertDialogs/ErrorDialog.kt | 2 +- .../ui/dialogs/BolusProgressDialog.kt | 2 +- .../ui/dialogs/CalibrationDialog.kt | 2 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 2 +- .../info/nightscout/ui/dialogs/CareDialog.kt | 2 +- .../ui/dialogs/ExtendedBolusDialog.kt | 2 +- .../info/nightscout/ui/dialogs/FillDialog.kt | 2 +- .../nightscout/ui/dialogs/InsulinDialog.kt | 2 +- .../info/nightscout/ui/dialogs/LoopDialog.kt | 2 +- .../ui/dialogs/ProfileSwitchDialog.kt | 2 +- .../nightscout/ui/dialogs/TempBasalDialog.kt | 2 +- .../nightscout/ui/dialogs/TempTargetDialog.kt | 2 +- .../nightscout/ui/dialogs/TreatmentDialog.kt | 2 +- 92 files changed, 294 insertions(+), 223 deletions(-) rename core/{core-main => ui}/src/main/res/drawable/ic_eopatch2_128.xml (100%) rename core/{core-main => ui}/src/main/res/raw/error.mp3 (100%) rename core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt => implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt (54%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index c6078960d6..8828960e34 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -34,7 +34,7 @@ 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.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.configuration.setupwizard.SetupWizardActivity import info.nightscout.core.activities.NoSplashAppCompatActivity import info.nightscout.core.ui.UIRunnable diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index be48c4de42..ef521207aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -16,7 +16,7 @@ import androidx.work.WorkManager import dagger.android.AndroidInjector import dagger.android.DaggerApplication import info.nightscout.androidaps.di.DaggerAppComponent -import info.nightscout.androidaps.logging.UserEntryLogger +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index e7a6d7f68c..55dadc5d02 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.configBuilder import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.logging.UserEntryLogger +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index d65e5461e6..87098a7c01 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.core.activities.DaggerAppCompatActivityWithResult diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index 789f09977c..bfdf2f50c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -13,7 +13,7 @@ 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.androidaps.logging.UserEntryLogger +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index f93dd77f88..a96889c0f6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -30,7 +30,7 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt index e032a75121..05a9dd88ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -8,7 +8,7 @@ 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.androidaps.logging.UserEntryLogger +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 diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt index 2b7e7264af..774bfcb7b9 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt @@ -6,7 +6,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.receivers.ReceiverStatusStore import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.impl.AppRepository @@ -49,7 +49,7 @@ class LoopPluginTest : TestBase() { @Mock lateinit var receiverStatusStore: ReceiverStatusStore @Mock lateinit var notificationManager: NotificationManager @Mock lateinit var repository: AppRepository - @Mock lateinit var uel:UserEntryLogger + @Mock lateinit var uel: UserEntryLogger @Mock lateinit var dateUtil: DateUtil @Mock lateinit var runningConfiguration: RunningConfiguration @Mock lateinit var config: Config diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt index d5339c308f..1786668af9 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.configBuilder import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus diff --git a/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt b/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt index eddf0817e5..b6fa428626 100644 --- a/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt +++ b/core/core-main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt @@ -6,7 +6,7 @@ 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.androidaps.logging.UserEntryLogger +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 diff --git a/core/core-main/src/main/res/values/strings.xml b/core/core-main/src/main/res/values/strings.xml index d9f68367b1..98ff64a64e 100644 --- a/core/core-main/src/main/res/values/strings.xml +++ b/core/core-main/src/main/res/values/strings.xml @@ -2,16 +2,12 @@ Refresh - Error Save Not set Failed to update basal profile - Basal profile in pump updated - Invalid input data Tempbasal delivery error Going to deliver %1$.2f U Waiting for pump - Delivering %1$.2f U Connecting Disconnected AAPS started diff --git a/core/core-main/src/main/res/drawable/ic_eopatch2_128.xml b/core/ui/src/main/res/drawable/ic_eopatch2_128.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_eopatch2_128.xml rename to core/ui/src/main/res/drawable/ic_eopatch2_128.xml diff --git a/core/core-main/src/main/res/raw/error.mp3 b/core/ui/src/main/res/raw/error.mp3 similarity index 100% rename from core/core-main/src/main/res/raw/error.mp3 rename to core/ui/src/main/res/raw/error.mp3 diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 5d9c45ec21..2869bdac52 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -1,5 +1,11 @@ + + Error + Basal profile in pump updated + Invalid input data + Delivering %1$.2f U + Confirmation Message diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt index 72e52ab313..34468cbc66 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt @@ -1,32 +1,13 @@ package info.nightscout.database.impl.transactions import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit -class UserEntryTransaction(private val entries: List) : Transaction>() { +class UserEntryTransaction(private val entries: List) : Transaction>() { - data class Entry( - val timestamp: Long, - val action: Action, - val source: Sources, - val note: String, - val values: List = listOf() - ) - - override fun run(): List { + override fun run(): List { for (entry in entries) - database.userEntryDao.insert( - UserEntry( - timestamp = entry.timestamp, - action = entry.action, - source = entry.source, - note = entry.note, - values = entry.values - ) - ) + database.userEntryDao.insert(entry) return entries } } \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index 3bc8c08171..9ab577fdee 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -1,6 +1,6 @@ package info.nightscout.implementation -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.events.EventNewNotification import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt similarity index 54% rename from core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt rename to implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt index 5d785ba9b9..3b0990909f 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt +++ b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt @@ -1,11 +1,13 @@ -package info.nightscout.androidaps.logging +package info.nightscout.implementation import info.nightscout.androidaps.annotations.OpenForTesting +import info.nightscout.database.entities.UserEntry 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.UserEntryTransaction +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.interfaces.userEntry.UserEntryMapper import info.nightscout.interfaces.userEntry.ValueWithUnitMapper import info.nightscout.rx.AapsSchedulers @@ -18,25 +20,35 @@ import javax.inject.Singleton @OpenForTesting @Singleton -class UserEntryLogger @Inject constructor( +class UserEntryLoggerImpl @Inject constructor( private val aapsLogger: AAPSLogger, private val repository: AppRepository, private val aapsSchedulers: AapsSchedulers, private val dateUtil: DateUtil -) { +) : UserEntryLogger { private val compositeDisposable = CompositeDisposable() - fun log(action: Action, source: Sources, note: String? = "", vararg listValues: ValueWithUnit?) = log(action, source, note, listValues.toList()) + override fun log(action: Action, source: Sources, note: String?, vararg listValues: ValueWithUnit?) = log(action, source, note, listValues.toList()) - fun log(action: Action, source: Sources, vararg listValues: ValueWithUnit?) = log(action, source, "", listValues.toList()) + override fun log(action: Action, source: Sources, vararg listValues: ValueWithUnit?) = log(action, source, "", listValues.toList()) - fun log(action: Action, source: Sources, note: String? = "", listValues: List = listOf()) { + override fun log(action: Action, source: Sources, note: String?, listValues: List) { val filteredValues = listValues.toList().filterNotNull() - log(listOf(UserEntryTransaction.Entry(dateUtil.now(), action, source, note ?: "", filteredValues))) + log( + listOf( + UserEntry( + timestamp = dateUtil.now(), + action = action, + source = source, + note = note ?: "", + values = filteredValues + ) + ) + ) } - fun log(entries: List) { + override fun log(entries: List) { compositeDisposable += repository.runTransactionForResult(UserEntryTransaction(entries)) .subscribeOn(aapsSchedulers.io) .observeOn(aapsSchedulers.io) @@ -46,12 +58,12 @@ class UserEntryLogger @Inject constructor( ) } - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", vararg listValues: ValueWithUnitMapper?) = + override fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String?, vararg listValues: ValueWithUnitMapper?) = log(action.db, source.db, note, listValues.toList().map { it?.db() }) - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, vararg listValues: ValueWithUnitMapper?) = log(action.db, source.db, "", listValues.toList().map { it?.db() }) + override fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, vararg listValues: ValueWithUnitMapper?) = log(action.db, source.db, "", listValues.toList().map { it?.db() }) - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", listValues: List = listOf()) = + override fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String?, listValues: List) = log(action.db, source.db, note, listValues.map { it?.db() }) } \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt index bd8f3b707a..fb1b540c39 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt +++ b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt @@ -19,6 +19,7 @@ import info.nightscout.implementation.HardLimitsImpl import info.nightscout.implementation.LocalAlertUtilsImpl import info.nightscout.implementation.TranslatorImpl 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.logging.LoggerUtilsImpl @@ -44,6 +45,7 @@ import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.Translator import info.nightscout.interfaces.XDripBroadcast 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 @@ -61,6 +63,7 @@ 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 @@ -115,6 +118,15 @@ open class ImplementationModule { @Singleton fun provideTranslator(rh: ResourceHelper): Translator = TranslatorImpl(rh) + @Provides + @Singleton + fun provideUserEntryLogger( + aapsLogger: AAPSLogger, + repository: AppRepository, + aapsSchedulers: AapsSchedulers, + dateUtil: DateUtil + ): UserEntryLogger = UserEntryLoggerImpl(aapsLogger, repository, aapsSchedulers, dateUtil) + @Provides @Singleton fun provideOverviewData( diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 05d11ba51e..3c25cd2c24 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,6 +1,6 @@ package info.nightscout.implementation.pump -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.events.EventNewNotification import info.nightscout.core.main.R import info.nightscout.core.pump.fromDbPumpType diff --git a/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt b/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt new file mode 100644 index 0000000000..dd425e5dac --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt @@ -0,0 +1,19 @@ +package info.nightscout.interfaces.logging + +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.userEntry.UserEntryMapper +import info.nightscout.interfaces.userEntry.ValueWithUnitMapper + +interface UserEntryLogger { + + fun log(action: Action, source: Sources, note: String? = "", vararg listValues: ValueWithUnit?) + fun log(action: Action, source: Sources, vararg listValues: ValueWithUnit?) + fun log(action: Action, source: Sources, note: String? = "", listValues: List = listOf()) + fun log(entries: List) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", vararg listValues: ValueWithUnitMapper?) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, vararg listValues: ValueWithUnitMapper?) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", listValues: List = listOf()) +} \ No newline at end of file diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 29610d8e61..930fa4a179 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -19,7 +19,7 @@ import android.widget.TableRow import android.widget.TextView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.core.ui.dialogs.OKDialog diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 9c110525b6..cdd63c04f4 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -3,7 +3,7 @@ package info.nightscout.plugins.general.autotune import android.view.View import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.pureProfileFromJson -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.UserEntry diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index 2c35a55da0..5e5f05a236 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -23,7 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.databinding.AutomationEventItemBinding import info.nightscout.automation.databinding.AutomationFragmentBinding import info.nightscout.automation.dialogs.EditEventDialog diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt index 20b16b67d3..20627842e8 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.automation.R import info.nightscout.automation.elements.InputCarePortalMenu diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index c42e145d94..337fb1584a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index cbbf8191d8..38875e35d4 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index 1382a24473..521320d893 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt index fffbb9ec22..859a98b715 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.LabelWithElement diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt index fbac6a8c50..aae8b43030 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName import info.nightscout.automation.elements.LabelWithElement diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt index c70a48405b..6ebbc6f4aa 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDuration diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index 4bcd81898d..3435fda965 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.friendlyDescription -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists import info.nightscout.automation.elements.InputDuration diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt index 7674c730ef..9822cf569b 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.actions import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index e6a32c4a29..41778314f1 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -5,7 +5,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.ConfigBuilder diff --git a/plugins/main/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt index f87aaa5233..86c9b77692 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt @@ -16,7 +16,7 @@ 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.androidaps.logging.UserEntryLogger +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 diff --git a/plugins/main/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt index 7fbd80264d..ffe4597bdb 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt @@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSmoothScroller import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.receivers.ReceiverStatusStore import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt index adcd6cc455..a10ba59a73 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt @@ -12,7 +12,7 @@ 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.androidaps.logging.UserEntryLogger +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 diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt index 92adc4991b..d5536d5dfe 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt @@ -12,7 +12,7 @@ import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.UIRunnable import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 5a6467d5b0..01345bd659 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -13,7 +13,7 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.valueToUnitsString -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.core.events.EventNewNotification diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index dc0cdb6913..af62faf178 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -12,7 +12,7 @@ import android.view.View import android.view.WindowManager import com.google.common.primitives.Ints.min import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.activities.NoSplashAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index 80decac09d..769c08a595 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -10,7 +10,7 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/plugins/main/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index a9552fb2ff..3f19bf33cd 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -187,7 +187,7 @@ open class VirtualPumpPlugin @Inject constructor( var delivering = 0.0 while (delivering < detailedBolusInfo.insulin) { SystemClock.sleep(200) - bolusingEvent.status = rh.gs(R.string.bolusdelivering, delivering) + bolusingEvent.status = rh.gs(R.string.bolus_delivering, delivering) bolusingEvent.percent = min((delivering / detailedBolusInfo.insulin * 100).toInt(), 100) rxBus.send(bolusingEvent) delivering += 0.1 diff --git a/plugins/main/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index 826d056c8d..bfb0e50e2a 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/plugins/main/src/main/java/info/nightscout/plugins/source/DexcomPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/source/DexcomPlugin.kt index 3f7df60dc7..055cc6d914 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/source/DexcomPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/source/DexcomPlugin.kt @@ -9,7 +9,7 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent diff --git a/plugins/main/src/main/java/info/nightscout/plugins/source/GlunovoPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/source/GlunovoPlugin.kt index 9e64dd30a2..c955c992b9 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/source/GlunovoPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/source/GlunovoPlugin.kt @@ -5,7 +5,7 @@ import android.net.Uri import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent diff --git a/plugins/main/src/main/java/info/nightscout/plugins/source/IntelligoPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/source/IntelligoPlugin.kt index 075fbd7a20..5b87bf14ae 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/source/IntelligoPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/source/IntelligoPlugin.kt @@ -7,7 +7,7 @@ import android.os.Handler import android.os.HandlerThread import android.util.Log import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent diff --git a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 1c80fcafe4..c4aaaf9ebf 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -13,7 +13,7 @@ import android.widget.ScrollView import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry diff --git a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt index 8d2370158e..bcf70e2841 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt @@ -5,7 +5,6 @@ import android.os.SystemClock import androidx.work.Worker import androidx.work.WorkerParameters import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.core.events.EventNewNotification import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult @@ -32,10 +31,10 @@ import info.nightscout.database.impl.transactions.SyncNsProfileSwitchTransaction import info.nightscout.database.impl.transactions.SyncNsTemporaryBasalTransaction import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction -import info.nightscout.database.impl.transactions.UserEntryTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.XDripBroadcast +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.sync.NsClient @@ -90,7 +89,7 @@ class StoreDataForDb @Inject constructor( val profileSwitches: MutableList = mutableListOf() val offlineEvents: MutableList = mutableListOf() - private val userEntries: MutableList = mutableListOf() + private val userEntries: MutableList = mutableListOf() private val inserted = HashMap() private val updated = HashMap() @@ -171,10 +170,12 @@ class StoreDataForDb @Inject constructor( boluses.clear() result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.BOLUS, UserEntry.Sources.NSClient, it.notes ?: "", - listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.BOLUS, + source = UserEntry.Sources.NSClient, + note = it.notes ?: "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) ) ) aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") @@ -182,10 +183,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.BOLUS_REMOVED, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.BOLUS_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) ) ) aapsLogger.debug(LTag.DATABASE, "Invalidated bolus $it") @@ -214,10 +217,12 @@ class StoreDataForDb @Inject constructor( carbs.clear() result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "", - listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CARBS, + source = UserEntry.Sources.NSClient, + note = it.notes ?: "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) ) ) aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") @@ -225,10 +230,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CARBS_REMOVED, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CARBS_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) ) ) aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it") @@ -236,10 +243,12 @@ class StoreDataForDb @Inject constructor( } result.updated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "", - listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CARBS, + source = UserEntry.Sources.NSClient, + note = it.notes ?: "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) ) ) aapsLogger.debug(LTag.DATABASE, "Updated carbs $it") @@ -265,10 +274,12 @@ class StoreDataForDb @Inject constructor( temporaryTargets.clear() result.inserted.forEach { tt -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.TT, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.TT, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.TherapyEventTTReason(tt.reason), ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL), ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget }, @@ -281,10 +292,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { tt -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.TT_REMOVED, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.TT_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.TherapyEventTTReason(tt.reason), ValueWithUnit.Mgdl(tt.lowTarget), ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, @@ -297,10 +310,12 @@ class StoreDataForDb @Inject constructor( } result.ended.forEach { tt -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CANCEL_TT, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CANCEL_TT, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.TherapyEventTTReason(tt.reason), ValueWithUnit.Mgdl(tt.lowTarget), ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, @@ -334,10 +349,12 @@ class StoreDataForDb @Inject constructor( temporaryBasals.clear() result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.TEMP_BASAL, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.TEMP_BASAL, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) @@ -349,10 +366,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.TEMP_BASAL_REMOVED, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.TEMP_BASAL_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) @@ -364,10 +383,12 @@ class StoreDataForDb @Inject constructor( } result.ended.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CANCEL_TEMP_BASAL, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CANCEL_TEMP_BASAL, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) @@ -400,10 +421,12 @@ class StoreDataForDb @Inject constructor( effectiveProfileSwitches.clear() result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.PROFILE_SWITCH, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp)) ) ) aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it") @@ -411,10 +434,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.PROFILE_SWITCH_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp)) ) ) aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it") @@ -439,10 +464,12 @@ class StoreDataForDb @Inject constructor( profileSwitches.clear() result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.PROFILE_SWITCH, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp)) ) ) aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it") @@ -450,10 +477,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "", - listOf(ValueWithUnit.Timestamp(it.timestamp)) + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.PROFILE_SWITCH_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf(ValueWithUnit.Timestamp(it.timestamp)) ) ) aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it") @@ -518,10 +547,12 @@ class StoreDataForDb @Inject constructor( else -> UserEntry.Action.CAREPORTAL } if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - action, UserEntry.Sources.NSClient, therapyEvent.note ?: "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = action, + source = UserEntry.Sources.NSClient, + note = therapyEvent.note ?: "", + values = listOf( ValueWithUnit.Timestamp(therapyEvent.timestamp), ValueWithUnit.TherapyEventType(therapyEvent.type), ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) @@ -532,10 +563,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { therapyEvent -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CAREPORTAL_REMOVED, UserEntry.Sources.NSClient, therapyEvent.note ?: "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CAREPORTAL_REMOVED, + source = UserEntry.Sources.NSClient, + note = therapyEvent.note ?: "", + values = listOf( ValueWithUnit.Timestamp(therapyEvent.timestamp), ValueWithUnit.TherapyEventType(therapyEvent.type), ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) @@ -566,10 +599,12 @@ class StoreDataForDb @Inject constructor( .also { result -> result.inserted.forEach { oe -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.LOOP_CHANGE, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.OfflineEventReason(oe.reason), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) ) @@ -580,10 +615,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { oe -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.LOOP_REMOVED, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.LOOP_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.OfflineEventReason(oe.reason), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) ) @@ -594,10 +631,12 @@ class StoreDataForDb @Inject constructor( } result.ended.forEach { oe -> if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.LOOP_CHANGE, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.OfflineEventReason(oe.reason), ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) ) @@ -628,10 +667,12 @@ class StoreDataForDb @Inject constructor( .also { result -> result.inserted.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.EXTENDED_BOLUS, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.EXTENDED_BOLUS, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount), ValueWithUnit.UnitPerHour(it.rate), @@ -645,10 +686,12 @@ class StoreDataForDb @Inject constructor( } result.invalidated.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.EXTENDED_BOLUS_REMOVED, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.EXTENDED_BOLUS_REMOVED, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount), ValueWithUnit.UnitPerHour(it.rate), @@ -661,10 +704,12 @@ class StoreDataForDb @Inject constructor( } result.ended.forEach { if (config.NSCLIENT.not()) userEntries.add( - UserEntryTransaction.Entry( - dateUtil.now(), - UserEntry.Action.CANCEL_EXTENDED_BOLUS, UserEntry.Sources.NSClient, "", - listOf( + UserEntry( + timestamp = dateUtil.now(), + action = UserEntry.Action.CANCEL_EXTENDED_BOLUS, + source = UserEntry.Sources.NSClient, + note = "", + values = listOf( ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount), ValueWithUnit.UnitPerHour(it.rate), diff --git a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt index af449c6ac9..2834ea43e7 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.sync.nsclient.data import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.events.EventNewNotification import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.database.entities.UserEntry diff --git a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index e4dfa2cba4..0c10f2642f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -6,7 +6,7 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository diff --git a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt index a5d24a8fa0..21b895c1ac 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index ceb3655cc5..7c2ca8375f 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStoreObject import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.database.entities.GlucoseValue diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 58105d4dc2..3b0f95380a 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -477,7 +477,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints { event.setStatus(getRh().gs(R.string.combo_programming_bolus)); break; case DELIVERING: - event.setStatus(getRh().gs(R.string.bolusdelivering, delivered)); + event.setStatus(getRh().gs(R.string.bolus_delivering, delivered)); break; case DELIVERED: event.setStatus(getRh().gs(R.string.bolusdelivered, delivered)); diff --git a/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt b/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt index 733281e1b2..1da9d69f72 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt @@ -834,7 +834,7 @@ class ComboV2Plugin @Inject constructor ( is RTCommandProgressStage.DeliveringBolus -> { val bolusingEvent = EventOverviewBolusProgress bolusingEvent.percent = (progressReport.overallProgress * 100.0).toInt() - bolusingEvent.status = rh.gs(R.string.bolusdelivering, detailedBolusInfo.insulin) + bolusingEvent.status = rh.gs(R.string.bolus_delivering, detailedBolusInfo.insulin) rxBus.send(bolusingEvent) } BasicProgressStage.Finished -> { diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 3d151a7c44..bc5b182bcb 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.dana.activities.DanaHistoryActivity import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding import info.nightscout.androidaps.dana.events.EventDanaRNewStatus -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.plugin.ActivePlugin diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 103a2f827f..ab60356634 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -151,7 +151,7 @@ class DanaRKoreanPlugin @Inject constructor( result } else { val result = PumpEnactResult(injector) - result.success(false).bolusDelivered(0.0).carbsDelivered(0.0).comment(R.string.invalidinput) + result.success(false).bolusDelivered(0.0).carbsDelivered(0.0).comment(R.string.invalid_input) aapsLogger.error("deliverTreatment: Invalid input") result } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 386fc18d66..eee0d81711 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -203,7 +203,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { return result; } else { PumpEnactResult result = new PumpEnactResult(getInjector()); - result.success(false).bolusDelivered(0d).carbsDelivered(0d).comment(R.string.invalidinput); + result.success(false).bolusDelivered(0d).carbsDelivered(0d).comment(R.string.invalid_input); aapsLogger.error("deliverTreatment: Invalid input"); return result; } @@ -292,7 +292,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { PumpEnactResult result = new PumpEnactResult(getInjector()); percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value(); if (percent < 0) { - result.isTempCancel(false).enacted(false).success(false).comment(R.string.invalidinput); + result.isTempCancel(false).enacted(false).success(false).comment(R.string.invalid_input); aapsLogger.error("setTempBasalPercent: Invalid input"); return result; } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index 40d25c6a89..524957dbb6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -218,7 +218,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump PumpEnactResult result = new PumpEnactResult(getInjector()); percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value(); if (percent < 0) { - result.isTempCancel(false).enacted(false).success(false).comment(R.string.invalidinput); + result.isTempCancel(false).enacted(false).success(false).comment(R.string.invalid_input); getAapsLogger().error("setTempBasalPercent: Invalid input"); return result; } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index bc577a2559..6d61fcecaa 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -193,7 +193,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin { return result; } else { PumpEnactResult result = new PumpEnactResult(getInjector()); - result.success(false).bolusDelivered(0d).carbsDelivered(0d).comment(R.string.invalidinput); + result.success(false).bolusDelivered(0d).carbsDelivered(0d).comment(R.string.invalid_input); aapsLogger.error("deliverTreatment: Invalid input"); return result; } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt index a4b69a08ee..9e0f6ffa25 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt @@ -20,7 +20,7 @@ class MsgBolusProgress( danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis() danaPump.bolusingTreatment?.insulin = deliveredInsulin val bolusingEvent = EventOverviewBolusProgress - bolusingEvent.status = rh.gs(R.string.bolusdelivering, deliveredInsulin) + bolusingEvent.status = rh.gs(R.string.bolus_delivering, deliveredInsulin) bolusingEvent.t = danaPump.bolusingTreatment bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100) aapsLogger.debug(LTag.PUMPCOMM, "Delivered insulin so far: $deliveredInsulin") diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index c9aa5506cb..d4b23671d9 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -325,7 +325,7 @@ class DanaRSPlugin @Inject constructor( result.success = false result.bolusDelivered = 0.0 result.carbsDelivered = 0.0 - result.comment = rh.gs(R.string.invalidinput) + result.comment = rh.gs(R.string.invalid_input) aapsLogger.error("deliverTreatment: Invalid input") result } @@ -419,7 +419,7 @@ class DanaRSPlugin @Inject constructor( result.isTempCancel = false result.enacted = false result.success = false - result.comment = rh.gs(R.string.invalidinput) + result.comment = rh.gs(R.string.invalid_input) aapsLogger.error("setTempBasalPercent: Invalid input") return result } diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt index 7e03873881..caa68f28b6 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt @@ -54,7 +54,7 @@ class EnterPinActivity : NoSplashAppCompatActivity() { if (result) { bleComm.finishV3Pairing() finish() - } else OKDialog.show(this, rh.gs(R.string.error), rh.gs(R.string.invalidinput)) + } else OKDialog.show(this, rh.gs(R.string.error), rh.gs(R.string.invalid_input)) } } binding.okcancel.cancel.setOnClickListener { finish() } diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt index bc884e87ec..843293036a 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt @@ -29,7 +29,7 @@ class DanaRSPacketNotifyDeliveryComplete( val deliveredInsulin = byteArrayToInt(getBytes(data, DATA_START, 2)) / 100.0 danaPump.bolusingTreatment?.insulin = deliveredInsulin val bolusingEvent = EventOverviewBolusProgress - bolusingEvent.status = rh.gs(R.string.bolusdelivering, deliveredInsulin) + bolusingEvent.status = rh.gs(R.string.bolus_delivering, deliveredInsulin) bolusingEvent.t = danaPump.bolusingTreatment bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100) danaPump.bolusDone = true diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt index 3b99be1013..7943112b6d 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt @@ -29,7 +29,7 @@ class DanaRSPacketNotifyDeliveryRateDisplay( danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis() danaPump.bolusingTreatment?.insulin = deliveredInsulin val bolusingEvent = EventOverviewBolusProgress - bolusingEvent.status = rh.gs(R.string.bolusdelivering, deliveredInsulin) + bolusingEvent.status = rh.gs(R.string.bolus_delivering, deliveredInsulin) bolusingEvent.t = danaPump.bolusingTreatment bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100) failed = bolusingEvent.percent < 100 diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 9fb4028f6e..6beb3603c7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -292,7 +292,7 @@ class DiaconnG8Plugin @Inject constructor( result.success = false result.bolusDelivered = 0.0 result.carbsDelivered = 0.0 - result.comment = rh.gs(R.string.invalidinput) + result.comment = rh.gs(R.string.invalid_input) aapsLogger.error("deliverTreatment: Invalid input") result } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 51a9a95a6e..2909a3b01b 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -264,7 +264,7 @@ class EopatchPumpPlugin @Inject constructor( // neither carbs nor bolus requested aapsLogger.error("deliverTreatment: Invalid input: neither carbs nor insulin are set in treatment") return PumpEnactResult(injector).success(false).enacted(false).bolusDelivered(0.0).carbsDelivered(0.0) - .comment(rh.gs(R.string.invalidinput)) + .comment(rh.gs(R.string.invalid_input)) } else if (detailedBolusInfo.insulin > 0.0) { var isSuccess = true val result = BehaviorSubject.createDefault(true) @@ -292,7 +292,7 @@ class EopatchPumpPlugin @Inject constructor( if (patchManager.patchConnectionState.isConnected) { val delivering = patchManager.bolusCurrent.nowBolus.injected rxBus.send(EventOverviewBolusProgress.apply { - status = rh.gs(R.string.bolusdelivering, delivering) + status = rh.gs(R.string.bolus_delivering, delivering) percent = min((delivering / detailedBolusInfo.insulin * 100).toInt(), 100) t = tr }) @@ -319,7 +319,7 @@ class EopatchPumpPlugin @Inject constructor( patchManager.addBolusToHistory(detailedBolusInfo) return PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(0.0) - .carbsDelivered(detailedBolusInfo.carbs).comment(rh.gs(info.nightscout.core.main.R.string.ok)) + .carbsDelivered(detailedBolusInfo.carbs).comment(rh.gs(R.string.ok)) } } @@ -420,7 +420,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResult(injector).success(true).enacted(true) } .onErrorReturnItem( PumpEnactResult(injector).success(false).enacted(false).bolusDelivered(0.0) - .comment(rh.gs(info.nightscout.core.main.R.string.error)) + .comment(rh.gs(R.string.error)) ) .blockingGet() } @@ -457,7 +457,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) } .onErrorReturnItem( PumpEnactResult(injector).success(false).enacted(false) - .comment(rh.gs(info.nightscout.core.main.R.string.error)) + .comment(rh.gs(R.string.error)) ) .blockingGet() } @@ -478,7 +478,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) } .onErrorReturnItem( PumpEnactResult(injector).success(false).enacted(false) - .comment(rh.gs(info.nightscout.core.main.R.string.error)) + .comment(rh.gs(R.string.error)) ) .blockingGet() } else { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java index 8703449ab7..96f6673275 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java @@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.logging.UserEntryLogger; +import info.nightscout.interfaces.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetInternalSuspendTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchInternalSuspendTimeResponse; import info.nightscout.interfaces.pump.PumpSync; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java index 6ef3312df7..5d4c5f20fc 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java @@ -9,13 +9,13 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalPause; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; +import info.nightscout.interfaces.logging.UserEntryLogger; import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.queue.Command; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java index 9a341a46d3..b10506ae19 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java @@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.logging.UserEntryLogger; +import info.nightscout.interfaces.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalStopResponse; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index 075b8147d1..5a5989f273 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -670,7 +670,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley // neither carbs nor bolus requested aapsLogger.error("deliverTreatment: Invalid input: neither carbs nor insulin are set in treatment"); return new PumpEnactResult(getInjector()).success(false).enacted(false).bolusDelivered(0d).carbsDelivered(0d) - .comment(R.string.invalidinput); + .comment(R.string.invalid_input); } else if (detailedBolusInfo.insulin > 0) { // bolus needed, ask pump to deliver it return deliverBolus(detailedBolusInfo); diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index 0bc2565cf6..2abff18c65 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -313,7 +313,7 @@ abstract class PumpPluginAbstract protected constructor( // neither carbs nor bolus requested aapsLogger.error("deliverTreatment: Invalid input") PumpEnactResult(injector).success(false).enacted(false).bolusDelivered(0.0).carbsDelivered(0.0) - .comment(R.string.invalidinput) + .comment(R.string.invalid_input) } else if (detailedBolusInfo.insulin > 0) { // bolus needed, ask pump to deliver it deliverBolus(detailedBolusInfo) diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index 53edef153a..a1a19be906 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -234,7 +234,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { return@setOnClickListener } } - ToastUtils.warnToast(this, R.string.invalidinput) + ToastUtils.warnToast(this, R.string.invalid_input) } binding.ageLabel.labelFor = binding.age.editTextId binding.tddLabel.labelFor = binding.tdd.editTextId diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index b89c46969c..757dfe39f1 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -3,7 +3,7 @@ package info.nightscout.ui.activities import android.annotation.SuppressLint import android.os.Bundle import android.widget.TextView -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.activities.NoSplashAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 72c128ff4e..afce3c4d17 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -17,7 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.iobCalc -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.ActionModeHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index 5625c4b634..21f372944b 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -14,7 +14,7 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.ActionModeHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 34fbbdfaa5..a8e7d87ddc 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.isInProgress -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.ActionModeHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 0fed2f354d..30a6716e3c 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -17,7 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.getCustomizedName -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index 0c23c1f58e..2f3f259974 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -18,7 +18,7 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.ActionModeHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 1b28043d1b..d6532d0239 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -18,7 +18,7 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.ActionModeHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 631802be38..f3ac31fb53 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -12,7 +12,7 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index 4b15049612..f5843c7229 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -11,7 +11,7 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.core.activities.DialogAppCompatActivity import info.nightscout.core.main.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt index e9fac38d81..9c5924dc6a 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.database.entities.UserEntry.Action diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index 0234dffb0f..21436e04bd 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -6,7 +6,7 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.database.entities.UserEntry.Action diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 0f782eaac9..c8938d7ca8 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -8,7 +8,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index 53ae82d54f..d3e8b2e1c6 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -11,7 +11,7 @@ import androidx.annotation.StringRes import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.database.entities.TherapyEvent diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt index 7c4d6d9d4a..17ece0857b 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.formatColor diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt index 2671e454b4..98266ce139 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.formatColor diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt index d2d619ee0c..3ac3c9c7a2 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt @@ -8,7 +8,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.pump.insertBolusTransaction import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt index 6e66ba027a..6ae4a63306 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt @@ -11,7 +11,7 @@ import android.view.Window import android.view.WindowManager import androidx.fragment.app.FragmentManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt index 05bf5b2938..55c1969791 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt @@ -9,7 +9,7 @@ import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt index 7b293a97f6..04403dd6f2 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.formatColor diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt index aace153928..45976d6af0 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import android.widget.ArrayAdapter import com.google.common.base.Joiner import com.google.common.collect.Lists -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt index 42cb5f8881..a42480bc2c 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt @@ -8,7 +8,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.core.pump.insertBolusTransaction import info.nightscout.core.pump.insertCarbsTransaction import info.nightscout.core.ui.dialogs.OKDialog