UserEntryLogger interface
This commit is contained in:
parent
79f8ae11fb
commit
8e8fbf1b6f
|
@ -34,7 +34,7 @@ import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||||
import info.nightscout.androidaps.databinding.ActivityMainBinding
|
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.configuration.setupwizard.SetupWizardActivity
|
||||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||||
import info.nightscout.core.ui.UIRunnable
|
import info.nightscout.core.ui.UIRunnable
|
||||||
|
|
|
@ -16,7 +16,7 @@ import androidx.work.WorkManager
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.DaggerApplication
|
import dagger.android.DaggerApplication
|
||||||
import info.nightscout.androidaps.di.DaggerAppComponent
|
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.plugins.configBuilder.PluginStore
|
||||||
import info.nightscout.androidaps.receivers.BTReceiver
|
import info.nightscout.androidaps.receivers.BTReceiver
|
||||||
import info.nightscout.androidaps.receivers.ChargingStateReceiver
|
import info.nightscout.androidaps.receivers.ChargingStateReceiver
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.configBuilder
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
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.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.database.entities.UserEntry.Action
|
import info.nightscout.database.entities.UserEntry.Action
|
||||||
|
|
|
@ -24,7 +24,7 @@ import info.nightscout.androidaps.BuildConfig
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||||
import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset
|
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.plugins.general.maintenance.formats.EncryptedPrefsFormat
|
||||||
import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
|
import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
|
||||||
import info.nightscout.core.activities.DaggerAppCompatActivityWithResult
|
import info.nightscout.core.activities.DaggerAppCompatActivityWithResult
|
||||||
|
|
|
@ -13,7 +13,7 @@ import info.nightscout.androidaps.dana.database.DanaHistoryDatabase
|
||||||
import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding
|
import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding
|
||||||
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
|
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
|
||||||
import info.nightscout.androidaps.insight.database.InsightDatabase
|
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.general.maintenance.activities.LogSettingActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase
|
import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase
|
||||||
|
|
|
@ -30,7 +30,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.extensions.directionToIcon
|
import info.nightscout.androidaps.extensions.directionToIcon
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
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.activities.QuickWizardListActivity
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
|
||||||
|
|
|
@ -8,7 +8,7 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.toStringShort
|
import info.nightscout.androidaps.extensions.toStringShort
|
||||||
import info.nightscout.androidaps.extensions.valueToUnits
|
import info.nightscout.androidaps.extensions.valueToUnits
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
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.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||||
import info.nightscout.core.graph.data.GlucoseValueDataPoint
|
import info.nightscout.core.graph.data.GlucoseValueDataPoint
|
||||||
|
|
|
@ -6,7 +6,7 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.TestBase
|
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.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
@ -49,7 +49,7 @@ class LoopPluginTest : TestBase() {
|
||||||
@Mock lateinit var receiverStatusStore: ReceiverStatusStore
|
@Mock lateinit var receiverStatusStore: ReceiverStatusStore
|
||||||
@Mock lateinit var notificationManager: NotificationManager
|
@Mock lateinit var notificationManager: NotificationManager
|
||||||
@Mock lateinit var repository: AppRepository
|
@Mock lateinit var repository: AppRepository
|
||||||
@Mock lateinit var uel:UserEntryLogger
|
@Mock lateinit var uel: UserEntryLogger
|
||||||
@Mock lateinit var dateUtil: DateUtil
|
@Mock lateinit var dateUtil: DateUtil
|
||||||
@Mock lateinit var runningConfiguration: RunningConfiguration
|
@Mock lateinit var runningConfiguration: RunningConfiguration
|
||||||
@Mock lateinit var config: Config
|
@Mock lateinit var config: Config
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.configBuilder
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBase
|
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.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.pump.PumpSync
|
import info.nightscout.interfaces.pump.PumpSync
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
|
|
|
@ -6,7 +6,7 @@ import com.google.common.base.Joiner
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
||||||
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
|
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.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.iob.round
|
import info.nightscout.core.iob.round
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
|
|
|
@ -2,16 +2,12 @@
|
||||||
<resources>
|
<resources>
|
||||||
<!-- General-->
|
<!-- General-->
|
||||||
<string name="refresh">Refresh</string>
|
<string name="refresh">Refresh</string>
|
||||||
<string name="error">Error</string>
|
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
<string name="not_set_short">Not set</string>
|
<string name="not_set_short">Not set</string>
|
||||||
<string name="failedupdatebasalprofile">Failed to update basal profile</string>
|
<string name="failedupdatebasalprofile">Failed to update basal profile</string>
|
||||||
<string name="profile_set_ok">Basal profile in pump updated</string>
|
|
||||||
<string name="invalidinput">Invalid input data</string>
|
|
||||||
<string name="tempbasaldeliveryerror">Tempbasal delivery error</string>
|
<string name="tempbasaldeliveryerror">Tempbasal delivery error</string>
|
||||||
<string name="goingtodeliver">Going to deliver %1$.2f U</string>
|
<string name="goingtodeliver">Going to deliver %1$.2f U</string>
|
||||||
<string name="waitingforpump">Waiting for pump</string>
|
<string name="waitingforpump">Waiting for pump</string>
|
||||||
<string name="bolusdelivering">Delivering %1$.2f U</string>
|
|
||||||
<string name="connecting">Connecting</string>
|
<string name="connecting">Connecting</string>
|
||||||
<string name="disconnected">Disconnected</string>
|
<string name="disconnected">Disconnected</string>
|
||||||
<string name="androidaps_start">AAPS started</string>
|
<string name="androidaps_start">AAPS started</string>
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- General-->
|
||||||
|
<string name="error">Error</string>
|
||||||
|
<string name="profile_set_ok">Basal profile in pump updated</string>
|
||||||
|
<string name="invalid_input">Invalid input data</string>
|
||||||
|
<string name="bolus_delivering">Delivering %1$.2f U</string>
|
||||||
|
|
||||||
<!-- Dialogs-->
|
<!-- Dialogs-->
|
||||||
<string name="confirmation">Confirmation</string>
|
<string name="confirmation">Confirmation</string>
|
||||||
<string name="message">Message</string>
|
<string name="message">Message</string>
|
||||||
|
|
|
@ -1,32 +1,13 @@
|
||||||
package info.nightscout.database.impl.transactions
|
package info.nightscout.database.impl.transactions
|
||||||
|
|
||||||
import info.nightscout.database.entities.UserEntry
|
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<Entry>) : Transaction<List<UserEntryTransaction.Entry>>() {
|
class UserEntryTransaction(private val entries: List<UserEntry>) : Transaction<List<UserEntry>>() {
|
||||||
|
|
||||||
data class Entry(
|
override fun run(): List<UserEntry> {
|
||||||
val timestamp: Long,
|
|
||||||
val action: Action,
|
|
||||||
val source: Sources,
|
|
||||||
val note: String,
|
|
||||||
val values: List<ValueWithUnit?> = listOf()
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun run(): List<Entry> {
|
|
||||||
|
|
||||||
for (entry in entries)
|
for (entry in entries)
|
||||||
database.userEntryDao.insert(
|
database.userEntryDao.insert(entry)
|
||||||
UserEntry(
|
|
||||||
timestamp = entry.timestamp,
|
|
||||||
action = entry.action,
|
|
||||||
source = entry.source,
|
|
||||||
note = entry.note,
|
|
||||||
values = entry.values
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
package info.nightscout.implementation
|
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.core.events.EventNewNotification
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.entities.UserEntry.Action
|
import info.nightscout.database.entities.UserEntry.Action
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package info.nightscout.androidaps.logging
|
package info.nightscout.implementation
|
||||||
|
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
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.Action
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.database.entities.ValueWithUnit
|
import info.nightscout.database.entities.ValueWithUnit
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.database.impl.transactions.UserEntryTransaction
|
import info.nightscout.database.impl.transactions.UserEntryTransaction
|
||||||
|
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||||
import info.nightscout.interfaces.userEntry.UserEntryMapper
|
import info.nightscout.interfaces.userEntry.UserEntryMapper
|
||||||
import info.nightscout.interfaces.userEntry.ValueWithUnitMapper
|
import info.nightscout.interfaces.userEntry.ValueWithUnitMapper
|
||||||
import info.nightscout.rx.AapsSchedulers
|
import info.nightscout.rx.AapsSchedulers
|
||||||
|
@ -18,25 +20,35 @@ import javax.inject.Singleton
|
||||||
|
|
||||||
@OpenForTesting
|
@OpenForTesting
|
||||||
@Singleton
|
@Singleton
|
||||||
class UserEntryLogger @Inject constructor(
|
class UserEntryLoggerImpl @Inject constructor(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val repository: AppRepository,
|
private val repository: AppRepository,
|
||||||
private val aapsSchedulers: AapsSchedulers,
|
private val aapsSchedulers: AapsSchedulers,
|
||||||
private val dateUtil: DateUtil
|
private val dateUtil: DateUtil
|
||||||
) {
|
) : UserEntryLogger {
|
||||||
|
|
||||||
private val compositeDisposable = CompositeDisposable()
|
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<ValueWithUnit?> = listOf()) {
|
override fun log(action: Action, source: Sources, note: String?, listValues: List<ValueWithUnit?>) {
|
||||||
val filteredValues = listValues.toList().filterNotNull()
|
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<UserEntryTransaction.Entry>) {
|
override fun log(entries: List<UserEntry>) {
|
||||||
compositeDisposable += repository.runTransactionForResult(UserEntryTransaction(entries))
|
compositeDisposable += repository.runTransactionForResult(UserEntryTransaction(entries))
|
||||||
.subscribeOn(aapsSchedulers.io)
|
.subscribeOn(aapsSchedulers.io)
|
||||||
.observeOn(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() })
|
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<ValueWithUnitMapper?> = listOf()) =
|
override fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String?, listValues: List<ValueWithUnitMapper?>) =
|
||||||
log(action.db, source.db, note, listValues.map { it?.db() })
|
log(action.db, source.db, note, listValues.map { it?.db() })
|
||||||
|
|
||||||
}
|
}
|
|
@ -19,6 +19,7 @@ import info.nightscout.implementation.HardLimitsImpl
|
||||||
import info.nightscout.implementation.LocalAlertUtilsImpl
|
import info.nightscout.implementation.LocalAlertUtilsImpl
|
||||||
import info.nightscout.implementation.TranslatorImpl
|
import info.nightscout.implementation.TranslatorImpl
|
||||||
import info.nightscout.implementation.TrendCalculatorImpl
|
import info.nightscout.implementation.TrendCalculatorImpl
|
||||||
|
import info.nightscout.implementation.UserEntryLoggerImpl
|
||||||
import info.nightscout.implementation.XDripBroadcastImpl
|
import info.nightscout.implementation.XDripBroadcastImpl
|
||||||
import info.nightscout.implementation.androidNotification.NotificationHolderImpl
|
import info.nightscout.implementation.androidNotification.NotificationHolderImpl
|
||||||
import info.nightscout.implementation.logging.LoggerUtilsImpl
|
import info.nightscout.implementation.logging.LoggerUtilsImpl
|
||||||
|
@ -44,6 +45,7 @@ import info.nightscout.interfaces.NotificationHolder
|
||||||
import info.nightscout.interfaces.Translator
|
import info.nightscout.interfaces.Translator
|
||||||
import info.nightscout.interfaces.XDripBroadcast
|
import info.nightscout.interfaces.XDripBroadcast
|
||||||
import info.nightscout.interfaces.logging.LoggerUtils
|
import info.nightscout.interfaces.logging.LoggerUtils
|
||||||
|
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||||
import info.nightscout.interfaces.maintenance.PrefFileListProvider
|
import info.nightscout.interfaces.maintenance.PrefFileListProvider
|
||||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.profile.DefaultValueHelper
|
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.ui.IconsProvider
|
||||||
import info.nightscout.interfaces.utils.HardLimits
|
import info.nightscout.interfaces.utils.HardLimits
|
||||||
import info.nightscout.interfaces.utils.TrendCalculator
|
import info.nightscout.interfaces.utils.TrendCalculator
|
||||||
|
import info.nightscout.rx.AapsSchedulers
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.shared.interfaces.ResourceHelper
|
import info.nightscout.shared.interfaces.ResourceHelper
|
||||||
|
@ -115,6 +118,15 @@ open class ImplementationModule {
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideTranslator(rh: ResourceHelper): Translator = TranslatorImpl(rh)
|
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
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideOverviewData(
|
fun provideOverviewData(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package info.nightscout.implementation.pump
|
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.events.EventNewNotification
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.core.pump.fromDbPumpType
|
import info.nightscout.core.pump.fromDbPumpType
|
||||||
|
|
|
@ -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<ValueWithUnit?> = listOf())
|
||||||
|
fun log(entries: List<UserEntry>)
|
||||||
|
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<ValueWithUnitMapper?> = listOf())
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ import android.widget.TableRow
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import dagger.android.support.DaggerFragment
|
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.ProfileSealed
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.plugins.general.autotune
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
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.ProfileSealed
|
||||||
import info.nightscout.core.profile.ProfileStoreObject
|
import info.nightscout.core.profile.ProfileStoreObject
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
|
|
|
@ -23,7 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import dagger.android.support.DaggerFragment
|
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.AutomationEventItemBinding
|
||||||
import info.nightscout.automation.databinding.AutomationFragmentBinding
|
import info.nightscout.automation.databinding.AutomationFragmentBinding
|
||||||
import info.nightscout.automation.dialogs.EditEventDialog
|
import info.nightscout.automation.dialogs.EditEventDialog
|
||||||
|
|
|
@ -4,7 +4,7 @@ import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.fromConstant
|
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.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.automation.R
|
import info.nightscout.automation.R
|
||||||
import info.nightscout.automation.elements.InputCarePortalMenu
|
import info.nightscout.automation.elements.InputCarePortalMenu
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.automation.actions
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.automation.actions
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.automation.actions
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.automation.actions
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.automation.elements.InputDuration
|
import info.nightscout.automation.elements.InputDuration
|
||||||
import info.nightscout.automation.elements.LabelWithElement
|
import info.nightscout.automation.elements.LabelWithElement
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.automation.actions
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.automation.elements.InputProfileName
|
import info.nightscout.automation.elements.InputProfileName
|
||||||
import info.nightscout.automation.elements.LabelWithElement
|
import info.nightscout.automation.elements.LabelWithElement
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.automation.actions
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.automation.elements.Comparator
|
import info.nightscout.automation.elements.Comparator
|
||||||
import info.nightscout.automation.elements.InputDuration
|
import info.nightscout.automation.elements.InputDuration
|
||||||
|
|
|
@ -4,7 +4,7 @@ import android.widget.LinearLayout
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.friendlyDescription
|
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.R
|
||||||
import info.nightscout.automation.elements.ComparatorExists
|
import info.nightscout.automation.elements.ComparatorExists
|
||||||
import info.nightscout.automation.elements.InputDuration
|
import info.nightscout.automation.elements.InputDuration
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.automation.actions
|
package info.nightscout.automation.actions
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
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.R
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
import info.nightscout.database.entities.UserEntry.Sources
|
import info.nightscout.database.entities.UserEntry.Sources
|
||||||
|
|
|
@ -5,7 +5,7 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.TestPumpPlugin
|
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.automation.triggers.Trigger
|
||||||
import info.nightscout.database.entities.OfflineEvent
|
import info.nightscout.database.entities.OfflineEvent
|
||||||
import info.nightscout.interfaces.ConfigBuilder
|
import info.nightscout.interfaces.ConfigBuilder
|
||||||
|
|
|
@ -16,7 +16,7 @@ import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
import info.nightscout.androidaps.extensions.convertedToPercent
|
import info.nightscout.androidaps.extensions.convertedToPercent
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
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.events.EventNewNotification
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.core.utils.receivers.ReceiverStatusStore
|
import info.nightscout.core.utils.receivers.ReceiverStatusStore
|
||||||
|
|
|
@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearSmoothScroller
|
import androidx.recyclerview.widget.LinearSmoothScroller
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
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.utils.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -12,7 +12,7 @@ import androidx.core.content.ContextCompat
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.toStringMedium
|
import info.nightscout.androidaps.extensions.toStringMedium
|
||||||
import info.nightscout.androidaps.extensions.toStringShort
|
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.UIRunnable
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.elements.SingleClickButton
|
import info.nightscout.core.ui.elements.SingleClickButton
|
||||||
|
|
|
@ -12,7 +12,7 @@ import android.widget.ArrayAdapter
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
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.UIRunnable
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -13,7 +13,7 @@ import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
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.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||||
import info.nightscout.core.events.EventNewNotification
|
import info.nightscout.core.events.EventNewNotification
|
||||||
|
|
|
@ -12,7 +12,7 @@ import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import com.google.common.primitives.Ints.min
|
import com.google.common.primitives.Ints.min
|
||||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
|
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.activities.NoSplashAppCompatActivity
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -10,7 +10,7 @@ import android.widget.AdapterView
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
import dagger.android.support.DaggerFragment
|
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.ProfileSealed
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -187,7 +187,7 @@ open class VirtualPumpPlugin @Inject constructor(
|
||||||
var delivering = 0.0
|
var delivering = 0.0
|
||||||
while (delivering < detailedBolusInfo.insulin) {
|
while (delivering < detailedBolusInfo.insulin) {
|
||||||
SystemClock.sleep(200)
|
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)
|
bolusingEvent.percent = min((delivering / detailedBolusInfo.insulin * 100).toInt(), 100)
|
||||||
rxBus.send(bolusingEvent)
|
rxBus.send(bolusingEvent)
|
||||||
delivering += 0.1
|
delivering += 0.1
|
||||||
|
|
|
@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.directionToIcon
|
import info.nightscout.androidaps.extensions.directionToIcon
|
||||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
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.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -9,7 +9,7 @@ import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.fromConstant
|
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.core.utils.receivers.DataWorkerStorage
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
|
|
|
@ -5,7 +5,7 @@ import android.net.Uri
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.HandlerThread
|
import android.os.HandlerThread
|
||||||
import dagger.android.HasAndroidInjector
|
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.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
|
|
|
@ -7,7 +7,7 @@ import android.os.Handler
|
||||||
import android.os.HandlerThread
|
import android.os.HandlerThread
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import dagger.android.HasAndroidInjector
|
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.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
|
|
|
@ -13,7 +13,7 @@ import android.widget.ScrollView
|
||||||
import androidx.core.view.MenuProvider
|
import androidx.core.view.MenuProvider
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import dagger.android.support.DaggerFragment
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
|
|
|
@ -5,7 +5,6 @@ import android.os.SystemClock
|
||||||
import androidx.work.Worker
|
import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
|
||||||
import info.nightscout.core.events.EventNewNotification
|
import info.nightscout.core.events.EventNewNotification
|
||||||
import info.nightscout.database.entities.Bolus
|
import info.nightscout.database.entities.Bolus
|
||||||
import info.nightscout.database.entities.BolusCalculatorResult
|
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.SyncNsTemporaryBasalTransaction
|
||||||
import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction
|
import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction
|
||||||
import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction
|
import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction
|
||||||
import info.nightscout.database.impl.transactions.UserEntryTransaction
|
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
import info.nightscout.interfaces.Constants
|
import info.nightscout.interfaces.Constants
|
||||||
import info.nightscout.interfaces.XDripBroadcast
|
import info.nightscout.interfaces.XDripBroadcast
|
||||||
|
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||||
import info.nightscout.interfaces.notifications.Notification
|
import info.nightscout.interfaces.notifications.Notification
|
||||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
import info.nightscout.interfaces.sync.NsClient
|
import info.nightscout.interfaces.sync.NsClient
|
||||||
|
@ -90,7 +89,7 @@ class StoreDataForDb @Inject constructor(
|
||||||
val profileSwitches: MutableList<ProfileSwitch> = mutableListOf()
|
val profileSwitches: MutableList<ProfileSwitch> = mutableListOf()
|
||||||
val offlineEvents: MutableList<OfflineEvent> = mutableListOf()
|
val offlineEvents: MutableList<OfflineEvent> = mutableListOf()
|
||||||
|
|
||||||
private val userEntries: MutableList<UserEntryTransaction.Entry> = mutableListOf()
|
private val userEntries: MutableList<UserEntry> = mutableListOf()
|
||||||
|
|
||||||
private val inserted = HashMap<String, Long>()
|
private val inserted = HashMap<String, Long>()
|
||||||
private val updated = HashMap<String, Long>()
|
private val updated = HashMap<String, Long>()
|
||||||
|
@ -171,10 +170,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
boluses.clear()
|
boluses.clear()
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.BOLUS, UserEntry.Sources.NSClient, it.notes ?: "",
|
action = UserEntry.Action.BOLUS,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = it.notes ?: "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it")
|
aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it")
|
||||||
|
@ -182,10 +183,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.BOLUS_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.BOLUS_REMOVED,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Invalidated bolus $it")
|
aapsLogger.debug(LTag.DATABASE, "Invalidated bolus $it")
|
||||||
|
@ -214,10 +217,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
carbs.clear()
|
carbs.clear()
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "",
|
action = UserEntry.Action.CARBS,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt()))
|
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")
|
aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it")
|
||||||
|
@ -225,10 +230,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CARBS_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.CARBS_REMOVED,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt()))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt()))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it")
|
aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it")
|
||||||
|
@ -236,10 +243,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.updated.forEach {
|
result.updated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "",
|
action = UserEntry.Action.CARBS,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt()))
|
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")
|
aapsLogger.debug(LTag.DATABASE, "Updated carbs $it")
|
||||||
|
@ -265,10 +274,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
temporaryTargets.clear()
|
temporaryTargets.clear()
|
||||||
result.inserted.forEach { tt ->
|
result.inserted.forEach { tt ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.TT, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.TT,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL),
|
ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL),
|
||||||
ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
|
@ -281,10 +292,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach { tt ->
|
result.invalidated.forEach { tt ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.TT_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.TT_REMOVED,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
ValueWithUnit.Mgdl(tt.lowTarget),
|
ValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
|
@ -297,10 +310,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.ended.forEach { tt ->
|
result.ended.forEach { tt ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CANCEL_TT, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.CANCEL_TT,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
ValueWithUnit.Mgdl(tt.lowTarget),
|
ValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
|
@ -334,10 +349,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
temporaryBasals.clear()
|
temporaryBasals.clear()
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.TEMP_BASAL, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.TEMP_BASAL,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
||||||
|
@ -349,10 +366,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.TEMP_BASAL_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.TEMP_BASAL_REMOVED,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
||||||
|
@ -364,10 +383,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.ended.forEach {
|
result.ended.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CANCEL_TEMP_BASAL, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.CANCEL_TEMP_BASAL,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
|
||||||
|
@ -400,10 +421,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
effectiveProfileSwitches.clear()
|
effectiveProfileSwitches.clear()
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.PROFILE_SWITCH,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it")
|
aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it")
|
||||||
|
@ -411,10 +434,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.PROFILE_SWITCH_REMOVED,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it")
|
aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it")
|
||||||
|
@ -439,10 +464,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
profileSwitches.clear()
|
profileSwitches.clear()
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.PROFILE_SWITCH,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it")
|
aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it")
|
||||||
|
@ -450,10 +477,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.PROFILE_SWITCH_REMOVED,
|
||||||
listOf(ValueWithUnit.Timestamp(it.timestamp))
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(ValueWithUnit.Timestamp(it.timestamp))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it")
|
aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it")
|
||||||
|
@ -518,10 +547,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
else -> UserEntry.Action.CAREPORTAL
|
else -> UserEntry.Action.CAREPORTAL
|
||||||
}
|
}
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
action, UserEntry.Sources.NSClient, therapyEvent.note ?: "",
|
action = action,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = therapyEvent.note ?: "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(therapyEvent.timestamp),
|
ValueWithUnit.Timestamp(therapyEvent.timestamp),
|
||||||
ValueWithUnit.TherapyEventType(therapyEvent.type),
|
ValueWithUnit.TherapyEventType(therapyEvent.type),
|
||||||
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null })
|
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 ->
|
result.invalidated.forEach { therapyEvent ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CAREPORTAL_REMOVED, UserEntry.Sources.NSClient, therapyEvent.note ?: "",
|
action = UserEntry.Action.CAREPORTAL_REMOVED,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = therapyEvent.note ?: "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(therapyEvent.timestamp),
|
ValueWithUnit.Timestamp(therapyEvent.timestamp),
|
||||||
ValueWithUnit.TherapyEventType(therapyEvent.type),
|
ValueWithUnit.TherapyEventType(therapyEvent.type),
|
||||||
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null })
|
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null })
|
||||||
|
@ -566,10 +599,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach { oe ->
|
result.inserted.forEach { oe ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.LOOP_CHANGE,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.OfflineEventReason(oe.reason),
|
ValueWithUnit.OfflineEventReason(oe.reason),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
||||||
)
|
)
|
||||||
|
@ -580,10 +615,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach { oe ->
|
result.invalidated.forEach { oe ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.LOOP_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.LOOP_REMOVED,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.OfflineEventReason(oe.reason),
|
ValueWithUnit.OfflineEventReason(oe.reason),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
||||||
)
|
)
|
||||||
|
@ -594,10 +631,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.ended.forEach { oe ->
|
result.ended.forEach { oe ->
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.LOOP_CHANGE,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.OfflineEventReason(oe.reason),
|
ValueWithUnit.OfflineEventReason(oe.reason),
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
|
||||||
)
|
)
|
||||||
|
@ -628,10 +667,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.EXTENDED_BOLUS, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.EXTENDED_BOLUS,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit.Insulin(it.amount),
|
ValueWithUnit.Insulin(it.amount),
|
||||||
ValueWithUnit.UnitPerHour(it.rate),
|
ValueWithUnit.UnitPerHour(it.rate),
|
||||||
|
@ -645,10 +686,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.EXTENDED_BOLUS_REMOVED, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.EXTENDED_BOLUS_REMOVED,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit.Insulin(it.amount),
|
ValueWithUnit.Insulin(it.amount),
|
||||||
ValueWithUnit.UnitPerHour(it.rate),
|
ValueWithUnit.UnitPerHour(it.rate),
|
||||||
|
@ -661,10 +704,12 @@ class StoreDataForDb @Inject constructor(
|
||||||
}
|
}
|
||||||
result.ended.forEach {
|
result.ended.forEach {
|
||||||
if (config.NSCLIENT.not()) userEntries.add(
|
if (config.NSCLIENT.not()) userEntries.add(
|
||||||
UserEntryTransaction.Entry(
|
UserEntry(
|
||||||
dateUtil.now(),
|
timestamp = dateUtil.now(),
|
||||||
UserEntry.Action.CANCEL_EXTENDED_BOLUS, UserEntry.Sources.NSClient, "",
|
action = UserEntry.Action.CANCEL_EXTENDED_BOLUS,
|
||||||
listOf(
|
source = UserEntry.Sources.NSClient,
|
||||||
|
note = "",
|
||||||
|
values = listOf(
|
||||||
ValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit.Insulin(it.amount),
|
ValueWithUnit.Insulin(it.amount),
|
||||||
ValueWithUnit.UnitPerHour(it.rate),
|
ValueWithUnit.UnitPerHour(it.rate),
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.plugins.sync.nsclient.data
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
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.events.EventNewNotification
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.database.entities.UserEntry
|
import info.nightscout.database.entities.UserEntry
|
||||||
|
|
|
@ -6,7 +6,7 @@ import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson
|
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.core.utils.receivers.DataWorkerStorage
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
|
|
@ -5,7 +5,7 @@ import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
import dagger.android.HasAndroidInjector
|
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.core.utils.receivers.DataWorkerStorage
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
import info.nightscout.interfaces.Config
|
import info.nightscout.interfaces.Config
|
||||||
|
|
|
@ -5,7 +5,7 @@ import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.TestPumpPlugin
|
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.AutosensDataStoreObject
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
import info.nightscout.database.entities.GlucoseValue
|
||||||
|
|
|
@ -477,7 +477,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints {
|
||||||
event.setStatus(getRh().gs(R.string.combo_programming_bolus));
|
event.setStatus(getRh().gs(R.string.combo_programming_bolus));
|
||||||
break;
|
break;
|
||||||
case DELIVERING:
|
case DELIVERING:
|
||||||
event.setStatus(getRh().gs(R.string.bolusdelivering, delivered));
|
event.setStatus(getRh().gs(R.string.bolus_delivering, delivered));
|
||||||
break;
|
break;
|
||||||
case DELIVERED:
|
case DELIVERED:
|
||||||
event.setStatus(getRh().gs(R.string.bolusdelivered, delivered));
|
event.setStatus(getRh().gs(R.string.bolusdelivered, delivered));
|
||||||
|
|
|
@ -834,7 +834,7 @@ class ComboV2Plugin @Inject constructor (
|
||||||
is RTCommandProgressStage.DeliveringBolus -> {
|
is RTCommandProgressStage.DeliveringBolus -> {
|
||||||
val bolusingEvent = EventOverviewBolusProgress
|
val bolusingEvent = EventOverviewBolusProgress
|
||||||
bolusingEvent.percent = (progressReport.overallProgress * 100.0).toInt()
|
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)
|
rxBus.send(bolusingEvent)
|
||||||
}
|
}
|
||||||
BasicProgressStage.Finished -> {
|
BasicProgressStage.Finished -> {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import info.nightscout.androidaps.dana.activities.DanaHistoryActivity
|
||||||
import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity
|
import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity
|
||||||
import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding
|
import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding
|
||||||
import info.nightscout.androidaps.dana.events.EventDanaRNewStatus
|
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.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||||
|
|
|
@ -151,7 +151,7 @@ class DanaRKoreanPlugin @Inject constructor(
|
||||||
result
|
result
|
||||||
} else {
|
} else {
|
||||||
val result = PumpEnactResult(injector)
|
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")
|
aapsLogger.error("deliverTreatment: Invalid input")
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
PumpEnactResult result = new PumpEnactResult(getInjector());
|
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");
|
aapsLogger.error("deliverTreatment: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
|
||||||
PumpEnactResult result = new PumpEnactResult(getInjector());
|
PumpEnactResult result = new PumpEnactResult(getInjector());
|
||||||
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
|
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
|
||||||
if (percent < 0) {
|
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");
|
aapsLogger.error("setTempBasalPercent: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
|
||||||
PumpEnactResult result = new PumpEnactResult(getInjector());
|
PumpEnactResult result = new PumpEnactResult(getInjector());
|
||||||
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
|
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
|
||||||
if (percent < 0) {
|
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");
|
getAapsLogger().error("setTempBasalPercent: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
PumpEnactResult result = new PumpEnactResult(getInjector());
|
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");
|
aapsLogger.error("deliverTreatment: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ class MsgBolusProgress(
|
||||||
danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis()
|
danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis()
|
||||||
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
||||||
val bolusingEvent = EventOverviewBolusProgress
|
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.t = danaPump.bolusingTreatment
|
||||||
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Delivered insulin so far: $deliveredInsulin")
|
aapsLogger.debug(LTag.PUMPCOMM, "Delivered insulin so far: $deliveredInsulin")
|
||||||
|
|
|
@ -325,7 +325,7 @@ class DanaRSPlugin @Inject constructor(
|
||||||
result.success = false
|
result.success = false
|
||||||
result.bolusDelivered = 0.0
|
result.bolusDelivered = 0.0
|
||||||
result.carbsDelivered = 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")
|
aapsLogger.error("deliverTreatment: Invalid input")
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
@ -419,7 +419,7 @@ class DanaRSPlugin @Inject constructor(
|
||||||
result.isTempCancel = false
|
result.isTempCancel = false
|
||||||
result.enacted = false
|
result.enacted = false
|
||||||
result.success = false
|
result.success = false
|
||||||
result.comment = rh.gs(R.string.invalidinput)
|
result.comment = rh.gs(R.string.invalid_input)
|
||||||
aapsLogger.error("setTempBasalPercent: Invalid input")
|
aapsLogger.error("setTempBasalPercent: Invalid input")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class EnterPinActivity : NoSplashAppCompatActivity() {
|
||||||
if (result) {
|
if (result) {
|
||||||
bleComm.finishV3Pairing()
|
bleComm.finishV3Pairing()
|
||||||
finish()
|
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() }
|
binding.okcancel.cancel.setOnClickListener { finish() }
|
||||||
|
|
|
@ -29,7 +29,7 @@ class DanaRSPacketNotifyDeliveryComplete(
|
||||||
val deliveredInsulin = byteArrayToInt(getBytes(data, DATA_START, 2)) / 100.0
|
val deliveredInsulin = byteArrayToInt(getBytes(data, DATA_START, 2)) / 100.0
|
||||||
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
||||||
val bolusingEvent = EventOverviewBolusProgress
|
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.t = danaPump.bolusingTreatment
|
||||||
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
||||||
danaPump.bolusDone = true
|
danaPump.bolusDone = true
|
||||||
|
|
|
@ -29,7 +29,7 @@ class DanaRSPacketNotifyDeliveryRateDisplay(
|
||||||
danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis()
|
danaPump.bolusProgressLastTimeStamp = System.currentTimeMillis()
|
||||||
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
danaPump.bolusingTreatment?.insulin = deliveredInsulin
|
||||||
val bolusingEvent = EventOverviewBolusProgress
|
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.t = danaPump.bolusingTreatment
|
||||||
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
bolusingEvent.percent = min((deliveredInsulin / danaPump.bolusAmountToBeDelivered * 100).toInt(), 100)
|
||||||
failed = bolusingEvent.percent < 100
|
failed = bolusingEvent.percent < 100
|
||||||
|
|
|
@ -292,7 +292,7 @@ class DiaconnG8Plugin @Inject constructor(
|
||||||
result.success = false
|
result.success = false
|
||||||
result.bolusDelivered = 0.0
|
result.bolusDelivered = 0.0
|
||||||
result.carbsDelivered = 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")
|
aapsLogger.error("deliverTreatment: Invalid input")
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ class EopatchPumpPlugin @Inject constructor(
|
||||||
// neither carbs nor bolus requested
|
// neither carbs nor bolus requested
|
||||||
aapsLogger.error("deliverTreatment: Invalid input: neither carbs nor insulin are set in treatment")
|
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)
|
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) {
|
} else if (detailedBolusInfo.insulin > 0.0) {
|
||||||
var isSuccess = true
|
var isSuccess = true
|
||||||
val result = BehaviorSubject.createDefault(true)
|
val result = BehaviorSubject.createDefault(true)
|
||||||
|
@ -292,7 +292,7 @@ class EopatchPumpPlugin @Inject constructor(
|
||||||
if (patchManager.patchConnectionState.isConnected) {
|
if (patchManager.patchConnectionState.isConnected) {
|
||||||
val delivering = patchManager.bolusCurrent.nowBolus.injected
|
val delivering = patchManager.bolusCurrent.nowBolus.injected
|
||||||
rxBus.send(EventOverviewBolusProgress.apply {
|
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)
|
percent = min((delivering / detailedBolusInfo.insulin * 100).toInt(), 100)
|
||||||
t = tr
|
t = tr
|
||||||
})
|
})
|
||||||
|
@ -319,7 +319,7 @@ class EopatchPumpPlugin @Inject constructor(
|
||||||
patchManager.addBolusToHistory(detailedBolusInfo)
|
patchManager.addBolusToHistory(detailedBolusInfo)
|
||||||
|
|
||||||
return PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(0.0)
|
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) }
|
.map { PumpEnactResult(injector).success(true).enacted(true) }
|
||||||
.onErrorReturnItem(
|
.onErrorReturnItem(
|
||||||
PumpEnactResult(injector).success(false).enacted(false).bolusDelivered(0.0)
|
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()
|
.blockingGet()
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ class EopatchPumpPlugin @Inject constructor(
|
||||||
.map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) }
|
.map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) }
|
||||||
.onErrorReturnItem(
|
.onErrorReturnItem(
|
||||||
PumpEnactResult(injector).success(false).enacted(false)
|
PumpEnactResult(injector).success(false).enacted(false)
|
||||||
.comment(rh.gs(info.nightscout.core.main.R.string.error))
|
.comment(rh.gs(R.string.error))
|
||||||
)
|
)
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
}
|
}
|
||||||
|
@ -478,7 +478,7 @@ class EopatchPumpPlugin @Inject constructor(
|
||||||
.map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) }
|
.map { PumpEnactResult(injector).success(true).enacted(true).isTempCancel(true) }
|
||||||
.onErrorReturnItem(
|
.onErrorReturnItem(
|
||||||
PumpEnactResult(injector).success(false).enacted(false)
|
PumpEnactResult(injector).success(false).enacted(false)
|
||||||
.comment(rh.gs(info.nightscout.core.main.R.string.error))
|
.comment(rh.gs(R.string.error))
|
||||||
)
|
)
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
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.api.GetInternalSuspendTime;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchInternalSuspendTimeResponse;
|
import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchInternalSuspendTimeResponse;
|
||||||
import info.nightscout.interfaces.pump.PumpSync;
|
import info.nightscout.interfaces.pump.PumpSync;
|
||||||
|
|
|
@ -9,13 +9,13 @@ import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
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.AlarmCode;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry;
|
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.ble.IPreferenceManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalPause;
|
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.core.response.PatchBooleanResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState;
|
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.pump.PumpSync;
|
||||||
import info.nightscout.interfaces.queue.Callback;
|
import info.nightscout.interfaces.queue.Callback;
|
||||||
import info.nightscout.interfaces.queue.Command;
|
import info.nightscout.interfaces.queue.Command;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
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.ble.IPreferenceManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalStop;
|
import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalStop;
|
||||||
import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalStopResponse;
|
import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalStopResponse;
|
||||||
|
|
|
@ -670,7 +670,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley
|
||||||
// neither carbs nor bolus requested
|
// neither carbs nor bolus requested
|
||||||
aapsLogger.error("deliverTreatment: Invalid input: neither carbs nor insulin are set in treatment");
|
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)
|
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) {
|
} else if (detailedBolusInfo.insulin > 0) {
|
||||||
// bolus needed, ask pump to deliver it
|
// bolus needed, ask pump to deliver it
|
||||||
return deliverBolus(detailedBolusInfo);
|
return deliverBolus(detailedBolusInfo);
|
||||||
|
|
|
@ -313,7 +313,7 @@ abstract class PumpPluginAbstract protected constructor(
|
||||||
// neither carbs nor bolus requested
|
// neither carbs nor bolus requested
|
||||||
aapsLogger.error("deliverTreatment: Invalid input")
|
aapsLogger.error("deliverTreatment: Invalid input")
|
||||||
PumpEnactResult(injector).success(false).enacted(false).bolusDelivered(0.0).carbsDelivered(0.0)
|
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) {
|
} else if (detailedBolusInfo.insulin > 0) {
|
||||||
// bolus needed, ask pump to deliver it
|
// bolus needed, ask pump to deliver it
|
||||||
deliverBolus(detailedBolusInfo)
|
deliverBolus(detailedBolusInfo)
|
||||||
|
|
|
@ -234,7 +234,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToastUtils.warnToast(this, R.string.invalidinput)
|
ToastUtils.warnToast(this, R.string.invalid_input)
|
||||||
}
|
}
|
||||||
binding.ageLabel.labelFor = binding.age.editTextId
|
binding.ageLabel.labelFor = binding.age.editTextId
|
||||||
binding.tddLabel.labelFor = binding.tdd.editTextId
|
binding.tddLabel.labelFor = binding.tdd.editTextId
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.ui.activities
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.TextView
|
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.activities.NoSplashAppCompatActivity
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -17,7 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.iobCalc
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
|
|
|
@ -14,7 +14,7 @@ import androidx.lifecycle.Lifecycle
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
|
|
|
@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.iobCalc
|
import info.nightscout.androidaps.extensions.iobCalc
|
||||||
import info.nightscout.androidaps.extensions.isInProgress
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
|
|
|
@ -17,7 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.getCustomizedName
|
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.profile.ProfileSealed
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -18,7 +18,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.friendlyDescription
|
import info.nightscout.androidaps.extensions.friendlyDescription
|
||||||
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
import info.nightscout.androidaps.extensions.highValueToUnitsToString
|
||||||
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
|
|
|
@ -18,7 +18,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.extensions.iobCalc
|
import info.nightscout.androidaps.extensions.iobCalc
|
||||||
import info.nightscout.androidaps.extensions.toStringFull
|
import info.nightscout.androidaps.extensions.toStringFull
|
||||||
import info.nightscout.androidaps.extensions.toTemporaryBasal
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.ActionModeHelper
|
import info.nightscout.core.utils.ActionModeHelper
|
||||||
|
|
|
@ -12,7 +12,7 @@ import androidx.lifecycle.Lifecycle
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
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.androidaps.utils.userEntry.UserEntryPresentationHelper
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -11,7 +11,7 @@ import android.view.ViewGroup
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import dagger.android.support.DaggerDialogFragment
|
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.androidaps.services.AlarmSoundServiceHelper
|
||||||
import info.nightscout.core.activities.DialogAppCompatActivity
|
import info.nightscout.core.activities.DialogAppCompatActivity
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.view.ViewGroup
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import dagger.android.support.DaggerDialogFragment
|
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.activities.DialogAppCompatActivity
|
||||||
import info.nightscout.core.main.R
|
import info.nightscout.core.main.R
|
||||||
import info.nightscout.database.entities.UserEntry.Action
|
import info.nightscout.database.entities.UserEntry.Action
|
||||||
|
|
|
@ -6,7 +6,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import dagger.android.HasAndroidInjector
|
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.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.database.entities.UserEntry.Action
|
import info.nightscout.database.entities.UserEntry.Action
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.annotation.StringRes
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.extensions.fromConstant
|
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.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
|
|
|
@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.extensions.formatColor
|
import info.nightscout.core.utils.extensions.formatColor
|
||||||
|
|
|
@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.extensions.formatColor
|
import info.nightscout.core.utils.extensions.formatColor
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.insertBolusTransaction
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -11,7 +11,7 @@ import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import dagger.android.support.DaggerDialogFragment
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||||
|
|
|
@ -9,7 +9,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import com.google.common.base.Joiner
|
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.profile.ProfileSealed
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
|
|
|
@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.core.utils.extensions.formatColor
|
import info.nightscout.core.utils.extensions.formatColor
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import com.google.common.collect.Lists
|
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.dialogs.OKDialog
|
||||||
import info.nightscout.core.ui.toast.ToastUtils
|
import info.nightscout.core.ui.toast.ToastUtils
|
||||||
import info.nightscout.database.entities.TemporaryTarget
|
import info.nightscout.database.entities.TemporaryTarget
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
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.insertBolusTransaction
|
||||||
import info.nightscout.core.pump.insertCarbsTransaction
|
import info.nightscout.core.pump.insertCarbsTransaction
|
||||||
import info.nightscout.core.ui.dialogs.OKDialog
|
import info.nightscout.core.ui.dialogs.OKDialog
|
||||||
|
|
Loading…
Reference in a new issue