sync -> plugins module
This commit is contained in:
parent
936192b0de
commit
34320ad8ca
|
@ -171,16 +171,12 @@
|
|||
android:scheme="wear" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".plugins.sync.nsclient.services.NSClientService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<service
|
||||
android:name=".services.AlarmSoundService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<service
|
||||
android:name=".plugins.general.overview.notifications.DismissNotificationService"
|
||||
android:name="info.nightscout.plugins.general.overview.notifications.DismissNotificationService"
|
||||
android:exported="false" />
|
||||
|
||||
<service android:name=".plugins.general.persistentNotification.DummyService" />
|
||||
|
|
|
@ -40,28 +40,28 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
|||
import info.nightscout.androidaps.databinding.ActivityMainBinding
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.interfaces.AndroidPermission
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.IconsProvider
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.interfaces.SmsCommunicator
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.androidaps.setupwizard.SetupWizardActivity
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.androidaps.utils.extensions.isRunningRealPumpTest
|
||||
import info.nightscout.interfaces.locale.LocaleHelper
|
||||
import info.nightscout.androidaps.utils.protection.PasswordCheck
|
||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
||||
import info.nightscout.androidaps.utils.tabs.TabPageAdapter
|
||||
import info.nightscout.androidaps.utils.ui.UIRunnable
|
||||
import info.nightscout.interfaces.AndroidPermission
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.SmsCommunicator
|
||||
import info.nightscout.interfaces.locale.LocaleHelper
|
||||
import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.events.EventAppExit
|
||||
import info.nightscout.rx.events.EventInitializationChanged
|
||||
|
|
|
@ -23,30 +23,30 @@ import info.nightscout.androidaps.database.transactions.VersionChangeTransaction
|
|||
import info.nightscout.androidaps.db.CompatDBHelper
|
||||
import info.nightscout.androidaps.di.DaggerAppComponent
|
||||
import info.nightscout.androidaps.di.StaticInjector
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.ConfigBuilder
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.androidaps.receivers.BTReceiver
|
||||
import info.nightscout.androidaps.receivers.ChargingStateReceiver
|
||||
import info.nightscout.androidaps.receivers.KeepAliveWorker
|
||||
import info.nightscout.androidaps.receivers.NetworkChangeReceiver
|
||||
import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.ProcessLifecycleListener
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.interfaces.locale.LocaleHelper
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.ui.utils.ActivityMonitor
|
||||
import info.nightscout.ui.widget.Widget
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
|
@ -124,7 +124,7 @@ class MainApp : DaggerApplication() {
|
|||
// log version
|
||||
disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe()
|
||||
// log app start
|
||||
if (sp.getBoolean(R.string.key_ns_logappstartedevent, config.APS))
|
||||
if (sp.getBoolean(R.string.key_ns_log_app_started_event, config.APS))
|
||||
disposable += repository
|
||||
.runTransaction(
|
||||
InsertIfNewByTimestampTherapyEventTransaction(
|
||||
|
@ -214,8 +214,8 @@ class MainApp : DaggerApplication() {
|
|||
}
|
||||
sp.remove("ns_charginonly")
|
||||
}
|
||||
if (!sp.contains(R.string.key_ns_logappstartedevent))
|
||||
sp.putBoolean(R.string.key_ns_logappstartedevent, config.APS)
|
||||
if (!sp.contains(R.string.key_ns_log_app_started_event))
|
||||
sp.putBoolean(R.string.key_ns_log_app_started_event, config.APS)
|
||||
}
|
||||
|
||||
override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
|
||||
|
|
|
@ -23,11 +23,9 @@ import info.nightscout.androidaps.danar.DanaRPlugin
|
|||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader
|
||||
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
|
@ -41,7 +39,6 @@ import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
|||
import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
||||
|
@ -53,10 +50,6 @@ import info.nightscout.androidaps.plugins.source.GlunovoPlugin
|
|||
import info.nightscout.androidaps.plugins.source.IntelligoPlugin
|
||||
import info.nightscout.androidaps.plugins.source.PoctechPlugin
|
||||
import info.nightscout.androidaps.plugins.source.TomatoPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolPlugin
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show
|
||||
import info.nightscout.androidaps.utils.protection.PasswordCheck
|
||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.BIOMETRIC
|
||||
|
@ -64,13 +57,20 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionTyp
|
|||
import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.CUSTOM_PIN
|
||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.NONE
|
||||
import info.nightscout.automation.AutomationPlugin
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.plugins.general.autotune.AutotunePlugin
|
||||
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import info.nightscout.plugins.general.xdripStatusline.StatusLinePlugin
|
||||
import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.plugins.sync.tidepool.TidepoolPlugin
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventRebuildTabs
|
||||
import info.nightscout.shared.SafeParse
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
@ -10,28 +10,17 @@ import info.nightscout.androidaps.MainApp
|
|||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.implementations.ActivityNamesImpl
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.interfaces.ActivityNames
|
||||
import info.nightscout.interfaces.AndroidPermission
|
||||
import info.nightscout.interfaces.Autotune
|
||||
import info.nightscout.interfaces.BolusTimer
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.CarbTimer
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.ConfigBuilder
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector
|
||||
import info.nightscout.androidaps.interfaces.IconsProvider
|
||||
import info.nightscout.androidaps.interfaces.ImportExportPrefs
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.interfaces.SmsCommunicator
|
||||
import info.nightscout.androidaps.interfaces.TrendCalculator
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator
|
||||
|
@ -44,18 +33,12 @@ import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctionImpl
|
|||
import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefsImpl
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.PumpSyncImplementation
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.DataSyncSelectorImplementation
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
import info.nightscout.androidaps.utils.androidNotification.NotificationHolderImpl
|
||||
import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.utils.resources.IconsProviderImplementation
|
||||
import info.nightscout.interfaces.storage.FileStorage
|
||||
import info.nightscout.interfaces.storage.Storage
|
||||
import info.nightscout.implementation.AndroidPermissionImpl
|
||||
import info.nightscout.implementation.BolusTimerImpl
|
||||
import info.nightscout.implementation.CarbTimerImpl
|
||||
|
@ -63,16 +46,33 @@ import info.nightscout.implementation.LocalAlertUtilsImpl
|
|||
import info.nightscout.implementation.TrendCalculatorImpl
|
||||
import info.nightscout.implementation.XDripBroadcastImpl
|
||||
import info.nightscout.implementation.constraints.ConstraintsImpl
|
||||
import info.nightscout.implementation.pump.PumpSyncImplementation
|
||||
import info.nightscout.implementation.queue.CommandQueueImplementation
|
||||
import info.nightscout.implementation.stats.DexcomTirCalculatorImpl
|
||||
import info.nightscout.implementation.stats.TddCalculatorImpl
|
||||
import info.nightscout.implementation.stats.TirCalculatorImpl
|
||||
import info.nightscout.interfaces.ActivityNames
|
||||
import info.nightscout.interfaces.AndroidPermission
|
||||
import info.nightscout.interfaces.Autotune
|
||||
import info.nightscout.interfaces.BolusTimer
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.CarbTimer
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.interfaces.SmsCommunicator
|
||||
import info.nightscout.interfaces.storage.FileStorage
|
||||
import info.nightscout.interfaces.storage.Storage
|
||||
import info.nightscout.plugins.general.autotune.AutotunePlugin
|
||||
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -23,12 +23,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragmen
|
|||
import info.nightscout.androidaps.plugins.general.overview.OverviewFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearFragment
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment
|
||||
import info.nightscout.androidaps.plugins.source.BGSourceFragment
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.NSClientFragment
|
||||
import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolFragment
|
||||
import info.nightscout.androidaps.utils.protection.PasswordCheck
|
||||
import info.nightscout.plugins.general.autotune.AutotuneFragment
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
@ -37,21 +32,14 @@ abstract class FragmentsModule {
|
|||
@ContributesAndroidInjector abstract fun contributesPreferencesFragment(): MyPreferenceFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesActionsFragment(): ActionsFragment
|
||||
@ContributesAndroidInjector abstract fun contributesAutotuneFragment(): AutotuneFragment
|
||||
@ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment
|
||||
@ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
|
||||
@ContributesAndroidInjector abstract fun contributesObjectivesFragment(): ObjectivesFragment
|
||||
@ContributesAndroidInjector abstract fun contributesOpenAPSFragment(): OpenAPSFragment
|
||||
@ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment
|
||||
@ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment
|
||||
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
|
||||
@ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesTidepoolFragment(): TidepoolFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesVirtualPumpFragment(): VirtualPumpFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesExtendedBolusDialog(): ExtendedBolusDialog
|
||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.di
|
|||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationWithAction
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -31,7 +31,6 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
||||
|
@ -41,14 +40,10 @@ import info.nightscout.androidaps.plugins.source.GlimpPlugin
|
|||
import info.nightscout.androidaps.plugins.source.GlunovoPlugin
|
||||
import info.nightscout.androidaps.plugins.source.IntelligoPlugin
|
||||
import info.nightscout.androidaps.plugins.source.MM640gPlugin
|
||||
import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.androidaps.plugins.source.PoctechPlugin
|
||||
import info.nightscout.androidaps.plugins.source.RandomBgPlugin
|
||||
import info.nightscout.androidaps.plugins.source.TomatoPlugin
|
||||
import info.nightscout.androidaps.plugins.source.XdripPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolPlugin
|
||||
import info.nightscout.automation.AutomationPlugin
|
||||
import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin
|
||||
import info.nightscout.plugins.constraints.dstHelper.DstHelperPlugin
|
||||
|
@ -65,6 +60,11 @@ import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin
|
|||
import info.nightscout.plugins.insulin.InsulinOrefRapidActingPlugin
|
||||
import info.nightscout.plugins.insulin.InsulinOrefUltraRapidActingPlugin
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.plugins.sync.tidepool.TidepoolPlugin
|
||||
import javax.inject.Qualifier
|
||||
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -2,12 +2,11 @@ package info.nightscout.androidaps.di
|
|||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.services.NSClientService
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService
|
||||
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
|
||||
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobile
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.automation.services.LocationService
|
||||
import info.nightscout.plugins.general.overview.notifications.DismissNotificationService
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
@ -17,6 +16,5 @@ abstract class ServicesModule {
|
|||
@ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService
|
||||
@ContributesAndroidInjector abstract fun contributesDummyService(): DummyService
|
||||
@ContributesAndroidInjector abstract fun contributesLocationService(): LocationService
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService
|
||||
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile
|
||||
}
|
|
@ -8,21 +8,9 @@ import info.nightscout.androidaps.plugins.source.DexcomPlugin
|
|||
import info.nightscout.androidaps.plugins.source.EversensePlugin
|
||||
import info.nightscout.androidaps.plugins.source.GlimpPlugin
|
||||
import info.nightscout.androidaps.plugins.source.MM640gPlugin
|
||||
import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.androidaps.plugins.source.PoctechPlugin
|
||||
import info.nightscout.androidaps.plugins.source.TomatoPlugin
|
||||
import info.nightscout.androidaps.plugins.source.XdripPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddAckWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddUpdateWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientMbgWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientUpdateRemoveAckWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadBgWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadStatusWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.ProcessTreatmentsWorker
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
|
||||
@Module
|
||||
|
@ -36,19 +24,7 @@ abstract class WorkersModule {
|
|||
@ContributesAndroidInjector abstract fun contributesPoctechWorker(): PoctechPlugin.PoctechWorker
|
||||
@ContributesAndroidInjector abstract fun contributesTomatoWorker(): TomatoPlugin.TomatoWorker
|
||||
@ContributesAndroidInjector abstract fun contributesEversenseWorker(): EversensePlugin.EversenseWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientSourceWorker(): NSClientSourcePlugin.NSClientSourceWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSProfileWorker(): ProfilePlugin.NSProfileWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientWorker(): NSClientAddUpdateWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientAddAckWorker(): NSClientAddAckWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientUpdateRemoveAckWorker(): NSClientUpdateRemoveAckWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientMbgWorker(): NSClientMbgWorker
|
||||
@ContributesAndroidInjector abstract fun contributesCsvExportWorker(): ImportExportPrefsImpl.CsvExportWorker
|
||||
@ContributesAndroidInjector abstract fun contributesAidexWorker(): AidexPlugin.AidexWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadStatusWorker(): LoadStatusWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadLastModificationWorker(): LoadLastModificationWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadBgWorker(): LoadBgWorker
|
||||
@ContributesAndroidInjector abstract fun contributesStoreBgWorker(): StoreDataForDb.StoreBgWorker
|
||||
@ContributesAndroidInjector abstract fun contributesTreatmentWorker(): LoadTreatmentsWorker
|
||||
@ContributesAndroidInjector abstract fun contributesProcessTreatmentsWorker(): ProcessTreatmentsWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadDeviceStatusWorker(): LoadDeviceStatusWorker
|
||||
}
|
|
@ -41,20 +41,15 @@ import info.nightscout.androidaps.interfaces.Profile
|
|||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui
|
||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
|
||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.extensions.buildDeviceStatus
|
||||
import info.nightscout.interfaces.ActivityNames
|
||||
import info.nightscout.interfaces.Config
|
||||
|
@ -63,6 +58,8 @@ import info.nightscout.interfaces.PluginDescription
|
|||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAcceptOpenLoopChange
|
||||
|
@ -71,7 +68,10 @@ import info.nightscout.rx.events.EventTempTargetChange
|
|||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.rx.weardata.EventData
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -16,7 +16,6 @@ import info.nightscout.androidaps.interfaces.PluginBase
|
|||
import info.nightscout.androidaps.interfaces.ProfileSource
|
||||
import info.nightscout.androidaps.interfaces.Pump
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||
|
@ -29,6 +28,7 @@ import info.nightscout.rx.events.EventConfigBuilderChange
|
|||
import info.nightscout.rx.events.EventRebuildTabs
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -138,7 +138,7 @@ class ConfigBuilderPlugin @Inject constructor(
|
|||
|
||||
// Ask when switching to physical pump plugin
|
||||
fun switchAllowed(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {
|
||||
if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != rh.gs(R.string.virtualpump))
|
||||
if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != rh.gs(R.string.virtual_pump))
|
||||
confirmPumpPluginActivation(changedPlugin, newState, activity, type)
|
||||
else if (changedPlugin.getType() == PluginType.PUMP) {
|
||||
performPluginSwitch(changedPlugin, newState, type)
|
||||
|
|
|
@ -12,20 +12,20 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit
|
|||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.ProfileStore
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.extensions.fromConstant
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
|
|
@ -6,7 +6,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin
|
|||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective0
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective1
|
||||
|
@ -22,6 +21,7 @@ import info.nightscout.interfaces.Config
|
|||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -91,8 +91,8 @@ class ObjectivesPlugin @Inject constructor(
|
|||
objective.startedOn = 0
|
||||
objective.accomplishedOn = 0
|
||||
}
|
||||
sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false)
|
||||
sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false)
|
||||
sp.putBoolean(R.string.key_objectives_bg_is_available_in_ns, false)
|
||||
sp.putBoolean(R.string.key_objectives_pump_status_is_available_in_ns, false)
|
||||
sp.putInt(R.string.key_ObjectivesmanualEnacts, 0)
|
||||
sp.putBoolean(R.string.key_objectiveuseprofileswitch, false)
|
||||
sp.putBoolean(R.string.key_objectiveusedisconnect, false)
|
||||
|
|
|
@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin
|
|||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import javax.inject.Inject
|
||||
|
||||
class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R.string.objectives_0_objective, R.string.objectives_0_gate) {
|
||||
|
@ -22,7 +22,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
|
|||
init {
|
||||
tasks.add(object : Task(this, R.string.objectives_bgavailableinns) {
|
||||
override fun isCompleted(): Boolean {
|
||||
return sp.getBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false)
|
||||
return sp.getBoolean(R.string.key_objectives_bg_is_available_in_ns, false)
|
||||
}
|
||||
})
|
||||
tasks.add(object : Task(this, R.string.synchaswritepermission) {
|
||||
|
@ -32,7 +32,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
|
|||
})
|
||||
tasks.add(object : Task(this, R.string.virtualpump_uploadstatus_title) {
|
||||
override fun isCompleted(): Boolean {
|
||||
return sp.getBoolean(R.string.key_virtualpump_uploadstatus, false)
|
||||
return sp.getBoolean(R.string.key_virtual_pump_upload_status, false)
|
||||
}
|
||||
|
||||
override fun shouldBeIgnored(): Boolean {
|
||||
|
@ -41,7 +41,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
|
|||
})
|
||||
tasks.add(object : Task(this, R.string.objectives_pumpstatusavailableinns) {
|
||||
override fun isCompleted(): Boolean {
|
||||
return sp.getBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false)
|
||||
return sp.getBoolean(R.string.key_objectives_pump_status_is_available_in_ns, false)
|
||||
}
|
||||
})
|
||||
tasks.add(object : Task(this, R.string.hasbgdata) {
|
||||
|
|
|
@ -7,25 +7,22 @@ import android.os.Bundle
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.extensions.durationInMinutes
|
||||
import info.nightscout.shared.extensions.safeQueryBroadcastReceivers
|
||||
import info.nightscout.androidaps.extensions.toStringFull
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.androidaps.receivers.Intents
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
||||
|
@ -33,6 +30,9 @@ import info.nightscout.rx.events.EventAutosensCalculationFinished
|
|||
import info.nightscout.rx.events.EventOverviewBolusProgress
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.extensions.safeQueryBroadcastReceivers
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -7,15 +7,15 @@ import androidx.core.content.FileProvider
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.BuildConfig
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.general.maintenance.LoggerUtils
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import java.io.BufferedInputStream
|
||||
import java.io.BufferedOutputStream
|
||||
|
|
|
@ -46,8 +46,6 @@ import info.nightscout.androidaps.events.EventNewBG
|
|||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||
import info.nightscout.androidaps.extensions.directionToIcon
|
||||
import info.nightscout.shared.extensions.runOnUiThread
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
|
@ -59,7 +57,6 @@ import info.nightscout.androidaps.interfaces.Loop
|
|||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.TrendCalculator
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification
|
||||
|
@ -68,19 +65,14 @@ import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizar
|
|||
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.EventUpdateOverviewIobCob
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.source.DexcomPlugin
|
||||
import info.nightscout.androidaps.plugins.source.XdripPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.androidaps.skins.SkinProvider
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
|
@ -95,6 +87,10 @@ import info.nightscout.interfaces.Config
|
|||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAcceptOpenLoopChange
|
||||
|
@ -106,7 +102,11 @@ import info.nightscout.rx.events.EventTempBasalChange
|
|||
import info.nightscout.rx.events.EventTempTargetChange
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.weardata.EventData
|
||||
import info.nightscout.shared.extensions.runOnUiThread
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.ui.dialogs.CalibrationDialog
|
||||
import info.nightscout.ui.dialogs.CarbsDialog
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
|
@ -505,7 +505,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
|
||||
R.id.temp_target -> v.performClick()
|
||||
R.id.active_profile -> activity?.let { activity ->
|
||||
if (loop.isDisconnected) OKDialog.show(activity, rh.gs(R.string.not_available_full), rh.gs(R.string.smscommunicator_pumpdisconnected))
|
||||
if (loop.isDisconnected) OKDialog.show(activity, rh.gs(R.string.not_available_full), rh.gs(R.string.smscommunicator_pump_disconnected))
|
||||
else
|
||||
protectionCheck.queryProtection(
|
||||
activity,
|
||||
|
|
|
@ -13,24 +13,24 @@ import info.nightscout.androidaps.extensions.putString
|
|||
import info.nightscout.androidaps.extensions.storeDouble
|
||||
import info.nightscout.androidaps.extensions.storeInt
|
||||
import info.nightscout.androidaps.extensions.storeString
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.Overview
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
|
|
@ -6,13 +6,13 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.databinding.WearFragmentBinding
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventMobileToWear
|
||||
import info.nightscout.rx.weardata.EventData
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -33,20 +33,16 @@ import info.nightscout.androidaps.interfaces.Loop
|
|||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.TrendCalculator
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.androidaps.utils.wizard.BolusWizard
|
||||
import info.nightscout.androidaps.utils.wizard.QuickWizard
|
||||
|
@ -54,13 +50,17 @@ import info.nightscout.androidaps.utils.wizard.QuickWizardEntry
|
|||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventMobileToWear
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.rx.weardata.EventData
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.ui.dialogs.CarbsDialog
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
|
|
@ -5,22 +5,23 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.androidaps.receivers.Intents
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
|
|
@ -18,23 +18,24 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction
|
||||
import info.nightscout.androidaps.extensions.fromConstant
|
||||
import info.nightscout.shared.extensions.safeGetInstalledPackages
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.source.activities.RequestDexcomPermissionActivity
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.extensions.safeGetInstalledPackages
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.math.abs
|
||||
|
|
|
@ -13,15 +13,16 @@ import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
|||
import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.util.Arrays
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
|
@ -12,12 +12,13 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -34,7 +35,7 @@ class GlimpPlugin @Inject constructor(
|
|||
.mainType(PluginType.BGSOURCE)
|
||||
.fragmentClass(BGSourceFragment::class.java.name)
|
||||
.pluginIcon(R.drawable.ic_glimp)
|
||||
.pluginName(R.string.Glimp)
|
||||
.pluginName(R.string.glimp)
|
||||
.preferencesId(R.xml.pref_bgsource)
|
||||
.description(R.string.description_source_glimp),
|
||||
aapsLogger, rh, injector
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.net.Uri
|
|||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
|
@ -15,17 +14,19 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.os.Handler
|
|||
import android.os.HandlerThread
|
||||
import android.util.Log
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
|
@ -15,20 +14,22 @@ import info.nightscout.androidaps.database.entities.TherapyEvent
|
|||
import info.nightscout.androidaps.database.entities.UserEntry
|
||||
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.shared.extensions.safeGetInstalledPackages
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.extensions.safeGetInstalledPackages
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
|
@ -11,15 +11,16 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONException
|
||||
import javax.inject.Inject
|
||||
|
@ -36,7 +37,7 @@ class MM640gPlugin @Inject constructor(
|
|||
.mainType(PluginType.BGSOURCE)
|
||||
.fragmentClass(BGSourceFragment::class.java.name)
|
||||
.pluginIcon(R.drawable.ic_generic_cgm)
|
||||
.pluginName(R.string.MM640g)
|
||||
.pluginName(R.string.mm640g)
|
||||
.description(R.string.description_source_mm640g),
|
||||
aapsLogger, rh, injector
|
||||
), BgSource {
|
||||
|
|
|
@ -5,20 +5,21 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.interfaces.utils.JsonHelper.safeGetString
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONException
|
||||
|
|
|
@ -10,17 +10,18 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.extensions.isRunningTest
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import java.util.Calendar
|
||||
|
|
|
@ -11,12 +11,13 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
|
@ -11,13 +11,14 @@ import info.nightscout.androidaps.database.entities.GlucoseValue
|
|||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.androidaps.receivers.Intents
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
|
|
@ -22,21 +22,21 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
import info.nightscout.androidaps.queue.commands.Command
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.extensions.buildDeviceStatus
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.LocalAlertUtils
|
||||
import info.nightscout.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventProfileSwitchChanged
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.ui.widget.Widget
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -16,14 +16,12 @@ import info.nightscout.androidaps.interfaces.CommandQueue
|
|||
import info.nightscout.androidaps.interfaces.ConfigBuilder
|
||||
import info.nightscout.androidaps.interfaces.ImportExportPrefs
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWBreak
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWButton
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWEditEncryptedPassword
|
||||
|
@ -47,7 +45,9 @@ import info.nightscout.interfaces.Constants
|
|||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.profile.ProfileFragment
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
|
@ -12,12 +12,12 @@ import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding
|
|||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWItem
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.interfaces.locale.LocaleHelper.update
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.events.EventProfileStoreChanged
|
||||
import info.nightscout.rx.events.EventProfileSwitchChanged
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package info.nightscout.androidaps.utils.extensions
|
||||
|
||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSMbg
|
||||
|
||||
fun therapyEventFromNsMbg(mbg: NSMbg) =
|
||||
TherapyEvent(
|
||||
type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, //convert Mbg to finger stick because is coming from "entries" collection
|
||||
timestamp = mbg.date,
|
||||
glucose = mbg.mbg,
|
||||
glucoseUnit = TherapyEvent.GlucoseUnit.MGDL
|
||||
)
|
|
@ -8,18 +8,18 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
import java.util.Calendar
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.ceil
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/virtualpump_extendedbolus_label"
|
||||
android:text="@string/extended_bolus_label"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/log"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="" />
|
||||
|
||||
</ScrollView>
|
|
@ -92,38 +92,6 @@
|
|||
<item>@string/key_pregnant</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="virtualPumpTypes">
|
||||
<item>Generic AAPS</item>
|
||||
<item>MDI</item>
|
||||
<item>Accu-Chek Combo</item>
|
||||
<item>Accu-Chek Spirit</item>
|
||||
<item>Accu-Chek Insight</item>
|
||||
<item>Accu-Chek Solo</item>
|
||||
<item>Animas Ping</item>
|
||||
<item>Animas Vibe</item>
|
||||
<item>Cellnovo</item>
|
||||
<item>DanaR</item>
|
||||
<item>DanaR Korean</item>
|
||||
<item>DanaRS</item>
|
||||
<item>DanaRv2</item>
|
||||
<item>DanaI</item>
|
||||
<item>Diaconn G8</item>
|
||||
<item>Eoflow Eopatch2</item>
|
||||
<item>Medtronic 512/712</item>
|
||||
<item>Medtronic 515/715</item>
|
||||
<item>Medtronic 522/722</item>
|
||||
<item>Medtronic 523/723 (Revel)</item>
|
||||
<item>Medtronic 554/754 (Veo)</item>
|
||||
<item>Medtronic 640G</item>
|
||||
<item>Omnipod Dash</item>
|
||||
<item>Omnipod Eros</item>
|
||||
<item>Tandem t:slim</item>
|
||||
<item>Tandem t:flex</item>
|
||||
<item>Tandem t:slim G4</item>
|
||||
<item>Tandem t:slim X2</item>
|
||||
<item>YpsoPump</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="smbMaxMinutes">
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
<string name="key_objectiveuseloop" translatable="false">ObjectivesLoopUsed</string>
|
||||
<string name="key_objectiveusescale" translatable="false">ObjectivesScaleUsed</string>
|
||||
<string name="key_objectives_request_code" translatable="false">objectives_request_code</string>
|
||||
<string name="key_ObjectivesbgIsAvailableInNS" translatable="false">ObjectivesbgIsAvailableInNS</string>
|
||||
<string name="key_ObjectivespumpStatusIsAvailableInNS" translatable="false">ObjectivespumpStatusIsAvailableInNS</string>
|
||||
<string name="key_ObjectivesmanualEnacts" translatable="false">ObjectivesmanualEnacts</string>
|
||||
|
||||
<string name="objectives_button_start">Start</string>
|
||||
|
|
|
@ -32,25 +32,8 @@
|
|||
<string name="key_smscommunicator_settings" translatable="false">smscommunicator</string>
|
||||
<string name="key_protection_settings" translatable="false">protection</string>
|
||||
<string name="key_absorption_category_settings" translatable="false">absorption_category_settings</string>
|
||||
<string name="key_ns_temporary_target_last_synced_id" translatable="false">ns_temporary_target_last_sync</string>
|
||||
<string name="key_ns_glucose_value_last_synced_id" translatable="false">ns_glucose_value_last_sync</string>
|
||||
<string name="key_ns_food_last_synced_id" translatable="false">ns_food_last_sync</string>
|
||||
<string name="key_ns_therapy_event_last_synced_id" translatable="false">ns_therapy_event_last_sync</string>
|
||||
<string name="key_openapsama_bolussnooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
|
||||
<string name="key_openapsama_autosens_adjusttargets" translatable="false">autosens_adjust_targets</string>
|
||||
<string name="key_ns_bolus_calculator_result_last_synced_id" translatable="false">ns_bolus_calculator_result_last_synced_id</string>
|
||||
<string name="key_ns_carbs_last_synced_id" translatable="false">ns_carbs_last_synced_id</string>
|
||||
<string name="key_ns_bolus_last_synced_id" translatable="false">ns_bolus_last_synced_id</string>
|
||||
<string name="key_ns_device_status_last_synced_id" translatable="false">ns_device_status_last_synced_id</string>
|
||||
<string name="key_ns_temporary_basal_last_synced_id" translatable="false">ns_temporary_basal_last_synced_id</string>
|
||||
<string name="key_ns_extended_bolus_last_synced_id" translatable="false">ns_extended_bolus_last_synced_id</string>
|
||||
<string name="key_ns_profile_switch_last_synced_id" translatable="false">profile_switch_last_synced_id</string>
|
||||
<string name="key_ns_effective_profile_switch_last_synced_id" translatable="false">ns_effective_profile_switch_last_synced_id</string>
|
||||
<string name="key_ns_offline_event_last_synced_id" translatable="false">ns_offline_event_last_synced_id</string>
|
||||
<string name="key_ns_profile_store_last_synced_timestamp" translatable="false">ns_profile_store_last_synced_timestamp</string>
|
||||
<string name="key_ns_sync_slow" translatable="false">ns_sync_slow</string>
|
||||
<string name="key_nsclient_token" translatable="false">nsclient_token</string>
|
||||
<string name="key_nsclientv2_lastmodified" translatable="false">nsclientv2_lastmodified</string>
|
||||
<string name="key_last_cleanup_run" translatable="false">last_cleanup_run</string>
|
||||
<string name="treatmentssafety_title">Treatments safety</string>
|
||||
<string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string>
|
||||
|
@ -66,26 +49,17 @@
|
|||
<string name="description_config_builder">Used for configuring the active plugins</string>
|
||||
<string name="description_objectives">Learning program</string>
|
||||
<string name="description_loop">Activate or deactivate the implementation triggering the loop.</string>
|
||||
<string name="description_ns_client_v3">Synchronizes your data with Nightscout using v3 API</string>
|
||||
<string name="description_ns_client">Synchronizes your data with Nightscout</string>
|
||||
<string name="description_ama">State of the algorithm in 2017</string>
|
||||
<string name="description_smb">Most recent algorithm for advanced users</string>
|
||||
<string name="description_smb_dynamic_isf">Most recent algorithm for advanced users with dynamic/automatic ISF</string>
|
||||
<string name="description_overview">Displays the current state of your loop and buttons for most common actions</string>
|
||||
<string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string>
|
||||
<string name="description_pump_virtual">Pump integration for pumps which don\'t have any driver yet (Open Loop)</string>
|
||||
<string name="description_sensitivity_aaps">Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences.</string>
|
||||
<string name="description_sensitivity_oref1">Sensitivity is calculated from 8h or 24h data in the past (using either which is more sensitive). Carbs (if not absorbed) are cut after time specified in preferences. Plugin also calculates UAM.</string>
|
||||
<string name="description_sensitivity_weighted_average">Sensitivity is calculated as a weighted average from deviations. Newer deviations have higher weight. Minimal carb absorption is calculated from max carb absorption time from preferences. This algorithm is the fastest in following sensitivity changes.</string>
|
||||
<string name="description_source_eversense">Receive BG values from the patched Eversense app.</string>
|
||||
<string name="description_source_glimp">Receive BG values from Glimp.</string>
|
||||
<string name="description_source_mm640g">Receive BG values from the 600SeriesAndroidUploader.</string>
|
||||
<string name="description_source_ns_client">Downloads BG data from Nightscout</string>
|
||||
<string name="description_source_xdrip">Receive BG values from xDrip+.</string>
|
||||
<string name="description_treatments">Saves all treatments that were made</string>
|
||||
<string name="description_wear">Monitor and control AAPS using your WearOS watch.</string>
|
||||
<string name="openapsma_run">Run now</string>
|
||||
<string name="vitualpump_label">VIRTUAL PUMP</string>
|
||||
<string name="openapsma_lastrun_label">Last run</string>
|
||||
<string name="openapsma_inputparameters_label">Input parameters</string>
|
||||
<string name="openapsma_glucosestatus_label">Glucose status</string>
|
||||
|
@ -101,7 +75,6 @@
|
|||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="overview">Overview</string>
|
||||
<string name="treatments">Treatments</string>
|
||||
<string name="virtualpump">Virtual Pump</string>
|
||||
<string name="configbuilder_pump">Pump</string>
|
||||
<string name="configbuilder_pump_description">Which pump would you like to use with AAPS?</string>
|
||||
<string name="configbuilder_profile">Profile</string>
|
||||
|
@ -127,14 +100,12 @@
|
|||
<string name="changeyourinput">Change your input!</string>
|
||||
<string name="configbuilder_bgsource">BG Source</string>
|
||||
<string name="configbuilder_bgsource_description">Where should AAPS gain it\'s data from?</string>
|
||||
<string name="xdrip">xDrip+</string>
|
||||
<string name="apsmode_title">APS Mode</string>
|
||||
<string name="closedloop">Closed Loop</string>
|
||||
<string name="openloop">Open Loop</string>
|
||||
<string name="lowglucosesuspend">Low Glucose Suspend</string>
|
||||
<string name="openloop_newsuggestion">New suggestion available</string>
|
||||
<string name="carbssuggestion">Carbs Suggestion</string>
|
||||
<string name="unsupportednsversion">Unsupported version of Nightscout</string>
|
||||
<string name="carb_time_label">Carb time</string>
|
||||
<string name="profile_label">Profile</string>
|
||||
<string name="overview_tempbasal_button">TempBasal</string>
|
||||
|
@ -202,7 +173,6 @@
|
|||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
<string name="basal_rate">Basal rate</string>
|
||||
<string name="MM640g">MM640g</string>
|
||||
<string name="ongoingnotificaction">Ongoing Notification</string>
|
||||
<string name="old_data">OLD DATA</string>
|
||||
<string name="openapsama">OpenAPS AMA</string>
|
||||
|
@ -216,7 +186,6 @@
|
|||
<string name="oaps_shortname">OAPS</string>
|
||||
<string name="dynisf_shortname">DYNISF</string>
|
||||
<string name="overview_shortname">HOME</string>
|
||||
<string name="virtualpump_shortname">VPUMP</string>
|
||||
<string name="treatments_shortname">TREAT</string>
|
||||
<string name="objectives_shortname">OBJ</string>
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
|
@ -235,33 +204,6 @@
|
|||
<string name="openapsama_link_to_preferncejson_doc_txt">Attention!\nNormally you do not have to change these values below. Please CLICK HERE and READ the text and make sure you UNDERSTAND it before change any of these values.</string>
|
||||
<string name="openapsama_link_to_preferncejson_doc" translatable="false">http://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-3/beyond-low-glucose-suspend.html</string>
|
||||
<string name="executing">Executing</string>
|
||||
<string name="virtualpump_settings">Virtual pump settings</string>
|
||||
<string name="virtualpump_uploadstatus_title">Upload status to NS</string>
|
||||
<string name="nsclientv3">NSClientV3</string>
|
||||
<string name="nsclientv3_shortname">NSV3</string>
|
||||
<string name="nsclientinternal">NSClient</string>
|
||||
<string name="nsclientinternal_shortname">NSCI</string>
|
||||
<string name="nsclientinternal_url">URL:</string>
|
||||
<string name="nsclientinternal_autoscroll">Autoscroll</string>
|
||||
<string name="restart">Restart</string>
|
||||
<string name="nsclientinternal_title">NSClient</string>
|
||||
<string name="nsclientinternal_url_title">Nightscout URL</string>
|
||||
<string name="nsclientinternal_url_dialogmessage">Enter Your Nightscout URL</string>
|
||||
<string name="nsclientinternal_secret_title">NS API secret</string>
|
||||
<string name="nsclientinternal_secret_dialogtitle">NS API secret</string>
|
||||
<string name="nsclientinternal_secret_dialogmessage">Enter NS API secret (min 12 chars)</string>
|
||||
<string name="nsclient_token_title">NS access token</string>
|
||||
<string name="nsclient_token_dialog_title">NS access token</string>
|
||||
<string name="nsclient_token_dialog_message">Access token generated on NS admin page (min 17 chars)</string>
|
||||
<string name="deliver_now">Deliver now</string>
|
||||
<string name="clear_queue">Clear queue</string>
|
||||
<string name="show_queue">Show queue</string>
|
||||
<string name="queue">Queue:</string>
|
||||
<string name="status">Status:</string>
|
||||
<string name="clearlog">Clear log</string>
|
||||
<string name="key_nsclientinternal_autoscroll" translatable="false">nsclientinternal_autoscroll</string>
|
||||
<string name="key_nsclientinternal_paused" translatable="false">nsclientinternal_paused</string>
|
||||
<string name="nowritepermission">NSCLIENT has no write permission. Wrong API secret?</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="nosuccess">not successful - please check phone</string>
|
||||
<string name="patientage">Patient type</string>
|
||||
|
@ -274,7 +216,6 @@
|
|||
<string name="patient_name">Patient name</string>
|
||||
<string name="patient_name_summary">Please provide patient name or nickname to differentiate among multiple setups</string>
|
||||
<string name="key_i_understand" translatable="false">I_understand</string>
|
||||
<string name="Glimp">Glimp</string>
|
||||
<string name="suspendloopfor1h">Suspend loop for 1h</string>
|
||||
<string name="suspendloopfor2h">Suspend loop for 2h</string>
|
||||
<string name="suspendloopfor3h">Suspend loop for 3h</string>
|
||||
|
@ -293,42 +234,11 @@
|
|||
<string name="duration10h">10 hours</string>
|
||||
<string name="resume">Resume</string>
|
||||
<string name="reconnect">Reconnect Pump</string>
|
||||
<string name="ns_logappstartedevent">Log app start to NS</string>
|
||||
<string name="restartingapp">Exiting application to apply settings.</string>
|
||||
<string name="configbuilder_insulin_description">Which type of insulin are you using?</string>
|
||||
<string name="key_usesuperbolus" translatable="false">key_usersuperbolus</string>
|
||||
<string name="enablesuperbolus">Enable superbolus in wizard</string>
|
||||
<string name="enablesuperbolus_summary">Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY!</string>
|
||||
<string name="key_show_statuslights" translatable="false">show_statuslights</string>
|
||||
<string name="show_statuslights">Show status lights on home screen</string>
|
||||
<string name="key_statuslights_cage_warning" translatable="false">statuslights_cage_warning</string>
|
||||
<string name="statuslights_cage_warning">Threshold warning canula age [h]</string>
|
||||
<string name="key_statuslights_cage_critical" translatable="false">statuslights_cage_critical</string>
|
||||
<string name="statuslights_cage_critical">Threshold critical canula age [h]</string>
|
||||
<string name="key_statuslights_iage_warning" translatable="false">statuslights_iage_warning</string>
|
||||
<string name="statuslights_iage_warning">Threshold warning insulin age [h]</string>
|
||||
<string name="key_statuslights_iage_critical" translatable="false">statuslights_iage_critical</string>
|
||||
<string name="statuslights_iage_critical">Threshold critical insulin age [h]</string>
|
||||
<string name="key_statuslights_sage_warning" translatable="false">statuslights_sage_warning</string>
|
||||
<string name="statuslights_sage_warning">Threshold warning sensor age [h]</string>
|
||||
<string name="key_statuslights_sage_critical" translatable="false">statuslights_sage_critical</string>
|
||||
<string name="statuslights_sage_critical">Threshold critical sensor age [h]</string>
|
||||
<string name="key_statuslights_sbat_warning" translatable="false">statuslights_sbat_warning</string>
|
||||
<string name="statuslights_sbat_warning">Threshold warning sensor battery level [%]</string>
|
||||
<string name="key_statuslights_sbat_critical" translatable="false">statuslights_sbat_critical</string>
|
||||
<string name="statuslights_sbat_critical">Threshold critical sensor battery level [%]</string>
|
||||
<string name="key_statuslights_bage_warning" translatable="false">statuslights_bage_warning</string>
|
||||
<string name="statuslights_bage_warning">Threshold warning pump battery age [h]</string>
|
||||
<string name="key_statuslights_bage_critical" translatable="false">statuslights_bage_critical</string>
|
||||
<string name="statuslights_bage_critical">Threshold critical pump battery age [h]</string>
|
||||
<string name="key_statuslights_res_warning" translatable="false">statuslights_res_warning</string>
|
||||
<string name="statuslights_res_warning">Threshold warning reservoir level [U]</string>
|
||||
<string name="key_statuslights_res_critical" translatable="false">statuslights_res_critical</string>
|
||||
<string name="statuslights_res_critical">Threshold critical reservoir level [U]</string>
|
||||
<string name="key_statuslights_bat_warning" translatable="false">statuslights_bat_warning</string>
|
||||
<string name="statuslights_bat_warning">Threshold warning pump battery level [%]</string>
|
||||
<string name="key_statuslights_bat_critical" translatable="false">statuslights_bat_critical</string>
|
||||
<string name="statuslights_bat_critical">Threshold critical pump battery level [%]</string>
|
||||
<string name="prediction_shortname">PRED</string>
|
||||
<string name="basal_shortname">BAS</string>
|
||||
<string name="deviation_shortname">DEV</string>
|
||||
|
@ -345,15 +255,15 @@
|
|||
<string name="careportal_pb_label">Pump battery</string>
|
||||
<string name="careportal_age_label">age:</string>
|
||||
<string name="careportal_level_label">level:</string>
|
||||
<string name="ns_alarmoptions">Alarm options</string>
|
||||
<string name="ns_alarm_options">Alarm options</string>
|
||||
<string name="key_ns_announcements" translatable="false">ns_announcements</string>
|
||||
<string name="key_ns_alarms" translatable="false">ns_alarms</string>
|
||||
<string name="key_nsalarm_staledatavalue" translatable="false">nsalarm_staledatavalue</string>
|
||||
<string name="key_nsalarm_urgent_staledatavalue" translatable="false">nsalarm_urgent_staledatavalue</string>
|
||||
<string name="key_ns_alarm_stale_data_value" translatable="false">nsalarm_staledatavalue</string>
|
||||
<string name="key_ns_alarm_urgent_stale_data_value" translatable="false">nsalarm_urgent_staledatavalue</string>
|
||||
<string name="ns_alarms">Create notifications from NS alarms</string>
|
||||
<string name="ns_announcements">Create notifications from NS announcements</string>
|
||||
<string name="nsalarm_staledatavalue_label">Stale data threshold [min]</string>
|
||||
<string name="nsalarm_urgent_staledatavalue_label">Urgent stale data threshold [min]</string>
|
||||
<string name="ns_alarm_stale_data_value_label">Stale data threshold [min]</string>
|
||||
<string name="ns_alarm_urgent_stale_data_value_label">Urgent stale data threshold [min]</string>
|
||||
<string name="openapsama_autosens_period">Interval for autosens [h]</string>
|
||||
<string name="openapsama_autosens_period_summary">Amount of hours in the past for sensitivity detection (carbs absorption time is excluded)</string>
|
||||
<string name="key_openapsama_autosens_period" translatable="false">openapsama_autosens_period</string>
|
||||
|
@ -367,16 +277,12 @@
|
|||
<string name="absorptionsettings_title">Absorption settings</string>
|
||||
<string name="absorption_maxtime_title">Meal max absorption time [h]</string>
|
||||
<string name="absorption_maxtime_summary">Time in hours where is expected all carbs from meal will be absorbed</string>
|
||||
<string name="openaps_short">OAPS</string>
|
||||
<string name="uploader_short">UPLD</string>
|
||||
<string name="keep_screen_on_title">Keep screen on</string>
|
||||
<string name="keep_screen_on_summary">Prevent Android to turn screen off. It will consume lot of energy when not plugged to power outlet.</string>
|
||||
<string name="sensitivity_warning">By turning on Autosense feature remember to enter all eated carbs. Otherwise carbs deviations will be identified wrong as sensitivity change !!</string>
|
||||
<string name="sensitivityweightedaverage">Sensitivity WeightedAverage</string>
|
||||
<string name="notloadedplugins">Not all profiles loaded!</string>
|
||||
<string name="valuesnotstored">Values not stored!</string>
|
||||
<string name="ns_localbroadcasts">Enable broadcasts to other apps (like xDrip+). Do not enable if you have more than one instance of AAPS or AAPSClient installed!</string>
|
||||
<string name="ns_localbroadcasts_title">Enable local Broadcasts.</string>
|
||||
<string name="openapssmb">OpenAPS SMB</string>
|
||||
<string name="openaps_smb_dynamic_isf">Dynamic ISF</string>
|
||||
<string name="key_DynISFAdjust" translatable="false">DynISFAdjust</string>
|
||||
|
@ -404,20 +310,12 @@
|
|||
<string name="reuse_profile_pct_hours">Reuse %1$d%% %2$dh</string>
|
||||
<string name="wearcontrol_title">Controls from Watch</string>
|
||||
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
|
||||
<string name="key_raise_notifications_as_android_notifications" translatable="false">raise_urgent_alarms_as_android_notification</string>
|
||||
<string name="raise_notifications_as_android_notifications">Use system notifications for alerts and notifications</string>
|
||||
<string name="gradually_increase_notification_volume">Gradually increase the volume for alerts and notifications</string>
|
||||
<string name="localalertsettings_title">Local alerts</string>
|
||||
<string name="enable_missed_bg_readings_alert">Alert if no BG data is received</string>
|
||||
<string name="enable_pump_unreachable_alert">Alert if pump is unreachable</string>
|
||||
<string name="pump_unreachable_threshold">Pump unreachable threshold [min]</string>
|
||||
<string name="enable_carbs_req_alert">Alert if carbs are required</string>
|
||||
<string name="urgent_alarm">Urgent Alarm</string>
|
||||
<string name="info">INFO</string>
|
||||
<string name="eversense">Eversense App (patched)</string>
|
||||
<string name="dexcomg5_nsupload_title">Upload BG data to NS</string>
|
||||
<string name="key_dexcomg5_nsupload" translatable="false">dexcomg5_nsupload</string>
|
||||
<string name="bgsource_upload">BG upload settings</string>
|
||||
<string name="wear_detailed_delta_title">Show detailed delta</string>
|
||||
<string name="wear_detailed_delta_summary">Show delta with one more decimal place</string>
|
||||
<string name="key_smbinterval" translatable="false">smbinterval</string>
|
||||
|
@ -428,10 +326,6 @@
|
|||
<string name="key_carbsReqThreshold" translatable="false">carbsReqThreshold</string>
|
||||
<string name="carbsReqThreshold">Minimum Carbs Required For Suggestion</string>
|
||||
<string name="carbsReqThreshold_summary">Minimum grams of carbs to display a carbs suggestion alert. Carbs suggestions below this number will not trigger a notification.</string>
|
||||
<string name="dexcomg5_xdripupload_title">Send BG data to xDrip+</string>
|
||||
<string name="dexcomg5_xdripupload_summary">In xDrip+ select 640g/Eversense data source</string>
|
||||
<string name="nsclientbg">NSClient BG</string>
|
||||
<string name="nsclientbgshort">NS BG</string>
|
||||
<string name="overview_editquickwizard_usebg">BG calculation</string>
|
||||
<string name="overview_editquickwizard_usebolusiob">Bolus IOB calculation</string>
|
||||
<string name="overview_editquickwizard_usebasaliob">Basal IOB calculation</string>
|
||||
|
@ -487,12 +381,6 @@
|
|||
<string name="nav_historybrowser">History browser</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="ns_create_announcements_from_errors_title">Create announcements from errors</string>
|
||||
<string name="ns_create_announcements_from_carbs_req_title">Create announcements from carbs required alerts</string>
|
||||
<string name="ns_create_announcements_from_errors_summary">Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments)</string>
|
||||
<string name="ns_create_announcements_from_carbs_req_summary">Create Nightscout announcements for carbs required alerts</string>
|
||||
<string name="key_ns_create_announcements_from_carbs_req" translatable="false">ns_create_announcements_from_carbs_req</string>
|
||||
<string name="eversense_shortname" translatable="false">EVR</string>
|
||||
<string name="wear_predictions_summary">Show the predictions on the watchface.</string>
|
||||
<string name="wear_predictions_title">Predictions</string>
|
||||
<string name="data_choices">Data Choices</string>
|
||||
|
@ -558,30 +446,12 @@
|
|||
<string name="secondcarbsincrement">Second carbs increment</string>
|
||||
<string name="thirdcarbsincrement">Third carbs increment</string>
|
||||
<string name="cgm">CGM</string>
|
||||
<string name="key_ns_cellular" translatable="false">ns_cellular</string>
|
||||
<string name="key_ns_wifi" translatable="false">ns_wifi</string>
|
||||
<string name="key_ns_wifi_ssids" translatable="false">ns_wifi_ssids</string>
|
||||
<string name="key_ns_allow_roaming" translatable="false">ns_allowroaming</string>
|
||||
<string name="key_ns_battery" translatable="false">ns_battery</string>
|
||||
<string name="key_ns_charging" translatable="false">ns_charging</string>
|
||||
<string name="ns_cellular">Use Cellular connection</string>
|
||||
<string name="ns_wifi">Use WiFi connection</string>
|
||||
<string name="ns_wifi_ssids">WiFi SSID</string>
|
||||
<string name="ns_charging">During charging</string>
|
||||
<string name="ns_battery">On battery</string>
|
||||
<string name="connectionsettings_title">Connection settings</string>
|
||||
<string name="ns_wifi_allowedssids">Allowed SSIDs (semicolon separated)</string>
|
||||
<string name="ns_allowroaming">Allow connection in roaming</string>
|
||||
<string name="key_always_use_shortavg" translatable="false">always_use_shortavg</string>
|
||||
<string name="openapsama_autosens_max">Max autosens ratio</string>
|
||||
<string name="openapsama_autosens_min">Min autosens ratio</string>
|
||||
<string name="openapsama_bolussnooze_dia_divisor">Bolus snooze dia divisor</string>
|
||||
<string name="openapsama_max_daily_safety_multiplier">Max daily safety multiplier</string>
|
||||
<string name="openapsama_current_basal_safety_multiplier">Current basal safety multiplier</string>
|
||||
<string name="key_virtualpump_uploadstatus" translatable="false">virtualpump_uploadstatus</string>
|
||||
<string name="virtualpump_type">Virtual Pump Type</string>
|
||||
<string name="virtualpump_definition">Pump Definition</string>
|
||||
<string name="virtualpump_pump_def">Bolus: Step=%1$s\nExtended Bolus: [Step=%2$s, Duration=%3$smin-%4$sh]\nBasal: Step=%5$s\nTBR: %6$s (by %7$s), Duration=%8$smin-%9$sh\n%10$s</string>
|
||||
<string name="key_wearwizard_bg" translatable="false">wearwizard_bg</string>
|
||||
<string name="key_wearwizard_tt" translatable="false">wearwizard_tt</string>
|
||||
<string name="key_wearwizard_trend" translatable="false">wearwizard_trend</string>
|
||||
|
@ -607,13 +477,6 @@
|
|||
<string name="open_navigation">Open navigation</string>
|
||||
<string name="close_navigation">Close navigation</string>
|
||||
<string name="nav_plugin_preferences">Plugin preferences</string>
|
||||
<string name="poctech">Poctech</string>
|
||||
<string name="description_source_poctech">Receive BG values from Poctech app</string>
|
||||
<string name="glunovo">Glunovo</string>
|
||||
<string name="description_source_glunovo">Receive values from Glunovo app</string>
|
||||
<string name="intelligo">Intelligo</string>
|
||||
<string name="description_source_intelligo">Receive values from Intelligo app</string>
|
||||
<string name="description_source_tomato">Receive BG values from Tomato app (MiaoMiao device)</string>
|
||||
<string name="key_high_temptarget_raises_sensitivity" translatable="false">high_temptarget_raises_sensitivity</string>
|
||||
<string name="key_low_temptarget_lowers_sensitivity" translatable="false">low_temptarget_lowers_sensitivity</string>
|
||||
<string name="high_temptarget_raises_sensitivity_title">High temptarget raises sensitivity</string>
|
||||
|
@ -650,7 +513,6 @@
|
|||
<string name="miscellaneous">Miscellaneous</string>
|
||||
<string name="nav_logsettings">Log settings</string>
|
||||
<string name="resettodefaults">Reset to defaults</string>
|
||||
<string name="nsmalfunction">NSClient malfunction. Consider NS and NSClient restart.</string>
|
||||
<string name="key_aps_mode" translatable="false">aps_mode</string>
|
||||
<string name="setupwizard_preferred_aps_mode">Preferred APS mode</string>
|
||||
<string name="sendlogfiles">Send today\'s log files to developers along with this time. Unexpected situation.</string>
|
||||
|
@ -661,41 +523,9 @@
|
|||
<string name="key_dexcom_lognssensorchange" translatable="false">dexcom_lognssensorchange</string>
|
||||
<string name="dexcom_lognssensorchange_title">Log sensor change to NS</string>
|
||||
<string name="dexcom_lognssensorchange_summary">Create event \"Sensor Change\" in NS automatically on sensor start</string>
|
||||
<string name="tomato">Tomato (MiaoMiao)</string>
|
||||
<string name="tomato_short">Tomato</string>
|
||||
<string name="key_tidepool_username" translatable="false">tidepool_username</string>
|
||||
<string name="key_tidepool_password" translatable="false">tidepool_password</string>
|
||||
<string name="key_tidepool_dev_servers" translatable="false">tidepool_dev_servers</string>
|
||||
<string name="key_tidepool_test_login" translatable="false">tidepool_test_login</string>
|
||||
<string name="key_tidepool_only_while_charging" translatable="false">tidepool_only_while_charging</string>
|
||||
<string name="key_tidepool_only_while_unmetered" translatable="false">tidepool_only_while_unmetered</string>
|
||||
<string name="summary_tidepool_username">Your Tidepool login user name, normally your email address</string>
|
||||
<string name="title_tidepool_username">Login User Name</string>
|
||||
<string name="summary_tidepool_password">Your Tidepool login password</string>
|
||||
<string name="title_tidepool_password">Login Password</string>
|
||||
<string name="title_tidepool_test_login">Test Tidepool Login</string>
|
||||
<string name="summary_tidepool_dev_servers">If enabled, uploads will go to https://int-app.tidepool.org instead of the regular https://app.tidepool.org/</string>
|
||||
<string name="title_tidepool_dev_servers">Use Integration (test) servers</string>
|
||||
<string name="tidepool">Tidepool</string>
|
||||
<string name="tidepool_shortname">TDP</string>
|
||||
<string name="description_tidepool">Uploads data to Tidepool</string>
|
||||
<string name="key_tidepool_last_end" translatable="false">tidepool_last_end</string>
|
||||
<string name="tidepool_upload_cgm">Upload CGM data</string>
|
||||
<string name="key_tidepool_upload_cgm" translatable="false">tidepool_upload_cgm</string>
|
||||
<string name="key_tidepool_upload_bolus" translatable="false">tidepool_upload_bolus</string>
|
||||
<string name="tidepool_upload_bolus">Upload treatments (insulin, carbs)</string>
|
||||
<string name="key_tidepool_upload_tbr" translatable="false">tidepool_upload_tbr</string>
|
||||
<string name="tidepool_upload_tbr">Upload temporary basals</string>
|
||||
<string name="key_tidepool_upload_profile" translatable="false">tidepool_upload_profile</string>
|
||||
<string name="tidepool_upload_profile">Upload profile switches, temp targets</string>
|
||||
<string name="key_tidepool_upload_bg" translatable="false">tidepool_upload_bg</string>
|
||||
<string name="tidepool_upload_bg">Upload BG tests</string>
|
||||
<string name="key_smbmaxminutes" translatable="false">smbmaxminutes</string>
|
||||
<string name="key_uamsmbmaxminutes" translatable="false">uamsmbmaxminutes</string>
|
||||
<string name="twohours">2h</string>
|
||||
<string name="dexcom_app_patched">BYODA</string>
|
||||
<string name="dexcom_short">BYODA</string>
|
||||
<string name="description_source_dexcom">Receive BG values from the \'Build Your Own Dexcom App\'.</string>
|
||||
<string name="cobvsiob">COB vs IOB</string>
|
||||
<string name="bolusconstraintappliedwarn">Bolus constraint applied: %1$.2f U to %2$.2f U</string>
|
||||
<string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Slow carbs absorption detected: %2$d%% of time. Double check your calculation. COB can be overestimated thus more insulin could be given !!!!!</font>]]></string>
|
||||
|
@ -724,7 +554,6 @@
|
|||
<string name="show_removed">Show removed</string>
|
||||
<string name="clearqueueconfirm">Clear queue? All data in queue will be lost!</string>
|
||||
<string name="key_wear_detailed_delta" translatable="false">wear_detailed_delta</string>
|
||||
<string name="key_snoozedTo" translatable="false">snoozedTo</string>
|
||||
<string name="ebstopsloop">Use of Extended bolus feature will stop closed loop mode for the time of running extended bolus. Do you really want it?</string>
|
||||
<string name="closed_loop_disabled_with_eb">Closed loop disabled because of running Extended bolus</string>
|
||||
<string name="chartmenu">Chart menu</string>
|
||||
|
@ -741,11 +570,6 @@
|
|||
<string name="overview_show_absinsulin">Absolute insulin</string>
|
||||
<string name="master_password_summary">Master password is used for backup encryption and to override security in application. Remember it or store on a safe place.</string>
|
||||
<string name="current_master_password">Current master password</string>
|
||||
<string name="statuslights">Status lights</string>
|
||||
<string name="statuslights_copy_ns">Copy settings from NS</string>
|
||||
<string name="key_statuslights_copy_ns" translatable="false">statuslights_copy_ns</string>
|
||||
<string name="copyexistingvalues">Copy NS settings (if exists)?</string>
|
||||
<string name="key_statuslights_overview_advanced" translatable="false">statuslights_overview_advanced</string>
|
||||
<string name="classic_description">Original skin</string>
|
||||
<string name="lowres_description">Low Resolution skin</string>
|
||||
<string name="buttonson_description">Buttons are always displayed on bottom of screen</string>
|
||||
|
@ -781,34 +605,6 @@
|
|||
<string name="email_address">Email address</string>
|
||||
<string name="privacy_settings">Privacy setting</string>
|
||||
<string name="privacy_summary">You can provide optional email address if you want to be notified about app crashes. This is not an automated service. You will be contacted by developers in dangerous situations.</string>
|
||||
<string name="full_sync">Full synchronization</string>
|
||||
<string name="full_sync_comment">Full synchronization? It may take many hours and until finish you\'ll not see new data in NS.</string>
|
||||
<string name="ns_sync_options">Synchronization</string>
|
||||
<string name="key_ns_upload" translatable="false">ns_upload</string>
|
||||
<string name="ns_upload_summary">Profiles, boluses, carbs, temporary basals are uploaded to NS</string>
|
||||
<string name="ns_upload">Upload data to NS</string>
|
||||
<string name="ns_receive_profile_store">Receive profile store</string>
|
||||
<string name="ns_receive_profile_store_summary">Synchronize profiles from NS profile editor</string>
|
||||
<string name="ns_receive_temp_target">Receive temporary targets</string>
|
||||
<string name="ns_receive_temp_target_summary">Accept temporary targets entered through NS or NSClient</string>
|
||||
<string name="ns_receive_profile_switch">Receive profile switches</string>
|
||||
<string name="ns_receive_profile_switch_summary">Accept profile switches entered through NS or NSClient</string>
|
||||
<string name="ns_receive_offline_event">Receive APS offline events</string>
|
||||
<string name="ns_receive_offline_event_summary">Accept APS Offline events entered through NS or NSClient</string>
|
||||
<string name="ns_receive_tbr_eb">Receive TBR and EB</string>
|
||||
<string name="ns_receive_tbr_eb_summary">Accept TBR and EB entered through another instance</string>
|
||||
<string name="ns_receive_insulin">Receive insulin</string>
|
||||
<string name="ns_receive_insulin_summary">Accept insulin entered through NS or NSClient (it\'s not delivered, only calculated towards IOB)</string>
|
||||
<string name="ns_receive_carbs">Receive carbs</string>
|
||||
<string name="ns_receive_carbs_summary">Accept carbs entered through NS or NSClient</string>
|
||||
<string name="key_ns_receive_tbr_eb" translatable="false">ns_receive_tbr_eb</string>
|
||||
<string name="ns_receive_therapy_events">Receive therapy events</string>
|
||||
<string name="ns_receive_therapy_events_summary">Accept therapy events (cannula, insulin, battery change etc) entered through NS or NSClient</string>
|
||||
<string name="key_ns_receive_cgm" translatable="false">ns_receive_cgm</string>
|
||||
<string name="ns_receive_cgm">Receive/backfill CGM data</string>
|
||||
<string name="ns_receive_cgm_summary">Accept CGM data from NS</string>
|
||||
<string name="run_question">Run %s?</string>
|
||||
<string name="ns_sync_slow">Slow down uploads</string>
|
||||
<string name="data_status">BG data status</string>
|
||||
<string name="remove_bg_readings">Remove BG readings</string>
|
||||
<string name="statuslights_cannula_age">cannula age</string>
|
||||
|
@ -868,9 +664,6 @@
|
|||
<string name="graph_scale">Graph scale</string>
|
||||
<string name="profile1">Profile 1</string>
|
||||
<string name="profile2">Profile 2</string>
|
||||
<string name="login">Login</string>
|
||||
<string name="remove_all">Remove all</string>
|
||||
<string name="reset_start">Reset start</string>
|
||||
<string name="a11y_open_settings">open settings</string>
|
||||
<string name="a11y_set_carb_timer">set carb timer alarm</string>
|
||||
<string name="device_all">All</string>
|
||||
|
@ -881,12 +674,6 @@
|
|||
<string name="a11y_drag_and_drop_handle">drag and drop handle</string>
|
||||
<string name="search">Search</string>
|
||||
|
||||
<!-- Aidex Cgms -->
|
||||
<string name="aidex">GlucoRx Aidex</string>
|
||||
<string name="aidex_short">Aidex</string>
|
||||
<string name="description_source_aidex">Receive BG values from GlucoRx Aidex CGMS.</string>
|
||||
<string name="blocked_by_charging">Blocked by charging options</string>
|
||||
<string name="blocked_by_connectivity">Blocked by connectivity options</string>
|
||||
<string name="no_watch_connected">(No Watch Connected)</string>
|
||||
<string name="key_adjust_sensitivity" translatable="false">dynisf_adjust_sensitivity</string>
|
||||
<string name="dynisf_adjust_sensitivity">Adjust sensitivity and BG</string>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
android:dependency="@string/key_enable_missed_bg_readings_alert"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_missed_bg_readings_threshold_minutes"
|
||||
android:title="@string/nsalarm_staledatavalue_label"
|
||||
android:title="@string/ns_alarm_stale_data_value_label"
|
||||
validate:maxNumber="10000"
|
||||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
|
|
@ -25,7 +25,6 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter
|
|||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage
|
||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.androidaps.plugins.source.GlimpPlugin
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
|
@ -34,13 +33,13 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl
|
|||
import info.nightscout.implementation.constraints.ConstraintsImpl
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by mike on 18.03.2018.
|
||||
|
|
|
@ -8,23 +8,23 @@ import info.nightscout.androidaps.R
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.interfaces.ActivityNames
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.interfaces.ActivityNames
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
|
|
@ -2,22 +2,22 @@ package info.nightscout.androidaps.plugins.constraints.safety
|
|||
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.androidaps.plugins.source.GlimpPlugin
|
||||
import info.nightscout.androidaps.utils.HardLimits
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
|
|
|
@ -5,9 +5,9 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.general.maintenance.LoggerUtils
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
|
|
|
@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.source
|
|||
import dagger.android.AndroidInjector
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
|
|
|
@ -15,12 +15,12 @@ import info.nightscout.androidaps.interfaces.Loop
|
|||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.mockito.Mock
|
||||
|
|
|
@ -21,7 +21,6 @@ import info.nightscout.androidaps.extensions.valueToUnits
|
|||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DeviationDataPoint
|
||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries
|
||||
|
@ -30,11 +29,12 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
|||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import java.util.Calendar
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -170,10 +170,10 @@ class OverviewData @Inject constructor(
|
|||
fun temporaryBasalDialogText(iobCobCalculator: IobCobCalculator): String =
|
||||
profileFunction.getProfile()?.let { profile ->
|
||||
iobCobCalculator.getTempBasalIncludingConvertedExtended(dateUtil.now())?.let { temporaryBasal ->
|
||||
"${rh.gs(R.string.basebasalrate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" +
|
||||
"${rh.gs(R.string.base_basal_rate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" +
|
||||
"\n" + rh.gs(R.string.tempbasal_label) + ": " + temporaryBasal.toStringFull(profile, dateUtil)
|
||||
}
|
||||
?: "${rh.gs(R.string.basebasalrate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}"
|
||||
?: "${rh.gs(R.string.base_basal_rate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}"
|
||||
} ?: rh.gs(R.string.value_unavailable_short)
|
||||
|
||||
@DrawableRes fun temporaryBasalIcon(iobCobCalculator: IobCobCalculator): Int =
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<string name="key_low_mark" translatable="false">low_mark</string>
|
||||
<string name="key_high_mark" translatable="false">high_mark</string>
|
||||
<string name="key_ns_create_announcements_from_errors" translatable="false">ns_create_announcements_from_errors</string>
|
||||
<string name="key_ns_logappstartedevent" translatable="false">ns_logappstartedevent</string>
|
||||
<string name="key_btwatchdog" translatable="false">bt_watchdog</string>
|
||||
<string name="key_btwatchdog_lastbark" translatable="false">bt_watchdog_last</string>
|
||||
<string name="key_pump_unreachable_threshold_minutes" translatable="false">pump_unreachable_threshold</string>
|
||||
|
@ -48,7 +47,7 @@
|
|||
<string name="key_openapsma_settings" translatable="false">openapsma_settings</string>
|
||||
<string name="key_medtronic_settings" translatable="false">medtronic_settings</string>
|
||||
<string name="key_danars_settings" translatable="false">danars_settings</string>
|
||||
<string name="key_nsclientinternal_settings" translatable="false">nsclientinternal_settings</string>
|
||||
<string name="key_ns_client_settings" translatable="false">nsclientinternal_settings</string>
|
||||
<string name="key_insight_local_settings" translatable="false">insight_local_settings</string>
|
||||
<string name="key_data_choices_settings" translatable="false">data_choices_settings</string>
|
||||
<string name="key_dexcom_settings" translatable="false">dexcom_settings</string>
|
||||
|
@ -154,9 +153,9 @@
|
|||
<string name="lastconnection_label">Last connection</string>
|
||||
<string name="lastbolus_label">Last bolus</string>
|
||||
<string name="dailyunits">Daily units</string>
|
||||
<string name="basebasalrate_label">Base basal rate</string>
|
||||
<string name="base_basal_rate_label">Base basal rate</string>
|
||||
<string name="tempbasal_label">Temp basal</string>
|
||||
<string name="virtualpump_extendedbolus_label">Extended bolus</string>
|
||||
<string name="extended_bolus_label">Extended bolus</string>
|
||||
<string name="reservoir_label">Reservoir</string>
|
||||
<string name="pumphistory">Pump history</string>
|
||||
<string name="viewprofile">View profile</string>
|
||||
|
@ -251,6 +250,11 @@
|
|||
<string name="treatments_wizard_cob_label">COB</string>
|
||||
<string name="bolus_iob_label">Bolus IOB</string>
|
||||
<string name="treatments_wizard_basaliob_label">Basal IOB</string>
|
||||
<string name="format_percent" translatable="false">%1$d%%</string>
|
||||
<string name="paused">Paused</string>
|
||||
<string name="invalid">INVALID</string>
|
||||
<string name="login">Login</string>
|
||||
<string name="upload_now">Upload now</string>
|
||||
|
||||
<!-- Constraints-->
|
||||
<string name="limitingbasalratio">Limiting max basal rate to %1$.2f U/h because of %2$s</string>
|
||||
|
@ -656,6 +660,12 @@
|
|||
<string name="autotune_run_cancelled">Another run of Autotune is detected, run cancelled</string>
|
||||
<string name="needconnectpermission">Application needs bluetooth permission</string>
|
||||
|
||||
<!-- Alerts -->
|
||||
<string name="key_raise_notifications_as_android_notifications" translatable="false">raise_urgent_alarms_as_android_notification</string>
|
||||
<string name="raise_notifications_as_android_notifications">Use system notifications for alerts and notifications</string>
|
||||
<string name="urgent_alarm">Urgent Alarm</string>
|
||||
<string name="info">INFO</string>
|
||||
|
||||
<!-- SmsCommunicator -->
|
||||
<string name="smscommunicator_missingsmspermission">Missing SMS permission</string>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump
|
||||
package info.nightscout.implementation.pump
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||
|
@ -32,18 +32,18 @@ import info.nightscout.androidaps.database.transactions.SyncTemporaryBasalWithTe
|
|||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.VirtualPump
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
@ -79,7 +79,7 @@ class PumpSyncImplementation @Inject constructor(
|
|||
override fun verifyPumpIdentification(type: PumpType, serialNumber: String): Boolean {
|
||||
val storedType = sp.getString(R.string.key_active_pump_type, "")
|
||||
val storedSerial = sp.getString(R.string.key_active_pump_serial_number, "")
|
||||
if (activePlugin.activePump is VirtualPumpPlugin) return true
|
||||
if (activePlugin.activePump is VirtualPump) return true
|
||||
if (type.description == storedType && serialNumber == storedSerial) return true
|
||||
aapsLogger.debug(LTag.PUMP, "verifyPumpIdentification failed for $type $serialNumber")
|
||||
return false
|
||||
|
@ -107,7 +107,7 @@ class PumpSyncImplementation @Inject constructor(
|
|||
return timestamp > dateUtil.now() - T.mins(1).msecs() // allow first record to be 1 min old
|
||||
}
|
||||
|
||||
if (activePlugin.activePump is VirtualPumpPlugin || (type.description == storedType && serialNumber == storedSerial && timestamp >= storedTimestamp)) {
|
||||
if (activePlugin.activePump is VirtualPump || (type.description == storedType && serialNumber == storedSerial && timestamp >= storedTimestamp)) {
|
||||
// data match
|
||||
return true
|
||||
}
|
|
@ -22,7 +22,6 @@ import javax.inject.Inject;
|
|||
import dagger.android.support.DaggerFragment;
|
||||
import info.nightscout.androidaps.insight.R;
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue;
|
||||
import info.nightscout.rx.bus.RxBus;
|
||||
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.TBROverNotificationBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBasalRate;
|
||||
import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBolus;
|
||||
|
@ -31,12 +30,13 @@ import info.nightscout.androidaps.plugins.pump.insight.descriptors.CartridgeStat
|
|||
import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState;
|
||||
import info.nightscout.androidaps.plugins.pump.insight.descriptors.TotalDailyDose;
|
||||
import info.nightscout.androidaps.plugins.pump.insight.events.EventLocalInsightUpdateGUI;
|
||||
import info.nightscout.interfaces.queue.Callback;
|
||||
import info.nightscout.shared.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter;
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.interfaces.queue.Callback;
|
||||
import info.nightscout.rx.AapsSchedulers;
|
||||
import info.nightscout.rx.bus.RxBus;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.shared.utils.DateUtil;
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
||||
|
||||
public class LocalInsightFragment extends DaggerFragment implements View.OnClickListener {
|
||||
|
@ -305,7 +305,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick
|
|||
private void getBaseBasalRateItem(List<View> statusItems) {
|
||||
if (localInsightPlugin.getActiveBasalRate() == null) return;
|
||||
ActiveBasalRate activeBasalRate = localInsightPlugin.getActiveBasalRate();
|
||||
statusItems.add(getStatusItem(rh.gs(R.string.basebasalrate_label),
|
||||
statusItems.add(getStatusItem(rh.gs(R.string.base_basal_rate_label),
|
||||
DecimalFormatter.INSTANCE.to2Decimal(activeBasalRate.getActiveBasalRate()) + " U/h (" + activeBasalRate.getActiveBasalProfileName() + ")"));
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<string name="stop_pump">Stop pump</string>
|
||||
<string name="started">Started</string>
|
||||
<string name="stopped">Stopped</string>
|
||||
<string name="paused">Paused</string>
|
||||
<string name="operating_mode">Operating mode</string>
|
||||
<string name="description_pump_insight_local">Pump integration for Accu-Chek Insight pumps</string>
|
||||
<string name="not_inserted">Not inserted</string>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package info.nightscout.interfaces
|
||||
|
||||
interface VirtualPump {
|
||||
var fakeDataDetected: Boolean
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
<string name="uploading_to_open_humans">AAPS is uploading to Open Humans. This may take a while.</string>
|
||||
<string name="you_have_been_signed_out_of_open_humans">You have been signed out of Open Humans</string>
|
||||
<string name="click_here_to_sign_in_again_if_this_wasnt_on_purpose">Click here to sign in again if this wasn\'t on purpose.</string>
|
||||
<string name="upload_now">Upload now</string>
|
||||
<string name="next">Next</string>
|
||||
<string name="welcome_to_open_humans">Welcome to Open Humans</string>
|
||||
<string name="setup_data_upload">To setup data upload, click \'Next\'.</string>
|
||||
|
|
|
@ -22,4 +22,5 @@ dependencies {
|
|||
implementation project(':graphview')
|
||||
implementation project(':core')
|
||||
implementation project(':interfaces')
|
||||
implementation project(':ns-sdk')
|
||||
}
|
|
@ -6,6 +6,8 @@
|
|||
<uses-permission android:name="android.permission.SEND_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.SEND_MMS" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name="info.nightscout.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity"
|
||||
|
@ -17,6 +19,10 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".sync.nsclient.services.NSClientService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
package info.nightscout.plugins.configBuilder
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
|
@ -6,18 +6,18 @@ import info.nightscout.androidaps.interfaces.ConfigBuilder
|
|||
import info.nightscout.androidaps.interfaces.Insulin
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.Sensitivity
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sdk.remotemodel.RemoteDeviceStatus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
|
@ -4,6 +4,7 @@ import dagger.Module
|
|||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.general.autotune.AutotuneCore
|
||||
import info.nightscout.plugins.general.autotune.AutotuneFS
|
||||
import info.nightscout.plugins.general.autotune.AutotuneFragment
|
||||
import info.nightscout.plugins.general.autotune.AutotuneIob
|
||||
import info.nightscout.plugins.general.autotune.AutotunePrep
|
||||
import info.nightscout.plugins.general.autotune.data.ATProfile
|
||||
|
@ -14,6 +15,8 @@ import info.nightscout.plugins.general.autotune.data.PreppedGlucose
|
|||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class AutotuneModule {
|
||||
@ContributesAndroidInjector abstract fun contributesAutotuneFragment(): AutotuneFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun autoTunePrepInjector(): AutotunePrep
|
||||
@ContributesAndroidInjector abstract fun autoTuneIobInjector(): AutotuneIob
|
||||
@ContributesAndroidInjector abstract fun autoTuneCoreInjector(): AutotuneCore
|
||||
|
|
|
@ -8,7 +8,10 @@ import dagger.Module
|
|||
FoodModule::class,
|
||||
SMSCommunicatorModule::class,
|
||||
AutotuneModule::class,
|
||||
ProfileModule::class
|
||||
ProfileModule::class,
|
||||
SyncModule::class,
|
||||
SourceModule::class,
|
||||
VirtualPumpModule::class
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.source.BGSourceFragment
|
||||
import info.nightscout.plugins.source.NSClientSourcePlugin
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class SourceModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientSourceWorker(): NSClientSourcePlugin.NSClientSourceWorker
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.sync.nsShared.NSClientFragment
|
||||
import info.nightscout.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.plugins.sync.nsclient.services.NSClientService
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.workers.ProcessTreatmentsWorker
|
||||
import info.nightscout.plugins.sync.tidepool.TidepoolFragment
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class SyncModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientWorker(): NSClientAddUpdateWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientAddAckWorker(): NSClientAddAckWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientUpdateRemoveAckWorker(): NSClientUpdateRemoveAckWorker
|
||||
@ContributesAndroidInjector abstract fun contributesNSClientMbgWorker(): NSClientMbgWorker
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesLoadStatusWorker(): LoadStatusWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadLastModificationWorker(): LoadLastModificationWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadBgWorker(): LoadBgWorker
|
||||
@ContributesAndroidInjector abstract fun contributesStoreBgWorker(): StoreDataForDb.StoreBgWorker
|
||||
@ContributesAndroidInjector abstract fun contributesTreatmentWorker(): LoadTreatmentsWorker
|
||||
@ContributesAndroidInjector abstract fun contributesProcessTreatmentsWorker(): ProcessTreatmentsWorker
|
||||
@ContributesAndroidInjector abstract fun contributesLoadDeviceStatusWorker(): LoadDeviceStatusWorker
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesTidepoolFragment(): TidepoolFragment
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpFragment
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class VirtualPumpModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesVirtualPumpFragment(): VirtualPumpFragment
|
||||
}
|
|
@ -190,11 +190,11 @@ class FoodFragment : DaggerFragment() {
|
|||
holder.binding.name.text = food.name
|
||||
holder.binding.portion.text = food.portion.toString() + food.unit
|
||||
holder.binding.carbs.text = food.carbs.toString() + rh.gs(R.string.shortgramm)
|
||||
holder.binding.fat.text = rh.gs(R.string.shortfat) + ": " + food.fat + rh.gs(R.string.shortgramm)
|
||||
holder.binding.fat.text = rh.gs(R.string.short_fat) + ": " + food.fat + rh.gs(R.string.shortgramm)
|
||||
holder.binding.fat.visibility = food.fat.isNotZero().toVisibility()
|
||||
holder.binding.protein.text = rh.gs(R.string.shortprotein) + ": " + food.protein + rh.gs(R.string.shortgramm)
|
||||
holder.binding.protein.text = rh.gs(R.string.short_protein) + ": " + food.protein + rh.gs(R.string.shortgramm)
|
||||
holder.binding.protein.visibility = food.protein.isNotZero().toVisibility()
|
||||
holder.binding.energy.text = rh.gs(R.string.shortenergy) + ": " + food.energy + rh.gs(R.string.shortkilojoul)
|
||||
holder.binding.energy.text = rh.gs(R.string.short_energy) + ": " + food.energy + rh.gs(R.string.short_kilo_joul)
|
||||
holder.binding.energy.visibility = food.energy.isNotZero().toVisibility()
|
||||
holder.binding.icRemove.tag = food
|
||||
holder.binding.icCalculator.tag = food
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.overview.notifications
|
||||
package info.nightscout.plugins.general.overview.notifications
|
||||
|
||||
import android.content.Intent
|
||||
import dagger.android.DaggerIntentService
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.overview.notifications
|
||||
package info.nightscout.plugins.general.overview.notifications
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
|
@ -12,19 +12,19 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.OverviewNotificationItemBinding
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.IconsProvider
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.OverviewNotificationItemBinding
|
||||
import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.util.Collections
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
|
@ -1,16 +1,16 @@
|
|||
package info.nightscout.androidaps.plugins.general.overview.notifications
|
||||
package info.nightscout.plugins.general.overview.notifications
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.T
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
|
@ -64,9 +64,9 @@ class NotificationWithAction constructor(
|
|||
nsClientPlugin.handleClearAlarm(nsAlarm, 60 * 60 * 1000L)
|
||||
// Adding current time to snooze if we got staleData
|
||||
aapsLogger.debug(LTag.NOTIFICATION, "Notification text is: $text")
|
||||
val msToSnooze = sp.getInt(R.string.key_nsalarm_staledatavalue, 15) * 60 * 1000L
|
||||
val msToSnooze = sp.getInt(R.string.key_ns_alarm_stale_data_value, 15) * 60 * 1000L
|
||||
aapsLogger.debug(LTag.NOTIFICATION, "snooze nsalarm_staledatavalue in minutes is ${T.msecs(msToSnooze).mins()} currentTimeMillis is: ${System.currentTimeMillis()}")
|
||||
sp.putLong(R.string.key_snoozedTo, System.currentTimeMillis() + msToSnooze)
|
||||
sp.putLong(R.string.key_snoozed_to, System.currentTimeMillis() + msToSnooze)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.overview.events
|
||||
package info.nightscout.plugins.general.overview.notifications.events
|
||||
|
||||
import info.nightscout.rx.events.Event
|
||||
|
|
@ -158,23 +158,23 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
val allowedNumbers = preferenceFragment.findPreference(rh.gs(R.string.key_smscommunicator_allowednumbers)) as EditTextPreference?
|
||||
?: return
|
||||
if (!areMoreNumbers(allowedNumbers.text)) {
|
||||
distance.title = (rh.gs(R.string.smscommunicator_remotebolusmindistance)
|
||||
distance.title = (rh.gs(R.string.smscommunicator_remote_bolus_min_distance)
|
||||
+ ".\n"
|
||||
+ rh.gs(R.string.smscommunicator_remotebolusmindistance_caveat))
|
||||
+ rh.gs(R.string.smscommunicator_remote_bolus_min_distance_caveat))
|
||||
distance.isEnabled = false
|
||||
} else {
|
||||
distance.title = rh.gs(R.string.smscommunicator_remotebolusmindistance)
|
||||
distance.title = rh.gs(R.string.smscommunicator_remote_bolus_min_distance)
|
||||
distance.isEnabled = true
|
||||
}
|
||||
allowedNumbers.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
if (!areMoreNumbers(newValue as String)) {
|
||||
distance.text = (Constants.remoteBolusMinDistance / (60 * 1000L)).toString()
|
||||
distance.title = (rh.gs(R.string.smscommunicator_remotebolusmindistance)
|
||||
distance.title = (rh.gs(R.string.smscommunicator_remote_bolus_min_distance)
|
||||
+ ".\n"
|
||||
+ rh.gs(R.string.smscommunicator_remotebolusmindistance_caveat))
|
||||
+ rh.gs(R.string.smscommunicator_remote_bolus_min_distance_caveat))
|
||||
distance.isEnabled = false
|
||||
} else {
|
||||
distance.title = rh.gs(R.string.smscommunicator_remotebolusmindistance)
|
||||
distance.title = rh.gs(R.string.smscommunicator_remote_bolus_min_distance)
|
||||
distance.isEnabled = true
|
||||
}
|
||||
true
|
||||
|
@ -275,7 +275,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"LOOP" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2 || divided.size == 3) processLOOP(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
|
@ -284,50 +284,50 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"PUMP" ->
|
||||
if (!remoteCommandsAllowed && divided.size > 1) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed && divided.size > 1) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size <= 3) processPUMP(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"PROFILE" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2 || divided.size == 3) processPROFILE(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"BASAL" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2 || divided.size == 3) processBASAL(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"EXTENDED" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2 || divided.size == 3) processEXTENDED(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"BOLUS" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (commandQueue.bolusInQueue()) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_another_bolus_in_queue)))
|
||||
else if (divided.size == 2 && dateUtil.now() - lastRemoteBolusTime < minDistance) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotebolusnotallowed)))
|
||||
else if (divided.size == 2 && dateUtil.now() - lastRemoteBolusTime < minDistance) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_bolus_not_allowed)))
|
||||
else if (divided.size == 2 && pump.isSuspended()) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.pumpsuspended)))
|
||||
else if (divided.size == 2 || divided.size == 3) processBOLUS(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"CARBS" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2 || divided.size == 3) processCARBS(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"CAL" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2) processCAL(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"TARGET" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2) processTARGET(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
"SMS" ->
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed)))
|
||||
if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed)))
|
||||
else if (divided.size == 2) processSMS(divided, receivedSms)
|
||||
else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
|
||||
|
@ -342,7 +342,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
execute?.action(divided[0])
|
||||
} else {
|
||||
messageToConfirm = null
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_unknowncommand)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_unknown_command)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
"DISABLE", "STOP" -> {
|
||||
if (loop.enabled) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_loopdisablereplywithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_loop_disable_reply_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) {
|
||||
override fun run() {
|
||||
|
@ -388,8 +388,8 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||
override fun run() {
|
||||
rxBus.send(EventRefreshOverview("SMS_LOOP_STOP"))
|
||||
val replyText = rh.gs(R.string.smscommunicator_loophasbeendisabled) + " " +
|
||||
rh.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed)
|
||||
val replyText = rh.gs(R.string.smscommunicator_loop_has_been_disabled) + " " +
|
||||
rh.gs(if (result.success) R.string.smscommunicator_tempbasal_canceled else R.string.smscommunicator_tempbasal_cancel_failed)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
}
|
||||
})
|
||||
|
@ -403,25 +403,25 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
"ENABLE", "START" -> {
|
||||
if (!loop.enabled) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_loopenablereplywithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_loop_enable_reply_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) {
|
||||
override fun run() {
|
||||
uel.log(Action.LOOP_ENABLED, Sources.SMS)
|
||||
loop.enabled = true
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loophasbeenenabled)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_has_been_enabled)))
|
||||
rxBus.send(EventRefreshOverview("SMS_LOOP_START"))
|
||||
}
|
||||
})
|
||||
} else
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loopisenabled)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_is_enabled)))
|
||||
receivedSms.processed = true
|
||||
}
|
||||
|
||||
"STATUS" -> {
|
||||
val reply = if (loop.enabled) {
|
||||
if (loop.isSuspended) rh.gs(R.string.sms_loop_suspended_for, loop.minutesToEndOfSuspend())
|
||||
else rh.gs(R.string.smscommunicator_loopisenabled)
|
||||
else rh.gs(R.string.smscommunicator_loop_is_enabled)
|
||||
} else
|
||||
rh.gs(R.string.loopisdisabled)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, reply))
|
||||
|
@ -430,7 +430,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
|
||||
"RESUME" -> {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_loopresumereplywithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_loop_resume_reply_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) {
|
||||
override fun run() {
|
||||
|
@ -445,13 +445,13 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||
override fun run() {
|
||||
if (!result.success) {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
}
|
||||
}
|
||||
})
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loopresumed)))
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_resumed)))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -463,11 +463,11 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
duration = min(180, duration)
|
||||
if (duration == 0) {
|
||||
receivedSms.processed = true
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrongduration)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrong_duration)))
|
||||
return
|
||||
} else {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_suspendreplywithcode, duration, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_suspend_reply_with_code, duration, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, duration) {
|
||||
override fun run() {
|
||||
|
@ -489,11 +489,11 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
aapsLogger.error(LTag.DATABASE, "Error while saving OfflineEvent", it)
|
||||
})
|
||||
rxBus.send(EventRefreshOverview("SMS_LOOP_SUSPENDED"))
|
||||
val replyText = rh.gs(R.string.smscommunicator_loopsuspended) + " " +
|
||||
rh.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed)
|
||||
val replyText = rh.gs(R.string.smscommunicator_loop_suspended) + " " +
|
||||
rh.gs(if (result.success) R.string.smscommunicator_tempbasal_canceled else R.string.smscommunicator_tempbasal_cancel_failed)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalcancelfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_cancel_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
receivedSms.processed = true
|
||||
} else if ((divided.size == 2) && (divided[1].equals("CONNECT", ignoreCase = true))) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_pumpconnectwithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_pump_connect_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) {
|
||||
override fun run() {
|
||||
|
@ -560,7 +560,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||
override fun run() {
|
||||
if (!result.success) {
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pumpconnectfail)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pump_connect_fail)))
|
||||
} else {
|
||||
disposable += repository.runTransactionForResult(CancelCurrentOfflineEventIfAnyTransaction(dateUtil.now()))
|
||||
.subscribe({ result ->
|
||||
|
@ -581,11 +581,11 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
duration = min(120, duration)
|
||||
if (duration == 0) {
|
||||
receivedSms.processed = true
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrongduration)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrong_duration)))
|
||||
return
|
||||
} else {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_pumpdisconnectwithcode, duration, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_pump_disconnect_with_code, duration, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) {
|
||||
override fun run() {
|
||||
|
@ -593,7 +593,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
val profile = profileFunction.getProfile() ?: return
|
||||
loop.goToZeroTemp(duration, profile, OfflineEvent.Reason.DISCONNECT_PUMP)
|
||||
rxBus.send(EventRefreshOverview("SMS_PUMP_DISCONNECT"))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pumpdisconnected)))
|
||||
sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pump_disconnected)))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
if (profile == null) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.noprofile)))
|
||||
else {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_profilereplywithcode, list[pIndex - 1], percentage, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_profile_reply_with_code, list[pIndex - 1], percentage, passCode)
|
||||
receivedSms.processed = true
|
||||
val finalPercentage = percentage
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, list[pIndex - 1] as String, finalPercentage) {
|
||||
|
@ -664,27 +664,27 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
private fun processBASAL(divided: Array<String>, receivedSms: Sms) {
|
||||
if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_basalstopreplywithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_basal_stop_reply_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) {
|
||||
override fun run() {
|
||||
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalcanceled)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_canceled)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalcanceled),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalcanceled))
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_canceled),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_canceled))
|
||||
)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalcancelfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_cancel_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalcancelfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalcancelfailed))
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_cancel_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_cancel_failed))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -703,7 +703,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
else {
|
||||
tempBasalPct = constraintChecker.applyBasalPercentConstraints(Constraint(tempBasalPct), profile).value()
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_basalpctreplywithcode, tempBasalPct, duration, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_basal_pct_reply_with_code, tempBasalPct, duration, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, tempBasalPct, duration) {
|
||||
override fun run() {
|
||||
|
@ -711,8 +711,8 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText =
|
||||
if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration) else rh.gs(
|
||||
R.string.smscommunicator_tempbasalset,
|
||||
if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration) else rh.gs(
|
||||
R.string.smscommunicator_tempbasal_set,
|
||||
result.absolute,
|
||||
result.duration
|
||||
)
|
||||
|
@ -721,24 +721,24 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
if (result.isPercent)
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS,
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration),
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration),
|
||||
ValueWithUnit.Percent(result.percent),
|
||||
ValueWithUnit.Minute(result.duration)
|
||||
)
|
||||
else
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS,
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration),
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration),
|
||||
ValueWithUnit.UnitPerHour(result.absolute),
|
||||
ValueWithUnit.Minute(result.duration)
|
||||
)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalfailed))
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_failed))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -758,22 +758,22 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
else {
|
||||
tempBasal = constraintChecker.applyBasalConstraints(Constraint(tempBasal), profile).value()
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_basalreplywithcode, tempBasal, duration, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_basal_reply_with_code, tempBasal, duration, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, tempBasal, duration) {
|
||||
override fun run() {
|
||||
commandQueue.tempBasalAbsolute(aDouble(), secondInteger(), true, profile, PumpSync.TemporaryBasalType.NORMAL, object : Callback() {
|
||||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText = if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration)
|
||||
else rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration)
|
||||
var replyText = if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration)
|
||||
else rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
if (result.isPercent)
|
||||
uel.log(
|
||||
Action.TEMP_BASAL,
|
||||
Sources.SMS,
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration),
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration),
|
||||
ValueWithUnit.Percent(result.percent),
|
||||
ValueWithUnit.Minute(result.duration)
|
||||
)
|
||||
|
@ -781,17 +781,17 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
uel.log(
|
||||
Action.TEMP_BASAL,
|
||||
Sources.SMS,
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration),
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration),
|
||||
ValueWithUnit.UnitPerHour(result.absolute),
|
||||
ValueWithUnit.Minute(result.duration)
|
||||
)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalfailed))
|
||||
Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_failed))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -805,23 +805,23 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
private fun processEXTENDED(divided: Array<String>, receivedSms: Sms) {
|
||||
if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_extendedstopreplywithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_extended_stop_reply_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) {
|
||||
override fun run() {
|
||||
commandQueue.cancelExtended(object : Callback() {
|
||||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText = rh.gs(R.string.smscommunicator_extendedcanceled)
|
||||
var replyText = rh.gs(R.string.smscommunicator_extended_canceled)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_extendedcancelfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_extended_cancel_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedcanceled),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extendedcanceled))
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_canceled),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extended_canceled))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -837,14 +837,14 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
if (extended == 0.0 || duration == 0) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
else {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_extendedreplywithcode, extended, duration, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_extended_reply_with_code, extended, duration, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, extended, duration) {
|
||||
override fun run() {
|
||||
commandQueue.extendedBolus(aDouble(), secondInteger(), object : Callback() {
|
||||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText = rh.gs(R.string.smscommunicator_extendedset, aDouble, duration)
|
||||
var replyText = rh.gs(R.string.smscommunicator_extended_set, aDouble, duration)
|
||||
if (config.APS) replyText += "\n" + rh.gs(R.string.loopsuspended)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
|
@ -852,24 +852,24 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
uel.log(
|
||||
Action.EXTENDED_BOLUS,
|
||||
Sources.SMS,
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedset, aDouble, duration) + " / " + rh.gs(R.string.loopsuspended),
|
||||
activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_set, aDouble, duration) + " / " + rh.gs(R.string.loopsuspended),
|
||||
ValueWithUnit.Insulin(aDouble ?: 0.0),
|
||||
ValueWithUnit.Minute(duration),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.loopsuspended))
|
||||
)
|
||||
else
|
||||
uel.log(
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedset, aDouble, duration),
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_set, aDouble, duration),
|
||||
ValueWithUnit.Insulin(aDouble ?: 0.0),
|
||||
ValueWithUnit.Minute(duration)
|
||||
)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_extendedfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_extended_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extendedfailed))
|
||||
Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extended_failed))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -905,9 +905,9 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
override fun run() {
|
||||
if (resultSuccess) {
|
||||
var replyText = if (isMeal)
|
||||
rh.gs(R.string.smscommunicator_mealbolusdelivered, resultBolusDelivered)
|
||||
rh.gs(R.string.smscommunicator_meal_bolus_delivered, resultBolusDelivered)
|
||||
else
|
||||
rh.gs(R.string.smscommunicator_bolusdelivered, resultBolusDelivered)
|
||||
rh.gs(R.string.smscommunicator_bolus_delivered, resultBolusDelivered)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
lastRemoteBolusTime = dateUtil.now()
|
||||
if (isMeal) {
|
||||
|
@ -944,18 +944,18 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
val tt = if (currentProfile.units == GlucoseUnit.MMOL) {
|
||||
DecimalFormatter.to1Decimal(eatingSoonTT)
|
||||
} else DecimalFormatter.to0Decimal(eatingSoonTT)
|
||||
replyText += "\n" + rh.gs(R.string.smscommunicator_mealbolusdelivered_tt, tt, eatingSoonTTDuration)
|
||||
replyText += "\n" + rh.gs(R.string.smscommunicator_meal_bolus_delivered_tt, tt, eatingSoonTTDuration)
|
||||
}
|
||||
}
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(Action.BOLUS, Sources.SMS, replyText)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_bolusfailed)
|
||||
var replyText = rh.gs(R.string.smscommunicator_bolus_failed)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_bolusfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_bolusfailed))
|
||||
Action.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_bolus_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_bolus_failed))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
if (grams == 0) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format)))
|
||||
else {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_carbsreplywithcode, grams, dateUtil.timeString(time), passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_carbs_reply_with_code, grams, dateUtil.timeString(time), passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, grams, time) {
|
||||
override fun run() {
|
||||
|
@ -1010,19 +1010,19 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||
override fun run() {
|
||||
if (result.success) {
|
||||
var replyText = rh.gs(R.string.smscommunicator_carbsset, anInteger)
|
||||
var replyText = rh.gs(R.string.smscommunicator_carbs_set, anInteger)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbsset, anInteger),
|
||||
Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbs_set, anInteger),
|
||||
ValueWithUnit.Gram(anInteger ?: 0)
|
||||
)
|
||||
} else {
|
||||
var replyText = rh.gs(R.string.smscommunicator_carbsfailed, anInteger)
|
||||
var replyText = rh.gs(R.string.smscommunicator_carbs_failed, anInteger)
|
||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbsfailed, anInteger),
|
||||
Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbs_failed, anInteger),
|
||||
ValueWithUnit.Gram(anInteger ?: 0)
|
||||
)
|
||||
}
|
||||
|
@ -1040,7 +1040,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
val isStop = divided[1].equals("STOP", ignoreCase = true) || divided[1].equals("CANCEL", ignoreCase = true)
|
||||
if (isMeal || isActivity || isHypo) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_temptargetwithcode, divided[1].uppercase(Locale.getDefault()), passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_temptarget_with_code, divided[1].uppercase(Locale.getDefault()), passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) {
|
||||
override fun run() {
|
||||
|
@ -1110,7 +1110,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
})
|
||||
} else if (isStop) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_temptargetcancel, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_temptarget_cancel, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) {
|
||||
override fun run() {
|
||||
|
@ -1137,16 +1137,16 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
|| divided[1].equals("DISABLE", ignoreCase = true))
|
||||
if (isStop) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_stopsmswithcode, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_stops_ns_with_code, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) {
|
||||
override fun run() {
|
||||
sp.putBoolean(R.string.key_smscommunicator_remote_commands_allowed, false)
|
||||
val replyText = rh.gs(R.string.smscommunicator_stoppedsms)
|
||||
val replyText = rh.gs(R.string.smscommunicator_stopped_sms)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
uel.log(
|
||||
Action.STOP_SMS, Sources.SMS, rh.gs(R.string.smscommunicator_stoppedsms),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_stoppedsms))
|
||||
Action.STOP_SMS, Sources.SMS, rh.gs(R.string.smscommunicator_stopped_sms),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_stopped_sms))
|
||||
)
|
||||
}
|
||||
})
|
||||
|
@ -1157,23 +1157,23 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
val cal = SafeParse.stringToDouble(divided[1])
|
||||
if (cal > 0.0) {
|
||||
val passCode = generatePassCode()
|
||||
val reply = rh.gs(R.string.smscommunicator_calibrationreplywithcode, cal, passCode)
|
||||
val reply = rh.gs(R.string.smscommunicator_calibration_reply_with_code, cal, passCode)
|
||||
receivedSms.processed = true
|
||||
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false, cal) {
|
||||
override fun run() {
|
||||
val result = xDripBroadcast.sendCalibration(aDouble!!)
|
||||
val replyText =
|
||||
if (result) rh.gs(R.string.smscommunicator_calibrationsent) else rh.gs(R.string.smscommunicator_calibrationfailed)
|
||||
if (result) rh.gs(R.string.smscommunicator_calibration_sent) else rh.gs(R.string.smscommunicator_calibration_failed)
|
||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||
if (result)
|
||||
uel.log(
|
||||
Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibrationsent),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibrationsent))
|
||||
Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibration_sent),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibration_sent))
|
||||
)
|
||||
else
|
||||
uel.log(
|
||||
Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibrationfailed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibrationfailed))
|
||||
Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibration_failed),
|
||||
ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibration_failed))
|
||||
)
|
||||
}
|
||||
})
|
||||
|
@ -1210,11 +1210,11 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
messages.add(sms)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
return if (e.message == "Invalid message body") {
|
||||
val notification = Notification(Notification.INVALID_MESSAGE_BODY, rh.gs(R.string.smscommunicator_messagebody), Notification.NORMAL)
|
||||
val notification = Notification(Notification.INVALID_MESSAGE_BODY, rh.gs(R.string.smscommunicator_message_body), Notification.NORMAL)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
false
|
||||
} else {
|
||||
val notification = Notification(Notification.INVALID_PHONE_NUMBER, rh.gs(R.string.smscommunicator_invalidphonennumber), Notification.NORMAL)
|
||||
val notification = Notification(Notification.INVALID_PHONE_NUMBER, rh.gs(R.string.smscommunicator_invalid_phone_number), Notification.NORMAL)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
false
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.virtual
|
||||
package info.nightscout.plugins.pump.virtual
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
|
@ -7,20 +7,20 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.VirtualpumpFragmentBinding
|
||||
import info.nightscout.androidaps.extensions.toStringFull
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.VirtualPumpFragmentBinding
|
||||
import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventExtendedBolusChange
|
||||
import info.nightscout.rx.events.EventTempBasalChange
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
@ -41,14 +41,14 @@ class VirtualPumpFragment : DaggerFragment() {
|
|||
private lateinit var refreshLoop: Runnable
|
||||
private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper)
|
||||
|
||||
private var _binding: VirtualpumpFragmentBinding? = null
|
||||
private var _binding: VirtualPumpFragmentBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
||||
VirtualpumpFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
||||
VirtualPumpFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
||||
|
||||
@Synchronized
|
||||
override fun onResume() {
|
||||
|
@ -90,7 +90,7 @@ class VirtualPumpFragment : DaggerFragment() {
|
|||
private fun updateGui() {
|
||||
if (_binding == null) return
|
||||
val profile = profileFunction.getProfile() ?: return
|
||||
binding.basabasalrate.text = rh.gs(R.string.pump_basebasalrate, virtualPumpPlugin.baseBasalRate)
|
||||
binding.baseBasalRate.text = rh.gs(R.string.pump_basebasalrate, virtualPumpPlugin.baseBasalRate)
|
||||
binding.tempbasal.text = iobCobCalculator.getTempBasal(dateUtil.now())?.toStringFull(profile, dateUtil)
|
||||
?: ""
|
||||
binding.extendedbolus.text = iobCobCalculator.getExtendedBolus(dateUtil.now())?.toStringFull(dateUtil)
|
||||
|
@ -102,7 +102,7 @@ class VirtualPumpFragment : DaggerFragment() {
|
|||
val pumpType = virtualPumpPlugin.pumpType
|
||||
|
||||
binding.type.text = pumpType?.description
|
||||
binding.typeDef.text = pumpType?.getFullDescription(rh.gs(R.string.virtualpump_pump_def), pumpType.hasExtendedBasals(), rh)
|
||||
binding.typeDef.text = pumpType?.getFullDescription(rh.gs(R.string.virtual_pump_pump_def), pumpType.hasExtendedBasals(), rh)
|
||||
binding.serialNumber.text = virtualPumpPlugin.serialNumber()
|
||||
}
|
||||
}
|
|
@ -1,45 +1,46 @@
|
|||
package info.nightscout.androidaps.plugins.pump.virtual
|
||||
package info.nightscout.plugins.pump.virtual
|
||||
|
||||
import android.os.SystemClock
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||
import info.nightscout.interfaces.data.PumpEnactResult
|
||||
import info.nightscout.androidaps.data.PumpEnactResultImpl
|
||||
import info.nightscout.androidaps.dialogs.BolusProgressDialog
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.Pump
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.androidaps.interfaces.PumpPluginBase
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.interfaces.pump.ManufacturerType
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.rx.events.EventOverviewBolusProgress
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.InstanceId
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.interfaces.VirtualPump
|
||||
import info.nightscout.interfaces.data.PumpEnactResult
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.pump.ManufacturerType
|
||||
import info.nightscout.interfaces.utils.TimeChangeType
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventOverviewBolusProgress
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import org.json.JSONException
|
||||
|
@ -68,14 +69,14 @@ open class VirtualPumpPlugin @Inject constructor(
|
|||
.mainType(PluginType.PUMP)
|
||||
.fragmentClass(VirtualPumpFragment::class.java.name)
|
||||
.pluginIcon(R.drawable.ic_virtual_pump)
|
||||
.pluginName(R.string.virtualpump)
|
||||
.shortName(R.string.virtualpump_shortname)
|
||||
.preferencesId(R.xml.pref_virtualpump)
|
||||
.pluginName(R.string.virtual_pump)
|
||||
.shortName(R.string.virtual_pump_shortname)
|
||||
.preferencesId(R.xml.pref_virtual_pump)
|
||||
.description(R.string.description_pump_virtual)
|
||||
.setDefault()
|
||||
.neverVisible(config.NSCLIENT),
|
||||
injector, aapsLogger, rh, commandQueue
|
||||
), Pump {
|
||||
), Pump, VirtualPump {
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
var batteryPercent = 50
|
||||
|
@ -123,14 +124,14 @@ open class VirtualPumpPlugin @Inject constructor(
|
|||
|
||||
override fun preprocessPreferences(preferenceFragment: PreferenceFragmentCompat) {
|
||||
super.preprocessPreferences(preferenceFragment)
|
||||
val uploadStatus = preferenceFragment.findPreference(rh.gs(R.string.key_virtualpump_uploadstatus)) as SwitchPreference?
|
||||
val uploadStatus = preferenceFragment.findPreference(rh.gs(R.string.key_virtual_pump_upload_status)) as SwitchPreference?
|
||||
?: return
|
||||
uploadStatus.isVisible = !config.NSCLIENT
|
||||
}
|
||||
|
||||
override val isFakingTempsByExtendedBoluses: Boolean
|
||||
get() = config.NSCLIENT && fakeDataDetected
|
||||
var fakeDataDetected = false
|
||||
override var fakeDataDetected = false
|
||||
|
||||
override fun loadTDDs(): PumpEnactResult { //no result, could read DB in the future?
|
||||
return PumpEnactResultImpl(injector)
|
||||
|
@ -340,7 +341,7 @@ open class VirtualPumpPlugin @Inject constructor(
|
|||
|
||||
override fun getJSONStatus(profile: Profile, profileName: String, version: String): JSONObject {
|
||||
val now = System.currentTimeMillis()
|
||||
if (!sp.getBoolean(R.string.key_virtualpump_uploadstatus, false)) {
|
||||
if (!sp.getBoolean(R.string.key_virtual_pump_upload_status, false)) {
|
||||
return JSONObject()
|
||||
}
|
||||
val pump = JSONObject()
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.virtual.events
|
||||
package info.nightscout.plugins.pump.virtual.events
|
||||
|
||||
import info.nightscout.rx.events.EventUpdateGui
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.source
|
||||
package info.nightscout.plugins.source
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.SparseArray
|
||||
|
@ -14,33 +14,33 @@ import androidx.lifecycle.Lifecycle
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||
import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction
|
||||
import info.nightscout.androidaps.databinding.BgsourceFragmentBinding
|
||||
import info.nightscout.androidaps.databinding.BgsourceItemBinding
|
||||
import info.nightscout.androidaps.events.EventNewBG
|
||||
import info.nightscout.androidaps.extensions.directionToIcon
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.utils.ActionModeHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.SourceFragmentBinding
|
||||
import info.nightscout.plugins.databinding.SourceItemBinding
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -62,13 +62,13 @@ class BGSourceFragment : DaggerFragment(), MenuProvider {
|
|||
private val disposable = CompositeDisposable()
|
||||
private val millsToThePast = T.hours(36).msecs()
|
||||
private lateinit var actionHelper: ActionModeHelper<GlucoseValue>
|
||||
private var _binding: BgsourceFragmentBinding? = null
|
||||
private var _binding: SourceFragmentBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
||||
BgsourceFragmentBinding.inflate(inflater, container, false).also {
|
||||
SourceFragmentBinding.inflate(inflater, container, false).also {
|
||||
_binding = it
|
||||
actionHelper = ActionModeHelper(rh, activity, this)
|
||||
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
|
||||
|
@ -130,7 +130,7 @@ class BGSourceFragment : DaggerFragment(), MenuProvider {
|
|||
inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List<GlucoseValue>) : RecyclerView.Adapter<RecyclerViewAdapter.GlucoseValuesViewHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): GlucoseValuesViewHolder {
|
||||
val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.bgsource_item, viewGroup, false)
|
||||
val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.source_item, viewGroup, false)
|
||||
return GlucoseValuesViewHolder(v)
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ class BGSourceFragment : DaggerFragment(), MenuProvider {
|
|||
|
||||
inner class GlucoseValuesViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
val binding = BgsourceItemBinding.bind(view)
|
||||
val binding = SourceItemBinding.bind(view)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,13 +195,13 @@ class BGSourceFragment : DaggerFragment(), MenuProvider {
|
|||
val source = when ((activePlugin.activeBgSource as PluginBase).pluginDescription.pluginName) {
|
||||
R.string.dexcom_app_patched -> Sources.Dexcom
|
||||
R.string.eversense -> Sources.Eversense
|
||||
R.string.Glimp -> Sources.Glimp
|
||||
R.string.MM640g -> Sources.MM640g
|
||||
R.string.nsclientbg -> Sources.NSClientSource
|
||||
R.string.glimp -> Sources.Glimp
|
||||
R.string.mm640g -> Sources.MM640g
|
||||
R.string.ns_client_bg -> Sources.NSClientSource
|
||||
R.string.poctech -> Sources.PocTech
|
||||
R.string.tomato -> Sources.Tomato
|
||||
R.string.glunovo -> Sources.Glunovo
|
||||
R.string.intelligo -> Sources.Intelligo
|
||||
R.string.intelligo -> Sources.Intelligo
|
||||
R.string.xdrip -> Sources.Xdrip
|
||||
R.string.aidex -> Sources.Aidex
|
||||
else -> Sources.Unknown
|
|
@ -1,34 +1,34 @@
|
|||
package info.nightscout.androidaps.plugins.source
|
||||
package info.nightscout.plugins.source
|
||||
|
||||
import android.content.Context
|
||||
import androidx.work.Worker
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.BgSource
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSgv
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSgv
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sdk.localmodel.entry.NSSgvV3
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
|
@ -45,8 +45,8 @@ class NSClientSourcePlugin @Inject constructor(
|
|||
.mainType(PluginType.BGSOURCE)
|
||||
.fragmentClass(BGSourceFragment::class.java.name)
|
||||
.pluginIcon(R.drawable.ic_nsclient_bg)
|
||||
.pluginName(R.string.nsclientbg)
|
||||
.shortName(R.string.nsclientbgshort)
|
||||
.pluginName(R.string.ns_client_bg)
|
||||
.shortName(R.string.ns_client_bg_short)
|
||||
.description(R.string.description_source_ns_client),
|
||||
aapsLogger, rh, injector
|
||||
), BgSource {
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared
|
||||
package info.nightscout.plugins.sync.nsShared
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
|
@ -13,24 +13,25 @@ import android.widget.ScrollView
|
|||
import androidx.core.view.MenuProvider
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.entities.UserEntry
|
||||
import info.nightscout.androidaps.databinding.NsClientFragmentBinding
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginFragment
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.NsClientFragmentBinding
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventNSClientRestart
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
@ -47,6 +48,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment {
|
|||
@Inject lateinit var uel: UserEntryLogger
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
@Inject lateinit var activePlugin: ActivePlugin
|
||||
@Inject lateinit var buildHelper: BuildHelper
|
||||
|
||||
companion object {
|
||||
|
||||
|
@ -80,13 +82,13 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment {
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.autoscroll.isChecked = sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true)
|
||||
binding.autoscroll.isChecked = sp.getBoolean(R.string.key_ns_client_autoscroll, true)
|
||||
binding.autoscroll.setOnCheckedChangeListener { _, isChecked ->
|
||||
sp.putBoolean(R.string.key_nsclientinternal_autoscroll, isChecked)
|
||||
sp.putBoolean(R.string.key_ns_client_autoscroll, isChecked)
|
||||
updateGui()
|
||||
}
|
||||
|
||||
binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false)
|
||||
binding.paused.isChecked = sp.getBoolean(R.string.key_ns_client_paused, false)
|
||||
binding.paused.setOnCheckedChangeListener { _, isChecked ->
|
||||
uel.log(if (isChecked) UserEntry.Action.NS_PAUSED else UserEntry.Action.NS_RESUME, UserEntry.Sources.NSClient)
|
||||
nsClientPlugin?.pause(isChecked)
|
||||
|
@ -95,8 +97,9 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment {
|
|||
}
|
||||
|
||||
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
|
||||
menu.add(Menu.FIRST, ID_MENU_TEST, 0, "Test").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clearlog)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
if (buildHelper.isUnfinishedMode())
|
||||
menu.add(Menu.FIRST, ID_MENU_TEST, 0, "Test").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clear_log)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
menu.add(Menu.FIRST, ID_MENU_RESTART, 0, rh.gs(R.string.restart)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
menu.add(Menu.FIRST, ID_MENU_SEND_NOW, 0, rh.gs(R.string.deliver_now)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
menu.add(Menu.FIRST, ID_MENU_FULL_SYNC, 0, rh.gs(R.string.full_sync)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
|
||||
|
@ -123,7 +126,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment {
|
|||
ID_MENU_FULL_SYNC -> {
|
||||
context?.let { context ->
|
||||
OKDialog.showConfirmation(
|
||||
context, rh.gs(R.string.nsclientinternal), rh.gs(R.string.full_sync_comment),
|
||||
context, rh.gs(R.string.ns_client), rh.gs(R.string.full_sync_comment),
|
||||
Runnable { nsClientPlugin?.resetToFullSync() }
|
||||
)
|
||||
}
|
||||
|
@ -154,9 +157,9 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment {
|
|||
|
||||
private fun updateGui() {
|
||||
if (_binding == null) return
|
||||
binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false)
|
||||
binding.paused.isChecked = sp.getBoolean(R.string.key_ns_client_paused, false)
|
||||
binding.log.text = nsClientPlugin?.textLog()
|
||||
if (sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true)) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN)
|
||||
if (sp.getBoolean(R.string.key_ns_client_autoscroll, true)) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN)
|
||||
binding.url.text = nsClientPlugin?.address
|
||||
binding.status.text = nsClientPlugin?.status
|
||||
val size = dataSyncSelector.queueSize()
|
|
@ -1,11 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared
|
||||
package info.nightscout.plugins.sync.nsShared
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
import androidx.work.Worker
|
||||
import androidx.work.WorkerParameters
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.Bolus
|
||||
import info.nightscout.androidaps.database.entities.BolusCalculatorResult
|
||||
|
@ -37,13 +36,13 @@ import info.nightscout.androidaps.interfaces.NsClient
|
|||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
@ -58,6 +57,7 @@ import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal
|
|||
import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget
|
||||
import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared.events
|
||||
package info.nightscout.plugins.sync.nsShared.events
|
||||
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.rx.events.Event
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared.events
|
||||
package info.nightscout.plugins.sync.nsShared.events
|
||||
|
||||
import info.nightscout.rx.events.Event
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared.events
|
||||
package info.nightscout.plugins.sync.nsShared.events
|
||||
|
||||
import info.nightscout.androidaps.events.EventStatus
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsShared.events
|
||||
package info.nightscout.plugins.sync.nsShared.events
|
||||
|
||||
import info.nightscout.rx.events.EventUpdateGui
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient
|
||||
package info.nightscout.plugins.sync.nsclient
|
||||
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.ValueWrapper
|
||||
import info.nightscout.androidaps.database.entities.Bolus
|
||||
|
@ -20,13 +19,14 @@ import info.nightscout.androidaps.extensions.toJson
|
|||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.toJson
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.extensions.toJson
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.toJson
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient
|
||||
package info.nightscout.plugins.sync.nsclient
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
|
@ -12,21 +12,11 @@ import androidx.preference.PreferenceFragmentCompat
|
|||
import androidx.preference.PreferenceScreen
|
||||
import androidx.preference.SwitchPreference
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.interfaces.Sync
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.NSClientFragment
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientResend
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.AlarmAck
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.services.NSClientService
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
|
@ -35,6 +25,15 @@ import info.nightscout.interfaces.Constants
|
|||
import info.nightscout.interfaces.PluginDescription
|
||||
import info.nightscout.interfaces.PluginType
|
||||
import info.nightscout.interfaces.utils.HtmlHelper.fromHtml
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsShared.NSClientFragment
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientResend
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.plugins.sync.nsclient.data.AlarmAck
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.plugins.sync.nsclient.services.NSClientService
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAppExit
|
||||
|
@ -42,6 +41,7 @@ import info.nightscout.rx.events.EventChargingState
|
|||
import info.nightscout.rx.events.EventNetworkChange
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
@ -67,9 +67,9 @@ class NSClientPlugin @Inject constructor(
|
|||
.mainType(PluginType.SYNC)
|
||||
.fragmentClass(NSClientFragment::class.java.name)
|
||||
.pluginIcon(R.drawable.ic_nightscout_syncs)
|
||||
.pluginName(R.string.nsclientinternal)
|
||||
.shortName(R.string.nsclientinternal_shortname)
|
||||
.preferencesId(R.xml.pref_nsclientinternal)
|
||||
.pluginName(R.string.ns_client)
|
||||
.shortName(R.string.ns_client_short_name)
|
||||
.preferencesId(R.xml.pref_ns_client)
|
||||
.description(R.string.description_ns_client),
|
||||
aapsLogger, rh, injector
|
||||
) {
|
||||
|
@ -196,8 +196,8 @@ class NSClientPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
override fun pause(newState: Boolean) {
|
||||
sp.putBoolean(R.string.key_nsclientinternal_paused, newState)
|
||||
rxBus.send(EventPreferenceChange(rh, R.string.key_nsclientinternal_paused))
|
||||
sp.putBoolean(R.string.key_ns_client_paused, newState)
|
||||
rxBus.send(EventPreferenceChange(rh, R.string.key_ns_client_paused))
|
||||
}
|
||||
|
||||
override val version: NsClient.Version
|
|
@ -1,12 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient
|
||||
package info.nightscout.plugins.sync.nsclient
|
||||
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventChargingState
|
||||
import info.nightscout.rx.events.EventNetworkChange
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -67,7 +67,7 @@ class NsClientReceiverDelegate @Inject constructor(
|
|||
val newAllowedState = allowedChargingState && allowedNetworkState
|
||||
if (newAllowedState != allowed) {
|
||||
allowed = newAllowedState
|
||||
rxBus.send(EventPreferenceChange(rh.gs(R.string.key_nsclientinternal_paused)))
|
||||
rxBus.send(EventPreferenceChange(rh.gs(R.string.key_ns_client_paused)))
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.acks
|
||||
package info.nightscout.plugins.sync.nsclient.acks
|
||||
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.acks
|
||||
package info.nightscout.plugins.sync.nsclient.acks
|
||||
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.acks
|
||||
package info.nightscout.plugins.sync.nsclient.acks
|
||||
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.Event
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data;
|
||||
package info.nightscout.plugins.sync.nsclient.data;
|
||||
|
||||
/**
|
||||
* Created by mike on 11.06.2017.
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import org.json.JSONObject
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.utils.HtmlHelper
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.sdk.remotemodel.RemoteDeviceStatus
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -82,7 +82,7 @@ class NSDeviceStatusHandler @Inject constructor(
|
|||
updateDeviceData(nsDeviceStatus)
|
||||
updateOpenApsData(nsDeviceStatus)
|
||||
updateUploaderData(nsDeviceStatus)
|
||||
nsDeviceStatus.pump?.let { sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true) } // Objective 0
|
||||
nsDeviceStatus.pump?.let { sp.putBoolean(R.string.key_objectives_pump_status_is_available_in_ns, true) } // Objective 0
|
||||
if (config.NSCLIENT && !configurationDetected)
|
||||
nsDeviceStatus.configuration?.let {
|
||||
// copy configuration of Insulin and Sensitivity from main AAPS
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import org.json.JSONObject
|
|
@ -1,22 +1,22 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import android.content.Context
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.database.entities.UserEntry
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
|
@ -149,7 +149,7 @@ class NSSettingsStatus @Inject constructor(
|
|||
data = status
|
||||
aapsLogger.debug(LTag.NSCLIENT, "Got versions: Nightscout: ${getVersion()}")
|
||||
if (getVersionNum() < config.SUPPORTEDNSVERSION) {
|
||||
val notification = Notification(Notification.OLD_NS, rh.gs(R.string.unsupportednsversion), Notification.NORMAL)
|
||||
val notification = Notification(Notification.OLD_NS, rh.gs(R.string.unsupported_ns_version), Notification.NORMAL)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.OLD_NS))
|
||||
|
@ -246,7 +246,7 @@ class NSSettingsStatus @Inject constructor(
|
|||
uel.log(Action.NS_SETTINGS_COPIED, UserEntry.Sources.NSClient)
|
||||
}
|
||||
|
||||
if (context != null) OKDialog.showConfirmation(context, rh.gs(R.string.statuslights), rh.gs(R.string.copyexistingvalues), action)
|
||||
if (context != null) OKDialog.showConfirmation(context, rh.gs(R.string.statuslights), rh.gs(R.string.copy_existing_values), action)
|
||||
else action.run()
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import org.json.JSONObject
|
|
@ -1,16 +1,16 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.data
|
||||
package info.nightscout.plugins.sync.nsclient.data
|
||||
|
||||
import android.text.Spanned
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.aps.loop.APSResult
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.utils.HtmlHelper
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.interfaces.utils.Round
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -145,9 +145,9 @@ class ProcessedDeviceStatusData @Inject constructor(
|
|||
|
||||
// test warning level
|
||||
val level = when {
|
||||
openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_urgent_staledatavalue, 31)).msecs() < dateUtil.now() -> Levels.URGENT
|
||||
openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_staledatavalue, 16)).msecs() < dateUtil.now() -> Levels.WARN
|
||||
else -> Levels.INFO
|
||||
openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_ns_alarm_urgent_stale_data_value, 31)).msecs() < dateUtil.now() -> Levels.URGENT
|
||||
openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_ns_alarm_stale_data_value, 16)).msecs() < dateUtil.now() -> Levels.WARN
|
||||
else -> Levels.INFO
|
||||
}
|
||||
string.append("<span style=\"color:${level.toColor()}\">")
|
||||
if (openAPSData.clockSuggested != 0L) string.append(dateUtil.minAgo(rh, openAPSData.clockSuggested)).append(" ")
|
|
@ -6,8 +6,8 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.Pump
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.plugins.configBuilder.RunningConfiguration
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.json.JSONObject
|
||||
|
|
@ -3,11 +3,12 @@ package info.nightscout.plugins.sync.nsclient.extensions
|
|||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||
import info.nightscout.androidaps.interfaces.GlucoseUnit
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSMbg
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import org.json.JSONObject
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
@ -26,10 +27,13 @@ fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit =
|
|||
if (this == TherapyEvent.GlucoseUnit.MGDL) GlucoseUnit.MGDL
|
||||
else GlucoseUnit.MMOL
|
||||
|
||||
/*
|
||||
create fake object with nsID and isValid == false
|
||||
*/
|
||||
|
||||
fun therapyEventFromNsMbg(mbg: NSMbg) =
|
||||
TherapyEvent(
|
||||
type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, //convert Mbg to finger stick because is coming from "entries" collection
|
||||
timestamp = mbg.date,
|
||||
glucose = mbg.mbg,
|
||||
glucoseUnit = TherapyEvent.GlucoseUnit.MGDL
|
||||
)
|
||||
fun therapyEventFromJson(jsonObject: JSONObject): TherapyEvent? {
|
||||
val glucoseUnit = if (JsonHelper.safeGetString(jsonObject, "units", Constants.MGDL) == Constants.MGDL) TherapyEvent.GlucoseUnit.MGDL else TherapyEvent.GlucoseUnit.MMOL
|
||||
val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient.services
|
||||
package info.nightscout.plugins.sync.nsclient.services
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
|
@ -16,44 +16,41 @@ import com.google.gson.GsonBuilder
|
|||
import com.google.gson.JsonDeserializer
|
||||
import dagger.android.DaggerService
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddAckWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddUpdateWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientMbgWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.NSClientUpdateRemoveAckWorker
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAddAck
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAuthAck
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSUpdateAck
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.AlarmAck
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSDeviceStatusHandler
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T.Companion.mins
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.utils.JsonHelper.safeGetString
|
||||
import info.nightscout.interfaces.utils.JsonHelper.safeGetStringAllowNull
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.general.food.FoodPlugin
|
||||
import info.nightscout.plugins.general.overview.notifications.NotificationWithAction
|
||||
import info.nightscout.plugins.profile.ProfilePlugin
|
||||
import info.nightscout.plugins.source.NSClientSourcePlugin
|
||||
import info.nightscout.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
|
||||
import info.nightscout.plugins.sync.nsclient.NSClientPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.acks.NSAddAck
|
||||
import info.nightscout.plugins.sync.nsclient.acks.NSAuthAck
|
||||
import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck
|
||||
import info.nightscout.plugins.sync.nsclient.data.AlarmAck
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSAlarm
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker
|
||||
import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker
|
||||
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAppExit
|
||||
|
@ -62,7 +59,10 @@ import info.nightscout.rx.events.EventNSClientRestart
|
|||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.sdk.remotemodel.RemoteDeviceStatus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T.Companion.mins
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import io.socket.client.IO
|
||||
|
@ -144,7 +144,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
.subscribe({ event: EventPreferenceChange ->
|
||||
if (event.isChanged(rh, R.string.key_nsclientinternal_url) ||
|
||||
event.isChanged(rh, R.string.key_nsclientinternal_api_secret) ||
|
||||
event.isChanged(rh, R.string.key_nsclientinternal_paused)
|
||||
event.isChanged(rh, R.string.key_ns_client_paused)
|
||||
) {
|
||||
latestDateInReceivedData = 0
|
||||
destroy()
|
||||
|
@ -221,7 +221,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
rxBus.send(EventNSClientNewLog("ERROR", "Write treatment permission not granted ", NsClient.Version.V1))
|
||||
}
|
||||
if (!hasWriteAuth) {
|
||||
val noWritePerm = Notification(Notification.NSCLIENT_NO_WRITE_PERMISSION, rh.gs(R.string.nowritepermission), Notification.URGENT)
|
||||
val noWritePerm = Notification(Notification.NSCLIENT_NO_WRITE_PERMISSION, rh.gs(R.string.no_write_permission), Notification.URGENT)
|
||||
rxBus.send(EventNewNotification(noWritePerm))
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.NSCLIENT_NO_WRITE_PERMISSION))
|
||||
|
@ -238,7 +238,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
|
||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int = START_STICKY
|
||||
|
||||
fun initialize() {
|
||||
private fun initialize() {
|
||||
dataCounter = 0
|
||||
readPreferences()
|
||||
@Suppress("DEPRECATION")
|
||||
|
@ -247,7 +247,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
if (!nsClientPlugin.isAllowed) {
|
||||
rxBus.send(EventNSClientNewLog("NSCLIENT", nsClientPlugin.blockingReason, NsClient.Version.V1))
|
||||
rxBus.send(EventNSClientStatus(nsClientPlugin.blockingReason, NsClient.Version.V1))
|
||||
} else if (sp.getBoolean(R.string.key_nsclientinternal_paused, false)) {
|
||||
} else if (sp.getBoolean(R.string.key_ns_client_paused, false)) {
|
||||
rxBus.send(EventNSClientNewLog("NSCLIENT", "paused", NsClient.Version.V1))
|
||||
rxBus.send(EventNSClientStatus("Paused", NsClient.Version.V1))
|
||||
} else if (!nsEnabled) {
|
||||
|
@ -309,7 +309,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
}
|
||||
rxBus.send(EventNSClientNewLog("WATCHDOG", "connections in last " + WATCHDOG_INTERVAL_MINUTES + " minutes: " + reconnections.size + "/" + WATCHDOG_MAX_CONNECTIONS, NsClient.Version.V1))
|
||||
if (reconnections.size >= WATCHDOG_MAX_CONNECTIONS) {
|
||||
val n = Notification(Notification.NS_MALFUNCTION, rh.gs(R.string.nsmalfunction), Notification.URGENT)
|
||||
val n = Notification(Notification.NS_MALFUNCTION, rh.gs(R.string.ns_malfunction), Notification.URGENT)
|
||||
rxBus.send(EventNewNotification(n))
|
||||
rxBus.send(EventNSClientNewLog("WATCHDOG", "pausing for $WATCHDOG_RECONNECT_IN minutes", NsClient.Version.V1))
|
||||
nsClientPlugin.pause(true)
|
||||
|
@ -544,7 +544,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
if (sgvs.length() > 0) {
|
||||
rxBus.send(EventNSClientNewLog("DATA", "received " + sgvs.length() + " sgvs", NsClient.Version.V1))
|
||||
// Objective0
|
||||
sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true)
|
||||
sp.putBoolean(R.string.key_objectives_bg_is_available_in_ns, true)
|
||||
dataWorkerStorage
|
||||
.beginUniqueWork(
|
||||
NSClientV3Plugin.JOB_NAME,
|
||||
|
@ -646,7 +646,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
private fun handleAlarm(alarm: JSONObject) {
|
||||
val defaultVal = config.NSCLIENT
|
||||
if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) {
|
||||
val snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L)
|
||||
val snoozedTo = sp.getLong(R.string.key_snoozed_to, 0L)
|
||||
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
|
||||
val nsAlarm = NSAlarm(alarm)
|
||||
val notification: Notification = NotificationWithAction(injector, nsAlarm)
|
||||
|
@ -660,7 +660,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService {
|
|||
private fun handleUrgentAlarm(alarm: JSONObject) {
|
||||
val defaultVal = config.NSCLIENT
|
||||
if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) {
|
||||
val snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L)
|
||||
val snoozedTo = sp.getLong(R.string.key_snoozed_to, 0L)
|
||||
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
|
||||
val nsAlarm = NSAlarm(alarm)
|
||||
val notification: Notification = NotificationWithAction(injector, nsAlarm)
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient
|
||||
package info.nightscout.plugins.sync.nsclient.workers
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
|
@ -6,7 +6,6 @@ import androidx.work.Worker
|
|||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.DeviceStatus
|
||||
import info.nightscout.androidaps.database.transactions.UpdateNsIdBolusCalculatorResultTransaction
|
||||
|
@ -37,9 +36,10 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryBasal
|
|||
import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarget
|
||||
import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent
|
||||
import info.nightscout.androidaps.interfaces.NsClient
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAddAck
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog
|
||||
import info.nightscout.plugins.sync.nsclient.acks.NSAddAck
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
|
@ -1,24 +1,23 @@
|
|||
package info.nightscout.androidaps.plugins.sync.nsclient
|
||||
package info.nightscout.plugins.sync.nsclient.workers
|
||||
|
||||
import android.content.Context
|
||||
import androidx.work.Worker
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||
import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.XDripBroadcast
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.androidaps.receivers.DataWorkerStorage
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.VirtualPump
|
||||
import info.nightscout.interfaces.utils.JsonHelper
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsShared.StoreDataForDb
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.bolusFromJson
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.carbsFromJson
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.effectiveProfileSwitchFromJson
|
||||
|
@ -33,6 +32,7 @@ import info.nightscout.rx.bus.RxBus
|
|||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import javax.inject.Inject
|
||||
|
||||
class NSClientAddUpdateWorker(
|
||||
|
@ -50,7 +50,6 @@ class NSClientAddUpdateWorker(
|
|||
@Inject lateinit var activePlugin: ActivePlugin
|
||||
@Inject lateinit var rxBus: RxBus
|
||||
@Inject lateinit var uel: UserEntryLogger
|
||||
@Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin
|
||||
@Inject lateinit var xDripBroadcast: XDripBroadcast
|
||||
@Inject lateinit var storeDataForDb: StoreDataForDb
|
||||
|
||||
|
@ -100,7 +99,8 @@ class NSClientAddUpdateWorker(
|
|||
ebJson.put("mills", mills)
|
||||
json = ebJson
|
||||
eventType = JsonHelper.safeGetString(json, "eventType")
|
||||
virtualPumpPlugin.fakeDataDetected = true
|
||||
|
||||
activePlugin.activePump.let { if (it is VirtualPump) it.fakeDataDetected = true }
|
||||
}
|
||||
when {
|
||||
insulin > 0 || carbs > 0 -> Any()
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue